@aham.ro/ui-designer 0.1.12 → 0.1.14
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/Designer.vue.d.ts +13 -1
- package/dist/index.d.ts +7 -3
- package/dist/preview.d.ts +40 -0
- package/dist/stores/checklist.d.ts +1 -1
- package/dist/stores/session.d.ts +13 -0
- package/dist/stores/templates.d.ts +5 -1
- package/dist/stores/theme.d.ts +12 -5
- package/dist/stores/translations.d.ts +9 -1
- package/dist/stores/workspace.d.ts +124 -4
- package/dist/ui-designer.css +1 -1
- package/dist/ui-designer.js +5382 -2391
- package/dist/widgets/ComponenList.vue.d.ts +13 -5
- package/dist/widgets/Header.vue.d.ts +3 -0
- package/dist/widgets/Properties.vue.d.ts +10 -2
- package/dist/widgets/SideInfo.vue.d.ts +7 -0
- package/dist/widgets/TemplateList.vue.d.ts +1 -0
- package/dist/widgets/Workspace.vue.d.ts +10 -1
- package/dist/widgets/components/Alert.vue.d.ts +1 -4
- package/dist/widgets/components/Checkbox.vue.d.ts +2 -4
- package/dist/widgets/components/ConsentCard.vue.d.ts +1 -4
- package/dist/widgets/components/Container.vue.d.ts +7 -16
- package/dist/widgets/components/DatePicker.vue.d.ts +10 -0
- package/dist/widgets/components/Divider.vue.d.ts +1 -3
- package/dist/widgets/components/EmailInput.vue.d.ts +1 -5
- package/dist/widgets/components/Errors.vue.d.ts +9 -0
- package/dist/widgets/components/Heading.vue.d.ts +2 -4
- package/dist/widgets/components/Image.vue.d.ts +1 -9
- package/dist/widgets/components/Layout.vue.d.ts +3 -7
- package/dist/widgets/components/LayoutRef.vue.d.ts +13 -7
- package/dist/widgets/components/LayoutSlot.vue.d.ts +13 -0
- package/dist/widgets/components/OtpInput.vue.d.ts +1 -4
- package/dist/widgets/components/PasswordInput.vue.d.ts +5 -7
- package/dist/widgets/components/ScopeList.vue.d.ts +1 -3
- package/dist/widgets/components/SocialButton.vue.d.ts +1 -4
- package/dist/widgets/components/Spacer.vue.d.ts +1 -3
- package/dist/widgets/components/SubmitButton.vue.d.ts +1 -4
- package/dist/widgets/components/Text.vue.d.ts +2 -3
- package/dist/widgets/components/TextInput.vue.d.ts +5 -5
- package/dist/widgets/components/TextLink.vue.d.ts +4 -5
- package/dist/widgets/components/ThemeToggler.vue.d.ts +11 -0
- package/dist/widgets/components/base/AlertBase.vue.d.ts +10 -0
- package/dist/widgets/components/base/CheckboxBase.vue.d.ts +13 -0
- package/dist/widgets/components/base/ConsentCardBase.vue.d.ts +10 -0
- package/dist/widgets/components/{Card.vue.d.ts → base/ContainerBase.vue.d.ts} +10 -9
- package/dist/widgets/components/base/DatePickerBase.vue.d.ts +17 -0
- package/dist/widgets/components/base/DividerBase.vue.d.ts +8 -0
- package/dist/widgets/components/base/EmailInputBase.vue.d.ts +18 -0
- package/dist/widgets/components/base/HeadingBase.vue.d.ts +12 -0
- package/dist/widgets/components/base/ImageBase.vue.d.ts +20 -0
- package/dist/widgets/components/base/LayoutBase.vue.d.ts +22 -0
- package/dist/widgets/components/base/LayoutRefBase.vue.d.ts +23 -0
- package/dist/widgets/components/base/OtpInputBase.vue.d.ts +10 -0
- package/dist/widgets/components/base/PasswordInputBase.vue.d.ts +30 -0
- package/dist/widgets/components/base/ScopeListBase.vue.d.ts +8 -0
- package/dist/widgets/components/base/SocialButtonBase.vue.d.ts +11 -0
- package/dist/widgets/components/base/SpacerBase.vue.d.ts +8 -0
- package/dist/widgets/components/base/SubmitButtonBase.vue.d.ts +10 -0
- package/dist/widgets/components/base/TextBase.vue.d.ts +10 -0
- package/dist/widgets/components/base/TextInputBase.vue.d.ts +21 -0
- package/dist/widgets/components/base/TextLinkBase.vue.d.ts +18 -0
- package/dist/widgets/components/base/ThemeTogglerBase.vue.d.ts +20 -0
- package/dist/widgets/components/base/index.d.ts +49 -0
- package/dist/widgets/components/index.d.ts +19 -15
- package/dist/widgets/components/linkResolver.d.ts +4 -0
- package/dist/widgets/components/types.d.ts +5 -0
- package/dist/widgets/header/IconButton.vue.d.ts +1 -1
- package/dist/widgets/header/SaveButton.vue.d.ts +5 -1
- package/dist/widgets/header/types.d.ts +5 -0
- package/dist/widgets/workspace/Breadcrumb.vue.d.ts +4 -1
- package/dist/widgets/workspace/ComponentHandler.vue.d.ts +4 -4
- package/dist/widgets/workspace/Composer.vue.d.ts +4 -1
- package/dist/widgets/workspace/DataExpose.vue.d.ts +13 -0
- package/dist/widgets/workspace/Editable.vue.d.ts +18 -0
- package/dist/widgets/workspace/WorkspaceNode.vue.d.ts +11 -4
- package/dist/widgets/workspace/ZoomController.vue.d.ts +0 -1
- package/dist/widgets/workspace/configuration.d.ts +3 -4
- package/dist/widgets/workspace/editable.d.ts +8 -4
- package/package.json +5 -1
package/dist/Designer.vue.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type WorkspaceData } from './stores/workspace';
|
|
1
2
|
import type { MoreMenuItem, Template } from './widgets/header/types';
|
|
2
|
-
|
|
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,8 @@ interface Options {
|
|
|
9
11
|
};
|
|
10
12
|
size?: 'small' | 'medium' | 'large';
|
|
11
13
|
moreItems?: MoreMenuItem[];
|
|
14
|
+
links?: Record<string, string>;
|
|
15
|
+
initialWorkspace?: WorkspaceData;
|
|
12
16
|
}
|
|
13
17
|
type __VLS_Props = {
|
|
14
18
|
value: string;
|
|
@@ -17,20 +21,28 @@ type __VLS_Props = {
|
|
|
17
21
|
};
|
|
18
22
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
23
|
moreSelect: (id: string) => any;
|
|
24
|
+
save: (data: WorkspaceData, onSuccess: (versionId?: string) => void) => any;
|
|
20
25
|
componentDrop: (type: string) => any;
|
|
21
26
|
translationUpdate: (fieldId: string, value: string, language: string) => any;
|
|
22
27
|
screenSelect: (screen: Template) => any;
|
|
23
28
|
screenAdd: (screen: Template) => any;
|
|
24
29
|
screenRename: (id: string, name: string) => any;
|
|
25
30
|
themeUpdate: (color: string) => any;
|
|
31
|
+
publish: (templateId: string, versionId: string, onSuccess: (response?: unknown) => void) => any;
|
|
32
|
+
notify: (message: string, theme?: NotificationTheme | undefined) => any;
|
|
33
|
+
dirtyChange: (dirty: boolean) => any;
|
|
26
34
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
35
|
onMoreSelect?: ((id: string) => any) | undefined;
|
|
36
|
+
onSave?: ((data: WorkspaceData, onSuccess: (versionId?: string) => void) => any) | undefined;
|
|
28
37
|
onComponentDrop?: ((type: string) => any) | undefined;
|
|
29
38
|
onTranslationUpdate?: ((fieldId: string, value: string, language: string) => any) | undefined;
|
|
30
39
|
onScreenSelect?: ((screen: Template) => any) | undefined;
|
|
31
40
|
onScreenAdd?: ((screen: Template) => any) | undefined;
|
|
32
41
|
onScreenRename?: ((id: string, name: string) => any) | undefined;
|
|
33
42
|
onThemeUpdate?: ((color: string) => any) | undefined;
|
|
43
|
+
onPublish?: ((templateId: string, versionId: string, onSuccess: (response?: unknown) => void) => any) | undefined;
|
|
44
|
+
onNotify?: ((message: string, theme?: NotificationTheme | undefined) => any) | undefined;
|
|
45
|
+
onDirtyChange?: ((dirty: boolean) => any) | undefined;
|
|
34
46
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
47
|
declare const _default: typeof __VLS_export;
|
|
36
48
|
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 {
|
|
20
|
-
export type {
|
|
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,40 @@
|
|
|
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
|
+
import { type DesignerLinks } from './widgets/components/linkResolver';
|
|
6
|
+
type Translation = {
|
|
7
|
+
componentId?: string;
|
|
8
|
+
key: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
translations?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
type PreviewTemplate = RenderTemplate & {
|
|
13
|
+
templateId?: string;
|
|
14
|
+
templateName?: string;
|
|
15
|
+
templates?: Array<RenderTemplate & {
|
|
16
|
+
templateId?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
templateName?: string;
|
|
19
|
+
}>;
|
|
20
|
+
workspace?: {
|
|
21
|
+
templates?: Array<RenderTemplate & {
|
|
22
|
+
templateId?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
templateName?: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
documentProps?: Record<string, Record<string, unknown>>;
|
|
28
|
+
translations?: Translation[];
|
|
29
|
+
form?: boolean;
|
|
30
|
+
theme?: ThemeData;
|
|
31
|
+
};
|
|
32
|
+
export type PreviewRenderOptions = {
|
|
33
|
+
links?: DesignerLinks;
|
|
34
|
+
walker?: RenderWalker;
|
|
35
|
+
form?: {
|
|
36
|
+
submit?: (payload: Record<string, FormDataEntryValue | boolean>) => void;
|
|
37
|
+
} | false;
|
|
38
|
+
};
|
|
39
|
+
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>;
|
|
40
|
+
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
|
}, {}, {
|
package/dist/stores/theme.d.ts
CHANGED
|
@@ -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
|
|
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,
|
|
24
|
+
values: Record<string, ThemeValue>;
|
|
20
25
|
}, {}, {
|
|
21
26
|
registerVariables(variables: ThemeVariable[]): void;
|
|
22
|
-
|
|
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,20 +21,42 @@ 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;
|
|
51
|
+
selectedTemplateId: string | undefined;
|
|
30
52
|
activeTemplateId: string | undefined;
|
|
31
53
|
activeTemplateName: string;
|
|
32
54
|
activeDevice: WorkspaceDevice;
|
|
33
55
|
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
34
56
|
templateNames: Record<string, string>;
|
|
35
57
|
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
58
|
+
undoStack: WorkspaceSnapshot[];
|
|
59
|
+
redoStack: WorkspaceSnapshot[];
|
|
36
60
|
}, {
|
|
37
61
|
selectedIndex: (state: {
|
|
38
62
|
components: {
|
|
@@ -44,24 +68,63 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
|
|
|
44
68
|
tablet?: Record<string, unknown> | undefined;
|
|
45
69
|
desktop?: Record<string, unknown> | undefined;
|
|
46
70
|
};
|
|
71
|
+
layoutId?: string | undefined;
|
|
47
72
|
children?: /*elided*/ any[] | undefined;
|
|
48
73
|
}[];
|
|
49
74
|
selectedId: string | undefined;
|
|
75
|
+
selectedTemplateId: string | undefined;
|
|
50
76
|
activeTemplateId: string | undefined;
|
|
51
77
|
activeTemplateName: string;
|
|
52
78
|
activeDevice: WorkspaceDevice;
|
|
53
79
|
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
54
80
|
templateNames: Record<string, string>;
|
|
55
81
|
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
82
|
+
undoStack: {
|
|
83
|
+
components: {
|
|
84
|
+
id: string;
|
|
85
|
+
type: string;
|
|
86
|
+
props: {
|
|
87
|
+
base: Record<string, unknown>;
|
|
88
|
+
phone?: Record<string, unknown> | undefined;
|
|
89
|
+
tablet?: Record<string, unknown> | undefined;
|
|
90
|
+
desktop?: Record<string, unknown> | undefined;
|
|
91
|
+
};
|
|
92
|
+
layoutId?: string | undefined;
|
|
93
|
+
children?: /*elided*/ any[] | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
96
|
+
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
97
|
+
selectedId?: string | undefined;
|
|
98
|
+
}[];
|
|
99
|
+
redoStack: {
|
|
100
|
+
components: {
|
|
101
|
+
id: string;
|
|
102
|
+
type: string;
|
|
103
|
+
props: {
|
|
104
|
+
base: Record<string, unknown>;
|
|
105
|
+
phone?: Record<string, unknown> | undefined;
|
|
106
|
+
tablet?: Record<string, unknown> | undefined;
|
|
107
|
+
desktop?: Record<string, unknown> | undefined;
|
|
108
|
+
};
|
|
109
|
+
layoutId?: string | undefined;
|
|
110
|
+
children?: /*elided*/ any[] | undefined;
|
|
111
|
+
}[];
|
|
112
|
+
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
113
|
+
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
114
|
+
selectedId?: string | undefined;
|
|
115
|
+
}[];
|
|
56
116
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
57
117
|
components: WorkspaceComponent[];
|
|
58
118
|
selectedId: string | undefined;
|
|
119
|
+
selectedTemplateId: string | undefined;
|
|
59
120
|
activeTemplateId: string | undefined;
|
|
60
121
|
activeTemplateName: string;
|
|
61
122
|
activeDevice: WorkspaceDevice;
|
|
62
123
|
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
63
124
|
templateNames: Record<string, string>;
|
|
64
125
|
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
126
|
+
undoStack: WorkspaceSnapshot[];
|
|
127
|
+
redoStack: WorkspaceSnapshot[];
|
|
65
128
|
}>) => number;
|
|
66
129
|
selectedComponent: (state: {
|
|
67
130
|
components: {
|
|
@@ -73,33 +136,76 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
|
|
|
73
136
|
tablet?: Record<string, unknown> | undefined;
|
|
74
137
|
desktop?: Record<string, unknown> | undefined;
|
|
75
138
|
};
|
|
139
|
+
layoutId?: string | undefined;
|
|
76
140
|
children?: /*elided*/ any[] | undefined;
|
|
77
141
|
}[];
|
|
78
142
|
selectedId: string | undefined;
|
|
143
|
+
selectedTemplateId: string | undefined;
|
|
79
144
|
activeTemplateId: string | undefined;
|
|
80
145
|
activeTemplateName: string;
|
|
81
146
|
activeDevice: WorkspaceDevice;
|
|
82
147
|
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
83
148
|
templateNames: Record<string, string>;
|
|
84
149
|
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
150
|
+
undoStack: {
|
|
151
|
+
components: {
|
|
152
|
+
id: string;
|
|
153
|
+
type: string;
|
|
154
|
+
props: {
|
|
155
|
+
base: Record<string, unknown>;
|
|
156
|
+
phone?: Record<string, unknown> | undefined;
|
|
157
|
+
tablet?: Record<string, unknown> | undefined;
|
|
158
|
+
desktop?: Record<string, unknown> | undefined;
|
|
159
|
+
};
|
|
160
|
+
layoutId?: string | undefined;
|
|
161
|
+
children?: /*elided*/ any[] | undefined;
|
|
162
|
+
}[];
|
|
163
|
+
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
164
|
+
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
165
|
+
selectedId?: string | undefined;
|
|
166
|
+
}[];
|
|
167
|
+
redoStack: {
|
|
168
|
+
components: {
|
|
169
|
+
id: string;
|
|
170
|
+
type: string;
|
|
171
|
+
props: {
|
|
172
|
+
base: Record<string, unknown>;
|
|
173
|
+
phone?: Record<string, unknown> | undefined;
|
|
174
|
+
tablet?: Record<string, unknown> | undefined;
|
|
175
|
+
desktop?: Record<string, unknown> | undefined;
|
|
176
|
+
};
|
|
177
|
+
layoutId?: string | undefined;
|
|
178
|
+
children?: /*elided*/ any[] | undefined;
|
|
179
|
+
}[];
|
|
180
|
+
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
181
|
+
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
182
|
+
selectedId?: string | undefined;
|
|
183
|
+
}[];
|
|
85
184
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
86
185
|
components: WorkspaceComponent[];
|
|
87
186
|
selectedId: string | undefined;
|
|
187
|
+
selectedTemplateId: string | undefined;
|
|
88
188
|
activeTemplateId: string | undefined;
|
|
89
189
|
activeTemplateName: string;
|
|
90
190
|
activeDevice: WorkspaceDevice;
|
|
91
191
|
templateComponents: Record<string, WorkspaceComponent[]>;
|
|
92
192
|
templateNames: Record<string, string>;
|
|
93
193
|
documentProps: Record<string, WorkspaceDeviceProps>;
|
|
194
|
+
undoStack: WorkspaceSnapshot[];
|
|
195
|
+
redoStack: WorkspaceSnapshot[];
|
|
94
196
|
}>) => {
|
|
95
197
|
props: {
|
|
96
198
|
base: Record<string, unknown>;
|
|
97
199
|
};
|
|
98
200
|
id: string;
|
|
99
201
|
type: string;
|
|
202
|
+
layoutId?: string;
|
|
100
203
|
children?: WorkspaceComponent[];
|
|
101
204
|
} | undefined;
|
|
102
205
|
}, {
|
|
206
|
+
saveHistory(): void;
|
|
207
|
+
undo(): boolean;
|
|
208
|
+
redo(): boolean;
|
|
103
209
|
setActiveTemplate(templateId?: string, templateName?: string): void;
|
|
104
210
|
setActiveDevice(device: WorkspaceDevice): void;
|
|
105
211
|
addComponent(type: string, index?: number, props?: Record<string, unknown>): {
|
|
@@ -108,13 +214,14 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
|
|
|
108
214
|
props: ComponentProps;
|
|
109
215
|
};
|
|
110
216
|
selectDocument(): void;
|
|
111
|
-
addChildComponent(parentId: string, type: string, props?: Record<string, unknown>): {
|
|
217
|
+
addChildComponent(parentId: string, type: string, index?: number, props?: Record<string, unknown>): {
|
|
112
218
|
id: string;
|
|
113
219
|
type: string;
|
|
114
220
|
props: ComponentProps;
|
|
115
221
|
} | undefined;
|
|
116
222
|
canAddChild(parentId: string): boolean;
|
|
117
223
|
updateComponentProps(id: string, props: Record<string, unknown>): void;
|
|
224
|
+
updateComponentPropsAcrossDevices(id: string, props: Record<string, unknown>, syncKeys?: string[]): void;
|
|
118
225
|
getComponentProps(component: WorkspaceComponent): Record<string, unknown>;
|
|
119
226
|
selectComponent(index: number): {
|
|
120
227
|
id: string;
|
|
@@ -125,18 +232,31 @@ export declare const useWorkspaceStore: import("pinia").StoreDefinition<"workspa
|
|
|
125
232
|
tablet?: Record<string, unknown> | undefined;
|
|
126
233
|
desktop?: Record<string, unknown> | undefined;
|
|
127
234
|
};
|
|
235
|
+
layoutId?: string | undefined;
|
|
128
236
|
children?: /*elided*/ any[] | undefined;
|
|
129
237
|
} | undefined;
|
|
130
|
-
selectComponentById(id: string): WorkspaceComponent | undefined;
|
|
238
|
+
selectComponentById(id: string, templateId?: string): WorkspaceComponent | undefined;
|
|
131
239
|
deselect(): void;
|
|
132
240
|
deleteSelected(): void;
|
|
133
241
|
move(from: number, to: number): void;
|
|
134
242
|
moveComponentBefore(sourceId: string, targetId: string): void;
|
|
243
|
+
moveComponentAfter(sourceId: string, targetId: string): void;
|
|
135
244
|
moveComponentToRoot(id: string, index?: number): void;
|
|
136
|
-
moveComponentInto(sourceId: string, parentId: string): void;
|
|
245
|
+
moveComponentInto(sourceId: string, parentId: string, index?: number): void;
|
|
246
|
+
moveComponentToTemplate(sourceId: string, targetTemplateId: string): void;
|
|
247
|
+
copyComponentToTemplate(sourceId: string, targetTemplateId: string): void;
|
|
248
|
+
setComponentProps(id: string, props: ComponentProps): boolean;
|
|
249
|
+
copyComponentProps(id: string, device?: WorkspaceDevice): {
|
|
250
|
+
base: Record<string, unknown>;
|
|
251
|
+
} | undefined;
|
|
252
|
+
pasteComponentProps(id: string, props: ComponentProps, device?: WorkspaceDevice): boolean;
|
|
137
253
|
remove(id: string): void;
|
|
138
254
|
findComponent(id: string): WorkspaceComponent | undefined;
|
|
255
|
+
findComponentsByType(type: string): WorkspaceComponent[];
|
|
139
256
|
exportData(): WorkspaceData;
|
|
257
|
+
export(): WorkspaceData;
|
|
140
258
|
importData(data: WorkspaceData): void;
|
|
259
|
+
import(data: WorkspaceData): void;
|
|
141
260
|
removeComponent(components: WorkspaceComponent[], id: string): boolean;
|
|
142
261
|
}>;
|
|
262
|
+
export {};
|