@aham.ro/ui-designer 0.1.12 → 0.1.13

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.
Files changed (77) hide show
  1. package/dist/Designer.vue.d.ts +13 -2
  2. package/dist/index.d.ts +7 -3
  3. package/dist/preview.d.ts +35 -0
  4. package/dist/stores/checklist.d.ts +1 -1
  5. package/dist/stores/session.d.ts +13 -0
  6. package/dist/stores/templates.d.ts +5 -1
  7. package/dist/stores/theme.d.ts +12 -5
  8. package/dist/stores/translations.d.ts +9 -1
  9. package/dist/stores/workspace.d.ts +118 -3
  10. package/dist/ui-designer.css +1 -1
  11. package/dist/ui-designer.js +5283 -2428
  12. package/dist/widgets/ComponenList.vue.d.ts +13 -5
  13. package/dist/widgets/Header.vue.d.ts +3 -0
  14. package/dist/widgets/Properties.vue.d.ts +10 -2
  15. package/dist/widgets/SideInfo.vue.d.ts +7 -0
  16. package/dist/widgets/TemplateList.vue.d.ts +1 -0
  17. package/dist/widgets/Workspace.vue.d.ts +10 -1
  18. package/dist/widgets/components/Alert.vue.d.ts +1 -4
  19. package/dist/widgets/components/Checkbox.vue.d.ts +1 -4
  20. package/dist/widgets/components/ConsentCard.vue.d.ts +1 -4
  21. package/dist/widgets/components/Container.vue.d.ts +7 -16
  22. package/dist/widgets/components/DatePicker.vue.d.ts +10 -0
  23. package/dist/widgets/components/Divider.vue.d.ts +1 -3
  24. package/dist/widgets/components/EmailInput.vue.d.ts +1 -5
  25. package/dist/widgets/components/Errors.vue.d.ts +9 -0
  26. package/dist/widgets/components/Heading.vue.d.ts +2 -4
  27. package/dist/widgets/components/Image.vue.d.ts +1 -9
  28. package/dist/widgets/components/Layout.vue.d.ts +3 -7
  29. package/dist/widgets/components/LayoutRef.vue.d.ts +13 -7
  30. package/dist/widgets/components/LayoutSlot.vue.d.ts +13 -0
  31. package/dist/widgets/components/OtpInput.vue.d.ts +1 -4
  32. package/dist/widgets/components/PasswordInput.vue.d.ts +5 -7
  33. package/dist/widgets/components/ScopeList.vue.d.ts +1 -3
  34. package/dist/widgets/components/SocialButton.vue.d.ts +1 -4
  35. package/dist/widgets/components/Spacer.vue.d.ts +1 -3
  36. package/dist/widgets/components/SubmitButton.vue.d.ts +1 -4
  37. package/dist/widgets/components/Text.vue.d.ts +2 -3
  38. package/dist/widgets/components/TextInput.vue.d.ts +5 -5
  39. package/dist/widgets/components/TextLink.vue.d.ts +4 -5
  40. package/dist/widgets/components/ThemeToggler.vue.d.ts +11 -0
  41. package/dist/widgets/components/base/AlertBase.vue.d.ts +10 -0
  42. package/dist/widgets/components/base/CheckboxBase.vue.d.ts +11 -0
  43. package/dist/widgets/components/base/ConsentCardBase.vue.d.ts +10 -0
  44. package/dist/widgets/components/{Card.vue.d.ts → base/ContainerBase.vue.d.ts} +10 -9
  45. package/dist/widgets/components/base/DatePickerBase.vue.d.ts +17 -0
  46. package/dist/widgets/components/base/DividerBase.vue.d.ts +8 -0
  47. package/dist/widgets/components/base/EmailInputBase.vue.d.ts +18 -0
  48. package/dist/widgets/components/base/HeadingBase.vue.d.ts +12 -0
  49. package/dist/widgets/components/base/ImageBase.vue.d.ts +20 -0
  50. package/dist/widgets/components/base/LayoutBase.vue.d.ts +22 -0
  51. package/dist/widgets/components/base/LayoutRefBase.vue.d.ts +23 -0
  52. package/dist/widgets/components/base/OtpInputBase.vue.d.ts +10 -0
  53. package/dist/widgets/components/base/PasswordInputBase.vue.d.ts +30 -0
  54. package/dist/widgets/components/base/ScopeListBase.vue.d.ts +8 -0
  55. package/dist/widgets/components/base/SocialButtonBase.vue.d.ts +11 -0
  56. package/dist/widgets/components/base/SpacerBase.vue.d.ts +8 -0
  57. package/dist/widgets/components/base/SubmitButtonBase.vue.d.ts +10 -0
  58. package/dist/widgets/components/base/TextBase.vue.d.ts +10 -0
  59. package/dist/widgets/components/base/TextInputBase.vue.d.ts +21 -0
  60. package/dist/widgets/components/base/TextLinkBase.vue.d.ts +18 -0
  61. package/dist/widgets/components/base/ThemeTogglerBase.vue.d.ts +20 -0
  62. package/dist/widgets/components/base/index.d.ts +48 -0
  63. package/dist/widgets/components/index.d.ts +19 -15
  64. package/dist/widgets/components/types.d.ts +5 -0
  65. package/dist/widgets/header/IconButton.vue.d.ts +1 -1
  66. package/dist/widgets/header/SaveButton.vue.d.ts +5 -1
  67. package/dist/widgets/header/types.d.ts +5 -0
  68. package/dist/widgets/workspace/Breadcrumb.vue.d.ts +4 -1
  69. package/dist/widgets/workspace/ComponentHandler.vue.d.ts +4 -4
  70. package/dist/widgets/workspace/Composer.vue.d.ts +4 -1
  71. package/dist/widgets/workspace/DataExpose.vue.d.ts +13 -0
  72. package/dist/widgets/workspace/Editable.vue.d.ts +18 -0
  73. package/dist/widgets/workspace/WorkspaceNode.vue.d.ts +7 -2
  74. package/dist/widgets/workspace/ZoomController.vue.d.ts +0 -1
  75. package/dist/widgets/workspace/configuration.d.ts +3 -4
  76. package/dist/widgets/workspace/editable.d.ts +8 -4
  77. package/package.json +5 -1
