@pairdraw/vue 0.20.0 → 0.21.1

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.
Files changed (238) hide show
  1. package/dist/canvas/CanvasRoot.vue.js +3 -0
  2. package/dist/canvas/CanvasRoot.vue.js.map +1 -1
  3. package/dist/canvas/surface/color-space.d.ts +1 -0
  4. package/dist/canvas/surface/color-space.d.ts.map +1 -1
  5. package/dist/canvas/surface/gl-surface.js +16 -2
  6. package/dist/canvas/surface/gl-surface.js.map +1 -1
  7. package/dist/canvas/surface/lifecycle.js +4 -2
  8. package/dist/canvas/surface/lifecycle.js.map +1 -1
  9. package/dist/canvas/surface/origin.js +14 -0
  10. package/dist/canvas/surface/origin.js.map +1 -0
  11. package/dist/canvas/surface/shader/plan.js +40 -0
  12. package/dist/canvas/surface/shader/plan.js.map +1 -0
  13. package/dist/canvas/surface/shader/playback.js +132 -36
  14. package/dist/canvas/surface/shader/playback.js.map +1 -1
  15. package/dist/canvas/surface/shader/stage.d.ts.map +1 -1
  16. package/dist/canvas/surface/shader/stage.js +42 -5
  17. package/dist/canvas/surface/shader/stage.js.map +1 -1
  18. package/dist/canvas/surface/types.d.ts +16 -0
  19. package/dist/canvas/surface/types.d.ts.map +1 -1
  20. package/dist/canvas/surface/use.js +3 -1
  21. package/dist/canvas/surface/use.js.map +1 -1
  22. package/dist/canvas/useCanvasInput.d.ts +8 -8
  23. package/dist/controls/binding-provider/pairdraw.js +1 -1
  24. package/dist/controls/binding-provider/pairdraw.js.map +1 -1
  25. package/dist/controls/color-model/types.d.ts +6 -0
  26. package/dist/controls/color-model/types.d.ts.map +1 -1
  27. package/dist/controls/color-model/use.d.ts.map +1 -1
  28. package/dist/controls/color-model/use.js +5 -3
  29. package/dist/controls/color-model/use.js.map +1 -1
  30. package/dist/controls/document-colors/index.d.ts +2 -2
  31. package/dist/controls/document-colors/index.js +2 -2
  32. package/dist/controls/document-colors/use.d.ts +7 -1
  33. package/dist/controls/document-colors/use.d.ts.map +1 -1
  34. package/dist/controls/document-colors/use.js +9 -1
  35. package/dist/controls/document-colors/use.js.map +1 -1
  36. package/dist/controls/node-props/use.d.ts +3 -3
  37. package/dist/controls/okhcl/use.d.ts +2 -2
  38. package/dist/controls/shader/catalog.d.ts +11 -0
  39. package/dist/controls/shader/catalog.d.ts.map +1 -1
  40. package/dist/controls/shader/catalog.js +35 -6
  41. package/dist/controls/shader/catalog.js.map +1 -1
  42. package/dist/controls/shader/gallery.d.ts +1 -1
  43. package/dist/controls/shader/gallery.d.ts.map +1 -1
  44. package/dist/controls/shader/gallery.js +292 -0
  45. package/dist/controls/shader/gallery.js.map +1 -1
  46. package/dist/controls/shader/index.d.ts +3 -1
  47. package/dist/controls/shader/index.js +3 -1
  48. package/dist/controls/shader/shapes.d.ts +18 -0
  49. package/dist/controls/shader/shapes.d.ts.map +1 -0
  50. package/dist/controls/shader/shapes.js +227 -0
  51. package/dist/controls/shader/shapes.js.map +1 -0
  52. package/dist/controls/shader/stops.d.ts +22 -0
  53. package/dist/controls/shader/stops.d.ts.map +1 -0
  54. package/dist/controls/shader/stops.js +73 -0
  55. package/dist/controls/shader/stops.js.map +1 -0
  56. package/dist/controls/variable-modes/helpers.d.ts.map +1 -1
  57. package/dist/controls/variable-modes/helpers.js +4 -2
  58. package/dist/controls/variable-modes/helpers.js.map +1 -1
  59. package/dist/editor/commands/shortcut.d.ts.map +1 -1
  60. package/dist/editor/commands/shortcut.js +9 -1
  61. package/dist/editor/commands/shortcut.js.map +1 -1
  62. package/dist/i18n/create.d.ts +1 -1
  63. package/dist/i18n/create.d.ts.map +1 -1
  64. package/dist/i18n/create.js +1 -0
  65. package/dist/i18n/create.js.map +1 -1
  66. package/dist/i18n/locale.d.ts +5 -4
  67. package/dist/i18n/locale.d.ts.map +1 -1
  68. package/dist/i18n/locale.js +4 -0
  69. package/dist/i18n/locale.js.map +1 -1
  70. package/dist/i18n/locales/de/ai.json.js +15 -0
  71. package/dist/i18n/locales/de/code.json.js +2 -0
  72. package/dist/i18n/locales/de/comments.json.js +1 -1
  73. package/dist/i18n/locales/de/panels.json.js +16 -1
  74. package/dist/i18n/locales/es/ai.json.js +15 -0
  75. package/dist/i18n/locales/es/code.json.js +2 -0
  76. package/dist/i18n/locales/es/comments.json.js +1 -1
  77. package/dist/i18n/locales/es/panels.json.js +16 -1
  78. package/dist/i18n/locales/fr/ai.json.js +15 -0
  79. package/dist/i18n/locales/fr/code.json.js +2 -0
  80. package/dist/i18n/locales/fr/comments.json.js +1 -1
  81. package/dist/i18n/locales/fr/panels.json.js +16 -1
  82. package/dist/i18n/locales/id/agents.json.js +31 -0
  83. package/dist/i18n/locales/id/agents.json.js.map +1 -0
  84. package/dist/i18n/locales/id/ai.json.js +608 -0
  85. package/dist/i18n/locales/id/ai.json.js.map +1 -0
  86. package/dist/i18n/locales/id/automation.json.js +150 -0
  87. package/dist/i18n/locales/id/automation.json.js.map +1 -0
  88. package/dist/i18n/locales/id/browser.json.js +50 -0
  89. package/dist/i18n/locales/id/browser.json.js.map +1 -0
  90. package/dist/i18n/locales/id/chat-context.json.js +62 -0
  91. package/dist/i18n/locales/id/chat-context.json.js.map +1 -0
  92. package/dist/i18n/locales/id/cloud/editor.json.js +337 -0
  93. package/dist/i18n/locales/id/cloud/editor.json.js.map +1 -0
  94. package/dist/i18n/locales/id/cloud/portal.json.js +435 -0
  95. package/dist/i18n/locales/id/cloud/portal.json.js.map +1 -0
  96. package/dist/i18n/locales/id/code.json.js +45 -0
  97. package/dist/i18n/locales/id/code.json.js.map +1 -0
  98. package/dist/i18n/locales/id/collaboration.json.js +84 -0
  99. package/dist/i18n/locales/id/collaboration.json.js.map +1 -0
  100. package/dist/i18n/locales/id/commands.json.js +111 -0
  101. package/dist/i18n/locales/id/commands.json.js.map +1 -0
  102. package/dist/i18n/locales/id/comments.json.js +37 -0
  103. package/dist/i18n/locales/id/comments.json.js.map +1 -0
  104. package/dist/i18n/locales/id/common.json.js +51 -0
  105. package/dist/i18n/locales/id/common.json.js.map +1 -0
  106. package/dist/i18n/locales/id/credentials.json.js +21 -0
  107. package/dist/i18n/locales/id/credentials.json.js.map +1 -0
  108. package/dist/i18n/locales/id/design-check.json.js +101 -0
  109. package/dist/i18n/locales/id/design-check.json.js.map +1 -0
  110. package/dist/i18n/locales/id/design-memory.json.js +61 -0
  111. package/dist/i18n/locales/id/design-memory.json.js.map +1 -0
  112. package/dist/i18n/locales/id/diagnostics.json.js +78 -0
  113. package/dist/i18n/locales/id/diagnostics.json.js.map +1 -0
  114. package/dist/i18n/locales/id/editor.json.js +62 -0
  115. package/dist/i18n/locales/id/editor.json.js.map +1 -0
  116. package/dist/i18n/locales/id/explore.json.js +30 -0
  117. package/dist/i18n/locales/id/explore.json.js.map +1 -0
  118. package/dist/i18n/locales/id/figjam.json.js +39 -0
  119. package/dist/i18n/locales/id/figjam.json.js.map +1 -0
  120. package/dist/i18n/locales/id/files.json.js +86 -0
  121. package/dist/i18n/locales/id/files.json.js.map +1 -0
  122. package/dist/i18n/locales/id/fonts.json.js +54 -0
  123. package/dist/i18n/locales/id/fonts.json.js.map +1 -0
  124. package/dist/i18n/locales/id/index.js +85 -0
  125. package/dist/i18n/locales/id/index.js.map +1 -0
  126. package/dist/i18n/locales/id/media.json.js +52 -0
  127. package/dist/i18n/locales/id/media.json.js.map +1 -0
  128. package/dist/i18n/locales/id/menu.json.js +118 -0
  129. package/dist/i18n/locales/id/menu.json.js.map +1 -0
  130. package/dist/i18n/locales/id/pages.json.js +16 -0
  131. package/dist/i18n/locales/id/pages.json.js.map +1 -0
  132. package/dist/i18n/locales/id/panels.json.js +838 -0
  133. package/dist/i18n/locales/id/panels.json.js.map +1 -0
  134. package/dist/i18n/locales/id/recovery.json.js +36 -0
  135. package/dist/i18n/locales/id/recovery.json.js.map +1 -0
  136. package/dist/i18n/locales/id/rename.json.js +19 -0
  137. package/dist/i18n/locales/id/rename.json.js.map +1 -0
  138. package/dist/i18n/locales/id/rendering.json.js +18 -0
  139. package/dist/i18n/locales/id/rendering.json.js.map +1 -0
  140. package/dist/i18n/locales/id/settings.json.js +169 -0
  141. package/dist/i18n/locales/id/settings.json.js.map +1 -0
  142. package/dist/i18n/locales/id/shaders.json.js +24 -0
  143. package/dist/i18n/locales/id/shaders.json.js.map +1 -0
  144. package/dist/i18n/locales/id/shapes.json.js +48 -0
  145. package/dist/i18n/locales/id/shapes.json.js.map +1 -0
  146. package/dist/i18n/locales/id/slides.json.js +27 -0
  147. package/dist/i18n/locales/id/slides.json.js.map +1 -0
  148. package/dist/i18n/locales/id/statuses.json.js +38 -0
  149. package/dist/i18n/locales/id/statuses.json.js.map +1 -0
  150. package/dist/i18n/locales/id/storage.json.js +21 -0
  151. package/dist/i18n/locales/id/storage.json.js.map +1 -0
  152. package/dist/i18n/locales/id/tools.json.js +27 -0
  153. package/dist/i18n/locales/id/tools.json.js.map +1 -0
  154. package/dist/i18n/locales/id/updates.json.js +31 -0
  155. package/dist/i18n/locales/id/updates.json.js.map +1 -0
  156. package/dist/i18n/locales/id/variables/panel.json.js +175 -0
  157. package/dist/i18n/locales/id/variables/panel.json.js.map +1 -0
  158. package/dist/i18n/locales/id/variables/types.json.js +15 -0
  159. package/dist/i18n/locales/id/variables/types.json.js.map +1 -0
  160. package/dist/i18n/locales/id/variations.json.js +23 -0
  161. package/dist/i18n/locales/id/variations.json.js.map +1 -0
  162. package/dist/i18n/locales/it/ai.json.js +15 -0
  163. package/dist/i18n/locales/it/code.json.js +2 -0
  164. package/dist/i18n/locales/it/comments.json.js +1 -1
  165. package/dist/i18n/locales/it/panels.json.js +16 -1
  166. package/dist/i18n/locales/ja/ai.json.js +15 -0
  167. package/dist/i18n/locales/ja/code.json.js +2 -0
  168. package/dist/i18n/locales/ja/comments.json.js +1 -1
  169. package/dist/i18n/locales/ja/panels.json.js +16 -1
  170. package/dist/i18n/locales/pl/ai.json.js +15 -0
  171. package/dist/i18n/locales/pl/code.json.js +2 -0
  172. package/dist/i18n/locales/pl/comments.json.js +1 -1
  173. package/dist/i18n/locales/pl/panels.json.js +16 -1
  174. package/dist/i18n/locales/ru/ai.json.js +15 -0
  175. package/dist/i18n/locales/ru/code.json.js +2 -0
  176. package/dist/i18n/locales/ru/comments.json.js +1 -1
  177. package/dist/i18n/locales/ru/panels.json.js +16 -1
  178. package/dist/i18n/locales/zh-cn/ai.json.js +15 -0
  179. package/dist/i18n/locales/zh-cn/code.json.js +2 -0
  180. package/dist/i18n/locales/zh-cn/comments.json.js +1 -1
  181. package/dist/i18n/locales/zh-cn/panels.json.js +16 -1
  182. package/dist/i18n/messages/ai.d.ts +33 -0
  183. package/dist/i18n/messages/ai.d.ts.map +1 -1
  184. package/dist/i18n/messages/ai.js +17 -0
  185. package/dist/i18n/messages/ai.js.map +1 -1
  186. package/dist/i18n/messages/code.d.ts +4 -0
  187. package/dist/i18n/messages/code.d.ts.map +1 -1
  188. package/dist/i18n/messages/code.js +3 -1
  189. package/dist/i18n/messages/code.js.map +1 -1
  190. package/dist/i18n/messages/comments.d.ts +2 -2
  191. package/dist/i18n/messages/comments.js +2 -2
  192. package/dist/i18n/messages/comments.js.map +1 -1
  193. package/dist/i18n/messages/panels.d.ts +17 -0
  194. package/dist/i18n/messages/panels.d.ts.map +1 -1
  195. package/dist/i18n/messages/panels.js +15 -0
  196. package/dist/i18n/messages/panels.js.map +1 -1
  197. package/dist/i18n/messages.d.ts +53 -1
  198. package/dist/i18n/useI18n.d.ts +212 -4
  199. package/dist/i18n/useI18n.d.ts.map +1 -1
  200. package/dist/primitives/ColorPicker/ColorInputRoot.vue.d.ts +6 -0
  201. package/dist/primitives/ColorPicker/ColorInputRoot.vue.d.ts.map +1 -1
  202. package/dist/primitives/ColorPicker/ColorInputRoot.vue.js +3 -1
  203. package/dist/primitives/ColorPicker/ColorInputRoot.vue.js.map +1 -1
  204. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts +6 -0
  205. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts.map +1 -1
  206. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js +3 -2
  207. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js.map +1 -1
  208. package/dist/primitives/Fill/FillRoot.vue.d.ts +2 -1
  209. package/dist/primitives/Fill/FillRoot.vue.d.ts.map +1 -1
  210. package/dist/primitives/Fill/FillRoot.vue.js +5 -2
  211. package/dist/primitives/Fill/FillRoot.vue.js.map +1 -1
  212. package/dist/primitives/Fill/FillSwatch.vue.d.ts.map +1 -1
  213. package/dist/primitives/Fill/FillSwatch.vue.js +2 -1
  214. package/dist/primitives/Fill/FillSwatch.vue.js.map +1 -1
  215. package/dist/primitives/Fill/types.d.ts +6 -1
  216. package/dist/primitives/Fill/types.d.ts.map +1 -1
  217. package/dist/primitives/Fill/useFill.d.ts +10 -4
  218. package/dist/primitives/Fill/useFill.d.ts.map +1 -1
  219. package/dist/primitives/Fill/useFill.js +14 -10
  220. package/dist/primitives/Fill/useFill.js.map +1 -1
  221. package/dist/primitives/GradientEditor/GradientEditorRoot.vue.d.ts +2 -1
  222. package/dist/primitives/GradientEditor/GradientEditorRoot.vue.d.ts.map +1 -1
  223. package/dist/primitives/GradientEditor/GradientEditorRoot.vue.js +5 -2
  224. package/dist/primitives/GradientEditor/GradientEditorRoot.vue.js.map +1 -1
  225. package/dist/primitives/GradientEditor/GradientEditorStop.vue.d.ts.map +1 -1
  226. package/dist/primitives/GradientEditor/GradientEditorStop.vue.js +4 -3
  227. package/dist/primitives/GradientEditor/GradientEditorStop.vue.js.map +1 -1
  228. package/dist/primitives/GradientEditor/types.d.ts +3 -1
  229. package/dist/primitives/GradientEditor/types.d.ts.map +1 -1
  230. package/dist/primitives/GradientEditor/useGradientStops.d.ts +5 -3
  231. package/dist/primitives/GradientEditor/useGradientStops.d.ts.map +1 -1
  232. package/dist/primitives/GradientEditor/useGradientStops.js +9 -4
  233. package/dist/primitives/GradientEditor/useGradientStops.js.map +1 -1
  234. package/dist/primitives/LayerTree/LayerTreeRoot.vue.d.ts +6 -1
  235. package/dist/primitives/LayerTree/LayerTreeRoot.vue.d.ts.map +1 -1
  236. package/dist/primitives/LayerTree/LayerTreeRoot.vue.js +16 -1
  237. package/dist/primitives/LayerTree/LayerTreeRoot.vue.js.map +1 -1
  238. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ //#region src/controls/shader/shapes.d.ts
