@1urso/generic-editor 0.1.63 → 0.1.64
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/editor/components/AssetsPanel.d.ts +2 -0
- package/dist/editor/components/HistoryPanel.d.ts +2 -0
- package/dist/editor/components/LayersPanel.d.ts +4 -0
- package/dist/editor/components/Minimap.d.ts +2 -0
- package/dist/editor/components/Ruler.d.ts +4 -0
- package/dist/editor/components/SmartGuides.d.ts +2 -0
- package/dist/editor/components/ViewToolbar.d.ts +2 -0
- package/dist/editor/context.d.ts +20 -1
- package/dist/editor/index.d.ts +1 -2
- package/dist/generic-editor.js +4441 -1532
- package/dist/generic-editor.umd.cjs +32 -28
- package/package.json +2 -1
package/dist/editor/context.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface IElement {
|
|
|
42
42
|
containerExpansion?: 'vertical' | 'horizontal';
|
|
43
43
|
animation?: IElementAnimation;
|
|
44
44
|
styleBindings?: Record<string, string>;
|
|
45
|
+
locked?: boolean;
|
|
46
|
+
hidden?: boolean;
|
|
45
47
|
}
|
|
46
48
|
export interface IListSettings {
|
|
47
49
|
sortProp?: string;
|
|
@@ -67,6 +69,7 @@ interface IEditorState {
|
|
|
67
69
|
availableFonts: string[];
|
|
68
70
|
theme: 'light' | 'dark';
|
|
69
71
|
history: IElement[][];
|
|
72
|
+
historyDescriptions: string[];
|
|
70
73
|
historyIndex: number;
|
|
71
74
|
clipboard: IElement[];
|
|
72
75
|
gridSize: number;
|
|
@@ -79,8 +82,16 @@ interface IEditorState {
|
|
|
79
82
|
orientation: 'horizontal' | 'vertical';
|
|
80
83
|
position: number;
|
|
81
84
|
}[];
|
|
85
|
+
assets: IAsset[];
|
|
82
86
|
}
|
|
83
|
-
interface
|
|
87
|
+
export interface IAsset {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
url: string;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
}
|
|
94
|
+
export interface IEditorContext {
|
|
84
95
|
state: IEditorState;
|
|
85
96
|
setGridSize: (size: number) => void;
|
|
86
97
|
setZoom: (zoom: number) => void;
|
|
@@ -115,9 +126,17 @@ interface IEditorContext {
|
|
|
115
126
|
loadState: (savedState: Partial<IEditorState>) => void;
|
|
116
127
|
undo: () => void;
|
|
117
128
|
redo: () => void;
|
|
129
|
+
jumpToHistory: (index: number) => void;
|
|
118
130
|
copy: () => void;
|
|
119
131
|
paste: () => void;
|
|
132
|
+
addAsset: (asset: IAsset) => void;
|
|
133
|
+
removeAsset: (id: string) => void;
|
|
134
|
+
}
|
|
135
|
+
export interface ISnapGuide {
|
|
136
|
+
type: 'horizontal' | 'vertical';
|
|
137
|
+
position: number;
|
|
120
138
|
}
|
|
139
|
+
export declare const EditorContext: React.Context<IEditorContext | undefined>;
|
|
121
140
|
export declare const EditorProvider: React.FC<{
|
|
122
141
|
children: ReactNode;
|
|
123
142
|
isList?: boolean;
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ILayout } from './types';
|
|
3
|
-
interface EditorProps {
|
|
3
|
+
export interface EditorProps {
|
|
4
4
|
layout: ILayout;
|
|
5
5
|
initialState?: unknown;
|
|
6
6
|
onSave?: (json: string) => void;
|
|
7
7
|
theme?: 'light' | 'dark';
|
|
8
8
|
}
|
|
9
9
|
export declare const GenericEditor: React.FC<EditorProps>;
|
|
10
|
-
export {};
|