@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.
@@ -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;
@@ -6,6 +6,7 @@ interface GlobalHeaderProps {
6
6
  setIsTemplatesOpen: (isOpen: boolean) => void;
7
7
  onFinish?: () => void;
8
8
  onToggleSidebar?: () => void;
9
+ onStartTour?: () => void;
9
10
  }
10
11
  export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
11
12
  export {};
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export declare const LoadingScreen: React.FC;
3
+ /** Wrapper para usar com AnimatePresence e permitir animação de saída */
4
+ export declare const LoadingScreenWithPresence: React.FC<{
5
+ show: boolean;
6
+ }>;
@@ -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 {};
@@ -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>;