@lvl99dotcom/paintcanvas 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/brushes/configRanges/index.d.ts +17 -0
- package/dist/lib/brushes/configRanges/index.js +31 -1
- package/dist/lib/brushes/params/index.d.ts +2 -1
- package/dist/lib/brushes/params/index.js +7 -4
- package/dist/lib/brushes/types/index.d.ts +8 -0
- package/dist/lib/classes/Layer/index.d.ts +10 -0
- package/dist/lib/classes/Layer/index.js +15 -1
- package/dist/lib/classes/LayerAutosave/index.d.ts +9 -15
- package/dist/lib/classes/LayerAutosave/index.js +30 -43
- package/dist/lib/classes/LayerStack/index.d.ts +15 -0
- package/dist/lib/classes/LayerStack/index.js +26 -2
- package/dist/lib/classes/PaintCanvas/index.d.ts +26 -3
- package/dist/lib/classes/PaintCanvas/index.js +39 -12
- package/dist/lib/classes/PngEncoder/index.d.ts +41 -0
- package/dist/lib/classes/PngEncoder/index.js +104 -0
- package/dist/lib/classes/ProfileGraphs/index.d.ts +87 -0
- package/dist/lib/classes/ProfileGraphs/index.js +148 -0
- package/dist/lib/classes/SettingsAutosave/index.d.ts +1 -1
- package/dist/lib/classes/SettingsAutosave/index.js +2 -1
- package/dist/lib/messages/schema.d.ts +720 -0
- package/dist/lib/presets/schema.d.ts +360 -0
- package/dist/lib/presets/schema.js +8 -1
- package/dist/lib/profiles/index.d.ts +61 -0
- package/dist/lib/profiles/index.js +131 -0
- package/dist/lib/profiles/schema.d.ts +73 -0
- package/dist/lib/profiles/schema.js +53 -0
- package/dist/lib/rendering/sample/index.d.ts +11 -0
- package/dist/lib/rendering/sample/index.js +36 -5
- package/dist/lib/settings/index.d.ts +2 -1
- package/dist/lib/settings/index.js +4 -1
- package/dist/lib/settings/schema.d.ts +49 -0
- package/dist/lib/settings/schema.js +6 -0
- package/dist/lib/validation/validators.generated.js +13064 -3696
- package/dist/locales/en-GB.js +30 -0
- package/dist/locales/en-US.js +30 -0
- package/dist/locales/fr.js +30 -0
- package/dist/locales/ja.js +30 -0
- package/dist/locales/ko.js +30 -0
- package/dist/locales/zh-Hans.js +30 -0
- package/dist/locales/zh-Hant.js +30 -0
- package/dist/package.js +1 -1
- package/dist/ui/ask/index.d.ts +48 -0
- package/dist/ui/ask/index.js +67 -0
- package/dist/ui/base/index.d.ts +8 -1
- package/dist/ui/base/index.js +19 -4
- package/dist/ui/elements/PaintCanvas/index.js +3 -1
- package/dist/ui/elements/PaintCanvas/style.js +1 -1
- package/dist/ui/elements/PcAppSettings/index.d.ts +6 -6
- package/dist/ui/elements/PcAppSettings/index.js +21 -65
- package/dist/ui/elements/PcBrushConfig/index.d.ts +25 -14
- package/dist/ui/elements/PcBrushConfig/index.js +216 -146
- package/dist/ui/elements/PcBrushConfig/style.js +1 -1
- package/dist/ui/elements/PcBrushTest/index.js +7 -2
- package/dist/ui/elements/PcBrushTest/style.js +1 -1
- package/dist/ui/elements/PcButton/index.d.ts +12 -3
- package/dist/ui/elements/PcButton/index.js +18 -10
- package/dist/ui/elements/PcCanvas/index.d.ts +6 -1
- package/dist/ui/elements/PcCanvas/index.js +10 -3
- package/dist/ui/elements/PcCanvas/style.js +1 -1
- package/dist/ui/elements/PcClipboardTools/index.d.ts +5 -4
- package/dist/ui/elements/PcClipboardTools/index.js +12 -5
- package/dist/ui/elements/PcDialog/index.d.ts +46 -10
- package/dist/ui/elements/PcDialog/index.js +102 -51
- package/dist/ui/elements/PcDialogWindow/index.d.ts +141 -0
- package/dist/ui/elements/PcDialogWindow/index.js +385 -0
- package/dist/ui/elements/PcPanelBrushes/index.d.ts +3 -2
- package/dist/ui/elements/PcPanelBrushes/index.js +7 -5
- package/dist/ui/elements/PcPanelBrushes/style.js +1 -1
- package/dist/ui/elements/PcPanelColours/index.js +2 -2
- package/dist/ui/elements/PcPanelColours/style.js +1 -1
- package/dist/ui/elements/PcPanelLayers/index.js +1 -1
- package/dist/ui/elements/PcPanelLayers/style.js +1 -1
- package/dist/ui/elements/PcProfileEditor/index.d.ts +103 -0
- package/dist/ui/elements/PcProfileEditor/index.js +259 -0
- package/dist/ui/elements/PcProfileGraph/index.d.ts +84 -0
- package/dist/ui/elements/PcProfileGraph/index.js +317 -0
- package/dist/ui/elements/PcShortcutSettings/index.js +9 -13
- package/dist/ui/elements/PcSliderRange/index.d.ts +147 -0
- package/dist/ui/elements/PcSliderRange/index.js +307 -0
- package/dist/ui/elements/PcStats/index.d.ts +19 -4
- package/dist/ui/elements/PcStats/index.js +29 -13
- package/dist/ui/elements/PcToolSettings/index.js +6 -6
- package/dist/ui/icons/images/icon-profile-graph@2x.js +3 -0
- package/dist/ui/icons/index.d.ts +1 -1
- package/dist/ui/icons/index.js +2 -0
- package/dist/ui/index.d.ts +6 -1
- package/dist/ui/index.js +6 -1
- package/dist/ui/styles/index.d.ts +21 -1
- package/dist/ui/styles/index.js +73 -14
- package/locales/en-GB.json +30 -0
- package/locales/en-US.json +30 -0
- package/locales/fr.json +30 -0
- package/locales/ja.json +30 -0
- package/locales/ko.json +30 -0
- package/locales/zh-Hans.json +30 -0
- package/locales/zh-Hant.json +30 -0
- package/package.json +25 -23
package/dist/locales/en-GB.js
CHANGED
|
@@ -8,6 +8,7 @@ var en_GB_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "Clear",
|
|
9
9
|
"paintCanvas.common.cut": "Cut",
|
|
10
10
|
"paintCanvas.common.copy": "Copy",
|
|
11
|
+
"paintCanvas.common.copyMerged": "Copy merged",
|
|
11
12
|
"paintCanvas.common.paste": "Paste",
|
|
12
13
|
"paintCanvas.common.undo": "Undo",
|
|
13
14
|
"paintCanvas.common.redo": "Redo",
|
|
@@ -17,6 +18,31 @@ var en_GB_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "Height",
|
|
18
19
|
"paintCanvas.common.size": "Size",
|
|
19
20
|
"paintCanvas.common.opacity": "Opacity",
|
|
21
|
+
"paintCanvas.range.low": "{label} (min)",
|
|
22
|
+
"paintCanvas.range.high": "{label} (max)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "Point {number}: {x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "Remove point",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "Sharp corner (linear)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "Smooth (bezier cubic)",
|
|
27
|
+
"paintCanvas.profiles.linear": "Linear",
|
|
28
|
+
"paintCanvas.profiles.overweight": "Overweight",
|
|
29
|
+
"paintCanvas.profiles.underweight": "Underweight",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param} profile graph",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}: profile graph",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "Custom",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "Profile graph actions",
|
|
34
|
+
"paintCanvas.profileEditor.new": "New graph",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "Duplicate…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "Rename…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "Delete…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "Reset",
|
|
39
|
+
"paintCanvas.profileEditor.name": "Name",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "Save profile graph",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "Rename profile graph",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "Delete profile graph",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "Delete \"{name}\"? This can't be undone.",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "Replace profile graph",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "You already have a profile graph called \"{name}\". Replace it?",
|
|
20
46
|
"paintCanvas.tool.brush": "Brush",
|
|
21
47
|
"paintCanvas.tool.eraser": "Eraser",
|
|
22
48
|
"paintCanvas.tool.move": "Move, scale and rotate",
|
|
@@ -89,6 +115,9 @@ var en_GB_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "My presets",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "Unknown",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "Delete \"{name}\"? This can't be undone.",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "Delete preset",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "Replace preset",
|
|
120
|
+
"paintCanvas.presets.replace": "Replace",
|
|
92
121
|
"paintCanvas.presets.deleted": "Deleted \"{name}\"",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "Couldn't delete \"{name}\"",
|
|
94
123
|
"paintCanvas.presets.saved": "Saved \"{name}\" to My presets",
|
|
@@ -182,6 +211,7 @@ var en_GB_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "Snap to pixel grid",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "Add to presets",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}: {source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}: vary with",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "Merge down",
|
|
186
216
|
"paintCanvas.layers.clear": "Clear…",
|
|
187
217
|
"paintCanvas.layers.delete": "Delete…",
|
package/dist/locales/en-US.js
CHANGED
|
@@ -8,6 +8,7 @@ var en_US_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "Clear",
|
|
9
9
|
"paintCanvas.common.cut": "Cut",
|
|
10
10
|
"paintCanvas.common.copy": "Copy",
|
|
11
|
+
"paintCanvas.common.copyMerged": "Copy merged",
|
|
11
12
|
"paintCanvas.common.paste": "Paste",
|
|
12
13
|
"paintCanvas.common.undo": "Undo",
|
|
13
14
|
"paintCanvas.common.redo": "Redo",
|
|
@@ -17,6 +18,31 @@ var en_US_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "Height",
|
|
18
19
|
"paintCanvas.common.size": "Size",
|
|
19
20
|
"paintCanvas.common.opacity": "Opacity",
|
|
21
|
+
"paintCanvas.range.low": "{label} (min)",
|
|
22
|
+
"paintCanvas.range.high": "{label} (max)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "Point {number}: {x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "Remove point",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "Sharp corner (linear)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "Smooth (bezier cubic)",
|
|
27
|
+
"paintCanvas.profiles.linear": "Linear",
|
|
28
|
+
"paintCanvas.profiles.overweight": "Overweight",
|
|
29
|
+
"paintCanvas.profiles.underweight": "Underweight",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param} profile graph",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}: profile graph",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "Custom",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "Profile graph actions",
|
|
34
|
+
"paintCanvas.profileEditor.new": "New graph",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "Duplicate…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "Rename…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "Delete…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "Reset",
|
|
39
|
+
"paintCanvas.profileEditor.name": "Name",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "Save profile graph",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "Rename profile graph",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "Delete profile graph",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "Delete \"{name}\"? This can't be undone.",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "Replace profile graph",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "You already have a profile graph called \"{name}\". Replace it?",
|
|
20
46
|
"paintCanvas.tool.brush": "Brush",
|
|
21
47
|
"paintCanvas.tool.eraser": "Eraser",
|
|
22
48
|
"paintCanvas.tool.move": "Move, scale and rotate",
|
|
@@ -89,6 +115,9 @@ var en_US_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "My presets",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "Unknown",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "Delete \"{name}\"? This can't be undone.",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "Delete preset",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "Replace preset",
|
|
120
|
+
"paintCanvas.presets.replace": "Replace",
|
|
92
121
|
"paintCanvas.presets.deleted": "Deleted \"{name}\"",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "Couldn't delete \"{name}\"",
|
|
94
123
|
"paintCanvas.presets.saved": "Saved \"{name}\" to My presets",
|
|
@@ -182,6 +211,7 @@ var en_US_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "Snap to pixel grid",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "Add to presets",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}: {source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}: vary with",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "Merge down",
|
|
186
216
|
"paintCanvas.layers.clear": "Clear…",
|
|
187
217
|
"paintCanvas.layers.delete": "Delete…",
|
package/dist/locales/fr.js
CHANGED
|
@@ -8,6 +8,7 @@ var fr_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "Effacer",
|
|
9
9
|
"paintCanvas.common.cut": "Couper",
|
|
10
10
|
"paintCanvas.common.copy": "Copier",
|
|
11
|
+
"paintCanvas.common.copyMerged": "Copier avec fusion",
|
|
11
12
|
"paintCanvas.common.paste": "Coller",
|
|
12
13
|
"paintCanvas.common.undo": "Annuler",
|
|
13
14
|
"paintCanvas.common.redo": "Rétablir",
|
|
@@ -17,6 +18,31 @@ var fr_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "Hauteur",
|
|
18
19
|
"paintCanvas.common.size": "Taille",
|
|
19
20
|
"paintCanvas.common.opacity": "Opacité",
|
|
21
|
+
"paintCanvas.range.low": "{label} (min)",
|
|
22
|
+
"paintCanvas.range.high": "{label} (max)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "Point {number} : {x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "Supprimer le point",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "Angle net (linéaire)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "Lisse (bézier cubique)",
|
|
27
|
+
"paintCanvas.profiles.linear": "Linéaire",
|
|
28
|
+
"paintCanvas.profiles.overweight": "Surpondéré",
|
|
29
|
+
"paintCanvas.profiles.underweight": "Sous-pondéré",
|
|
30
|
+
"paintCanvas.profileEditor.title": "Courbe de profil : {param}",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param} : courbe de profil",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "Personnalisé",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "Actions de la courbe",
|
|
34
|
+
"paintCanvas.profileEditor.new": "Nouvelle courbe",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "Dupliquer…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "Renommer…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "Supprimer…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "Réinitialiser",
|
|
39
|
+
"paintCanvas.profileEditor.name": "Nom",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "Enregistrer la courbe",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "Renommer la courbe",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "Supprimer la courbe",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "Supprimer « {name} » ? Cette action est irréversible.",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "Remplacer la courbe",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "Vous avez déjà une courbe nommée « {name} ». La remplacer ?",
|
|
20
46
|
"paintCanvas.tool.brush": "Pinceau",
|
|
21
47
|
"paintCanvas.tool.eraser": "Gomme",
|
|
22
48
|
"paintCanvas.tool.move": "Déplacer, redimensionner et faire pivoter",
|
|
@@ -89,6 +115,9 @@ var fr_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "Mes préréglages",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "Inconnu",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "Supprimer «\xA0{name}\xA0»\xA0? Cette action est irréversible.",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "Supprimer le préréglage",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "Remplacer le préréglage",
|
|
120
|
+
"paintCanvas.presets.replace": "Remplacer",
|
|
92
121
|
"paintCanvas.presets.deleted": "«\xA0{name}\xA0» supprimé",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "Impossible de supprimer «\xA0{name}\xA0»",
|
|
94
123
|
"paintCanvas.presets.saved": "«\xA0{name}\xA0» enregistré dans Mes préréglages",
|
|
@@ -182,6 +211,7 @@ var fr_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "Aligner sur la grille de pixels",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "Ajouter aux préréglages",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}\xA0: {source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param} : varier selon",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "Fusionner avec le calque inférieur",
|
|
186
216
|
"paintCanvas.layers.clear": "Effacer…",
|
|
187
217
|
"paintCanvas.layers.delete": "Supprimer…",
|
package/dist/locales/ja.js
CHANGED
|
@@ -8,6 +8,7 @@ var ja_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "クリア",
|
|
9
9
|
"paintCanvas.common.cut": "切り取り",
|
|
10
10
|
"paintCanvas.common.copy": "コピー",
|
|
11
|
+
"paintCanvas.common.copyMerged": "結合部分をコピー",
|
|
11
12
|
"paintCanvas.common.paste": "ペースト",
|
|
12
13
|
"paintCanvas.common.undo": "取り消す",
|
|
13
14
|
"paintCanvas.common.redo": "やり直す",
|
|
@@ -17,6 +18,31 @@ var ja_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "高さ",
|
|
18
19
|
"paintCanvas.common.size": "サイズ",
|
|
19
20
|
"paintCanvas.common.opacity": "不透明度",
|
|
21
|
+
"paintCanvas.range.low": "{label}(最小)",
|
|
22
|
+
"paintCanvas.range.high": "{label}(最大)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "点 {number}:{x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "点を削除",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "角(直線)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "なめらか(3次ベジェ)",
|
|
27
|
+
"paintCanvas.profiles.linear": "リニア",
|
|
28
|
+
"paintCanvas.profiles.overweight": "重め",
|
|
29
|
+
"paintCanvas.profiles.underweight": "軽め",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param}のプロファイルグラフ",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}:プロファイルグラフ",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "カスタム",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "グラフの操作",
|
|
34
|
+
"paintCanvas.profileEditor.new": "新しいグラフ",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "複製…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "名前を変更…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "削除…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "リセット",
|
|
39
|
+
"paintCanvas.profileEditor.name": "名前",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "グラフを保存",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "グラフの名前を変更",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "グラフを削除",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "「{name}」を削除しますか?元に戻せません。",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "グラフを置き換え",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "「{name}」という名前のグラフがすでにあります。置き換えますか?",
|
|
20
46
|
"paintCanvas.tool.brush": "ブラシ",
|
|
21
47
|
"paintCanvas.tool.eraser": "消しゴム",
|
|
22
48
|
"paintCanvas.tool.move": "移動・拡大縮小・回転",
|
|
@@ -89,6 +115,9 @@ var ja_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "マイプリセット",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "不明",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "「{name}」を削除しますか?元に戻せません。",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "プリセットを削除",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "プリセットを置き換え",
|
|
120
|
+
"paintCanvas.presets.replace": "置き換え",
|
|
92
121
|
"paintCanvas.presets.deleted": "「{name}」を削除しました",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "「{name}」を削除できませんでした",
|
|
94
123
|
"paintCanvas.presets.saved": "「{name}」をマイプリセットに保存しました",
|
|
@@ -182,6 +211,7 @@ var ja_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "ピクセルグリッドに吸着",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "プリセットに追加",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}:{source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}:変化の元",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "下のレイヤーと結合",
|
|
186
216
|
"paintCanvas.layers.clear": "クリア…",
|
|
187
217
|
"paintCanvas.layers.delete": "削除…",
|
package/dist/locales/ko.js
CHANGED
|
@@ -8,6 +8,7 @@ var ko_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "지우기",
|
|
9
9
|
"paintCanvas.common.cut": "잘라내기",
|
|
10
10
|
"paintCanvas.common.copy": "복사",
|
|
11
|
+
"paintCanvas.common.copyMerged": "병합하여 복사",
|
|
11
12
|
"paintCanvas.common.paste": "붙여넣기",
|
|
12
13
|
"paintCanvas.common.undo": "실행 취소",
|
|
13
14
|
"paintCanvas.common.redo": "다시 실행",
|
|
@@ -17,6 +18,31 @@ var ko_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "높이",
|
|
18
19
|
"paintCanvas.common.size": "크기",
|
|
19
20
|
"paintCanvas.common.opacity": "불투명도",
|
|
21
|
+
"paintCanvas.range.low": "{label} (최소)",
|
|
22
|
+
"paintCanvas.range.high": "{label} (최대)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "점 {number}: {x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "점 삭제",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "뾰족한 모서리 (선형)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "부드럽게 (3차 베지어)",
|
|
27
|
+
"paintCanvas.profiles.linear": "선형",
|
|
28
|
+
"paintCanvas.profiles.overweight": "강하게",
|
|
29
|
+
"paintCanvas.profiles.underweight": "약하게",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param} 프로필 그래프",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}: 프로필 그래프",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "사용자 지정",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "그래프 작업",
|
|
34
|
+
"paintCanvas.profileEditor.new": "새 그래프",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "복제…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "이름 바꾸기…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "삭제…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "초기화",
|
|
39
|
+
"paintCanvas.profileEditor.name": "이름",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "그래프 저장",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "그래프 이름 바꾸기",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "그래프 삭제",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "\"{name}\"을(를) 삭제할까요? 되돌릴 수 없습니다.",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "그래프 바꾸기",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "\"{name}\"(이)라는 그래프가 이미 있습니다. 바꿀까요?",
|
|
20
46
|
"paintCanvas.tool.brush": "브러시",
|
|
21
47
|
"paintCanvas.tool.eraser": "지우개",
|
|
22
48
|
"paintCanvas.tool.move": "이동, 크기 조절 및 회전",
|
|
@@ -89,6 +115,9 @@ var ko_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "내 프리셋",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "알 수 없음",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "\"{name}\"을(를) 삭제할까요? 되돌릴 수 없습니다.",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "프리셋 삭제",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "프리셋 바꾸기",
|
|
120
|
+
"paintCanvas.presets.replace": "바꾸기",
|
|
92
121
|
"paintCanvas.presets.deleted": "\"{name}\"을(를) 삭제했습니다",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "\"{name}\"을(를) 삭제하지 못했습니다",
|
|
94
123
|
"paintCanvas.presets.saved": "\"{name}\"을(를) 내 프리셋에 저장했습니다",
|
|
@@ -182,6 +211,7 @@ var ko_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "픽셀 격자에 맞추기",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "프리셋에 추가",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}: {source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}: 변화 기준",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "아래 레이어와 병합",
|
|
186
216
|
"paintCanvas.layers.clear": "지우기…",
|
|
187
217
|
"paintCanvas.layers.delete": "삭제…",
|
package/dist/locales/zh-Hans.js
CHANGED
|
@@ -8,6 +8,7 @@ var zh_Hans_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "清除",
|
|
9
9
|
"paintCanvas.common.cut": "剪切",
|
|
10
10
|
"paintCanvas.common.copy": "复制",
|
|
11
|
+
"paintCanvas.common.copyMerged": "合并拷贝",
|
|
11
12
|
"paintCanvas.common.paste": "粘贴",
|
|
12
13
|
"paintCanvas.common.undo": "撤销",
|
|
13
14
|
"paintCanvas.common.redo": "重做",
|
|
@@ -17,6 +18,31 @@ var zh_Hans_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "高度",
|
|
18
19
|
"paintCanvas.common.size": "大小",
|
|
19
20
|
"paintCanvas.common.opacity": "不透明度",
|
|
21
|
+
"paintCanvas.range.low": "{label}(最小)",
|
|
22
|
+
"paintCanvas.range.high": "{label}(最大)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "点 {number}:{x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "删除点",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "尖角(线性)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "平滑(三次贝塞尔)",
|
|
27
|
+
"paintCanvas.profiles.linear": "线性",
|
|
28
|
+
"paintCanvas.profiles.overweight": "偏重",
|
|
29
|
+
"paintCanvas.profiles.underweight": "偏轻",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param}曲线",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}:曲线",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "自定义",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "曲线操作",
|
|
34
|
+
"paintCanvas.profileEditor.new": "新建曲线",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "复制…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "重命名…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "删除…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "重置",
|
|
39
|
+
"paintCanvas.profileEditor.name": "名称",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "保存曲线",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "重命名曲线",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "删除曲线",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "删除“{name}”?此操作无法撤销。",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "替换曲线",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "已有名为“{name}”的曲线。要替换吗?",
|
|
20
46
|
"paintCanvas.tool.brush": "画笔",
|
|
21
47
|
"paintCanvas.tool.eraser": "橡皮擦",
|
|
22
48
|
"paintCanvas.tool.move": "移动、缩放和旋转",
|
|
@@ -89,6 +115,9 @@ var zh_Hans_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "我的预设",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "未知",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "删除“{name}”?此操作无法撤销。",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "删除预设",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "替换预设",
|
|
120
|
+
"paintCanvas.presets.replace": "替换",
|
|
92
121
|
"paintCanvas.presets.deleted": "已删除“{name}”",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "无法删除“{name}”",
|
|
94
123
|
"paintCanvas.presets.saved": "已将“{name}”保存到我的预设",
|
|
@@ -182,6 +211,7 @@ var zh_Hans_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "对齐像素网格",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "添加到预设",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}:{source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}:变化依据",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "向下合并",
|
|
186
216
|
"paintCanvas.layers.clear": "清除…",
|
|
187
217
|
"paintCanvas.layers.delete": "删除…",
|
package/dist/locales/zh-Hant.js
CHANGED
|
@@ -8,6 +8,7 @@ var zh_Hant_default = {
|
|
|
8
8
|
"paintCanvas.common.clear": "清除",
|
|
9
9
|
"paintCanvas.common.cut": "剪下",
|
|
10
10
|
"paintCanvas.common.copy": "拷貝",
|
|
11
|
+
"paintCanvas.common.copyMerged": "合併拷貝",
|
|
11
12
|
"paintCanvas.common.paste": "貼上",
|
|
12
13
|
"paintCanvas.common.undo": "復原",
|
|
13
14
|
"paintCanvas.common.redo": "重做",
|
|
@@ -17,6 +18,31 @@ var zh_Hant_default = {
|
|
|
17
18
|
"paintCanvas.common.height": "高度",
|
|
18
19
|
"paintCanvas.common.size": "大小",
|
|
19
20
|
"paintCanvas.common.opacity": "不透明度",
|
|
21
|
+
"paintCanvas.range.low": "{label}(最小)",
|
|
22
|
+
"paintCanvas.range.high": "{label}(最大)",
|
|
23
|
+
"paintCanvas.profileGraph.point": "點 {number}:{x}, {y}",
|
|
24
|
+
"paintCanvas.profileGraph.remove": "刪除點",
|
|
25
|
+
"paintCanvas.profileGraph.linear": "尖角(線性)",
|
|
26
|
+
"paintCanvas.profileGraph.bezier": "平滑(三次貝茲)",
|
|
27
|
+
"paintCanvas.profiles.linear": "線性",
|
|
28
|
+
"paintCanvas.profiles.overweight": "偏重",
|
|
29
|
+
"paintCanvas.profiles.underweight": "偏輕",
|
|
30
|
+
"paintCanvas.profileEditor.title": "{param}曲線",
|
|
31
|
+
"paintCanvas.profileEditor.button": "{param}:曲線",
|
|
32
|
+
"paintCanvas.profileEditor.custom": "自訂",
|
|
33
|
+
"paintCanvas.profileEditor.actions": "曲線操作",
|
|
34
|
+
"paintCanvas.profileEditor.new": "新增曲線",
|
|
35
|
+
"paintCanvas.profileEditor.duplicate": "複製…",
|
|
36
|
+
"paintCanvas.profileEditor.rename": "重新命名…",
|
|
37
|
+
"paintCanvas.profileEditor.delete": "刪除…",
|
|
38
|
+
"paintCanvas.profileEditor.reset": "重設",
|
|
39
|
+
"paintCanvas.profileEditor.name": "名稱",
|
|
40
|
+
"paintCanvas.profileEditor.saveHeading": "儲存曲線",
|
|
41
|
+
"paintCanvas.profileEditor.renameHeading": "重新命名曲線",
|
|
42
|
+
"paintCanvas.profileEditor.deleteHeading": "刪除曲線",
|
|
43
|
+
"paintCanvas.profileEditor.deleteConfirm": "刪除「{name}」?此操作無法復原。",
|
|
44
|
+
"paintCanvas.profileEditor.replaceHeading": "取代曲線",
|
|
45
|
+
"paintCanvas.profileEditor.replaceConfirm": "已有名為「{name}」的曲線。要取代嗎?",
|
|
20
46
|
"paintCanvas.tool.brush": "筆刷",
|
|
21
47
|
"paintCanvas.tool.eraser": "橡皮擦",
|
|
22
48
|
"paintCanvas.tool.move": "移動、縮放和旋轉",
|
|
@@ -89,6 +115,9 @@ var zh_Hant_default = {
|
|
|
89
115
|
"paintCanvas.presets.myPresets": "我的預設",
|
|
90
116
|
"paintCanvas.presets.unknownAuthor": "未知",
|
|
91
117
|
"paintCanvas.presets.deleteConfirm": "要刪除「{name}」嗎?此動作無法復原。",
|
|
118
|
+
"paintCanvas.presets.deleteHeading": "刪除預設",
|
|
119
|
+
"paintCanvas.presets.replaceHeading": "取代預設",
|
|
120
|
+
"paintCanvas.presets.replace": "取代",
|
|
92
121
|
"paintCanvas.presets.deleted": "已刪除「{name}」",
|
|
93
122
|
"paintCanvas.presets.deleteFailed": "無法刪除「{name}」",
|
|
94
123
|
"paintCanvas.presets.saved": "已將「{name}」儲存到我的預設",
|
|
@@ -182,6 +211,7 @@ var zh_Hant_default = {
|
|
|
182
211
|
"paintCanvas.brushConfig.snapToPixelGrid": "對齊像素格線",
|
|
183
212
|
"paintCanvas.brushConfig.addToPresets": "加入預設",
|
|
184
213
|
"paintCanvas.brushConfig.variation": "{param}:{source}",
|
|
214
|
+
"paintCanvas.brushConfig.varyWith": "{param}:變化依據",
|
|
185
215
|
"paintCanvas.layers.mergeDownTitle": "向下合併",
|
|
186
216
|
"paintCanvas.layers.clear": "清除…",
|
|
187
217
|
"paintCanvas.layers.delete": "刪除…",
|
package/dist/package.js
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "../elements/PcDialog";
|
|
2
|
+
import type Translations from "../../lib/i18n";
|
|
3
|
+
import { type DialogField } from "../elements/PcDialog";
|
|
4
|
+
/** The choice that agrees, in the dialogs `askConfirm` and `askText` show */
|
|
5
|
+
export declare const OK_CHOICE = "ok";
|
|
6
|
+
/** What to ask */
|
|
7
|
+
export interface AskOptions {
|
|
8
|
+
heading: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
/** The button that agrees */
|
|
11
|
+
confirm: string;
|
|
12
|
+
/** The button that doesn't */
|
|
13
|
+
cancel: string;
|
|
14
|
+
/** Whether agreeing removes or replaces something (the button is pink) */
|
|
15
|
+
cancelling?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** What to ask for text: as `AskOptions`, with the field's label and the text it starts with */
|
|
18
|
+
export interface AskTextOptions extends AskOptions, DialogField {
|
|
19
|
+
}
|
|
20
|
+
/** Asks the user to confirm, resolving true if they agree */
|
|
21
|
+
export type ConfirmFn = (options: AskOptions) => boolean | Promise<boolean>;
|
|
22
|
+
/** Asks the user for text, resolving with it, or null if they don't give it */
|
|
23
|
+
export type PromptFn = (options: AskTextOptions) => string | null | Promise<string | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Ask the user to confirm in a dialog shown in `parent`, resolving true if they agree (false for the cancel button,
|
|
26
|
+
* Escape or a press outside it).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* if (await askConfirm(this.renderRoot, { heading: "Delete preset", message: 'Delete "Ink"?', confirm: "Delete",
|
|
30
|
+
* cancel: "Cancel", cancelling: true })) remove();
|
|
31
|
+
*/
|
|
32
|
+
export declare const askConfirm: (parent: Node, options: AskOptions) => Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Ask the user for text in a dialog shown in `parent`, resolving with what they typed when they agree (or press Enter),
|
|
35
|
+
* or null if they cancel.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const name = await askText(this.renderRoot, { heading: "Add to presets", label: "Name", value: "Ink",
|
|
39
|
+
* confirm: "Save", cancel: "Cancel" });
|
|
40
|
+
*/
|
|
41
|
+
export declare const askText: (parent: Node, { label, value, ...options }: AskTextOptions) => Promise<string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* The question asked before deleting one of the user's brush presets, in the chosen language.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await askConfirm(this.renderRoot, deletePresetQuestion(this.translations, "Ink"));
|
|
47
|
+
*/
|
|
48
|
+
export declare const deletePresetQuestion: (translations: Pick<Translations, "t">, name: string) => AskOptions;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CANCEL_CHOICE } from "../elements/PcDialog/index.js";
|
|
2
|
+
// src/ui/ask/index.ts
|
|
3
|
+
/** The choice that agrees, in the dialogs `askConfirm` and `askText` show */
|
|
4
|
+
var OK_CHOICE = "ok";
|
|
5
|
+
/**
|
|
6
|
+
* Show a dialog in a parent (e.g. an element's shadow root) until the user chooses, then remove it. The choice doesn't
|
|
7
|
+
* reach the parent's listeners.
|
|
8
|
+
*/
|
|
9
|
+
var ask = (parent, options, field) => new Promise((resolve) => {
|
|
10
|
+
const dialog = document.createElement("pc-dialog");
|
|
11
|
+
dialog.heading = options.heading;
|
|
12
|
+
dialog.message = options.message ?? "";
|
|
13
|
+
dialog.field = field;
|
|
14
|
+
dialog.choices = [{
|
|
15
|
+
value: "ok",
|
|
16
|
+
label: options.confirm,
|
|
17
|
+
cancelling: options.cancelling
|
|
18
|
+
}, {
|
|
19
|
+
value: CANCEL_CHOICE,
|
|
20
|
+
label: options.cancel,
|
|
21
|
+
variant: "dismiss"
|
|
22
|
+
}];
|
|
23
|
+
dialog.addEventListener("pc-choose", (event) => {
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
dialog.remove();
|
|
26
|
+
resolve(event.detail);
|
|
27
|
+
}, { once: true });
|
|
28
|
+
parent.appendChild(dialog);
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Ask the user to confirm in a dialog shown in `parent`, resolving true if they agree (false for the cancel button,
|
|
32
|
+
* Escape or a press outside it).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* if (await askConfirm(this.renderRoot, { heading: "Delete preset", message: 'Delete "Ink"?', confirm: "Delete",
|
|
36
|
+
* cancel: "Cancel", cancelling: true })) remove();
|
|
37
|
+
*/
|
|
38
|
+
var askConfirm = async (parent, options) => (await ask(parent, options)).value === "ok";
|
|
39
|
+
/**
|
|
40
|
+
* Ask the user for text in a dialog shown in `parent`, resolving with what they typed when they agree (or press Enter),
|
|
41
|
+
* or null if they cancel.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const name = await askText(this.renderRoot, { heading: "Add to presets", label: "Name", value: "Ink",
|
|
45
|
+
* confirm: "Save", cancel: "Cancel" });
|
|
46
|
+
*/
|
|
47
|
+
var askText = async (parent, { label, value, ...options }) => {
|
|
48
|
+
const choice = await ask(parent, options, {
|
|
49
|
+
label,
|
|
50
|
+
value
|
|
51
|
+
});
|
|
52
|
+
return choice.value === "ok" ? choice.text : null;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The question asked before deleting one of the user's brush presets, in the chosen language.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await askConfirm(this.renderRoot, deletePresetQuestion(this.translations, "Ink"));
|
|
59
|
+
*/
|
|
60
|
+
var deletePresetQuestion = (translations, name) => ({
|
|
61
|
+
heading: translations.t("paintCanvas.presets.deleteHeading"),
|
|
62
|
+
message: translations.t("paintCanvas.presets.deleteConfirm", { name }),
|
|
63
|
+
confirm: translations.t("paintCanvas.common.delete"),
|
|
64
|
+
cancel: translations.t("paintCanvas.common.cancel"),
|
|
65
|
+
cancelling: true
|
|
66
|
+
});
|
|
67
|
+
export { OK_CHOICE, askConfirm, askText, deletePresetQuestion };
|
package/dist/ui/base/index.d.ts
CHANGED
|
@@ -16,8 +16,15 @@ export declare const defineElement: (name: string, constructor: CustomElementCon
|
|
|
16
16
|
* emit(this, "pc-select", { value: "duplicate" });
|
|
17
17
|
*/
|
|
18
18
|
export declare const emit: <T>(target: EventTarget, type: string, detail?: T) => boolean;
|
|
19
|
+
/** The least font size of form fields on touch screens: iOS zooms the page in on fields with smaller text */
|
|
20
|
+
export declare const TOUCH_FIELD_FONT_SIZE = "16px";
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Form fields' text on touch screens: at least 16px, so iOS doesn't zoom the page in when one is focused (which is
|
|
23
|
+
* hard to undo). It wins over elements' own field sizes, as zooming makes the whole interface hard to use.
|
|
24
|
+
*/
|
|
25
|
+
export declare const touchFields: import("lit").CSSResult;
|
|
26
|
+
/**
|
|
27
|
+
* The base of PaintCanvas's elements: the design tokens, 16px form fields on touch screens (see `touchFields`), the translations and icons they use (shared ones unless
|
|
21
28
|
* given others), and re-rendering when either changes.
|
|
22
29
|
*
|
|
23
30
|
* @example
|
package/dist/ui/base/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installTokens, tokens } from "../tokens/index.js";
|
|
2
2
|
import { icons } from "../icons/index.js";
|
|
3
3
|
import { translations } from "../../lib/i18n/index.js";
|
|
4
|
-
import { LitElement } from "lit";
|
|
4
|
+
import { LitElement, css, unsafeCSS } from "lit";
|
|
5
5
|
// src/ui/base/index.ts
|
|
6
6
|
/**
|
|
7
7
|
* Register a custom element unless the name is already registered (e.g. by another copy of PaintCanvas, or after hot
|
|
@@ -25,8 +25,23 @@ var emit = (target, type, detail) => target.dispatchEvent(new CustomEvent(type,
|
|
|
25
25
|
composed: true,
|
|
26
26
|
cancelable: true
|
|
27
27
|
}));
|
|
28
|
+
/** The least font size of form fields on touch screens: iOS zooms the page in on fields with smaller text */
|
|
29
|
+
var TOUCH_FIELD_FONT_SIZE = "16px";
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Form fields' text on touch screens: at least 16px, so iOS doesn't zoom the page in when one is focused (which is
|
|
32
|
+
* hard to undo). It wins over elements' own field sizes, as zooming makes the whole interface hard to use.
|
|
33
|
+
*/
|
|
34
|
+
var touchFields = css`
|
|
35
|
+
@media (pointer: coarse) {
|
|
36
|
+
input,
|
|
37
|
+
select,
|
|
38
|
+
textarea {
|
|
39
|
+
font-size: max(${unsafeCSS(TOUCH_FIELD_FONT_SIZE)}, 1em) !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
/**
|
|
44
|
+
* The base of PaintCanvas's elements: the design tokens, 16px form fields on touch screens (see `touchFields`), the translations and icons they use (shared ones unless
|
|
30
45
|
* given others), and re-rendering when either changes.
|
|
31
46
|
*
|
|
32
47
|
* @example
|
|
@@ -37,7 +52,7 @@ var emit = (target, type, detail) => target.dispatchEvent(new CustomEvent(type,
|
|
|
37
52
|
* }
|
|
38
53
|
*/
|
|
39
54
|
var PcElement = class extends LitElement {
|
|
40
|
-
static styles = [tokens];
|
|
55
|
+
static styles = [tokens, touchFields];
|
|
41
56
|
static properties = {
|
|
42
57
|
translations: { attribute: false },
|
|
43
58
|
icons: { attribute: false },
|
|
@@ -91,4 +106,4 @@ var PcElement = class extends LitElement {
|
|
|
91
106
|
this.watched = [];
|
|
92
107
|
}
|
|
93
108
|
};
|
|
94
|
-
export { PcElement, defineElement, emit };
|
|
109
|
+
export { PcElement, TOUCH_FIELD_FONT_SIZE, defineElement, emit, touchFields };
|
|
@@ -433,7 +433,7 @@ var PaintCanvasElement = class extends PcElement {
|
|
|
433
433
|
closePanelOutside(event) {
|
|
434
434
|
const panel = this.app?.panel;
|
|
435
435
|
if (!panel) return;
|
|
436
|
-
if (event.composedPath().some((target) => target instanceof Element && (target.classList.contains("panel") && target.getRootNode() === this.renderRoot || target.matches("dialog, pc-dialog") || target.getAttribute("data-panel") === panel || panel === Panel.Palette && target.localName === "pc-colour-pair"))) return;
|
|
436
|
+
if (event.composedPath().some((target) => target instanceof Element && (target.classList.contains("panel") && target.getRootNode() === this.renderRoot || target.matches("dialog, pc-dialog, pc-dialog-window") || target.getAttribute("data-panel") === panel || panel === Panel.Palette && target.localName === "pc-colour-pair"))) return;
|
|
437
437
|
markDismissingPress(event);
|
|
438
438
|
this.app.closePanel();
|
|
439
439
|
}
|
|
@@ -484,6 +484,8 @@ var PaintCanvasElement = class extends PcElement {
|
|
|
484
484
|
}];
|
|
485
485
|
return html`<pc-dialog
|
|
486
486
|
class="elsewhere"
|
|
487
|
+
inline
|
|
488
|
+
.dismissible=${false}
|
|
487
489
|
heading=${this.t("paintCanvas.autosave.elsewhere")}
|
|
488
490
|
message=${this.t("paintCanvas.autosave.elsewhereMessage")}
|
|
489
491
|
.choices=${choices}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/ui/elements/PaintCanvas/style.css?inline
|
|
2
|
-
var style_default = "/* The layout: header across the top, footer across the bottom, sides left and right, and between them the tool\n settings, the canvas and the bottom bar. Empty areas take no space. */\n:host {\n position: relative;\n display: grid;\n grid-template:\n \"header header header\" auto\n \"left top right\" auto\n \"left center right\" 1fr\n \"left bottom right\" auto\n \"footer footer footer\" auto / auto 1fr auto;\n overflow: hidden;\n background: var(--pc-bar);\n font-family: var(--pc-font);\n font-size: var(--pc-font-size);\n}\nheader {\n grid-area: header;\n}\n.top {\n grid-area: top;\n min-width: 0;\n}\n/* The tool settings fill the top pane */\n.top pc-tool-settings {\n flex: 1;\n}\n.center {\n position: relative;\n grid-area: center;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n}\n.bottom {\n grid-area: bottom;\n min-width: 0;\n}\nfooter {\n grid-area: footer;\n}\n.side {\n position: relative;\n z-index: 3;\n display: flex;\n min-height: 0;\n}\n/* A side's panes fill it */\n.side pc-pane,\n.side pc-toolbar,\n.side ::slotted(*) {\n flex: 1;\n}\n.side.left {\n grid-area: left;\n}\n.side.right {\n grid-area: right;\n}\n\n/* Hiding the interface (Tab key) leaves only the canvas */\n:host([ui-hidden]) header,\n:host([ui-hidden]) .top,\n:host([ui-hidden]) .bottom,\n:host([ui-hidden]) footer,\n:host([ui-hidden]) .side {\n display: none;\n}\n\n/* The canvas fills the middle; things drawn over it go in the overlay */\n.center ::slotted([slot=\"center\"]),\n.center pc-canvas {\n position: absolute;\n inset: 0;\n}\n.overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.overlay > * {\n pointer-events: auto;\n}\npc-canvas-map {\n position: absolute;\n right: 20px;\n bottom: 20px;\n}\n\n/* Menus opened from the toolbar float over the canvas, beside the toolbar */\n.panel {\n position: absolute;\n z-index: 4;\n left: 0;\n bottom: 0;\n max-height: 100%;\n overflow: auto;\n}\n.panel.top-panel {\n top: 0;\n bottom: auto;\n}\n/* The app menu: the implementer's content in a panel */\n.menu-panel:not([open]) {\n display: none;\n}\n\n/* Floating: the side's panes float over the canvas (see pc-pane), so the side takes no space */\n.side[data-mode=\"floating\"] {\n /* Beside the canvas only, so it floats over the canvas and not the tool settings */\n grid-row: 3;\n width: 0;\n}\n/* Overlay: the side's rail sits over the canvas (beside it only, not the tool settings), so the canvas fills the\n width behind it; presses between its panes' buttons (which take presses themselves) reach the canvas */\n.side[data-mode=\"overlay\"] {\n grid-row: 3;\n grid-column: 1 / -1;\n pointer-events: none;\n}\n.side.left[data-mode=\"overlay\"] {\n justify-self: start;\n}\n.side.right[data-mode=\"overlay\"] {\n justify-self: end;\n}\n/* The toolbar's panels open beside a left overlay rail, not under it */\n:host([left-mode=\"overlay\"]) .panel {\n left: var(--pc-left-inset);\n}\n
|
|
2
|
+
var style_default = "/* The layout: header across the top, footer across the bottom, sides left and right, and between them the tool\n settings, the canvas and the bottom bar. Empty areas take no space. */\n:host {\n position: relative;\n display: grid;\n grid-template:\n \"header header header\" auto\n \"left top right\" auto\n \"left center right\" 1fr\n \"left bottom right\" auto\n \"footer footer footer\" auto / auto 1fr auto;\n overflow: hidden;\n background: var(--pc-bar);\n font-family: var(--pc-font);\n font-size: var(--pc-font-size);\n}\nheader {\n grid-area: header;\n}\n.top {\n grid-area: top;\n min-width: 0;\n}\n/* The tool settings fill the top pane */\n.top pc-tool-settings {\n flex: 1;\n}\n.center {\n position: relative;\n grid-area: center;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n}\n.bottom {\n grid-area: bottom;\n min-width: 0;\n}\nfooter {\n grid-area: footer;\n}\n.side {\n position: relative;\n z-index: 3;\n display: flex;\n min-height: 0;\n}\n/* A side's panes fill it */\n.side pc-pane,\n.side pc-toolbar,\n.side ::slotted(*) {\n flex: 1;\n}\n.side.left {\n grid-area: left;\n}\n.side.right {\n grid-area: right;\n}\n\n/* Hiding the interface (Tab key) leaves only the canvas */\n:host([ui-hidden]) header,\n:host([ui-hidden]) .top,\n:host([ui-hidden]) .bottom,\n:host([ui-hidden]) footer,\n:host([ui-hidden]) .side {\n display: none;\n}\n\n/* The canvas fills the middle; things drawn over it go in the overlay */\n.center ::slotted([slot=\"center\"]),\n.center pc-canvas {\n position: absolute;\n inset: 0;\n}\n.overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.overlay > * {\n pointer-events: auto;\n}\npc-canvas-map {\n position: absolute;\n right: 20px;\n bottom: 20px;\n}\n\n/* Menus opened from the toolbar float over the canvas, beside the toolbar */\n.panel {\n position: absolute;\n z-index: 4;\n left: 0;\n bottom: 0;\n max-height: 100%;\n overflow: auto;\n}\n.panel.top-panel {\n top: 0;\n bottom: auto;\n}\n/* The app menu: the implementer's content in a panel */\n.menu-panel:not([open]) {\n display: none;\n}\n\n/* Floating: the side's panes float over the canvas (see pc-pane), so the side takes no space */\n.side[data-mode=\"floating\"] {\n /* Beside the canvas only, so it floats over the canvas and not the tool settings */\n grid-row: 3;\n width: 0;\n}\n/* Overlay: the side's rail sits over the canvas (beside it only, not the tool settings), so the canvas fills the\n width behind it; presses between its panes' buttons (which take presses themselves) reach the canvas */\n.side[data-mode=\"overlay\"] {\n grid-row: 3;\n grid-column: 1 / -1;\n pointer-events: none;\n}\n.side.left[data-mode=\"overlay\"] {\n justify-self: start;\n}\n.side.right[data-mode=\"overlay\"] {\n justify-self: end;\n}\n/* The toolbar's panels open beside a left overlay rail, not under it */\n:host([left-mode=\"overlay\"]) .panel {\n left: var(--pc-left-inset);\n}\n";
|
|
3
3
|
export { style_default as default };
|