@pairdraw/vue 0.19.2 → 0.20.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.
Files changed (302) hide show
  1. package/dist/canvas/CanvasRoot.vue.js +2 -0
  2. package/dist/canvas/CanvasRoot.vue.js.map +1 -1
  3. package/dist/canvas/auto-layout/value-edit.js +1 -1
  4. package/dist/canvas/auto-layout/value-edit.js.map +1 -1
  5. package/dist/canvas/eyedropper/index.d.ts +26 -0
  6. package/dist/canvas/eyedropper/index.d.ts.map +1 -0
  7. package/dist/canvas/eyedropper/index.js +62 -0
  8. package/dist/canvas/eyedropper/index.js.map +1 -0
  9. package/dist/canvas/eyedropper/sample.js +13 -0
  10. package/dist/canvas/eyedropper/sample.js.map +1 -0
  11. package/dist/canvas/eyedropper/use.d.ts +33 -0
  12. package/dist/canvas/eyedropper/use.d.ts.map +1 -0
  13. package/dist/canvas/eyedropper/use.js +52 -0
  14. package/dist/canvas/eyedropper/use.js.map +1 -0
  15. package/dist/canvas/pointer/drag-move.js +4 -0
  16. package/dist/canvas/pointer/drag-move.js.map +1 -1
  17. package/dist/canvas/surface/kit-loader.js +2 -3
  18. package/dist/canvas/surface/kit-loader.js.map +1 -1
  19. package/dist/canvas/surface/lifecycle.js +30 -1
  20. package/dist/canvas/surface/lifecycle.js.map +1 -1
  21. package/dist/canvas/surface/types.d.ts +9 -0
  22. package/dist/canvas/surface/types.d.ts.map +1 -1
  23. package/dist/canvas/text-edit/textarea.d.ts +1 -0
  24. package/dist/canvas/text-edit/textarea.d.ts.map +1 -1
  25. package/dist/canvas/tools/registry.js +5 -1
  26. package/dist/canvas/tools/registry.js.map +1 -1
  27. package/dist/canvas/useCanvasInput.d.ts +152 -10
  28. package/dist/canvas/useCanvasInput.d.ts.map +1 -1
  29. package/dist/canvas/useCanvasInput.js +3 -2
  30. package/dist/canvas/useCanvasInput.js.map +1 -1
  31. package/dist/controls/document-colors/index.d.ts +2 -0
  32. package/dist/controls/document-colors/index.js +2 -0
  33. package/dist/controls/document-colors/use.d.ts +14 -0
  34. package/dist/controls/document-colors/use.d.ts.map +1 -0
  35. package/dist/controls/document-colors/use.js +27 -0
  36. package/dist/controls/document-colors/use.js.map +1 -0
  37. package/dist/controls/effects/helpers.d.ts +13 -2
  38. package/dist/controls/effects/helpers.d.ts.map +1 -1
  39. package/dist/controls/effects/helpers.js +89 -34
  40. package/dist/controls/effects/helpers.js.map +1 -1
  41. package/dist/controls/effects/index.d.ts +2 -1
  42. package/dist/controls/effects/index.js +2 -1
  43. package/dist/controls/effects/use.d.ts +9 -7
  44. package/dist/controls/effects/use.d.ts.map +1 -1
  45. package/dist/controls/effects/use.js +6 -3
  46. package/dist/controls/effects/use.js.map +1 -1
  47. package/dist/controls/node-props/use.d.ts +3 -3
  48. package/dist/controls/position/use.d.ts +1 -1
  49. package/dist/controls/typography/features.d.ts +24 -0
  50. package/dist/controls/typography/features.d.ts.map +1 -0
  51. package/dist/controls/typography/features.js +130 -0
  52. package/dist/controls/typography/features.js.map +1 -0
  53. package/dist/controls/typography/index.d.ts +2 -1
  54. package/dist/controls/typography/index.js +2 -1
  55. package/dist/controls/typography/use.d.ts +6 -0
  56. package/dist/controls/typography/use.d.ts.map +1 -1
  57. package/dist/controls/typography/use.js +4 -1
  58. package/dist/controls/typography/use.js.map +1 -1
  59. package/dist/editor/commands/registry.d.ts +4 -0
  60. package/dist/editor/commands/registry.d.ts.map +1 -1
  61. package/dist/editor/commands/registry.js +2 -0
  62. package/dist/editor/commands/registry.js.map +1 -1
  63. package/dist/editor/commands/selection.js +22 -0
  64. package/dist/editor/commands/selection.js.map +1 -1
  65. package/dist/editor/commands/types.d.ts +1 -1
  66. package/dist/editor/commands/types.d.ts.map +1 -1
  67. package/dist/editor/menu-model/canvas.d.ts.map +1 -1
  68. package/dist/editor/menu-model/canvas.js +7 -1
  69. package/dist/editor/menu-model/canvas.js.map +1 -1
  70. package/dist/editor/selection-capabilities/use.d.ts +2 -0
  71. package/dist/editor/selection-capabilities/use.js +5 -0
  72. package/dist/editor/selection-capabilities/use.js.map +1 -1
  73. package/dist/editor/selection-state/use.d.ts +1 -0
  74. package/dist/editor/selection-state/use.js +5 -0
  75. package/dist/editor/selection-state/use.js.map +1 -1
  76. package/dist/editor/tool-cursor/index.d.ts.map +1 -1
  77. package/dist/editor/tool-cursor/index.js +5 -1
  78. package/dist/editor/tool-cursor/index.js.map +1 -1
  79. package/dist/i18n/index.d.ts +5 -2
  80. package/dist/i18n/index.js +5 -2
  81. package/dist/i18n/locales/de/ai.json.js +53 -2
  82. package/dist/i18n/locales/de/commands.json.js +2 -0
  83. package/dist/i18n/locales/de/design-check.json.js +13 -1
  84. package/dist/i18n/locales/de/design-memory.json.js +82 -0
  85. package/dist/i18n/locales/de/design-memory.json.js.map +1 -0
  86. package/dist/i18n/locales/de/fonts.json.js +10 -0
  87. package/dist/i18n/locales/de/index.js +5 -1
  88. package/dist/i18n/locales/de/index.js.map +1 -1
  89. package/dist/i18n/locales/de/menu.json.js +2 -0
  90. package/dist/i18n/locales/de/panels.json.js +94 -1
  91. package/dist/i18n/locales/de/settings.json.js +1 -0
  92. package/dist/i18n/locales/de/tools.json.js +3 -1
  93. package/dist/i18n/locales/de/variables/panel.json.js +20 -0
  94. package/dist/i18n/locales/de/variations.json.js +23 -0
  95. package/dist/i18n/locales/de/variations.json.js.map +1 -0
  96. package/dist/i18n/locales/es/ai.json.js +52 -1
  97. package/dist/i18n/locales/es/commands.json.js +2 -0
  98. package/dist/i18n/locales/es/design-check.json.js +13 -1
  99. package/dist/i18n/locales/es/design-memory.json.js +82 -0
  100. package/dist/i18n/locales/es/design-memory.json.js.map +1 -0
  101. package/dist/i18n/locales/es/fonts.json.js +10 -0
  102. package/dist/i18n/locales/es/index.js +5 -1
  103. package/dist/i18n/locales/es/index.js.map +1 -1
  104. package/dist/i18n/locales/es/menu.json.js +2 -0
  105. package/dist/i18n/locales/es/panels.json.js +94 -1
  106. package/dist/i18n/locales/es/settings.json.js +1 -0
  107. package/dist/i18n/locales/es/tools.json.js +3 -1
  108. package/dist/i18n/locales/es/variables/panel.json.js +20 -0
  109. package/dist/i18n/locales/es/variations.json.js +23 -0
  110. package/dist/i18n/locales/es/variations.json.js.map +1 -0
  111. package/dist/i18n/locales/fr/ai.json.js +53 -2
  112. package/dist/i18n/locales/fr/commands.json.js +2 -0
  113. package/dist/i18n/locales/fr/design-check.json.js +13 -1
  114. package/dist/i18n/locales/fr/design-memory.json.js +82 -0
  115. package/dist/i18n/locales/fr/design-memory.json.js.map +1 -0
  116. package/dist/i18n/locales/fr/fonts.json.js +10 -0
  117. package/dist/i18n/locales/fr/index.js +5 -1
  118. package/dist/i18n/locales/fr/index.js.map +1 -1
  119. package/dist/i18n/locales/fr/menu.json.js +2 -0
  120. package/dist/i18n/locales/fr/panels.json.js +94 -1
  121. package/dist/i18n/locales/fr/settings.json.js +1 -0
  122. package/dist/i18n/locales/fr/tools.json.js +3 -1
  123. package/dist/i18n/locales/fr/variables/panel.json.js +20 -0
  124. package/dist/i18n/locales/fr/variations.json.js +23 -0
  125. package/dist/i18n/locales/fr/variations.json.js.map +1 -0
  126. package/dist/i18n/locales/it/ai.json.js +53 -2
  127. package/dist/i18n/locales/it/commands.json.js +2 -0
  128. package/dist/i18n/locales/it/design-check.json.js +13 -1
  129. package/dist/i18n/locales/it/design-memory.json.js +82 -0
  130. package/dist/i18n/locales/it/design-memory.json.js.map +1 -0
  131. package/dist/i18n/locales/it/fonts.json.js +10 -0
  132. package/dist/i18n/locales/it/index.js +5 -1
  133. package/dist/i18n/locales/it/index.js.map +1 -1
  134. package/dist/i18n/locales/it/menu.json.js +2 -0
  135. package/dist/i18n/locales/it/panels.json.js +94 -1
  136. package/dist/i18n/locales/it/settings.json.js +1 -0
  137. package/dist/i18n/locales/it/tools.json.js +3 -1
  138. package/dist/i18n/locales/it/variables/panel.json.js +20 -0
  139. package/dist/i18n/locales/it/variations.json.js +23 -0
  140. package/dist/i18n/locales/it/variations.json.js.map +1 -0
  141. package/dist/i18n/locales/ja/ai.json.js +53 -2
  142. package/dist/i18n/locales/ja/commands.json.js +2 -0
  143. package/dist/i18n/locales/ja/design-check.json.js +13 -1
  144. package/dist/i18n/locales/ja/design-memory.json.js +61 -0
  145. package/dist/i18n/locales/ja/design-memory.json.js.map +1 -0
  146. package/dist/i18n/locales/ja/fonts.json.js +10 -0
  147. package/dist/i18n/locales/ja/index.js +5 -1
  148. package/dist/i18n/locales/ja/index.js.map +1 -1
  149. package/dist/i18n/locales/ja/menu.json.js +2 -0
  150. package/dist/i18n/locales/ja/panels.json.js +91 -1
  151. package/dist/i18n/locales/ja/settings.json.js +1 -0
  152. package/dist/i18n/locales/ja/tools.json.js +3 -1
  153. package/dist/i18n/locales/ja/variables/panel.json.js +20 -0
  154. package/dist/i18n/locales/ja/variations.json.js +23 -0
  155. package/dist/i18n/locales/ja/variations.json.js.map +1 -0
  156. package/dist/i18n/locales/pl/ai.json.js +53 -2
  157. package/dist/i18n/locales/pl/commands.json.js +2 -0
  158. package/dist/i18n/locales/pl/design-check.json.js +13 -1
  159. package/dist/i18n/locales/pl/design-memory.json.js +89 -0
  160. package/dist/i18n/locales/pl/design-memory.json.js.map +1 -0
  161. package/dist/i18n/locales/pl/fonts.json.js +10 -0
  162. package/dist/i18n/locales/pl/index.js +5 -1
  163. package/dist/i18n/locales/pl/index.js.map +1 -1
  164. package/dist/i18n/locales/pl/menu.json.js +2 -0
  165. package/dist/i18n/locales/pl/panels.json.js +95 -1
  166. package/dist/i18n/locales/pl/settings.json.js +1 -0
  167. package/dist/i18n/locales/pl/tools.json.js +3 -1
  168. package/dist/i18n/locales/pl/variables/panel.json.js +20 -0
  169. package/dist/i18n/locales/pl/variations.json.js +23 -0
  170. package/dist/i18n/locales/pl/variations.json.js.map +1 -0
  171. package/dist/i18n/locales/ru/ai.json.js +53 -2
  172. package/dist/i18n/locales/ru/commands.json.js +3 -1
  173. package/dist/i18n/locales/ru/design-check.json.js +13 -1
  174. package/dist/i18n/locales/ru/design-memory.json.js +89 -0
  175. package/dist/i18n/locales/ru/design-memory.json.js.map +1 -0
  176. package/dist/i18n/locales/ru/fonts.json.js +10 -0
  177. package/dist/i18n/locales/ru/index.js +5 -1
  178. package/dist/i18n/locales/ru/index.js.map +1 -1
  179. package/dist/i18n/locales/ru/menu.json.js +2 -0
  180. package/dist/i18n/locales/ru/panels.json.js +95 -1
  181. package/dist/i18n/locales/ru/settings.json.js +1 -0
  182. package/dist/i18n/locales/ru/tools.json.js +3 -1
  183. package/dist/i18n/locales/ru/variables/panel.json.js +20 -0
  184. package/dist/i18n/locales/ru/variations.json.js +23 -0
  185. package/dist/i18n/locales/ru/variations.json.js.map +1 -0
  186. package/dist/i18n/locales/zh-cn/ai.json.js +53 -2
  187. package/dist/i18n/locales/zh-cn/commands.json.js +2 -0
  188. package/dist/i18n/locales/zh-cn/design-check.json.js +13 -1
  189. package/dist/i18n/locales/zh-cn/design-memory.json.js +61 -0
  190. package/dist/i18n/locales/zh-cn/design-memory.json.js.map +1 -0
  191. package/dist/i18n/locales/zh-cn/fonts.json.js +10 -0
  192. package/dist/i18n/locales/zh-cn/index.js +5 -1
  193. package/dist/i18n/locales/zh-cn/index.js.map +1 -1
  194. package/dist/i18n/locales/zh-cn/menu.json.js +2 -0
  195. package/dist/i18n/locales/zh-cn/panels.json.js +91 -1
  196. package/dist/i18n/locales/zh-cn/settings.json.js +1 -0
  197. package/dist/i18n/locales/zh-cn/tools.json.js +3 -1
  198. package/dist/i18n/locales/zh-cn/variables/panel.json.js +20 -0
  199. package/dist/i18n/locales/zh-cn/variations.json.js +23 -0
  200. package/dist/i18n/locales/zh-cn/variations.json.js.map +1 -0
  201. package/dist/i18n/messages/ai.d.ts +65 -2
  202. package/dist/i18n/messages/ai.d.ts.map +1 -1
  203. package/dist/i18n/messages/ai.js +53 -2
  204. package/dist/i18n/messages/ai.js.map +1 -1
  205. package/dist/i18n/messages/chat-usage.d.ts +34 -0
  206. package/dist/i18n/messages/chat-usage.d.ts.map +1 -0
  207. package/dist/i18n/messages/chat-usage.js +25 -0
  208. package/dist/i18n/messages/chat-usage.js.map +1 -0
  209. package/dist/i18n/messages/commands.d.ts +2 -0
  210. package/dist/i18n/messages/commands.d.ts.map +1 -1
  211. package/dist/i18n/messages/commands.js +2 -0
  212. package/dist/i18n/messages/commands.js.map +1 -1
  213. package/dist/i18n/messages/design-check.d.ts +12 -0
  214. package/dist/i18n/messages/design-check.d.ts.map +1 -1
  215. package/dist/i18n/messages/design-check.js +13 -1
  216. package/dist/i18n/messages/design-check.js.map +1 -1
  217. package/dist/i18n/messages/design-memory.d.ts +68 -0
  218. package/dist/i18n/messages/design-memory.d.ts.map +1 -0
  219. package/dist/i18n/messages/design-memory.js +85 -0
  220. package/dist/i18n/messages/design-memory.js.map +1 -0
  221. package/dist/i18n/messages/fonts.d.ts +12 -0
  222. package/dist/i18n/messages/fonts.d.ts.map +1 -1
  223. package/dist/i18n/messages/fonts.js +10 -0
  224. package/dist/i18n/messages/fonts.js.map +1 -1
  225. package/dist/i18n/messages/menu.d.ts +2 -0
  226. package/dist/i18n/messages/menu.d.ts.map +1 -1
  227. package/dist/i18n/messages/menu.js +2 -0
  228. package/dist/i18n/messages/menu.js.map +1 -1
  229. package/dist/i18n/messages/panels.d.ts +114 -0
  230. package/dist/i18n/messages/panels.d.ts.map +1 -1
  231. package/dist/i18n/messages/panels.js +94 -1
  232. package/dist/i18n/messages/panels.js.map +1 -1
  233. package/dist/i18n/messages/settings.d.ts +1 -0
  234. package/dist/i18n/messages/settings.d.ts.map +1 -1
  235. package/dist/i18n/messages/settings.js +1 -0
  236. package/dist/i18n/messages/settings.js.map +1 -1
  237. package/dist/i18n/messages/tools.d.ts +2 -0
  238. package/dist/i18n/messages/tools.d.ts.map +1 -1
  239. package/dist/i18n/messages/tools.js +3 -1
  240. package/dist/i18n/messages/tools.js.map +1 -1
  241. package/dist/i18n/messages/variables/panel.d.ts +24 -0
  242. package/dist/i18n/messages/variables/panel.d.ts.map +1 -1
  243. package/dist/i18n/messages/variables/panel.js +20 -0
  244. package/dist/i18n/messages/variables/panel.js.map +1 -1
  245. package/dist/i18n/messages/variations.d.ts +28 -0
  246. package/dist/i18n/messages/variations.d.ts.map +1 -0
  247. package/dist/i18n/messages/variations.js +26 -0
  248. package/dist/i18n/messages/variations.js.map +1 -0
  249. package/dist/i18n/messages.d.ts +356 -3
  250. package/dist/i18n/messages.d.ts.map +1 -1
  251. package/dist/i18n/messages.js +8 -2
  252. package/dist/i18n/messages.js.map +1 -1
  253. package/dist/i18n/useI18n.d.ts +1193 -9
  254. package/dist/i18n/useI18n.d.ts.map +1 -1
  255. package/dist/i18n/useI18n.js +8 -1
  256. package/dist/i18n/useI18n.js.map +1 -1
  257. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts +5 -2
  258. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.d.ts.map +1 -1
  259. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js +12 -3
  260. package/dist/primitives/ColorPicker/ColorPickerRoot.vue.js.map +1 -1
  261. package/dist/primitives/ColorPicker/index.d.ts +2 -1
  262. package/dist/primitives/ColorPicker/index.js +2 -1
  263. package/dist/primitives/ColorPicker/outside.d.ts +16 -0
  264. package/dist/primitives/ColorPicker/outside.d.ts.map +1 -0
  265. package/dist/primitives/ColorPicker/outside.js +20 -0
  266. package/dist/primitives/ColorPicker/outside.js.map +1 -0
  267. package/dist/primitives/FontPicker/FontPickerRoot.vue.d.ts +5 -0
  268. package/dist/primitives/FontPicker/FontPickerRoot.vue.d.ts.map +1 -1
  269. package/dist/primitives/FontPicker/FontPickerRoot.vue.js +63 -56
  270. package/dist/primitives/FontPicker/FontPickerRoot.vue.js.map +1 -1
  271. package/dist/primitives/LayerTree/LayerTreeRoot.vue.d.ts +1 -1
  272. package/dist/primitives/TypographyControls/TypographyControlsRoot.vue.d.ts +3 -0
  273. package/dist/primitives/TypographyControls/TypographyControlsRoot.vue.d.ts.map +1 -1
  274. package/dist/primitives/TypographyControls/TypographyControlsRoot.vue.js +3 -1
  275. package/dist/primitives/TypographyControls/TypographyControlsRoot.vue.js.map +1 -1
  276. package/dist/shared/assets/cursors/eyedropper.svg.js +6 -0
  277. package/dist/shared/assets/cursors/eyedropper.svg.js.map +1 -0
  278. package/dist/shared/frame.d.ts +28 -0
  279. package/dist/shared/frame.d.ts.map +1 -0
  280. package/dist/shared/frame.js +92 -0
  281. package/dist/shared/frame.js.map +1 -0
  282. package/dist/shared/input/auto-layout/drag.js +71 -0
  283. package/dist/shared/input/auto-layout/drag.js.map +1 -0
  284. package/dist/shared/input/{auto-layout-hover.d.ts → auto-layout/hover.d.ts} +3 -3
  285. package/dist/shared/input/auto-layout/hover.d.ts.map +1 -0
  286. package/dist/shared/input/{auto-layout-hover.js → auto-layout/hover.js} +42 -86
  287. package/dist/shared/input/auto-layout/hover.js.map +1 -0
  288. package/dist/shared/input/{auto-layout.js → auto-layout/index.js} +2 -2
  289. package/dist/shared/input/auto-layout/index.js.map +1 -0
  290. package/dist/shared/input/index.d.ts +1 -1
  291. package/dist/shared/input/index.js +1 -1
  292. package/dist/shared/input/move/drag.js +1 -1
  293. package/dist/shared/input/resize.js +1 -1
  294. package/dist/shared/input/select.js +5 -3
  295. package/dist/shared/input/select.js.map +1 -1
  296. package/dist/shared/input/types.d.ts +10 -2
  297. package/dist/shared/input/types.d.ts.map +1 -1
  298. package/dist/shared/input/types.js.map +1 -1
  299. package/package.json +19 -4
  300. package/dist/shared/input/auto-layout-hover.d.ts.map +0 -1
  301. package/dist/shared/input/auto-layout-hover.js.map +0 -1
  302. package/dist/shared/input/auto-layout.js.map +0 -1
