polotno 4.19.1 → 4.20.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 (208) hide show
  1. package/LICENSE.md +8 -2
  2. package/THIRD_PARTY_NOTICES.md +2871 -0
  3. package/blueprint/canvas/context-menu/context-menu.js +1 -1
  4. package/blueprint/canvas/page-controls.d.ts +3 -3
  5. package/blueprint/pages-timeline/pages-timeline.js +2 -2
  6. package/blueprint/pages-timeline/play-button.js +2 -2
  7. package/blueprint/side-panel/animations-panel.d.ts +1 -1
  8. package/blueprint/side-panel/draw-panel.js +2 -2
  9. package/blueprint/side-panel/effect-card.js +3 -3
  10. package/blueprint/side-panel/effects-panel.d.ts +1 -1
  11. package/blueprint/side-panel/effects-panel.js +1 -1
  12. package/blueprint/side-panel/elements-panel.d.ts +1 -1
  13. package/blueprint/side-panel/select-video.d.ts +19 -19
  14. package/blueprint/side-panel/videos-grid.d.ts +4 -4
  15. package/blueprint/toolbar/animations-picker.d.ts +1 -1
  16. package/blueprint/toolbar/element-container.d.ts +1 -1
  17. package/blueprint/toolbar/figure-toolbar.js +1 -1
  18. package/blueprint/toolbar/filters-picker.d.ts +1 -1
  19. package/blueprint/toolbar/filters-picker.js +1 -1
  20. package/blueprint/toolbar/group-button.js +1 -1
  21. package/blueprint/toolbar/image-remove-background-button.js +1 -1
  22. package/blueprint/toolbar/image-toolbar.js +1 -1
  23. package/blueprint/toolbar/line-toolbar.js +1 -1
  24. package/blueprint/toolbar/page-toolbar.d.ts +1 -1
  25. package/blueprint/toolbar/position-picker.js +1 -1
  26. package/blueprint/toolbar/sketch.d.ts +5 -5
  27. package/blueprint/toolbar/svg-toolbar.js +1 -1
  28. package/blueprint/toolbar/table-toolbar.js +1 -1
  29. package/blueprint/toolbar/text-ai-write.js +1 -1
  30. package/blueprint/toolbar/text-toolbar.d.ts +1 -1
  31. package/blueprint.polotno.css +164 -153
  32. package/canvas/apply-filters.d.ts +2 -6
  33. package/canvas/apply-filters.js +1 -1
  34. package/canvas/context-menu/context-menu.js +1 -1
  35. package/canvas/crop-overlay.d.ts +1 -1
  36. package/canvas/crop-overlay.js +1 -1
  37. package/canvas/downscale.d.ts +1 -24
  38. package/canvas/downscale.js +1 -1
  39. package/canvas/element.d.ts +3 -1
  40. package/canvas/element.js +1 -1
  41. package/canvas/fade-overlay.js +1 -1
  42. package/canvas/figure-element.js +1 -1
  43. package/canvas/gif-element.d.ts +32 -0
  44. package/canvas/gif-element.js +1 -1
  45. package/canvas/hotkeys.d.ts +1 -1
  46. package/canvas/hotkeys.js +1 -1
  47. package/canvas/html-element.js +1 -1
  48. package/canvas/image-element.d.ts +4 -48
  49. package/canvas/image-element.js +1 -1
  50. package/canvas/image-tool-controls.js +1 -1
  51. package/canvas/line-element.js +1 -1
  52. package/canvas/lottie-element.d.ts +11 -0
  53. package/canvas/lottie-element.js +1 -0
  54. package/canvas/lottie-player.d.ts +2 -0
  55. package/canvas/lottie-player.js +1 -0
  56. package/canvas/lottie-player.wasm.d.ts +1 -0
  57. package/canvas/lottie-player.wasm.js +1 -0
  58. package/canvas/media-placeholders.d.ts +23 -0
  59. package/canvas/media-placeholders.js +1 -0
  60. package/canvas/page-controls.d.ts +3 -3
  61. package/canvas/page.js +1 -1
  62. package/canvas/quill-font-formats.d.ts +2 -2
  63. package/canvas/rect-control.js +1 -1
  64. package/canvas/render-tag-element.js +1 -1
  65. package/canvas/rich-editor.d.ts +7 -4
  66. package/canvas/rich-editor.js +5 -5
  67. package/canvas/rules.js +2 -2
  68. package/canvas/table-cell-text.d.ts +18 -0
  69. package/canvas/table-cell-text.js +1 -0
  70. package/canvas/table-element.js +1 -1
  71. package/canvas/text-element/caret-color.d.ts +3 -1
  72. package/canvas/text-element/render-tag-source.d.ts +33 -0
  73. package/canvas/text-element/render-tag-source.js +1 -0
  74. package/canvas/text-element.d.ts +1 -1
  75. package/canvas/text-element.js +1 -1
  76. package/canvas/use-color.d.ts +5 -5
  77. package/canvas/use-filtered-source.js +1 -1
  78. package/canvas/use-mediabunny-video.js +1 -1
  79. package/canvas/use-transformer-snap.d.ts +2 -2
  80. package/canvas/video-element.d.ts +4 -2
  81. package/canvas/video-element.js +1 -1
  82. package/icons/animation-icons.d.ts +1 -0
  83. package/icons/animation-icons.js +1 -1
  84. package/icons/registry.d.ts +35 -32
  85. package/icons/registry.js +1 -1
  86. package/image-tools/geometry.d.ts +2 -2
  87. package/image-tools/target.d.ts +6 -6
  88. package/image-tools/target.js +1 -1
  89. package/lib/utils.d.ts +1 -1
  90. package/model/figure-model.d.ts +10 -10
  91. package/model/gif-model.d.ts +10 -10
  92. package/model/group-model.d.ts +393 -84
  93. package/model/group-model.js +1 -1
  94. package/model/image-model.d.ts +10 -10
  95. package/model/image-tools.d.ts +1 -1
  96. package/model/line-model.d.ts +10 -10
  97. package/model/lottie-model.d.ts +242 -0
  98. package/model/lottie-model.js +5 -0
  99. package/model/node-model.d.ts +8 -8
  100. package/model/page-model.d.ts +1186 -297
  101. package/model/page-model.js +1 -1
  102. package/model/shape-model.d.ts +11 -11
  103. package/model/shape-model.js +1 -1
  104. package/model/store.d.ts +30 -26
  105. package/model/store.js +1 -1
  106. package/model/svg-model.d.ts +9 -9
  107. package/model/table-model.d.ts +127 -20
  108. package/model/table-model.js +1 -1
  109. package/model/text-model.d.ts +9 -9
  110. package/model/video-model.d.ts +10 -10
  111. package/package.json +36 -55
  112. package/pages-timeline/pages-timeline.js +1 -1
  113. package/pages-timeline/track-styles.d.ts +12 -12
  114. package/polotno-app.d.ts +1 -1
  115. package/polotno.bundle.js +183 -179
  116. package/primitives/button.d.ts +4 -4
  117. package/primitives/dialog.d.ts +4 -4
  118. package/primitives/dropdown-menu.d.ts +18 -18
  119. package/primitives/input-group.d.ts +1 -1
  120. package/primitives/popover.d.ts +4 -4
  121. package/primitives/select.d.ts +5 -5
  122. package/primitives/tooltip.d.ts +3 -3
  123. package/side-panel/animations-panel.js +1 -1
  124. package/side-panel/background-panel.js +1 -1
  125. package/side-panel/draw-panel.js +1 -1
  126. package/side-panel/effect-card.js +1 -1
  127. package/side-panel/effects-panel.js +1 -1
  128. package/side-panel/photos-panel.js +1 -1
  129. package/side-panel/select-lottie.d.ts +11 -0
  130. package/side-panel/select-lottie.js +1 -0
  131. package/side-panel/select-video.d.ts +19 -19
  132. package/side-panel/size-panel.js +1 -1
  133. package/side-panel/unsplash-credit.d.ts +4 -1
  134. package/side-panel/unsplash-credit.js +1 -1
  135. package/side-panel/upload-panel.js +1 -1
  136. package/themes/carbon.css +1 -1
  137. package/toolbar/gif-toolbar.d.ts +3 -0
  138. package/toolbar/gif-toolbar.js +1 -1
  139. package/toolbar/group-button.js +1 -1
  140. package/toolbar/html-toolbar.d.ts +1 -0
  141. package/toolbar/html-toolbar.js +3 -3
  142. package/toolbar/image-remove-background-button.js +1 -1
  143. package/toolbar/index.d.ts +1 -1
  144. package/toolbar/index.js +1 -1
  145. package/toolbar/line-toolbar.js +1 -1
  146. package/toolbar/position-picker.js +1 -1
  147. package/toolbar/table-toolbar.js +1 -1
  148. package/toolbar/text-ai-write.js +1 -1
  149. package/toolbar/text-toolbar.js +1 -1
  150. package/toolbar/toolbar-shared.d.ts +15 -4
  151. package/toolbar/toolbar-shared.js +1 -1
  152. package/toolbar/toolbar.js +1 -1
  153. package/ui.css +2 -2
  154. package/utils/animations.d.ts +47 -44
  155. package/utils/animations.js +1 -1
  156. package/utils/base64.d.ts +1 -2
  157. package/utils/base64.js +1 -1
  158. package/utils/clipboard.d.ts +19 -18
  159. package/utils/clipboard.js +1 -1
  160. package/utils/fade-gradient.d.ts +1 -1
  161. package/utils/file.d.ts +4 -3
  162. package/utils/file.js +1 -1
  163. package/utils/font-metric.d.ts +29 -28
  164. package/utils/fonts.js +1 -1
  165. package/utils/gif-encoder.d.ts +35 -0
  166. package/utils/gif-encoder.js +1 -0
  167. package/utils/gif-lib.d.ts +6 -10
  168. package/utils/gif-lib.js +1 -1
  169. package/utils/gif-worker.d.ts +1 -0
  170. package/utils/gif-worker.js +3 -0
  171. package/utils/html2canvas.js +1 -1
  172. package/utils/image-dpi.d.ts +1 -1
  173. package/utils/image-dpi.js +1 -1
  174. package/utils/insert-file.js +1 -1
  175. package/utils/l10n.d.ts +1 -0
  176. package/utils/l10n.js +1 -1
  177. package/utils/lottie.d.ts +12 -0
  178. package/utils/lottie.js +1 -0
  179. package/utils/math.d.ts +4 -4
  180. package/utils/px.d.ts +3 -0
  181. package/utils/px.js +1 -1
  182. package/utils/react-color/components/common/Checkboard.d.ts +12 -12
  183. package/utils/react-color/components/common/Swatch.d.ts +6 -6
  184. package/utils/react-color/helpers/interaction.d.ts +6 -6
  185. package/utils/reactcss/components/active.d.ts +6 -6
  186. package/utils/reactcss/components/hover.d.ts +6 -6
  187. package/utils/rich-text-html.js +1 -1
  188. package/utils/selection-colors.js +1 -1
  189. package/utils/selection-transform.d.ts +4 -4
  190. package/utils/selection-transform.js +1 -1
  191. package/utils/split-element.js +1 -1
  192. package/utils/text-format-state.d.ts +1 -0
  193. package/utils/text-format-state.js +1 -1
  194. package/utils/text-format.d.ts +2 -2
  195. package/utils/text-sizing.d.ts +1 -1
  196. package/utils/timeline.d.ts +30 -2
  197. package/utils/timeline.js +1 -1
  198. package/utils/to-html.js +1 -1
  199. package/utils/to-svg.js +1 -1
  200. package/utils/validate-key.js +1 -1
  201. package/canvas/downscale-bands.d.ts +0 -10
  202. package/canvas/downscale-bands.js +0 -1
  203. package/canvas/downscale-kernel.d.ts +0 -7
  204. package/canvas/downscale-kernel.js +0 -1
  205. package/canvas/downscale-kernel.wasm.d.ts +0 -1
  206. package/canvas/downscale-kernel.wasm.js +0 -1
  207. package/canvas/downscale-passes.d.ts +0 -7
  208. package/canvas/downscale-passes.js +0 -1
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e,Fragment as t}from"react/jsx-runtime";import{observer as l}from"mobx-react-lite";import{ContextMenuPopover as n,Menu as s,MenuDivider as i,MenuItem as r}from"@blueprintjs/core";import{t as a}from"../../../utils/l10n.js";import{useDuplicateElement as d}from"../../toolbar/use-duplicate-element.js";import{ChevronDown as m,ChevronUp as c,DoubleChevronDown as u,DoubleChevronUp as b,Duplicate as v,Layers as p,Lock as C,Trash as x,Unlock as E}from"@blueprintjs/icons";import{useRemoveElement as h}from"../../toolbar/use-remove-element.js";import{useCopyStyle as w}from"../../toolbar/use-copy-style.js";import{useLock as f}from"../../toolbar/use-lock.js";export const ContextMenu=l(({store:l,isOpen:k,offset:R,setIsOpen:y})=>{var j;const{disabled:g,duplicate:M}=d({store:l}),{disabled:D,remove:P}=h({store:l}),{setElementToCopy:B}=w(l),{disabled:O,lock:F,locked:T}=f({store:l}),U=o(T?C:E,{});return 0===l.selectedElements.length?null:o(n,{isOpen:k,onClose:()=>{y(!1)},content:e(s,{children:[o(r,{shouldDismissPopover:!1,icon:U,text:a(T?"contextMenu.unlock":"contextMenu.lock"),onClick:F,disabled:O}),o(r,{icon:o(v,{}),text:a("contextMenu.duplicate"),onClick:M,disabled:g}),o(r,{icon:o(x,{}),text:a("contextMenu.remove"),onClick:P,disabled:D}),o(i,{}),e(r,{icon:o(p,{}),text:a("toolbar.layering"),children:[o(r,{shouldDismissPopover:!1,icon:o(b,{}),text:a("toolbar.toForward"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsTop([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveTop())}),o(r,{shouldDismissPopover:!1,icon:o(c,{}),text:a("toolbar.up"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsUp([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveUp())}),o(r,{shouldDismissPopover:!1,icon:o(m,{}),text:a("toolbar.down"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsDown([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveDown())}),o(r,{shouldDismissPopover:!1,icon:o(u,{}),text:a("toolbar.toBottom"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsBottom([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveBottom())})]}),"table"===(null===(j=l.selectedElements[0])||void 0===j?void 0:j.type)&&(()=>{var n;const s=l.selectedElements[0],d=s.focusedCells[0],m=null!=d,c=null!==(n=s.getFocusedCellRange())&&void 0!==n?n:d?{minRow:d.row,maxRow:d.row,minCol:d.col,maxCol:d.col}:{minRow:0,maxRow:0,minCol:0,maxCol:0},{minRow:u,maxRow:b,minCol:v,maxCol:p}=c,C=b>u,x=p>v;return e(t,{children:[m&&e(t,{children:[o(i,{}),o(r,{text:a("toolbar.insertRowAbove"),onClick:()=>{l.history.transaction(()=>{s.addRow(u)})}}),o(r,{text:a("toolbar.insertRowBelow"),onClick:()=>{l.history.transaction(()=>{s.addRow(b+1)})}}),o(r,{text:a(C?"toolbar.deleteRows":"toolbar.deleteRow"),disabled:s.rows<=b-u+1,onClick:()=>{l.history.transaction(()=>{s.removeRowRange(u,b)})}}),o(i,{}),o(r,{text:a("toolbar.insertColumnLeft"),onClick:()=>{l.history.transaction(()=>{s.addColumn(v)})}}),o(r,{text:a("toolbar.insertColumnRight"),onClick:()=>{l.history.transaction(()=>{s.addColumn(p+1)})}}),o(r,{text:a(x?"toolbar.deleteColumns":"toolbar.deleteColumn"),disabled:s.cols<=p-v+1,onClick:()=>{l.history.transaction(()=>{s.removeColumnRange(v,p)})}})]}),o(i,{}),o(r,{text:a("toolbar.distributeRowsEvenly"),onClick:()=>{l.history.transaction(()=>{s.distributeRowsEvenly()})}}),o(r,{text:a("toolbar.distributeColumnsEvenly"),onClick:()=>{l.history.transaction(()=>{s.distributeColumnsEvenly()})}})]})})()]}),targetOffset:{top:R.y,left:R.x}})});
1
+ import{Fragment as o,jsx as e,jsxs as t}from"react/jsx-runtime";import{observer as l}from"mobx-react-lite";import{ContextMenuPopover as n,Menu as s,MenuDivider as i,MenuItem as r}from"@blueprintjs/core";import{t as a}from"../../../utils/l10n.js";import{useDuplicateElement as d}from"../../toolbar/use-duplicate-element.js";import{ChevronDown as m,ChevronUp as c,DoubleChevronDown as u,DoubleChevronUp as b,Duplicate as v,Layers as p,Lock as C,Trash as x,Unlock as E}from"@blueprintjs/icons";import{useRemoveElement as h}from"../../toolbar/use-remove-element.js";import{useCopyStyle as w}from"../../toolbar/use-copy-style.js";import{useLock as f}from"../../toolbar/use-lock.js";export const ContextMenu=l(({store:l,isOpen:k,offset:R,setIsOpen:y})=>{var j;const{disabled:g,duplicate:M}=d({store:l}),{disabled:D,remove:P}=h({store:l}),{setElementToCopy:B}=w(l),{disabled:O,lock:F,locked:T}=f({store:l}),U=e(T?C:E,{});return 0===l.selectedElements.length?null:e(n,{isOpen:k,onClose:()=>{y(!1)},content:t(s,{children:[e(r,{shouldDismissPopover:!1,icon:U,text:a(T?"contextMenu.unlock":"contextMenu.lock"),onClick:F,disabled:O}),e(r,{icon:e(v,{}),text:a("contextMenu.duplicate"),onClick:M,disabled:g}),e(r,{icon:e(x,{}),text:a("contextMenu.remove"),onClick:P,disabled:D}),e(i,{}),t(r,{icon:e(p,{}),text:a("toolbar.layering"),children:[e(r,{shouldDismissPopover:!1,icon:e(b,{}),text:a("toolbar.toForward"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsTop([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveTop())}),e(r,{shouldDismissPopover:!1,icon:e(c,{}),text:a("toolbar.up"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsUp([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveUp())}),e(r,{shouldDismissPopover:!1,icon:e(m,{}),text:a("toolbar.down"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsDown([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveDown())}),e(r,{shouldDismissPopover:!1,icon:e(u,{}),text:a("toolbar.toBottom"),disabled:!l.selectedElements.some(o=>{var e;return null===(e=o.parent)||void 0===e?void 0:e.canMoveElementsBottom([o.id])}),onClick:()=>l.selectedElements.forEach(o=>o.moveBottom())})]}),"table"===(null===(j=l.selectedElements[0])||void 0===j?void 0:j.type)&&(()=>{var n;const s=l.selectedElements[0],d=s.focusedCells[0],m=null!=d,c=null!==(n=s.getFocusedCellRange())&&void 0!==n?n:d?{minRow:d.row,maxRow:d.row,minCol:d.col,maxCol:d.col}:{minRow:0,maxRow:0,minCol:0,maxCol:0},{minRow:u,maxRow:b,minCol:v,maxCol:p}=c,C=b>u,x=p>v;return t(o,{children:[m&&t(o,{children:[e(i,{}),e(r,{text:a("toolbar.insertRowAbove"),onClick:()=>{l.history.transaction(()=>{s.addRow(u)})}}),e(r,{text:a("toolbar.insertRowBelow"),onClick:()=>{l.history.transaction(()=>{s.addRow(b+1)})}}),e(r,{text:a(C?"toolbar.deleteRows":"toolbar.deleteRow"),disabled:s.rows<=b-u+1,onClick:()=>{l.history.transaction(()=>{s.removeRowRange(u,b)})}}),e(i,{}),e(r,{text:a("toolbar.insertColumnLeft"),onClick:()=>{l.history.transaction(()=>{s.addColumn(v)})}}),e(r,{text:a("toolbar.insertColumnRight"),onClick:()=>{l.history.transaction(()=>{s.addColumn(p+1)})}}),e(r,{text:a(x?"toolbar.deleteColumns":"toolbar.deleteColumn"),disabled:s.cols<=p-v+1,onClick:()=>{l.history.transaction(()=>{s.removeColumnRange(v,p)})}})]}),e(i,{}),e(r,{text:a("toolbar.distributeRowsEvenly"),onClick:()=>{l.history.transaction(()=>{s.distributeRowsEvenly()})}}),e(r,{text:a("toolbar.distributeColumnsEvenly"),onClick:()=>{l.history.transaction(()=>{s.distributeColumnsEvenly()})}})]})})()]}),targetOffset:{top:R.y,left:R.x}})});
@@ -6,19 +6,19 @@ export declare const PageControls: (({ store, page, xPadding, yPadding, layout,
6
6
  page: PageType;
7
7
  xPadding: number;
8
8
  yPadding: number;
9
- layout?: "vertical" | "horizontal";
9
+ layout?: 'vertical' | 'horizontal';
10
10
  }) => React.JSX.Element | null) & React.NamedExoticComponent<{
11
11
  store: StoreType;
12
12
  page: PageType;
13
13
  xPadding: number;
14
14
  yPadding: number;
15
- layout?: "vertical" | "horizontal";
15
+ layout?: 'vertical' | 'horizontal';
16
16
  }> & {
17
17
  readonly type: ({ store, page, xPadding, yPadding, layout, }: {
18
18
  store: StoreType;
19
19
  page: PageType;
20
20
  xPadding: number;
21
21
  yPadding: number;
22
- layout?: "vertical" | "horizontal";
22
+ layout?: 'vertical' | 'horizontal';
23
23
  }) => React.JSX.Element | null;
24
24
  };
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import"../blueprint-guard";import n from"react";import{observer as o}from"mobx-react-lite";import{Button as r,Navbar as s}from"@blueprintjs/core";import{Plus as a,Play as l}from"@blueprintjs/icons";import d from"../../utils/styled.js";import{flags as m}from"../../utils/flags.js";import{t as p}from"../../utils/l10n.js";import{Pages as c}from"./pages.js";import{CurrentTime as u}from"./current-time.js";import{Audios as h}from"./audios.js";import{ElementsTimeline as v}from"./elements.js";import{PlayButton as f}from"./play-button.js";import{TimeRuler as g}from"./time-ruler.js";const b=d("div")`
1
+ import{Fragment as e,jsx as t,jsxs as i}from"react/jsx-runtime";import"../blueprint-guard";import n from"react";import{observer as o}from"mobx-react-lite";import{Button as r,Navbar as s}from"@blueprintjs/core";import{Plus as a,Play as l}from"@blueprintjs/icons";import d from"../../utils/styled.js";import{flags as m}from"../../utils/flags.js";import{t as p}from"../../utils/l10n.js";import{Pages as c}from"./pages.js";import{CurrentTime as u}from"./current-time.js";import{Audios as h}from"./audios.js";import{ElementsTimeline as v}from"./elements.js";import{PlayButton as f}from"./play-button.js";import{TimeRuler as g}from"./time-ruler.js";const b=d("div")`
2
2
  position: relative;
3
3
  height: 0px;
4
4
  `,x=d("div")`
@@ -35,4 +35,4 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import"../bluepr
35
35
  &.active::before {
36
36
  background: var(--polotno-accent-color, #137cbd);
37
37
  }
38
- `;export const PagesTimeline=o(({store:o,defaultOpened:d=!1})=>{const y=n.useRef(null),[j,E]=n.useState(d),[k,L]=n.useState(.02),[C,M]=n.useState(()=>(e=>{if(!m.animationsEnabled){return 65}const t=e.pages.reduce((e,t)=>e+t.children.length,0),i=25*e.audios.length+20*t+140;return Math.min(Math.max(i,140),420)})(o)),[R,S]=n.useState(!1),P=n.useRef(0),z=n.useRef(C),D=n.useRef(!1),W=o.duration*k,Y=n.useCallback(e=>{if(!D.current){return}const t=e.clientY-P.current,i=z.current-t,n=Math.min(420,Math.max(140,i));M(n)},[]),N=n.useCallback(()=>{D.current&&(D.current=!1,S(!1),window.removeEventListener("mousemove",Y),window.removeEventListener("mouseup",N))},[Y]);return n.useEffect(()=>()=>{window.removeEventListener("mousemove",Y),window.removeEventListener("mouseup",N)},[Y,N]),t(i,{children:[e(b,{children:e(x,{children:e(s,{style:{height:"35px",padding:"0 5px"},children:e(s.Group,{style:{height:"35px"},children:e(r,{minimal:!0,onClick:()=>{E(!j)},icon:m.animationsEnabled&&!j?e(l,{}):null,children:p("pagesTimeline.pages")})})})})}),t(s,{style:{padding:"5px",height:"auto",zIndex:1,position:"relative",overflow:"visible",display:j?"block":"none"},className:"polotno-pages-timeline",children:[m.animationsEnabled&&e(w,{onMouseDown:e=>{e.preventDefault(),P.current=e.clientY,z.current=C,D.current=!0,S(!0),window.addEventListener("mousemove",Y),window.addEventListener("mouseup",N)},className:R?"active":void 0,title:"Drag to adjust timeline height"}),m.animationsEnabled&&e("div",{style:{display:"flex",justifyContent:"center"},children:e(f,{store:o,scale:k,onScaleChange:L})}),e("div",{dir:"ltr",style:{width:"100%",position:"relative",height:C},children:e("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowX:"auto",padding:"0 24px"},ref:y,children:t("div",{style:{position:"relative",minWidth:m.animationsEnabled?W+"px":void 0},children:[m.animationsEnabled&&e(g,{store:o,scale:k,minWidth:W}),t("div",{style:{position:"relative",display:"flex"},children:[e("div",{style:{position:"relative",minWidth:m.animationsEnabled?W+"px":void 0,height:"60px"},children:e(c,{store:o,scale:k})}),e(r,{icon:e(a,{}),style:{width:"60px",marginLeft:"12px"},onClick:()=>{var e;o.addPage({bleed:(null===(e=o.activePage)||void 0===e?void 0:e.bleed)||0})},minimal:!0})]}),m.animationsEnabled&&t(i,{children:[e(v,{store:o,scale:k,width:W}),e(h,{store:o,scale:k,width:W})]}),m.animationsEnabled&&e(u,{store:o,scale:k,dragAreaRef:y,variant:"timeline"})]})})})]})]})});
38
+ `;export const PagesTimeline=o(({store:o,defaultOpened:d=!1})=>{const y=n.useRef(null),[j,E]=n.useState(d),[k,L]=n.useState(.02),[C,M]=n.useState(()=>(e=>{if(!m.animationsEnabled){return 65}const t=e.pages.reduce((e,t)=>e+t.children.length,0),i=25*e.audios.length+20*t+140;return Math.min(Math.max(i,140),420)})(o)),[R,S]=n.useState(!1),P=n.useRef(0),z=n.useRef(C),D=n.useRef(!1),W=o.duration*k,Y=n.useCallback(e=>{if(!D.current){return}const t=e.clientY-P.current,i=z.current-t,n=Math.min(420,Math.max(140,i));M(n)},[]),N=n.useCallback(()=>{D.current&&(D.current=!1,S(!1),window.removeEventListener("mousemove",Y),window.removeEventListener("mouseup",N))},[Y]);return n.useEffect(()=>()=>{window.removeEventListener("mousemove",Y),window.removeEventListener("mouseup",N)},[Y,N]),i(e,{children:[t(b,{children:t(x,{children:t(s,{style:{height:"35px",padding:"0 5px"},children:t(s.Group,{style:{height:"35px"},children:t(r,{minimal:!0,onClick:()=>{E(!j)},icon:m.animationsEnabled&&!j?t(l,{}):null,children:p("pagesTimeline.pages")})})})})}),i(s,{style:{padding:"5px",height:"auto",zIndex:1,position:"relative",overflow:"visible",display:j?"block":"none"},className:"polotno-pages-timeline",children:[m.animationsEnabled&&t(w,{onMouseDown:e=>{e.preventDefault(),P.current=e.clientY,z.current=C,D.current=!0,S(!0),window.addEventListener("mousemove",Y),window.addEventListener("mouseup",N)},className:R?"active":void 0,title:"Drag to adjust timeline height"}),m.animationsEnabled&&t("div",{style:{display:"flex",justifyContent:"center"},children:t(f,{store:o,scale:k,onScaleChange:L})}),t("div",{dir:"ltr",style:{width:"100%",position:"relative",height:C},children:t("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowX:"auto",padding:"0 24px"},ref:y,children:i("div",{style:{position:"relative",minWidth:m.animationsEnabled?W+"px":void 0},children:[m.animationsEnabled&&t(g,{store:o,scale:k,minWidth:W}),i("div",{style:{position:"relative",display:"flex"},children:[t("div",{style:{position:"relative",minWidth:m.animationsEnabled?W+"px":void 0,height:"60px"},children:t(c,{store:o,scale:k})}),t(r,{icon:t(a,{}),style:{width:"60px",marginLeft:"12px"},onClick:()=>{var e;o.addPage({bleed:(null===(e=o.activePage)||void 0===e?void 0:e.bleed)||0})},minimal:!0})]}),m.animationsEnabled&&i(e,{children:[t(v,{store:o,scale:k,width:W}),t(h,{store:o,scale:k,width:W})]}),m.animationsEnabled&&t(u,{store:o,scale:k,dragAreaRef:y,variant:"timeline"})]})})})]})]})});
@@ -1,4 +1,4 @@
1
- import{jsxs as t,jsx as i}from"react/jsx-runtime";import{observer as e}from"mobx-react-lite";import{Button as n,ButtonGroup as o}from"@blueprintjs/core";import{Pause as l,Play as a}from"@blueprintjs/icons";import r from"../../utils/styled.js";const s=r("div")`
1
+ import{jsx as t,jsxs as i}from"react/jsx-runtime";import{observer as e}from"mobx-react-lite";import{Button as n,ButtonGroup as o}from"@blueprintjs/core";import{Pause as l,Play as a}from"@blueprintjs/icons";import r from"../../utils/styled.js";const s=r("div")`
2
2
  display: grid;
3
3
  grid-template-columns: 1fr auto 1fr;
4
4
  align-items: center;
@@ -21,4 +21,4 @@ import{jsxs as t,jsx as i}from"react/jsx-runtime";import{observer as e}from"mobx
21
21
  font-size: 13px;
22
22
  font-weight: 500;
23
23
  font-variant-numeric: tabular-nums;
24
- `,f=t=>{const i=Math.floor(t/6e4),e=Math.floor(t%6e4/1e3);return`${i.toString().padStart(2,"0")}:${e.toString().padStart(2,"0")}`};export const PlayButton=e(({store:e,scale:r,onScaleChange:g})=>{var u;const y=(null===(u=e.activePage)||void 0===u?void 0:u.startTime)||0,h=e.isPlaying||0!==e.currentTime?e.currentTime:y;return t(s,{children:[i(c,{children:t(p,{style:{opacity:.85,textAlign:"right"},children:[f(h)," / ",f(e.duration)]})}),i(m,{className:"polotno-play-button-container",children:i(n,{icon:e.isPlaying?i(l,{size:25}):i(a,{size:25}),minimal:!0,onClick:()=>{var t;if(e.isPlaying){const t=e.activePage;e.stop(),t&&e.selectPage(t.id)}else{e.play({startTime:(null===(t=e.activePage)||void 0===t?void 0:t.startTime)||0})}}})}),g&&r&&t(d,{children:[i(p,{style:{opacity:.6,fontSize:"12px"},children:"Zoom timeline"}),t(o,{minimal:!0,children:[i(n,{icon:i("span",{style:{fontWeight:"bold"},children:"−"}),onClick:()=>{g&&r&&g(Math.max(r/1.5,.005))},title:"Zoom out timeline"}),i(n,{icon:i("span",{style:{fontWeight:"bold"},children:"+"}),onClick:()=>{g&&r&&g(Math.min(1.5*r,.2))},title:"Zoom in timeline"})]})]})]})});
24
+ `,f=t=>{const i=Math.floor(t/6e4),e=Math.floor(t%6e4/1e3);return`${i.toString().padStart(2,"0")}:${e.toString().padStart(2,"0")}`};export const PlayButton=e(({store:e,scale:r,onScaleChange:g})=>{var u;const y=(null===(u=e.activePage)||void 0===u?void 0:u.startTime)||0,h=e.isPlaying||0!==e.currentTime?e.currentTime:y;return i(s,{children:[t(c,{children:i(p,{style:{opacity:.85,textAlign:"right"},children:[f(h)," / ",f(e.duration)]})}),t(m,{className:"polotno-play-button-container",children:t(n,{icon:e.isPlaying?t(l,{size:25}):t(a,{size:25}),minimal:!0,onClick:()=>{var t;if(e.isPlaying){const t=e.activePage;e.stop(),t&&e.selectPage(t.id)}else{e.play({startTime:(null===(t=e.activePage)||void 0===t?void 0:t.startTime)||0})}}})}),g&&r&&i(d,{children:[t(p,{style:{opacity:.6,fontSize:"12px"},children:"Zoom timeline"}),i(o,{minimal:!0,children:[t(n,{icon:t("span",{style:{fontWeight:"bold"},children:"−"}),onClick:()=>{g&&r&&g(Math.max(r/1.5,.005))},title:"Zoom out timeline"}),t(n,{icon:t("span",{style:{fontWeight:"bold"},children:"+"}),onClick:()=>{g&&r&&g(Math.min(1.5*r,.2))},title:"Zoom in timeline"})]})]})]})});
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { StoreType } from '../../model/store.js';
3
3
  export declare const NumberInput: ({ value, onValueChange, ...props }: {
4
4
  [x: string]: any;
5
- value: any;
6
5
  onValueChange: any;
6
+ value: any;
7
7
  }) => React.JSX.Element;
8
8
  export declare const AnimationsPanel: (({ store }: {
9
9
  store: StoreType;
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import o from"react";import{observer as l}from"mobx-react-lite";import{Button as n,ButtonGroup as r,Slider as s,NumericInput as a}from"@blueprintjs/core";import{Edit as c,Highlight as d,Select as h}from"@blueprintjs/icons";import p from"../../utils/styled.js";import m from"../toolbar/color-picker.js";import*as u from"../../utils/svg.js";const g=p("div")`
1
+ import{Fragment as e,jsx as i,jsxs as t}from"react/jsx-runtime";import o from"react";import{observer as l}from"mobx-react-lite";import{Button as n,ButtonGroup as r,Slider as s,NumericInput as a}from"@blueprintjs/core";import{Edit as c,Highlight as d,Select as h}from"@blueprintjs/icons";import p from"../../utils/styled.js";import m from"../toolbar/color-picker.js";import*as u from"../../utils/svg.js";const g=p("div")`
2
2
  height: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -16,4 +16,4 @@ import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import o from"re
16
16
  align-items: center;
17
17
  justify-content: space-between;
18
18
  padding: 5px 0;
19
- `,b=(e,i,t)=>Math.max(i,Math.min(t,e)),f=(e,i)=>Array.from(e.keys()).find(e=>u.sameColors(e,i)),C=(e,i)=>{const t=f(e,i);return e.get(t||"")||i};export const DrawPanel=l(({store:l})=>{const{brushType:p,strokeWidth:k,stroke:T,opacity:w}=l.toolOptions,j="selection"===l.tool,N=l.selectedElements,O=1===N.length&&"svg"===N[0].type,z=O?N[0]:null,M=u.useSvgColors((null==z?void 0:z.src)||""),S=M.length>0?M[0]:null,E=e=>{"selection"===e?l.setTool("selection"):(l.selectElements([]),l.setTool("draw"),l.setToolOptions({brushType:e,opacity:"highlighter"===e?.5:1,strokeWidth:"highlighter"===e?30:k||5}))},R=e=>{l.setToolOptions({strokeWidth:e})},F=e=>{l.setToolOptions({opacity:e})},P=e=>{z&&z.set({opacity:e})};return o.useEffect(()=>()=>{l.setTool("selection")},[]),i(g,{children:[i(y,{children:[e(x,{children:"Tool"}),i(r,{fill:!0,style:{padding:"0 5px"},children:[e(n,{active:j,onClick:()=>E("selection"),icon:e(h,{}),children:"Selection"}),e(n,{active:!j&&"brush"===p,onClick:()=>E("brush"),icon:e(c,{}),children:"Brush"}),e(n,{active:!j&&"highlighter"===p,onClick:()=>E("highlighter"),icon:e(d,{}),children:"Highlighter"})]})]}),!O&&i(t,{children:[i(y,{style:{opacity:j?.5:1},children:[i(v,{children:[e("div",{children:"Stroke Width"}),e(a,{value:k,onValueChange:e=>{Number.isNaN(e)||R(b(e,1,50))},style:{width:"60px"},min:1,max:50,buttonPosition:"none",disabled:j})]}),e("div",{style:{padding:"0 13px"},children:e(s,{min:1,max:50,stepSize:1,value:k,onChange:R,labelRenderer:!1,showTrackFill:!1,disabled:j})})]}),e(y,{style:{opacity:j?.5:1,pointerEvents:j?"none":"auto"},children:i(v,{children:[e("div",{style:{lineHeight:"30px"},children:"Color"}),e(m,{value:T,size:30,onChange:e=>{l.setToolOptions({stroke:e})},store:l})]})}),i(y,{style:{opacity:j?.5:1},children:[i(v,{children:[e("div",{children:"Opacity"}),e(a,{value:Math.round(100*w),onValueChange:e=>{Number.isNaN(e)||F(b(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none",disabled:j})]}),e("div",{style:{padding:"0 13px"},children:e(s,{min:0,max:100,stepSize:1,value:Math.round(100*w),onChange:e=>F(e/100),labelRenderer:!1,showTrackFill:!1,disabled:j})})]})]}),O&&S&&i(t,{children:[e(y,{children:i(v,{children:[e("div",{style:{lineHeight:"30px"},children:"Color"}),e(m,{value:C(z.colorsReplace,S),size:30,onChange:e=>{if(z&&S){const i=f(z.colorsReplace,S)||S;z.replaceColor(i,e)}},store:l,gradientEnabled:!0})]})}),i(y,{children:[i(v,{children:[e("div",{children:"Opacity"}),e(a,{value:Math.round(100*z.opacity),onValueChange:e=>{Number.isNaN(e)||P(b(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none"})]}),e("div",{style:{padding:"0 13px"},children:e(s,{min:0,max:100,stepSize:1,value:Math.round(100*z.opacity),onChange:e=>P(e/100),labelRenderer:!1,showTrackFill:!1})})]})]})]})});
19
+ `,b=(e,i,t)=>Math.max(i,Math.min(t,e)),f=(e,i)=>Array.from(e.keys()).find(e=>u.sameColors(e,i)),C=(e,i)=>{const t=f(e,i);return e.get(t||"")||i};export const DrawPanel=l(({store:l})=>{const{brushType:p,strokeWidth:k,stroke:T,opacity:w}=l.toolOptions,j="selection"===l.tool,N=l.selectedElements,O=1===N.length&&"svg"===N[0].type,z=O?N[0]:null,M=u.useSvgColors((null==z?void 0:z.src)||""),S=M.length>0?M[0]:null,E=e=>{"selection"===e?l.setTool("selection"):(l.selectElements([]),l.setTool("draw"),l.setToolOptions({brushType:e,opacity:"highlighter"===e?.5:1,strokeWidth:"highlighter"===e?30:k||5}))},R=e=>{l.setToolOptions({strokeWidth:e})},F=e=>{l.setToolOptions({opacity:e})},P=e=>{z&&z.set({opacity:e})};return o.useEffect(()=>()=>{l.setTool("selection")},[]),t(g,{children:[t(y,{children:[i(x,{children:"Tool"}),t(r,{fill:!0,style:{padding:"0 5px"},children:[i(n,{active:j,onClick:()=>E("selection"),icon:i(h,{}),children:"Selection"}),i(n,{active:!j&&"brush"===p,onClick:()=>E("brush"),icon:i(c,{}),children:"Brush"}),i(n,{active:!j&&"highlighter"===p,onClick:()=>E("highlighter"),icon:i(d,{}),children:"Highlighter"})]})]}),!O&&t(e,{children:[t(y,{style:{opacity:j?.5:1},children:[t(v,{children:[i("div",{children:"Stroke Width"}),i(a,{value:k,onValueChange:e=>{Number.isNaN(e)||R(b(e,1,50))},style:{width:"60px"},min:1,max:50,buttonPosition:"none",disabled:j})]}),i("div",{style:{padding:"0 13px"},children:i(s,{min:1,max:50,stepSize:1,value:k,onChange:R,labelRenderer:!1,showTrackFill:!1,disabled:j})})]}),i(y,{style:{opacity:j?.5:1,pointerEvents:j?"none":"auto"},children:t(v,{children:[i("div",{style:{lineHeight:"30px"},children:"Color"}),i(m,{value:T,size:30,onChange:e=>{l.setToolOptions({stroke:e})},store:l})]})}),t(y,{style:{opacity:j?.5:1},children:[t(v,{children:[i("div",{children:"Opacity"}),i(a,{value:Math.round(100*w),onValueChange:e=>{Number.isNaN(e)||F(b(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none",disabled:j})]}),i("div",{style:{padding:"0 13px"},children:i(s,{min:0,max:100,stepSize:1,value:Math.round(100*w),onChange:e=>F(e/100),labelRenderer:!1,showTrackFill:!1,disabled:j})})]})]}),O&&S&&t(e,{children:[i(y,{children:t(v,{children:[i("div",{style:{lineHeight:"30px"},children:"Color"}),i(m,{value:C(z.colorsReplace,S),size:30,onChange:e=>{if(z&&S){const i=f(z.colorsReplace,S)||S;z.replaceColor(i,e)}},store:l,gradientEnabled:!0})]})}),t(y,{children:[t(v,{children:[i("div",{children:"Opacity"}),i(a,{value:Math.round(100*z.opacity),onValueChange:e=>{Number.isNaN(e)||P(b(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none"})]}),i("div",{style:{padding:"0 13px"},children:i(s,{min:0,max:100,stepSize:1,value:Math.round(100*z.opacity),onChange:e=>P(e/100),labelRenderer:!1,showTrackFill:!1})})]})]})]})});
@@ -1,4 +1,4 @@
1
- var r,e;import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";import l from"../../utils/styled.js";import{Effects as o,shapeFilterToCSS as s}from"../../utils/filters.js";const n=l("div")`
1
+ var r,e;import{Fragment as t,jsx as i,jsxs as a}from"react/jsx-runtime";import l from"../../utils/styled.js";import{Effects as o,shapeFilterToCSS as s}from"../../utils/filters.js";const n=l("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  flex-grow: 0;
@@ -31,12 +31,12 @@ var r,e;import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";import l
31
31
  &[data-active='true'] {
32
32
  border-color: white;
33
33
  }
34
- `;export const EffectCard=({title:r,imageSrc:e,effect:a,onClick:l,active:o})=>{const s=v(a);return i(n,{onClick:l,children:[i(d,{children:[t(u,{"data-active":o}),t(s,{src:e})]}),t(c,{children:r})]})};const f=l(p)`
34
+ `;export const EffectCard=({title:r,imageSrc:e,effect:t,onClick:l,active:o})=>{const s=v(t);return a(n,{onClick:l,children:[a(d,{children:[i(u,{"data-active":o}),i(s,{src:e})]}),i(c,{children:r})]})};const f=l(p)`
35
35
  filter: sepia(1);
36
36
  `,x=l(p)`
37
37
  filter: grayscale(1);
38
38
  `,m=l(p)`
39
39
  filter: ${null===(r=s(o.warm))||void 0===r?void 0:r.filter};
40
- `,g=r=>{const{html:e,filter:l}=s(o.cold);return i(a,{children:[t("div",{style:{display:"none"},dangerouslySetInnerHTML:{__html:e||""}}),t(p,Object.assign({style:{filter:l}},r))]})},h=l(p)`
40
+ `,g=r=>{const{html:e,filter:l}=s(o.cold);return a(t,{children:[i("div",{style:{display:"none"},dangerouslySetInnerHTML:{__html:e||""}}),i(p,Object.assign({style:{filter:l}},r))]})},h=l(p)`
41
41
  filter: ${null===(e=s(o.natural))||void 0===e?void 0:e.filter};
42
42
  `,v=r=>{switch(r){case o.sepia:return f;case o.grayscale:return x;case o.warm:return m;case o.cold:return g;case o.natural:return h;default:return p}};
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { StoreType } from '../../model/store.js';
3
3
  export declare const NumberInput: ({ value, onValueChange, ...props }: {
4
4
  [x: string]: any;
5
- value: any;
6
5
  onValueChange: any;
6
+ value: any;
7
7
  }) => React.JSX.Element;
8
8
  export declare const EffectsPanel: (({ store }: {
9
9
  store: StoreType;
@@ -1 +1 @@
1
- var e=this&&this.__rest||function(e,n){var a={};for(var t in e){Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t])}if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++){n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(a[t[l]]=e[t[l]])}}return a};import{jsx as n,jsxs as a,Fragment as t}from"react/jsx-runtime";import l from"react";import{Alignment as i,Button as r,NumericInput as o,Slider as d,Switch as s}from"@blueprintjs/core";import{observer as u}from"mobx-react-lite";import{INDEPENDENT_FILTERS as c}from"../../model/shape-model.js";import h from"../toolbar/color-picker.js";import{t as b}from"../../utils/l10n.js";import{Cross as p}from"@blueprintjs/icons";import{EffectCard as m}from"./effect-card.js";import{Effects as g}from"../../utils/filters.js";import{CurvePowerSlider as f}from"../toolbar/filters-picker.js";const v=(e,n,a)=>Math.max(n,Math.min(a,e));export const NumberInput=a=>{var{value:t,onValueChange:i}=a,r=e(a,["value","onValueChange"]);const[d,s]=l.useState(t.toString());return l.useEffect(()=>{s(t.toString())},[t]),n(o,Object.assign({value:d,onValueChange:(e,n)=>{s(n),Number.isNaN(e)||i(e)}},r))};const x=({label:e,enabled:l,visible:r=!0,onEnabledChange:u,numberValue:c,onNumberValueChange:h,min:b,max:p})=>r?a(t,{children:[n(s,{checked:l,label:e,onChange:e=>{u(e.target.checked)},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),l&&a("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[n("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:n(d,{value:c,onChange:e=>{h(e)},min:b,max:p,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})}),n(o,{value:c,onValueChange:e=>{h(v(e,b,p))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:b,max:p})]})]}):null;export const EffectsPanel=u(({store:e})=>{var t,u,y,C,w,k,E,V,j,I,T,O,R,M;const P=e.selectedElements,N=P[0],S=P.map(e=>e.id).join(","),B="effects"===e.openedSidePanel;if(l.useEffect(()=>{B&&(N&&N.filters||e.restoreSidePanel())},[B,S]),!N||!N.filters){return null}const z=(e=>"text"===e.type)(N),F=((e=>{e.type})(N),(e=>"image"===e.type)(N)),H=(e=>"svg"===e.type)(N),G=F||H,W=n=>{e.history.transaction(()=>{P.forEach(e=>{e.set(n)})})},X=(n,a)=>{e.history.transaction(()=>{P.forEach(e=>{let t=Number(a);return 0==a||a||(t=e.filters.has(n)?null:1),c.includes(n)||e.set({grayscaleEnabled:"grayscale"===n&&!!a,sepiaEnabled:"sepia"===n&&!!a}),e.setFilter(n,t)})})};return a("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"},children:[a("div",{style:{display:"flex",justifyContent:"space-between"},children:[n("h3",{style:{margin:0,lineHeight:"30px"},children:b("sidePanel.effects")}),n(r,{minimal:!0,icon:n(p,{}),onClick:()=>e.restoreSidePanel()})]}),G&&n("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginTop:"16px"},children:a("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[n(m,{active:N.grayscaleEnabled,onClick:()=>{X("grayscale",!N.grayscaleEnabled)},title:b("toolbar.grayscale"),imageSrc:N.src,effect:g.grayscale}),n(m,{active:N.sepiaEnabled,onClick:()=>{X("sepia",!N.sepiaEnabled)},title:b("toolbar.sepia"),imageSrc:N.src,effect:g.sepia}),n(m,{active:N.filters.has("cold"),onClick:()=>{X("cold",N.filters.has("cold")?null:1)},title:b("toolbar.cold"),imageSrc:N.src,effect:g.cold}),n(m,{active:N.filters.has("natural"),onClick:()=>{X("natural",N.filters.has("natural")?null:1)},title:b("toolbar.natural"),imageSrc:N.src,effect:g.natural}),n(m,{active:N.filters.has("warm"),onClick:()=>{X("warm",N.filters.has("warm")?null:1)},title:b("toolbar.warm"),imageSrc:N.src,effect:g.warm})]})}),n(x,{label:b("toolbar.blur"),enabled:N.blurEnabled,visible:G||z,onEnabledChange:e=>{W({blurEnabled:e})},numberValue:N.blurRadius,onNumberValueChange:e=>{W({blurRadius:e})},min:0,max:100}),n(x,{label:b("toolbar.brightness"),visible:G,enabled:N.brightnessEnabled,onEnabledChange:e=>{W({brightnessEnabled:e})},numberValue:Math.round(100*N.brightness),onNumberValueChange:e=>{W({brightness:e/100})},min:-100,max:100}),n(x,{label:b("toolbar.temperature"),visible:G,enabled:N.filters.has("temperature"),onEnabledChange:e=>{X("temperature",e?0:null)},numberValue:Math.round(100*(null!==(u=null===(t=N.filters.get("temperature"))||void 0===t?void 0:t.intensity)&&void 0!==u?u:0)),onNumberValueChange:e=>{X("temperature",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.contrast"),visible:G,enabled:N.filters.has("contrast"),onEnabledChange:e=>{X("contrast",e?0:null)},numberValue:Math.round(100*(null!==(C=null===(y=N.filters.get("contrast"))||void 0===y?void 0:y.intensity)&&void 0!==C?C:0)),onNumberValueChange:e=>{X("contrast",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.shadows"),visible:G,enabled:N.filters.has("shadows"),onEnabledChange:e=>{X("shadows",e?0:null)},numberValue:Math.round(100*(null!==(k=null===(w=N.filters.get("shadows"))||void 0===w?void 0:w.intensity)&&void 0!==k?k:0)),onNumberValueChange:e=>{X("shadows",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.white"),visible:G,enabled:N.filters.has("white"),onEnabledChange:e=>{X("white",e?0:null)},numberValue:Math.round(100*(null!==(V=null===(E=N.filters.get("white"))||void 0===E?void 0:E.intensity)&&void 0!==V?V:0)),onNumberValueChange:e=>{X("white",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.black"),visible:G,enabled:N.filters.has("black"),onEnabledChange:e=>{X("black",e?0:null)},numberValue:Math.round(100*(null!==(I=null===(j=N.filters.get("black"))||void 0===j?void 0:j.intensity)&&void 0!==I?I:0)),onNumberValueChange:e=>{X("black",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.vibrance"),visible:G,enabled:N.filters.has("vibrance"),onEnabledChange:e=>{X("vibrance",e?0:null)},numberValue:Math.round(100*(null!==(O=null===(T=N.filters.get("vibrance"))||void 0===T?void 0:T.intensity)&&void 0!==O?O:0)),onNumberValueChange:e=>{X("vibrance",e/100)},min:-100,max:100}),n(x,{label:b("toolbar.saturation"),visible:G,enabled:N.filters.has("saturation"),onEnabledChange:e=>{X("saturation",e?0:null)},numberValue:Math.round(100*(null!==(M=null===(R=N.filters.get("saturation"))||void 0===R?void 0:R.intensity)&&void 0!==M?M:0)),onNumberValueChange:e=>{X("saturation",e/100)},min:-100,max:100}),z&&n(s,{checked:!!N.curveEnabled,label:b("toolbar.curvedText")||"Curved text",onChange:e=>{W({curveEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&N.curveEnabled&&a(l.Fragment,{children:[a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.curvePower")||"Curve"}),n("div",{children:n(NumberInput,{value:Math.round(100*N.curvePower),onValueChange:e=>{W({curvePower:v(e,-100,100)/100})},style:{width:"50px"},min:-100,max:100,buttonPosition:"none"})})]}),n("div",{children:n(f,{textEl:N,eachSet:W})})]}),z&&n(s,{checked:!!N.strokeWidth,label:b("toolbar.textStroke"),onChange:e=>{W({strokeWidth:e.target.checked?2:0})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&!!N.strokeWidth&&n(l.Fragment,{children:a("div",{style:{display:"flex",justifyContent:"space-between"},children:[n(h,{value:N.stroke,size:30,gradientEnabled:!0,onChange:e=>{W({stroke:e})},store:e}),n(o,{defaultValue:N.strokeWidth,onValueChange:e=>{W({strokeWidth:v(e,1,30)})},style:{width:"80px"},min:1,max:Math.round(N.fontSize/2)})]})}),z&&n(s,{checked:!!N.backgroundEnabled,label:b("toolbar.textBackground"),onChange:e=>{W({backgroundEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&!!N.backgroundEnabled&&a(l.Fragment,{children:[a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.backgroundCornerRadius")}),n("div",{children:n(NumberInput,{value:100*N.backgroundCornerRadius,onValueChange:e=>{W({backgroundCornerRadius:v(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:100*N.backgroundCornerRadius,onChange:e=>{W({backgroundCornerRadius:v(e,0,100)/100})},min:0,max:100,labelRenderer:!1})}),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.backgroundPadding")}),n("div",{children:n(NumberInput,{value:Math.round(100*N.backgroundPadding),onValueChange:e=>{W({backgroundPadding:v(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:Math.round(100*N.backgroundPadding),onChange:e=>{W({backgroundPadding:v(e,0,100)/100})},min:0,max:100,labelRenderer:!1})}),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.opacity")}),n("div",{children:n(NumberInput,{value:Math.round(100*N.backgroundOpacity),onValueChange:e=>{W({backgroundOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:100*N.backgroundOpacity,onChange:e=>{W({backgroundOpacity:e/100})},min:0,max:100,labelRenderer:!1})}),a("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{style:{lineHeight:"30px"},children:b("toolbar.color")}),n(h,{value:N.backgroundColor,size:30,onChange:e=>{W({backgroundColor:e})},store:e})]})]}),G&&n(s,{checked:!!N.borderSize,label:b("toolbar.border"),onChange:e=>{W({borderSize:e.target.checked?2:0})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),G&&!!N.borderSize&&n(l.Fragment,{children:a("div",{style:{display:"flex",justifyContent:"space-between"},children:[n(h,{value:N.borderColor,size:30,gradientEnabled:!0,onChange:e=>{W({borderColor:e})},store:e}),n(o,{defaultValue:N.borderSize,onValueChange:e=>{W({borderSize:v(e,1,Math.min(N.width,N.height)/2)})},style:{width:"80px"},min:1,max:Math.max(1,Math.min(N.width,N.height)/2)})]})}),G&&n(x,{label:b("toolbar.cornerRadius"),visible:G,enabled:0!==N.cornerRadius,onEnabledChange:e=>{W({cornerRadius:e?Math.min(N.width/4,N.height/4):0})},numberValue:Math.min(N.cornerRadius,Math.round(Math.min(N.width/2,N.height/2))),onNumberValueChange:e=>{W({cornerRadius:e})},min:1,max:Math.round(Math.min(N.width/2,N.height/2))}),n(s,{checked:N.shadowEnabled,label:b("toolbar.shadow"),onChange:e=>{W({shadowEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),N.shadowEnabled&&a(l.Fragment,{children:[a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.blur")}),n("div",{children:n(NumberInput,{value:N.shadowBlur,onValueChange:e=>{W({shadowBlur:v(e,-50,50)})},style:{width:"50px"},min:0,max:50,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:N.shadowBlur,onChange:e=>{W({shadowBlur:e})},min:0,max:50,showTrackFill:!1,labelRenderer:!1})}),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.offsetX")}),n("div",{children:n(NumberInput,{value:N.shadowOffsetX,onValueChange:e=>{W({shadowOffsetX:v(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:N.shadowOffsetX,onChange:e=>{W({shadowOffsetX:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})}),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.offsetY")}),n("div",{children:n(NumberInput,{value:N.shadowOffsetY,onValueChange:e=>{W({shadowOffsetY:v(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:N.shadowOffsetY,onChange:e=>{W({shadowOffsetY:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})}),a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{children:b("toolbar.opacity")}),n("div",{children:n(NumberInput,{value:Math.round(100*N.shadowOpacity),onValueChange:e=>{W({shadowOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),n("div",{children:n(d,{value:100*N.shadowOpacity,onChange:e=>{W({shadowOpacity:e/100})},min:0,max:100,labelRenderer:!1})}),a("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[n("div",{style:{lineHeight:"30px"},children:b("toolbar.color")}),n(h,{value:N.shadowColor,size:30,onChange:e=>{W({shadowColor:e})},store:e})]})]})]})});
1
+ var e=this&&this.__rest||function(e,n){var a={};for(var t in e){Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t])}if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++){n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(a[t[l]]=e[t[l]])}}return a};import{Fragment as n,jsx as a,jsxs as t}from"react/jsx-runtime";import l from"react";import{Alignment as i,Button as r,NumericInput as o,Slider as d,Switch as s}from"@blueprintjs/core";import{observer as u}from"mobx-react-lite";import{INDEPENDENT_FILTERS as c}from"../../model/shape-model.js";import h from"../toolbar/color-picker.js";import{t as b}from"../../utils/l10n.js";import{Cross as p}from"@blueprintjs/icons";import{EffectCard as m}from"./effect-card.js";import{Effects as g}from"../../utils/filters.js";import{CurvePowerSlider as f}from"../toolbar/filters-picker.js";const v=(e,n,a)=>Math.max(n,Math.min(a,e));export const NumberInput=n=>{var{value:t,onValueChange:i}=n,r=e(n,["value","onValueChange"]);const[d,s]=l.useState(t.toString());return l.useEffect(()=>{s(t.toString())},[t]),a(o,Object.assign({value:d,onValueChange:(e,n)=>{s(n),Number.isNaN(e)||i(e)}},r))};const x=({label:e,enabled:l,visible:r=!0,onEnabledChange:u,numberValue:c,onNumberValueChange:h,min:b,max:p})=>r?t(n,{children:[a(s,{checked:l,label:e,onChange:e=>{u(e.target.checked)},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),l&&t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[a("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:a(d,{value:c,onChange:e=>{h(e)},min:b,max:p,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})}),a(o,{value:c,onValueChange:e=>{h(v(e,b,p))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:b,max:p})]})]}):null;export const EffectsPanel=u(({store:e})=>{var n,u,y,C,w,k,E,V,j,I,T,O,R,M;const P=e.selectedElements,N=P[0],S=P.map(e=>e.id).join(","),B="effects"===e.openedSidePanel;if(l.useEffect(()=>{B&&(N&&N.filters||e.restoreSidePanel())},[B,S]),!N||!N.filters){return null}const z=(e=>"text"===e.type)(N),F=((e=>{e.type})(N),(e=>"image"===e.type)(N)),H=(e=>"svg"===e.type)(N),G=F||H,W=n=>{e.history.transaction(()=>{P.forEach(e=>{e.set(n)})})},X=(n,a)=>{e.history.transaction(()=>{P.forEach(e=>{let t=Number(a);return 0==a||a||(t=e.filters.has(n)?null:1),c.includes(n)||e.set({grayscaleEnabled:"grayscale"===n&&!!a,sepiaEnabled:"sepia"===n&&!!a}),e.setFilter(n,t)})})};return t("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"},children:[t("div",{style:{display:"flex",justifyContent:"space-between"},children:[a("h3",{style:{margin:0,lineHeight:"30px"},children:b("sidePanel.effects")}),a(r,{minimal:!0,icon:a(p,{}),onClick:()=>e.restoreSidePanel()})]}),G&&a("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginTop:"16px"},children:t("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[a(m,{active:N.grayscaleEnabled,onClick:()=>{X("grayscale",!N.grayscaleEnabled)},title:b("toolbar.grayscale"),imageSrc:N.src,effect:g.grayscale}),a(m,{active:N.sepiaEnabled,onClick:()=>{X("sepia",!N.sepiaEnabled)},title:b("toolbar.sepia"),imageSrc:N.src,effect:g.sepia}),a(m,{active:N.filters.has("cold"),onClick:()=>{X("cold",N.filters.has("cold")?null:1)},title:b("toolbar.cold"),imageSrc:N.src,effect:g.cold}),a(m,{active:N.filters.has("natural"),onClick:()=>{X("natural",N.filters.has("natural")?null:1)},title:b("toolbar.natural"),imageSrc:N.src,effect:g.natural}),a(m,{active:N.filters.has("warm"),onClick:()=>{X("warm",N.filters.has("warm")?null:1)},title:b("toolbar.warm"),imageSrc:N.src,effect:g.warm})]})}),a(x,{label:b("toolbar.blur"),enabled:N.blurEnabled,visible:G||z,onEnabledChange:e=>{W({blurEnabled:e})},numberValue:N.blurRadius,onNumberValueChange:e=>{W({blurRadius:e})},min:0,max:100}),a(x,{label:b("toolbar.brightness"),visible:G,enabled:N.brightnessEnabled,onEnabledChange:e=>{W({brightnessEnabled:e})},numberValue:Math.round(100*N.brightness),onNumberValueChange:e=>{W({brightness:e/100})},min:-100,max:100}),a(x,{label:b("toolbar.temperature"),visible:G,enabled:N.filters.has("temperature"),onEnabledChange:e=>{X("temperature",e?0:null)},numberValue:Math.round(100*(null!==(V=null===(n=N.filters.get("temperature"))||void 0===n?void 0:n.intensity)&&void 0!==V?V:0)),onNumberValueChange:e=>{X("temperature",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.contrast"),visible:G,enabled:N.filters.has("contrast"),onEnabledChange:e=>{X("contrast",e?0:null)},numberValue:Math.round(100*(null!==(j=null===(u=N.filters.get("contrast"))||void 0===u?void 0:u.intensity)&&void 0!==j?j:0)),onNumberValueChange:e=>{X("contrast",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.shadows"),visible:G,enabled:N.filters.has("shadows"),onEnabledChange:e=>{X("shadows",e?0:null)},numberValue:Math.round(100*(null!==(I=null===(y=N.filters.get("shadows"))||void 0===y?void 0:y.intensity)&&void 0!==I?I:0)),onNumberValueChange:e=>{X("shadows",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.white"),visible:G,enabled:N.filters.has("white"),onEnabledChange:e=>{X("white",e?0:null)},numberValue:Math.round(100*(null!==(T=null===(C=N.filters.get("white"))||void 0===C?void 0:C.intensity)&&void 0!==T?T:0)),onNumberValueChange:e=>{X("white",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.black"),visible:G,enabled:N.filters.has("black"),onEnabledChange:e=>{X("black",e?0:null)},numberValue:Math.round(100*(null!==(O=null===(w=N.filters.get("black"))||void 0===w?void 0:w.intensity)&&void 0!==O?O:0)),onNumberValueChange:e=>{X("black",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.vibrance"),visible:G,enabled:N.filters.has("vibrance"),onEnabledChange:e=>{X("vibrance",e?0:null)},numberValue:Math.round(100*(null!==(R=null===(k=N.filters.get("vibrance"))||void 0===k?void 0:k.intensity)&&void 0!==R?R:0)),onNumberValueChange:e=>{X("vibrance",e/100)},min:-100,max:100}),a(x,{label:b("toolbar.saturation"),visible:G,enabled:N.filters.has("saturation"),onEnabledChange:e=>{X("saturation",e?0:null)},numberValue:Math.round(100*(null!==(M=null===(E=N.filters.get("saturation"))||void 0===E?void 0:E.intensity)&&void 0!==M?M:0)),onNumberValueChange:e=>{X("saturation",e/100)},min:-100,max:100}),z&&a(s,{checked:!!N.curveEnabled,label:b("toolbar.curvedText")||"Curved text",onChange:e=>{W({curveEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&N.curveEnabled&&t(l.Fragment,{children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.curvePower")||"Curve"}),a("div",{children:a(NumberInput,{value:Math.round(100*N.curvePower),onValueChange:e=>{W({curvePower:v(e,-100,100)/100})},style:{width:"50px"},min:-100,max:100,buttonPosition:"none"})})]}),a("div",{children:a(f,{textEl:N,eachSet:W})})]}),z&&a(s,{checked:!!N.strokeWidth,label:b("toolbar.textStroke"),onChange:e=>{W({strokeWidth:e.target.checked?2:0})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&!!N.strokeWidth&&a(l.Fragment,{children:t("div",{style:{display:"flex",justifyContent:"space-between"},children:[a(h,{value:N.stroke,size:30,gradientEnabled:!0,onChange:e=>{W({stroke:e})},store:e}),a(o,{defaultValue:N.strokeWidth,onValueChange:e=>{W({strokeWidth:v(e,1,30)})},style:{width:"80px"},min:1,max:Math.round(N.fontSize/2)})]})}),z&&a(s,{checked:!!N.backgroundEnabled,label:b("toolbar.textBackground"),onChange:e=>{W({backgroundEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),z&&!!N.backgroundEnabled&&t(l.Fragment,{children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.backgroundCornerRadius")}),a("div",{children:a(NumberInput,{value:100*N.backgroundCornerRadius,onValueChange:e=>{W({backgroundCornerRadius:v(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:100*N.backgroundCornerRadius,onChange:e=>{W({backgroundCornerRadius:v(e,0,100)/100})},min:0,max:100,labelRenderer:!1})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.backgroundPadding")}),a("div",{children:a(NumberInput,{value:Math.round(100*N.backgroundPadding),onValueChange:e=>{W({backgroundPadding:v(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:Math.round(100*N.backgroundPadding),onChange:e=>{W({backgroundPadding:v(e,0,100)/100})},min:0,max:100,labelRenderer:!1})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.opacity")}),a("div",{children:a(NumberInput,{value:Math.round(100*N.backgroundOpacity),onValueChange:e=>{W({backgroundOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:100*N.backgroundOpacity,onChange:e=>{W({backgroundOpacity:e/100})},min:0,max:100,labelRenderer:!1})}),t("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{style:{lineHeight:"30px"},children:b("toolbar.color")}),a(h,{value:N.backgroundColor,size:30,onChange:e=>{W({backgroundColor:e})},store:e})]})]}),G&&a(s,{checked:!!N.borderSize,label:b("toolbar.border"),onChange:e=>{W({borderSize:e.target.checked?2:0})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),G&&!!N.borderSize&&a(l.Fragment,{children:t("div",{style:{display:"flex",justifyContent:"space-between"},children:[a(h,{value:N.borderColor,size:30,gradientEnabled:!0,onChange:e=>{W({borderColor:e})},store:e}),a(o,{defaultValue:N.borderSize,onValueChange:e=>{W({borderSize:v(e,1,Math.min(N.width,N.height)/2)})},style:{width:"80px"},min:1,max:Math.max(1,Math.min(N.width,N.height)/2)})]})}),G&&a(x,{label:b("toolbar.cornerRadius"),visible:G,enabled:0!==N.cornerRadius,onEnabledChange:e=>{W({cornerRadius:e?Math.min(N.width/4,N.height/4):0})},numberValue:Math.min(N.cornerRadius,Math.round(Math.min(N.width/2,N.height/2))),onNumberValueChange:e=>{W({cornerRadius:e})},min:1,max:Math.round(Math.min(N.width/2,N.height/2))}),a(s,{checked:N.shadowEnabled,label:b("toolbar.shadow"),onChange:e=>{W({shadowEnabled:e.target.checked})},alignIndicator:i.RIGHT,style:{marginTop:"20px"}}),N.shadowEnabled&&t(l.Fragment,{children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.blur")}),a("div",{children:a(NumberInput,{value:N.shadowBlur,onValueChange:e=>{W({shadowBlur:v(e,-50,50)})},style:{width:"50px"},min:0,max:50,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:N.shadowBlur,onChange:e=>{W({shadowBlur:e})},min:0,max:50,showTrackFill:!1,labelRenderer:!1})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.offsetX")}),a("div",{children:a(NumberInput,{value:N.shadowOffsetX,onValueChange:e=>{W({shadowOffsetX:v(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:N.shadowOffsetX,onChange:e=>{W({shadowOffsetX:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.offsetY")}),a("div",{children:a(NumberInput,{value:N.shadowOffsetY,onValueChange:e=>{W({shadowOffsetY:v(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:N.shadowOffsetY,onChange:e=>{W({shadowOffsetY:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{children:b("toolbar.opacity")}),a("div",{children:a(NumberInput,{value:Math.round(100*N.shadowOpacity),onValueChange:e=>{W({shadowOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"})})]}),a("div",{children:a(d,{value:100*N.shadowOpacity,onChange:e=>{W({shadowOpacity:e/100})},min:0,max:100,labelRenderer:!1})}),t("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[a("div",{style:{lineHeight:"30px"},children:b("toolbar.color")}),a(h,{value:N.shadowColor,size:30,onChange:e=>{W({shadowColor:e})},store:e})]})]})]})});
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { StoreType } from '../../model/store.js';
3
3
  export declare const NounprojectPanel: ({ store, query }: {
4
- store: any;
5
4
  query: any;
5
+ store: any;
6
6
  }) => React.JSX.Element;
7
7
  export declare const setDefaultColor: (color: string) => void;
8
8
  export declare const Shapes: ({ store }: {
@@ -15,7 +15,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
15
15
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
16
16
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
17
17
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
18
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
18
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
19
19
  custom: import("mobx-state-tree").IType<any, any, any>;
20
20
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
21
21
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -33,7 +33,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
33
33
  delay: import("mobx-state-tree").IType<number | undefined, number, number>;
34
34
  duration: import("mobx-state-tree").IType<number | undefined, number, number>;
35
35
  enabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
36
- type: import("mobx-state-tree").ISimpleType<"exit" | "enter" | "loop">;
36
+ type: import("mobx-state-tree").ISimpleType<"enter" | "exit" | "loop">;
37
37
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
38
38
  data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
39
39
  easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -93,7 +93,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
93
93
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
94
94
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
95
95
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
96
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
96
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
97
97
  custom: import("mobx-state-tree").IType<any, any, any>;
98
98
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
99
99
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -105,7 +105,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
105
105
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
106
106
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
107
107
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
108
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
108
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
109
109
  custom: import("mobx-state-tree").IType<any, any, any>;
110
110
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
111
111
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -117,7 +117,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
117
117
  type: string | undefined;
118
118
  name: string | undefined;
119
119
  opacity: number | undefined;
120
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
120
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
121
121
  custom: any;
122
122
  visible: boolean | undefined;
123
123
  selectable: boolean | undefined;
@@ -136,7 +136,6 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
136
136
  alwaysOnTop: boolean;
137
137
  showInExport: boolean;
138
138
  } | {
139
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
140
139
  id: string;
141
140
  type: string;
142
141
  name: string;
@@ -147,6 +146,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
147
146
  removable: boolean;
148
147
  alwaysOnTop: boolean;
149
148
  showInExport: boolean;
149
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
150
150
  }>>;
151
151
  readonly parent: any;
152
152
  readonly isHighlighted: boolean;
@@ -164,7 +164,6 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
164
164
  alwaysOnTop: boolean;
165
165
  showInExport: boolean;
166
166
  } | {
167
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
168
167
  id: string;
169
168
  type: string;
170
169
  name: string;
@@ -175,6 +174,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
175
174
  removable: boolean;
176
175
  alwaysOnTop: boolean;
177
176
  showInExport: boolean;
177
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
178
178
  };
179
179
  } & {
180
180
  clone(attrs?: any, { skipSelect }?: {
@@ -199,7 +199,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
199
199
  readonly isSelected: boolean;
200
200
  readonly isSelectedDirectly: boolean;
201
201
  } & {
202
- setAnimation(type: "enter" | "exit" | "loop", attrs: import("../../utils/animations.js").AnimationAttrs): void;
202
+ setAnimation(type: 'enter' | 'exit' | 'loop', attrs: import("../../utils/animations.js").AnimationAttrs): void;
203
203
  setFilter(type: any, value: any): void;
204
204
  } & {
205
205
  _setSourceSize(size: import("../../image-tools/types.js").Size, src: string): void;
@@ -223,7 +223,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
223
223
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
224
224
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
225
225
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
226
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
226
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
227
227
  custom: import("mobx-state-tree").IType<any, any, any>;
228
228
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
229
229
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -241,7 +241,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
241
241
  delay: import("mobx-state-tree").IType<number | undefined, number, number>;
242
242
  duration: import("mobx-state-tree").IType<number | undefined, number, number>;
243
243
  enabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
244
- type: import("mobx-state-tree").ISimpleType<"exit" | "enter" | "loop">;
244
+ type: import("mobx-state-tree").ISimpleType<"enter" | "exit" | "loop">;
245
245
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
246
246
  data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
247
247
  easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -301,7 +301,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
301
301
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
302
302
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
303
303
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
304
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
304
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
305
305
  custom: import("mobx-state-tree").IType<any, any, any>;
306
306
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
307
307
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -313,7 +313,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
313
313
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
314
314
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
315
315
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
316
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light">, [undefined]>;
316
+ blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
317
317
  custom: import("mobx-state-tree").IType<any, any, any>;
318
318
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
319
319
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -325,7 +325,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
325
325
  type: string | undefined;
326
326
  name: string | undefined;
327
327
  opacity: number | undefined;
328
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
328
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
329
329
  custom: any;
330
330
  visible: boolean | undefined;
331
331
  selectable: boolean | undefined;
@@ -344,7 +344,6 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
344
344
  alwaysOnTop: boolean;
345
345
  showInExport: boolean;
346
346
  } | {
347
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
348
347
  id: string;
349
348
  type: string;
350
349
  name: string;
@@ -355,6 +354,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
355
354
  removable: boolean;
356
355
  alwaysOnTop: boolean;
357
356
  showInExport: boolean;
357
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
358
358
  }>>;
359
359
  readonly parent: any;
360
360
  readonly isHighlighted: boolean;
@@ -372,7 +372,6 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
372
372
  alwaysOnTop: boolean;
373
373
  showInExport: boolean;
374
374
  } | {
375
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
376
375
  id: string;
377
376
  type: string;
378
377
  name: string;
@@ -383,6 +382,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
383
382
  removable: boolean;
384
383
  alwaysOnTop: boolean;
385
384
  showInExport: boolean;
385
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
386
386
  };
387
387
  } & {
388
388
  clone(attrs?: any, { skipSelect }?: {
@@ -407,7 +407,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
407
407
  readonly isSelected: boolean;
408
408
  readonly isSelectedDirectly: boolean;
409
409
  } & {
410
- setAnimation(type: "enter" | "exit" | "loop", attrs: import("../../utils/animations.js").AnimationAttrs): void;
410
+ setAnimation(type: 'enter' | 'exit' | 'loop', attrs: import("../../utils/animations.js").AnimationAttrs): void;
411
411
  setFilter(type: any, value: any): void;
412
412
  } & {
413
413
  _setSourceSize(size: import("../../image-tools/types.js").Size, src: string): void;
@@ -431,7 +431,7 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
431
431
  type: string | undefined;
432
432
  name: string | undefined;
433
433
  opacity: number | undefined;
434
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
434
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
435
435
  custom: any;
436
436
  visible: boolean | undefined;
437
437
  selectable: boolean | undefined;
@@ -450,7 +450,6 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
450
450
  alwaysOnTop: boolean;
451
451
  showInExport: boolean;
452
452
  } | {
453
- blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
454
453
  id: string;
455
454
  type: string;
456
455
  name: string;
@@ -461,7 +460,8 @@ export declare const selectVideo: ({ src, droppedPos, targetElement, store, attr
461
460
  removable: boolean;
462
461
  alwaysOnTop: boolean;
463
462
  showInExport: boolean;
463
+ blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
464
464
  }>> & {
465
- type: "video";
465
+ type: 'video';
466
466
  }) | undefined>;
467
467
  export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  export declare const VideosGrid: ({ items, onSelect, loadMore, isLoading, error, getCredit, }: {
3
- items: any;
4
- onSelect: any;
5
- loadMore: any;
6
- isLoading: any;
7
3
  error: any;
8
4
  getCredit: any;
5
+ isLoading: any;
6
+ items: any;
7
+ loadMore: any;
8
+ onSelect: any;
9
9
  }) => React.JSX.Element | null;
@@ -3,8 +3,8 @@ import { StoreType } from '../../model/store.js';
3
3
  import { ShapeType } from '../../model/shape-model.js';
4
4
  export declare const NumberInput: ({ value, onValueChange, ...props }: {
5
5
  [x: string]: any;
6
- value: any;
7
6
  onValueChange: any;
7
+ value: any;
8
8
  }) => React.JSX.Element;
9
9
  export declare const AnimationsPickerOld: (({ element, store, elements, }: {
10
10
  elements?: Array<ShapeType>;
@@ -5,6 +5,6 @@ export declare const extendToolbar: ({ type, usedItems, components, }: {
5
5
  components: any;
6
6
  }) => string[];
7
7
  export declare const ElementContainer: ({ items, itemRender }: {
8
- items: any;
9
8
  itemRender: any;
9
+ items: any;
10
10
  }) => React.JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{observer as r}from"mobx-react-lite";import{Button as o,Popover as n,Position as s,Slider as l,Tooltip as a}from"@blueprintjs/core";import{Disable as h}from"@blueprintjs/icons";import{ZoStrokeWidth as d}from"../../icons/meronex.js";import c from"./color-picker.js";import{AnimationsPicker as g}from"./animations-picker.js";import{NumberInput as m,EffectsPicker as p}from"./filters-picker.js";import{ElementContainer as u,extendToolbar as k}from"./element-container.js";import{t as x}from"../../utils/l10n.js";import{flags as w}from"../../utils/flags.js";export const FigureFill=r(({elements:t,store:i})=>e(c,{value:t[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:e=>i.history.transaction(()=>{t.forEach(t=>{t.set({fill:e})})}),store:i}));export const FigureSettings=r(({store:r,elements:c,element:g})=>{const p=e=>{r.history.transaction(()=>{c.forEach(t=>{t.set(e)})})};return e(n,{position:s.BOTTOM,content:t("div",{style:{padding:"15px",paddingTop:"15px",width:"270px"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"},children:[e(o,{onClick:()=>{p({strokeWidth:0})},active:0===c[0].strokeWidth,style:{width:"44px",height:"34px"},icon:e(h,{size:20})}),e(o,{onClick:()=>{p({dash:[],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&0===c[0].dash.length,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),e(o,{onClick:()=>{p({dash:[4,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&4===c[0].dash[0],children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),e(o,{onClick:()=>{p({dash:[2,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&2===c[0].dash[0],children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),e(o,{onClick:()=>{p({dash:[1,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&1===c[0].dash[0],children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[e("div",{className:"bp6-control bp6-align-right",children:x("toolbar.strokeWidth")}),e("div",{children:e(m,{value:c[0].strokeWidth,onValueChange:e=>{p({strokeWidth:e})},style:{width:"50px"},min:0,max:Math.round(Math.min(c[0].width,c[0].height)/2),buttonPosition:"none"})})]}),e(l,{value:c[0].strokeWidth,onChange:e=>{p({strokeWidth:e})},min:0,max:Math.round(Math.min(c[0].width,c[0].height)/2),labelRenderer:!1}),"rect"===c[0].subType&&t(i,{children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"15px",paddingBottom:"5px"},children:[e("div",{className:"bp6-control bp6-align-right",children:x("toolbar.cornerRadius")}),e("div",{children:e(m,{value:c[0].cornerRadius,onValueChange:e=>{p({cornerRadius:e})},style:{width:"50px"},min:0,max:Math.round(Math.max(c[0].width,c[0].height)/2),buttonPosition:"none"})})]}),e(l,{value:c[0].cornerRadius,onChange:e=>{p({cornerRadius:e})},min:0,max:Math.round(Math.max(c[0].width,c[0].height)/2),labelRenderer:!1})]})]}),children:e(a,{content:x("toolbar.strokeSettings"),position:s.BOTTOM,children:e(o,{icon:e(d,{}),minimal:!0,"aria-label":x("toolbar.strokeSettings")})})})});export const FigureStroke=r(({elements:t,store:i})=>t.find(e=>e.strokeWidth)?e(c,{value:t[0].stroke,style:{marginRight:"5px"},gradientEnabled:!0,onChange:e=>i.history.transaction(()=>{t.forEach(t=>{t.set({stroke:e})})}),store:i}):null);const v={FigureFill,FigureStroke,FigureSettings,FigureAnimations:g,FigureFilters:p};export const FigureToolbar=r(({store:t,components:i})=>{const r=t.selectedElements[0],o=["FigureFill","FigureStroke","FigureSettings","FigureFilters",w.animationsEnabled&&"FigureAnimations"].filter(e=>Boolean(e)),n=k({type:"figure",usedItems:o,components:i});return e(u,{items:n,itemRender:o=>{const n=i[o]||v[o];return e(n,{element:r,store:t,elements:t.selectedElements},o)}})});export default FigureToolbar;
1
+ import{Fragment as e,jsx as t,jsxs as i}from"react/jsx-runtime";import{observer as r}from"mobx-react-lite";import{Button as o,Popover as n,Position as s,Slider as l,Tooltip as a}from"@blueprintjs/core";import{Disable as h}from"@blueprintjs/icons";import{ZoStrokeWidth as d}from"../../icons/meronex.js";import c from"./color-picker.js";import{AnimationsPicker as g}from"./animations-picker.js";import{NumberInput as m,EffectsPicker as p}from"./filters-picker.js";import{ElementContainer as u,extendToolbar as k}from"./element-container.js";import{t as x}from"../../utils/l10n.js";import{flags as w}from"../../utils/flags.js";export const FigureFill=r(({elements:e,store:i})=>t(c,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:t=>i.history.transaction(()=>{e.forEach(e=>{e.set({fill:t})})}),store:i}));export const FigureSettings=r(({store:r,elements:c,element:g})=>{const p=e=>{r.history.transaction(()=>{c.forEach(t=>{t.set(e)})})};return t(n,{position:s.BOTTOM,content:i("div",{style:{padding:"15px",paddingTop:"15px",width:"270px"},children:[i("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"},children:[t(o,{onClick:()=>{p({strokeWidth:0})},active:0===c[0].strokeWidth,style:{width:"44px",height:"34px"},icon:t(h,{size:20})}),t(o,{onClick:()=>{p({dash:[],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&0===c[0].dash.length,children:t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),t(o,{onClick:()=>{p({dash:[4,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&4===c[0].dash[0],children:t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),t(o,{onClick:()=>{p({dash:[2,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&2===c[0].dash[0],children:t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),t(o,{onClick:()=>{p({dash:[1,1],strokeWidth:c[0].strokeWidth||10})},active:!!c[0].strokeWidth&&1===c[0].dash[0],children:t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:t("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),i("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[t("div",{className:"bp6-control bp6-align-right",children:x("toolbar.strokeWidth")}),t("div",{children:t(m,{value:c[0].strokeWidth,onValueChange:e=>{p({strokeWidth:e})},style:{width:"50px"},min:0,max:Math.round(Math.min(c[0].width,c[0].height)/2),buttonPosition:"none"})})]}),t(l,{value:c[0].strokeWidth,onChange:e=>{p({strokeWidth:e})},min:0,max:Math.round(Math.min(c[0].width,c[0].height)/2),labelRenderer:!1}),"rect"===c[0].subType&&i(e,{children:[i("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"15px",paddingBottom:"5px"},children:[t("div",{className:"bp6-control bp6-align-right",children:x("toolbar.cornerRadius")}),t("div",{children:t(m,{value:c[0].cornerRadius,onValueChange:e=>{p({cornerRadius:e})},style:{width:"50px"},min:0,max:Math.round(Math.max(c[0].width,c[0].height)/2),buttonPosition:"none"})})]}),t(l,{value:c[0].cornerRadius,onChange:e=>{p({cornerRadius:e})},min:0,max:Math.round(Math.max(c[0].width,c[0].height)/2),labelRenderer:!1})]})]}),children:t(a,{content:x("toolbar.strokeSettings"),position:s.BOTTOM,children:t(o,{icon:t(d,{}),minimal:!0,"aria-label":x("toolbar.strokeSettings")})})})});export const FigureStroke=r(({elements:e,store:i})=>e.find(e=>e.strokeWidth)?t(c,{value:e[0].stroke,style:{marginRight:"5px"},gradientEnabled:!0,onChange:t=>i.history.transaction(()=>{e.forEach(e=>{e.set({stroke:t})})}),store:i}):null);const v={FigureFill,FigureStroke,FigureSettings,FigureAnimations:g,FigureFilters:p};export const FigureToolbar=r(({store:e,components:i})=>{const r=e.selectedElements[0],o=["FigureFill","FigureStroke","FigureSettings","FigureFilters",w.animationsEnabled&&"FigureAnimations"].filter(e=>Boolean(e)),n=k({type:"figure",usedItems:o,components:i});return t(u,{items:n,itemRender:o=>{const n=i[o]||v[o];return t(n,{element:r,store:e,elements:e.selectedElements},o)}})});export default FigureToolbar;
@@ -3,8 +3,8 @@ import { StoreType } from '../../model/store.js';
3
3
  import { ShapeType } from '../../model/shape-model.js';
4
4
  export declare const NumberInput: ({ value, onValueChange, ...props }: {
5
5
  [x: string]: any;
6
- value: any;
7
6
  onValueChange: any;
7
+ value: any;
8
8
  }) => React.JSX.Element;
9
9
  export declare const CurvePowerSlider: (({ textEl, eachSet }: {
10
10
  textEl: any;