polotno 3.18.0 → 3.19.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 (73) hide show
  1. package/blueprint/side-panel/select-video.d.ts +18 -16
  2. package/canvas/animated-shadow.d.ts +11 -0
  3. package/canvas/animated-shadow.js +1 -0
  4. package/canvas/apply-filters.d.ts +5 -1
  5. package/canvas/apply-filters.js +1 -1
  6. package/canvas/downscale-kernel.js +1 -1
  7. package/canvas/downscale.js +1 -1
  8. package/canvas/element.js +1 -1
  9. package/canvas/figure-element.js +1 -1
  10. package/canvas/gif-element.js +1 -1
  11. package/canvas/html-element.js +1 -1
  12. package/canvas/image-element.d.ts +1 -0
  13. package/canvas/image-element.js +1 -1
  14. package/canvas/line-element.js +1 -1
  15. package/canvas/page.js +1 -1
  16. package/canvas/render-tag-element.js +1 -1
  17. package/canvas/rich-editor.d.ts +2 -0
  18. package/canvas/rich-editor.js +8 -5
  19. package/canvas/text-element.js +1 -1
  20. package/canvas/use-animated-blur.d.ts +4 -0
  21. package/canvas/use-animated-blur.js +1 -0
  22. package/canvas/use-color.d.ts +1 -1
  23. package/canvas/use-filtered-source.js +1 -1
  24. package/canvas/use-offscreen-canvas.d.ts +2 -0
  25. package/canvas/use-offscreen-canvas.js +1 -0
  26. package/canvas/use-transformer-snap.js +1 -1
  27. package/canvas/video-element.js +1 -1
  28. package/icons/animation-icons.d.ts +30 -7
  29. package/icons/animation-icons.js +1 -1
  30. package/icons/registry.d.ts +22 -0
  31. package/icons/registry.js +1 -1
  32. package/image-tools/raster.js +1 -1
  33. package/model/figure-model.d.ts +10 -9
  34. package/model/gif-model.d.ts +10 -9
  35. package/model/group-model.d.ts +78 -72
  36. package/model/group-model.js +1 -1
  37. package/model/history.d.ts +3 -0
  38. package/model/history.js +1 -1
  39. package/model/image-model.d.ts +10 -9
  40. package/model/line-model.d.ts +10 -9
  41. package/model/node-model.d.ts +8 -8
  42. package/model/page-model.d.ts +228 -207
  43. package/model/shape-model.d.ts +15 -9
  44. package/model/shape-model.js +1 -1
  45. package/model/store.d.ts +29 -19
  46. package/model/store.js +1 -1
  47. package/model/svg-model.d.ts +9 -8
  48. package/model/table-model.d.ts +8 -7
  49. package/model/text-model.d.ts +9 -8
  50. package/model/video-model.d.ts +10 -9
  51. package/package.json +21 -19
  52. package/pages-timeline/element-track.js +1 -1
  53. package/pages-timeline/page-preview.js +1 -1
  54. package/polotno.bundle.js +181 -163
  55. package/side-panel/animations-panel.js +1 -1
  56. package/side-panel/select-video.d.ts +18 -16
  57. package/toolbar/animations-picker.js +1 -1
  58. package/toolbar/use-copy-style.d.ts +1 -0
  59. package/toolbar/use-copy-style.js +1 -1
  60. package/ui.css +1 -1
  61. package/utils/animations.d.ts +212 -10
  62. package/utils/animations.js +1 -1
  63. package/utils/clipboard.d.ts +17 -15
  64. package/utils/clipboard.js +1 -1
  65. package/utils/fonts.js +1 -1
  66. package/utils/image-edit.js +1 -1
  67. package/utils/l10n.d.ts +44 -0
  68. package/utils/l10n.js +1 -1
  69. package/utils/px.d.ts +1 -0
  70. package/utils/px.js +1 -1
  71. package/utils/timeline.d.ts +3 -1
  72. package/utils/timeline.js +1 -1
  73. package/utils/validate-key.js +1 -1
