@1urso/generic-editor 0.1.1 → 0.1.2
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/README.md +14 -1
- package/dist/editor/context.d.ts +2 -0
- package/dist/editor/index.d.ts +1 -0
- package/dist/generic-editor.css +1 -1
- package/dist/generic-editor.js +472 -396
- package/dist/generic-editor.umd.cjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,7 +141,11 @@ const config = {
|
|
|
141
141
|
function App() {
|
|
142
142
|
return (
|
|
143
143
|
<div style={{ height: "100vh", width: "100%" }}>
|
|
144
|
-
<EditorContent
|
|
144
|
+
<EditorContent
|
|
145
|
+
layout={config}
|
|
146
|
+
onSave={(json) => saveToBackend(json)}
|
|
147
|
+
theme="light" // Opcional: 'light' ou 'dark'
|
|
148
|
+
/>
|
|
145
149
|
</div>
|
|
146
150
|
);
|
|
147
151
|
}
|
|
@@ -262,3 +266,12 @@ interface IProp {
|
|
|
262
266
|
dataName: string; // Chave do objeto (ex: "product_price")
|
|
263
267
|
}
|
|
264
268
|
```
|
|
269
|
+
|
|
270
|
+
#### `EditorProps`
|
|
271
|
+
|
|
272
|
+
| Prop | Tipo | Obrigatório | Descrição |
|
|
273
|
+
| -------------- | ------------------------ | ----------- | ------------------------------------------- |
|
|
274
|
+
| `layout` | `ILayout` | Sim | Configuração inicial e metadados. |
|
|
275
|
+
| `onSave` | `(json: string) => void` | Não | Callback disparado ao salvar. |
|
|
276
|
+
| `initialState` | `any` | Não | Estado salvo anteriormente (JSON parseado). |
|
|
277
|
+
| `theme` | `'light' \| 'dark'` | Não | Tema da interface (padrão: `'light'`). |
|
package/dist/editor/context.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ interface IEditorState {
|
|
|
28
28
|
listSettings: IListSettings;
|
|
29
29
|
availableProps: IProp[];
|
|
30
30
|
availableFonts: string[];
|
|
31
|
+
theme: 'light' | 'dark';
|
|
31
32
|
}
|
|
32
33
|
interface IEditorContext {
|
|
33
34
|
state: IEditorState;
|
|
@@ -44,6 +45,7 @@ export declare const EditorProvider: React.FC<{
|
|
|
44
45
|
children: ReactNode;
|
|
45
46
|
isList?: boolean;
|
|
46
47
|
availableProps?: IProp[];
|
|
48
|
+
theme?: 'light' | 'dark';
|
|
47
49
|
}>;
|
|
48
50
|
export declare const useEditor: () => IEditorContext;
|
|
49
51
|
export {};
|