polotno 4.12.0 → 4.13.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/README.md +57 -22
- package/blueprint/canvas/context-menu/context-menu.d.ts +2 -2
- package/blueprint/canvas/page-controls.d.ts +14 -2
- package/blueprint/canvas/tooltip.d.ts +24 -2
- package/blueprint/pages-timeline/audio-track.d.ts +12 -2
- package/blueprint/pages-timeline/audios.d.ts +10 -2
- package/blueprint/pages-timeline/current-time.d.ts +2 -2
- package/blueprint/pages-timeline/element-track.d.ts +14 -2
- package/blueprint/pages-timeline/elements.d.ts +2 -2
- package/blueprint/pages-timeline/page-preview.d.ts +8 -2
- package/blueprint/pages-timeline/pages-timeline.d.ts +8 -2
- package/blueprint/pages-timeline/pages.d.ts +8 -2
- package/blueprint/pages-timeline/play-button.d.ts +2 -2
- package/blueprint/pages-timeline/time-ruler.d.ts +10 -2
- package/blueprint/side-panel/ai-images-panel.d.ts +6 -2
- package/blueprint/side-panel/animations-panel.d.ts +6 -2
- package/blueprint/side-panel/background-panel.d.ts +6 -2
- package/blueprint/side-panel/draw-panel.d.ts +6 -2
- package/blueprint/side-panel/effects-panel.d.ts +6 -2
- package/blueprint/side-panel/image-clip-panel.d.ts +6 -2
- package/blueprint/side-panel/layers-panel.d.ts +6 -2
- package/blueprint/side-panel/pages-panel.d.ts +6 -2
- package/blueprint/side-panel/select-video.d.ts +2 -2
- package/blueprint/side-panel/side-panel.d.ts +2 -2
- package/blueprint/side-panel/size-panel.d.ts +6 -2
- package/blueprint/side-panel/templates-panel.d.ts +6 -2
- package/blueprint/side-panel/text-panel.d.ts +6 -2
- package/blueprint/side-panel/videos-panel.d.ts +6 -2
- package/blueprint/toolbar/admin-button.d.ts +6 -2
- package/blueprint/toolbar/animations-picker.d.ts +18 -4
- package/blueprint/toolbar/copy-style.d.ts +6 -2
- package/blueprint/toolbar/download-button.d.ts +6 -2
- package/blueprint/toolbar/duplicate-button.d.ts +6 -2
- package/blueprint/toolbar/figure-toolbar.d.ts +8 -8
- package/blueprint/toolbar/filters-picker.d.ts +26 -6
- package/blueprint/toolbar/gif-toolbar.d.ts +2 -2
- package/blueprint/toolbar/group-button.d.ts +6 -2
- package/blueprint/toolbar/group-toolbar.d.ts +2 -2
- package/blueprint/toolbar/history-buttons.d.ts +6 -2
- package/blueprint/toolbar/html-toolbar.d.ts +10 -10
- package/blueprint/toolbar/image-remove-background-button.d.ts +10 -2
- package/blueprint/toolbar/image-toolbar.d.ts +28 -8
- package/blueprint/toolbar/line-toolbar.d.ts +14 -10
- package/blueprint/toolbar/lock-button.d.ts +6 -2
- package/blueprint/toolbar/many-toolbar.d.ts +2 -2
- package/blueprint/toolbar/opacity-picker.d.ts +6 -2
- package/blueprint/toolbar/page-toolbar.d.ts +2 -2
- package/blueprint/toolbar/position-picker.d.ts +6 -2
- package/blueprint/toolbar/remove-button.d.ts +6 -2
- package/blueprint/toolbar/svg-toolbar.d.ts +2 -2
- package/blueprint/toolbar/table-toolbar.d.ts +44 -14
- package/blueprint/toolbar/text-ai-write.d.ts +6 -2
- package/blueprint/toolbar/text-toolbar.d.ts +14 -14
- package/blueprint/toolbar/toolbar.d.ts +2 -2
- package/blueprint/toolbar/video-toolbar.d.ts +6 -6
- package/blueprint/toolbar/zoom-buttons.d.ts +4 -4
- package/canvas/audio.d.ts +3 -2
- package/canvas/context-menu/context-menu.d.ts +2 -2
- package/canvas/drawing-layer.d.ts +2 -2
- package/canvas/element.d.ts +2 -2
- package/canvas/fade-overlay.d.ts +14 -0
- package/canvas/fade-overlay.js +1 -0
- package/canvas/figure-element.d.ts +2 -2
- package/canvas/gif-element.d.ts +2 -2
- package/canvas/gif-element.js +1 -1
- package/canvas/highlighter.d.ts +6 -2
- package/canvas/html-element.d.ts +2 -2
- package/canvas/image-element.d.ts +5 -3
- package/canvas/image-element.js +1 -1
- package/canvas/line-element.d.ts +2 -2
- package/canvas/page-controls.d.ts +14 -2
- package/canvas/page.d.ts +2 -2
- package/canvas/page.js +1 -1
- package/canvas/render-tag-element.d.ts +2 -2
- package/canvas/render-tag-element.js +1 -1
- package/canvas/rich-editor.js +3 -3
- package/canvas/rules.d.ts +2 -2
- package/canvas/table-element.d.ts +2 -2
- package/canvas/text-element.d.ts +2 -2
- package/canvas/tooltip.d.ts +24 -2
- package/canvas/video-element.d.ts +3 -2
- package/canvas/video-element.js +1 -1
- package/canvas/workspace-canvas.d.ts +2 -2
- package/hooks/use-fade-stop-focus.d.ts +2 -0
- package/hooks/use-fade-stop-focus.js +1 -0
- package/icons/registry.d.ts +106 -102
- package/model/figure-model.d.ts +1 -1
- package/model/gif-model.d.ts +1 -1
- package/model/group-model.d.ts +8 -8
- package/model/image-model.d.ts +1 -1
- package/model/line-model.d.ts +1 -1
- package/model/page-model.d.ts +10 -10
- package/model/shape-model.d.ts +2 -2
- package/model/shape-model.js +1 -1
- package/model/store.d.ts +92 -92
- package/model/svg-model.d.ts +1 -1
- package/model/table-model.d.ts +1 -1
- package/model/text-model.d.ts +1 -1
- package/model/video-model.d.ts +1 -1
- package/package.json +52 -38
- package/pages-timeline/audio-track.d.ts +14 -2
- package/pages-timeline/audio-track.js +1 -1
- package/pages-timeline/audios.d.ts +10 -2
- package/pages-timeline/current-time.d.ts +2 -2
- package/pages-timeline/current-time.js +1 -1
- package/pages-timeline/element-track.d.ts +14 -2
- package/pages-timeline/element-track.js +1 -1
- package/pages-timeline/elements.d.ts +2 -2
- package/pages-timeline/page-preview.d.ts +8 -2
- package/pages-timeline/page-preview.js +1 -1
- package/pages-timeline/pages-timeline.d.ts +8 -2
- package/pages-timeline/pages-timeline.js +1 -1
- package/pages-timeline/pages.d.ts +8 -2
- package/pages-timeline/play-button.d.ts +2 -2
- package/pages-timeline/time-ruler.d.ts +10 -2
- package/pages-timeline/time-ruler.js +1 -1
- package/polotno.bundle.js +167 -166
- package/side-panel/ai-images-panel.d.ts +6 -2
- package/side-panel/animations-panel.d.ts +6 -2
- package/side-panel/background-panel.d.ts +6 -2
- package/side-panel/draw-panel.d.ts +6 -2
- package/side-panel/effects-panel.d.ts +6 -2
- package/side-panel/effects-panel.js +1 -1
- package/side-panel/image-clip-panel.d.ts +6 -2
- package/side-panel/layers-panel.d.ts +6 -2
- package/side-panel/pages-panel.d.ts +6 -2
- package/side-panel/select-video.d.ts +2 -2
- package/side-panel/side-panel.d.ts +2 -2
- package/side-panel/size-panel.d.ts +6 -2
- package/side-panel/templates-panel.d.ts +6 -2
- package/side-panel/text-panel.d.ts +6 -2
- package/side-panel/videos-panel.d.ts +6 -2
- package/toolbar/admin-button.d.ts +6 -2
- package/toolbar/animations-picker.d.ts +18 -4
- package/toolbar/copy-style.d.ts +6 -2
- package/toolbar/download-button.d.ts +6 -2
- package/toolbar/duplicate-button.d.ts +6 -2
- package/toolbar/figure-toolbar.d.ts +8 -8
- package/toolbar/filters-picker.d.ts +26 -6
- package/toolbar/gif-toolbar.d.ts +2 -2
- package/toolbar/group-button.d.ts +6 -2
- package/toolbar/group-toolbar.d.ts +2 -2
- package/toolbar/history-buttons.d.ts +6 -2
- package/toolbar/html-toolbar.d.ts +10 -10
- package/toolbar/image-remove-background-button.d.ts +10 -2
- package/toolbar/image-toolbar.d.ts +32 -10
- package/toolbar/line-toolbar.d.ts +14 -10
- package/toolbar/lock-button.d.ts +6 -2
- package/toolbar/many-toolbar.d.ts +2 -2
- package/toolbar/opacity-picker.d.ts +6 -2
- package/toolbar/page-toolbar.d.ts +2 -2
- package/toolbar/position-picker.d.ts +6 -2
- package/toolbar/remove-button.d.ts +6 -2
- package/toolbar/svg-toolbar.d.ts +2 -2
- package/toolbar/table-toolbar.d.ts +44 -14
- package/toolbar/text-ai-write.d.ts +6 -2
- package/toolbar/text-toolbar.d.ts +30 -18
- package/toolbar/toolbar.d.ts +2 -2
- package/toolbar/video-toolbar.d.ts +12 -6
- package/toolbar/video-toolbar.js +1 -1
- package/toolbar/zoom-buttons.d.ts +4 -4
- package/ui.css +1 -1
- package/utils/clip-fade.d.ts +6 -0
- package/utils/clip-fade.js +1 -0
- package/utils/clipboard.d.ts +2 -2
- package/utils/fade-gradient.d.ts +33 -0
- package/utils/fade-gradient.js +1 -0
- package/utils/fade-overlay.d.ts +9 -0
- package/utils/fade-overlay.js +1 -0
- package/utils/l10n.d.ts +19 -0
- package/utils/l10n.js +1 -1
- package/utils/pointer-drag.d.ts +6 -4
- package/utils/pointer-drag.js +1 -1
- package/utils/rich-text-html.d.ts +0 -10
- package/utils/rich-text-html.js +1 -1
- package/utils/validate-key.js +1 -1
package/toolbar/lock-button.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { StoreType } from '../model/store.js';
|
|
2
2
|
export declare const LockButton: (({ store }: {
|
|
3
3
|
store: StoreType;
|
|
4
|
-
}) => import("react").JSX.Element) & {
|
|
5
|
-
|
|
4
|
+
}) => import("react").JSX.Element) & import("react").NamedExoticComponent<{
|
|
5
|
+
store: StoreType;
|
|
6
|
+
}> & {
|
|
7
|
+
readonly type: ({ store }: {
|
|
8
|
+
store: StoreType;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
6
10
|
};
|
|
@@ -4,7 +4,7 @@ type Props = {
|
|
|
4
4
|
store: StoreType;
|
|
5
5
|
components?: any;
|
|
6
6
|
};
|
|
7
|
-
export declare const ManyToolbar: (({ store, components }: Props) => React.JSX.Element) & {
|
|
8
|
-
|
|
7
|
+
export declare const ManyToolbar: (({ store, components }: Props) => React.JSX.Element) & React.NamedExoticComponent<Props> & {
|
|
8
|
+
readonly type: ({ store, components }: Props) => React.JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
export default ManyToolbar;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { StoreType } from '../ui-types.js';
|
|
2
2
|
export declare const OpacityPicker: (({ store }: {
|
|
3
3
|
store: StoreType;
|
|
4
|
-
}) => import("react").JSX.Element) & {
|
|
5
|
-
|
|
4
|
+
}) => import("react").JSX.Element) & import("react").NamedExoticComponent<{
|
|
5
|
+
store: StoreType;
|
|
6
|
+
}> & {
|
|
7
|
+
readonly type: ({ store }: {
|
|
8
|
+
store: StoreType;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
6
10
|
};
|
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
store: StoreType;
|
|
6
6
|
components?: any;
|
|
7
7
|
};
|
|
8
|
-
export declare const PageToolbar: (({ store, components }: Props) => React.JSX.Element) & {
|
|
9
|
-
|
|
8
|
+
export declare const PageToolbar: (({ store, components }: Props) => React.JSX.Element) & React.NamedExoticComponent<Props> & {
|
|
9
|
+
readonly type: ({ store, components }: Props) => React.JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export default PageToolbar;
|
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { StoreType } from '../ui-types.js';
|
|
3
3
|
export declare const PositionPicker: (({ store }: {
|
|
4
4
|
store: StoreType;
|
|
5
|
-
}) => React.JSX.Element) & {
|
|
6
|
-
|
|
5
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
6
|
+
store: StoreType;
|
|
7
|
+
}> & {
|
|
8
|
+
readonly type: ({ store }: {
|
|
9
|
+
store: StoreType;
|
|
10
|
+
}) => React.JSX.Element;
|
|
7
11
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { StoreType } from '../model/store.js';
|
|
2
2
|
export declare const RemoveButton: (({ store }: {
|
|
3
3
|
store: StoreType;
|
|
4
|
-
}) => import("react").JSX.Element) & {
|
|
5
|
-
|
|
4
|
+
}) => import("react").JSX.Element) & import("react").NamedExoticComponent<{
|
|
5
|
+
store: StoreType;
|
|
6
|
+
}> & {
|
|
7
|
+
readonly type: ({ store }: {
|
|
8
|
+
store: StoreType;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
6
10
|
};
|
package/toolbar/svg-toolbar.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
hideSvgEffects?: boolean;
|
|
6
6
|
components?: any;
|
|
7
7
|
};
|
|
8
|
-
export declare const SvgToolbar: (({ store, hideSvgEffects, components }: Props) => React.JSX.Element) & {
|
|
9
|
-
|
|
8
|
+
export declare const SvgToolbar: (({ store, hideSvgEffects, components }: Props) => React.JSX.Element) & React.NamedExoticComponent<Props> & {
|
|
9
|
+
readonly type: ({ store, hideSvgEffects, components }: Props) => React.JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export default SvgToolbar;
|
|
@@ -13,37 +13,67 @@ type ButtonProps = {
|
|
|
13
13
|
export declare const TableBorderSettings: (({ elements, store }: {
|
|
14
14
|
elements: any[];
|
|
15
15
|
store: StoreType;
|
|
16
|
-
}) => React.JSX.Element) & {
|
|
17
|
-
|
|
16
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
17
|
+
elements: any[];
|
|
18
|
+
store: StoreType;
|
|
19
|
+
}> & {
|
|
20
|
+
readonly type: ({ elements, store }: {
|
|
21
|
+
elements: any[];
|
|
22
|
+
store: StoreType;
|
|
23
|
+
}) => React.JSX.Element;
|
|
18
24
|
};
|
|
19
25
|
export declare const TableStructureMenu: (({ element, store }: {
|
|
20
26
|
element: TableElementType;
|
|
21
27
|
store: StoreType;
|
|
22
|
-
}) => React.JSX.Element) & {
|
|
23
|
-
|
|
28
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
29
|
+
element: TableElementType;
|
|
30
|
+
store: StoreType;
|
|
31
|
+
}> & {
|
|
32
|
+
readonly type: ({ element, store }: {
|
|
33
|
+
element: TableElementType;
|
|
34
|
+
store: StoreType;
|
|
35
|
+
}) => React.JSX.Element;
|
|
24
36
|
};
|
|
25
|
-
export declare const TableStructure: (({ elements, store }: ButtonProps) => React.JSX.Element) & {
|
|
26
|
-
|
|
37
|
+
export declare const TableStructure: (({ elements, store }: ButtonProps) => React.JSX.Element) & React.NamedExoticComponent<ButtonProps> & {
|
|
38
|
+
readonly type: ({ elements, store }: ButtonProps) => React.JSX.Element;
|
|
27
39
|
};
|
|
28
40
|
export declare const CellPadding: (({ elements, store }: {
|
|
29
41
|
elements: any[];
|
|
30
42
|
store: StoreType;
|
|
31
|
-
}) => React.JSX.Element) & {
|
|
32
|
-
|
|
43
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
44
|
+
elements: any[];
|
|
45
|
+
store: StoreType;
|
|
46
|
+
}> & {
|
|
47
|
+
readonly type: ({ elements, store }: {
|
|
48
|
+
elements: any[];
|
|
49
|
+
store: StoreType;
|
|
50
|
+
}) => React.JSX.Element;
|
|
33
51
|
};
|
|
34
52
|
export declare const CellBackground: (({ elements, store }: {
|
|
35
53
|
elements: any[];
|
|
36
54
|
store: StoreType;
|
|
37
|
-
}) => React.JSX.Element) & {
|
|
38
|
-
|
|
55
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
56
|
+
elements: any[];
|
|
57
|
+
store: StoreType;
|
|
58
|
+
}> & {
|
|
59
|
+
readonly type: ({ elements, store }: {
|
|
60
|
+
elements: any[];
|
|
61
|
+
store: StoreType;
|
|
62
|
+
}) => React.JSX.Element;
|
|
39
63
|
};
|
|
40
64
|
export declare const CellVerticalAlign: (({ elements, store }: {
|
|
41
65
|
elements: any[];
|
|
42
66
|
store: StoreType;
|
|
43
|
-
}) => React.JSX.Element) & {
|
|
44
|
-
|
|
67
|
+
}) => React.JSX.Element) & React.NamedExoticComponent<{
|
|
68
|
+
elements: any[];
|
|
69
|
+
store: StoreType;
|
|
70
|
+
}> & {
|
|
71
|
+
readonly type: ({ elements, store }: {
|
|
72
|
+
elements: any[];
|
|
73
|
+
store: StoreType;
|
|
74
|
+
}) => React.JSX.Element;
|
|
45
75
|
};
|
|
46
|
-
export declare const TableToolbar: (({ store, components }: Props) => React.JSX.Element) & {
|
|
47
|
-
|
|
76
|
+
export declare const TableToolbar: (({ store, components }: Props) => React.JSX.Element) & React.NamedExoticComponent<Props> & {
|
|
77
|
+
readonly type: ({ store, components }: Props) => React.JSX.Element;
|
|
48
78
|
};
|
|
49
79
|
export default TableToolbar;
|
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { StoreType } from '../ui-types.js';
|
|
3
3
|
export declare const TextAiWrite: (({ store }: {
|
|
4
4
|
store: StoreType;
|
|
5
|
-
}) => React.JSX.Element | null) & {
|
|
6
|
-
|
|
5
|
+
}) => React.JSX.Element | null) & React.NamedExoticComponent<{
|
|
6
|
+
store: StoreType;
|
|
7
|
+
}> & {
|
|
8
|
+
readonly type: ({ store }: {
|
|
9
|
+
store: StoreType;
|
|
10
|
+
}) => React.JSX.Element | null;
|
|
7
11
|
};
|
|
@@ -21,40 +21,52 @@ export declare const FontMenu: ({ store, fonts, activeFont, activeFontLabel, onF
|
|
|
21
21
|
onOpenChange: (open: boolean) => void;
|
|
22
22
|
}) => React.JSX.Element;
|
|
23
23
|
export declare const fetcher: (url: string) => Promise<any>;
|
|
24
|
-
export declare const TextFontFamily: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
25
|
-
|
|
24
|
+
export declare const TextFontFamily: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
25
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
26
26
|
};
|
|
27
|
-
export declare const TextFontSize: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
28
|
-
|
|
27
|
+
export declare const TextFontSize: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
28
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
29
29
|
};
|
|
30
30
|
export declare const ALIGN_OPTIONS: string[];
|
|
31
31
|
export declare const VERTICAL_ALIGN_OPTIONS: string[];
|
|
32
32
|
export declare const VERTICAL_ALIGN_ICONS: Record<string, React.ReactNode>;
|
|
33
|
-
export declare const TextFontVariant: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
34
|
-
|
|
33
|
+
export declare const TextFontVariant: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
34
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
35
35
|
};
|
|
36
|
-
export declare const TextTransform: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
37
|
-
|
|
36
|
+
export declare const TextTransform: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
37
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
38
38
|
};
|
|
39
|
-
export declare const TextFill: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
40
|
-
|
|
39
|
+
export declare const TextFill: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
40
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
41
41
|
};
|
|
42
|
-
export declare const TextSpacing: (({ elements, store }: InputProps) => React.JSX.Element) & {
|
|
43
|
-
|
|
42
|
+
export declare const TextSpacing: (({ elements, store }: InputProps) => React.JSX.Element) & React.NamedExoticComponent<InputProps> & {
|
|
43
|
+
readonly type: ({ elements, store }: InputProps) => React.JSX.Element;
|
|
44
44
|
};
|
|
45
45
|
export declare const TextFilters: (({ element, store }: {
|
|
46
46
|
element: import("../ui-types.js").ShapeType;
|
|
47
47
|
store: StoreType;
|
|
48
|
-
}) => React.JSX.Element | null) & {
|
|
49
|
-
|
|
48
|
+
}) => React.JSX.Element | null) & React.NamedExoticComponent<{
|
|
49
|
+
element: import("../ui-types.js").ShapeType;
|
|
50
|
+
store: StoreType;
|
|
51
|
+
}> & {
|
|
52
|
+
readonly type: ({ element, store }: {
|
|
53
|
+
element: import("../ui-types.js").ShapeType;
|
|
54
|
+
store: StoreType;
|
|
55
|
+
}) => React.JSX.Element | null;
|
|
50
56
|
};
|
|
51
57
|
export declare const TextAnimations: (({ element, store }: {
|
|
52
58
|
element: import("../ui-types.js").ShapeType;
|
|
53
59
|
store: StoreType;
|
|
54
|
-
}) => React.JSX.Element | null) & {
|
|
55
|
-
|
|
60
|
+
}) => React.JSX.Element | null) & React.NamedExoticComponent<{
|
|
61
|
+
element: import("../ui-types.js").ShapeType;
|
|
62
|
+
store: StoreType;
|
|
63
|
+
}> & {
|
|
64
|
+
readonly type: ({ element, store }: {
|
|
65
|
+
element: import("../ui-types.js").ShapeType;
|
|
66
|
+
store: StoreType;
|
|
67
|
+
}) => React.JSX.Element | null;
|
|
56
68
|
};
|
|
57
|
-
export declare const TextToolbar: (({ store, components }: PageProps) => React.JSX.Element) & {
|
|
58
|
-
|
|
69
|
+
export declare const TextToolbar: (({ store, components }: PageProps) => React.JSX.Element) & React.NamedExoticComponent<PageProps> & {
|
|
70
|
+
readonly type: ({ store, components }: PageProps) => React.JSX.Element;
|
|
59
71
|
};
|
|
60
72
|
export default TextToolbar;
|
package/toolbar/toolbar.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ type ToolbarComp = React.ComponentType<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare function registerToolbarComponent(type: string, reactComponent: ToolbarComp): void;
|
|
14
14
|
export { useToolbarCondensed };
|
|
15
|
-
export declare const Toolbar: (({ store, downloadButtonEnabled, components }: ToolbarProps) => React.JSX.Element) & {
|
|
16
|
-
|
|
15
|
+
export declare const Toolbar: (({ store, downloadButtonEnabled, components }: ToolbarProps) => React.JSX.Element) & React.NamedExoticComponent<ToolbarProps> & {
|
|
16
|
+
readonly type: ({ store, downloadButtonEnabled, components }: ToolbarProps) => React.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
export default Toolbar;
|
|
@@ -3,15 +3,21 @@ import type { StoreType, VideoElementType } from '../ui-types.js';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
store: StoreType;
|
|
5
5
|
components?: any;
|
|
6
|
+
};
|
|
7
|
+
type ElementProps = Props & {
|
|
6
8
|
element: VideoElementType;
|
|
7
9
|
};
|
|
8
|
-
export declare const VideoTrim: (({ element }:
|
|
9
|
-
|
|
10
|
+
export declare const VideoTrim: (({ element }: ElementProps) => React.JSX.Element) & React.NamedExoticComponent<Props & {
|
|
11
|
+
element: VideoElementType;
|
|
12
|
+
}> & {
|
|
13
|
+
readonly type: ({ element }: ElementProps) => React.JSX.Element;
|
|
10
14
|
};
|
|
11
|
-
export declare const VideoClip: (({ element, store }:
|
|
12
|
-
|
|
15
|
+
export declare const VideoClip: (({ element, store }: ElementProps) => React.JSX.Element | null) & React.NamedExoticComponent<Props & {
|
|
16
|
+
element: VideoElementType;
|
|
17
|
+
}> & {
|
|
18
|
+
readonly type: ({ element, store }: ElementProps) => React.JSX.Element | null;
|
|
13
19
|
};
|
|
14
|
-
export declare const VideoToolbar: (({ store, components }: Props) => React.JSX.Element) & {
|
|
15
|
-
|
|
20
|
+
export declare const VideoToolbar: (({ store, components }: Props) => React.JSX.Element) & React.NamedExoticComponent<Props> & {
|
|
21
|
+
readonly type: ({ store, components }: Props) => React.JSX.Element;
|
|
16
22
|
};
|
|
17
23
|
export default VideoToolbar;
|
package/toolbar/video-toolbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import{observer as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import{observer as o}from"mobx-react-lite";import{ElementContainer as r,extendToolbar as n}from"./element-container.js";import{Button as s}from"../primitives/button.js";import{clamp as a,firstSliderValue as l}from"../lib/utils.js";import{NumericInput as d}from"../primitives/numeric-input.js";import{SpeedControl as p}from"../primitives/speed-control.js";import{Slider as m}from"../primitives/slider.js";import{Popover as c,PopoverContent as h,PopoverTrigger as u}from"../primitives/popover.js";import{Tooltip as g,TooltipContent as f,TooltipTrigger as v}from"../primitives/tooltip.js";import{AnimationsPicker as x}from"./animations-picker.js";import{flags as b}from"../utils/flags.js";import{getVideoDuration as w,getVideoObjectPreview as y,getVideoSize as j}from"@polotno/core/video";import{t as V}from"../utils/l10n.js";import{DRAG_SLOP_PX as T,isPrimaryDrag as C,usePointerDrag as z}from"../utils/pointer-drag.js";import{PolotnoIcon as E}from"../icons/registry.js";export const VideoTrim=o(({element:o})=>{const r=i.useRef(null),[n,l]=i.useState([]),d=z();i.useEffect(()=>{l([])},[o.src]);const p=async()=>{if(!o.src){return}if(n.length){return}const{width:e,height:t}=await j(o.src);if(!r.current){return}const i=e/t,{src:s}=o,a=r.current.offsetHeight,d=r.current.offsetWidth,p=a*i,m=Math.ceil(d/p),c=await w(s),h=document.createElement("video");h.crossOrigin="anonymous",h.src=s;const u=document.createElement("canvas");u.width=480;try{await new Promise((e,t)=>{h.addEventListener("loadeddata",()=>{const t=h.videoWidth/h.videoHeight;u.height=480/t,e()}),h.addEventListener("error",t)}),l([]);for(let e=0;e<m;e++){const t=e*c/m,i=await y(h,u,t);l(e=>e.concat(i))}}catch(g){console.error("Error generating previews:",g)}},m=t=>e("div",{className:"polotno-video-trim-handle pn:w-[10px] pn:touch-pan-y pn:pointer-coarse:w-5",style:Object.assign(Object.assign({position:"absolute",top:"0"},"start"===t?{left:100*o.startTime+"%"}:{right:100-100*o.endTime+"%"}),{height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"}),onPointerDown:e=>((e,t)=>{if(!C(e)){return}const i=e.clientX,{width:n}=r.current.getBoundingClientRect(),s=o.startTime,l=o.endTime;d(e,{slopX:T,node:o,onMove:e=>{const r=(e.clientX-i)/n;"start"===t?o.set({startTime:a(s+r,0,l)}):o.set({endTime:a(l+r,s,1)})}})})(e,t)});return t(c,{onOpenChange:e=>{e&&setTimeout(p,0)},children:[e(u,{render:t(s,{variant:"ghost",size:"sm",children:[e(E,{name:"toolbar.trim",className:"pn:size-4"}),"Trim"]})}),e(h,{align:"start",className:"pn:p-3",style:{width:"600px"},children:t("div",{className:"pn:flex pn:items-center",children:[e("div",{className:"pn:flex pn:h-[30px] pn:items-center pn:rounded-md pn:border pn:border-input pn:px-3 pn:text-sm pn:tabular-nums",children:(o.duration*(o.endTime-o.startTime)/1e3).toFixed(2)}),e("span",{className:"pn:ml-1 pn:text-xs pn:text-muted-foreground",children:V("toolbar.seconds")}),t("div",{style:{flex:1,height:"30px",display:"flex",position:"relative",overflow:"hidden",marginLeft:"10px",borderRadius:"4px"},ref:r,children:[n.map((t,i)=>e("img",{src:t,style:{width:"auto",height:"100%",objectFit:"cover"}},i)),e("div",{style:{position:"absolute",top:"0",left:0,width:100*o.startTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),e("div",{style:{position:"absolute",top:"0",right:"0%",width:100-100*o.endTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),m("start"),m("end")]})]})})]})});const N=o(({element:i})=>{const o=Math.round(100*i.volume),r=e=>{i.set({volume:e/100})};return t(c,{children:[t(g,{children:[e(v,{render:e(u,{render:e(s,{variant:"ghost",size:"icon-sm","aria-label":V("toolbar.volume"),children:e(E,{name:"action.unmuted",className:"pn:size-4"})})})}),e(f,{children:V("toolbar.volume")})]}),e(h,{style:{padding:"10px",width:"250px"},align:"start",children:t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:e(m,{value:[o],onValueChange:e=>{r(l(e))},min:0,max:100,step:1})}),e(d,{value:o,onValueChange:e=>{r(a(e,0,100))},style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:0,max:100})]})})]})}),S=o(({element:i})=>t(c,{children:[t(g,{children:[e(v,{render:e(u,{render:t(s,{variant:"ghost",size:"sm","aria-label":V("toolbar.speed"),children:[e(E,{name:"toolbar.duration",className:"pn:size-4"}),i.speed,"×"]})})}),e(f,{children:V("toolbar.speed")})]}),t(h,{style:{padding:"10px",width:"250px"},align:"start",children:[e("div",{style:{fontSize:"12px",marginBottom:"8px"},children:V("toolbar.speed")}),e(p,{value:i.speed,onChange:e=>i.set({speed:e})})]})]}));export const VideoClip=o(({element:t,store:i})=>t.contentEditable?t.clipSrc?e(s,{variant:"ghost",size:"sm",onClickCapture:()=>{t.set({clipSrc:""})},children:V("toolbar.removeClip")}):e(s,{variant:"ghost",size:"sm",onClickCapture:e=>{e.stopPropagation(),i.openSidePanel("image-clip")},children:V("toolbar.clip")}):null);const k={VideoTrim,VideoAnimations:x,VideoVolume:N,VideoSpeed:S,VideoClip};export const VideoToolbar=o(({store:t,components:i})=>{const o=t.selectedElements,s=["VideoTrim","VideoVolume","VideoSpeed","VideoClip",b.animationsEnabled&&"VideoAnimations"],a=n({type:"video",usedItems:s,components:i});return e(r,{items:a,itemRender:r=>{const n=i[r]||k[r];return e(n,{elements:o,element:o[0],store:t},r)}})});export default VideoToolbar;
|
|
@@ -2,10 +2,10 @@ import type { StoreType } from '../ui-types.js';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
store: StoreType;
|
|
4
4
|
};
|
|
5
|
-
export declare const ZoomGroup: (({ store }: Props) => import("react").JSX.Element) & {
|
|
6
|
-
|
|
5
|
+
export declare const ZoomGroup: (({ store }: Props) => import("react").JSX.Element) & import("react").NamedExoticComponent<Props> & {
|
|
6
|
+
readonly type: ({ store }: Props) => import("react").JSX.Element;
|
|
7
7
|
};
|
|
8
|
-
export declare const ZoomButtons: (({ store }: Props) => import("react").JSX.Element) & {
|
|
9
|
-
|
|
8
|
+
export declare const ZoomButtons: (({ store }: Props) => import("react").JSX.Element) & import("react").NamedExoticComponent<Props> & {
|
|
9
|
+
readonly type: ({ store }: Props) => import("react").JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export default ZoomButtons;
|