mirror of
https://github.com/penpot/penpot.git
synced 2026-05-28 03:13:40 +00:00
💄 Fix typos in comments and docstrings (#9362)
This commit is contained in:
parent
5fd758597e
commit
2fc4f35cde
@ -315,8 +315,8 @@
|
|||||||
(defn get-file
|
(defn get-file
|
||||||
"Get file, resolve all features and apply migrations.
|
"Get file, resolve all features and apply migrations.
|
||||||
|
|
||||||
Usefull when you have plan to apply massive or not cirurgical
|
Useful when you have plan to apply massive or not surgical
|
||||||
operations on file, because it removes the ovehead of lazy fetching
|
operations on file, because it removes the overhead of lazy fetching
|
||||||
and decoding."
|
and decoding."
|
||||||
[cfg file-id & {:as opts}]
|
[cfg file-id & {:as opts}]
|
||||||
(db/run! cfg get-file* file-id opts))
|
(db/run! cfg get-file* file-id opts))
|
||||||
|
|||||||
@ -280,7 +280,7 @@
|
|||||||
(sm/explainer schema:config))
|
(sm/explainer schema:config))
|
||||||
|
|
||||||
(defn read-config
|
(defn read-config
|
||||||
"Reads the configuration from enviroment variables and decodes all
|
"Reads the configuration from environment variables and decodes all
|
||||||
known values."
|
known values."
|
||||||
[& {:keys [prefix default] :or {prefix "penpot"}}]
|
[& {:keys [prefix default] :or {prefix "penpot"}}]
|
||||||
(->> (read-env prefix)
|
(->> (read-env prefix)
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
(defn- write!
|
(defn- write!
|
||||||
[^OutputStream output ^bytes data]
|
[^OutputStream output ^bytes data]
|
||||||
(l/trc :hint "writting data" :data data :length (alength data))
|
(l/trc :hint "writing data" :data data :length (alength data))
|
||||||
(.write output data)
|
(.write output data)
|
||||||
(.flush output))
|
(.flush output))
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
of the object. This function can be applied to the object returned by the
|
of the object. This function can be applied to the object returned by the
|
||||||
`get-object` but also to the RPC return value (in case you don't provide
|
`get-object` but also to the RPC return value (in case you don't provide
|
||||||
the return value calculated key under `::key` metadata prop.
|
the return value calculated key under `::key` metadata prop.
|
||||||
- `::reuse-key?` enables reusing the key calculated on first time; usefull
|
- `::reuse-key?` enables reusing the key calculated on first time; useful
|
||||||
when the target object is not retrieved on the RPC (typical on retrieving
|
when the target object is not retrieved on the RPC (typical on retrieving
|
||||||
dependent objects).
|
dependent objects).
|
||||||
"
|
"
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
(defn- generate-index
|
(defn- generate-index
|
||||||
"An optimized algorithm for calculate parents index that walk from top
|
"An optimized algorithm for calculate parents index that walk from top
|
||||||
to down starting from a provided shape-id. Usefull when you want to
|
to down starting from a provided shape-id. Useful when you want to
|
||||||
create an index for the whole objects or subpart of the tree."
|
create an index for the whole objects or subpart of the tree."
|
||||||
[index objects shape-id parents]
|
[index objects shape-id parents]
|
||||||
(let [shape (get objects shape-id)
|
(let [shape (get objects shape-id)
|
||||||
|
|||||||
@ -543,7 +543,7 @@
|
|||||||
(update :svg-attrs dissoc :fill)
|
(update :svg-attrs dissoc :fill)
|
||||||
(assoc-in [:fills 0 :fill-color] (clr/parse color-style)))
|
(assoc-in [:fills 0 :fill-color] (clr/parse color-style)))
|
||||||
|
|
||||||
;; Only create an opacity if the color is setted. Othewise can create problems down the line
|
;; Only create an opacity if the color is set. Otherwise can create problems down the line
|
||||||
(and (or (clr/color-string? color-attr) (clr/color-string? color-style))
|
(and (or (clr/color-string? color-attr) (clr/color-string? color-style))
|
||||||
(dm/get-in shape [:svg-attrs :fillOpacity]))
|
(dm/get-in shape [:svg-attrs :fillOpacity]))
|
||||||
(-> (update :svg-attrs dissoc :fillOpacity)
|
(-> (update :svg-attrs dissoc :fillOpacity)
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
[app.common.geom.shapes.points :as gpo]
|
[app.common.geom.shapes.points :as gpo]
|
||||||
[app.common.types.shape.layout :as ctl]))
|
[app.common.types.shape.layout :as ctl]))
|
||||||
|
|
||||||
;; Setted in app.common.geom.shapes.common-layout
|
;; Set in app.common.geom.shapes.common-layout
|
||||||
;; We do it this way because circular dependencies
|
;; We do it this way because circular dependencies
|
||||||
(def -child-min-width nil)
|
(def -child-min-width nil)
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
(def conjv (fnil conj []))
|
(def conjv (fnil conj []))
|
||||||
|
|
||||||
;; Setted in app.common.geom.shapes.min-size-layout
|
;; Set in app.common.geom.shapes.min-size-layout
|
||||||
;; We do it this way because circular dependencies
|
;; We do it this way because circular dependencies
|
||||||
(def -child-min-width nil)
|
(def -child-min-width nil)
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
;;
|
;;
|
||||||
;; 5. If any track still has an infinite growth limit set its growth limit to its base size.
|
;; 5. If any track still has an infinite growth limit set its growth limit to its base size.
|
||||||
|
|
||||||
;; - Distribute extra space accross spaned tracks
|
;; - Distribute extra space across spanned tracks
|
||||||
;; - Maximize tracks
|
;; - Maximize tracks
|
||||||
;;
|
;;
|
||||||
;; - Expand flexible tracks
|
;; - Expand flexible tracks
|
||||||
@ -55,7 +55,7 @@
|
|||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
[app.common.types.shape.layout :as ctl]))
|
[app.common.types.shape.layout :as ctl]))
|
||||||
|
|
||||||
;; Setted in app.common.geom.shapes.common-layout
|
;; Set in app.common.geom.shapes.common-layout
|
||||||
;; We do it this way because circular dependencies
|
;; We do it this way because circular dependencies
|
||||||
(def -child-min-width nil)
|
(def -child-min-width nil)
|
||||||
|
|
||||||
@ -449,7 +449,7 @@
|
|||||||
column-tracks (set-auto-base-size column-tracks children shape-cells bounds objects :column)
|
column-tracks (set-auto-base-size column-tracks children shape-cells bounds objects :column)
|
||||||
row-tracks (set-auto-base-size row-tracks children shape-cells bounds objects :row)
|
row-tracks (set-auto-base-size row-tracks children shape-cells bounds objects :row)
|
||||||
|
|
||||||
;; Adjust multi-spaned cells with no flex columns
|
;; Adjust multi-spanned cells with no flex columns
|
||||||
column-tracks (set-auto-multi-span parent column-tracks children-map shape-cells bounds objects :column)
|
column-tracks (set-auto-multi-span parent column-tracks children-map shape-cells bounds objects :column)
|
||||||
row-tracks (set-auto-multi-span parent row-tracks children-map shape-cells bounds objects :row)
|
row-tracks (set-auto-multi-span parent row-tracks children-map shape-cells bounds objects :row)
|
||||||
|
|
||||||
|
|||||||
@ -1840,7 +1840,7 @@
|
|||||||
|
|
||||||
;; On texts, when we want to omit the touched attrs, both text (the actual letters)
|
;; On texts, when we want to omit the touched attrs, both text (the actual letters)
|
||||||
;; and attrs (bold, font, etc) are in the same attr :content.
|
;; and attrs (bold, font, etc) are in the same attr :content.
|
||||||
;; If only one of them is touched, we want to adress this case and
|
;; If only one of them is touched, we want to address this case and
|
||||||
;; only update the untouched one
|
;; only update the untouched one
|
||||||
text-content-change?
|
text-content-change?
|
||||||
(and omit-touched?
|
(and omit-touched?
|
||||||
@ -2163,7 +2163,7 @@
|
|||||||
|
|
||||||
;; On texts, both text (the actual letters)
|
;; On texts, both text (the actual letters)
|
||||||
;; and attrs (bold, font, etc) are in the same attr :content.
|
;; and attrs (bold, font, etc) are in the same attr :content.
|
||||||
;; If only one of them is touched, we want to adress this case and
|
;; If only one of them is touched, we want to address this case and
|
||||||
;; only update the untouched one
|
;; only update the untouched one
|
||||||
text-change?
|
text-change?
|
||||||
(and (not skip-operations?)
|
(and (not skip-operations?)
|
||||||
|
|||||||
@ -259,7 +259,7 @@
|
|||||||
(some? (find-component-main objects shape only-direct-child?))))
|
(some? (find-component-main objects shape only-direct-child?))))
|
||||||
|
|
||||||
(defn in-any-component?
|
(defn in-any-component?
|
||||||
"Check if the shape is part of any component (main or copy), wether it's
|
"Check if the shape is part of any component (main or copy), whether it's
|
||||||
head or not."
|
head or not."
|
||||||
[objects shape]
|
[objects shape]
|
||||||
(or (ctk/in-component-copy? shape)
|
(or (ctk/in-component-copy? shape)
|
||||||
|
|||||||
@ -1074,7 +1074,7 @@
|
|||||||
(maybe-remove?)))))
|
(maybe-remove?)))))
|
||||||
|
|
||||||
(defn check-deassigned-cells
|
(defn check-deassigned-cells
|
||||||
"Clean the cells whith shapes that are no longer in the layout"
|
"Clean the cells with shapes that are no longer in the layout"
|
||||||
[parent objects]
|
[parent objects]
|
||||||
|
|
||||||
(let [child-set (set (:shapes parent))
|
(let [child-set (set (:shapes parent))
|
||||||
|
|||||||
@ -110,10 +110,10 @@
|
|||||||
|
|
||||||
(defn ^:export init
|
(defn ^:export init
|
||||||
[options]
|
[options]
|
||||||
;; WORKAROUND: we set this really not usefull property for signal a
|
;; WORKAROUND: we set this really not useful property for signal a
|
||||||
;; sideffect and prevent GCC remove it. We need it because we need
|
;; side effect and prevent GCC remove it. We need it because we need
|
||||||
;; to populate the Date prototype with transit related properties
|
;; to populate the Date prototype with transit related properties
|
||||||
;; before SES hardning is applied on loading MCP plugin
|
;; before SES hardening is applied on loading MCP plugin
|
||||||
(unchecked-set js/globalThis "penpotStartDate"
|
(unchecked-set js/globalThis "penpotStartDate"
|
||||||
(-> (ct/now)
|
(-> (ct/now)
|
||||||
(t/encode-str)
|
(t/encode-str)
|
||||||
|
|||||||
@ -359,7 +359,7 @@
|
|||||||
(rx/of (du/fetch-access-tokens))))
|
(rx/of (du/fetch-access-tokens))))
|
||||||
|
|
||||||
;; Once the essential data is fetched, lets proceed to
|
;; Once the essential data is fetched, lets proceed to
|
||||||
;; fetch teh file bunldle
|
;; fetch the file bundle
|
||||||
(rx/of (initialize-file team-id file-id)))
|
(rx/of (initialize-file team-id file-id)))
|
||||||
|
|
||||||
(->> stream
|
(->> stream
|
||||||
|
|||||||
@ -696,7 +696,7 @@
|
|||||||
(let [page-id (:current-page-id state)
|
(let [page-id (:current-page-id state)
|
||||||
file-id (:current-file-id state)
|
file-id (:current-file-id state)
|
||||||
|
|
||||||
;; FIXME: revisit, innefficient access
|
;; FIXME: revisit, inefficient access
|
||||||
objects (dsh/lookup-page-objects state page-id)
|
objects (dsh/lookup-page-objects state page-id)
|
||||||
|
|
||||||
libraries (dsh/lookup-libraries state)
|
libraries (dsh/lookup-libraries state)
|
||||||
|
|||||||
@ -731,7 +731,7 @@
|
|||||||
|
|
||||||
(defn apply-spacing-token-separated
|
(defn apply-spacing-token-separated
|
||||||
"Handles edge-case for spacing token when applying token via toggle button.
|
"Handles edge-case for spacing token when applying token via toggle button.
|
||||||
Splits out `shape-ids` into seperate default actions:
|
Splits out `shape-ids` into separate default actions:
|
||||||
- Layouts take the `default` update function
|
- Layouts take the `default` update function
|
||||||
- Shapes inside layout will only take margin"
|
- Shapes inside layout will only take margin"
|
||||||
[{:keys [token shapes attr]}]
|
[{:keys [token shapes attr]}]
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
(def sidebar
|
(def sidebar
|
||||||
"A context that intends to store the current sidebar position,
|
"A context that intends to store the current sidebar position,
|
||||||
usefull for components that behaves distinctly if they are showed in
|
useful for components that behaves distinctly if they are showed in
|
||||||
right sidebar or left sidebar.
|
right sidebar or left sidebar.
|
||||||
|
|
||||||
Possible values: `:right:` and `:left`."
|
Possible values: `:right:` and `:left`."
|
||||||
|
|||||||
@ -137,7 +137,7 @@
|
|||||||
(if (or (mth/close? 0.01 (:width selrect))
|
(if (or (mth/close? 0.01 (:width selrect))
|
||||||
(mth/close? 0.01 (:height selrect)))
|
(mth/close? 0.01 (:height selrect)))
|
||||||
|
|
||||||
;; We cannot use "objectBoundingbox" if the shape doesn't have width/heigth
|
;; We cannot use "objectBoundingbox" if the shape doesn't have width/height
|
||||||
;; From the SVG spec (https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBox
|
;; From the SVG spec (https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBox
|
||||||
;; Keyword objectBoundingBox should not be used when the geometry of the applicable element
|
;; Keyword objectBoundingBox should not be used when the geometry of the applicable element
|
||||||
;; has no width or no height, such as the case of a horizontal or vertical line, even when
|
;; has no width or no height, such as the case of a horizontal or vertical line, even when
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user