@1urso/generic-editor 0.1.78 → 0.1.80
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/FeedbackModal.d.ts +14 -0
- package/dist/editor/components/GlobalHeader.d.ts +1 -0
- package/dist/editor/components/LoadingScreen.d.ts +6 -0
- package/dist/editor/context.d.ts +18 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/generic-editor.js +21299 -16458
- package/dist/generic-editor.umd.cjs +113 -33
- package/package.json +3 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type FeedbackType = 'alert' | 'confirm' | 'prompt';
|
|
3
|
+
export interface FeedbackState {
|
|
4
|
+
type: FeedbackType;
|
|
5
|
+
message: string;
|
|
6
|
+
onConfirm?: () => void;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
onPromptSubmit?: (value: string) => void;
|
|
9
|
+
promptDefaultValue?: string;
|
|
10
|
+
confirmLabel?: string;
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const FeedbackModal: React.FC;
|
package/dist/editor/context.d.ts
CHANGED
|
@@ -85,6 +85,17 @@ interface IEditorState {
|
|
|
85
85
|
position: number;
|
|
86
86
|
}[];
|
|
87
87
|
assets: IAsset[];
|
|
88
|
+
feedback?: {
|
|
89
|
+
type: 'alert' | 'confirm' | 'prompt';
|
|
90
|
+
message: string;
|
|
91
|
+
onConfirm?: () => void;
|
|
92
|
+
onCancel?: () => void;
|
|
93
|
+
onPromptSubmit?: (v: string) => void;
|
|
94
|
+
promptDefaultValue?: string;
|
|
95
|
+
confirmLabel?: string;
|
|
96
|
+
cancelLabel?: string;
|
|
97
|
+
title?: string;
|
|
98
|
+
};
|
|
88
99
|
}
|
|
89
100
|
export interface IAsset {
|
|
90
101
|
id: string;
|
|
@@ -95,6 +106,8 @@ export interface IAsset {
|
|
|
95
106
|
}
|
|
96
107
|
export interface IEditorContext {
|
|
97
108
|
state: IEditorState;
|
|
109
|
+
/** Elemento para renderizar portais (Dialog, DropdownMenu, Select). Use o elemento em fullscreen para que modais apareçam. */
|
|
110
|
+
portalContainer: HTMLElement | null | undefined;
|
|
98
111
|
setGridSize: (size: number) => void;
|
|
99
112
|
setZoom: (zoom: number) => void;
|
|
100
113
|
setPan: (pan: {
|
|
@@ -134,6 +147,10 @@ export interface IEditorContext {
|
|
|
134
147
|
setPropertiesPanelOpen: (open: boolean) => void;
|
|
135
148
|
addAsset: (asset: IAsset) => void;
|
|
136
149
|
removeAsset: (id: string) => void;
|
|
150
|
+
showAlert: (message: string) => void;
|
|
151
|
+
showConfirm: (message: string, onConfirm: () => void, onCancel?: () => void) => void;
|
|
152
|
+
showPrompt: (message: string, onSubmit: (value: string) => void, onCancel?: () => void, defaultValue?: string) => void;
|
|
153
|
+
clearFeedback: () => void;
|
|
137
154
|
}
|
|
138
155
|
export interface ISnapGuide {
|
|
139
156
|
type: 'horizontal' | 'vertical';
|
|
@@ -145,6 +162,7 @@ export declare const EditorProvider: React.FC<{
|
|
|
145
162
|
isList?: boolean;
|
|
146
163
|
availableProps?: IProp[];
|
|
147
164
|
theme?: 'light' | 'dark';
|
|
165
|
+
portalContainer?: HTMLElement | null;
|
|
148
166
|
}>;
|
|
149
167
|
export declare const useEditor: () => IEditorContext;
|
|
150
168
|
export {};
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -8,5 +8,7 @@ export interface EditorProps {
|
|
|
8
8
|
templates?: ITemplate[];
|
|
9
9
|
activeTemplateId?: string;
|
|
10
10
|
onTemplateChange?: (templateId: string) => void;
|
|
11
|
+
/** Elemento para renderizar portais (modais, dropdowns). Passe o elemento em fullscreen para que modais apareçam. */
|
|
12
|
+
portalContainer?: HTMLElement | null;
|
|
11
13
|
}
|
|
12
14
|
export declare const GenericEditor: React.FC<EditorProps>;
|