0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

🐛 Fixes some problems with texts not displaying correctly

This commit is contained in:
alonso.torres 2020-05-20 11:47:08 +02:00
parent fd18a6a6d0
commit bcd755c9e4
2 changed files with 67 additions and 50 deletions

View file

@ -962,7 +962,7 @@
} }
}, },
"workspace.options.fill" : { "workspace.options.fill" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:446", "src/uxbox/main/ui/workspace/sidebar/options/fill.cljs:71" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/fill.cljs:41", "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:383" ],
"translations" : { "translations" : {
"en" : "Fill", "en" : "Fill",
"fr" : "Fond" "fr" : "Fond"
@ -976,116 +976,116 @@
"unused" : true "unused" : true
}, },
"workspace.options.font-options" : { "workspace.options.font-options" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:452" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:389" ],
"translations" : { "translations" : {
"en" : "Text", "en" : "Text",
"fr" : "TODO" "fr" : "TODO"
} }
}, },
"workspace.options.font-options.align-bottom" : { "workspace.options.font-options.align-bottom" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:357" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:294" ],
"translations" : { "translations" : {
"en" : "Align bottom" "en" : "Align bottom"
} }
}, },
"workspace.options.font-options.align-center" : { "workspace.options.font-options.align-center" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:171" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:169" ],
"translations" : { "translations" : {
"en" : "Align center" "en" : "Align center"
} }
}, },
"workspace.options.font-options.align-justify" : { "workspace.options.font-options.align-justify" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:181" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:179" ],
"translations" : { "translations" : {
"en" : "Justify" "en" : "Justify"
} }
}, },
"workspace.options.font-options.align-left" : { "workspace.options.font-options.align-left" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:166" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:164" ],
"translations" : { "translations" : {
"en" : "Align left" "en" : "Align left"
} }
}, },
"workspace.options.font-options.align-middle" : { "workspace.options.font-options.align-middle" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:352" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:289" ],
"translations" : { "translations" : {
"en" : "Align middle" "en" : "Align middle"
} }
}, },
"workspace.options.font-options.align-right" : { "workspace.options.font-options.align-right" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:176" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:174" ],
"translations" : { "translations" : {
"en" : "Align right" "en" : "Align right"
} }
}, },
"workspace.options.font-options.align-top" : { "workspace.options.font-options.align-top" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:347" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:284" ],
"translations" : { "translations" : {
"en" : "Align top" "en" : "Align top"
} }
}, },
"workspace.options.font-options.decoration" : { "workspace.options.font-options.decoration" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:378" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:315" ],
"translations" : { "translations" : {
"en" : "Decoration" "en" : "Decoration"
} }
}, },
"workspace.options.font-options.letter-spacing" : { "workspace.options.font-options.letter-spacing" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:304" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:241" ],
"translations" : { "translations" : {
"en" : "Letter Spacing" "en" : "Letter Spacing"
} }
}, },
"workspace.options.font-options.line-height" : { "workspace.options.font-options.line-height" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:292" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:229" ],
"translations" : { "translations" : {
"en" : "Line height" "en" : "Line height"
} }
}, },
"workspace.options.font-options.lowercase" : { "workspace.options.font-options.lowercase" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:427" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:364" ],
"translations" : { "translations" : {
"en" : "Lowercase" "en" : "Lowercase"
} }
}, },
"workspace.options.font-options.none" : { "workspace.options.font-options.none" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:381", "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:417" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:318", "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:354" ],
"translations" : { "translations" : {
"en" : "None" "en" : "None"
} }
}, },
"workspace.options.font-options.strikethrough" : { "workspace.options.font-options.strikethrough" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:393" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:330" ],
"translations" : { "translations" : {
"en" : "Strikethrough" "en" : "Strikethrough"
} }
}, },
"workspace.options.font-options.text-case" : { "workspace.options.font-options.text-case" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:414" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:351" ],
"translations" : { "translations" : {
"en" : "Case" "en" : "Case"
} }
}, },
"workspace.options.font-options.titlecase" : { "workspace.options.font-options.titlecase" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:432" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:369" ],
"translations" : { "translations" : {
"en" : "Titlecase" "en" : "Titlecase"
} }
}, },
"workspace.options.font-options.underline" : { "workspace.options.font-options.underline" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:387" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:324" ],
"translations" : { "translations" : {
"en" : "Underline" "en" : "Underline"
} }
}, },
"workspace.options.font-options.uppercase" : { "workspace.options.font-options.uppercase" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:422" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:359" ],
"translations" : { "translations" : {
"en" : "Uppercase" "en" : "Uppercase"
} }
}, },
"workspace.options.font-options.vertical-align" : { "workspace.options.font-options.vertical-align" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:344" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/text.cljs:281" ],
"translations" : { "translations" : {
"en" : "Vertical align" "en" : "Vertical align"
} }
@ -1111,109 +1111,121 @@
} }
}, },
"workspace.options.grid.column" : { "workspace.options.grid.column" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:125" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:132" ],
"translations" : { "translations" : {
"en" : "Columns" "en" : "Columns"
} }
}, },
"workspace.options.grid.params.columns" : { "workspace.options.grid.params.columns" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:164" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:171" ],
"translations" : { "translations" : {
"en" : "Columns" "en" : "Columns"
} }
}, },
"workspace.options.grid.params.gutter" : { "workspace.options.grid.params.gutter" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:191" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:202" ],
"translations" : { "translations" : {
"en" : "Gutter" "en" : "Gutter"
} }
}, },
"workspace.options.grid.params.height" : { "workspace.options.grid.params.height" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:184" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:194" ],
"translations" : { "translations" : {
"en" : "Height" "en" : "Height"
} }
}, },
"workspace.options.grid.params.margin" : { "workspace.options.grid.params.margin" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:196" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:207" ],
"translations" : { "translations" : {
"en" : "Margin" "en" : "Margin"
} }
}, },
"workspace.options.grid.params.rows" : { "workspace.options.grid.params.rows" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:156" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:163" ],
"translations" : { "translations" : {
"en" : "Rows" "en" : "Rows"
} }
}, },
"workspace.options.grid.params.set-default" : { "workspace.options.grid.params.set-default" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:208" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:219" ],
"translations" : { "translations" : {
"en" : "Set as default" "en" : "Set as default"
} }
}, },
"workspace.options.grid.params.size" : { "workspace.options.grid.params.size" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:149" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:156" ],
"translations" : { "translations" : {
"en" : "Size" "en" : "Size"
} }
}, },
"workspace.options.grid.params.type" : { "workspace.options.grid.params.type" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:172" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:179" ],
"translations" : { "translations" : {
"en" : "Type" "en" : "Type"
} }
}, },
"workspace.options.grid.params.type.bottom" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:187" ],
"translations" : {
"en" : "Bottom"
}
},
"workspace.options.grid.params.type.center" : { "workspace.options.grid.params.type.center" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:176" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:185" ],
"translations" : { "translations" : {
"en" : "Center" "en" : "Center"
} }
}, },
"workspace.options.grid.params.type.left" : { "workspace.options.grid.params.type.left" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:175" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:184" ],
"translations" : { "translations" : {
"en" : "Left" "en" : "Left"
} }
}, },
"workspace.options.grid.params.type.right" : { "workspace.options.grid.params.type.right" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:177" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:188" ],
"translations" : { "translations" : {
"en" : "Right" "en" : "Right"
} }
}, },
"workspace.options.grid.params.type.stretch" : { "workspace.options.grid.params.type.stretch" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:174" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:181" ],
"translations" : { "translations" : {
"en" : "Stretch" "en" : "Stretch"
} }
}, },
"workspace.options.grid.params.type.top" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:183" ],
"translations" : {
"en" : "Top"
}
},
"workspace.options.grid.params.use-default" : { "workspace.options.grid.params.use-default" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:206" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:217" ],
"translations" : { "translations" : {
"en" : "Use default" "en" : "Use default"
} }
}, },
"workspace.options.grid.params.width" : { "workspace.options.grid.params.width" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:183" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:195" ],
"translations" : { "translations" : {
"en" : "Width" "en" : "Width"
} }
}, },
"workspace.options.grid.row" : { "workspace.options.grid.row" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:126" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:133" ],
"translations" : { "translations" : {
"en" : "Rows" "en" : "Rows"
} }
}, },
"workspace.options.grid.square" : { "workspace.options.grid.square" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:124" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:131" ],
"translations" : { "translations" : {
"en" : "Square" "en" : "Square"
} }
}, },
"workspace.options.grid.title" : { "workspace.options.grid.title" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:220" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/frame_grid.cljs:231" ],
"translations" : { "translations" : {
"en" : "Grid & Layouts" "en" : "Grid & Layouts"
} }
@ -1311,53 +1323,53 @@
} }
}, },
"workspace.options.stroke" : { "workspace.options.stroke" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:111", "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:175" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:90", "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:124" ],
"translations" : { "translations" : {
"en" : "Stroke", "en" : "Stroke",
"fr" : null "fr" : null
} }
}, },
"workspace.options.stroke.center" : { "workspace.options.stroke.center" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:161" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:110" ],
"translations" : { "translations" : {
"en" : "Center" "en" : "Center"
} }
}, },
"workspace.options.stroke.dashed" : { "workspace.options.stroke.dashed" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:169" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:118" ],
"translations" : { "translations" : {
"en" : "Dashed", "en" : "Dashed",
"fr" : "Tiré" "fr" : "Tiré"
} }
}, },
"workspace.options.stroke.dotted" : { "workspace.options.stroke.dotted" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:168" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:117" ],
"translations" : { "translations" : {
"en" : "Dotted", "en" : "Dotted",
"fr" : "Pointillé" "fr" : "Pointillé"
} }
}, },
"workspace.options.stroke.inner" : { "workspace.options.stroke.inner" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:162" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:111" ],
"translations" : { "translations" : {
"en" : "Inside" "en" : "Inside"
} }
}, },
"workspace.options.stroke.mixed" : { "workspace.options.stroke.mixed" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:170" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:119" ],
"translations" : { "translations" : {
"en" : "Mixed", "en" : "Mixed",
"fr" : "Mixte" "fr" : "Mixte"
} }
}, },
"workspace.options.stroke.outer" : { "workspace.options.stroke.outer" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:163" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:112" ],
"translations" : { "translations" : {
"en" : "Outside" "en" : "Outside"
} }
}, },
"workspace.options.stroke.solid" : { "workspace.options.stroke.solid" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:167" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs:116" ],
"translations" : { "translations" : {
"en" : "Solid", "en" : "Solid",
"fr" : "Solide" "fr" : "Solide"

View file

@ -36,13 +36,14 @@
[:div.advanced-options {} [:div.advanced-options {}
children]])) children]]))
(def ^:private size-options (defn- get-size-options [locale]
[{:value :auto :label (tr "workspace.options.grid.auto")} [{:value :auto :label (t locale "workspace.options.grid.auto")}
:separator :separator
18 12 10 8 6 4 3 2]) 18 12 10 8 6 4 3 2])
(mf/defc grid-options [{:keys [frame grid default-grid-params on-change on-remove on-save-grid]}] (mf/defc grid-options [{:keys [frame grid default-grid-params on-change on-remove on-save-grid]}]
(let [locale (i18n/use-locale) (let [locale (i18n/use-locale)
size-options (get-size-options locale)
state (mf/use-state {:show-advanced-options false state (mf/use-state {:show-advanced-options false
:changes {}}) :changes {}})
{:keys [type display params] :as grid} (d/deep-merge grid (:changes @state)) {:keys [type display params] :as grid} (d/deep-merge grid (:changes @state))
@ -178,9 +179,13 @@
[:& input-row {:label (t locale "workspace.options.grid.params.type") [:& input-row {:label (t locale "workspace.options.grid.params.type")
:type :select :type :select
:options [{:value :stretch :label (t locale "workspace.options.grid.params.type.stretch")} :options [{:value :stretch :label (t locale "workspace.options.grid.params.type.stretch")}
{:value :left :label (t locale "workspace.options.grid.params.type.left")} {:value :left :label (if (= type :row)
(t locale "workspace.options.grid.params.type.top")
(t locale "workspace.options.grid.params.type.left"))}
{:value :center :label (t locale "workspace.options.grid.params.type.center")} {:value :center :label (t locale "workspace.options.grid.params.type.center")}
{:value :right :label (t locale "workspace.options.grid.params.type.right")}] {:value :right :label (if (= type :row)
(t locale "workspace.options.grid.params.type.bottom")
(t locale "workspace.options.grid.params.type.right"))}]
:value (:type params) :value (:type params)
:on-change (handle-change :params :type)}]) :on-change (handle-change :params :type)}])