@@ -1 +1 @@
1
- var e=this&&this.__rest||function(e,t){var o={};for(var i in e){Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i])}if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++){t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(o[i[r]]=e[i[r]])}}return o};import{isAlive as t,types as o}from"mobx-state-tree";import{nanoid as i}from"nanoid";import{GROUP_BLEND_MODES as r}from"@polotno/schema/defaults";import{Node as n}from"./node-model.js";import{Animation as l,Shape as s}from"./shape-model.js";import{animate as a}from"../utils/animations.js";import{polotnoError as d}from"@polotno/core/errors";import{getPlayheadLocalTime as c}from"../utils/timeline.js";import{getCenter as p,getTotalClientRect as h}from"../utils/math.js";import{TextElement as m}from"./text-model.js";import{ImageElement as y}from"./image-model.js";import{VideoElement as f}from"./video-model.js";import{LineElement as u}from"./line-model.js";import{SVGElement as g}from"./svg-model.js";import{FigureElement as E}from"./figure-model.js";import{GifElement as b}from"./gif-model.js";import{TableElement as v}from"./table-model.js";export const forEveryChild=(e,t)=>{if(e.children){for(const o of e.children){if(!0===t(o)){break}forEveryChild(o,t)}}};export{forEveryNode}from"@polotno/core/for-every-node";export function zIndexOps(e){const t=(t,o,i)=>{const r=t.map(t=>e.children.findIndex(e=>e.id===t)).filter(e=>-1!==e).sort((e,t)=>(t-e)*o);for(const n of r){const r=e.children[n+o];!r||t.indexOf(r.id)>=0||i(n)}},o=(e,o)=>{let i=!1;return t(e,o,()=>{i=!0}),i},i=(o,i)=>{t(o,i,t=>{const o=e.children.slice();[o[t],o[t+i]]=[o[t+i],o[t]],e.children.replace(o)})},r=(t,o)=>{const i=[],r=[];e.children.forEach(e=>{(t.indexOf(e.id)>=0?i:r).push(e)}),e.children.replace(o?r.concat(i):i.concat(r))};return{canMoveElementsUp:e=>o(e,1),canMoveElementsTop:e=>o(e,1),canMoveElementsDown:e=>o(e,-1),canMoveElementsBottom:e=>o(e,-1),moveElementsUp(e){i(e,1)},moveElementsDown(e){i(e,-1)},moveElementsTop(e){r(e,!0)},moveElementsBottom(e){r(e,!1)},setElementZIndex(t,o){const i=e.children.find(e=>e.id===t);if(i){const t=e.children.filter(e=>e!==i);t.splice(o,0,i),e.children.replace(t)}},_reconcileChildren(t){const o=new Map(e.children.map(e=>[e.id,e]));e.children.replace(t.flatMap(e=>{var t;return null!==(t=o.get(e.id))&&void 0!==t?t:[]})),t.forEach((t,i)=>{o.has(t.id)||e.children.splice(i,0,t)})}}}const x=[...new Array(20)].map((e,t)=>o.late(()=>M[t]));export const ElementTypes=o.union({dispatcher:e=>{const t=TYPES_MAP[e.type];if(!t){const t=`Unknown element type: "${e.type}"`;throw d("DESIGN_INVALID",t,{errors:[{path:"type",message:t}],knownTypes:Object.keys(TYPES_MAP)})}return t}},g,m,y,u,f,E,b,v,o.late(()=>GroupElement),...x);const w=Object.freeze({x:0,y:0,offsetX:0,offsetY:0,scaleX:1,scaleY:1,rotation:0,opacity:1});function j(e){return 1===e?w:Object.assign(Object.assign({},w),{opacity:e})}const O={x:0,y:0,width:0,height:0,rotation:0,opacity:1,fontSize:0,cropX:0,cropY:0,cropWidth:1,cropHeight:1},C=(e,t)=>"number"==typeof e&&isFinite(e)?e:t;function P(e,t,o,i){O.x=e.x,O.y=e.y,O.width=e.width,O.height=e.height,O.opacity=i;const r=a({element:O,animation:t,dTime:o})||{},n=C(r.width,e.width),l=C(r.height,e.height);return{x:C(r.x,e.x),y:C(r.y,e.y),width:n>0?n:e.width,height:l>0?l:e.height,rotation:C(r.rotation,0),opacity:C(r.opacity,i)}}export const GroupElement=n.named("Group").props({type:"group",blendMode:o.optional(o.enumeration([...r]),"pass-through"),children:o.array(ElementTypes),animations:o.array(l)}).views(e=>({get draggable(){let t=!0;return forEveryChild(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return forEveryChild(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return forEveryChild(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return forEveryChild(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return forEveryChild(e,e=>{e.locked||(t=!1)}),t},get _restingBbox(){const t=[];if(forEveryChild(e,e=>{var o,i,r;if("group"===e.type){return}const n=e.width,l=e.height;!n||!l||n<=0||l<=0||t.push({x:null!==(o=e.x)&&void 0!==o?o:0,y:null!==(i=e.y)&&void 0!==i?i:0,width:n,height:l,rotation:null!==(r=e.rotation)&&void 0!==r?r:0})}),!t.length){return null}const o=h(t);return o.width<=0||o.height<=0?null:{x:o.x,y:o.y,width:o.width,height:o.height}},get a(){if(!t(e)){return w}const o=c(e);if(null===o){return j(e.opacity)}if(e.store.isEditingPaused&&this.isSelectedDirectly){return j(e.opacity)}const i=e.page,r=e.store.animatedElementsIds;if(r.length&&!r.includes(e.id)){return j(e.opacity)}let n,l,s;for(const t of e.animations){t.enabled&&("enter"===t.type?n=t:"exit"===t.type?l=t:"loop"===t.type&&(s=t))}const a=!!n&&o<n.delay,d=!!n&&o>=n.delay&&o<=n.delay+n.duration,h=!a&&!d&&!!l&&o>=i.duration-l.duration-l.delay&&o<=i.duration-l.delay,m=!!l&&o>=i.duration-l.delay;if(!(a||d||h||m||s)){return j(e.opacity)}const y=this._restingBbox;if(!y){return j(e.opacity)}let f={x:y.x,y:y.y,width:y.width,height:y.height,rotation:0,opacity:e.opacity};a&&(f.opacity=0),d&&(f=P(y,n,o-n.delay,e.opacity)),h&&(f=P(y,l,o-(i.duration-l.duration-l.delay),e.opacity)),m&&(f.opacity=0),s&&(f=P(f,s,o,f.opacity));const u=p(f);return{x:u.x,y:u.y,offsetX:y.x+y.width/2,offsetY:y.y+y.height/2,scaleX:f.width/y.width,scaleY:f.height/y.height,rotation:f.rotation,opacity:f.opacity}},get isSelectedDirectly(){return!!t(e)&&e.store.selectedElements.indexOf(e)>=0&&e.selectable},get active(){return!0}})).actions(t=>Object.assign(Object.assign({set(o){var{draggable:i,contentEditable:r,styleEditable:n,resizable:l}=o,s=e(o,["draggable","contentEditable","styleEditable","resizable"]);void 0!==i&&forEveryChild(t,e=>{e.set({draggable:i})}),void 0!==r&&forEveryChild(t,e=>{e.set({contentEditable:r})}),void 0!==n&&forEveryChild(t,e=>{e.set({styleEditable:n})}),void 0!==l&&forEveryChild(t,e=>{e.set({resizable:l})}),Object.assign(t,s)},addElement(e,{skipSelect:o=!1}={}){const r=TYPES_MAP[e.type];if(!r){return void console.error("Can not find model with type "+e.type)}e.children&&e.children.forEach(e=>{e.id=e.id||i(10)});const n=r.create(Object.assign({id:i(10)},e));return t.children.push(n),n.selectable&&!o&&t.store.selectElements([n.id]),n}},zIndexOps(t)),{setAnimation(e,o){const i=t.animations.find(t=>t.type===e);i?Object.assign(i,o):t.animations.push(Object.assign({type:e},o))}}));const M=[];export const TYPES_MAP={svg:g,text:m,image:y,group:GroupElement,line:u,video:f,figure:E,gif:b,table:v};export function registerShapeModel(e,t){const o=e.type;if(!o){throw new Error('You must pass "type" attribute to custom model.')}const i=s.named(o).props(e),r=t?t(i):i;TYPES_MAP[o]=r,M.push(r)}
1
+ var e=this&&this.__rest||function(e,t){var o={};for(var i in e){Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i])}if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++){t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(o[i[r]]=e[i[r]])}}return o};import{isAlive as t,types as o}from"mobx-state-tree";import{nanoid as i}from"nanoid";import{GROUP_BLEND_MODES as r}from"@polotno/schema/defaults";import{Node as n}from"./node-model.js";import{Animation as l,Shape as s}from"./shape-model.js";import{animate as a,playedAnimations as c,setAnimationOf as d}from"../utils/animations.js";import{polotnoError as p}from"@polotno/core/errors";import{transitionWindows as h}from"@polotno/core/animation-presets";import{getPlayheadLocalTime as m}from"../utils/timeline.js";import{getCenter as f,getTotalClientRect as y}from"../utils/math.js";import{TextElement as u}from"./text-model.js";import{ImageElement as g}from"./image-model.js";import{VideoElement as E}from"./video-model.js";import{LineElement as v}from"./line-model.js";import{SVGElement as b}from"./svg-model.js";import{FigureElement as x}from"./figure-model.js";import{GifElement as w}from"./gif-model.js";import{TableElement as j}from"./table-model.js";export const forEveryChild=(e,t)=>{if(e.children){for(const o of e.children){if(!0===t(o)){break}forEveryChild(o,t)}}};export{forEveryNode}from"@polotno/core/for-every-node";export function zIndexOps(e){const t=(t,o,i)=>{const r=t.map(t=>e.children.findIndex(e=>e.id===t)).filter(e=>-1!==e).sort((e,t)=>(t-e)*o);for(const n of r){const r=e.children[n+o];!r||t.indexOf(r.id)>=0||i(n)}},o=(e,o)=>{let i=!1;return t(e,o,()=>{i=!0}),i},i=(o,i)=>{t(o,i,t=>{const o=e.children.slice();[o[t],o[t+i]]=[o[t+i],o[t]],e.children.replace(o)})},r=(t,o)=>{const i=[],r=[];e.children.forEach(e=>{(t.indexOf(e.id)>=0?i:r).push(e)}),e.children.replace(o?r.concat(i):i.concat(r))};return{canMoveElementsUp:e=>o(e,1),canMoveElementsTop:e=>o(e,1),canMoveElementsDown:e=>o(e,-1),canMoveElementsBottom:e=>o(e,-1),moveElementsUp(e){i(e,1)},moveElementsDown(e){i(e,-1)},moveElementsTop(e){r(e,!0)},moveElementsBottom(e){r(e,!1)},setElementZIndex(t,o){const i=e.children.find(e=>e.id===t);if(i){const t=e.children.filter(e=>e!==i);t.splice(o,0,i),e.children.replace(t)}}}}const O=[...new Array(20)].map((e,t)=>o.late(()=>T[t]));export const ElementTypes=o.union({dispatcher:e=>{const t=TYPES_MAP[e.type];if(!t){const t=`Unknown element type: "${e.type}"`;throw p("DESIGN_INVALID",t,{errors:[{path:"type",message:t}],knownTypes:Object.keys(TYPES_MAP)})}return t}},b,u,g,v,E,x,w,j,o.late(()=>GroupElement),...O);const S=Object.freeze({x:0,y:0,offsetX:0,offsetY:0,scaleX:1,scaleY:1,rotation:0,opacity:1});function P(e){return 1===e?S:Object.assign(Object.assign({},S),{opacity:e})}const C=(e,t)=>"number"==typeof e&&isFinite(e)?e:t;function M(e,t,o,i,r){var n,l,s;const c={x:e.x,y:e.y,width:e.width,height:e.height,rotation:null!==(n=e.rotation)&&void 0!==n?n:0,opacity:i,fontSize:0,cropX:0,cropY:0,cropWidth:1,cropHeight:1,page:r},d=a({element:c,animation:t,dTime:o})||{},p=C(d.width,e.width),h=C(d.height,e.height);return{x:C(d.x,e.x),y:C(d.y,e.y),width:p>0?p:e.width,height:h>0?h:e.height,rotation:C(d.rotation,c.rotation),opacity:Math.min(1,Math.max(0,C(d.opacity,i))),wipe:null!==(l=d.wipe)&&void 0!==l?l:e.wipe,flipScale:null!==(s=d.flipScale)&&void 0!==s?s:e.flipScale}}export const GroupElement=n.named("Group").props({type:"group",blendMode:o.optional(o.enumeration([...r]),"pass-through"),children:o.array(ElementTypes),animations:o.array(l)}).views(e=>({get draggable(){let t=!0;return forEveryChild(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return forEveryChild(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return forEveryChild(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return forEveryChild(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return forEveryChild(e,e=>{e.locked||(t=!1)}),t},get _restingBbox(){const t=[];if(forEveryChild(e,e=>{var o,i,r;if("group"===e.type){return}const n=e.width,l=e.height;!n||!l||n<=0||l<=0||t.push({x:null!==(o=e.x)&&void 0!==o?o:0,y:null!==(i=e.y)&&void 0!==i?i:0,width:n,height:l,rotation:null!==(r=e.rotation)&&void 0!==r?r:0})}),!t.length){return null}const o=y(t);return o.width<=0||o.height<=0?null:{x:o.x,y:o.y,width:o.width,height:o.height}},get a(){var o;if(!t(e)){return S}const i=m(e);if(null===i){return P(e.opacity)}if(e.store.isEditingPaused&&this.isSelectedDirectly){return P(e.opacity)}const r=e.page,n=e.store.animatedElementsIds;if(n.length&&!n.includes(e.id)){return P(e.opacity)}let l,s,a;for(const t of c(e)){t.enabled&&("enter"===t.type?l=t:"exit"===t.type?s=t:"loop"===t.type&&(a=t))}const d=h(c(e),r.duration),p=!!l&&i<l.delay,y=!!d.enter&&i>=d.enter.start&&i<=d.enter.end,u=!p&&!y&&!!d.exit&&i>=d.exit.start&&i<=d.exit.end,g=!!s&&i>=r.duration-s.delay,E=!!a&&i>=a.delay;if(!(p||y||u||g||E)){return P(e.opacity)}const v=this._restingBbox;if(!v){return P(e.opacity)}let b={x:v.x,y:v.y,width:v.width,height:v.height,rotation:0,opacity:e.opacity};p&&(b.opacity=0),y&&(b=M(v,l,(i-d.enter.start)/d.pace,e.opacity,r)),u&&(b=M(v,s,(i-d.exit.start)/d.pace,e.opacity,r)),g&&(b.opacity=0),E&&(b=M(b,a,i-a.delay,b.opacity,r));const x=f(b);return{x:x.x,y:x.y,offsetX:v.x+v.width/2,offsetY:v.y+v.height/2,scaleX:b.width/v.width*(null!==(o=b.flipScale)&&void 0!==o?o:1),scaleY:b.height/v.height,rotation:b.rotation,opacity:b.opacity,wipe:b.wipe}},get isSelectedDirectly(){return!!t(e)&&e.store.selectedElements.indexOf(e)>=0&&e.selectable},get active(){return!0}})).actions(t=>Object.assign(Object.assign({set(o){var{draggable:i,contentEditable:r,styleEditable:n,resizable:l}=o,s=e(o,["draggable","contentEditable","styleEditable","resizable"]);void 0!==i&&forEveryChild(t,e=>{e.set({draggable:i})}),void 0!==r&&forEveryChild(t,e=>{e.set({contentEditable:r})}),void 0!==n&&forEveryChild(t,e=>{e.set({styleEditable:n})}),void 0!==l&&forEveryChild(t,e=>{e.set({resizable:l})}),Object.assign(t,s)},addElement(e,{skipSelect:o=!1}={}){const r=TYPES_MAP[e.type];if(!r){return void console.error("Can not find model with type "+e.type)}e.children&&e.children.forEach(e=>{e.id=e.id||i(10)});const n=r.create(Object.assign({id:i(10)},e));return t.children.push(n),n.selectable&&!o&&t.store.selectElements([n.id]),n}},zIndexOps(t)),{setAnimation(e,o){d(t.animations,e,o)}}));const T=[];export const TYPES_MAP={svg:b,text:u,image:g,group:GroupElement,line:v,video:E,figure:x,gif:w,table:j};export function registerShapeModel(e,t){const o=e.type;if(!o){throw new Error('You must pass "type" attribute to custom model.')}const i=s.named(o).props(e),r=t?t(i):i;TYPES_MAP[o]=r,T.push(r)}
@@ -1,3 +1,4 @@
1
+ import { IDisposer } from 'mobx-state-tree';
1
2
  export declare const UndoManager: import("mobx-state-tree").IModelType<{
2
3
  history: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>;
3
4
  undoIdx: import("mobx-state-tree").IType<number | undefined, number, number>;
@@ -6,6 +7,8 @@ export declare const UndoManager: import("mobx-state-tree").IModelType<{
6
7
  readonly canUndo: boolean;
7
8
  readonly canRedo: boolean;
8
9
  } & {
10
+ _onChange(listener: () => void): IDisposer;
11
+ _applyDocument(apply: () => void): void;
9
12
  startTransaction(): void;
10
13
  endTransaction(skipSave?: boolean): void;
11
14
  ignore(func: any, skipStateReplacement?: boolean, delayed?: boolean): Promise<void>;
package/model/history.js CHANGED
@@ -1 +1 @@
1
- import{types as t,resolvePath as e,onSnapshot as n,getSnapshot as o,applySnapshot as r}from"mobx-state-tree";import{deepEqual as a}from"../utils/deep-equal.js";import{observable as d,when as s}from"mobx";Object.assign(t);export const UndoManager=t.model("UndoManager",{history:t.array(t.frozen()),undoIdx:-1,targetPath:""}).views(t=>({get canUndo(){return t.undoIdx>0},get canRedo(){return t.undoIdx<t.history.length-1}})).actions(t=>{let i,c,l=!1,u=null,h=0;const g=d.box(0);let f=null;const m=()=>g.get()>0;function y(){const t=o(i);return{pages:t.pages,width:t.width,height:t.height,custom:t.custom,audios:t.audios}}function p(t,e,n){let o=!1;const r=t.map(t=>{if(t.id===e){return o=!0,Object.assign(Object.assign({},t),n)}if(!t.children){return t}const r=p(t.children,e,n);return r===t.children?t:(o=!0,Object.assign(Object.assign({},t),{children:r}))});return o?r:t}function S(){const t=y();return f?Object.assign(Object.assign({},t),{pages:t.pages.map(t=>Object.assign(Object.assign({},t),{children:p(t.children,f.id,f.entry)}))}):t}function b(t,e){return t.length===e.length&&t.every((t,n)=>t.id===e[n].id)}function x(t){return o(t.children,!1)}function U(t,e){var n;const d=null!==(n=e.children)&&void 0!==n?n:[];let s=x(t);b(s,d)||(t._reconcileChildren(d),s=x(t)),r(t,Object.assign(Object.assign({},e),{children:d.map((e,n)=>e.children&&e!==s[n]?(U(t.children[n],e),o(t.children[n])):a(e,s[n])?s[n]:e)}))}function w(t){const e=t.pages;let n=o(i.pages);b(n,e)||(i._reconcilePages(e),n=o(i.pages)),e.forEach((t,e)=>{t!==n[e]&&U(i.pages[e],t)}),a(i.custom,t.custom)||i.set({custom:t.custom}),r(i.audios,t.audios),i.setSize(t.width,t.height)}const I={startTransaction(){g.set(g.get()+1)},endTransaction(t){g.set(Math.max(0,g.get()-1)),t||I.requestAddState(S())},async ignore(t,e=!1,n=!1){n&&await new Promise(t=>setTimeout(t,10));const o=!!h;h&&I.addUndoState();let r=m();I.startTransaction();const a=g.get();try{await t()}catch(i){setTimeout(()=>{throw i})}const d=a!==g.get(),s=!d;I.endTransaction(s),e||r&&!o||I.replaceState(),d||(clearTimeout(h),h=0)},async transaction(t){await I.ignore(t,!0),m()||I.addUndoState()},_whenIdle:t=>s(()=>!m(),{signal:t}),_commitToolChange(t){if(m()){return!1}const e=y();I.requestAddState(S()),I.addUndoState();try{t()}catch(n){throw w(e),n}return I.requestAddState(S()),I.addUndoState(),!0},_startDraft(t,e){h&&I.addUndoState(),f={id:t,entry:e,state:y()}},_draftChange(t){t(),f&&(f.state=y())},_commitDraft(){f&&(h&&I.addUndoState(),u=f.state,f=null,I.addUndoState())},_discardDraft(){f=null},requestAddState(t){u=t,h||m()||(l?l=!1:h=setTimeout(()=>{h=0,clearTimeout(h),m()||I.addUndoState()},100))},addUndoState(){if(l){return void(l=!1)}const e=t.history[t.undoIdx];!a(u,e)&&(clearTimeout(h),h=0,t.history.splice(t.undoIdx+1),t.history.push(u),t.undoIdx=t.history.length-1)},afterCreate(){if(i=e(t,".."),!i){throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment")}c=n(i,()=>{f&&(f.state=y()),I.requestAddState(S())}),0===t.history.length&&I.requestAddState(S())},clear(){clearTimeout(h),h=0,t.history.splice(0,t.history.length),t.undoIdx=-1,I.addUndoState()},beforeDestroy(){c()},undo(){var e;if(!(null===(e=i._beforeToolHistory)||void 0===e?void 0:e.call(i,"undo"))){if(h&&I.addUndoState(),m()){const e=t.history[t.undoIdx];return void(e&&w(e))}t.canUndo?(t.undoIdx--,l=!0,w(t.history[t.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")}},redo(){var e;h&&I.addUndoState(),t.canRedo?(null===(e=i._beforeToolHistory)||void 0===e||e.call(i,"redo"),t.undoIdx++,l=!0,w(t.history[t.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){t.history[t.undoIdx]=S()}};return I});export default UndoManager;
1
+ import{types as t,resolvePath as e,onPatch as o,getSnapshot as n,applySnapshot as a}from"mobx-state-tree";import{deepEqual as r}from"../utils/deep-equal.js";import{observable as d,reaction as s,when as i}from"mobx";Object.assign(t);export const UndoManager=t.model("UndoManager",{history:t.array(t.frozen()),undoIdx:-1,targetPath:""}).views(t=>({get canUndo(){return t.undoIdx>0},get canRedo(){return t.undoIdx<t.history.length-1}})).actions(t=>{let c,u,l=!1;const h={};let g=null;const m=d.box(0),f=new Set;let y;function p(){m.set(m.get()+1)}function S(){y=o(c,p)}let b=0;const x=d.box(0);let U=null;const w=()=>x.get()>0;function I(){const t=n(c);return{pages:t.pages,width:t.width,height:t.height,custom:t.custom,audios:t.audios}}function T(t,e,o){let n=!1;const a=t.map(t=>{if(t.id===e){return n=!0,Object.assign(Object.assign({},t),o)}if(!t.children){return t}const a=T(t.children,e,o);return a===t.children?t:(n=!0,Object.assign(Object.assign({},t),{children:a}))});return n?a:t}function j(){const t=I();return U?Object.assign(Object.assign({},t),{pages:t.pages.map(t=>Object.assign(Object.assign({},t),{children:T(t.children,U.id,U.entry)}))}):t}function O(t,e){const o=new Map(e.map(t=>[t.id,t]));return t.map(t=>{const e=o.get(t.id);return e?r(t,e)?e:t.children&&e.children?Object.assign(Object.assign({},t),{children:O(t.children,e.children)}):t:t})}function _(t){v._applyDocument(()=>{a(c.pages,O(t.pages,n(c.pages))),r(c.custom,t.custom)||c.set({custom:t.custom}),a(c.audios,t.audios),c.setSize(t.width,t.height)})}const v={_onChange:t=>(f.add(t),()=>f.delete(t)),_applyDocument(t){y();try{t()}finally{S(),p()}},startTransaction(){x.set(x.get()+1)},endTransaction(t){x.set(Math.max(0,x.get()-1)),t||v.requestAddState(j())},async ignore(t,e=!1,o=!1){o&&await new Promise(t=>setTimeout(t,10));const n=!!b;b&&v.addUndoState();let a=w();v.startTransaction();const r=x.get();try{await t()}catch(i){setTimeout(()=>{throw i})}const d=r!==x.get(),s=!d;v.endTransaction(s),e||a&&!n||v.replaceState(),d||(clearTimeout(b),b=0)},async transaction(t){await v.ignore(t,!0),w()||v.addUndoState()},_whenIdle:t=>i(()=>!w(),{signal:t}),_commitToolChange(t){if(w()){return!1}const e=I();v.requestAddState(j()),v.addUndoState();try{t()}catch(o){throw _(e),o}return v.requestAddState(j()),v.addUndoState(),!0},_startDraft(t,e){b&&v.addUndoState(),U={id:t,entry:e,state:I()}},_draftChange(t){t(),U&&(U.state=I())},_commitDraft(){U&&(b&&v.addUndoState(),g=U.state,U=null,v.addUndoState())},_discardDraft(){U=null},requestAddState(t){g=t,b||w()||(l?l=!1:b=setTimeout(()=>{b=0,clearTimeout(b),w()||v.addUndoState()},100))},addUndoState(){if(l){return void(l=!1)}g===h&&(g=j());const e=t.history[t.undoIdx];!r(g,e)&&(clearTimeout(b),b=0,t.history.splice(t.undoIdx+1),t.history.push(g),t.undoIdx=t.history.length-1)},afterCreate(){if(c=e(t,".."),!c){throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment")}S(),u=s(()=>m.get(),()=>{U&&(U.state=I()),v.requestAddState(U?j():h),f.forEach(t=>t())}),0===t.history.length&&v.requestAddState(j())},clear(){clearTimeout(b),b=0,t.history.splice(0,t.history.length),t.undoIdx=-1,v.addUndoState()},beforeDestroy(){y(),u()},undo(){var e;if(!(null===(e=c._beforeToolHistory)||void 0===e?void 0:e.call(c,"undo"))){if(b&&v.addUndoState(),w()){const e=t.history[t.undoIdx];return void(e&&_(e))}t.canUndo?(t.undoIdx--,l=!0,_(t.history[t.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")}},redo(){var e;b&&v.addUndoState(),t.canRedo?(null===(e=c._beforeToolHistory)||void 0===e||e.call(c,"redo"),t.undoIdx++,l=!0,_(t.history[t.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){t.history[t.undoIdx]=j()}};return v});export default UndoManager;
@@ -4,7 +4,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
4
4
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
5
5
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
6
6
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
7
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
7
+ 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]>;
8
8
  custom: import("mobx-state-tree").IType<any, any, any>;
9
9
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
10
10
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -25,6 +25,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
25
25
  type: import("mobx-state-tree").ISimpleType<"exit" | "enter" | "loop">;
26
26
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
27
27
  data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
28
+ easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
28
29
  }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
29
30
  blurEnabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
30
31
  blurRadius: import("mobx-state-tree").IType<number | undefined, number, number>;
@@ -74,7 +75,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
74
75
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
75
76
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
76
77
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
77
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
78
+ 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]>;
78
79
  custom: import("mobx-state-tree").IType<any, any, any>;
79
80
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
80
81
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -86,7 +87,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
86
87
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
87
88
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
88
89
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
89
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
90
+ 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]>;
90
91
  custom: import("mobx-state-tree").IType<any, any, any>;
91
92
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
92
93
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -98,7 +99,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
98
99
  type: string | undefined;
99
100
  name: string | undefined;
100
101
  opacity: number | undefined;
101
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
102
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
102
103
  custom: any;
103
104
  visible: boolean | undefined;
104
105
  selectable: boolean | undefined;
@@ -117,7 +118,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
117
118
  alwaysOnTop: boolean;
118
119
  showInExport: boolean;
119
120
  } | {
120
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
121
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
121
122
  id: string;
122
123
  type: string;
123
124
  name: string;
@@ -145,7 +146,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
145
146
  alwaysOnTop: boolean;
146
147
  showInExport: boolean;
147
148
  } | {
148
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
149
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
149
150
  id: string;
150
151
  type: string;
151
152
  name: string;
@@ -180,7 +181,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
180
181
  readonly isSelected: boolean;
181
182
  readonly isSelectedDirectly: boolean;
182
183
  } & {
183
- setAnimation(type: any, attrs: any): void;
184
+ setAnimation(type: "enter" | "exit" | "loop", attrs: import("../utils/animations.js").AnimationAttrs): void;
184
185
  setFilter(type: any, value: any): void;
185
186
  } & {
186
187
  _setSourceSize(size: import("../image-tools/types.js").Size, src: string): void;
@@ -204,7 +205,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
204
205
  type: string | undefined;
205
206
  name: string | undefined;
206
207
  opacity: number | undefined;
207
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
208
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
208
209
  custom: any;
209
210
  visible: boolean | undefined;
210
211
  selectable: boolean | undefined;
@@ -223,7 +224,7 @@ export declare const ImageElement: import("mobx-state-tree").IModelType<{
223
224
  alwaysOnTop: boolean;
224
225
  showInExport: boolean;
225
226
  } | {
226
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
227
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
227
228
  id: string;
228
229
  type: string;
229
230
  name: string;
@@ -4,7 +4,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
4
4
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
5
5
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
6
6
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
7
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
7
+ 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]>;
8
8
  custom: import("mobx-state-tree").IType<any, any, any>;
9
9
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
10
10
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -25,6 +25,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
25
25
  type: import("mobx-state-tree").ISimpleType<"exit" | "enter" | "loop">;
26
26
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
27
27
  data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
28
+ easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
28
29
  }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
29
30
  blurEnabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
30
31
  blurRadius: import("mobx-state-tree").IType<number | undefined, number, number>;
@@ -65,7 +66,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
65
66
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
66
67
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
67
68
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
68
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
69
+ 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]>;
69
70
  custom: import("mobx-state-tree").IType<any, any, any>;
70
71
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
71
72
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -77,7 +78,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
77
78
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
78
79
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
79
80
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
80
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
81
+ 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]>;
81
82
  custom: import("mobx-state-tree").IType<any, any, any>;
82
83
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
83
84
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -89,7 +90,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
89
90
  type: string | undefined;
90
91
  name: string | undefined;
91
92
  opacity: number | undefined;
92
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
93
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
93
94
  custom: any;
94
95
  visible: boolean | undefined;
95
96
  selectable: boolean | undefined;
@@ -108,7 +109,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
108
109
  alwaysOnTop: boolean;
109
110
  showInExport: boolean;
110
111
  } | {
111
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
112
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
112
113
  id: string;
113
114
  type: string;
114
115
  name: string;
@@ -136,7 +137,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
136
137
  alwaysOnTop: boolean;
137
138
  showInExport: boolean;
138
139
  } | {
139
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
140
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
140
141
  id: string;
141
142
  type: string;
142
143
  name: string;
@@ -171,14 +172,14 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
171
172
  readonly isSelected: boolean;
172
173
  readonly isSelectedDirectly: boolean;
173
174
  } & {
174
- setAnimation(type: any, attrs: any): void;
175
+ setAnimation(type: "enter" | "exit" | "loop", attrs: import("../utils/animations.js").AnimationAttrs): void;
175
176
  setFilter(type: any, value: any): void;
176
177
  }, import("mobx-state-tree").ModelCreationType<{
177
178
  id: string;
178
179
  type: string | undefined;
179
180
  name: string | undefined;
180
181
  opacity: number | undefined;
181
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
182
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
182
183
  custom: any;
183
184
  visible: boolean | undefined;
184
185
  selectable: boolean | undefined;
@@ -197,7 +198,7 @@ export declare const LineElement: import("mobx-state-tree").IModelType<{
197
198
  alwaysOnTop: boolean;
198
199
  showInExport: boolean;
199
200
  } | {
200
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
201
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
201
202
  id: string;
202
203
  type: string;
203
204
  name: string;
@@ -4,7 +4,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
4
4
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
5
5
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
6
6
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
7
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
7
+ 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]>;
8
8
  custom: import("mobx-state-tree").IType<any, any, any>;
9
9
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
10
10
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -19,7 +19,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
19
19
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
20
20
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
21
21
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
22
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
22
+ 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]>;
23
23
  custom: import("mobx-state-tree").IType<any, any, any>;
24
24
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
25
25
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -31,7 +31,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
31
31
  type: import("mobx-state-tree").IType<string | undefined, string, string>;
32
32
  name: import("mobx-state-tree").IType<string | undefined, string, string>;
33
33
  opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
34
- blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light">, [undefined]>;
34
+ 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]>;
35
35
  custom: import("mobx-state-tree").IType<any, any, any>;
36
36
  visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
37
37
  selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
@@ -43,7 +43,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
43
43
  type: string | undefined;
44
44
  name: string | undefined;
45
45
  opacity: number | undefined;
46
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
46
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
47
47
  custom: any;
48
48
  visible: boolean | undefined;
49
49
  selectable: boolean | undefined;
@@ -62,7 +62,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
62
62
  alwaysOnTop: boolean;
63
63
  showInExport: boolean;
64
64
  } | {
65
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
65
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
66
66
  id: string;
67
67
  type: string;
68
68
  name: string;
@@ -90,7 +90,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
90
90
  alwaysOnTop: boolean;
91
91
  showInExport: boolean;
92
92
  } | {
93
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
93
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
94
94
  id: string;
95
95
  type: string;
96
96
  name: string;
@@ -118,7 +118,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
118
118
  type: string | undefined;
119
119
  name: string | undefined;
120
120
  opacity: number | undefined;
121
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
121
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light" | undefined;
122
122
  custom: any;
123
123
  visible: boolean | undefined;
124
124
  selectable: boolean | undefined;
@@ -137,7 +137,7 @@ export declare const Node: import("mobx-state-tree").IModelType<{
137
137
  alwaysOnTop: boolean;
138
138
  showInExport: boolean;
139
139
  } | {
140
- blendMode: "normal" | "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light";
140
+ blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
141
141
  id: string;
142
142
  type: string;
143
143
  name: string;