@1urso/generic-editor 0.1.79 → 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 +15 -0
- package/dist/generic-editor.js +21125 -16379
- 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;
|
|
@@ -136,6 +147,10 @@ export interface IEditorContext {
|
|
|
136
147
|
setPropertiesPanelOpen: (open: boolean) => void;
|
|
137
148
|
addAsset: (asset: IAsset) => void;
|
|
138
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;
|
|
139
154
|
}
|
|
140
155
|
export interface ISnapGuide {
|
|
141
156
|
type: 'horizontal' | 'vertical';
|