@pixerate/editor-react 0.94.0 → 0.96.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 +3 -1
- package/dist/animation-editor/index.cjs +1240 -195
- package/dist/animation-editor/index.js +4 -2
- package/dist/canvas/index.cjs +1419 -372
- package/dist/canvas/index.js +9 -4
- package/dist/canvas/useMermaidDiagram.d.cts +7 -1
- package/dist/canvas/useMermaidDiagram.d.ts +7 -1
- package/dist/chunk-3I7FOSLF.js +988 -0
- package/dist/{chunk-OTGJEYHV.js → chunk-5LFQ2UQZ.js} +75 -68
- package/dist/{chunk-5R67YSSD.js → chunk-GLSOQNQR.js} +1 -1
- package/dist/{chunk-6YRSQW2V.js → chunk-IY6YOY5B.js} +1 -1
- package/dist/chunk-KIRIU53A.js +72 -0
- package/dist/{chunk-NNM633RN.js → chunk-R7MEGRPV.js} +23 -0
- package/dist/color/ColorPicker.d.cts +30 -0
- package/dist/color/ColorPicker.d.ts +30 -0
- package/dist/color/DualColorPicker.d.cts +29 -0
- package/dist/color/DualColorPicker.d.ts +29 -0
- package/dist/color/index.cjs +1067 -0
- package/dist/color/index.d.cts +7 -0
- package/dist/color/index.d.ts +7 -0
- package/dist/color/index.js +14 -0
- package/dist/color/useColorScheme.d.cts +16 -0
- package/dist/color/useColorScheme.d.ts +16 -0
- package/dist/effects/index.cjs +1169 -124
- package/dist/effects/index.js +4 -2
- package/dist/gradient/FillPicker.d.cts +27 -0
- package/dist/gradient/FillPicker.d.ts +27 -0
- package/dist/gradient/GradientEditor.d.cts +21 -0
- package/dist/gradient/GradientEditor.d.ts +21 -0
- package/dist/gradient/index.cjs +1601 -0
- package/dist/gradient/index.d.cts +6 -0
- package/dist/gradient/index.d.ts +6 -0
- package/dist/gradient/index.js +617 -0
- package/dist/gradient/useGradientController.d.cts +10 -0
- package/dist/gradient/useGradientController.d.ts +10 -0
- package/dist/image-editor/index.cjs +1742 -697
- package/dist/image-editor/index.js +5 -3
- package/dist/index.cjs +2181 -1115
- package/dist/index.js +9 -5
- package/dist/paint-editor/index.cjs +1233 -188
- package/dist/paint-editor/index.js +4 -2
- package/dist/parameters/fields.d.cts +1 -1
- package/dist/parameters/fields.d.ts +1 -1
- package/dist/parameters/index.cjs +1218 -173
- package/dist/parameters/index.js +3 -1
- package/dist/persistence/index.cjs +25 -4
- package/dist/persistence/index.d.cts +1 -0
- package/dist/persistence/index.d.ts +1 -0
- package/dist/persistence/index.js +5 -3
- package/dist/persistence/useEditorAutosave.d.cts +17 -0
- package/dist/persistence/useEditorAutosave.d.ts +17 -0
- package/dist/vector/index.cjs +1219 -174
- package/dist/vector/index.js +4 -2
- package/dist/video-editor/index.cjs +1230 -185
- package/dist/video-editor/index.js +4 -2
- package/package.json +29 -3
package/dist/canvas/index.js
CHANGED
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
EffectParameters,
|
|
3
3
|
EffectsBrowser,
|
|
4
4
|
useEffectDescription
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-GLSOQNQR.js";
|
|
6
|
+
import "../chunk-5LFQ2UQZ.js";
|
|
7
|
+
import "../chunk-KIRIU53A.js";
|
|
8
|
+
import "../chunk-3I7FOSLF.js";
|
|
7
9
|
import {
|
|
8
10
|
PresenceLayer,
|
|
9
11
|
usePlaybackSurface
|
|
@@ -2997,7 +2999,8 @@ function MermaidFamilyScene({
|
|
|
2997
2999
|
// src/canvas/useMermaidDiagram.ts
|
|
2998
3000
|
import { useEffect as useEffect12, useMemo as useMemo12, useRef as useRef18, useState as useState10, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
2999
3001
|
import {
|
|
3000
|
-
DiagramController
|
|
3002
|
+
DiagramController,
|
|
3003
|
+
createDiagramEditorDocument
|
|
3001
3004
|
} from "@pixerate/editor/diagram";
|
|
3002
3005
|
import {
|
|
3003
3006
|
CSS_VARIABLE_DIAGRAM_SCENE_THEME,
|
|
@@ -3023,6 +3026,8 @@ function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
|
3023
3026
|
const layoutOptions = (controllerOrOptions instanceof DiagramController ? void 0 : controllerOrOptions.layoutOptions) ?? view.layoutOptions;
|
|
3024
3027
|
const sceneTheme = (controllerOrOptions instanceof DiagramController ? void 0 : controllerOrOptions.sceneTheme) ?? view.sceneTheme;
|
|
3025
3028
|
const state = useDiagramState(controller);
|
|
3029
|
+
const editorDocument = useMemo12(() => createDiagramEditorDocument(controller), [controller]);
|
|
3030
|
+
useEffect12(() => () => editorDocument.destroy(), [editorDocument]);
|
|
3026
3031
|
const canvas = useMemo12(
|
|
3027
3032
|
() => mermaidToCanvas(state.document, { ...layoutOptions, editable: state.editable }),
|
|
3028
3033
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -3068,7 +3073,7 @@ function useMermaidDiagram(controllerOrOptions = {}, view = {}) {
|
|
|
3068
3073
|
}),
|
|
3069
3074
|
[controller]
|
|
3070
3075
|
);
|
|
3071
|
-
return { controller, state, document: state.document, source: state.source, ...canvas, scene, ...actions };
|
|
3076
|
+
return { controller, editorDocument, state, document: state.document, source: state.source, ...canvas, scene, ...actions };
|
|
3072
3077
|
}
|
|
3073
3078
|
function useMermaidStream(source, options = {}) {
|
|
3074
3079
|
const { complete = false, duration = 300, ...layoutOptions } = options;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DiagramController, type DiagramActionResult, type DiagramControllerOptions, type DiagramState, type EditOp, type MermaidDocument } from '@pixerate/editor/diagram';
|
|
1
|
+
import { DiagramController, type DiagramActionResult, type DiagramControllerOptions, type DiagramState, type EditOp, type DiagramEditorDocument, type MermaidDocument } from '@pixerate/editor/diagram';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import { type DiagramLayout, type DiagramLayoutOptions, type DiagramScene, type DiagramSceneTheme, type MermaidFlowEdge, type MermaidFlowNode } from '@pixerate/editor/canvas';
|
|
3
4
|
export interface UseMermaidDiagramOptions extends DiagramControllerOptions {
|
|
4
5
|
/** Layout spacing and node measuring for new nodes (stored positions always win). */
|
|
@@ -16,6 +17,11 @@ type Placed = {
|
|
|
16
17
|
};
|
|
17
18
|
export interface UseMermaidDiagramResult {
|
|
18
19
|
controller: DiagramController;
|
|
20
|
+
/**
|
|
21
|
+
* The save / load / undo contract for this diagram: pass it to `useEditorAutosave`
|
|
22
|
+
* (`@pixerate/editor-react/persistence`) or `createDocumentToolProvider`.
|
|
23
|
+
*/
|
|
24
|
+
editorDocument: EditorDocument<DiagramEditorDocument>;
|
|
19
25
|
state: DiagramState;
|
|
20
26
|
document: MermaidDocument;
|
|
21
27
|
/** The Mermaid text (with the `%% @pixerate` layout comment). */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DiagramController, type DiagramActionResult, type DiagramControllerOptions, type DiagramState, type EditOp, type MermaidDocument } from '@pixerate/editor/diagram';
|
|
1
|
+
import { DiagramController, type DiagramActionResult, type DiagramControllerOptions, type DiagramState, type EditOp, type DiagramEditorDocument, type MermaidDocument } from '@pixerate/editor/diagram';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import { type DiagramLayout, type DiagramLayoutOptions, type DiagramScene, type DiagramSceneTheme, type MermaidFlowEdge, type MermaidFlowNode } from '@pixerate/editor/canvas';
|
|
3
4
|
export interface UseMermaidDiagramOptions extends DiagramControllerOptions {
|
|
4
5
|
/** Layout spacing and node measuring for new nodes (stored positions always win). */
|
|
@@ -16,6 +17,11 @@ type Placed = {
|
|
|
16
17
|
};
|
|
17
18
|
export interface UseMermaidDiagramResult {
|
|
18
19
|
controller: DiagramController;
|
|
20
|
+
/**
|
|
21
|
+
* The save / load / undo contract for this diagram: pass it to `useEditorAutosave`
|
|
22
|
+
* (`@pixerate/editor-react/persistence`) or `createDocumentToolProvider`.
|
|
23
|
+
*/
|
|
24
|
+
editorDocument: EditorDocument<DiagramEditorDocument>;
|
|
19
25
|
state: DiagramState;
|
|
20
26
|
document: MermaidDocument;
|
|
21
27
|
/** The Mermaid text (with the `%% @pixerate` layout comment). */
|