@@ -1,6 +1,29 @@
1
1
  import { useI18n } from "../../i18n/useI18n.js";
2
2
  import { copyEffects } from "@pairdraw/scene-graph/copy";
3
+ import { BLACK, DEFAULT_NOISE, DEFAULT_NOISE_COLOR, DEFAULT_TEXTURE, UNSET_NOISE, UNSET_TEXTURE } from "@pairdraw/scene-graph/constants";
3
4
  //#region src/controls/effects/helpers.ts
5
+ /** A noise value change that keeps every other grain value the layer has. */
6
+ function noiseChange(changes) {
7
+ return (current) => {
8
+ return { noise: {
9
+ ...current.type === "NOISE" ? current.noise : UNSET_NOISE,
10
+ ...changes
11
+ } };
12
+ };
13
+ }
14
+ /** A texture value change that keeps every other grain value the layer has. */
15
+ function textureChange(changes) {
16
+ return (current) => {
17
+ return { texture: {
18
+ ...current.type === "TEXTURE" ? current.texture : UNSET_TEXTURE,
19
+ ...changes
20
+ } };
21
+ };
22
+ }
23
+ /** A change of a noise's type, which also keeps the grain square. */
24
+ function noiseTypeChange(type) {
25
+ return noiseChange({ noiseType: type });
26
+ }
4
27
  const { panels } = useI18n();
