polotno 3.19.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-lib.d.ts +1 -1
- 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
package/icons/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=this&&this.__rest||function(t,i){var e={};for(var o in t){Object.prototype.hasOwnProperty.call(t,o)&&i.indexOf(o)<0&&(e[o]=t[o])}if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++){i.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}}return e};import{jsx as i}from"react/jsx-runtime";import{observable as e,action as o}from"mobx";import{observer as n}from"mobx-react-lite";import{AlignCenter as a,AlignCenterHorizontal as r,AlignCenterVertical as l,AlignEndHorizontal as p,AlignEndVertical as s,AlignHorizontalSpaceAround as c,AlignJustify as m,AlignLeft as d,AlignRight as y,AlignStartHorizontal as u,AlignStartVertical as g,AlignVerticalJustifyCenter as b,AlignVerticalJustifyEnd as f,AlignVerticalJustifyStart as x,AlignVerticalSpaceAround as h,ArrowDown as v,ArrowDownLeft as
|
|
1
|
+
var t=this&&this.__rest||function(t,i){var e={};for(var o in t){Object.prototype.hasOwnProperty.call(t,o)&&i.indexOf(o)<0&&(e[o]=t[o])}if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++){i.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}}return e};import{jsx as i}from"react/jsx-runtime";import{observable as e,action as o}from"mobx";import{observer as n}from"mobx-react-lite";import{AlignCenter as a,AlignCenterHorizontal as r,AlignCenterVertical as l,AlignEndHorizontal as p,AlignEndVertical as s,AlignHorizontalSpaceAround as c,AlignJustify as m,AlignLeft as d,AlignRight as y,AlignStartHorizontal as u,AlignStartVertical as g,AlignVerticalJustifyCenter as b,AlignVerticalJustifyEnd as f,AlignVerticalJustifyStart as x,AlignVerticalSpaceAround as h,ArrowDown as v,ArrowDownLeft as P,ArrowDownRight as w,ArrowLeft as k,ArrowLeftRight as z,ArrowRight as L,ArrowUp as O,ArrowUpDown as j,ArrowUpLeft as R,ArrowUpRight as T,Ban as B,Bold as I,CaseSensitive as W,Check as F,ChevronDown as C,ChevronLeft as D,ChevronRight as G,ChevronsDown as H,ChevronsUp as M,ChevronUp as S,CloudUpload as E,Contrast as U,Copy as V,CreditCard as $,Crop as _,Edit as J,Eye as K,EyeOff as N,Files as Z,FileText as q,GripVertical as A,HelpCircle as Q,Highlighter as X,Image as Y,Italic as tt,Layers as it,LayoutTemplate as et,List as ot,ListOrdered as nt,Lock as at,MousePointer as rt,MoreHorizontal as lt,PaintBucket as pt,Palette as st,Pause as ct,Pencil as mt,Pilcrow as dt,Pipette as yt,Play as ut,Plus as gt,Redo2 as bt,Scaling as ft,Scissors as xt,Search as ht,SkipBack as vt,Settings as Pt,Shapes as wt,SlidersHorizontal as kt,Sparkles as zt,Strikethrough as Lt,TextCursorInput as Ot,Timer as jt,Trash2 as Rt,Type as Tt,Underline as Bt,Undo2 as It,Unlock as Wt,Upload as Ft,Video as Ct,Volume2 as Dt,VolumeX as Gt,WandSparkles as Ht,WrapText as Mt,X as St,ZoomIn as Et,ZoomOut as Ut}from"lucide-react";import{Instagram as Vt,Facebook as $t,Youtube as _t,Linkedin as Jt,Twitter as Kt}from"./brand-icons.js";import{NoneIcon as Nt,MoveIcon as Zt,FadeIcon as qt,ZoomIcon as At,RotateIcon as Qt,BlinkIcon as Xt,BounceIcon as Yt,BlurIcon as ti,CountIcon as ii,PopIcon as ei,RiseIcon as oi,FlipIcon as ni,GrowTurnIcon as ai,PulseIcon as ri,FloatIcon as li,ShakeIcon as pi,TypewriterIcon as si,LineRiseIcon as ci,WordRiseIcon as mi,WordFadeIcon as di,LetterPopIcon as yi,WordBlurIcon as ui,WipeIcon as gi,GlowIcon as bi,KenBurnsIcon as fi,LineWipeIcon as xi,LinePeekIcon as hi,LetterWaveIcon as vi}from"./animation-icons.js";const Pi={"action.duplicate":V,"action.split":xt,"action.rename":mt,"action.remove":Rt,"action.lock":at,"action.unlock":Wt,"action.undo":It,"action.redo":bt,"action.add":gt,"action.more":lt,"action.settings":Pt,"action.search":ht,"action.close":St,"action.confirm":F,"action.none":B,"action.visible":K,"action.hidden":N,"action.dragHandle":A,"action.eyeDropper":yt,"action.unmuted":Dt,"action.muted":Gt,"action.help":Q,"ui.chevronUp":S,"ui.chevronDown":C,"ui.chevronLeft":D,"ui.chevronRight":G,"layering.menu":it,"layering.up":S,"layering.down":C,"layering.top":M,"layering.bottom":H,"text.bold":I,"text.italic":tt,"text.underline":Bt,"text.strikethrough":Lt,"text.alignLeft":d,"text.alignCenter":a,"text.alignRight":y,"text.alignJustify":m,"text.valignTop":x,"text.valignMiddle":b,"text.valignBottom":f,"text.uppercase":W,"text.spacing":Mt,"text.bulletList":ot,"text.numberedList":nt,"text.paragraph":dt,"text.richText":Ot,"text.uploadFont":Ft,"position.alignLeft":g,"position.alignCenter":l,"position.alignRight":s,"position.alignTop":u,"position.alignMiddle":r,"position.alignBottom":p,"position.distributeVertical":h,"position.distributeHorizontal":c,"sidePanel.templates":et,"sidePanel.text":Tt,"sidePanel.photos":Y,"sidePanel.elements":wt,"sidePanel.upload":E,"sidePanel.background":pt,"sidePanel.pages":Z,"sidePanel.layers":it,"sidePanel.resize":ft,"sidePanel.draw":mt,"sidePanel.videos":Ct,"toolbar.opacity":U,"toolbar.filters":Ht,"toolbar.aiWrite":zt,"toolbar.duration":jt,"toolbar.trim":xt,"toolbar.flipHorizontal":z,"toolbar.flipVertical":j,"toolbar.zoomIn":Et,"toolbar.zoomOut":Ut,"toolbar.crop":_,"imageEdit.ai":zt,"colorPicker.reverseGradient":z,"download.export":Ft,"download.image":Y,"download.pdf":q,"download.video":Ct,"draw.select":rt,"draw.brush":J,"draw.highlighter":X,"background.colorPicker":st,"pagesTimeline.play":ut,"pagesTimeline.pause":ct,"pagesTimeline.rewind":vt,"size.instagram":Vt,"size.facebook":$t,"size.youtube":_t,"size.linkedin":Jt,"size.twitter":Kt,"size.video":Ct,"size.print":q,"size.businessCard":$,"animation.directionRight":L,"animation.directionLeft":k,"animation.directionUp":O,"animation.directionDown":v,"animation.directionBottomRight":w,"animation.directionBottomLeft":P,"animation.directionTopRight":T,"animation.directionTopLeft":R,"animation.typeMove":Zt,"animation.typeFade":qt,"animation.typeZoom":At,"animation.typeBlur":ti,"animation.typeCount":ii,"animation.typeRotate":Qt,"animation.typeBlink":Xt,"animation.typeBounce":Yt,"animation.typePop":ei,"animation.typeRise":oi,"animation.typeFlip":ni,"animation.typeGrowTurn":ai,"animation.typePulse":ri,"animation.typeFloat":li,"animation.typeShake":pi,"animation.typeTypewriter":si,"animation.typeLineRise":ci,"animation.typeWordRise":mi,"animation.typeWordFade":di,"animation.typeLetterPop":yi,"animation.typeWordBlur":ui,"animation.typeWipe":gi,"animation.typeGlow":bi,"animation.typeKenBurns":fi,"animation.typeLineWipe":xi,"animation.typeLinePeek":hi,"animation.typeLetterWave":vi,"animation.typeNone":Nt,"animation.settings":kt},wi=e.map();export const setIcons=o(t=>{for(const i of Object.keys(t)){const e=t[i];null!=e&&("function"==typeof e||"object"==typeof e?wi.set(i,e):console.warn(`polotno: setIcons('${i}') expects a React component, received ${typeof e}. Ignored.`))}});export const resetIcons=o(()=>wi.clear());export const PolotnoIcon=n(e=>{var o,{name:n}=e,a=t(e,["name"]);const r=null!==(o=wi.get(n))&&void 0!==o?o:Pi[n];return i(r,Object.assign({"data-pn-icon":""},a))});
|
|
@@ -12,9 +12,9 @@ export declare function cropFrame(snapshot: ImageSnapshot, size: Size, frame: Re
|
|
|
12
12
|
cropY: number;
|
|
13
13
|
cropWidth: number;
|
|
14
14
|
cropHeight: number;
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
15
|
width: number;
|
|
18
16
|
height: number;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
19
|
};
|
|
20
20
|
export declare const matchesAspect: (a: Size, b: Size) => boolean;
|
package/image-tools/target.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { ImageSnapshot } from './types.js';
|
|
|
4
4
|
export declare function toolError(tool: PolotnoErrorDetailsMap['TOOL_FAILED']['tool'], elementId: string, reason: PolotnoErrorDetailsMap['TOOL_FAILED']['reason'], cause?: unknown): Error & {
|
|
5
5
|
code: "TOOL_FAILED";
|
|
6
6
|
details?: {
|
|
7
|
-
reason:
|
|
8
|
-
tool:
|
|
7
|
+
reason: 'handler-failed' | 'busy' | 'canceled' | 'stale-result' | 'unsupported-target' | 'unavailable' | 'invalid-geometry' | 'invalid-result';
|
|
8
|
+
tool: 'crop' | 'expand' | 'inpaint' | 'upscale' | 'remove-background';
|
|
9
9
|
elementId: string;
|
|
10
10
|
} | undefined;
|
|
11
11
|
cause?: unknown;
|
|
@@ -21,6 +21,10 @@ export declare function targetSnapshot(element: ToolTarget, store: ToolStore): {
|
|
|
21
21
|
pageId: string | undefined;
|
|
22
22
|
ancestors: unknown[];
|
|
23
23
|
role: string;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
24
28
|
src: string;
|
|
25
29
|
rotation: number;
|
|
26
30
|
cropX: number;
|
|
@@ -30,8 +34,4 @@ export declare function targetSnapshot(element: ToolTarget, store: ToolStore): {
|
|
|
30
34
|
flipX: boolean;
|
|
31
35
|
flipY: boolean;
|
|
32
36
|
stretchEnabled: boolean;
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
width: number;
|
|
36
|
-
height: number;
|
|
37
37
|
} | null;
|
package/image-tools/target.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getRoot as e,isAlive as t}from"mobx-state-tree";import{polotnoError as r}from"@polotno/core/errors";export function toolError(e,t,o,i){return r("TOOL_FAILED",`Image tool ${e}: ${o}`,{reason:o,tool:e,elementId:t},i)}export function imageSnapshot(e){return{src:e.src,x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight,flipX:e.flipX,flipY:e.flipY,stretchEnabled:e.stretchEnabled}}export function eligible(r,o,i){var l;if(!t(r)||e(r)!==o||"viewer"===o.role||!r.page){return!1}if(!r.contentEditable||"expand"===i&&!r.resizable){return!1}if("crop"===i?!["image","svg","video"].includes(r.type)||r.maskSrc:"image"!==r.type){return!1}for(let e=r;e&&e!==r.page;e=null!==(l=e.parent)&&void 0!==l?l:null){if(!e.visible||"admin"!==o.role&&!e.selectable){return!1}}return!0}export function targetSnapshot(r,o){var i,l;if(!t(r)||e(r)!==o){return null}const n=[];for(let e=r.parent;e;e=null!==(
|
|
1
|
+
import{getRoot as e,isAlive as t}from"mobx-state-tree";import{polotnoError as r}from"@polotno/core/errors";export function toolError(e,t,o,i){return r("TOOL_FAILED",`Image tool ${e}: ${o}`,{reason:o,tool:e,elementId:t},i)}export function imageSnapshot(e){return{src:e.src,x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight,flipX:e.flipX,flipY:e.flipY,stretchEnabled:e.stretchEnabled}}export function eligible(r,o,i){var l;if(!t(r)||e(r)!==o||"viewer"===o.role||!r.page){return!1}if(!r.contentEditable||"expand"===i&&!r.resizable){return!1}if("crop"===i?!["image","svg","video"].includes(r.type)||r.maskSrc:"image"!==r.type){return!1}for(let e=r;e&&e!==r.page;e=null!==(l=e.parent)&&void 0!==l?l:null){if(!e.visible||"admin"!==o.role&&!e.selectable){return!1}}return!0}export function targetSnapshot(r,o){var i,l;if(!t(r)||e(r)!==o){return null}const n=[];for(let e=r.parent;e;e=null!==(l=e.parent)&&void 0!==l?l:null){n.push([e.id,e.selectable,e.visible])}return Object.assign(Object.assign({},imageSnapshot(r)),{selectable:r.selectable,visible:r.visible,contentEditable:r.contentEditable,resizable:r.resizable,maskSrc:r.maskSrc,pageId:null===(i=r.page)||void 0===i?void 0:i.id,ancestors:n,role:o.role})}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClassValue } from
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
3
|
export declare function clamp(value: number, min: number, max: number): number;
|
|
4
4
|
export declare function firstSliderValue(value: number | readonly number[]): number;
|
package/model/figure-model.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const FigureElement: 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<"
|
|
7
|
+
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]>;
|
|
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>;
|
|
@@ -22,7 +22,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
22
22
|
delay: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
23
23
|
duration: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
24
24
|
enabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
25
|
-
type: import("mobx-state-tree").ISimpleType<"
|
|
25
|
+
type: import("mobx-state-tree").ISimpleType<"enter" | "exit" | "loop">;
|
|
26
26
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
27
27
|
data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
|
|
28
28
|
easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -66,7 +66,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
66
66
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
67
67
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
68
68
|
opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
69
|
-
blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"
|
|
69
|
+
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]>;
|
|
70
70
|
custom: import("mobx-state-tree").IType<any, any, any>;
|
|
71
71
|
visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
72
72
|
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -78,7 +78,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
78
78
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
79
79
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
80
80
|
opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
81
|
-
blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"
|
|
81
|
+
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]>;
|
|
82
82
|
custom: import("mobx-state-tree").IType<any, any, any>;
|
|
83
83
|
visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
84
84
|
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -90,7 +90,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
90
90
|
type: string | undefined;
|
|
91
91
|
name: string | undefined;
|
|
92
92
|
opacity: number | undefined;
|
|
93
|
-
blendMode: "
|
|
93
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
|
|
94
94
|
custom: any;
|
|
95
95
|
visible: boolean | undefined;
|
|
96
96
|
selectable: boolean | undefined;
|
|
@@ -109,7 +109,6 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
109
109
|
alwaysOnTop: boolean;
|
|
110
110
|
showInExport: boolean;
|
|
111
111
|
} | {
|
|
112
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
113
112
|
id: string;
|
|
114
113
|
type: string;
|
|
115
114
|
name: string;
|
|
@@ -120,6 +119,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
120
119
|
removable: boolean;
|
|
121
120
|
alwaysOnTop: boolean;
|
|
122
121
|
showInExport: boolean;
|
|
122
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
123
123
|
}>>;
|
|
124
124
|
readonly parent: any;
|
|
125
125
|
readonly isHighlighted: boolean;
|
|
@@ -137,7 +137,6 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
137
137
|
alwaysOnTop: boolean;
|
|
138
138
|
showInExport: boolean;
|
|
139
139
|
} | {
|
|
140
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
141
140
|
id: string;
|
|
142
141
|
type: string;
|
|
143
142
|
name: string;
|
|
@@ -148,6 +147,7 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
148
147
|
removable: boolean;
|
|
149
148
|
alwaysOnTop: boolean;
|
|
150
149
|
showInExport: boolean;
|
|
150
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
151
151
|
};
|
|
152
152
|
} & {
|
|
153
153
|
clone(attrs?: any, { skipSelect }?: {
|
|
@@ -172,14 +172,14 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
172
172
|
readonly isSelected: boolean;
|
|
173
173
|
readonly isSelectedDirectly: boolean;
|
|
174
174
|
} & {
|
|
175
|
-
setAnimation(type:
|
|
175
|
+
setAnimation(type: 'enter' | 'exit' | 'loop', attrs: import("../utils/animations.js").AnimationAttrs): void;
|
|
176
176
|
setFilter(type: any, value: any): void;
|
|
177
177
|
}, import("mobx-state-tree").ModelCreationType<{
|
|
178
178
|
id: string;
|
|
179
179
|
type: string | undefined;
|
|
180
180
|
name: string | undefined;
|
|
181
181
|
opacity: number | undefined;
|
|
182
|
-
blendMode: "
|
|
182
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
|
|
183
183
|
custom: any;
|
|
184
184
|
visible: boolean | undefined;
|
|
185
185
|
selectable: boolean | undefined;
|
|
@@ -198,7 +198,6 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
198
198
|
alwaysOnTop: boolean;
|
|
199
199
|
showInExport: boolean;
|
|
200
200
|
} | {
|
|
201
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
202
201
|
id: string;
|
|
203
202
|
type: string;
|
|
204
203
|
name: string;
|
|
@@ -209,5 +208,6 @@ export declare const FigureElement: import("mobx-state-tree").IModelType<{
|
|
|
209
208
|
removable: boolean;
|
|
210
209
|
alwaysOnTop: boolean;
|
|
211
210
|
showInExport: boolean;
|
|
211
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
212
212
|
}>;
|
|
213
213
|
export type FigureElementType = Instance<typeof FigureElement>;
|
package/model/gif-model.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const GifElement: 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<"
|
|
7
|
+
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]>;
|
|
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>;
|
|
@@ -22,7 +22,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
22
22
|
delay: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
23
23
|
duration: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
24
24
|
enabled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
25
|
-
type: import("mobx-state-tree").ISimpleType<"
|
|
25
|
+
type: import("mobx-state-tree").ISimpleType<"enter" | "exit" | "loop">;
|
|
26
26
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
27
27
|
data: import("mobx-state-tree").IType<{} | null | undefined, {}, {}>;
|
|
28
28
|
easing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -79,7 +79,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
79
79
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
80
80
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
81
81
|
opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
82
|
-
blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"
|
|
82
|
+
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]>;
|
|
83
83
|
custom: import("mobx-state-tree").IType<any, any, any>;
|
|
84
84
|
visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
85
85
|
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -91,7 +91,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
91
91
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
92
92
|
name: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
93
93
|
opacity: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
94
|
-
blendMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"
|
|
94
|
+
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]>;
|
|
95
95
|
custom: import("mobx-state-tree").IType<any, any, any>;
|
|
96
96
|
visible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
97
97
|
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -103,7 +103,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
103
103
|
type: string | undefined;
|
|
104
104
|
name: string | undefined;
|
|
105
105
|
opacity: number | undefined;
|
|
106
|
-
blendMode: "
|
|
106
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
|
|
107
107
|
custom: any;
|
|
108
108
|
visible: boolean | undefined;
|
|
109
109
|
selectable: boolean | undefined;
|
|
@@ -122,7 +122,6 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
122
122
|
alwaysOnTop: boolean;
|
|
123
123
|
showInExport: boolean;
|
|
124
124
|
} | {
|
|
125
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
126
125
|
id: string;
|
|
127
126
|
type: string;
|
|
128
127
|
name: string;
|
|
@@ -133,6 +132,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
133
132
|
removable: boolean;
|
|
134
133
|
alwaysOnTop: boolean;
|
|
135
134
|
showInExport: boolean;
|
|
135
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
136
136
|
}>>;
|
|
137
137
|
readonly parent: any;
|
|
138
138
|
readonly isHighlighted: boolean;
|
|
@@ -150,7 +150,6 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
150
150
|
alwaysOnTop: boolean;
|
|
151
151
|
showInExport: boolean;
|
|
152
152
|
} | {
|
|
153
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
154
153
|
id: string;
|
|
155
154
|
type: string;
|
|
156
155
|
name: string;
|
|
@@ -161,6 +160,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
161
160
|
removable: boolean;
|
|
162
161
|
alwaysOnTop: boolean;
|
|
163
162
|
showInExport: boolean;
|
|
163
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
164
164
|
};
|
|
165
165
|
} & {
|
|
166
166
|
clone(attrs?: any, { skipSelect }?: {
|
|
@@ -185,7 +185,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
185
185
|
readonly isSelected: boolean;
|
|
186
186
|
readonly isSelectedDirectly: boolean;
|
|
187
187
|
} & {
|
|
188
|
-
setAnimation(type:
|
|
188
|
+
setAnimation(type: 'enter' | 'exit' | 'loop', attrs: import("../utils/animations.js").AnimationAttrs): void;
|
|
189
189
|
setFilter(type: any, value: any): void;
|
|
190
190
|
} & {
|
|
191
191
|
_setSourceSize(size: import("../image-tools/types.js").Size, src: string): void;
|
|
@@ -209,7 +209,7 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
209
209
|
type: string | undefined;
|
|
210
210
|
name: string | undefined;
|
|
211
211
|
opacity: number | undefined;
|
|
212
|
-
blendMode: "
|
|
212
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light" | undefined;
|
|
213
213
|
custom: any;
|
|
214
214
|
visible: boolean | undefined;
|
|
215
215
|
selectable: boolean | undefined;
|
|
@@ -228,7 +228,6 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
228
228
|
alwaysOnTop: boolean;
|
|
229
229
|
showInExport: boolean;
|
|
230
230
|
} | {
|
|
231
|
-
blendMode: "normal" | "color" | "overlay" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "saturation" | "screen" | "soft-light";
|
|
232
231
|
id: string;
|
|
233
232
|
type: string;
|
|
234
233
|
name: string;
|
|
@@ -239,5 +238,6 @@ export declare const GifElement: import("mobx-state-tree").IModelType<{
|
|
|
239
238
|
removable: boolean;
|
|
240
239
|
alwaysOnTop: boolean;
|
|
241
240
|
showInExport: boolean;
|
|
241
|
+
blendMode: "color" | "color-burn" | "color-dodge" | "darken" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "luminosity" | "multiply" | "normal" | "overlay" | "saturation" | "screen" | "soft-light";
|
|
242
242
|
}>;
|
|
243
243
|
export type GifElementType = Instance<typeof GifElement>;
|