@particle-academy/fancy-cms-ui 0.0.1-dev.6 → 0.0.1-dev.7
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/dist/{chunk-5PWZGIYZ.js → chunk-5O6U4VIU.js} +25 -2
- package/dist/chunk-5O6U4VIU.js.map +1 -0
- package/dist/editor.cjs +380 -61
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.d.cts +42 -3
- package/dist/editor.d.ts +42 -3
- package/dist/editor.js +354 -59
- package/dist/editor.js.map +1 -1
- package/dist/react.cjs +23 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-5PWZGIYZ.js.map +0 -1
package/dist/editor.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { P as PageDoc } from './types-CpfPEq3V.cjs';
|
|
2
|
+
import { P as PageDoc, N as Node, m as StyleProps } from './types-CpfPEq3V.cjs';
|
|
3
3
|
import { a as ElementRegistry } from './registry-Bk7GN1rA.cjs';
|
|
4
4
|
import { P as PageOp } from './ops-C_s0FGeV.cjs';
|
|
5
5
|
|
|
@@ -20,6 +20,10 @@ interface NodeTransform {
|
|
|
20
20
|
y?: number;
|
|
21
21
|
scale?: number;
|
|
22
22
|
opacity?: number;
|
|
23
|
+
rotate?: number;
|
|
24
|
+
/** Explicit size in px (a true resize, distinct from `scale`). Absent = auto. */
|
|
25
|
+
w?: number;
|
|
26
|
+
h?: number;
|
|
23
27
|
}
|
|
24
28
|
interface EditablePageProps {
|
|
25
29
|
doc: PageDoc;
|
|
@@ -36,6 +40,13 @@ interface EditablePageProps {
|
|
|
36
40
|
frames?: number;
|
|
37
41
|
/** Scroll progress 0..1 (scroll = the timeline playhead). The host maps it to transforms. */
|
|
38
42
|
onProgress?: (progress: number) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Pin the page into a scroll canvas (the `frames`×viewport spacer + sticky pin
|
|
45
|
+
* that turns scroll into the playhead). Default `true`. Set **false** for a
|
|
46
|
+
* full multi-section page that should scroll naturally — animation is then
|
|
47
|
+
* driven by the dock scrub + Play preview instead of raw scroll.
|
|
48
|
+
*/
|
|
49
|
+
pinned?: boolean;
|
|
39
50
|
}
|
|
40
51
|
/**
|
|
41
52
|
* Inline EditMode over a live, seeded CMS page. Hold **Ctrl+Shift** to reveal
|
|
@@ -43,7 +54,7 @@ interface EditablePageProps {
|
|
|
43
54
|
* toolbar styles it, and the selection can be **dragged to move** / **resized**
|
|
44
55
|
* — committed as transforms the host captures into a timeline keyframe.
|
|
45
56
|
*/
|
|
46
|
-
declare function EditablePage({ doc, registry, timelineDock, transforms, onNodeTransform, onSelect, frames, onProgress, }: EditablePageProps): ReactElement;
|
|
57
|
+
declare function EditablePage({ doc, registry, timelineDock, transforms, onNodeTransform, onSelect, frames, onProgress, pinned, }: EditablePageProps): ReactElement;
|
|
47
58
|
|
|
48
59
|
interface CanvasProps {
|
|
49
60
|
doc: PageDoc;
|
|
@@ -74,6 +85,34 @@ interface InspectorProps {
|
|
|
74
85
|
/** Contextual property editor for the selected node. Every change is one op. */
|
|
75
86
|
declare function Inspector({ doc, selection, apply }: InspectorProps): ReactElement;
|
|
76
87
|
|
|
88
|
+
interface NodeInspectorProps {
|
|
89
|
+
node: Node;
|
|
90
|
+
/** The currently-applied transform for this node (sampled from the active keyframe). */
|
|
91
|
+
transform: NodeTransform;
|
|
92
|
+
/** Live measured size, used as the placeholder when width/height are still "auto". */
|
|
93
|
+
measured: {
|
|
94
|
+
w: number;
|
|
95
|
+
h: number;
|
|
96
|
+
};
|
|
97
|
+
/** Patch the node's props (commits through the op-spine → undoable). */
|
|
98
|
+
onProps: (patch: Record<string, unknown>) => void;
|
|
99
|
+
/** Patch the node's base style. */
|
|
100
|
+
onStyle: (patch: Partial<StyleProps>) => void;
|
|
101
|
+
/** Commit a transform (position / size / opacity / scale / rotate) into the active keyframe. */
|
|
102
|
+
onTransform: (t: NodeTransform) => void;
|
|
103
|
+
onRemove: () => void;
|
|
104
|
+
onClose: () => void;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The on-page element Inspector — a docked properties panel shown while a node
|
|
108
|
+
* is selected in EditMode. Where the floating toolbar handles quick text tweaks,
|
|
109
|
+
* this is the full surface: content, element-specific props (a button's label /
|
|
110
|
+
* link / variant, an image's src / alt, …), exact position + size, and the style
|
|
111
|
+
* box. Every control writes through the op-spine or the active keyframe, so edits
|
|
112
|
+
* are undoable and animatable.
|
|
113
|
+
*/
|
|
114
|
+
declare function NodeInspector({ node, transform, measured, onProps, onStyle, onTransform, onRemove, onClose, }: NodeInspectorProps): ReactElement;
|
|
115
|
+
|
|
77
116
|
/**
|
|
78
117
|
* Editor state engine — pure and framework-agnostic so it's unit-testable.
|
|
79
118
|
* `useEditor` wraps this with `useReducer`. Undo/redo uses document snapshots
|
|
@@ -118,4 +157,4 @@ interface EditorApi {
|
|
|
118
157
|
}
|
|
119
158
|
declare function useEditor(initialDoc: PageDoc): EditorApi;
|
|
120
159
|
|
|
121
|
-
export { Canvas, type CanvasProps, EditablePage, type EditablePageProps, Editor, type EditorAction, type EditorApi, type EditorProps, type EditorState, Inspector, type InspectorProps, LayersPanel, type LayersPanelProps, editorReduce, initEditor, useEditor };
|
|
160
|
+
export { Canvas, type CanvasProps, EditablePage, type EditablePageProps, Editor, type EditorAction, type EditorApi, type EditorProps, type EditorState, Inspector, type InspectorProps, LayersPanel, type LayersPanelProps, NodeInspector, type NodeInspectorProps, editorReduce, initEditor, useEditor };
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { P as PageDoc } from './types-CpfPEq3V.js';
|
|
2
|
+
import { P as PageDoc, N as Node, m as StyleProps } from './types-CpfPEq3V.js';
|
|
3
3
|
import { a as ElementRegistry } from './registry-Dht9JBLU.js';
|
|
4
4
|
import { P as PageOp } from './ops-nevYkDzK.js';
|
|
5
5
|
|
|
@@ -20,6 +20,10 @@ interface NodeTransform {
|
|
|
20
20
|
y?: number;
|
|
21
21
|
scale?: number;
|
|
22
22
|
opacity?: number;
|
|
23
|
+
rotate?: number;
|
|
24
|
+
/** Explicit size in px (a true resize, distinct from `scale`). Absent = auto. */
|
|
25
|
+
w?: number;
|
|
26
|
+
h?: number;
|
|
23
27
|
}
|
|
24
28
|
interface EditablePageProps {
|
|
25
29
|
doc: PageDoc;
|
|
@@ -36,6 +40,13 @@ interface EditablePageProps {
|
|
|
36
40
|
frames?: number;
|
|
37
41
|
/** Scroll progress 0..1 (scroll = the timeline playhead). The host maps it to transforms. */
|
|
38
42
|
onProgress?: (progress: number) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Pin the page into a scroll canvas (the `frames`×viewport spacer + sticky pin
|
|
45
|
+
* that turns scroll into the playhead). Default `true`. Set **false** for a
|
|
46
|
+
* full multi-section page that should scroll naturally — animation is then
|
|
47
|
+
* driven by the dock scrub + Play preview instead of raw scroll.
|
|
48
|
+
*/
|
|
49
|
+
pinned?: boolean;
|
|
39
50
|
}
|
|
40
51
|
/**
|
|
41
52
|
* Inline EditMode over a live, seeded CMS page. Hold **Ctrl+Shift** to reveal
|
|
@@ -43,7 +54,7 @@ interface EditablePageProps {
|
|
|
43
54
|
* toolbar styles it, and the selection can be **dragged to move** / **resized**
|
|
44
55
|
* — committed as transforms the host captures into a timeline keyframe.
|
|
45
56
|
*/
|
|
46
|
-
declare function EditablePage({ doc, registry, timelineDock, transforms, onNodeTransform, onSelect, frames, onProgress, }: EditablePageProps): ReactElement;
|
|
57
|
+
declare function EditablePage({ doc, registry, timelineDock, transforms, onNodeTransform, onSelect, frames, onProgress, pinned, }: EditablePageProps): ReactElement;
|
|
47
58
|
|
|
48
59
|
interface CanvasProps {
|
|
49
60
|
doc: PageDoc;
|
|
@@ -74,6 +85,34 @@ interface InspectorProps {
|
|
|
74
85
|
/** Contextual property editor for the selected node. Every change is one op. */
|
|
75
86
|
declare function Inspector({ doc, selection, apply }: InspectorProps): ReactElement;
|
|
76
87
|
|
|
88
|
+
interface NodeInspectorProps {
|
|
89
|
+
node: Node;
|
|
90
|
+
/** The currently-applied transform for this node (sampled from the active keyframe). */
|
|
91
|
+
transform: NodeTransform;
|
|
92
|
+
/** Live measured size, used as the placeholder when width/height are still "auto". */
|
|
93
|
+
measured: {
|
|
94
|
+
w: number;
|
|
95
|
+
h: number;
|
|
96
|
+
};
|
|
97
|
+
/** Patch the node's props (commits through the op-spine → undoable). */
|
|
98
|
+
onProps: (patch: Record<string, unknown>) => void;
|
|
99
|
+
/** Patch the node's base style. */
|
|
100
|
+
onStyle: (patch: Partial<StyleProps>) => void;
|
|
101
|
+
/** Commit a transform (position / size / opacity / scale / rotate) into the active keyframe. */
|
|
102
|
+
onTransform: (t: NodeTransform) => void;
|
|
103
|
+
onRemove: () => void;
|
|
104
|
+
onClose: () => void;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The on-page element Inspector — a docked properties panel shown while a node
|
|
108
|
+
* is selected in EditMode. Where the floating toolbar handles quick text tweaks,
|
|
109
|
+
* this is the full surface: content, element-specific props (a button's label /
|
|
110
|
+
* link / variant, an image's src / alt, …), exact position + size, and the style
|
|
111
|
+
* box. Every control writes through the op-spine or the active keyframe, so edits
|
|
112
|
+
* are undoable and animatable.
|
|
113
|
+
*/
|
|
114
|
+
declare function NodeInspector({ node, transform, measured, onProps, onStyle, onTransform, onRemove, onClose, }: NodeInspectorProps): ReactElement;
|
|
115
|
+
|
|
77
116
|
/**
|
|
78
117
|
* Editor state engine — pure and framework-agnostic so it's unit-testable.
|
|
79
118
|
* `useEditor` wraps this with `useReducer`. Undo/redo uses document snapshots
|
|
@@ -118,4 +157,4 @@ interface EditorApi {
|
|
|
118
157
|
}
|
|
119
158
|
declare function useEditor(initialDoc: PageDoc): EditorApi;
|
|
120
159
|
|
|
121
|
-
export { Canvas, type CanvasProps, EditablePage, type EditablePageProps, Editor, type EditorAction, type EditorApi, type EditorProps, type EditorState, Inspector, type InspectorProps, LayersPanel, type LayersPanelProps, editorReduce, initEditor, useEditor };
|
|
160
|
+
export { Canvas, type CanvasProps, EditablePage, type EditablePageProps, Editor, type EditorAction, type EditorApi, type EditorProps, type EditorState, Inspector, type InspectorProps, LayersPanel, type LayersPanelProps, NodeInspector, type NodeInspectorProps, editorReduce, initEditor, useEditor };
|