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.
- package/LICENSE.md +8 -2
- package/THIRD_PARTY_NOTICES.md +2871 -0
- package/blueprint/canvas/context-menu/context-menu.js +1 -1
- package/blueprint/canvas/page-controls.d.ts +3 -3
- package/blueprint/pages-timeline/pages-timeline.js +2 -2
- package/blueprint/pages-timeline/play-button.js +2 -2
- package/blueprint/side-panel/animations-panel.d.ts +1 -1
- package/blueprint/side-panel/draw-panel.js +2 -2
- package/blueprint/side-panel/effect-card.js +3 -3
- package/blueprint/side-panel/effects-panel.d.ts +1 -1
- package/blueprint/side-panel/effects-panel.js +1 -1
- package/blueprint/side-panel/elements-panel.d.ts +1 -1
- package/blueprint/side-panel/select-video.d.ts +19 -19
- package/blueprint/side-panel/videos-grid.d.ts +4 -4
- package/blueprint/toolbar/animations-picker.d.ts +1 -1
- package/blueprint/toolbar/element-container.d.ts +1 -1
- package/blueprint/toolbar/figure-toolbar.js +1 -1
- package/blueprint/toolbar/filters-picker.d.ts +1 -1
- package/blueprint/toolbar/filters-picker.js +1 -1
- package/blueprint/toolbar/group-button.js +1 -1
- package/blueprint/toolbar/image-remove-background-button.js +1 -1
- package/blueprint/toolbar/image-toolbar.js +1 -1
- package/blueprint/toolbar/line-toolbar.js +1 -1
- package/blueprint/toolbar/page-toolbar.d.ts +1 -1
- package/blueprint/toolbar/position-picker.js +1 -1
- package/blueprint/toolbar/sketch.d.ts +5 -5
- package/blueprint/toolbar/svg-toolbar.js +1 -1
- package/blueprint/toolbar/table-toolbar.js +1 -1
- package/blueprint/toolbar/text-ai-write.js +1 -1
- package/blueprint/toolbar/text-toolbar.d.ts +1 -1
- package/blueprint.polotno.css +164 -153
- package/canvas/apply-filters.d.ts +2 -6
- package/canvas/apply-filters.js +1 -1
- package/canvas/context-menu/context-menu.js +1 -1
- package/canvas/crop-overlay.d.ts +1 -1
- package/canvas/crop-overlay.js +1 -1
- package/canvas/downscale.d.ts +1 -24
- package/canvas/downscale.js +1 -1
- package/canvas/element.d.ts +3 -1
- package/canvas/element.js +1 -1
- package/canvas/fade-overlay.js +1 -1
- package/canvas/figure-element.js +1 -1
- package/canvas/gif-element.d.ts +32 -0
- package/canvas/gif-element.js +1 -1
- package/canvas/hotkeys.d.ts +1 -1
- package/canvas/hotkeys.js +1 -1
- package/canvas/html-element.js +1 -1
- package/canvas/image-element.d.ts +4 -48
- package/canvas/image-element.js +1 -1
- package/canvas/image-tool-controls.js +1 -1
- package/canvas/line-element.js +1 -1
- package/canvas/lottie-element.d.ts +11 -0
- package/canvas/lottie-element.js +1 -0
- package/canvas/lottie-player.d.ts +2 -0
- package/canvas/lottie-player.js +1 -0
- package/canvas/lottie-player.wasm.d.ts +1 -0
- package/canvas/lottie-player.wasm.js +1 -0
- package/canvas/media-placeholders.d.ts +23 -0
- package/canvas/media-placeholders.js +1 -0
- package/canvas/page-controls.d.ts +3 -3
- package/canvas/page.js +1 -1
- package/canvas/quill-font-formats.d.ts +2 -2
- package/canvas/rect-control.js +1 -1
- package/canvas/render-tag-element.js +1 -1
- package/canvas/rich-editor.d.ts +7 -4
- package/canvas/rich-editor.js +5 -5
- package/canvas/rules.js +2 -2
- package/canvas/table-cell-text.d.ts +18 -0
- package/canvas/table-cell-text.js +1 -0
- package/canvas/table-element.js +1 -1
- package/canvas/text-element/caret-color.d.ts +3 -1
- package/canvas/text-element/render-tag-source.d.ts +33 -0
- package/canvas/text-element/render-tag-source.js +1 -0
- package/canvas/text-element.d.ts +1 -1
- package/canvas/text-element.js +1 -1
- package/canvas/use-color.d.ts +5 -5
- package/canvas/use-filtered-source.js +1 -1
- package/canvas/use-mediabunny-video.js +1 -1
- package/canvas/use-transformer-snap.d.ts +2 -2
- package/canvas/video-element.d.ts +4 -2
- package/canvas/video-element.js +1 -1
- package/icons/animation-icons.d.ts +1 -0
- package/icons/animation-icons.js +1 -1
- package/icons/registry.d.ts +35 -32
- package/icons/registry.js +1 -1
- package/image-tools/geometry.d.ts +2 -2
- package/image-tools/target.d.ts +6 -6
- package/image-tools/target.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/model/figure-model.d.ts +10 -10
- package/model/gif-model.d.ts +10 -10
- package/model/group-model.d.ts +393 -84
- package/model/group-model.js +1 -1
- package/model/image-model.d.ts +10 -10
- package/model/image-tools.d.ts +1 -1
- package/model/line-model.d.ts +10 -10
- package/model/lottie-model.d.ts +242 -0
- package/model/lottie-model.js +5 -0
- package/model/node-model.d.ts +8 -8
- package/model/page-model.d.ts +1186 -297
- package/model/page-model.js +1 -1
- package/model/shape-model.d.ts +11 -11
- package/model/shape-model.js +1 -1
- package/model/store.d.ts +30 -26
- package/model/store.js +1 -1
- package/model/svg-model.d.ts +9 -9
- package/model/table-model.d.ts +127 -20
- package/model/table-model.js +1 -1
- package/model/text-model.d.ts +9 -9
- package/model/video-model.d.ts +10 -10
- package/package.json +36 -55
- package/pages-timeline/pages-timeline.js +1 -1
- package/pages-timeline/track-styles.d.ts +12 -12
- package/polotno-app.d.ts +1 -1
- package/polotno.bundle.js +183 -179
- package/primitives/button.d.ts +4 -4
- package/primitives/dialog.d.ts +4 -4
- package/primitives/dropdown-menu.d.ts +18 -18
- package/primitives/input-group.d.ts +1 -1
- package/primitives/popover.d.ts +4 -4
- package/primitives/select.d.ts +5 -5
- package/primitives/tooltip.d.ts +3 -3
- package/side-panel/animations-panel.js +1 -1
- package/side-panel/background-panel.js +1 -1
- package/side-panel/draw-panel.js +1 -1
- package/side-panel/effect-card.js +1 -1
- package/side-panel/effects-panel.js +1 -1
- package/side-panel/photos-panel.js +1 -1
- package/side-panel/select-lottie.d.ts +11 -0
- package/side-panel/select-lottie.js +1 -0
- package/side-panel/select-video.d.ts +19 -19
- package/side-panel/size-panel.js +1 -1
- package/side-panel/unsplash-credit.d.ts +4 -1
- package/side-panel/unsplash-credit.js +1 -1
- package/side-panel/upload-panel.js +1 -1
- package/themes/carbon.css +1 -1
- package/toolbar/gif-toolbar.d.ts +3 -0
- package/toolbar/gif-toolbar.js +1 -1
- package/toolbar/group-button.js +1 -1
- package/toolbar/html-toolbar.d.ts +1 -0
- package/toolbar/html-toolbar.js +3 -3
- package/toolbar/image-remove-background-button.js +1 -1
- package/toolbar/index.d.ts +1 -1
- package/toolbar/index.js +1 -1
- package/toolbar/line-toolbar.js +1 -1
- package/toolbar/position-picker.js +1 -1
- package/toolbar/table-toolbar.js +1 -1
- package/toolbar/text-ai-write.js +1 -1
- package/toolbar/text-toolbar.js +1 -1
- package/toolbar/toolbar-shared.d.ts +15 -4
- package/toolbar/toolbar-shared.js +1 -1
- package/toolbar/toolbar.js +1 -1
- package/ui.css +2 -2
- package/utils/animations.d.ts +47 -44
- package/utils/animations.js +1 -1
- package/utils/base64.d.ts +1 -2
- package/utils/base64.js +1 -1
- package/utils/clipboard.d.ts +19 -18
- package/utils/clipboard.js +1 -1
- package/utils/fade-gradient.d.ts +1 -1
- package/utils/file.d.ts +4 -3
- package/utils/file.js +1 -1
- package/utils/font-metric.d.ts +29 -28
- package/utils/fonts.js +1 -1
- package/utils/gif-encoder.d.ts +35 -0
- package/utils/gif-encoder.js +1 -0
- package/utils/gif-lib.d.ts +6 -10
- package/utils/gif-lib.js +1 -1
- package/utils/gif-worker.d.ts +1 -0
- package/utils/gif-worker.js +3 -0
- package/utils/html2canvas.js +1 -1
- package/utils/image-dpi.d.ts +1 -1
- package/utils/image-dpi.js +1 -1
- package/utils/insert-file.js +1 -1
- package/utils/l10n.d.ts +1 -0
- package/utils/l10n.js +1 -1
- package/utils/lottie.d.ts +12 -0
- package/utils/lottie.js +1 -0
- package/utils/math.d.ts +4 -4
- package/utils/px.d.ts +3 -0
- package/utils/px.js +1 -1
- package/utils/react-color/components/common/Checkboard.d.ts +12 -12
- package/utils/react-color/components/common/Swatch.d.ts +6 -6
- package/utils/react-color/helpers/interaction.d.ts +6 -6
- package/utils/reactcss/components/active.d.ts +6 -6
- package/utils/reactcss/components/hover.d.ts +6 -6
- package/utils/rich-text-html.js +1 -1
- package/utils/selection-colors.js +1 -1
- package/utils/selection-transform.d.ts +4 -4
- package/utils/selection-transform.js +1 -1
- package/utils/split-element.js +1 -1
- package/utils/text-format-state.d.ts +1 -0
- package/utils/text-format-state.js +1 -1
- package/utils/text-format.d.ts +2 -2
- package/utils/text-sizing.d.ts +1 -1
- package/utils/timeline.d.ts +30 -2
- package/utils/timeline.js +1 -1
- package/utils/to-html.js +1 -1
- package/utils/to-svg.js +1 -1
- package/utils/validate-key.js +1 -1
- package/canvas/downscale-bands.d.ts +0 -10
- package/canvas/downscale-bands.js +0 -1
- package/canvas/downscale-kernel.d.ts +0 -7
- package/canvas/downscale-kernel.js +0 -1
- package/canvas/downscale-kernel.wasm.d.ts +0 -1
- package/canvas/downscale-kernel.wasm.js +0 -1
- package/canvas/downscale-passes.d.ts +0 -7
- package/canvas/downscale-passes.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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?:
|
|
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?:
|
|
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?:
|
|
22
|
+
layout?: 'vertical' | 'horizontal';
|
|
23
23
|
}) => React.JSX.Element | null;
|
|
24
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
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]),
|
|
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{
|
|
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
|
|
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{
|
|
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")},[]),
|
|
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{
|
|
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:
|
|
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
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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: "
|
|
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:
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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: "
|
|
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:
|
|
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: "
|
|
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:
|
|
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>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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;
|