5
28
  const EFFECT_LABELS = {
6
29
  DROP_SHADOW: panels.value.dropShadow,
@@ -8,8 +31,12 @@ const EFFECT_LABELS = {
8
31
  LAYER_BLUR: panels.value.layerBlur,
9
32
  BACKGROUND_BLUR: panels.value.backgroundBlur,
10
33
  FOREGROUND_BLUR: panels.value.foregroundBlur,
34
+ NOISE: panels.value.noise,
35
+ TEXTURE: panels.value.texture,
11
36
  SHADER: panels.value.shader
12
37
  };
38
+ /** Radius of a shadow or blur that does not set one. */
39
+ const DEFAULT_EFFECT_RADIUS = 8;
13
40
  /** The code a new layer shader starts from: it tints the layer it sits on. */
14
41
  const DEFAULT_SHADER_SOURCE = `uniform sampler2D layer; /* @object */
15
42
  uniform vec2 resolution; /* @resolution */
@@ -50,11 +77,12 @@ function createDefaultEffect() {
50
77
  }
51
78
  /** Effects scrubbed on every selected node, each committed from its own value before the scrub. */
52
79
  function createEffectEditActions(editor, effectsBeforeScrub) {
53
- function apply(nodes, index, changes) {
80
+ function apply(nodes, index, change) {
54
81
  for (const node of nodes) {
55
82
  const effects = [...node.effects];
56
83
  const current = effects.at(index);
57
84
  if (!current) continue;
85
+ const changes = typeof change === "function" ? change(current) : change;
58
86
  effects[index] = {
59
87
  ...current,
60
88
  ...changes
@@ -63,19 +91,19 @@ function createEffectEditActions(editor, effectsBeforeScrub) {
63
91
  }
64
92
  editor.requestRender();
65
93
  }
66
- function scrubEffect(nodes, index, changes) {
94
+ function scrubEffect(nodes, index, change) {
67
95
  if (nodes.length === 0) return;
68
96
  effectsBeforeScrub.value ??= new Map(nodes.map((node) => [node.id, {
69
97
  effects: copyEffects(node.effects),
70
98
  effectStyleId: node.effectStyleId
71
99
  }]));
72
- apply(nodes, index, changes);
100
+ apply(nodes, index, change);
73
101
  }
74
- function commitEffect(nodes, index, changes) {
102
+ function commitEffect(nodes, index, change) {
75
103
  if (nodes.length === 0) return;
76
104
  const previous = effectsBeforeScrub.value;
77
105
  effectsBeforeScrub.value = null;
78
- apply(nodes, index, changes);
106
+ apply(nodes, index, change);
79
107
  if (!previous) return;
80
108
  editor.undo.runBatch("Change effect", () => {
81
109
  for (const node of nodes) {
@@ -93,38 +121,65 @@ function createEffectEditActions(editor, effectsBeforeScrub) {
93
121
  commitEffect
94
122
  };
95
123
  }
124
+ /**
125
+ * `type` as a complete effect, keeping what every kind can carry. A shadow blurs away from the
126
+ * layer and a blur is centred on it, so switching between the two rewrites the geometry; a noise
127
+ * or texture starts where Figma's effects panel starts one.
128
+ */
129
+ function effectOfType(type, previous) {
130
+ const blendMode = previous.blendMode;
131
+ const visible = previous.visible;
132
+ if (type === "SHADER") return {
133
+ type,
134
+ source: DEFAULT_SHADER_SOURCE,
135
+ uniforms: {},
136
+ visible,
137
+ blendMode
138
+ };
139
+ if (type === "NOISE") return {
140
+ type,
141
+ color: { ...DEFAULT_NOISE_COLOR },
142
+ visible,
143
+ blendMode,
144
+ noise: {
145
+ ...DEFAULT_NOISE,
146
+ noiseSize: { ...DEFAULT_NOISE.noiseSize }
147
+ }
148
+ };
149
+ if (type === "TEXTURE") return {
150
+ type,
151
+ color: { ...BLACK },
152
+ radius: DEFAULT_TEXTURE.noiseSize.x,
153
+ visible,
154
+ blendMode,
155
+ texture: {
156
+ ...DEFAULT_TEXTURE,
157
+ noiseSize: { ...DEFAULT_TEXTURE.noiseSize }
158
+ }
159
+ };
160
+ const radius = previous.type === "SHADER" || previous.type === "NOISE" ? DEFAULT_EFFECT_RADIUS : previous.radius;
161
+ return {
162
+ type,
163
+ color: previous.type === "SHADER" ? { ...BLACK } : { ...previous.color },
164
+ radius,
165
+ spread: 0,
166
+ offset: isShadow(type) ? {
167
+ x: 0,
168
+ y: 4
169
+ } : {
170
+ x: 0,
171
+ y: 0
172
+ },
173
+ visible,
174
+ blendMode
175
+ };
176
+ }
96
177
  function createEffectControlActions(expandedIndex) {
97
178
  function updateType(patch, node, index, type) {
98
179
  if (!node) return;
99
180
  const previous = node.effects[index];
100
- if (type === "SHADER") {
101
- patch(index, previous.type === "SHADER" ? { type } : {
102
- type,
103
- source: DEFAULT_SHADER_SOURCE,
104
- uniforms: {}
105
- });
106
- return;
107
- }
108
- const shadow = isShadow(type);
109
- const wasShadow = previous.type !== "SHADER" && isShadow(previous.type);
110
- let geometry = {};
111
- if (shadow !== wasShadow) geometry = shadow ? {
112
- offset: {
113
- x: 0,
114
- y: 4
115
- },
116
- spread: 0
117
- } : {
118
- offset: {
119
- x: 0,
120
- y: 0
121
- },
122
- spread: 0
123
- };
124
- patch(index, {
125
- ...geometry,
126
- type
127
- });
181
+ if (type === previous.type) return;
182
+ patch(index, effectOfType(type, previous));
128
183
  }
129
184
  function updateColor(patch, index, color) {
130
185
  patch(index, { color });
@@ -149,6 +204,6 @@ function createEffectControlActions(expandedIndex) {
149
204
  };
150
205
  }
151
206
  //#endregion
152
- export { EFFECT_OPTIONS, createDefaultEffect, createEffectControlActions, createEffectEditActions, isShadow, isShadowEffect };
207
+ export { EFFECT_OPTIONS, createDefaultEffect, createEffectControlActions, createEffectEditActions, isShadow, isShadowEffect, noiseChange, noiseTypeChange, textureChange };
153
208
 
154
209
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/controls/effects/helpers.ts"],"sourcesContent":["import type { Ref } from 'vue'\n\nimport type { Editor } from '@pairdraw/core'\nimport type { Effect, SceneNode, ShadowEffect } from '@pairdraw/scene-graph'\nimport { copyEffects } from '@pairdraw/scene-graph/copy'\nimport type { Color } from '@pairdraw/scene-graph/primitives'\n\nimport { useI18n } from '#vue/i18n/useI18n.js'\n\ntype EffectType = Effect['type']\n\nconst { panels } = useI18n()\n\nconst EFFECT_LABELS: Record<string, string> = {\n DROP_SHADOW: panels.value.dropShadow,\n INNER_SHADOW: panels.value.innerShadow,\n LAYER_BLUR: panels.value.layerBlur,\n BACKGROUND_BLUR: panels.value.backgroundBlur,\n FOREGROUND_BLUR: panels.value.foregroundBlur,\n SHADER: panels.value.shader\n}\n\n/** The code a new layer shader starts from: it tints the layer it sits on. */\nconst DEFAULT_SHADER_SOURCE = `uniform sampler2D layer; /* @object */\nuniform vec2 resolution; /* @resolution */\nuniform vec4 tint; /* @color @default #ff7a45 */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution;\n vec4 color = texture2D(layer, uv);\n gl_FragColor = vec4(mix(color.rgb, tint.rgb, tint.a), color.a);\n}`\n\nconst EFFECT_TYPES = Object.keys(EFFECT_LABELS) as EffectType[]\nexport const EFFECT_OPTIONS = EFFECT_TYPES.map((t) => ({\n value: t,\n label: EFFECT_LABELS[t]\n}))\n\nexport function isShadow(type: Effect['type']): type is ShadowEffect['type'] {\n return type === 'DROP_SHADOW' || type === 'INNER_SHADOW'\n}\n\nexport function isShadowEffect(effect: Effect): effect is ShadowEffect {\n return isShadow(effect.type)\n}\n\nexport function createDefaultEffect(): Effect {\n return {\n type: 'DROP_SHADOW',\n color: { r: 0, g: 0, b: 0, a: 0.25 },\n offset: { x: 0, y: 4 },\n radius: 4,\n spread: 0,\n visible: true\n }\n}\n\nexport interface EffectEditSnapshot {\n effects: Effect[]\n effectStyleId: string | null\n}\n\n/** Effects scrubbed on every selected node, each committed from its own value before the scrub. */\nexport function createEffectEditActions(\n editor: Editor,\n effectsBeforeScrub: Ref<Map<string, EffectEditSnapshot> | null>\n) {\n function apply(nodes: readonly SceneNode[], index: number, changes: Partial<Effect>) {\n for (const node of nodes) {\n const effects = [...node.effects]\n const current = effects.at(index)\n if (!current) continue\n effects[index] = { ...current, ...changes } as Effect\n editor.updateNode(node.id, { effects })\n }\n editor.requestRender()\n }\n\n function scrubEffect(nodes: readonly SceneNode[], index: number, changes: Partial<Effect>) {\n if (nodes.length === 0) return\n effectsBeforeScrub.value ??= new Map(\n nodes.map((node) => [\n node.id,\n { effects: copyEffects(node.effects), effectStyleId: node.effectStyleId }\n ])\n )\n apply(nodes, index, changes)\n }\n\n function commitEffect(nodes: readonly SceneNode[], index: number, changes: Partial<Effect>) {\n if (nodes.length === 0) return\n const previous = effectsBeforeScrub.value\n effectsBeforeScrub.value = null\n apply(nodes, index, changes)\n if (!previous) return\n editor.undo.runBatch('Change effect', () => {\n for (const node of nodes) {\n const before = previous.get(node.id)\n if (!before) continue\n editor.commitNodeUpdate(\n node.id,\n { effects: before.effects, effectStyleId: before.effectStyleId },\n 'Change effect'\n )\n }\n })\n }\n\n return { scrubEffect, commitEffect }\n}\n\nexport function createEffectControlActions(expandedIndex: Ref<number | null>) {\n function updateType(\n patch: (index: number, changes: Partial<Effect>) => void,\n node: SceneNode | null,\n index: number,\n type: EffectType\n ) {\n if (!node) return\n const previous = node.effects[index]\n if (type === 'SHADER') {\n patch(\n index,\n previous.type === 'SHADER'\n ? { type }\n : { type, source: DEFAULT_SHADER_SOURCE, uniforms: {} }\n )\n return\n }\n // A shadow blurs away from the layer; a blur is centred on it. Switching between the two\n // always rewrites the geometry, so the moment the type changes the offsets match it.\n const shadow = isShadow(type)\n const wasShadow = previous.type !== 'SHADER' && isShadow(previous.type)\n let geometry: Partial<ShadowEffect> = {}\n if (shadow !== wasShadow) {\n geometry = shadow\n ? { offset: { x: 0, y: 4 }, spread: 0 }\n : { offset: { x: 0, y: 0 }, spread: 0 }\n }\n patch(index, { ...geometry, type })\n }\n\n function updateColor(\n patch: (index: number, changes: Partial<Effect>) => void,\n index: number,\n color: Color\n ) {\n patch(index, { color })\n }\n\n function adjustExpandedAfterRemove(index: number) {\n if (expandedIndex.value === index) expandedIndex.value = null\n else if (expandedIndex.value !== null && expandedIndex.value > index) expandedIndex.value--\n }\n\n function handleRemove(removeFn: (index: number) => void, index: number) {\n removeFn(index)\n adjustExpandedAfterRemove(index)\n }\n\n function toggleExpand(index: number) {\n expandedIndex.value = expandedIndex.value === index ? null : index\n }\n\n return { updateType, updateColor, handleRemove, adjustExpandedAfterRemove, toggleExpand }\n}\n"],"mappings":";;;AAWA,MAAM,EAAE,WAAW,QAAQ;AAE3B,MAAM,gBAAwC;CAC5C,aAAa,OAAO,MAAM;CAC1B,cAAc,OAAO,MAAM;CAC3B,YAAY,OAAO,MAAM;CACzB,iBAAiB,OAAO,MAAM;CAC9B,iBAAiB,OAAO,MAAM;CAC9B,QAAQ,OAAO,MAAM;AACvB;;AAGA,MAAM,wBAAwB;;;;;;;;;AAW9B,MAAa,iBADQ,OAAO,KAAK,aACH,CAAA,CAAa,KAAK,OAAO;CACrD,OAAO;CACP,OAAO,cAAc;AACvB,EAAE;AAEF,SAAgB,SAAS,MAAoD;CAC3E,OAAO,SAAS,iBAAiB,SAAS;AAC5C;AAEA,SAAgB,eAAe,QAAwC;CACrE,OAAO,SAAS,OAAO,IAAI;AAC7B;AAEA,SAAgB,sBAA8B;CAC5C,OAAO;EACL,MAAM;EACN,OAAO;GAAE,GAAG;GAAG,GAAG;GAAG,GAAG;GAAG,GAAG;EAAK;EACnC,QAAQ;GAAE,GAAG;GAAG,GAAG;EAAE;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;CACX;AACF;;AAQA,SAAgB,wBACd,QACA,oBACA;CACA,SAAS,MAAM,OAA6B,OAAe,SAA0B;EACnF,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,UAAU,CAAC,GAAG,KAAK,OAAO;GAChC,MAAM,UAAU,QAAQ,GAAG,KAAK;GAChC,IAAI,C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E,QAAQ;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,QAAQ;EAAE,IACpC;GAAE,QAAQ;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,QAAQ;EAAE;EAE1C,MAAM,OAAO;GAAE,GAAG;GAAU;EAAK,CAAC;CACpC;CAEA,SAAS,YACP,OACA,OACA,OACA;EACA,MAAM,OAAO,EAAE,MAAM,CAAC;CACxB;CAEA,SAAS,0BAA0B,OAAe;EAChD,IAAI,cAAc,UAAU,OAAO,cAAc,QAAQ;OACpD,IAAI,cAAc,UAAU,QAAQ,cAAc,QAAQ,OAAO,cAAc;CACtF;CAEA,SAAS,aAAa,UAAmC,OAAe;EACtE,SAAS,KAAK;EACd,0BAA0B,KAAK;CACjC;CAEA,SAAS,aAAa,OAAe;EACnC,cAAc,QAAQ,cAAc,UAAU,QAAQ,OAAO;CAC/D;CAEA,OAAO;EAAE;EAAY;EAAa;EAAc;EAA2B;CAAa;AAC1F"}
1
+ {"version":3,"file":"helpers.js","names":[],"sources":["../../../src/controls/effects/helpers.ts"],"sourcesContent":["import type { Ref } from 'vue'\n\nimport type { Editor } from '@pairdraw/core'\nimport type {\n Effect,\n NoiseEffectParams,\n SceneNode,\n ShadowEffect,\n TextureEffectParams\n} from '@pairdraw/scene-graph'\nimport {\n BLACK,\n DEFAULT_NOISE,\n DEFAULT_NOISE_COLOR,\n DEFAULT_TEXTURE,\n UNSET_NOISE,\n UNSET_TEXTURE\n} from '@pairdraw/scene-graph/constants'\nimport { copyEffects } from '@pairdraw/scene-graph/copy'\nimport type { Color } from '@pairdraw/scene-graph/primitives'\n\nimport { useI18n } from '#vue/i18n/useI18n.js'\n\ntype EffectType = Effect['type']\n\n/**\n * One change to an effect: values to merge, or a function that reads the layer's own effect and\n * returns only what it changes, so every selected layer keeps its other values.\n */\nexport type EffectChange = Partial<Effect> | ((current: Effect) => Partial<Effect>)\n\n/** A noise value change that keeps every other grain value the layer has. */\nexport function noiseChange(changes: Partial<NoiseEffectParams>): EffectChange {\n return (current) => {\n const noise = current.type === 'NOISE' ? current.noise : UNSET_NOISE\n return { noise: { ...noise, ...changes } }\n }\n}\n\n/** A texture value change that keeps every other grain value the layer has. */\nexport function textureChange(changes: Partial<TextureEffectParams>): EffectChange {\n return (current) => {\n const texture = current.type === 'TEXTURE' ? current.texture : UNSET_TEXTURE\n return { texture: { ...texture, ...changes } }\n }\n}\n\n/** A change of a noise's type, which also keeps the grain square. */\nexport function noiseTypeChange(type: NoiseEffectParams['noiseType']): EffectChange {\n return noiseChange({ noiseType: type })\n}\n\nconst { panels } = useI18n()\n\nconst EFFECT_LABELS: Record<string, string> = {\n DROP_SHADOW: panels.value.dropShadow,\n INNER_SHADOW: panels.value.innerShadow,\n LAYER_BLUR: panels.value.layerBlur,\n BACKGROUND_BLUR: panels.value.backgroundBlur,\n FOREGROUND_BLUR: panels.value.foregroundBlur,\n NOISE: panels.value.noise,\n TEXTURE: panels.value.texture,\n SHADER: panels.value.shader\n}\n\n/** Radius of a shadow or blur that does not set one. */\nconst DEFAULT_EFFECT_RADIUS = 8\n\n/** The code a new layer shader starts from: it tints the layer it sits on. */\nconst DEFAULT_SHADER_SOURCE = `uniform sampler2D layer; /* @object */\nuniform vec2 resolution; /* @resolution */\nuniform vec4 tint; /* @color @default #ff7a45 */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution;\n vec4 color = texture2D(layer, uv);\n gl_FragColor = vec4(mix(color.rgb, tint.rgb, tint.a), color.a);\n}`\n\nconst EFFECT_TYPES = Object.keys(EFFECT_LABELS) as EffectType[]\nexport const EFFECT_OPTIONS = EFFECT_TYPES.map((t) => ({\n value: t,\n label: EFFECT_LABELS[t]\n}))\n\nexport function isShadow(type: Effect['type']): type is ShadowEffect['type'] {\n return type === 'DROP_SHADOW' || type === 'INNER_SHADOW'\n}\n\nexport function isShadowEffect(effect: Effect): effect is ShadowEffect {\n return isShadow(effect.type)\n}\n\nexport function createDefaultEffect(): Effect {\n return {\n type: 'DROP_SHADOW',\n color: { r: 0, g: 0, b: 0, a: 0.25 },\n offset: { x: 0, y: 4 },\n radius: 4,\n spread: 0,\n visible: true\n }\n}\n\nexport interface EffectEditSnapshot {\n effects: Effect[]\n effectStyleId: string | null\n}\n\n/** Effects scrubbed on every selected node, each committed from its own value before the scrub. */\nexport function createEffectEditActions(\n editor: Editor,\n effectsBeforeScrub: Ref<Map<string, EffectEditSnapshot> | null>\n) {\n function apply(nodes: readonly SceneNode[], index: number, change: EffectChange) {\n for (const node of nodes) {\n const effects = [...node.effects]\n const current = effects.at(index)\n if (!current) continue\n const changes = typeof change === 'function' ? change(current) : change\n effects[index] = { ...current, ...changes } as Effect\n editor.updateNode(node.id, { effects })\n }\n editor.requestRender()\n }\n\n function scrubEffect(nodes: readonly SceneNode[], index: number, change: EffectChange) {\n if (nodes.length === 0) return\n effectsBeforeScrub.value ??= new Map(\n nodes.map((node) => [\n node.id,\n { effects: copyEffects(node.effects), effectStyleId: node.effectStyleId }\n ])\n )\n apply(nodes, index, change)\n }\n\n function commitEffect(nodes: readonly SceneNode[], index: number, change: EffectChange) {\n if (nodes.length === 0) return\n const previous = effectsBeforeScrub.value\n effectsBeforeScrub.value = null\n apply(nodes, index, change)\n if (!previous) return\n editor.undo.runBatch('Change effect', () => {\n for (const node of nodes) {\n const before = previous.get(node.id)\n if (!before) continue\n editor.commitNodeUpdate(\n node.id,\n { effects: before.effects, effectStyleId: before.effectStyleId },\n 'Change effect'\n )\n }\n })\n }\n\n return { scrubEffect, commitEffect }\n}\n\n/**\n * `type` as a complete effect, keeping what every kind can carry. A shadow blurs away from the\n * layer and a blur is centred on it, so switching between the two rewrites the geometry; a noise\n * or texture starts where Figma's effects panel starts one.\n */\nfunction effectOfType(type: EffectType, previous: Effect): Effect {\n const blendMode = previous.blendMode\n const visible = previous.visible\n if (type === 'SHADER') {\n return { type, source: DEFAULT_SHADER_SOURCE, uniforms: {}, visible, blendMode }\n }\n if (type === 'NOISE') {\n return {\n type,\n color: { ...DEFAULT_NOISE_COLOR },\n visible,\n blendMode,\n noise: { ...DEFAULT_NOISE, noiseSize: { ...DEFAULT_NOISE.noiseSize } }\n }\n }\n if (type === 'TEXTURE') {\n return {\n type,\n color: { ...BLACK },\n radius: DEFAULT_TEXTURE.noiseSize.x,\n visible,\n blendMode,\n texture: { ...DEFAULT_TEXTURE, noiseSize: { ...DEFAULT_TEXTURE.noiseSize } }\n }\n }\n const radius =\n previous.type === 'SHADER' || previous.type === 'NOISE'\n ? DEFAULT_EFFECT_RADIUS\n : previous.radius\n return {\n type,\n color: previous.type === 'SHADER' ? { ...BLACK } : { ...previous.color },\n radius,\n spread: 0,\n offset: isShadow(type) ? { x: 0, y: 4 } : { x: 0, y: 0 },\n visible,\n blendMode\n }\n}\n\nexport function createEffectControlActions(expandedIndex: Ref<number | null>) {\n function updateType(\n patch: (index: number, changes: Partial<Effect>) => void,\n node: SceneNode | null,\n index: number,\n type: EffectType\n ) {\n if (!node) return\n const previous = node.effects[index]\n if (type === previous.type) return\n patch(index, effectOfType(type, previous))\n }\n\n function updateColor(\n patch: (index: number, changes: Partial<Effect>) => void,\n index: number,\n color: Color\n ) {\n patch(index, { color })\n }\n\n function adjustExpandedAfterRemove(index: number) {\n if (expandedIndex.value === index) expandedIndex.value = null\n else if (expandedIndex.value !== null && expandedIndex.value > index) expandedIndex.value--\n }\n\n function handleRemove(removeFn: (index: number) => void, index: number) {\n removeFn(index)\n adjustExpandedAfterRemove(index)\n }\n\n function toggleExpand(index: number) {\n expandedIndex.value = expandedIndex.value === index ? null : index\n }\n\n return { updateType, updateColor, handleRemove, adjustExpandedAfterRemove, toggleExpand }\n}\n"],"mappings":";;;;;AAgCA,SAAgB,YAAY,SAAmD;CAC7E,QAAQ,YAAY;EAElB,OAAO,EAAE,OAAO;GAAE,GADJ,QAAQ,SAAS,UAAU,QAAQ,QAAQ;GAC7B,GAAG;EAAQ,EAAE;CAC3C;AACF;;AAGA,SAAgB,cAAc,SAAqD;CACjF,QAAQ,YAAY;EAEl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W,EAAE,GAAG,gBAAgB,UAAU;EAAE;CAC7E;CAEF,MAAM,SACJ,SAAS,SAAS,YAAY,SAAS,SAAS,UAC5C,wBACA,SAAS;CACf,OAAO;EACL;EACA,OAAO,SAAS,SAAS,WAAW,EAAE,GAAG,MAAM,IAAI,EAAE,GAAG,SAAS,MAAM;EACvE;EACA,QAAQ;EACR,QAAQ,SAAS,IAAI,IAAI;GAAE,GAAG;GAAG,GAAG;EAAE,IAAI;GAAE,GAAG;GAAG,GAAG;EAAE;EACvD;EACA;CACF;AACF;AAEA,SAAgB,2BAA2B,eAAmC;CAC5E,SAAS,WACP,OACA,MACA,OACA,MACA;EACA,IAAI,CAAC,MAAM;EACX,MAAM,WAAW,KAAK,QAAQ;EAC9B,IAAI,SAAS,SAAS,MAAM;EAC5B,MAAM,OAAO,aAAa,MAAM,QAAQ,CAAC;CAC3C;CAEA,SAAS,YACP,OACA,OACA,OACA;EACA,MAAM,OAAO,EAAE,MAAM,CAAC;CACxB;CAEA,SAAS,0BAA0B,OAAe;EAChD,IAAI,cAAc,UAAU,OAAO,cAAc,QAAQ;OACpD,IAAI,cAAc,UAAU,QAAQ,cAAc,QAAQ,OAAO,cAAc;CACtF;CAEA,SAAS,aAAa,UAAmC,OAAe;EACtE,SAAS,KAAK;EACd,0BAA0B,KAAK;CACjC;CAEA,SAAS,aAAa,OAAe;EACnC,cAAc,QAAQ,cAAc,UAAU,QAAQ,OAAO;CAC/D;CAEA,OAAO;EAAE;EAAY;EAAa;EAAc;EAA2B;CAAa;AAC1F"}
@@ -1,2 +1,3 @@
1
+ import { EffectChange, noiseChange, noiseTypeChange, textureChange } from "./helpers.js";
1
2
  import { useEffectsControls } from "./use.js";
2
- export { useEffectsControls };
3
+ export { type EffectChange, noiseChange, noiseTypeChange, textureChange, useEffectsControls };
@@ -1,2 +1,3 @@
1
+ import { noiseChange, noiseTypeChange, textureChange } from "./helpers.js";
1
2
  import { useEffectsControls } from "./use.js";
2
- export { useEffectsControls };
3
+ export { noiseChange, noiseTypeChange, textureChange, useEffectsControls };
@@ -1,5 +1,4 @@
1
- import { createDefaultEffect, isShadow, isShadowEffect } from "./helpers.js";
2
- import { Effect } from "@pairdraw/scene-graph";
1
+ import { EffectChange, createDefaultEffect, isShadow, isShadowEffect, noiseChange, noiseTypeChange, textureChange } from "./helpers.js";
3
2
  //#region src/controls/effects/use.d.ts
4
3
  /**
5
4
  * Returns effect-editing helpers for property panels.
@@ -8,23 +7,26 @@ import { Effect } from "@pairdraw/scene-graph";
8
7
  * scrub-preview behavior, and effect type/color updates.
9
8
  */
10
9
  declare function useEffectsControls(): {
11
- updateType: (patch: (index: number, changes: Partial<Effect>) => void, node: import("@pairdraw/scene-graph").SceneNode | null, index: number, type: "DROP_SHADOW" | "INNER_SHADOW" | "LAYER_BLUR" | "BACKGROUND_BLUR" | "FOREGROUND_BLUR" | "SHADER") => void;
12
- updateColor: (patch: (index: number, changes: Partial<Effect>) => void, index: number, color: import("@pairdraw/scene-graph/primitives").Color) => void;
10
+ updateType: (patch: (index: number, changes: Partial<import("@pairdraw/scene-graph").Effect>) => void, node: import("@pairdraw/scene-graph").SceneNode | null, index: number, type: "DROP_SHADOW" | "INNER_SHADOW" | "LAYER_BLUR" | "BACKGROUND_BLUR" | "FOREGROUND_BLUR" | "SHADER" | "NOISE" | "TEXTURE") => void;
11
+ updateColor: (patch: (index: number, changes: Partial<import("@pairdraw/scene-graph").Effect>) => void, index: number, color: import("@pairdraw/scene-graph/primitives").Color) => void;
13
12
  handleRemove: (removeFn: (index: number) => void, index: number) => void;
14
13
  adjustExpandedAfterRemove: (index: number) => void;
15
14
  toggleExpand: (index: number) => void;
16
15
  expandedIndex: import("vue").Ref<number | null, number | null>;
17
16
  effectOptions: {
18
- value: "DROP_SHADOW" | "INNER_SHADOW" | "LAYER_BLUR" | "BACKGROUND_BLUR" | "FOREGROUND_BLUR" | "SHADER";
17
+ value: "DROP_SHADOW" | "INNER_SHADOW" | "LAYER_BLUR" | "BACKGROUND_BLUR" | "FOREGROUND_BLUR" | "SHADER" | "NOISE" | "TEXTURE";
19
18
  label: string;
20
19
  }[];
21
20
  createDefaultEffect: typeof createDefaultEffect;
22
21
  isShadow: typeof isShadow;
23
22
  isShadowEffect: typeof isShadowEffect;
23
+ noiseChange: typeof noiseChange;
24
+ noiseTypeChange: typeof noiseTypeChange;
25
+ textureChange: typeof textureChange;
24
26
  /** Previews a change to one effect on every selected layer. */
25
- scrubEffect: (index: number, changes: Partial<Effect>) => void;
27
+ scrubEffect: (index: number, change: EffectChange) => void;
26
28
  /** Applies a change to one effect on every selected layer in one undo step. */
27
- commitEffect: (index: number, changes: Partial<Effect>) => void;
29
+ commitEffect: (index: number, change: EffectChange) => void;
28
30
  };
29
31
  //#endregion
30
32
  export { useEffectsControls };
@@ -1 +1 @@
1
- {"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/effects/use.ts"],"mappings":";;;;;;;;;iBAsBgB;;;;;;;;;;;;;;;EAgBS,cAAA,eAAM,SAAW,QAAQ;;EAGxB,eAAA,eAAM,SAAW,QAAQ"}
1
+ {"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/effects/use.ts"],"mappings":";;;;;;;;iBAwBgB;;;;;;;;;;;;;;;;;;EAmBS,cAAA,eAAM,QAAU;;EAGf,eAAA,eAAM,QAAU"}
@@ -1,6 +1,6 @@
1
1
  import { useEditor } from "../../editor/context/index.js";
2
2
  import { useNodeProps } from "../node-props/use.js";
3
- import { EFFECT_OPTIONS, createDefaultEffect, createEffectControlActions, createEffectEditActions, isShadow, isShadowEffect } from "./helpers.js";
3
+ import { EFFECT_OPTIONS, createDefaultEffect, createEffectControlActions, createEffectEditActions, isShadow, isShadowEffect, noiseChange, noiseTypeChange, textureChange } from "./helpers.js";
4
4
  import { ref, shallowRef } from "vue";
5
5
  //#region src/controls/effects/use.ts
6
6
  /**
@@ -22,10 +22,13 @@ function useEffectsControls() {
22
22
  createDefaultEffect,
23
23
  isShadow,
24
24
  isShadowEffect,
25
+ noiseChange,
26
+ noiseTypeChange,
27
+ textureChange,
25
28
  /** Previews a change to one effect on every selected layer. */
26
- scrubEffect: (index, changes) => editActions.scrubEffect(nodes.value, index, changes),
29
+ scrubEffect: (index, change) => editActions.scrubEffect(nodes.value, index, change),
27
30
  /** Applies a change to one effect on every selected layer in one undo step. */
28
- commitEffect: (index, changes) => editActions.commitEffect(nodes.value, index, changes),
31
+ commitEffect: (index, change) => editActions.commitEffect(nodes.value, index, change),
29
32
  ...controlActions
30
33
  };
31
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/effects/use.ts"],"sourcesContent":["import { ref, shallowRef } from 'vue'\n\nimport type { Effect } from '@pairdraw/scene-graph'\n\nimport {\n EFFECT_OPTIONS,\n createDefaultEffect,\n createEffectControlActions,\n createEffectEditActions,\n isShadow,\n isShadowEffect,\n type EffectEditSnapshot\n} from '#vue/controls/effects/helpers'\nimport { useNodeProps } from '#vue/controls/node-props/use'\nimport { useEditor } from '#vue/editor/context'\n\n/**\n * Returns effect-editing helpers for property panels.\n *\n * This composable manages default effect creation, expanded-row state,\n * scrub-preview behavior, and effect type/color updates.\n */\nexport function useEffectsControls() {\n const editor = useEditor()\n\n const expandedIndex = ref<number | null>(null)\n const { nodes } = useNodeProps()\n const effectsBeforeScrub = shallowRef<Map<string, EffectEditSnapshot> | null>(null)\n const editActions = createEffectEditActions(editor, effectsBeforeScrub)\n const controlActions = createEffectControlActions(expandedIndex)\n\n return {\n expandedIndex,\n effectOptions: EFFECT_OPTIONS,\n createDefaultEffect,\n isShadow,\n isShadowEffect,\n /** Previews a change to one effect on every selected layer. */\n scrubEffect: (index: number, changes: Partial<Effect>) =>\n editActions.scrubEffect(nodes.value, index, changes),\n /** Applies a change to one effect on every selected layer in one undo step. */\n commitEffect: (index: number, changes: Partial<Effect>) =>\n editActions.commitEffect(nodes.value, index, changes),\n ...controlActions\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgB,qBAAqB;CACnC,MAAM,SAAS,UAAU;CAEzB,MAAM,gBAAgB,IAAmB,IAAI;CAC7C,MAAM,EAAE,UAAU,aAAa;CAC/B,MAAM,qBAAqB,WAAmD,IAAI;CAClF,MAAM,cAAc,wBAAwB,QAAQ,kBAAkB;CACtE,MAAM,iBAAiB,2BAA2B,aAAa;CAE/D,OAAO;EACL;EACA,eAAe;EACf;EACA;EACA;;EAEA,cAAc,OAAe,YAC3B,YAAY,YAAY,MAAM,OAAO,OAAO,OAAO;;EAErD,eAAe,OAAe,YAC5B,YAAY,aAAa,MAAM,OAAO,OAAO,OAAO;EACtD,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/effects/use.ts"],"sourcesContent":["import { ref, shallowRef } from 'vue'\n\nimport {\n EFFECT_OPTIONS,\n createDefaultEffect,\n createEffectControlActions,\n createEffectEditActions,\n isShadow,\n isShadowEffect,\n noiseChange,\n noiseTypeChange,\n textureChange,\n type EffectChange,\n type EffectEditSnapshot\n} from '#vue/controls/effects/helpers'\nimport { useNodeProps } from '#vue/controls/node-props/use'\nimport { useEditor } from '#vue/editor/context'\n\n/**\n * Returns effect-editing helpers for property panels.\n *\n * This composable manages default effect creation, expanded-row state,\n * scrub-preview behavior, and effect type/color updates.\n */\nexport function useEffectsControls() {\n const editor = useEditor()\n\n const expandedIndex = ref<number | null>(null)\n const { nodes } = useNodeProps()\n const effectsBeforeScrub = shallowRef<Map<string, EffectEditSnapshot> | null>(null)\n const editActions = createEffectEditActions(editor, effectsBeforeScrub)\n const controlActions = createEffectControlActions(expandedIndex)\n\n return {\n expandedIndex,\n effectOptions: EFFECT_OPTIONS,\n createDefaultEffect,\n isShadow,\n isShadowEffect,\n noiseChange,\n noiseTypeChange,\n textureChange,\n /** Previews a change to one effect on every selected layer. */\n scrubEffect: (index: number, change: EffectChange) =>\n editActions.scrubEffect(nodes.value, index, change),\n /** Applies a change to one effect on every selected layer in one undo step. */\n commitEffect: (index: number, change: EffectChange) =>\n editActions.commitEffect(nodes.value, index, change),\n ...controlActions\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,qBAAqB;CACnC,MAAM,SAAS,UAAU;CAEzB,MAAM,gBAAgB,IAAmB,IAAI;CAC7C,MAAM,EAAE,UAAU,aAAa;CAC/B,MAAM,qBAAqB,WAAmD,IAAI;CAClF,MAAM,cAAc,wBAAwB,QAAQ,kBAAkB;CACtE,MAAM,iBAAiB,2BAA2B,aAAa;CAE/D,OAAO;EACL;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;;EAEA,cAAc,OAAe,WAC3B,YAAY,YAAY,MAAM,OAAO,OAAO,MAAM;;EAEpD,eAAe,OAAe,WAC5B,YAAY,aAAa,MAAM,OAAO,OAAO,MAAM;EACrD,GAAG;CACL;AACF"}
@@ -17,9 +17,9 @@ declare function useNodeProps(): {
17
17
  prop: <K extends keyof import("@pairdraw/scene-graph").SceneNode>(key: K) => import("vue").ComputedRef<MixedValue<import("@pairdraw/scene-graph").SceneNode[K]>>;
18
18
  merged: <K extends keyof import("@pairdraw/scene-graph").SceneNode>(key: K) => MixedValue<import("@pairdraw/scene-graph").SceneNode[K]>;
19
19
  updateAllWithUndo: (patch: Partial<import("@pairdraw/scene-graph").SceneNode>, label: string) => void;
20
- updateArrayItem: (key: "strokes" | "fills" | "effects", index: number, patch: Record<string, unknown> | import("@pairdraw/scene-graph").Fill | import("@pairdraw/scene-graph").Stroke, label: string) => void;
21
- removeArrayItem: (key: "strokes" | "fills" | "effects", index: number, label: string) => void;
22
- toggleArrayVisibility: (key: "strokes" | "fills" | "effects", index: number) => void;
20
+ updateArrayItem: (key: "fills" | "strokes" | "effects", index: number, patch: Record<string, unknown> | import("@pairdraw/scene-graph").Fill | import("@pairdraw/scene-graph").Stroke, label: string) => void;
21
+ removeArrayItem: (key: "fills" | "strokes" | "effects", index: number, label: string) => void;
22
+ toggleArrayVisibility: (key: "fills" | "strokes" | "effects", index: number) => void;
23
23
  isArrayMixed: (key: Parameters<typeof isNodeArrayMixed>[1]) => boolean;
24
24
  updateProp: (key: string, value: number | string) => void;
25
25
  commitProp: (key: string, _value: number | string, previous: number | string) => void;
@@ -14,7 +14,7 @@ declare function usePosition(): {
14
14
  active: import("vue").ComputedRef<boolean>;
15
15
  isMulti: import("vue").ComputedRef<boolean>;
16
16
  prop: <K extends keyof SceneNode>(key: K) => import("vue").ComputedRef<MixedValue<SceneNode[K]>>;
17
- panelProp: (key: "x" | "y" | "width" | "height" | "rotation") => import("vue").ComputedRef<MixedValue<number>>;
17
+ panelProp: (key: "x" | "y" | "rotation" | "width" | "height") => import("vue").ComputedRef<MixedValue<number>>;
18
18
  ids: import("vue").ComputedRef<string[]>;
19
19
  x: import("vue").ComputedRef<number>;
20
20
  y: import("vue").ComputedRef<number>;
@@ -0,0 +1,24 @@
1
+ import { MixedValue } from "../node-props/helpers.js";
2
+ import { ComputedRef } from "vue";
3
+ import { Editor } from "@pairdraw/core";
4
+ import { SceneNode } from "@pairdraw/scene-graph";
5
+ //#region src/controls/typography/features.d.ts
6
+ /** One OpenType feature the selected text's font has, as the panel's switch list offers it. */
7
+ interface TypographyFeature {
8
+ tag: string;
9
+ /** One of the switches Figma always offers, whether or not the font lists the tag. */
10
+ standard: boolean;
11
+ }
12
+ /**
13
+ * The OpenType features of the selected text layers' font, as Figma's type settings offer them:
14
+ * only the features the font actually has, and actions that toggle them. Layers in different
15
+ * families share the features every one of their fonts has.
16
+ */
17
+ declare function createTypographyFeatures(editor: Editor, nodes: ComputedRef<SceneNode[]>): {
18
+ available: ComputedRef<TypographyFeature[]>;
19
+ state: (tag: string) => MixedValue<boolean>;
20
+ set: (tag: string, enabled: boolean) => void;
21
+ };
22
+ //#endregion
23
+ export { TypographyFeature, createTypographyFeatures };
24
+ //# sourceMappingURL=features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.d.ts","names":[],"sources":["../../../src/controls/typography/features.ts"],"mappings":";;;;;;UAUiB;EACf;;EAEA;;;;;;;iBAiDc,yBAAyB,QAAQ,QAAQ,OAAO,YAAY;;EAsDtD,QAAA,gBAAS;EASX,MAAA,aAAM"}
@@ -0,0 +1,130 @@
1
+ import { MIXED } from "../node-props/helpers.js";
2
+ import { computed, onScopeDispose, ref } from "vue";
3
+ import { fontManager } from "@pairdraw/core/text";
4
+ import { uniq } from "es-toolkit/array";
5
+ //#region src/controls/typography/features.ts
6
+ /** The common switches Figma always shows for text; the font's own features follow them. */
7
+ const STANDARD_FEATURES = [
8
+ "LIGA",
9
+ "CALT",
10
+ "KERN"
11
+ ];
12
+ /** The features a font has, in a stable order: the common controls first, then the font's own. */
13
+ const COMMON_ORDER = [
14
+ "LIGA",
15
+ "CALT",
16
+ "DLIG",
17
+ "HLIG",
18
+ "KERN",
19
+ "LNUM",
20
+ "ONUM",
21
+ "PNUM",
22
+ "TNUM",
23
+ "FRAC",
24
+ "AFRC",
25
+ "ORDN",
26
+ "ZERO",
27
+ "SMCP",
28
+ "PCAP",
29
+ "C2SC",
30
+ "C2PC",
31
+ "UNIC",
32
+ "TITL",
33
+ "CASE",
34
+ "SINF",
35
+ "SUBS",
36
+ "SUPS"
37
+ ];
38
+ function featureOrder(tag) {
39
+ const common = COMMON_ORDER.indexOf(tag);
40
+ if (common !== -1) return common;
41
+ const set = /^SS(\d{2})$/.exec(tag);
42
+ if (set) return COMMON_ORDER.length + Number(set[1]);
43
+ const variant = /^CV(\d{2})$/.exec(tag);
44
+ if (variant) return COMMON_ORDER.length + 100 + Number(variant[1]);
45
+ return COMMON_ORDER.length + 200;
46
+ }
47
+ /**
48
+ * The OpenType features of the selected text layers' font, as Figma's type settings offer them:
49
+ * only the features the font actually has, and actions that toggle them. Layers in different
50
+ * families share the features every one of their fonts has.
51
+ */
52
+ function createTypographyFeatures(editor, nodes) {
53
+ const arrived = ref(0);
54
+ const families = computed(() => uniq(nodes.value.map((node) => node.fontFamily)));
55
+ function request(current) {
56
+ for (const family of current) {
57
+ if (fontManager.loadedFamilyFaces(family) !== void 0) continue;
58
+ fontManager.familyFaces(family).then(() => arrived.value++);
59
+ }
60
+ }
61
+ request(families.value);
62
+ onScopeDispose(fontManager.onFamilyFacesReset(() => {
63
+ arrived.value++;
64
+ request(families.value);
65
+ }));
66
+ onScopeDispose(fontManager.onFaceLoaded((family) => {
67
+ if (families.value.includes(family)) arrived.value++;
68
+ }));
69
+ const available = computed(() => {
70
+ arrived.value;
71
+ if (families.value.at(0) === void 0 || nodes.value.length === 0) return [];
72
+ let shared = null;
73
+ for (const family of families.value) {
74
+ const tags = fontManager.familyFeatures(family);
75
+ if (tags === void 0 || tags === null) return STANDARD_FEATURES.map((tag) => ({
76
+ tag,
77
+ standard: true
78
+ }));
79
+ shared = shared === null ? tags : shared.filter((tag) => tags.includes(tag));
80
+ }
81
+ return uniq([...STANDARD_FEATURES, ...shared ?? []]).map((tag) => ({
82
+ tag,
83
+ standard: STANDARD_FEATURES.includes(tag)
84
+ })).sort((a, b) => Number(b.standard) - Number(a.standard) || featureOrder(a.tag) - featureOrder(b.tag) || a.tag.localeCompare(b.tag));
85
+ });
86
+ /** Whether a feature is on for every selected text, MIXED when they differ; unset reads on. */
87
+ function state(tag) {
88
+ const values = nodes.value.map((node) => node.fontFeatures.find((feature) => feature.tag === tag)?.enabled ?? true);
89
+ const first = values.at(0);
90
+ return values.every((value) => value === first) ? first ?? true : MIXED;
91
+ }
92
+ /** Toggles one feature on every selected text, keeping its other features and its ranges'. */
93
+ function set(tag, enabled) {
94
+ const targets = nodes.value;
95
+ if (targets.length === 0) return;
96
+ editor.undo.runBatch(`Change ${tag} feature`, () => {
97
+ for (const target of targets) {
98
+ const node = editor.graph.getNode(target.id) ?? target;
99
+ const merge = (features) => features.some((feature) => feature.tag === tag) ? features.map((feature) => feature.tag === tag ? {
100
+ tag,
101
+ enabled
102
+ } : feature) : [...features, {
103
+ tag,
104
+ enabled
105
+ }];
106
+ const styleRuns = node.styleRuns.map((run) => run.style.fontFeatures ? {
107
+ ...run,
108
+ style: {
109
+ ...run.style,
110
+ fontFeatures: merge(run.style.fontFeatures)
111
+ }
112
+ } : run);
113
+ const changes = editor.layerChanges(target.id, { fontFeatures: merge(node.fontFeatures) });
114
+ editor.updateNodeWithUndo(target.id, {
115
+ ...changes,
116
+ styleRuns
117
+ }, `Change ${tag} feature`);
118
+ }
119
+ });
120
+ }
121
+ return {
122
+ available,
123
+ state,
124
+ set
125
+ };
126
+ }
127
+ //#endregion
128
+ export { STANDARD_FEATURES, createTypographyFeatures };
129
+
130
+ //# sourceMappingURL=features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.js","names":[],"sources":["../../../src/controls/typography/features.ts"],"sourcesContent":["import { uniq } from 'es-toolkit/array'\nimport { computed, onScopeDispose, ref, type ComputedRef } from 'vue'\n\nimport type { Editor } from '@pairdraw/core'\nimport { fontManager } from '@pairdraw/core/text'\nimport type { FontFeature, SceneNode } from '@pairdraw/scene-graph'\n\nimport { MIXED, type MixedValue } from '#vue/controls/node-props/use'\n\n/** One OpenType feature the selected text's font has, as the panel's switch list offers it. */\nexport interface TypographyFeature {\n tag: string\n /** One of the switches Figma always offers, whether or not the font lists the tag. */\n standard: boolean\n}\n\n/** The common switches Figma always shows for text; the font's own features follow them. */\nexport const STANDARD_FEATURES = ['LIGA', 'CALT', 'KERN'] as const\n\n/** The features a font has, in a stable order: the common controls first, then the font's own. */\nconst COMMON_ORDER = [\n 'LIGA',\n 'CALT',\n 'DLIG',\n 'HLIG',\n 'KERN',\n 'LNUM',\n 'ONUM',\n 'PNUM',\n 'TNUM',\n 'FRAC',\n 'AFRC',\n 'ORDN',\n 'ZERO',\n 'SMCP',\n 'PCAP',\n 'C2SC',\n 'C2PC',\n 'UNIC',\n 'TITL',\n 'CASE',\n 'SINF',\n 'SUBS',\n 'SUPS'\n]\n\nfunction featureOrder(tag: string): number {\n const common = COMMON_ORDER.indexOf(tag)\n if (common !== -1) return common\n // Stylistic sets and character variants follow, numbered; anything else sorts after them.\n const set = /^SS(\\d{2})$/.exec(tag)\n if (set) return COMMON_ORDER.length + Number(set[1])\n const variant = /^CV(\\d{2})$/.exec(tag)\n if (variant) return COMMON_ORDER.length + 100 + Number(variant[1])\n return COMMON_ORDER.length + 200\n}\n\n/**\n * The OpenType features of the selected text layers' font, as Figma's type settings offer them:\n * only the features the font actually has, and actions that toggle them. Layers in different\n * families share the features every one of their fonts has.\n */\nexport function createTypographyFeatures(editor: Editor, nodes: ComputedRef<SceneNode[]>) {\n // Bumped when a family's faces arrive, so the list follows a font that loads after selection.\n const arrived = ref(0)\n const families = computed(() => uniq(nodes.value.map((node) => node.fontFamily)))\n function request(current: readonly string[]) {\n for (const family of current) {\n if (fontManager.loadedFamilyFaces(family) !== undefined) continue\n void fontManager.familyFaces(family).then(() => arrived.value++)\n }\n }\n request(families.value)\n onScopeDispose(\n fontManager.onFamilyFacesReset(() => {\n arrived.value++\n request(families.value)\n })\n )\n // Faces may also arrive by the renderer, a paste or a script: the list follows any of them.\n onScopeDispose(\n fontManager.onFaceLoaded((family) => {\n if (families.value.includes(family)) arrived.value++\n })\n )\n\n const available = computed<TypographyFeature[]>(() => {\n void arrived.value\n const first = families.value.at(0)\n if (first === undefined || nodes.value.length === 0) return []\n let shared: string[] | null = null\n for (const family of families.value) {\n const tags = fontManager.familyFeatures(family)\n // Until a family's font is loaded its features are unknown: the common switches stay, and\n // the font's own join them once it arrives.\n if (tags === undefined || tags === null) {\n return STANDARD_FEATURES.map((tag) => ({ tag, standard: true }))\n }\n shared = shared === null ? tags : shared.filter((tag) => tags.includes(tag))\n }\n // The common switches stay offered beside the font's own, as Figma keeps them for any font.\n const tags = uniq([...STANDARD_FEATURES, ...(shared ?? [])])\n return tags\n .map((tag) => ({\n tag,\n standard: (STANDARD_FEATURES as readonly string[]).includes(tag)\n }))\n .sort(\n (a, b) =>\n Number(b.standard) - Number(a.standard) ||\n featureOrder(a.tag) - featureOrder(b.tag) ||\n a.tag.localeCompare(b.tag)\n )\n })\n\n /** Whether a feature is on for every selected text, MIXED when they differ; unset reads on. */\n function state(tag: string): MixedValue<boolean> {\n const values = nodes.value.map(\n (node) => node.fontFeatures.find((feature) => feature.tag === tag)?.enabled ?? true\n )\n const first = values.at(0)\n return values.every((value) => value === first) ? (first ?? true) : MIXED\n }\n\n /** Toggles one feature on every selected text, keeping its other features and its ranges'. */\n function set(tag: string, enabled: boolean) {\n const targets = nodes.value\n if (targets.length === 0) return\n editor.undo.runBatch(`Change ${tag} feature`, () => {\n for (const target of targets) {\n const node = editor.graph.getNode(target.id) ?? target\n // The toggled tag keeps its place in the list, so a range whose features now equal the\n // text's own keeps its run instead of being stripped as redundant.\n const merge = (features: FontFeature[]): FontFeature[] =>\n features.some((feature) => feature.tag === tag)\n ? features.map((feature) => (feature.tag === tag ? { tag, enabled } : feature))\n : [...features, { tag, enabled }]\n // A range with its own features keeps them, with the toggled tag replaced, as an axis\n // edit keeps the other axes a range sets. layerChanges strips the changed style from\n // the runs it recomputes, so the merged runs go on after it, not through it.\n const styleRuns = node.styleRuns.map((run) =>\n run.style.fontFeatures\n ? { ...run, style: { ...run.style, fontFeatures: merge(run.style.fontFeatures) } }\n : run\n )\n const changes = editor.layerChanges(target.id, { fontFeatures: merge(node.fontFeatures) })\n editor.updateNodeWithUndo(target.id, { ...changes, styleRuns }, `Change ${tag} feature`)\n }\n })\n }\n\n return { available, state, set }\n}\n"],"mappings":";;;;;;AAiBA,MAAa,oBAAoB;CAAC;CAAQ;CAAQ;AAAM;;AAGxD,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAS,aAAa,KAAqB;CACzC,MAAM,SAAS,aAAa,QAAQ,GAAG;CACvC,IAAI,WAAW,IAAI,OAAO;CAE1B,MAAM,MAAM,cAAc,KAAK,GAAG;CAClC,IAAI,KAAK,OAAO,aAAa,SAAS,OAAO,IAAI,EAAE;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ures } from "./features.js";
1
2
  import { TypographyAxis } from "./axes.js";
2
3
  import { UseTypographyOptions, useTypography } from "./use.js";
3
- export { type TypographyAxis, type UseTypographyOptions, useTypography };
4
+ export { type TypographyAxis, type TypographyFeature, type UseTypographyOptions, createTypographyFeatures, useTypography };
@@ -1,2 +1,3 @@
1
+ import { createTypographyFeatures } from "./features.js";
1
2
  import { useTypography } from "./use.js";
2
- export { useTypography };
3
+ export { createTypographyFeatures, useTypography };
@@ -1,4 +1,5 @@
1
1
  import { MixedValue } from "../node-props/helpers.js";
2
+ import { TypographyFeature } from "./features.js";
2
3
  import { TypographyAxis } from "./axes.js";
3
4
  //#region src/controls/typography/use.d.ts
4
5
  /**
@@ -19,6 +20,11 @@ interface UseTypographyOptions {
19
20
  * This composable is designed for text property panels and formatting controls.
20
21
  */
21
22
  declare function useTypography(options?: UseTypographyOptions): {
23
+ features: {
24
+ available: import("vue").ComputedRef<TypographyFeature[]>;
25
+ state: (tag: string) => MixedValue<boolean>;
26
+ set: (tag: string, enabled: boolean) => void;
27
+ };
22
28
  axes: import("vue").ComputedRef<TypographyAxis[]>;
23
29
  opticalSizeAuto: import("vue").ComputedRef<MixedValue<boolean>>;
24
30
  previewAxis: (axis: string, value: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/typography/use.ts"],"mappings":";;;;;;UAOiB;EACf,OAAO,gBAAgB,kBAAkB;;UAG1B;;;;EAIf,aAAa;;;;;;;iBAQC,cAAc,UAAS;kCAAA"}
1
+ {"version":3,"file":"use.d.ts","names":[],"sources":["../../../src/controls/typography/use.ts"],"mappings":";;;;;;;UAQiB;EACf,OAAO,gBAAgB,kBAAkB;;UAG1B;;;;EAIf,aAAa;;;;;;;iBAQC,cAAc,UAAS;;yCAAA"}
@@ -1,6 +1,7 @@
1
1
  import { useEditor } from "../../editor/context/index.js";
2
2
  import { createTypographyAxes } from "./axes.js";
3
3
  import { createTypographyActions, createTypographyState } from "./actions.js";
4
+ import { createTypographyFeatures } from "./features.js";
4
5
  //#region src/controls/typography/use.ts
5
6
  /**
6
7
  * Returns typography-related state and actions for the current text selection.
@@ -16,11 +17,13 @@ function useTypography(options = {}) {
16
17
  options
17
18
  });
18
19
  const axes = createTypographyAxes(editor, typographyState.nodes);
20
+ const features = createTypographyFeatures(editor, typographyState.nodes);
19
21
  return {
20
22
  editor,
21
23
  ...typographyState,
22
24
  ...actions,
23
- ...axes
25
+ ...axes,
26
+ features
24
27
  };
25
28
  }
26
29
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/typography/use.ts"],"sourcesContent":["import { createTypographyActions, createTypographyState } from '#vue/controls/typography/actions'\nimport { createTypographyAxes } from '#vue/controls/typography/axes'\nimport { useEditor } from '#vue/editor/context'\n\n/**\n * Options for {@link useTypography}.\n */\nexport interface TypographyFontLoader {\n load: (family: string, style: string) => Promise<unknown>\n}\n\nexport interface UseTypographyOptions {\n /**\n * Optional font loader invoked before changing family or weight.\n */\n fontLoader?: TypographyFontLoader\n}\n\n/**\n * Returns typography-related state and actions for the current text selection.\n *\n * This composable is designed for text property panels and formatting controls.\n */\nexport function useTypography(options: UseTypographyOptions = {}) {\n const editor = useEditor()\n const typographyState = createTypographyState(editor)\n const actions = createTypographyActions({ editor, ...typographyState, options })\n const axes = createTypographyAxes(editor, typographyState.nodes)\n\n return {\n editor,\n ...typographyState,\n ...actions,\n ...axes\n }\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,cAAc,UAAgC,CAAC,GAAG;CAChE,MAAM,SAAS,UAAU;CACzB,MAAM,kBAAkB,sBAAsB,MAAM;CACpD,MAAM,UAAU,wBAAwB;EAAE;EAAQ,GAAG;EAAiB;CAAQ,CAAC;CAC/E,MAAM,OAAO,qBAAqB,QAAQ,gBAAgB,KAAK;CAE/D,OAAO;EACL;EACA,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"use.js","names":[],"sources":["../../../src/controls/typography/use.ts"],"sourcesContent":["import { createTypographyActions, createTypographyState } from '#vue/controls/typography/actions'\nimport { createTypographyAxes } from '#vue/controls/typography/axes'\nimport { createTypographyFeatures } from '#vue/controls/typography/features'\nimport { useEditor } from '#vue/editor/context'\n\n/**\n * Options for {@link useTypography}.\n */\nexport interface TypographyFontLoader {\n load: (family: string, style: string) => Promise<unknown>\n}\n\nexport interface UseTypographyOptions {\n /**\n * Optional font loader invoked before changing family or weight.\n */\n fontLoader?: TypographyFontLoader\n}\n\n/**\n * Returns typography-related state and actions for the current text selection.\n *\n * This composable is designed for text property panels and formatting controls.\n */\nexport function useTypography(options: UseTypographyOptions = {}) {\n const editor = useEditor()\n const typographyState = createTypographyState(editor)\n const actions = createTypographyActions({ editor, ...typographyState, options })\n const axes = createTypographyAxes(editor, typographyState.nodes)\n const features = createTypographyFeatures(editor, typographyState.nodes)\n\n return {\n editor,\n ...typographyState,\n ...actions,\n ...axes,\n features\n }\n}\n"],"mappings":";;;;;;;;;;AAwBA,SAAgB,cAAc,UAAgC,CAAC,GAAG;CAChE,MAAM,SAAS,UAAU;CACzB,MAAM,kBAAkB,sBAAsB,MAAM;CACpD,MAAM,UAAU,wBAAwB;EAAE;EAAQ,GAAG;EAAiB;CAAQ,CAAC;CAC/E,MAAM,OAAO,qBAAqB,QAAQ,gBAAgB,KAAK;CAC/D,MAAM,WAAW,yBAAyB,QAAQ,gBAAgB,KAAK;CAEvE,OAAO;EACL;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH;CACF;AACF"}
@@ -42,6 +42,9 @@ declare const EDITOR_COMMAND_METADATA: {
42
42
  keybinding: string;
43
43
  contextTestId: string;
44
44
  };
45
+ 'selection.duplicateAsVariation': {
46
+ contextTestId: string;
47
+ };
45
48
  'selection.delete': {
46
49
  shortcut: string;
47
50
  contextTestId: string;
@@ -76,6 +79,7 @@ declare const EDITOR_COMMAND_METADATA: {
76
79
  'selection.detachIcon': {};
77
80
  'selection.goToMainComponent': {};
78
81
  'selection.resetInstanceOverrides': {};
82
+ 'selection.pushInstanceOverrides': {};
79
83
  'selection.createInstance': {};
80
84
  'selection.createSlot': {
81
85
  contextTestId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/editor/commands/registry.ts"],"mappings":";;UAEiB;EACf;EACA;EACA;;cAGW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4IG,sBAAsB,IAAI,kBAAkB"}
1
+ {"version":3,"file":"registry.d.ts","names":[],"sources":["../../../src/editor/commands/registry.ts"],"mappings":";;UAEiB;EACf;EACA;EACA;;cAGW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8IG,sBAAsB,IAAI,kBAAkB"}
@@ -34,6 +34,7 @@ const EDITOR_COMMAND_METADATA = {
34
34
  keybinding: "$mod+KeyD",
35
35
  contextTestId: "context-duplicate"
36
36
  },
37
+ "selection.duplicateAsVariation": { contextTestId: "context-duplicate-as-variation" },
37
38
  "selection.delete": {
38
39
  shortcut: "⌫",
39
40
  contextTestId: "context-delete"
@@ -66,6 +67,7 @@ const EDITOR_COMMAND_METADATA = {
66
67
  "selection.detachIcon": {},
67
68
  "selection.goToMainComponent": {},
68
69
  "selection.resetInstanceOverrides": {},
70
+ "selection.pushInstanceOverrides": {},
69
71
  "selection.createInstance": {},
70
72
  "selection.createSlot": { contextTestId: "context-create-slot" },
71
73
  "selection.wrapInAutoLayout": {