2
+ /**
3
+ * The shapes the `shaders` library draws for an effect that takes one, as `SHAPE3D_TYPES` in
4
+ * `shaders/core` names them. The list is local so the panel does not load the WebGPU library;
5
+ * `shapes.test.ts` keeps it equal to the library's.
6
+ */
7
+ declare const SHADER_SHAPES: readonly ["sphere3D", "cube3D", "torus3D", "octahedron3D", "cylinder3D", "capsule3D", "cone3D", "pyramid3D", "prism3D", "ellipsoid3D", "diamond3D", "link3D", "gem3D", "helix3D", "metaballs3D", "dodecahedron3D", "hemisphere3D", "ribbon3D", "blob3D", "gyroscope3D"];
8
+ type ShaderShape = (typeof SHADER_SHAPES)[number];
9
+ /** The type of the shape `value` holds, or '' when it holds none. */
10
+ declare function shaderShapeType(value: unknown): string;
11
+ /**
12
+ * `value` with its shape type set to `type`: the new shape's own geometry fills in where the
13
+ * old shape had none, and whatever the old shape set for the same fields is kept.
14
+ */
15
+ declare function withShapeType(value: unknown, type: string): string;
16
+ //#endregion
17
+ export { SHADER_SHAPES, ShaderShape, shaderShapeType, withShapeType };
18
+ //# sourceMappingURL=shapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapes.d.ts","names":[],"sources":["../../../src/controls/shader/shapes.ts"],"mappings":";;;;;;cAKa;KAuBD,sBAAsB;;iBA2ElB,gBAAgB;;;;;iBAShB,cAAc,gBAAgB"}
@@ -0,0 +1,227 @@
1
+ //#region src/controls/shader/shapes.ts
2
+ /**
3
+ * The shapes the `shaders` library draws for an effect that takes one, as `SHAPE3D_TYPES` in
4
+ * `shaders/core` names them. The list is local so the panel does not load the WebGPU library;
5
+ * `shapes.test.ts` keeps it equal to the library's.
6
+ */
7
+ const SHADER_SHAPES = [
8
+ "sphere3D",
9
+ "cube3D",
10
+ "torus3D",
11
+ "octahedron3D",
12
+ "cylinder3D",
13
+ "capsule3D",
14
+ "cone3D",
15
+ "pyramid3D",
16
+ "prism3D",
17
+ "ellipsoid3D",
18
+ "diamond3D",
19
+ "link3D",
20
+ "gem3D",
21
+ "helix3D",
22
+ "metaballs3D",
23
+ "dodecahedron3D",
24
+ "hemisphere3D",
25
+ "ribbon3D",
26
+ "blob3D",
27
+ "gyroscope3D"
28
+ ];
29
+ /** The geometry each shape starts from, as `SHAPE3D_DEFAULTS` in `shaders/core` gives it. */
30
+ const SHAPE_DEFAULTS = {
31
+ sphere3D: {
32
+ radius: .35,
33
+ rotX: 0,
34
+ rotY: 0,
35
+ rotZ: 0
36
+ },
37
+ cube3D: {
38
+ sizeX: .27,
39
+ sizeY: .27,
40
+ sizeZ: .27,
41
+ rounding: .02,
42
+ rotX: 25,
43
+ rotY: 35,
44
+ rotZ: 0
45
+ },
46
+ torus3D: {
47
+ radius: .3,
48
+ tube: .12,
49
+ rotX: 55,
50
+ rotY: 0,
51
+ rotZ: 0
52
+ },
53
+ octahedron3D: {
54
+ radius: .42,
55
+ rotX: 10,
56
+ rotY: 25,
57
+ rotZ: 0
58
+ },
59
+ cylinder3D: {
60
+ radius: .22,
61
+ height: .26,
62
+ rounding: .02,
63
+ rotX: 60,
64
+ rotY: 0,
65
+ rotZ: 30
66
+ },
67
+ capsule3D: {
68
+ radius: .16,
69
+ height: .2,
70
+ rotX: 0,
71
+ rotY: 0,
72
+ rotZ: 35
73
+ },
74
+ cone3D: {
75
+ radius: .3,
76
+ topRadius: .02,
77
+ height: .3,
78
+ rotX: 25,
79
+ rotY: 0,
80
+ rotZ: 15
81
+ },
82
+ pyramid3D: {
83
+ size: .3,
84
+ height: .45,
85
+ rotX: -10,
86
+ rotY: 30,
87
+ rotZ: 0
88
+ },
89
+ prism3D: {
90
+ radius: .28,
91
+ height: .14,
92
+ rotX: 25,
93
+ rotY: 30,
94
+ rotZ: 0
95
+ },
96
+ ellipsoid3D: {
97
+ radiusX: .38,
98
+ radiusY: .22,
99
+ radiusZ: .3,
100
+ rotX: 0,
101
+ rotY: 0,
102
+ rotZ: 20
103
+ },
104
+ diamond3D: {
105
+ radius: .3,
106
+ height: .42,
107
+ rotX: 15,
108
+ rotY: 0,
109
+ rotZ: 0
110
+ },
111
+ link3D: {
112
+ radius: .18,
113
+ length: .15,
114
+ tube: .08,
115
+ rotX: 20,
116
+ rotY: 30,
117
+ rotZ: 0
118
+ },
119
+ gem3D: {
120
+ radius: .3,
121
+ height: .32,
122
+ facets: 8,
123
+ rotX: 15,
124
+ rotY: 0,
125
+ rotZ: 0
126
+ },
127
+ helix3D: {
128
+ radius: .22,
129
+ tube: .06,
130
+ pitch: .16,
131
+ rotX: 20,
132
+ rotY: 0,
133
+ rotZ: 0
134
+ },
135
+ metaballs3D: {
136
+ balls: 4,
137
+ ballRadius: .16,
138
+ spread: .2,
139
+ blend: .12,
140
+ speed: 1,
141
+ rotX: 0,
142
+ rotY: 0,
143
+ rotZ: 0
144
+ },
145
+ dodecahedron3D: {
146
+ radius: .34,
147
+ rotX: 20,
148
+ rotY: 10,
149
+ rotZ: 0
150
+ },
151
+ hemisphere3D: {
152
+ radius: .4,
153
+ cut: 0,
154
+ rotX: 30,
155
+ rotY: 0,
156
+ rotZ: 0
157
+ },
158
+ ribbon3D: {
159
+ width: .15,
160
+ thickness: .03,
161
+ length: .38,
162
+ wave: .1,
163
+ waveFrequency: 7,
164
+ twist: 140,
165
+ speed: 1,
166
+ rotX: 12,
167
+ rotY: 18,
168
+ rotZ: 0
169
+ },
170
+ blob3D: {
171
+ radius: .3,
172
+ wobble: .07,
173
+ wobbliness: 5,
174
+ speed: 1,
175
+ rotX: 0,
176
+ rotY: 0,
177
+ rotZ: 0
178
+ },
179
+ gyroscope3D: {
180
+ radius: .34,
181
+ width: .1,
182
+ thickness: .028,
183
+ rounding: .006,
184
+ core: .14,
185
+ speed: 1,
186
+ rotX: 15,
187
+ rotY: 0,
188
+ rotZ: 0
189
+ }
190
+ };
191
+ /** The shape an effect's `shape` prop holds, as the library writes it: JSON with a `type`. */
192
+ function readShape(value) {
193
+ if (typeof value !== "string") return null;
194
+ try {
195
+ const parsed = JSON.parse(value);
196
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return null;
197
+ return parsed;
198
+ } catch {
199
+ return null;
200
+ }
201
+ }
202
+ /** The type of the shape `value` holds, or '' when it holds none. */
203
+ function shaderShapeType(value) {
204
+ const shape = readShape(value);
205
+ return typeof shape?.type === "string" ? shape.type : "";
206
+ }
207
+ /**
208
+ * `value` with its shape type set to `type`: the new shape's own geometry fills in where the
209
+ * old shape had none, and whatever the old shape set for the same fields is kept.
210
+ */
211
+ function withShapeType(value, type) {
212
+ const shape = readShape(value);
213
+ if (shape?.type === type) return value;
214
+ const defaults = SHADER_SHAPES.includes(type) ? SHAPE_DEFAULTS[type] : {};
215
+ return JSON.stringify(shape ? {
216
+ ...defaults,
217
+ ...shape,
218
+ type
219
+ } : {
220
+ ...defaults,
221
+ type
222
+ });
223
+ }
224
+ //#endregion
225
+ export { SHADER_SHAPES, shaderShapeType, withShapeType };
226
+
227
+ //# sourceMappingURL=shapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapes.js","names":[],"sources":["../../../src/controls/shader/shapes.ts"],"sourcesContent":["/**\n * The shapes the `shaders` library draws for an effect that takes one, as `SHAPE3D_TYPES` in\n * `shaders/core` names them. The list is local so the panel does not load the WebGPU library;\n * `shapes.test.ts` keeps it equal to the library's.\n */\nexport const SHADER_SHAPES = [\n 'sphere3D',\n 'cube3D',\n 'torus3D',\n 'octahedron3D',\n 'cylinder3D',\n 'capsule3D',\n 'cone3D',\n 'pyramid3D',\n 'prism3D',\n 'ellipsoid3D',\n 'diamond3D',\n 'link3D',\n 'gem3D',\n 'helix3D',\n 'metaballs3D',\n 'dodecahedron3D',\n 'hemisphere3D',\n 'ribbon3D',\n 'blob3D',\n 'gyroscope3D'\n] as const\n\nexport type ShaderShape = (typeof SHADER_SHAPES)[number]\n\n/** The geometry each shape starts from, as `SHAPE3D_DEFAULTS` in `shaders/core` gives it. */\nconst SHAPE_DEFAULTS: Readonly<Record<ShaderShape, Readonly<Record<string, number>>>> = {\n sphere3D: { radius: 0.35, rotX: 0, rotY: 0, rotZ: 0 },\n cube3D: { sizeX: 0.27, sizeY: 0.27, sizeZ: 0.27, rounding: 0.02, rotX: 25, rotY: 35, rotZ: 0 },\n torus3D: { radius: 0.3, tube: 0.12, rotX: 55, rotY: 0, rotZ: 0 },\n octahedron3D: { radius: 0.42, rotX: 10, rotY: 25, rotZ: 0 },\n cylinder3D: { radius: 0.22, height: 0.26, rounding: 0.02, rotX: 60, rotY: 0, rotZ: 30 },\n capsule3D: { radius: 0.16, height: 0.2, rotX: 0, rotY: 0, rotZ: 35 },\n cone3D: { radius: 0.3, topRadius: 0.02, height: 0.3, rotX: 25, rotY: 0, rotZ: 15 },\n pyramid3D: { size: 0.3, height: 0.45, rotX: -10, rotY: 30, rotZ: 0 },\n prism3D: { radius: 0.28, height: 0.14, rotX: 25, rotY: 30, rotZ: 0 },\n ellipsoid3D: { radiusX: 0.38, radiusY: 0.22, radiusZ: 0.3, rotX: 0, rotY: 0, rotZ: 20 },\n diamond3D: { radius: 0.3, height: 0.42, rotX: 15, rotY: 0, rotZ: 0 },\n link3D: { radius: 0.18, length: 0.15, tube: 0.08, rotX: 20, rotY: 30, rotZ: 0 },\n gem3D: { radius: 0.3, height: 0.32, facets: 8, rotX: 15, rotY: 0, rotZ: 0 },\n helix3D: { radius: 0.22, tube: 0.06, pitch: 0.16, rotX: 20, rotY: 0, rotZ: 0 },\n metaballs3D: {\n balls: 4,\n ballRadius: 0.16,\n spread: 0.2,\n blend: 0.12,\n speed: 1,\n rotX: 0,\n rotY: 0,\n rotZ: 0\n },\n dodecahedron3D: { radius: 0.34, rotX: 20, rotY: 10, rotZ: 0 },\n hemisphere3D: { radius: 0.4, cut: 0, rotX: 30, rotY: 0, rotZ: 0 },\n ribbon3D: {\n width: 0.15,\n thickness: 0.03,\n length: 0.38,\n wave: 0.1,\n waveFrequency: 7,\n twist: 140,\n speed: 1,\n rotX: 12,\n rotY: 18,\n rotZ: 0\n },\n blob3D: { radius: 0.3, wobble: 0.07, wobbliness: 5, speed: 1, rotX: 0, rotY: 0, rotZ: 0 },\n gyroscope3D: {\n radius: 0.34,\n width: 0.1,\n thickness: 0.028,\n rounding: 0.006,\n core: 0.14,\n speed: 1,\n rotX: 15,\n rotY: 0,\n rotZ: 0\n }\n}\n\n/** The fields a shape's JSON holds: a type, and whatever that shape's geometry needs. */\ninterface ShaderShapeFields {\n type?: unknown\n [field: string]: unknown\n}\n\n/** The shape an effect's `shape` prop holds, as the library writes it: JSON with a `type`. */\nfunction readShape(value: unknown): ShaderShapeFields | null {\n if (typeof value !== 'string') return null\n try {\n const parsed: unknown = JSON.parse(value)\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return null\n return parsed as ShaderShapeFields\n } catch {\n return null\n }\n}\n\n/** The type of the shape `value` holds, or '' when it holds none. */\nexport function shaderShapeType(value: unknown): string {\n const shape = readShape(value)\n return typeof shape?.type === 'string' ? shape.type : ''\n}\n\n/**\n * `value` with its shape type set to `type`: the new shape's own geometry fills in where the\n * old shape had none, and whatever the old shape set for the same fields is kept.\n */\nexport function withShapeType(value: unknown, type: string): string {\n const shape = readShape(value)\n if (shape?.type === type) return value as string\n const defaults = SHADER_SHAPES.includes(type as ShaderShape)\n ? SHAPE_DEFAULTS[type as ShaderShape]\n : {}\n return JSON.stringify(shape ? { ...defaults, ...shape, type } : { ...defaults, type })\n}\n"],"mappings":";;;;;;AAKA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAKA,MAAM,iBAAkF;CACtF,UAAU;EAAE,QA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/** One colour stop of a shader effect's gradient, as the `shaders` library takes it. */
3
+ interface ShaderStop {
4
+ color: string;
5
+ position: number;
6
+ }
7
+ /** The stops a preset's gradient value holds, sorted along the ramp, positions within it. */
8
+ declare function shaderStops(value: unknown): ShaderStop[];
9
+ /** `stops` with stop `index` at `position`, kept within the ramp. */
10
+ declare function setStopPosition(stops: readonly ShaderStop[], index: number, position: number): ShaderStop[];
11
+ /** `stops` with stop `index` painted `color`. */
12
+ declare function setStopColor(stops: readonly ShaderStop[], index: number, color: string): ShaderStop[];
13
+ /**
14
+ * `stops` with a stop in the widest gap between two, painted the colour on its left, so adding
15
+ * one never flashes a colour the shader did not already show.
16
+ */
17
+ declare function addStop(stops: readonly ShaderStop[]): ShaderStop[];
18
+ /** `stops` without stop `index`; the last two stay, since a ramp needs two. */
19
+ declare function removeStop(stops: readonly ShaderStop[], index: number): ShaderStop[];
20
+ //#endregion
21
+ export { ShaderStop, addStop, removeStop, setStopColor, setStopPosition, shaderStops };
22
+ //# sourceMappingURL=stops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stops.d.ts","names":[],"sources":["../../../src/controls/shader/stops.ts"],"mappings":";;UACiB;EACf;EACA;;;iBAmBc,YAAY,iBAAiB;;iBAS7B,gBACd,gBAAgB,cAChB,eACA,mBACC;;iBAMa,aACd,gBAAgB,cAChB,eACA,gBACC;;;;;iBAQa,QAAQ,gBAAgB,eAAe;;iBAyBvC,WAAW,gBAAgB,cAAc,gBAAgB"}
@@ -0,0 +1,73 @@
1
+ //#region src/controls/shader/stops.ts
2
+ /** The least stops a gradient keeps: fewer stops are a colour, not a ramp. */
3
+ const MIN_STOPS = 2;
4
+ function isStop(value) {
5
+ return typeof value === "object" && value !== null && "color" in value && typeof value.color === "string" && "position" in value && typeof value.position === "number" && Number.isFinite(value.position);
6
+ }
7
+ /** The stops a preset's gradient value holds, sorted along the ramp, positions within it. */
8
+ function shaderStops(value) {
9
+ if (!Array.isArray(value)) return [];
10
+ return value.filter(isStop).map((stop) => ({
11
+ color: stop.color,
12
+ position: Math.min(1, Math.max(0, stop.position))
13
+ })).sort((a, b) => a.position - b.position);
14
+ }
15
+ /** `stops` with stop `index` at `position`, kept within the ramp. */
16
+ function setStopPosition(stops, index, position) {
17
+ const clamped = Math.min(1, Math.max(0, position));
18
+ return stops.map((stop, at) => at === index ? {
19
+ ...stop,
20
+ position: clamped
21
+ } : stop);
22
+ }
23
+ /** `stops` with stop `index` painted `color`. */
24
+ function setStopColor(stops, index, color) {
25
+ return stops.map((stop, at) => at === index ? {
26
+ ...stop,
27
+ color
28
+ } : stop);
29
+ }
30
+ /**
31
+ * `stops` with a stop in the widest gap between two, painted the colour on its left, so adding
32
+ * one never flashes a colour the shader did not already show.
33
+ */
34
+ function addStop(stops) {
35
+ if (stops.length === 0) return [{
36
+ color: "#000000",
37
+ position: 0
38
+ }, {
39
+ color: "#ffffff",
40
+ position: 1
41
+ }];
42
+ const sorted = shaderStops(stops);
43
+ let widest = 0;
44
+ let at = 0;
45
+ for (let index = 1; index < sorted.length; index++) {
46
+ const gap = (sorted[index]?.position ?? 1) - (sorted[index - 1]?.position ?? 0);
47
+ if (gap > widest) {
48
+ widest = gap;
49
+ at = index;
50
+ }
51
+ }
52
+ const left = sorted.at(Math.max(0, at - 1));
53
+ const right = sorted.at(Math.min(sorted.length - 1, at));
54
+ const position = ((left?.position ?? 0) + (right?.position ?? 1)) / 2;
55
+ const added = {
56
+ color: left?.color ?? "#000000",
57
+ position
58
+ };
59
+ return [
60
+ ...sorted.slice(0, at),
61
+ added,
62
+ ...sorted.slice(at)
63
+ ];
64
+ }
65
+ /** `stops` without stop `index`; the last two stay, since a ramp needs two. */
66
+ function removeStop(stops, index) {
67
+ if (stops.length <= MIN_STOPS) return [...stops];
68
+ return stops.filter((_, at) => at !== index);
69
+ }
70
+ //#endregion
71
+ export { addStop, removeStop, setStopColor, setStopPosition, shaderStops };
72
+
73
+ //# sourceMappingURL=stops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stops.js","names":[],"sources":["../../../src/controls/shader/stops.ts"],"sourcesContent":["/** One colour stop of a shader effect's gradient, as the `shaders` library takes it. */\nexport interface ShaderStop {\n color: string\n position: number\n}\n\n/** The least stops a gradient keeps: fewer stops are a colour, not a ramp. */\nconst MIN_STOPS = 2\n\nfunction isStop(value: unknown): value is ShaderStop {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'color' in value &&\n typeof value.color === 'string' &&\n 'position' in value &&\n typeof value.position === 'number' &&\n Number.isFinite(value.position)\n )\n}\n\n/** The stops a preset's gradient value holds, sorted along the ramp, positions within it. */\nexport function shaderStops(value: unknown): ShaderStop[] {\n if (!Array.isArray(value)) return []\n return value\n .filter(isStop)\n .map((stop) => ({ color: stop.color, position: Math.min(1, Math.max(0, stop.position)) }))\n .sort((a, b) => a.position - b.position)\n}\n\n/** `stops` with stop `index` at `position`, kept within the ramp. */\nexport function setStopPosition(\n stops: readonly ShaderStop[],\n index: number,\n position: number\n): ShaderStop[] {\n const clamped = Math.min(1, Math.max(0, position))\n return stops.map((stop, at) => (at === index ? { ...stop, position: clamped } : stop))\n}\n\n/** `stops` with stop `index` painted `color`. */\nexport function setStopColor(\n stops: readonly ShaderStop[],\n index: number,\n color: string\n): ShaderStop[] {\n return stops.map((stop, at) => (at === index ? { ...stop, color } : stop))\n}\n\n/**\n * `stops` with a stop in the widest gap between two, painted the colour on its left, so adding\n * one never flashes a colour the shader did not already show.\n */\nexport function addStop(stops: readonly ShaderStop[]): ShaderStop[] {\n if (stops.length === 0) {\n return [\n { color: '#000000', position: 0 },\n { color: '#ffffff', position: 1 }\n ]\n }\n const sorted = shaderStops(stops)\n let widest = 0\n let at = 0\n for (let index = 1; index < sorted.length; index++) {\n const gap = (sorted[index]?.position ?? 1) - (sorted[index - 1]?.position ?? 0)\n if (gap > widest) {\n widest = gap\n at = index\n }\n }\n const left = sorted.at(Math.max(0, at - 1))\n const right = sorted.at(Math.min(sorted.length - 1, at))\n const position = ((left?.position ?? 0) + (right?.position ?? 1)) / 2\n const added = { color: left?.color ?? '#000000', position }\n return [...sorted.slice(0, at), added, ...sorted.slice(at)]\n}\n\n/** `stops` without stop `index`; the last two stay, since a ramp needs two. */\nexport function removeStop(stops: readonly ShaderStop[], index: number): ShaderStop[] {\n if (stops.length <= MIN_STOPS) return [...stops]\n return stops.filter((_, at) => at !== index)\n}\n"],"mappings":";;AAOA,MAAM,YAAY;AAElB,SAAS,OAAO,OAAqC;CACnD,OACE,OAAO,UAAU,YACjB,UAAU,QACV,WAAW,SACX,OAAO,MAAM,UAAU,YACvB,cAAc,SACd,OAAO,MAAM,aAAa,YAC1B,OAAO,SAAS,MAAM,QAAQ;AAElC;;AAGA,SAAgB,YAAY,OAA8B;CACxD,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;CACnC,OAAO,MACJ,OAAO,MAAM,CAAC,CACd,KAAK,UAAU;EAAE,OAAO,KAAK;EAAO,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,QAAQ,CAAC;CAAE,EAAE,CAAC,CACzF,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,QAAQ;AAC3C;;AAGA,SAAgB,gBACd,OACA,OACA,UACc;CACd,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,QAAQ,CAAC;CACjD,OAAO,MAAM,KAAK,MAAM,OAAQ,OAAO,QAAQ;EAAE,GAAG;EAAM,UAAU;CAAQ,IAAI,IAAK;AACvF;;AAGA,SAAgB,aACd,OACA,OACA,OACc;CACd,OAAO,MAAM,KAAK,MAAM,OAAQ,OAAO,QAAQ;EAAE,GAAG;EAAM;CAAM,IAAI,IAAK;AAC3E;;;;;AAMA,SAAgB,QAAQ,OAA4C;CAClE,IAAI,MAAM,WAAW,GACnB,OAAO,CACL;EAAE,OAAO;EAAW,UAAU;CAAE,GAChC;EAAE,OAAO;EAAW,UAAU;CAAE,CAClC;CAEF,MAAM,SAAS,YAAY,KAAK;CAChC,IAAI,SAAS;CACb,IAAI,KAAK;CACT,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,QAAQ,SAAS;EAClD,MAAM,OAAO,OAAO,MAAM,EAAE,YAAY,MAAM,OAAO,QAAQ,EAAE,EAAE,YAAY;EAC7E,IAAI,MAAM,QAAQ;GAChB,SAAS;GACT,KAAK;EACP;CACF;CACA,MAAM,OAAO,OAAO,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,CAAC;CAC1C,MAAM,QAAQ,OAAO,GAAG,KAAK,IAAI,OAAO,SAAS,GAAG,EAAE,CAAC;CACvD,MAAM,aAAa,MAAM,YAAY,MAAM,OAAO,YAAY,MAAM;CACpE,MAAM,QAAQ;EAAE,OAAO,MAAM,SAAS;EAAW;CAAS;CAC1D,OAAO;EAAC,GAAG,OAAO,MAAM,GAAG,EAAE;EAAG;EAAO,GAAG,OAAO,MAAM,EAAE;CAAC;AAC5D;;AAGA,SAAgB,WAAW,OAA8B,OAA6B;CACpF,IAAI,MAAM,UAAU,WAAW,OAAO,CAAC,GAAG,KAAK;CAC/C,OAAO,MAAM,QAAQ,GAAG,OAAO,OAAO,KAAK;AAC7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","names":[],"sources":["../../../src/controls/variable-modes/helpers.ts"],"mappings":";;;;;KAcY,qBAAqB,KAAK;;UAGrB;EACf;EACA;;EAEA;EACA,OAAO;;EAEP,OAAO;;EAEP,WAAW;;;;;;iBAiBG,oBAAoB,QAAQ,QAAQ,SAAS,cAAc;;;;;iBAqC3D,gBACd,QAAQ,QACR,SAAS,aACT,sBACA"}
1
+ {"version":3,"file":"helpers.d.ts","names":[],"sources":["../../../src/controls/variable-modes/helpers.ts"],"mappings":";;;;;KAcY,qBAAqB,KAAK;;UAGrB;EACf;EACA;;EAEA;EACA,OAAO;;EAEP,OAAO;;EAEP,WAAW;;;;;;iBAiBG,oBAAoB,QAAQ,QAAQ,SAAS,cAAc;;;;;iBAsC3D,gBACd,QAAQ,QACR,SAAS,aACT,sBACA"}
@@ -21,11 +21,13 @@ function shared(values) {
21
21
  function variableModeChoices(editor, targets) {
22
22
  if (targets.length === 0) return [];
23
23
  const { graph } = editor;
24
- const used = targets.every((target) => target.type === "CANVAS") ? null : collectionsBoundIn(graph, targets.map((target) => target.id));
24
+ const holders = targets.every((target) => target.type === "CANVAS");
25
+ let used;
26
+ const bound = (id) => (used ??= collectionsBoundIn(graph, targets.map((target) => target.id))).has(id);
25
27
  const choices = [];
26
28
  for (const collection of graph.variableCollections.values()) {
27
29
  if (collection.modes.length < 2) continue;
28
- if (used && !used.has(collection.id)) continue;
30
+ if ((!holders || collection.deleted) && !bound(collection.id)) continue;
29
31
  const inherited = shared(targets.map((target) => target.parentId ? graph.getNodeVariableModeId(target.parentId, collection.id) : collection.defaultModeId));
30
32
  choices.push({
31
33
  collectionId: collection.id,
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/controls/variable-modes/helpers.ts"],"sourcesContent":["import { omit } from 'es-toolkit'\n\nimport type { Editor } from '@pairdraw/core'\nimport {\n isLibraryCollection,\n type SceneNode,\n type VariableCollection,\n type VariableCollectionMode\n} from '@pairdraw/scene-graph'\nimport { collectionsBoundIn } from '@pairdraw/scene-graph/variables'\n\nimport { MIXED, type MixedValue } from '#vue/controls/node-props/use'\n\n/** A mode as the control lists it. */\nexport type VariableModeOption = Pick<VariableCollectionMode, 'modeId' | 'name'>\n\n/** One collection a variable mode can be set for, as Figma's Apply variable mode menu lists it. */\nexport interface VariableModeChoice {\n collectionId: string\n name: string\n /** Whether the collection is a library's copy rather than the file's own. */\n library: boolean\n modes: VariableModeOption[]\n /** The mode every target sets, MIXED when they differ, or null when none sets one (Auto). */\n value: MixedValue<string | null>\n /** The mode the targets show without one of their own, null when they would show different ones. */\n inherited: VariableModeOption | null\n}\n\nfunction modeOption(collection: VariableCollection, modeId: string): VariableModeOption | null {\n const mode = collection.modes.find((candidate) => candidate.modeId === modeId)\n return mode ? { modeId: mode.modeId, name: mode.name } : null\n}\n\nfunction shared<T>(values: readonly T[]): MixedValue<T> {\n const [first] = values\n return values.every((value) => value === first) ? first : MIXED\n}\n\n/**\n * The collections a mode can be set for on `targets`, as Figma offers them: those with more than\n * one mode whose variables the targets' layers use, or every such collection for a page.\n */\nexport function variableModeChoices(editor: Editor, targets: SceneNode[]): VariableModeChoice[] {\n if (targets.length === 0) return []\n const { graph } = editor\n const page = targets.every((target) => target.type === 'CANVAS')\n const used = page\n ? null\n : collectionsBoundIn(\n graph,\n targets.map((target) => target.id)\n )\n const choices: VariableModeChoice[] = []\n for (const collection of graph.variableCollections.values()) {\n if (collection.modes.length < 2) continue\n if (used && !used.has(collection.id)) continue\n const inherited = shared(\n targets.map((target) =>\n target.parentId\n ? graph.getNodeVariableModeId(target.parentId, collection.id)\n : collection.defaultModeId\n )\n )\n choices.push({\n collectionId: collection.id,\n name: collection.name,\n library: isLibraryCollection(collection),\n modes: collection.modes.map((mode) => ({ modeId: mode.modeId, name: mode.name })),\n value: shared(targets.map((target) => target.variableModes[collection.id] ?? null)),\n inherited: inherited === MIXED ? null : modeOption(collection, inherited)\n })\n }\n return choices\n}\n\n/**\n * Sets the mode `targets` show for a collection, or clears it with null so they inherit their\n * parent's again, in one undo step.\n */\nexport function setVariableMode(\n editor: Editor,\n targets: SceneNode[],\n collectionId: string,\n modeId: string | null\n): void {\n const changed = targets.filter(\n (target) => (target.variableModes[collectionId] ?? null) !== modeId\n )\n if (changed.length === 0) return\n const label = modeId ? 'Apply variable mode' : 'Remove variable mode'\n editor.undo.runBatch(label, () => {\n for (const target of changed) {\n const others = omit(target.variableModes, [collectionId])\n const variableModes = modeId ? { ...others, [collectionId]: modeId } : others\n editor.updateNodeWithUndo(target.id, { variableModes }, label)\n }\n })\n}\n"],"mappings":";;;;;AA6BA,SAAS,WAAW,YAAgC,QAA2C;CAC7F,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,UAAU,WAAW,MAAM;CAC7E,OAA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M,UAAU,SAAS;GAC5B,MAAM,SAAS,KAAK,OAAO,eAAe,CAAC,YAAY,CAAC;GACxD,MAAM,gBAAgB,SAAS;IAAE,GAAG;KAAS,eAAe;GAAO,IAAI;GACvE,OAAO,mBAAmB,OAAO,IAAI,EAAE,cAAc,GAAG,KAAK;EAC/D;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/controls/variable-modes/helpers.ts"],"sourcesContent":["import { omit } from 'es-toolkit'\n\nimport type { Editor } from '@pairdraw/core'\nimport {\n isLibraryCollection,\n type SceneNode,\n type VariableCollection,\n type VariableCollectionMode\n} from '@pairdraw/scene-graph'\nimport { collectionsBoundIn } from '@pairdraw/scene-graph/variables'\n\nimport { MIXED, type MixedValue } from '#vue/controls/node-props/use'\n\n/** A mode as the control lists it. */\nexport type VariableModeOption = Pick<VariableCollectionMode, 'modeId' | 'name'>\n\n/** One collection a variable mode can be set for, as Figma's Apply variable mode menu lists it. */\nexport interface VariableModeChoice {\n collectionId: string\n name: string\n /** Whether the collection is a library's copy rather than the file's own. */\n library: boolean\n modes: VariableModeOption[]\n /** The mode every target sets, MIXED when they differ, or null when none sets one (Auto). */\n value: MixedValue<string | null>\n /** The mode the targets show without one of their own, null when they would show different ones. */\n inherited: VariableModeOption | null\n}\n\nfunction modeOption(collection: VariableCollection, modeId: string): VariableModeOption | null {\n const mode = collection.modes.find((candidate) => candidate.modeId === modeId)\n return mode ? { modeId: mode.modeId, name: mode.name } : null\n}\n\nfunction shared<T>(values: readonly T[]): MixedValue<T> {\n const [first] = values\n return values.every((value) => value === first) ? first : MIXED\n}\n\n/**\n * The collections a mode can be set for on `targets`, as Figma offers them: those with more than\n * one mode whose variables the targets' layers use, or every such collection for a page.\n */\nexport function variableModeChoices(editor: Editor, targets: SceneNode[]): VariableModeChoice[] {\n if (targets.length === 0) return []\n const { graph } = editor\n const holders = targets.every((target) => target.type === 'CANVAS')\n let used: Set<string> | undefined\n const bound = (id: string) =>\n (used ??= collectionsBoundIn(\n graph,\n targets.map((target) => target.id)\n )).has(id)\n const choices: VariableModeChoice[] = []\n for (const collection of graph.variableCollections.values()) {\n if (collection.modes.length < 2) continue\n // A deleted collection is offered only where its variables are still bound, in what it holds.\n if ((!holders || collection.deleted) && !bound(collection.id)) continue\n const inherited = shared(\n targets.map((target) =>\n target.parentId\n ? graph.getNodeVariableModeId(target.parentId, collection.id)\n : collection.defaultModeId\n )\n )\n choices.push({\n collectionId: collection.id,\n name: collection.name,\n library: isLibraryCollection(collection),\n modes: collection.modes.map((mode) => ({ modeId: mode.modeId, name: mode.name })),\n value: shared(targets.map((target) => target.variableModes[collection.id] ?? null)),\n inherited: inherited === MIXED ? null : modeOption(collection, inherited)\n })\n }\n return choices\n}\n\n/**\n * Sets the mode `targets` show for a collection, or clears it with null so they inherit their\n * parent's again, in one undo step.\n */\nexport function setVariableMode(\n editor: Editor,\n targets: SceneNode[],\n collectionId: string,\n modeId: string | null\n): void {\n const changed = targets.filter(\n (target) => (target.variableModes[collectionId] ?? null) !== modeId\n )\n if (changed.length === 0) return\n const label = modeId ? 'Apply variable mode' : 'Remove variable mode'\n editor.undo.runBatch(label, () => {\n for (const target of changed) {\n const others = omit(target.variableModes, [collectionId])\n const variableModes = modeId ? { ...others, [collectionId]: modeId } : others\n editor.updateNodeWithUndo(target.id, { variableModes }, label)\n }\n })\n}\n"],"mappings":";;;;;AA6BA,SAAS,WAAW,YAAgC,QAA2C;CAC7F,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,UAAU,WAAW,MAAM;CAC7E,OAAO,OAAO;EAAE,QAAQ,KAAK;EAAQ,MAAM,KAAK;CAAK,IAAI;AAC3D;AAEA,SAAS,OAAU,QAAqC;CACtD,MAAM,CAAC,SAAS;CAChB,OAAO,OAAO,OAAO,UAAU,UAAU,KAAK,IAAI,QAAQ;AAC5D;;;;;AAMA,SAAgB,oBAAoB,QAAgB,SAA4C;CAC9F,IAAI,QAAQ,WAAW,GAAG,OAAO,CAAC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/D;CACF,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"shortcut.d.ts","names":[],"sources":["../../../src/editor/commands/shortcut.ts"],"mappings":";KACY;iBA0BI,iBAAiB,qBAAkC;iBAWnD,eACd,8BACA,WAAQ"}
1
+ {"version":3,"file":"shortcut.d.ts","names":[],"sources":["../../../src/editor/commands/shortcut.ts"],"mappings":";KACY;iBAmCI,iBAAiB,qBAAkC;iBAWnD,eACd,8BACA,WAAQ"}
@@ -20,6 +20,14 @@ const MODIFIER_DISPLAY = {
20
20
  CTRL: "Ctrl"
21
21
  }
22
22
  };
23
+ /** The macOS glyphs the command metadata carries, named as the key prints elsewhere. */
24
+ const KEY_DISPLAY = {
25
+ "⌫": "Backspace",
26
+ "⇥": "Tab",
27
+ "↩": "Enter",
28
+ "⇞": "PageUp",
29
+ "⇟": "PageDown"
30
+ };
23
31
  const MAC_MODIFIER_ORDER = [
24
32
  "CTRL",
25
33
  "ALT",
@@ -46,7 +54,7 @@ function formatShortcut(shortcut, platform = shortcutPlatform()) {
46
54
  return shortcut.split(" ").map((combo) => {
47
55
  const parts = compact(combo.split("+"));
48
56
  const modifiers = parts.filter((part) => part in MODIFIER_DISPLAY[platform]);
49
- const keys = parts.filter((part) => !(part in MODIFIER_DISPLAY[platform]));
57
+ const keys = parts.filter((part) => !(part in MODIFIER_DISPLAY[platform])).map((part) => platform === "mac" ? part : KEY_DISPLAY[part] ?? part);
50
58
  const formattedModifiers = sortModifiers(modifiers, platform).map((part) => MODIFIER_DISPLAY[platform][part]);
51
59
  const separator = platform === "mac" ? "" : "+";
52
60
  return [...formattedModifiers, ...keys].join(separator);
@@ -1 +1 @@
1
- {"version":3,"file":"shortcut.js","names":[],"sources":["../../../src/editor/commands/shortcut.ts"],"sourcesContent":["import { compact } from 'es-toolkit/array'\nexport type ShortcutPlatform = 'mac' | 'windows' | 'linux'\n\nconst MODIFIER_DISPLAY: Record<ShortcutPlatform, Record<string, string>> = {\n mac: {\n MOD: '⌘',\n SHIFT: '⇧',\n ALT: '⌥',\n CTRL: '⌃'\n },\n windows: {\n MOD: 'Ctrl',\n SHIFT: 'Shift',\n ALT: 'Alt',\n CTRL: 'Ctrl'\n },\n linux: {\n MOD: 'Ctrl',\n SHIFT: 'Shift',\n ALT: 'Alt',\n CTRL: 'Ctrl'\n }\n}\n\nconst MAC_MODIFIER_ORDER = ['CTRL', 'ALT', 'SHIFT', 'MOD']\nconst STANDARD_MODIFIER_ORDER = ['MOD', 'CTRL', 'ALT', 'SHIFT']\n\nexport function shortcutPlatform(userAgent = navigator.userAgent): ShortcutPlatform {\n if (/Mac|iPhone|iPad|iPod/u.test(userAgent)) return 'mac'\n if (/Win/u.test(userAgent)) return 'windows'\n return 'linux'\n}\n\nfunction sortModifiers(modifiers: string[], platform: ShortcutPlatform): string[] {\n const order = platform === 'mac' ? MAC_MODIFIER_ORDER : STANDARD_MODIFIER_ORDER\n return [...modifiers].sort((a, b) => order.indexOf(a) - order.indexOf(b))\n}\n\nexport function formatShortcut(\n shortcut: string | undefined,\n platform = shortcutPlatform()\n): string | undefined {\n if (!shortcut) return undefined\n\n return shortcut\n .split(' ')\n .map((combo) => {\n const parts = compact(combo.split('+'))\n const modifiers = parts.filter((part) => part in MODIFIER_DISPLAY[platform])\n const keys = parts.filter((part) => !(part in MODIFIER_DISPLAY[platform]))\n const formattedModifiers = sortModifiers(modifiers, platform).map(\n (part) => MODIFIER_DISPLAY[platform][part]\n )\n const separator = platform === 'mac' ? '' : '+'\n return [...formattedModifiers, ...keys].join(separator)\n })\n .join(' ')\n}\n"],"mappings":";;AAGA,MAAM,mBAAqE;CACzE,KAAK;EACH,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;CACR;CACA,SAAS;EACP,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;CACR;CACA,OAAO;EACL,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;CACR;AACF;AAEA,MAAM,qBAAqB;CAAC;CAAQ;CAAO;CAAS;AAAK;AACzD,MAAM,0BAA0B;CAAC;CAAO;CAAQ;CAAO;AAAO;AAE9D,SAAgB,iBAAiB,YAAY,UAAU,WAA6B;CAClF,IAAI,wBAAwB,KAAK,SAAS,GAAG,OAAO;CACpD,IAAI,OAAO,KAAK,SAAS,GAAG,OAAO;CACnC,OAAO;AACT;AAEA,SAAS,cAAc,WAAqB,UAAsC;CAChF,MAAM,QAAQ,aAAa,QAAQ,qBAAqB;CACxD,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,MAAM,GAAG,MAAM,MAAM,QAAQ,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC;AAC1E;AAEA,SAAgB,eACd,UACA,WAAW,iBAAiB,GACR;CACpB,IAAI,CAAC,UAAU,OAAO,KAAA;CAEtB,OAAO,SACJ,MAAM,GAAG,CAAC,CACV,KAAK,UAAU;EACd,MAAM,QAAQ,QAAQ,MAAM,MAAM,GAAG,CAAC;EACtC,MAAM,YAAY,MAAM,QAAQ,SAAS,QAAQ,iBAAiB,SAAS;EAC3E,MAAM,OAAO,MAAM,QAAQ,SAAS,EAAE,QAAQ,iBAAiB,UAAU;EACzE,MAAM,qBAAqB,cAAc,WAAW,QAAQ,CAAC,CAAC,KAC3D,SAAS,iBAAiB,SAAS,CAAC,KACvC;EACA,MAAM,YAAY,aAAa,QAAQ,KAAK;EAC5C,OAAO,CAAC,GAAG,oBAAoB,GAAG,IAAI,CAAC,CAAC,KAAK,SAAS;CACxD,CAAC,CAAC,CACD,KAAK,GAAG;AACb"}
1
+ {"version":3,"file":"shortcut.js","names":[],"sources":["../../../src/editor/commands/shortcut.ts"],"sourcesContent":["import { compact } from 'es-toolkit/array'\nexport type ShortcutPlatform = 'mac' | 'windows' | 'linux'\n\nconst MODIFIER_DISPLAY: Record<ShortcutPlatform, Record<string, string>> = {\n mac: {\n MOD: '⌘',\n SHIFT: '⇧',\n ALT: '⌥',\n CTRL: '⌃'\n },\n windows: {\n MOD: 'Ctrl',\n SHIFT: 'Shift',\n ALT: 'Alt',\n CTRL: 'Ctrl'\n },\n linux: {\n MOD: 'Ctrl',\n SHIFT: 'Shift',\n ALT: 'Alt',\n CTRL: 'Ctrl'\n }\n}\n\n/** The macOS glyphs the command metadata carries, named as the key prints elsewhere. */\nconst KEY_DISPLAY: Record<string, string> = {\n '⌫': 'Backspace',\n '⇥': 'Tab',\n '↩': 'Enter',\n '⇞': 'PageUp',\n '⇟': 'PageDown'\n}\n\nconst MAC_MODIFIER_ORDER = ['CTRL', 'ALT', 'SHIFT', 'MOD']\nconst STANDARD_MODIFIER_ORDER = ['MOD', 'CTRL', 'ALT', 'SHIFT']\n\nexport function shortcutPlatform(userAgent = navigator.userAgent): ShortcutPlatform {\n if (/Mac|iPhone|iPad|iPod/u.test(userAgent)) return 'mac'\n if (/Win/u.test(userAgent)) return 'windows'\n return 'linux'\n}\n\nfunction sortModifiers(modifiers: string[], platform: ShortcutPlatform): string[] {\n const order = platform === 'mac' ? MAC_MODIFIER_ORDER : STANDARD_MODIFIER_ORDER\n return [...modifiers].sort((a, b) => order.indexOf(a) - order.indexOf(b))\n}\n\nexport function formatShortcut(\n shortcut: string | undefined,\n platform = shortcutPlatform()\n): string | undefined {\n if (!shortcut) return undefined\n\n return shortcut\n .split(' ')\n .map((combo) => {\n const parts = compact(combo.split('+'))\n const modifiers = parts.filter((part) => part in MODIFIER_DISPLAY[platform])\n const keys = parts\n .filter((part) => !(part in MODIFIER_DISPLAY[platform]))\n .map((part) => (platform === 'mac' ? part : (KEY_DISPLAY[part] ?? part)))\n const formattedModifiers = sortModifiers(modifiers, platform).map(\n (part) => MODIFIER_DISPLAY[platform][part]\n )\n const separator = platform === 'mac' ? '' : '+'\n return [...formattedModifiers, ...keys].join(separator)\n })\n .join(' ')\n}\n"],"mappings":";;AAGA,MAAM,mBAAqE;CACzE,KAAK;EACH,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;CACR;CACA,SAAS;EACP,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;CAC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/create.d.ts
2
- declare const i18n: import("@nanostores/i18n").I18n<"en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN">;
2
+ declare const i18n: import("@nanostores/i18n").I18n<"id" | "en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN">;
3
3
  //#endregion
4
4
  export { i18n };
5
5
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","names":[],"sources":["../../src/i18n/create.ts"],"mappings":";cAiBa,iCAAI"}
1
+ {"version":3,"file":"create.d.ts","names":[],"sources":["../../src/i18n/create.ts"],"mappings":";cAkBa,iCAAI"}
@@ -5,6 +5,7 @@ const localeLoaders = {
5
5
  de: () => import("./locales/de/index.js"),
6
6
  es: () => import("./locales/es/index.js"),
7
7
  fr: () => import("./locales/fr/index.js"),
8
+ id: () => import("./locales/id/index.js"),
8
9
  it: () => import("./locales/it/index.js"),
9
10
  ja: () => import("./locales/ja/index.js"),
10
11
  pl: () => import("./locales/pl/index.js"),
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","names":[],"sources":["../../src/i18n/create.ts"],"sourcesContent":["import { createI18n } from '@nanostores/i18n'\nimport type { ComponentsJSON } from '@nanostores/i18n'\n\nimport { locale } from '#vue/i18n/locale'\nimport type { Locale, TranslatedLocale } from '#vue/i18n/locale'\n\nconst localeLoaders = {\n de: () => import('#vue/i18n/locales/de'),\n es: () => import('#vue/i18n/locales/es'),\n fr: () => import('#vue/i18n/locales/fr'),\n it: () => import('#vue/i18n/locales/it'),\n ja: () => import('#vue/i18n/locales/ja'),\n pl: () => import('#vue/i18n/locales/pl'),\n ru: () => import('#vue/i18n/locales/ru'),\n 'zh-CN': () => import('#vue/i18n/locales/zh-cn')\n} satisfies Record<TranslatedLocale, () => Promise<{ default: ComponentsJSON }>>\n\nexport const i18n = createI18n<Locale, 'en'>(locale, {\n baseLocale: 'en',\n async get(code) {\n if (code === 'en') return {}\n const mod = await localeLoaders[code]()\n return mod.default\n }\n})\n"],"mappings":";;;AAMA,MAAM,gBAAgB;CACpB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,eAAe,OAAO;AACxB;AAEA,MAAa,OAAO,WAAyB,QAAQ;CACnD,YAAY;CACZ,MAAM,IAAI,MAAM;EACd,IAAI,SAAS,MAAM,OAAO,CAAC;EAE3B,QAAO,MADW,cAAc,KAAK,CAAC,EAAA,CAC3B;CACb;AACF,CAAC"}
1
+ {"version":3,"file":"create.js","names":[],"sources":["../../src/i18n/create.ts"],"sourcesContent":["import { createI18n } from '@nanostores/i18n'\nimport type { ComponentsJSON } from '@nanostores/i18n'\n\nimport { locale } from '#vue/i18n/locale'\nimport type { Locale, TranslatedLocale } from '#vue/i18n/locale'\n\nconst localeLoaders = {\n de: () => import('#vue/i18n/locales/de'),\n es: () => import('#vue/i18n/locales/es'),\n fr: () => import('#vue/i18n/locales/fr'),\n id: () => import('#vue/i18n/locales/id'),\n it: () => import('#vue/i18n/locales/it'),\n ja: () => import('#vue/i18n/locales/ja'),\n pl: () => import('#vue/i18n/locales/pl'),\n ru: () => import('#vue/i18n/locales/ru'),\n 'zh-CN': () => import('#vue/i18n/locales/zh-cn')\n} satisfies Record<TranslatedLocale, () => Promise<{ default: ComponentsJSON }>>\n\nexport const i18n = createI18n<Locale, 'en'>(locale, {\n baseLocale: 'en',\n async get(code) {\n if (code === 'en') return {}\n const mod = await localeLoaders[code]()\n return mod.default\n }\n})\n"],"mappings":";;;AAMA,MAAM,gBAAgB;CACpB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,UAAU,OAAO;CACjB,eAAe,OAAO;AACxB;AAEA,MAAa,OAAO,WAAyB,QAAQ;CACnD,YAAY;CACZ,MAAM,IAAI,MAAM;EACd,IAAI,SAAS,MAAM,OAAO,CAAC;EAE3B,QAAO,MADW,cAAc,KAAK,CAAC,EAAA,CAC3B;CACb;AACF,CAAC"}
@@ -1,12 +1,13 @@
1
1
  //#region src/i18n/locale.d.ts
2
- declare const AVAILABLE_LOCALES: readonly ["en", "de", "es", "fr", "it", "ja", "pl", "ru", "zh-CN"];
2
+ declare const AVAILABLE_LOCALES: readonly ["en", "de", "es", "fr", "id", "it", "ja", "pl", "ru", "zh-CN"];
3
3
  type Locale = (typeof AVAILABLE_LOCALES)[number];
4
4
  type TranslatedLocale = Exclude<Locale, 'en'>;
5
- declare const TRANSLATED_LOCALES: readonly ["de", "es", "fr", "it", "ja", "pl", "ru", "zh-CN"];
5
+ declare const TRANSLATED_LOCALES: readonly ["de", "es", "fr", "id", "it", "ja", "pl", "ru", "zh-CN"];
6
6
  declare const LOCALE_DIR_NAMES: {
7
7
  readonly de: "de";
8
8
  readonly es: "es";
9
9
  readonly fr: "fr";
10
+ readonly id: "id";
10
11
  readonly it: "it";
11
12
  readonly ja: "ja";
12
13
  readonly pl: "pl";
@@ -14,8 +15,8 @@ declare const LOCALE_DIR_NAMES: {
14
15
  readonly 'zh-CN': "zh-cn";
15
16
  };
16
17
  declare const LOCALE_LABELS: Record<Locale, string>;
17
- declare const localeSetting: import("nanostores").PreinitializedWritableAtom<"en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN" | undefined> & object;
18
- declare const locale: import("@nanostores/i18n").LocaleStore<"en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN">;
18
+ declare const localeSetting: import("nanostores").PreinitializedWritableAtom<"id" | "en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN" | undefined> & object;
19
+ declare const locale: import("@nanostores/i18n").LocaleStore<"id" | "en" | "de" | "es" | "fr" | "it" | "ja" | "pl" | "ru" | "zh-CN">;
19
20
  declare function setLocale(code: Locale): void;
20
21
  //#endregion
21
22
  export { AVAILABLE_LOCALES, LOCALE_DIR_NAMES, LOCALE_LABELS, Locale, TRANSLATED_LOCALES, TranslatedLocale, locale, localeSetting, setLocale };
@@ -1 +1 @@
1
- {"version":3,"file":"locale.d.ts","names":[],"sources":["../../src/i18n/locale.ts"],"mappings":";cAGa;KACD,iBAAiB;KACjB,mBAAmB,QAAQ;cAE1B;cAWA;;;;;;;;;;cAWA,eAAe,OAAO;cActB,oCAAa;cAmCb,mCAAM;iBASH,UAAU,MAAM"}
1
+ {"version":3,"file":"locale.d.ts","names":[],"sources":["../../src/i18n/locale.ts"],"mappings":";cAGa;KAYD,iBAAiB;KACjB,mBAAmB,QAAQ;cAE1B;cAYA;;;;;;;;;;;cAYA,eAAe,OAAO;cAetB,oCAAa;cAmCb,mCAAM;iBASH,UAAU,MAAM"}
@@ -6,6 +6,7 @@ const AVAILABLE_LOCALES = [
6
6
  "de",
7
7
  "es",
8
8
  "fr",
9
+ "id",
9
10
  "it",
10
11
  "ja",
11
12
  "pl",
@@ -16,6 +17,7 @@ const TRANSLATED_LOCALES = [
16
17
  "de",
17
18
  "es",
18
19
  "fr",
20
+ "id",
19
21
  "it",
20
22
  "ja",
21
23
  "pl",
@@ -26,6 +28,7 @@ const LOCALE_DIR_NAMES = {
26
28
  de: "de",
27
29
  es: "es",
28
30
  fr: "fr",
31
+ id: "id",
29
32
  it: "it",
30
33
  ja: "ja",
31
34
  pl: "pl",
@@ -37,6 +40,7 @@ const LOCALE_LABELS = {
37
40
  de: "Deutsch",
38
41
  es: "Español",
39
42
  fr: "Français",
43
+ id: "Bahasa Indonesia",
40
44
  it: "Italiano",
41
45
  ja: "日本語",
42
46
  pl: "Polski",
@@ -1 +1 @@
1
- {"version":3,"file":"locale.js","names":[],"sources":["../../src/i18n/locale.ts"],"sourcesContent":["import { localeFrom } from '@nanostores/i18n'\nimport { atom, onStart } from 'nanostores'\n\nexport const AVAILABLE_LOCALES = ['en', 'de', 'es', 'fr', 'it', 'ja', 'pl', 'ru', 'zh-CN'] as const\nexport type Locale = (typeof AVAILABLE_LOCALES)[number]\nexport type TranslatedLocale = Exclude<Locale, 'en'>\n\nexport const TRANSLATED_LOCALES = [\n 'de',\n 'es',\n 'fr',\n 'it',\n 'ja',\n 'pl',\n 'ru',\n 'zh-CN'\n] as const satisfies ReadonlyArray<TranslatedLocale>\n\nexport const LOCALE_DIR_NAMES = {\n de: 'de',\n es: 'es',\n fr: 'fr',\n it: 'it',\n ja: 'ja',\n pl: 'pl',\n ru: 'ru',\n 'zh-CN': 'zh-cn'\n} as const satisfies Record<TranslatedLocale, string>\n\nexport const LOCALE_LABELS: Record<Locale, string> = {\n en: 'English',\n de: 'Deutsch',\n es: 'Español',\n fr: 'Français',\n it: 'Italiano',\n ja: '日本語',\n pl: 'Polski',\n ru: 'Русский',\n 'zh-CN': '中文(简体)'\n}\n\nconst LOCALE_STORAGE_KEY = 'pairdraw-locale'\n\nexport const localeSetting = atom<Locale | undefined>(undefined)\n\n/** A tag's language and script, as Unicode's likely subtags fill them in: `zh-TW` is `zh-Hant`. */\nfunction languageScript(tag: string): string | null {\n try {\n const { language, script } = new Intl.Locale(tag).maximize()\n return `${language}-${script ?? ''}`\n } catch {\n return null\n }\n}\n\n/**\n * The first browser language with a locale: the same tag, or the same language in the same\n * script, so `zh` and `zh-SG` read Simplified Chinese and `zh-TW`, written in Traditional, does not.\n */\nexport function resolveBrowserLocale(languages: readonly string[]): Locale {\n const localesByCode = new Map(AVAILABLE_LOCALES.map((code) => [code.toLowerCase(), code]))\n const localesByScript = new Map(AVAILABLE_LOCALES.map((code) => [languageScript(code), code]))\n for (const language of languages) {\n const match =\n localesByCode.get(language.toLowerCase()) ?? localesByScript.get(languageScript(language))\n if (match) return match\n }\n return 'en'\n}\n\nconst browserLocale = atom<Locale>('en')\nonStart(browserLocale, () => {\n if (typeof navigator === 'undefined') return\n const browserLanguages = Array.isArray(navigator.languages) ? navigator.languages : []\n const languages = browserLanguages.length > 0 ? browserLanguages : [navigator.language || 'en']\n browserLocale.set(resolveBrowserLocale(languages))\n})\n\nexport const locale = localeFrom(localeSetting, browserLocale)\n\nfunction getLocalStorage(): Storage | null {\n if (typeof localStorage === 'undefined') return null\n if (typeof localStorage.getItem !== 'function') return null\n if (typeof localStorage.setItem !== 'function') return null\n return localStorage\n}\n\nexport function setLocale(code: Locale) {\n localeSetting.set(code)\n getLocalStorage()?.setItem(LOCALE_STORAGE_KEY, code)\n}\n\nconst saved = getLocalStorage()?.getItem(LOCALE_STORAGE_KEY) as Locale | null | undefined\nif (saved && AVAILABLE_LOCALES.includes(saved)) {\n localeSetting.set(saved)\n}\n"],"mappings":";;;AAGA,MAAa,oBAAoB;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;AAAO;AAIzF,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,mBAAmB;CAC9B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,SAAS;AACX;AAEA,MAAa,gBAAwC;CACnD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,SAAS;AACX;AAEA,MAAM,qBAAqB;AAE3B,MAAa,gBAAgB,KAAyB,KAAA,CAAS;;AAG/D,SAAS,eAAe,KAA4B;CAClD,IAAI;EACF,MAAM,EAAE,UAAU,WAAW,IAAI,KAAK,OAAO,GAAG,CAAC,CAAC,SAAS;EAC3D,OAAO,GAAG,SAAS,GAAG,UAAU;CAClC,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,SAAgB,qBAAqB,WAAsC;CACzE,MAAM,gBAAgB,IAAI,IAAI,kBAAkB,KAAK,SAAS,CAAC,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC;CACzF,MAAM,kBAAkB,IAAI,IAAI,kBAAkB,KAAK,SAAS,CAAC,eAAe,IAAI,GAAG,IAAI,CAAC,CAAC;CAC7F,KAAK,MAAM,YAAY,WAAW;EAChC,MAAM,QACJ,cAAc,IAAI,SAAS,YAAY,CAAC,KAAK,gBAAgB,IAAI,eAAe,QAAQ,CAAC;EAC3F,IAAI,OAAO,OAAO;CACpB;CACA,OAAO;AACT;AAEA,MAAM,gBAAgB,KAAa,IAAI;AACvC,QAAQ,qBAAqB;CAC3B,IAAI,OAAO,cAAc,aAAa;CACtC,MAAM,mBAAmB,MAAM,QAAQ,UAAU,SAAS,IAAI,UAAU,YAAY,CAAC;CACrF,MAAM,YAAY,iBAAiB,SAAS,IAAI,mBAAmB,CAAC,UAAU,YAAY,IAAI;CAC9F,cAAc,IAAI,qBAAqB,SAAS,CAAC;AACnD,CAAC;AAED,MAAa,SAAS,WAAW,eAAe,aAAa;AAE7D,SAAS,kBAAkC;CACzC,IAAI,OAAO,iBAAiB,aAAa,OAAO;CAChD,IAAI,OAAO,aAAa,YAAY,YAAY,OAAO;CACvD,IAAI,OAAO,aAAa,YAAY,YAAY,OAAO;CACvD,OAAO;AACT;AAEA,SAAgB,UAAU,MAAc;CACtC,cAAc,IAAI,IAAI;CACtB,gBAAgB,CAAC,EAAE,QAAQ,oBAAoB,IAAI;AACrD;AAEA,MAAM,QAAQ,gBAAgB,CAAC,EAAE,QAAQ,kBAAkB;AAC3D,IAAI,SAAS,kBAAkB,SAAS,KAAK,GAC3C,cAAc,IAAI,KAAK"}
1
+ {"version":3,"file":"locale.js","names":[],"sources":["../../src/i18n/locale.ts"],"sourcesContent":["import { localeFrom } from '@nanostores/i18n'\nimport { atom, onStart } from 'nanostores'\n\nexport const AVAILABLE_LOCALES = [\n 'en',\n 'de',\n 'es',\n 'fr',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'ru',\n 'zh-CN'\n] as const\nexport type Locale = (typeof AVAILABLE_LOCALES)[number]\nexport type TranslatedLocale = Exclude<Locale, 'en'>\n\nexport const TRANSLATED_LOCALES = [\n 'de',\n 'es',\n 'fr',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'ru',\n 'zh-CN'\n] as const satisfies ReadonlyArray<TranslatedLocale>\n\nexport const LOCALE_DIR_NAMES = {\n de: 'de',\n es: 'es',\n fr: 'fr',\n id: 'id',\n it: 'it',\n ja: 'ja',\n pl: 'pl',\n ru: 'ru',\n 'zh-CN': 'zh-cn'\n} as const satisfies Record<TranslatedLocale, string>\n\nexport const LOCALE_LABELS: Record<Locale, string> = {\n en: 'English',\n de: 'Deutsch',\n es: 'Español',\n fr: 'Français',\n id: 'Bahasa Indonesia',\n it: 'Italiano',\n ja: '日本語',\n pl: 'Polski',\n ru: 'Русский',\n 'zh-CN': '中文(简体)'\n}\n\nconst LOCALE_STORAGE_KEY = 'pairdraw-locale'\n\nexport const localeSetting = atom<Locale | undefined>(undefined)\n\n/** A tag's language and script, as Unicode's likely subtags fill them in: `zh-TW` is `zh-Hant`. */\nfunction languageScript(tag: string): string | null {\n try {\n const { language, script } = new Intl.Locale(tag).maximize()\n return `${language}-${script ?? ''}`\n } catch {\n return null\n }\n}\n\n/**\n * The first browser language with a locale: the same tag, or the same language in the same\n * script, so `zh` and `zh-SG` read Simplified Chinese and `zh-TW`, written in Traditional, does not.\n */\nexport function resolveBrowserLocale(languages: readonly string[]): Locale {\n const localesByCode = new Map(AVAILABLE_LOCALES.map((code) => [code.toLowerCase(), code]))\n const localesByScript = new Map(AVAILABLE_LOCALES.map((code) => [languageScript(code), code]))\n for (const language of languages) {\n const match =\n localesByCode.get(language.toLowerCase()) ?? localesByScript.get(languageScript(language))\n if (match) return match\n }\n return 'en'\n}\n\nconst browserLocale = atom<Locale>('en')\nonStart(browserLocale, () => {\n if (typeof navigator === 'undefined') return\n const browserLanguages = Array.isArray(navigator.languages) ? navigator.languages : []\n const languages = browserLanguages.length > 0 ? browserLanguages : [navigator.language || 'en']\n browserLocale.set(resolveBrowserLocale(languages))\n})\n\nexport const locale = localeFrom(localeSetting, browserLocale)\n\nfunction getLocalStorage(): Storage | null {\n if (typeof localStorage === 'undefined') return null\n if (typeof localStorage.getItem !== 'function') return null\n if (typeof localStorage.setItem !== 'function') return null\n return localStorage\n}\n\nexport function setLocale(code: Locale) {\n localeSetting.set(code)\n getLocalStorage()?.setItem(LOCALE_STORAGE_KEY, code)\n}\n\nconst saved = getLocalStorage()?.getItem(LOCALE_STORAGE_KEY) as Locale | null | undefined\nif (saved && AVAILABLE_LOCALES.includes(saved)) {\n localeSetting.set(saved)\n}\n"],"mappings":";;;AAGA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,mBAAmB;CAC9B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,SAAS;AACX;AAEA,MAAa,gBAAwC;CACnD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,SAAS;AACX;AAEA,MAAM,qBAAqB;AAE3B,MAAa,gBAAgB,KAAyB,KAAA,CAAS;;AAG/D,SAAS,eAAe,KAA4B;CAClD,IAAI;EACF,MAAM,EAAE,UAAU,WAAW,IAAI,KAAK,OAAO,GAAG,CAAC,CAAC,SAAS;EAC3D,OAAO,GAAG,SAAS,GAAG,UAAU;CAClC,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,SAAgB,qBAAqB,WAAsC;CACzE,MAAM,gBAAgB,IAAI,IAAI,kBAAkB,KAAK,SAAS,CAAC,KAAK,YAAY,GAAG,IAAI,CAAC,CAAC;CACzF,MAAM,kBAAkB,IAAI,IAAI,kBAAkB,KAAK,SAAS,CAAC,eAAe,IAAI,GAAG,IAAI,CAAC,CAAC;CAC7F,KAAK,MAAM,YAAY,WAAW;EAChC,MAAM,QACJ,cAAc,IAAI,SAAS,YAAY,CAAC,KAAK,gBAAgB,IAAI,eAAe,QAAQ,CAAC;EAC3F,IAAI,OAAO,OAAO;CACpB;CACA,OAAO;AACT;AAEA,MAAM,gBAAgB,KAAa,IAAI;AACvC,QAAQ,qBAAqB;CAC3B,IAAI,OAAO,cAAc,aAAa;CACtC,MAAM,mBAAmB,MAAM,QAAQ,UAAU,SAAS,IAAI,UAAU,YAAY,CAAC;CACrF,MAAM,YAAY,iBAAiB,SAAS,IAAI,mBAAmB,CAAC,UAAU,YAAY,IAAI;CAC9F,cAAc,IAAI,qBAAqB,SAAS,CAAC;AACnD,CAAC;AAED,MAAa,SAAS,WAAW,eAAe,aAAa;AAE7D,SAAS,kBAAkC;CACzC,IAAI,OAAO,iBAAiB,aAAa,OAAO;CAChD,IAAI,OAAO,aAAa,YAAY,YAAY,OAAO;CACvD,IAAI,OAAO,aAAa,YAAY,YAAY,OAAO;CACvD,OAAO;AACT;AAEA,SAAgB,UAAU,MAAc;CACtC,cAAc,IAAI,IAAI;CACtB,gBAAgB,CAAC,EAAE,QAAQ,oBAAoB,IAAI;AACrD;AAEA,MAAM,QAAQ,gBAAgB,CAAC,EAAE,QAAQ,kBAAkB;AAC3D,IAAI,SAAS,kBAAkB,SAAS,KAAK,GAC3C,cAAc,IAAI,KAAK"}
@@ -89,6 +89,17 @@ var ai_default = {
89
89
  changePreview: "Änderungsvorschauen",
90
90
  changePreviewHint: "Vorher-nachher-Bilder, die mit jeder KI-Bearbeitung im Chatverlauf gespeichert werden. Größere Vorschauen belegen mehr Speicher.",
91
91
  changePreviewOff: "Aus, nur Struktur",
92
+ turnRenders: "Geänderte Frames im Chat",
93
+ turnRendersHint: "Eine Antwort, die Frames ändert, zeigt kleine Vorher-nachher-Bilder davon unter ihrem Text.",
94
+ turnRendersTitle: "Geänderte Frames",
95
+ turnRendersMore: "+{count} weitere Frames",
96
+ turnRendersRendering: "Änderungen werden gerendert…",
97
+ turnRendersCleared: "Bilder zum Sparen von Speicher verworfen",
98
+ turnRendersUnavailable: "Bilder sind hier nicht verfügbar",
99
+ turnRendersCount: "{count} Frames geändert",
100
+ turnRenderWidth: "{width}px breit",
101
+ turnRenderNewFrame: "Neuer Frame",
102
+ turnRenderDeleted: "Gelöscht",
92
103
  promptStartTitle: "Was möchtest du gestalten?",
93
104
  promptStartLabel: "Beschreibe ein Design",
94
105
  promptStartPlaceholder: "Ein Anmeldebildschirm für eine Banking-App, ein Preisbereich, ein Dashboard…",
@@ -109,6 +120,9 @@ var ai_default = {
109
120
  commentPromptApplyAll: "Setze das Feedback in diesen Unterhaltungen um, antworte dann in jeder, was du geändert hast, und erledige sie.",
110
121
  commentPromptThread: "Unterhaltung {id}",
111
122
  commentPromptThreadOnLayer: "Unterhaltung {id} an {layer}",
123
+ commentPromptRegion: "Markierter Bereich: x {minX} bis {maxX}, y {minY} bis {maxY} auf der Seite. Ändere nur, was darin liegt.",
124
+ commentPromptRegionImage: "Ein Bild des markierten Bereichs ist als Ausschnitt angehängt.",
125
+ commentPromptRegionLayers: "Ebenen im markierten Bereich: {layers}",
112
126
  canvasPrompt: "Prompt auf der Arbeitsfläche",
113
127
  canvasPromptHint: "Zeigt unten auf der Arbeitsfläche einen Prompt, solange der Chat geschlossen ist. Was du dort schreibst, geht an den Chat.",
114
128
  animateEdits: "KI-Änderungen animieren",
@@ -143,6 +157,7 @@ var ai_default = {
143
157
  modelCapabilityToolsShort: "Werkzeuge",
144
158
  modelCapabilityVisionShort: "Vision",
145
159
  selectDesignModel: "Designmodell auswählen",
160
+ designModelName: "Designmodell",
146
161
  modelNeedsCredential: "Schlüssel fehlt",
147
162
  modelAgentConnection: "Agent",
148
163
  modelConnectionChecking: "Wird geprüft…",