@@ -1,5 +1,7 @@
1
- import type { MoreMenuItem, Template } from './widgets/header/types';
2
- interface Options {
1
+ import { type WorkspaceData } from './stores/workspace';
2
+ import type { ChecklistItem, MoreMenuItem, Template } from './widgets/header/types';
3
+ type NotificationTheme = 'info' | 'success' | 'warning' | 'danger';
4
+ export interface Options {
3
5
  subject: string;
4
6
  templates: Template[];
5
7
  shared?: boolean;
@@ -9,6 +11,7 @@ interface Options {
9
11
  };
10
12
  size?: 'small' | 'medium' | 'large';
11
13
  moreItems?: MoreMenuItem[];
14
+ checklist?: ChecklistItem[];
12
15
  }
13
16
  type __VLS_Props = {
14
17
  value: string;
@@ -17,20 +20,28 @@ type __VLS_Props = {
17
20
  };
18
21
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
22
  moreSelect: (id: string) => any;
23
+ save: (data: WorkspaceData, onSuccess: (versionId?: string) => void) => any;
20
24
  componentDrop: (type: string) => any;
21
25
  translationUpdate: (fieldId: string, value: string, language: string) => any;
22
26
  screenSelect: (screen: Template) => any;
23
27
  screenAdd: (screen: Template) => any;
24
28
  screenRename: (id: string, name: string) => any;
25
29
  themeUpdate: (color: string) => any;
30
+ publish: (templateId: string, versionId: string, onSuccess: (response?: unknown) => void) => any;
31
+ notify: (message: string, theme?: NotificationTheme | undefined) => any;
32
+ dirtyChange: (dirty: boolean) => any;
26
33
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
34
  onMoreSelect?: ((id: string) => any) | undefined;
35
+ onSave?: ((data: WorkspaceData, onSuccess: (versionId?: string) => void) => any) | undefined;
28
36
  onComponentDrop?: ((type: string) => any) | undefined;
29
37
  onTranslationUpdate?: ((fieldId: string, value: string, language: string) => any) | undefined;
30
38
  onScreenSelect?: ((screen: Template) => any) | undefined;
31
39
  onScreenAdd?: ((screen: Template) => any) | undefined;
32
40
  onScreenRename?: ((id: string, name: string) => any) | undefined;
33
41
  onThemeUpdate?: ((color: string) => any) | undefined;
42
+ onPublish?: ((templateId: string, versionId: string, onSuccess: (response?: unknown) => void) => any) | undefined;
43
+ onNotify?: ((message: string, theme?: NotificationTheme | undefined) => any) | undefined;
44
+ onDirtyChange?: ((dirty: boolean) => any) | undefined;
34
45
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
46
  declare const _default: typeof __VLS_export;
36
47
  export default _default;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as Designer } from './Designer.vue';
1
+ export { default as Designer, type Options } from './Designer.vue';
2
2
  export { useChecklistStore } from './stores/checklist';
3
3
  export { useTemplatesStore } from './stores/templates';
4
4
  export type { DynamicTemplate, PredefinedTemplate, TemplateBase, TemplateRecord } from './stores/templates';
@@ -7,6 +7,8 @@ export type { ThemeData, ThemeVariable, ThemeVariableType } from './stores/theme
7
7
  export { useTranslationStore } from './stores/translations';
8
8
  export type { TranslationItem, TranslationItemInput } from './stores/translations';
9
9
  export { useWorkspaceStore } from './stores/workspace';
10
+ export type { WorkspaceData } from './stores/workspace';
11
+ export { useDesignerSessionStore } from './stores/session';
10
12
  export { default as ColorPicker } from './widgets/ColorPicker.vue';
11
13
  export * from './widgets/components';
12
14
  export type { ChecklistContext, ChecklistItem, MoreMenuItem, Template } from './widgets/header/types';
@@ -16,10 +18,12 @@ export { default as ThemeSidebar } from './widgets/ThemeSidebar.vue';
16
18
  export type { TranslationField } from './widgets/TranslationSidebar.vue';
17
19
  export { default as ComponentHandler } from './widgets/workspace/ComponentHandler.vue';
18
20
  export { default as Composer } from './widgets/workspace/Composer.vue';
19
- export { withEditable } from './widgets/workspace/editable';
20
- export type { EditablePropDefinition, EditablePropDefinitions } from './widgets/workspace/editable';
21
+ export { withProperties } from './widgets/workspace/editable';
22
+ export type { PropertyDefinition, PropertyDefinitions } from './widgets/workspace/editable';
21
23
  export { default as Renderer } from './widgets/workspace/Renderer.vue';
22
24
  export { default as Desktop } from './widgets/workspace/screens/Desktop.vue';
23
25
  export { default as Device } from './widgets/workspace/screens/Device.vue';
24
26
  export { default as Mobile } from './widgets/workspace/screens/Mobile.vue';
25
27
  export { default as Tablet } from './widgets/workspace/screens/Tablet.vue';
28
+ export { render } from './preview';
29
+ export type { PreviewRenderOptions } from './preview';
@@ -0,0 +1,35 @@
1
+ import './designer.css';
2
+ import './style.css';
3
+ import { type RenderWalker, type RenderTemplate } from './widgets/components/base';
4
+ import type { ThemeData } from './stores/theme';
5
+ type Translation = {
6
+ componentId?: string;
7
+ key: string;
8
+ value?: string;
9
+ translations?: Record<string, string>;
10
+ };
11
+ type PreviewTemplate = RenderTemplate & {
12
+ templateId?: string;
13
+ templates?: Array<RenderTemplate & {
14
+ templateId?: string;
15
+ id?: string;
16
+ }>;
17
+ workspace?: {
18
+ templates?: Array<RenderTemplate & {
19
+ templateId?: string;
20
+ id?: string;
21
+ }>;
22
+ };
23
+ documentProps?: Record<string, Record<string, unknown>>;
24
+ translations?: Translation[];
25
+ form?: boolean;
26
+ theme?: ThemeData;
27
+ };
28
+ export type PreviewRenderOptions = {
29
+ walker?: RenderWalker;
30
+ form?: {
31
+ submit?: (payload: Record<string, FormDataEntryValue>) => void;
32
+ } | false;
33
+ };
34
+ export declare function render(template: PreviewTemplate, target: string, options?: PreviewRenderOptions): import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions>, {}, {}, "", {}, any>;
35
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { ChecklistItem } from '../widgets/header/types';
2
2
  export type { ChecklistItem } from '../widgets/header/types';
3
- export declare const useChecklistStore: import("pinia").StoreDefinition<"checklist", {
3
+ export declare const useChecklistStore: import("pinia").StoreDefinition<"designer/checklist", {
4
4
  items: ChecklistItem[];
5
5
  }, {}, {
6
6
  setComplete(id: string, complete?: boolean): void;
@@ -0,0 +1,13 @@
1
+ export declare const useDesignerSessionStore: import("pinia").StoreDefinition<"designer/session", {
2
+ isDirty: boolean;
3
+ isSaving: boolean;
4
+ isPublishing: boolean;
5
+ draftVersionId: string | undefined;
6
+ savedVersionId: string | undefined;
7
+ }, {}, {
8
+ setDirty(value: boolean): void;
9
+ startSaving(): void;
10
+ markSaved(versionId?: string): void;
11
+ finishSaving(): void;
12
+ markPublished(versionId?: string): void;
13
+ }>;
@@ -5,6 +5,10 @@ export interface TemplateBase {
5
5
  channel: string;
6
6
  version: string;
7
7
  changed: boolean;
8
+ hasDraft?: boolean;
9
+ draftVersionId?: string;
10
+ canDelete?: boolean;
11
+ requiredComponents?: string[];
8
12
  }
9
13
  export interface PredefinedTemplate extends TemplateBase {
10
14
  type: 'predefined';
@@ -14,7 +18,7 @@ export interface DynamicTemplate extends TemplateBase {
14
18
  content?: Record<string, unknown>;
15
19
  }
16
20
  export type TemplateRecord = PredefinedTemplate | DynamicTemplate;
17
- export declare const useTemplatesStore: import("pinia").StoreDefinition<"templates", {
21
+ export declare const useTemplatesStore: import("pinia").StoreDefinition<"designer/templates", {
18
22
  templates: TemplateRecord[];
19
23
  template: TemplateRecord | null;
20
24
  }, {}, {
@@ -1,4 +1,4 @@
1
- export type ThemeVariableType = 'color' | 'size';
1
+ export type ThemeVariableType = 'color' | 'size' | 'number' | 'font-family' | 'font-weight' | 'duration' | 'shadow' | 'text';
2
2
  export interface ThemeVariable {
3
3
  key: string;
4
4
  title: string;
@@ -9,17 +9,24 @@ export interface ThemeVariable {
9
9
  dark: string;
10
10
  };
11
11
  component?: string;
12
+ userCreated?: boolean;
12
13
  }
13
14
  export interface ThemeData {
14
15
  variables: ThemeVariable[];
15
- values: Record<string, string>;
16
+ values: Record<string, ThemeValue | string>;
16
17
  }
17
- export declare const useThemeStore: import("pinia").StoreDefinition<"theme", {
18
+ export interface ThemeValue {
19
+ light?: string;
20
+ dark?: string;
21
+ }
22
+ export declare const useThemeStore: import("pinia").StoreDefinition<"designer/theme", {
18
23
  variables: ThemeVariable[];
19
- values: Record<string, string>;
24
+ values: Record<string, ThemeValue>;
20
25
  }, {}, {
21
26
  registerVariables(variables: ThemeVariable[]): void;
22
- setValue(key: string, value: string): void;
27
+ addVariable(variable: ThemeVariable): void;
28
+ removeVariable(key: string): void;
29
+ setValue(key: string, value: string, dark?: boolean): void;
23
30
  value(variable: ThemeVariable, dark: boolean): string;
24
31
  exportData(): ThemeData;
25
32
  importData(data: ThemeData): void;
@@ -12,8 +12,9 @@ export type TranslationItemInput = Omit<TranslationItem, 'key' | 'translations'>
12
12
  value?: string;
13
13
  translations?: Record<string, string>;
14
14
  };
15
- export declare const useTranslationStore: import("pinia").StoreDefinition<"translations", {
15
+ export declare const useTranslationStore: import("pinia").StoreDefinition<"designer/translations", {
16
16
  items: TranslationItem[];
17
+ languages: string[];
17
18
  }, {
18
19
  fields: (state: {
19
20
  items: {
@@ -25,8 +26,10 @@ export declare const useTranslationStore: import("pinia").StoreDefinition<"trans
25
26
  screenId?: string | undefined;
26
27
  componentId?: string | undefined;
27
28
  }[];
29
+ languages: string[];
28
30
  } & import("pinia").PiniaCustomStateProperties<{
29
31
  items: TranslationItem[];
32
+ languages: string[];
30
33
  }>) => {
31
34
  id: string;
32
35
  key: string;
@@ -37,11 +40,16 @@ export declare const useTranslationStore: import("pinia").StoreDefinition<"trans
37
40
  componentId?: string | undefined;
38
41
  }[];
39
42
  }, {
43
+ registerLanguages(languages: string[]): void;
40
44
  setItems(items: TranslationItemInput[]): void;
41
45
  setScreenItems(screenId: string, items: TranslationItemInput[]): void;
42
46
  setComponentItems(componentId: string, items: TranslationItemInput[]): void;
47
+ addLanguage(language: string): void;
48
+ removeLanguage(language: string): void;
43
49
  updateValue(id: string, value: string, language?: string): void;
44
50
  ensureValue(id: string, value: string, componentId?: string): void;
51
+ removeComponent(componentId: string): void;
52
+ reconcile(validIds: Set<string>): void;
45
53
  getValue(id: string, language?: string): string;
46
54
  remove(id: string): void;
47
55
  clear(): void;
@@ -1,7 +1,9 @@
1
+ import type { TranslationItem } from './translations';
1
2
  export interface WorkspaceComponent {
2
3
  id: string;
3
4
  type: string;
4
5
  props: ComponentProps;
6
+ layoutId?: string;
5
7
  children?: WorkspaceComponent[];
6
8
  }
7
9
  export declare const MAX_COMPONENT_DEPTH = 10;
@@ -19,12 +21,31 @@ export interface WorkspaceTemplateData {
19
21
  templateName: string;
20
22
  components: WorkspaceComponent[];
21
23
  documentProps: WorkspaceDeviceProps;
24
+ translations?: TranslationItem[];
25
+ }
26
+ export interface DynamicTemplateData {
27
+ id: string;
28
+ name: string;
29
+ version: string;
30
+ channel: string;
31
+ icon: string;
32
+ changed: boolean;
33
+ hasDraft?: boolean;
34
+ type: 'dynamic';
22
35
  }
23
36
  export interface WorkspaceData {
24
37
  templates: WorkspaceTemplateData[];
38
+ activeTemplateId?: string;
39
+ dynamicTemplates?: DynamicTemplateData[];
25
40
  }
41
+ type WorkspaceSnapshot = {
42
+ components: WorkspaceComponent[];
43
+ templateComponents: Record<string, WorkspaceComponent[]>;
44
+ documentProps: Record<string, WorkspaceDeviceProps>;
45
+ selectedId?: string;
46
+ };
26
47
  export declare function isWorkspaceData(value: unknown): value is WorkspaceData;
27
- export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspace", {
48
+ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"designer/workspace", {
28
49
  components: WorkspaceComponent[];
29
50
  selectedId: string | undefined;
30
51
  activeTemplateId: string | undefined;
@@ -33,6 +54,8 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
33
54
  templateComponents: Record<string, WorkspaceComponent[]>;
34
55
  templateNames: Record<string, string>;
35
56
  documentProps: Record<string, WorkspaceDeviceProps>;
57
+ undoStack: WorkspaceSnapshot[];
58
+ redoStack: WorkspaceSnapshot[];
36
59
  }, {
37
60
  selectedIndex: (state: {
38
61
  components: {
@@ -44,6 +67,7 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
44
67
  tablet?: Record<string, unknown> | undefined;
45
68
  desktop?: Record<string, unknown> | undefined;
46
69
  };
70
+ layoutId?: string | undefined;
47
71
  children?: /*elided*/ any[] | undefined;
48
72
  }[];
49
73
  selectedId: string | undefined;
@@ -53,6 +77,40 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
53
77
  templateComponents: Record<string, WorkspaceComponent[]>;
54
78
  templateNames: Record<string, string>;
55
79
  documentProps: Record<string, WorkspaceDeviceProps>;
80
+ undoStack: {
81
+ components: {
82
+ id: string;
83
+ type: string;
84
+ props: {
85
+ base: Record<string, unknown>;
86
+ phone?: Record<string, unknown> | undefined;
87
+ tablet?: Record<string, unknown> | undefined;
88
+ desktop?: Record<string, unknown> | undefined;
89
+ };
90
+ layoutId?: string | undefined;
91
+ children?: /*elided*/ any[] | undefined;
92
+ }[];
93
+ templateComponents: Record<string, WorkspaceComponent[]>;
94
+ documentProps: Record<string, WorkspaceDeviceProps>;
95
+ selectedId?: string | undefined;
96
+ }[];
97
+ redoStack: {
98
+ components: {
99
+ id: string;
100
+ type: string;
101
+ props: {
102
+ base: Record<string, unknown>;
103
+ phone?: Record<string, unknown> | undefined;
104
+ tablet?: Record<string, unknown> | undefined;
105
+ desktop?: Record<string, unknown> | undefined;
106
+ };
107
+ layoutId?: string | undefined;
108
+ children?: /*elided*/ any[] | undefined;
109
+ }[];
110
+ templateComponents: Record<string, WorkspaceComponent[]>;
111
+ documentProps: Record<string, WorkspaceDeviceProps>;
112
+ selectedId?: string | undefined;
113
+ }[];
56
114
  } & import("pinia").PiniaCustomStateProperties<{
57
115
  components: WorkspaceComponent[];
58
116
  selectedId: string | undefined;
@@ -62,6 +120,8 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
62
120
  templateComponents: Record<string, WorkspaceComponent[]>;
63
121
  templateNames: Record<string, string>;
64
122
  documentProps: Record<string, WorkspaceDeviceProps>;
123
+ undoStack: WorkspaceSnapshot[];
124
+ redoStack: WorkspaceSnapshot[];
65
125
  }>) => number;
66
126
  selectedComponent: (state: {
67
127
  components: {
@@ -73,6 +133,7 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
73
133
  tablet?: Record<string, unknown> | undefined;
74
134
  desktop?: Record<string, unknown> | undefined;
75
135
  };
136
+ layoutId?: string | undefined;
76
137
  children?: /*elided*/ any[] | undefined;
77
138
  }[];
78
139
  selectedId: string | undefined;
@@ -82,6 +143,40 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
82
143
  templateComponents: Record<string, WorkspaceComponent[]>;
83
144
  templateNames: Record<string, string>;
84
145
  documentProps: Record<string, WorkspaceDeviceProps>;
146
+ undoStack: {
147
+ components: {
148
+ id: string;
149
+ type: string;
150
+ props: {
151
+ base: Record<string, unknown>;
152
+ phone?: Record<string, unknown> | undefined;
153
+ tablet?: Record<string, unknown> | undefined;
154
+ desktop?: Record<string, unknown> | undefined;
155
+ };
156
+ layoutId?: string | undefined;
157
+ children?: /*elided*/ any[] | undefined;
158
+ }[];
159
+ templateComponents: Record<string, WorkspaceComponent[]>;
160
+ documentProps: Record<string, WorkspaceDeviceProps>;
161
+ selectedId?: string | undefined;
162
+ }[];
163
+ redoStack: {
164
+ components: {
165
+ id: string;
166
+ type: string;
167
+ props: {
168
+ base: Record<string, unknown>;
169
+ phone?: Record<string, unknown> | undefined;
170
+ tablet?: Record<string, unknown> | undefined;
171
+ desktop?: Record<string, unknown> | undefined;
172
+ };
173
+ layoutId?: string | undefined;
174
+ children?: /*elided*/ any[] | undefined;
175
+ }[];
176
+ templateComponents: Record<string, WorkspaceComponent[]>;
177
+ documentProps: Record<string, WorkspaceDeviceProps>;
178
+ selectedId?: string | undefined;
179
+ }[];
85
180
  } & import("pinia").PiniaCustomStateProperties<{
86
181
  components: WorkspaceComponent[];
87
182
  selectedId: string | undefined;
@@ -91,15 +186,21 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
91
186
  templateComponents: Record<string, WorkspaceComponent[]>;
92
187
  templateNames: Record<string, string>;
93
188
  documentProps: Record<string, WorkspaceDeviceProps>;
189
+ undoStack: WorkspaceSnapshot[];
190
+ redoStack: WorkspaceSnapshot[];
94
191
  }>) => {
95
192
  props: {
96
193
  base: Record<string, unknown>;
97
194
  };
98
195
  id: string;
99
196
  type: string;
197
+ layoutId?: string;
100
198
  children?: WorkspaceComponent[];
101
199
  } | undefined;
102
200
  }, {
201
+ saveHistory(): void;
202
+ undo(): boolean;
203
+ redo(): boolean;
103
204
  setActiveTemplate(templateId?: string, templateName?: string): void;
104
205
  setActiveDevice(device: WorkspaceDevice): void;
105
206
  addComponent(type: string, index?: number, props?: Record<string, unknown>): {
@@ -108,13 +209,14 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
108
209
  props: ComponentProps;
109
210
  };
110
211
  selectDocument(): void;
111
- addChildComponent(parentId: string, type: string, props?: Record<string, unknown>): {
212
+ addChildComponent(parentId: string, type: string, index?: number, props?: Record<string, unknown>): {
112
213
  id: string;
113
214
  type: string;
114
215
  props: ComponentProps;
115
216
  } | undefined;
116
217
  canAddChild(parentId: string): boolean;
117
218
  updateComponentProps(id: string, props: Record<string, unknown>): void;
219
+ updateComponentPropsAcrossScreens(id: string, props: Record<string, unknown>, syncKeys?: string[]): void;
118
220
  getComponentProps(component: WorkspaceComponent): Record<string, unknown>;
119
221
  selectComponent(index: number): {
120
222
  id: string;
@@ -125,6 +227,7 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
125
227
  tablet?: Record<string, unknown> | undefined;
126
228
  desktop?: Record<string, unknown> | undefined;
127
229
  };
230
+ layoutId?: string | undefined;
128
231
  children?: /*elided*/ any[] | undefined;
129
232
  } | undefined;
130
233
  selectComponentById(id: string): WorkspaceComponent | undefined;
@@ -132,11 +235,23 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
132
235
  deleteSelected(): void;
133
236
  move(from: number, to: number): void;
134
237
  moveComponentBefore(sourceId: string, targetId: string): void;
238
+ moveComponentAfter(sourceId: string, targetId: string): void;
135
239
  moveComponentToRoot(id: string, index?: number): void;
136
- moveComponentInto(sourceId: string, parentId: string): void;
240
+ moveComponentInto(sourceId: string, parentId: string, index?: number): void;
241
+ moveComponentToTemplate(sourceId: string, targetTemplateId: string): void;
242
+ copyComponentToTemplate(sourceId: string, targetTemplateId: string): void;
243
+ setComponentProps(id: string, props: ComponentProps): boolean;
244
+ copyComponentProps(id: string, device?: WorkspaceDevice): {
245
+ base: Record<string, unknown>;
246
+ } | undefined;
247
+ pasteComponentProps(id: string, props: ComponentProps, device?: WorkspaceDevice): boolean;
137
248
  remove(id: string): void;
138
249
  findComponent(id: string): WorkspaceComponent | undefined;
250
+ findComponentsByType(type: string): WorkspaceComponent[];
139
251
  exportData(): WorkspaceData;
252
+ export(): WorkspaceData;
140
253
  importData(data: WorkspaceData): void;
254
+ import(data: WorkspaceData): void;
141
255
  removeComponent(components: WorkspaceComponent[], id: string): boolean;
142
256
  }>;
257
+ export {};