@lightspeed/crane 1.1.1 → 1.1.3
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/app.d.mts +76 -8
- package/dist/app.d.ts +76 -8
- package/dist/app.mjs +1 -1
- package/dist/cli.mjs +10 -23
- package/package.json +6 -5
- package/template/footers/example-footer/ExampleFooter.vue +12 -2
- package/template/footers/example-footer/assets/cart.svg +19 -0
- package/template/footers/example-footer/component/LegalLinks.vue +20 -0
- package/template/footers/example-footer/component/MadeWith.vue +23 -0
- package/template/footers/example-footer/component/ReportAbuse.vue +4 -3
- package/template/footers/example-footer/showcases/1.ts +1 -1
- package/template/headers/example-header/ExampleHeader.vue +38 -4
- package/template/headers/example-header/assets/account_icon.svg +11 -0
- package/template/headers/example-header/assets/lightspeed_logo.png +0 -0
- package/template/headers/example-header/component/Account.vue +20 -0
- package/template/headers/example-header/component/Cart.vue +14 -33
- package/template/headers/example-header/component/Logo.vue +95 -0
- package/template/headers/example-header/component/NavigationMenu.vue +53 -0
- package/template/headers/example-header/settings/translations.ts +6 -2
- package/template/headers/example-header/showcases/1.ts +32 -3
- package/template/headers/example-header/showcases/2.ts +42 -0
- package/template/headers/example-header/showcases/translations.ts +14 -2
- package/template/package.json +1 -1
- package/template/reference/sections/about-us/AboutUs.vue +73 -0
- package/template/reference/sections/about-us/assets/our_company_in_numbers.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_company_in_numbers_preview.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_team.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_team_preview.jpg +0 -0
- package/template/reference/sections/about-us/client.ts +6 -0
- package/template/reference/sections/about-us/component/Image.vue +94 -0
- package/template/reference/sections/about-us/component/Stats.vue +155 -0
- package/template/reference/sections/about-us/component/Title.vue +32 -0
- package/template/reference/sections/about-us/server.ts +6 -0
- package/template/reference/sections/about-us/settings/content.ts +64 -0
- package/template/reference/sections/about-us/settings/design.ts +74 -0
- package/template/reference/sections/about-us/settings/layout.ts +12 -0
- package/template/reference/sections/about-us/settings/translations.ts +151 -0
- package/template/reference/sections/about-us/showcases/1.ts +176 -0
- package/template/reference/sections/about-us/showcases/2.ts +160 -0
- package/template/reference/sections/about-us/showcases/translations.ts +259 -0
- package/template/reference/sections/about-us/type.ts +5 -0
- package/template/reference/sections/about-us/util/visibility-provider.ts +27 -0
- package/template/reference/sections/intro-slider/IntroSlider.vue +77 -0
- package/template/reference/sections/intro-slider/assets/bike_1.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_1@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_2.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_2@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_3.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_3@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_4.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_4@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_5.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_5@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_6.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_6@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_1.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_1@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_2.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_2@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_3.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_3@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_5.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_5@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_6.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_6@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/custom_section_showcase_1_preview.png +0 -0
- package/template/reference/sections/intro-slider/assets/custom_section_showcase_2_preview.png +0 -0
- package/template/reference/sections/intro-slider/client.ts +5 -0
- package/template/reference/sections/intro-slider/component/Slider.vue +235 -0
- package/template/reference/sections/intro-slider/component/Title.vue +106 -0
- package/template/reference/sections/intro-slider/entity/color.ts +4 -0
- package/template/reference/sections/intro-slider/server.ts +5 -0
- package/template/reference/sections/intro-slider/settings/content.ts +43 -0
- package/template/reference/sections/intro-slider/settings/design.ts +88 -0
- package/template/reference/sections/intro-slider/settings/layout.ts +12 -0
- package/template/reference/sections/intro-slider/settings/translations.ts +53 -0
- package/template/reference/sections/intro-slider/showcases/1.ts +274 -0
- package/template/reference/sections/intro-slider/showcases/2.ts +270 -0
- package/template/reference/sections/intro-slider/showcases/translations.ts +88 -0
- package/template/reference/sections/intro-slider/type.ts +5 -0
- package/template/reference/sections/tag-lines/TagLines.vue +158 -0
- package/template/reference/sections/tag-lines/assets/explore_our_holiday_gift_guide.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/fall_is_here.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/fall_is_here_preview.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/folding_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/hybrid_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/mountain_and_road_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/shop_chelsea_boots.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/sweater_weather.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/what_we_sell.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/what_we_sell_preview.jpg +0 -0
- package/template/reference/sections/tag-lines/client.ts +5 -0
- package/template/reference/sections/tag-lines/component/HighlightedText.vue +50 -0
- package/template/reference/sections/tag-lines/component/SectionImage.vue +78 -0
- package/template/reference/sections/tag-lines/component/Title.vue +51 -0
- package/template/reference/sections/tag-lines/composables/highlighted-text-image-list.ts +34 -0
- package/template/reference/sections/tag-lines/server.ts +5 -0
- package/template/reference/sections/tag-lines/settings/content.ts +37 -0
- package/template/reference/sections/tag-lines/settings/design.ts +81 -0
- package/template/reference/sections/tag-lines/settings/layout.ts +12 -0
- package/template/reference/sections/tag-lines/settings/translations.ts +61 -0
- package/template/reference/sections/tag-lines/showcases/1.ts +190 -0
- package/template/reference/sections/tag-lines/showcases/2.ts +190 -0
- package/template/reference/sections/tag-lines/showcases/translations.ts +49 -0
- package/template/reference/sections/tag-lines/type.ts +5 -0
- package/template/reference/shared/components/Button.vue +151 -0
- package/template/reference/shared/components/SectionWrapper.vue +26 -0
- package/template/reference/shared/components/Tagline.vue +45 -0
- package/template/reference/shared/utils/color.ts +16 -0
- package/template/reference/shared/utils/styles.ts +12 -0
- package/template/reference/templates/assets/reference_template_apparel_cover_image.jpg +0 -0
- package/template/reference/templates/assets/reference_template_bike_cover_image.jpg +0 -0
- package/template/reference/templates/reference-template-apparel.ts +44 -0
- package/template/reference/templates/reference-template-bike.ts +44 -0
- package/template/sections/example-section/ExampleSection.vue +8 -19
- package/template/sections/example-section/assets/bike_accessories_high.jpg +0 -0
- package/template/sections/example-section/assets/bike_accessories_low.jpg +0 -0
- package/template/sections/example-section/assets/bike_new_arrivals_high.jpg +0 -0
- package/template/sections/example-section/assets/bike_new_arrivals_low.jpg +0 -0
- package/template/sections/example-section/assets/custom_section_showcase_3_preview.jpg +0 -0
- package/template/sections/example-section/assets/fixed_gears_high.jpg +0 -0
- package/template/sections/example-section/assets/fixed_gears_low.jpg +0 -0
- package/template/sections/example-section/assets/repair_service_high.jpg +0 -0
- package/template/sections/example-section/assets/repair_service_low.jpg +0 -0
- package/template/sections/example-section/settings/translations.ts +39 -7
- package/template/sections/example-section/showcases/3.ts +198 -0
- package/template/sections/example-section/showcases/translations.ts +49 -1
- package/template/shared/components/LanguageSelector.vue +75 -0
- package/template/shared/components/SectionWrapper.vue +26 -0
- package/template/templates/template.ts +28 -43
- package/types.d.ts +264 -141
- package/template/headers/example-header/component/SampleComponent.vue +0 -11
package/dist/app.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
1
2
|
import { App, Ref, Component } from 'vue';
|
|
2
3
|
|
|
3
4
|
interface AppBaseContext {
|
|
@@ -12,7 +13,7 @@ interface AppBaseData<C, D> {
|
|
|
12
13
|
readonly content: C;
|
|
13
14
|
readonly design: D;
|
|
14
15
|
readonly defaults: Record<string, unknown>;
|
|
15
|
-
readonly externalContent:
|
|
16
|
+
readonly externalContent: ExternalContentData;
|
|
16
17
|
}
|
|
17
18
|
interface AppBaseState<C, D> {
|
|
18
19
|
readonly context: AppBaseContext;
|
|
@@ -20,13 +21,13 @@ interface AppBaseState<C, D> {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
interface VueBaseProps<CONTENT, DESIGN> {
|
|
23
|
-
init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent:
|
|
24
|
-
update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent:
|
|
24
|
+
init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData) => void;
|
|
25
|
+
update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData) => void;
|
|
25
26
|
readonly context: Ref<AppBaseContext>;
|
|
26
27
|
readonly content: Ref<CONTENT>;
|
|
27
28
|
readonly design: Ref<DESIGN>;
|
|
28
29
|
readonly defaults: Ref<Record<string, unknown>>;
|
|
29
|
-
readonly
|
|
30
|
+
readonly site: Ref<SiteContent>;
|
|
30
31
|
}
|
|
31
32
|
declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
|
|
32
33
|
|
|
@@ -50,17 +51,29 @@ declare function useTextareaElementContent<CONTENT>(elementName: string, externa
|
|
|
50
51
|
|
|
51
52
|
interface ButtonContent {
|
|
52
53
|
title: string;
|
|
53
|
-
|
|
54
|
+
type: ActionLinkType;
|
|
55
|
+
link?: string;
|
|
56
|
+
email?: string;
|
|
57
|
+
phone?: string;
|
|
58
|
+
tileDivId?: string;
|
|
59
|
+
pageId?: string;
|
|
60
|
+
pageUrl?: string;
|
|
54
61
|
hasTitle: boolean;
|
|
55
62
|
hasLink: boolean;
|
|
56
63
|
performAction: () => void;
|
|
57
64
|
}
|
|
58
65
|
declare function useButtonElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
|
|
59
66
|
title: string | undefined;
|
|
67
|
+
type: ActionLinkType | undefined;
|
|
60
68
|
link: string | undefined;
|
|
69
|
+
email: string | undefined;
|
|
70
|
+
phone: string | undefined;
|
|
71
|
+
tileDivId: string | null;
|
|
72
|
+
pageId: string | undefined;
|
|
73
|
+
pageUrl: string | undefined;
|
|
61
74
|
hasTitle: boolean;
|
|
62
75
|
hasLink: boolean;
|
|
63
|
-
performAction: () => void;
|
|
76
|
+
performAction: (() => void) | undefined;
|
|
64
77
|
};
|
|
65
78
|
|
|
66
79
|
interface ImageContent {
|
|
@@ -96,6 +109,42 @@ declare function useSelectboxElementContent<CONTENT>(elementName: string, extern
|
|
|
96
109
|
value: string | undefined;
|
|
97
110
|
};
|
|
98
111
|
|
|
112
|
+
declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
|
|
113
|
+
hasContent: boolean;
|
|
114
|
+
items: {
|
|
115
|
+
performAction: (() => void) | undefined;
|
|
116
|
+
id: string;
|
|
117
|
+
title?: string | undefined;
|
|
118
|
+
type?: string | undefined;
|
|
119
|
+
link?: string | undefined;
|
|
120
|
+
email?: string | undefined;
|
|
121
|
+
phone?: string | undefined;
|
|
122
|
+
tileIdForScroll?: string | undefined;
|
|
123
|
+
pageIdForNavigate?: string | undefined;
|
|
124
|
+
showStoreCategories?: boolean | undefined;
|
|
125
|
+
isSubmenuOpened?: boolean | undefined;
|
|
126
|
+
categoryId?: number | undefined;
|
|
127
|
+
}[];
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare function useNavigationMenuElementContent<CONTENT>(): {
|
|
131
|
+
hasContent: boolean;
|
|
132
|
+
items: {
|
|
133
|
+
performAction: (() => void) | undefined;
|
|
134
|
+
id: string;
|
|
135
|
+
title?: string | undefined;
|
|
136
|
+
type?: string | undefined;
|
|
137
|
+
link?: string | undefined;
|
|
138
|
+
email?: string | undefined;
|
|
139
|
+
phone?: string | undefined;
|
|
140
|
+
tileIdForScroll?: string | undefined;
|
|
141
|
+
pageIdForNavigate?: string | undefined;
|
|
142
|
+
showStoreCategories?: boolean | undefined;
|
|
143
|
+
isSubmenuOpened?: boolean | undefined;
|
|
144
|
+
categoryId?: number | undefined;
|
|
145
|
+
}[];
|
|
146
|
+
};
|
|
147
|
+
|
|
99
148
|
interface Card {
|
|
100
149
|
title: string;
|
|
101
150
|
settings: Record<string, unknown>;
|
|
@@ -121,10 +170,16 @@ declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes,
|
|
|
121
170
|
value: string | undefined;
|
|
122
171
|
} | {
|
|
123
172
|
title: string | undefined;
|
|
173
|
+
type: ActionLinkType | undefined;
|
|
124
174
|
link: string | undefined;
|
|
175
|
+
email: string | undefined;
|
|
176
|
+
phone: string | undefined;
|
|
177
|
+
tileDivId: string | null;
|
|
178
|
+
pageId: string | undefined;
|
|
179
|
+
pageUrl: string | undefined;
|
|
125
180
|
hasTitle: boolean;
|
|
126
181
|
hasLink: boolean;
|
|
127
|
-
performAction: () => void;
|
|
182
|
+
performAction: (() => void) | undefined;
|
|
128
183
|
} | {
|
|
129
184
|
hasContent: boolean;
|
|
130
185
|
lowResolutionMobileImage: string;
|
|
@@ -136,6 +191,17 @@ declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes,
|
|
|
136
191
|
value: boolean | undefined;
|
|
137
192
|
} | undefined;
|
|
138
193
|
|
|
194
|
+
declare function useLogoElementContent<CONTENT>(): {
|
|
195
|
+
type: LogoType | undefined;
|
|
196
|
+
text: string | undefined;
|
|
197
|
+
image: {
|
|
198
|
+
lowResolutionMobileImage: string;
|
|
199
|
+
highResolutionMobileImage: string;
|
|
200
|
+
lowResolutionDesktopImage: string;
|
|
201
|
+
highResolutionDesktopImage: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
|
|
139
205
|
declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
|
|
140
206
|
font: string | undefined;
|
|
141
207
|
size: number | GlobalTextSizeString | undefined;
|
|
@@ -185,6 +251,8 @@ declare function useLayoutElementDesign(): {
|
|
|
185
251
|
layout: string | undefined;
|
|
186
252
|
};
|
|
187
253
|
|
|
254
|
+
declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
|
|
255
|
+
|
|
188
256
|
interface VueServerAppExtensions {
|
|
189
257
|
init?: (app: App<Element>) => void;
|
|
190
258
|
render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
|
|
@@ -278,4 +346,4 @@ interface InstantsiteJSAPI {
|
|
|
278
346
|
|
|
279
347
|
declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
|
|
280
348
|
|
|
281
|
-
export { type ButtonContent, type Card, type Deck, EditorTypes, type ImageContent, type InputBoxContent, type SelectBoxContent, type TextAreaContent, type ToggleContent, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
|
|
349
|
+
export { type ButtonContent, type Card, type Deck, EditorTypes, type ImageContent, type InputBoxContent, type SelectBoxContent, type TextAreaContent, type ToggleContent, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
|
package/dist/app.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
1
2
|
import { App, Ref, Component } from 'vue';
|
|
2
3
|
|
|
3
4
|
interface AppBaseContext {
|
|
@@ -12,7 +13,7 @@ interface AppBaseData<C, D> {
|
|
|
12
13
|
readonly content: C;
|
|
13
14
|
readonly design: D;
|
|
14
15
|
readonly defaults: Record<string, unknown>;
|
|
15
|
-
readonly externalContent:
|
|
16
|
+
readonly externalContent: ExternalContentData;
|
|
16
17
|
}
|
|
17
18
|
interface AppBaseState<C, D> {
|
|
18
19
|
readonly context: AppBaseContext;
|
|
@@ -20,13 +21,13 @@ interface AppBaseState<C, D> {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
interface VueBaseProps<CONTENT, DESIGN> {
|
|
23
|
-
init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent:
|
|
24
|
-
update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent:
|
|
24
|
+
init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData) => void;
|
|
25
|
+
update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData) => void;
|
|
25
26
|
readonly context: Ref<AppBaseContext>;
|
|
26
27
|
readonly content: Ref<CONTENT>;
|
|
27
28
|
readonly design: Ref<DESIGN>;
|
|
28
29
|
readonly defaults: Ref<Record<string, unknown>>;
|
|
29
|
-
readonly
|
|
30
|
+
readonly site: Ref<SiteContent>;
|
|
30
31
|
}
|
|
31
32
|
declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
|
|
32
33
|
|
|
@@ -50,17 +51,29 @@ declare function useTextareaElementContent<CONTENT>(elementName: string, externa
|
|
|
50
51
|
|
|
51
52
|
interface ButtonContent {
|
|
52
53
|
title: string;
|
|
53
|
-
|
|
54
|
+
type: ActionLinkType;
|
|
55
|
+
link?: string;
|
|
56
|
+
email?: string;
|
|
57
|
+
phone?: string;
|
|
58
|
+
tileDivId?: string;
|
|
59
|
+
pageId?: string;
|
|
60
|
+
pageUrl?: string;
|
|
54
61
|
hasTitle: boolean;
|
|
55
62
|
hasLink: boolean;
|
|
56
63
|
performAction: () => void;
|
|
57
64
|
}
|
|
58
65
|
declare function useButtonElementContent<CONTENT>(elementName: string, externalContent?: Record<string, unknown>): {
|
|
59
66
|
title: string | undefined;
|
|
67
|
+
type: ActionLinkType | undefined;
|
|
60
68
|
link: string | undefined;
|
|
69
|
+
email: string | undefined;
|
|
70
|
+
phone: string | undefined;
|
|
71
|
+
tileDivId: string | null;
|
|
72
|
+
pageId: string | undefined;
|
|
73
|
+
pageUrl: string | undefined;
|
|
61
74
|
hasTitle: boolean;
|
|
62
75
|
hasLink: boolean;
|
|
63
|
-
performAction: () => void;
|
|
76
|
+
performAction: (() => void) | undefined;
|
|
64
77
|
};
|
|
65
78
|
|
|
66
79
|
interface ImageContent {
|
|
@@ -96,6 +109,42 @@ declare function useSelectboxElementContent<CONTENT>(elementName: string, extern
|
|
|
96
109
|
value: string | undefined;
|
|
97
110
|
};
|
|
98
111
|
|
|
112
|
+
declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
|
|
113
|
+
hasContent: boolean;
|
|
114
|
+
items: {
|
|
115
|
+
performAction: (() => void) | undefined;
|
|
116
|
+
id: string;
|
|
117
|
+
title?: string | undefined;
|
|
118
|
+
type?: string | undefined;
|
|
119
|
+
link?: string | undefined;
|
|
120
|
+
email?: string | undefined;
|
|
121
|
+
phone?: string | undefined;
|
|
122
|
+
tileIdForScroll?: string | undefined;
|
|
123
|
+
pageIdForNavigate?: string | undefined;
|
|
124
|
+
showStoreCategories?: boolean | undefined;
|
|
125
|
+
isSubmenuOpened?: boolean | undefined;
|
|
126
|
+
categoryId?: number | undefined;
|
|
127
|
+
}[];
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare function useNavigationMenuElementContent<CONTENT>(): {
|
|
131
|
+
hasContent: boolean;
|
|
132
|
+
items: {
|
|
133
|
+
performAction: (() => void) | undefined;
|
|
134
|
+
id: string;
|
|
135
|
+
title?: string | undefined;
|
|
136
|
+
type?: string | undefined;
|
|
137
|
+
link?: string | undefined;
|
|
138
|
+
email?: string | undefined;
|
|
139
|
+
phone?: string | undefined;
|
|
140
|
+
tileIdForScroll?: string | undefined;
|
|
141
|
+
pageIdForNavigate?: string | undefined;
|
|
142
|
+
showStoreCategories?: boolean | undefined;
|
|
143
|
+
isSubmenuOpened?: boolean | undefined;
|
|
144
|
+
categoryId?: number | undefined;
|
|
145
|
+
}[];
|
|
146
|
+
};
|
|
147
|
+
|
|
99
148
|
interface Card {
|
|
100
149
|
title: string;
|
|
101
150
|
settings: Record<string, unknown>;
|
|
@@ -121,10 +170,16 @@ declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes,
|
|
|
121
170
|
value: string | undefined;
|
|
122
171
|
} | {
|
|
123
172
|
title: string | undefined;
|
|
173
|
+
type: ActionLinkType | undefined;
|
|
124
174
|
link: string | undefined;
|
|
175
|
+
email: string | undefined;
|
|
176
|
+
phone: string | undefined;
|
|
177
|
+
tileDivId: string | null;
|
|
178
|
+
pageId: string | undefined;
|
|
179
|
+
pageUrl: string | undefined;
|
|
125
180
|
hasTitle: boolean;
|
|
126
181
|
hasLink: boolean;
|
|
127
|
-
performAction: () => void;
|
|
182
|
+
performAction: (() => void) | undefined;
|
|
128
183
|
} | {
|
|
129
184
|
hasContent: boolean;
|
|
130
185
|
lowResolutionMobileImage: string;
|
|
@@ -136,6 +191,17 @@ declare function getReactiveRef(card: Card | undefined, editorType: EditorTypes,
|
|
|
136
191
|
value: boolean | undefined;
|
|
137
192
|
} | undefined;
|
|
138
193
|
|
|
194
|
+
declare function useLogoElementContent<CONTENT>(): {
|
|
195
|
+
type: LogoType | undefined;
|
|
196
|
+
text: string | undefined;
|
|
197
|
+
image: {
|
|
198
|
+
lowResolutionMobileImage: string;
|
|
199
|
+
highResolutionMobileImage: string;
|
|
200
|
+
lowResolutionDesktopImage: string;
|
|
201
|
+
highResolutionDesktopImage: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
|
|
139
205
|
declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
|
|
140
206
|
font: string | undefined;
|
|
141
207
|
size: number | GlobalTextSizeString | undefined;
|
|
@@ -185,6 +251,8 @@ declare function useLayoutElementDesign(): {
|
|
|
185
251
|
layout: string | undefined;
|
|
186
252
|
};
|
|
187
253
|
|
|
254
|
+
declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
|
|
255
|
+
|
|
188
256
|
interface VueServerAppExtensions {
|
|
189
257
|
init?: (app: App<Element>) => void;
|
|
190
258
|
render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
|
|
@@ -278,4 +346,4 @@ interface InstantsiteJSAPI {
|
|
|
278
346
|
|
|
279
347
|
declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
|
|
280
348
|
|
|
281
|
-
export { type ButtonContent, type Card, type Deck, EditorTypes, type ImageContent, type InputBoxContent, type SelectBoxContent, type TextAreaContent, type ToggleContent, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
|
|
349
|
+
export { type ButtonContent, type Card, type Deck, EditorTypes, type ImageContent, type InputBoxContent, type SelectBoxContent, type TextAreaContent, type ToggleContent, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
|
package/dist/app.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentInstance as z,ref as b,computed as r,reactive as f,createSSRApp as D}from"vue";import{renderToString as L}from"vue/server-renderer";const w=new Map;function v(){const n=(a,l,u,d,s,i)=>{w.set(a._uid,{context:b(l),content:b(u),design:b(d),defaults:b(s),externalContent:b(i)})},t=(a,l,u,d,s)=>{const i=w.get(a._uid);i!==void 0&&(i.content.value=l,i.design.value=u,i.defaults.value=d,i.externalContent.value=s)},e=z()?.appContext.app._uid??-1,o=w.get(e);return{init:n,update:t,context:o?.context,content:o?.content,design:o?.design,defaults:o?.defaults,externalContent:o?.externalContent}}function C(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return $(o,n)}function $(n,t){const e=r(()=>{const l=n.value[t];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${t} is not inputbox`)}}),o=r(()=>e.value!==void 0),a=r(()=>e.value);return f({hasContent:o,value:a})}function h(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return B(o,n)}function B(n,t){const e=r(()=>{const l=n.value[t];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${t} is not textarea`)}}),o=r(()=>e.value!==void 0),a=r(()=>e.value);return f({hasContent:o,value:a})}function R(n){return"title"in n&&"type"in n}function T(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return S(o,n)}function S(n,t){const e=r(()=>{const s=n.value[t];if(s!==void 0){if(R(s))return s;throw new Error(`Element ${t} is not action link`)}}),o=r(()=>e.value?.title),a=r(()=>e.value?.link),l=r(()=>!!o.value),u=r(()=>!!a.value),d=s=>{if(s?.pageUrl)return s.pageUrl;switch(s?.pageId){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}};return f({title:o,link:a,hasTitle:l,hasLink:u,performAction:()=>{if(e.value!==void 0)switch(e.value.type){case"HYPER_LINK":e.value.link&&window.open(e.value.link,"_blank");break;case"GO_TO_STORE_LINK":window.open("/products");break;case"GO_TO_PAGE":window.open(d(e.value));break;case"MAIL_LINK":e.value.email&&window.open(`mailto:${e.value.email}`,"_self");break;case"TEL_LINK":e.value.phone&&window.open(`tel:${e.value.phone}`,"_self");break;case"SCROLL_TO_TILE":{if(typeof document>"u")return;const s=e.value.tileId;document.getElementById(`tile-${s}`)?.scrollIntoView();break}default:throw new Error(`Unknown ButtonType: ${e.value.type}`)}}})}function G(n){return"bucket"in n&&"borderInfo"in n&&"set"in n}function m(n,t){const e=new RegExp(/^https?:\/\//);return n!=null&&e.test(n)?n:`${t}/${n}`}function x(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return N(o,n)}function N(n,t){const e=r(()=>{const i=n.value[t];if(i!==void 0){if(G(i))return i;throw new Error(`Element ${t} is not image`)}}),o=r(()=>e.value===void 0?"":v().context.value.imageBuckets?.[e.value?.bucket]),a=r(()=>e.value!==void 0),l=r(()=>m(e.value?.set?.["cropped-webp-100x200"]?.url,o.value)),u=r(()=>m(e.value?.set?.["cropped-webp-1000x2000"]?.url,o.value)),d=r(()=>m(e.value?.set?.["webp-200x200"]?.url,o.value)),s=r(()=>m(e.value?.set?.["webp-2000x2000"]?.url,o.value));return f({hasContent:a,lowResolutionMobileImage:l,highResolutionMobileImage:u,lowResolutionDesktopImage:d,highResolutionDesktopImage:s})}function U(n){return"enabled"in n}function k(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return X(o,n)}function X(n,t){const e=r(()=>{const l=n.value[t];if(l!==void 0){if(U(l))return l;throw new Error(`Element ${t} is not toggle`)}}),o=r(()=>e.value!==void 0),a=r(()=>e.value?.enabled);return f({hasContent:o,value:a})}function I(n,t){const e=v(),o=r(()=>t!==void 0?t:e.content.value);return M(o,n)}function M(n,t){const e=r(()=>{const l=n.value[t];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${t} is not selectbox`)}}),o=r(()=>e.value!==void 0),a=r(()=>e.value);return f({hasContent:o,value:a})}var A=(n=>(n.INPUTBOX="INPUTBOX",n.TEXTAREA="TEXTAREA",n.BUTTON="BUTTON",n.IMAGE="IMAGE",n.TOGGLE="TOGGLE",n.SELECTBOX="SELECTBOX",n))(A||{});function P(n){if(typeof n!="object"||n===null)return!1;const t=n;return Array.isArray(t.cards)&&t.cards.every(e=>typeof e.settings=="object"&&e.settings!==null)}function K(n){const t=v(),e=r(()=>{const l=t.content.value[n];if(l!==void 0){if(P(l))return l;throw new Error(`Element ${n} is not of DECK type`)}}),o=r(()=>e.value!==void 0&&e.value.cards.length>0),a=r(()=>e.value?.cards);return f({hasContent:o,cards:a,getReactiveRef:V})}function V(n,t,e){if(n==null)throw Error("Could not get a reactive ref for undefined Card");const o=n.settings[e];if(o===void 0)return o;switch(t){case"TEXTAREA":return h(e,n.settings);case"INPUTBOX":return C(e,n.settings);case"SELECTBOX":return I(e,n.settings);case"IMAGE":return x(e,n.settings);case"TOGGLE":return k(e,n.settings);case"BUTTON":return T(e,n.settings);default:return}}function y(n,t){if(t===void 0)return;if(!t.startsWith("global."))return t;const e=t.split(".").at(2);if(e!==void 0)return n.fontFamily[e]}function O(n,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const e=t.split(".").at(2);if(e!==void 0)return n.textSize[e]}function p(n,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const e=t.split(".").at(2);if(e!==void 0)return n.color[e]}function W(n){const t=v(),e=r(()=>{const i=t.design.value[n],c=t.defaults.value[n],g=t.context.value.globalDesign;return{font:i?.font?.replaceAll("_"," ")??y(g,c?.font),size:i?.size??O(g,c?.size),bold:i?.bold??c?.bold,italic:i?.italic??c?.italic,color:i?.color??p(g,c?.color),visible:i?.visible??c?.visible??!1}}),o=r(()=>e.value?.font),a=r(()=>e.value?.size),l=r(()=>e.value?.bold),u=r(()=>e.value?.italic),d=r(()=>e.value?.color),s=r(()=>e.value?.visible);return f({font:o,size:a,bold:l,italic:u,color:d,visible:s})}function j(n){const t=v(),e=r(()=>{const c=t.design.value[n],g=t.defaults.value[n],E=t.context.value.globalDesign;return{font:c?.font?.replaceAll("_"," ")??y(E,g?.font),size:c?.size??O(E,g?.size),bold:c?.bold??g?.bold,italic:c?.italic??g?.italic,color:c?.color??p(E,g?.color),visible:c?.visible??g?.visible??!1,whiteSpace:"pre-wrap"}}),o=r(()=>e.value?.font),a=r(()=>e.value?.size),l=r(()=>e.value?.bold),u=r(()=>e.value?.italic),d=r(()=>e.value?.color),s=r(()=>e.value?.visible),i=r(()=>e.value?.whiteSpace);return f({font:o,size:a,bold:l,italic:u,color:d,visible:s,whiteSpace:i})}function F(n){const t=v(),e=r(()=>{const i=t.design.value[n],c=t.defaults.value[n],g=t.context.value.globalDesign;return{appearance:i?.appearance??c?.appearance,font:i?.font??y(g,c?.font),size:i?.size??c?.size,style:i?.style??c?.style,color:i?.color??p(g,c?.color),visible:i?.visible??c?.visible??!1}}),o=r(()=>e.value?.appearance),a=r(()=>e.value?.font),l=r(()=>e.value?.size),u=r(()=>e.value?.style),d=r(()=>e.value?.color),s=r(()=>e.value?.visible);return f({appearance:o,font:a,size:l,style:u,color:d,visible:s})}function H(n){const t=v(),e=r(()=>{const l=t.design.value[n],u=t.defaults.value[n],d=t.context.value.globalDesign;return{overlay:{type:l?.overlay?.type??u?.overlay?.type,solid:{color:l?.overlay?.solid?.color??p(d,u?.overlay?.solid?.color)},gradient:{fromColor:l?.overlay?.gradient?.fromColor??p(d,u?.overlay?.gradient?.fromColor),toColor:l?.overlay?.gradient?.toColor??p(d,u?.overlay?.gradient?.toColor)}},visible:l?.visible??u?.visible??!1}}),o=r(()=>e.value?.overlay),a=r(()=>e.value?.visible);return f({overlay:o,visible:a})}function J(n){const t=v(),e=r(()=>{const a=t.design.value[n],l=t.defaults.value[n];return{enabled:a?.enabled??l?.enabled}}),o=r(()=>e.value?.enabled);return f({enabled:o})}function Y(n){const t=v(),e=r(()=>{const a=t.design.value[n],l=t.defaults.value[n];return{value:a?.value??l?.value}}),o=r(()=>e.value?.value);return f({value:o})}function q(n){const t=v(),e=r(()=>{const a=t.design.value[n],l=t.defaults.value[n],u=t.context.value.globalDesign;return{background:{type:a?.background?.type??l?.background?.type,solid:{color:a?.background?.solid?.color??p(u,l?.background?.solid?.color)},gradient:{fromColor:a?.background?.gradient?.fromColor??p(u,l?.background?.gradient?.fromColor),toColor:a?.background?.gradient?.toColor??p(u,l?.background?.gradient?.toColor)}}}}),o=r(()=>e.value?.background);return f({background:o})}function Q(){const n=v(),t=r(()=>n.design.value.layout),e=r(()=>t.value);return f({layout:e})}function _(n){return{app:D(n)}}function Z(n,t){return{init:()=>{const{app:e}=_(n);return t?.init?.(e),{render:async(o,a)=>(v().init(e,o,a.content,a.design,a.defaults,a.externalContent),t?.render?.(e,o,a),{html:await L(e,{context:o}),state:{context:o,data:a}})}}}}function ee(n,t){return{init:()=>{const{app:e}=_(n);return t?.init?.(e),{mount:(o,a)=>{v().init(e,a.context,a.data.content,a.data.design,a.data.defaults,a.data.externalContent),t?.mount?.(e,o,a),e.mount(o)},update:o=>{v().update(e,o.data.content,o.data.design,o.data.defaults,o.data.externalContent),t?.update?.(e,o)},unmount:()=>{t?.unmount?.(e),e.unmount()}}}}}function te(){return globalThis.window.instantsite}export{A as EditorTypes,ee as createVueClientApp,Z as createVueServerApp,q as useBackgroundElementDesign,T as useButtonElementContent,F as useButtonElementDesign,K as useDeckElementContent,x as useImageElementContent,H as useImageElementDesign,C as useInputboxElementContent,te as useInstantsiteJsApi,Q as useLayoutElementDesign,I as useSelectboxElementContent,Y as useSelectboxElementDesign,W as useTextElementDesign,h as useTextareaElementContent,j as useTextareaElementDesign,k as useToggleElementContent,J as useToggleElementDesign,v as useVueBaseProps};
|
|
1
|
+
import{getCurrentInstance as N,ref as E,computed as i,reactive as d,createSSRApp as B}from"vue";import{renderToString as M}from"vue/server-renderer";const y=new Map;function s(){const e=(r,l,a,v,g,u)=>{y.set(r._uid,{context:E(l),content:E(a),design:E(v),defaults:E(g),site:E(u?.site??{})})},n=(r,l,a,v,g)=>{const u=y.get(r._uid);u!==void 0&&(u.content.value=l,u.design.value=a,u.defaults.value=v,u.site.value=g.site??{})},t=N()?.appContext.app._uid??-1,o=y.get(t);return{init:e,update:n,context:o?.context,content:o?.content,design:o?.design,defaults:o?.defaults,site:o?.site}}function O(e,n){const t=s(),o=i(()=>n!==void 0?n:t.content.value);return K(o,e)}function K(e,n){const t=i(()=>{const l=e.value[n];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${n} is not inputbox`)}}),o=i(()=>t.value!==void 0),r=i(()=>t.value);return d({hasContent:o,value:r})}function C(e,n){const t=s(),o=i(()=>n!==void 0?n:t.content.value);return P(o,e)}function P(e,n){const t=i(()=>{const l=e.value[n];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${n} is not textarea`)}}),o=i(()=>t.value!==void 0),r=i(()=>t.value);return d({hasContent:o,value:r})}const b={HYPER_LINK:"HYPER_LINK",SCROLL_TO_TILE:"SCROLL_TO_TILE",MAIL_LINK:"MAIL_LINK",TEL_LINK:"TEL_LINK",GO_TO_STORE:"GO_TO_STORE",GO_TO_STORE_LINK:"GO_TO_STORE_LINK",GO_TO_PAGE:"GO_TO_PAGE"};function U(e){if("tileId"in e)return e.tileId;if("tileIdForScroll"in e)return e.tileIdForScroll}function X(e){if("pageId"in e)return e.pageId;if("pageIdForNavigate"in e)return e.pageIdForNavigate}function F(e){if("pageUrl"in e)return e.pageUrl;switch(X(e)){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}}const x=(e,n)=>{if(!e||n)return;const{type:t,link:o,email:r,phone:l}=e,a=F(e);switch(t){case b.HYPER_LINK:if(o)return()=>window.open(o,"_blank");break;case b.GO_TO_STORE:case b.GO_TO_STORE_LINK:return()=>window.open("/products","_self");case b.MAIL_LINK:if(r)return()=>window.open(`mailto:${r}`,"_self");break;case b.TEL_LINK:if(l)return()=>window.open(`tel:${l}`,"_self");break;case b.SCROLL_TO_TILE:if(typeof document<"u")return()=>{const v=U(e);document.getElementById(`tile-${v}`)?.scrollIntoView()};break;case b.GO_TO_PAGE:if(a)return()=>window.open(a,"_self");break;default:console.error(`Unknown type of ActionLink: ${t}`)}};function V(e){return"title"in e&&"type"in e}function H(e,n,t){const o=i(()=>{const _=e.value[n];if(_!==void 0){if(V(_))return _;throw new Error(`Element ${n} is not action link`)}}),r=i(()=>o.value?.title),l=i(()=>o.value?.type),a=i(()=>o.value?.link),v=i(()=>o.value?.email),g=i(()=>o.value?.phone),u=i(()=>o.value?.tileId?`tile-${o.value?.tileId}`:null),c=i(()=>o.value?.type==="GO_TO_STORE_LINK"?"products":o.value?.pageId),f=i(()=>o.value?.pageUrl),m=i(()=>!!r.value),$=i(()=>!!a.value),D=x(o.value,t);return d({title:r,type:l,link:a,email:v,phone:g,tileDivId:u,pageId:c,pageUrl:f,hasTitle:m,hasLink:$,performAction:D})}function L(e,n){const t=s(),o=i(()=>!!t.site?.value?.isPreviewMode),r=i(()=>n!==void 0?n:t.content.value!==void 0?t.content.value:{});return H(r,e,o.value)}function W(e){return"bucket"in e&&"borderInfo"in e&&"set"in e}function w(e,n){const t=new RegExp(/^https?:\/\//);return e!=null&&t.test(e)?e:`${n}/${e}`}function k(e,n){const t=s(),o=i(()=>n!==void 0?n:t.content.value);return Y(o,e)}function Y(e,n){const t=i(()=>{const u=e.value[n];if(u!==void 0){if(W(u))return u;throw new Error(`Element ${n} is not image`)}}),o=i(()=>t.value===void 0?"":s().context.value.imageBuckets?.[t.value?.bucket]),r=i(()=>t.value!==void 0),l=i(()=>w(t.value?.set?.["cropped-webp-100x200"]?.url,o.value)),a=i(()=>w(t.value?.set?.["cropped-webp-1000x2000"]?.url,o.value)),v=i(()=>w(t.value?.set?.["webp-200x200"]?.url,o.value)),g=i(()=>w(t.value?.set?.["webp-2000x2000"]?.url,o.value));return d({hasContent:r,lowResolutionMobileImage:l,highResolutionMobileImage:a,lowResolutionDesktopImage:v,highResolutionDesktopImage:g})}function j(e){return"enabled"in e}function R(e,n){const t=s(),o=i(()=>n!==void 0?n:t.content.value);return J(o,e)}function J(e,n){const t=i(()=>{const l=e.value[n];if(l!==void 0){if(j(l))return l;throw new Error(`Element ${n} is not toggle`)}}),o=i(()=>t.value!==void 0),r=i(()=>t.value?.enabled);return d({hasContent:o,value:r})}function A(e,n){const t=s(),o=i(()=>n!==void 0?n:t.content.value);return q(o,e)}function q(e,n){const t=i(()=>{const l=e.value[n];if(l!==void 0){if(typeof l=="string")return l;throw new Error(`Element ${n} is not selectbox`)}}),o=i(()=>t.value!==void 0),r=i(()=>t.value);return d({hasContent:o,value:r})}function Q(e){return e!==null&&"items"in e}function G(e){const n=s(),t=i(()=>{const a=n.content.value[e];if(a!==void 0){if(Q(a))return a;throw new Error(`Element ${e} is not an menu`)}}),o=i(()=>!!n.site?.value?.isPreviewMode),r=i(()=>t.value!==void 0),l=i(()=>t.value?.items?t.value.items.map(a=>({...a,performAction:x(a,o.value)})):[]);return d({hasContent:r,items:l})}const Z="menu";function ee(){return G(Z)}var S=(e=>(e.INPUTBOX="INPUTBOX",e.TEXTAREA="TEXTAREA",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e))(S||{});function te(e){if(typeof e!="object"||e===null)return!1;const n=e;return Array.isArray(n.cards)&&n.cards.every(t=>typeof t.settings=="object"&&t.settings!==null)}function ne(e){const n=s(),t=i(()=>{const l=n.content.value[e];if(l!==void 0){if(te(l))return l;throw new Error(`Element ${e} is not of DECK type`)}}),o=i(()=>t.value!==void 0&&t.value.cards.length>0),r=i(()=>t.value?.cards);return d({hasContent:o,cards:r,getReactiveRef:oe})}function oe(e,n,t){if(e==null)throw Error("Could not get a reactive ref for undefined Card");const o=e.settings[t];if(o===void 0)return o;switch(n){case"TEXTAREA":return C(t,e.settings);case"INPUTBOX":return O(t,e.settings);case"SELECTBOX":return A(t,e.settings);case"IMAGE":return k(t,e.settings);case"TOGGLE":return R(t,e.settings);case"BUTTON":return L(t,e.settings);default:return}}function ie(e){return"type"in e&&("text"in e||"image"in e)}function T(e,n){const t=new RegExp(/^https?:\/\//);return e!==void 0&&t.test(e)?e:`${n}/${e}`}function re(){const e=s(),n=i(()=>{const a=e.content.value.logo;if(a!==void 0){if(ie(a))return a;throw new Error("Element logo is not LOGO")}}),t=i(()=>n.value?.type),o=i(()=>n.value?.text),r=i(()=>n.value?.image===void 0?"":e.context.value.imageBuckets?.[n.value.image.bucket]),l=i(()=>({lowResolutionMobileImage:T(n.value?.image?.set?.["cropped-webp-100x200"]?.url,r.value),highResolutionMobileImage:T(n.value?.image?.set?.["cropped-webp-1000x2000"]?.url,r.value),lowResolutionDesktopImage:T(n.value?.image?.set?.["webp-200x200"]?.url,r.value),highResolutionDesktopImage:T(n.value?.image?.set?.["webp-2000x2000"]?.url,r.value)}));return d({type:t,text:o,image:l})}function I(e,n){if(n===void 0)return;if(!n.startsWith("global."))return n;const t=n.split(".").at(2);if(t!==void 0)return e.fontFamily[t]}function h(e,n){if(n===void 0)return;if(typeof n!="string"||!n.startsWith("global."))return n;const t=n.split(".").at(2);if(t!==void 0)return e.textSize[t]}function p(e,n){if(n===void 0)return;if(typeof n!="string"||!n.startsWith("global."))return n;const t=n.split(".").at(2);if(t!==void 0)return e.color[t]}function le(e){const n=s(),t=i(()=>{const u=n.design.value[e],c=n.defaults.value[e],f=n.context.value.globalDesign;return{font:u?.font?.replaceAll("_"," ")??I(f,c?.font),size:u?.size??h(f,c?.size),bold:u?.bold??c?.bold,italic:u?.italic??c?.italic,color:u?.color??p(f,c?.color),visible:u?.visible??c?.visible??!1}}),o=i(()=>t.value?.font),r=i(()=>t.value?.size),l=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({font:o,size:r,bold:l,italic:a,color:v,visible:g})}function ae(e){const n=s(),t=i(()=>{const c=n.design.value[e],f=n.defaults.value[e],m=n.context.value.globalDesign;return{font:c?.font?.replaceAll("_"," ")??I(m,f?.font),size:c?.size??h(m,f?.size),bold:c?.bold??f?.bold,italic:c?.italic??f?.italic,color:c?.color??p(m,f?.color),visible:c?.visible??f?.visible??!1,whiteSpace:"pre-wrap"}}),o=i(()=>t.value?.font),r=i(()=>t.value?.size),l=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible),u=i(()=>t.value?.whiteSpace);return d({font:o,size:r,bold:l,italic:a,color:v,visible:g,whiteSpace:u})}function ue(e){const n=s(),t=i(()=>{const u=n.design.value[e],c=n.defaults.value[e],f=n.context.value.globalDesign;return{appearance:u?.appearance??c?.appearance,font:u?.font??I(f,c?.font),size:u?.size??c?.size,style:u?.style??c?.style,color:u?.color??p(f,c?.color),visible:u?.visible??c?.visible??!1}}),o=i(()=>t.value?.appearance),r=i(()=>t.value?.font),l=i(()=>t.value?.size),a=i(()=>t.value?.style),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({appearance:o,font:r,size:l,style:a,color:v,visible:g})}function se(e){const n=s(),t=i(()=>{const l=n.design.value[e],a=n.defaults.value[e],v=n.context.value.globalDesign;return{overlay:{type:l?.overlay?.type??a?.overlay?.type,solid:{color:l?.overlay?.solid?.color??p(v,a?.overlay?.solid?.color)},gradient:{fromColor:l?.overlay?.gradient?.fromColor??p(v,a?.overlay?.gradient?.fromColor),toColor:l?.overlay?.gradient?.toColor??p(v,a?.overlay?.gradient?.toColor)}},visible:l?.visible??a?.visible??!1}}),o=i(()=>t.value?.overlay),r=i(()=>t.value?.visible);return d({overlay:o,visible:r})}function ce(e){const n=s(),t=i(()=>{const r=n.design.value[e],l=n.defaults.value[e];return{enabled:r?.enabled??l?.enabled}}),o=i(()=>t.value?.enabled);return d({enabled:o})}function ve(e){const n=s(),t=i(()=>{const r=n.design.value[e],l=n.defaults.value[e];return{value:r?.value??l?.value}}),o=i(()=>t.value?.value);return d({value:o})}function de(e){const n=s(),t=i(()=>{const r=n.design.value[e],l=n.defaults.value[e],a=n.context.value.globalDesign;return{background:{type:r?.background?.type??l?.background?.type,solid:{color:r?.background?.solid?.color??p(a,l?.background?.solid?.color)},gradient:{fromColor:r?.background?.gradient?.fromColor??p(a,l?.background?.gradient?.fromColor),toColor:r?.background?.gradient?.toColor??p(a,l?.background?.gradient?.toColor)}}}}),o=i(()=>t.value?.background);return d({background:o})}function fe(){const e=s(),n=i(()=>e.design.value.layout),t=i(()=>n.value);return d({layout:t})}function ge(e,n){return{visible:n?.visible??!1,width:n?.width??1,color:p(e,n?.color)}}function pe(){const e=s();return i(()=>{const n=e.design.value.logo,t=e.defaults.value.logo,o=e.context.value.globalDesign;return{font:n?.font?.replaceAll("_"," ")??I(o,t?.font),size:n?.size??h(o,t?.size),bold:n?.bold??t?.bold,italic:n?.italic??t?.italic,color:n?.color??p(o,t?.color),visible:n?.visible??t?.visible??!1,spacing:n?.spacing??t?.spacing??0,capitalization:n?.capitalization??t?.capitalization??"none",frame:n?.frame??ge(o,t?.frame)}})}function z(e){return{app:B(e)}}function be(e,n){return{init:()=>{const{app:t}=z(e);return n?.init?.(t),{render:async(o,r)=>(s().init(t,o,r.content,r.design,r.defaults,r.externalContent),n?.render?.(t,o,r),{html:await M(t,{context:o}),state:{context:o,data:r}})}}}}function me(e,n){return{init:()=>{const{app:t}=z(e);return n?.init?.(t),{mount:(o,r)=>{s().init(t,r.context,r.data.content,r.data.design,r.data.defaults,r.data.externalContent),n?.mount?.(t,o,r),t.mount(o)},update:o=>{s().update(t,o.data.content,o.data.design,o.data.defaults,o.data.externalContent),n?.update?.(t,o)},unmount:()=>{n?.unmount?.(t),t.unmount()}}}}}function Ee(){return globalThis.window.instantsite}export{S as EditorTypes,me as createVueClientApp,be as createVueServerApp,de as useBackgroundElementDesign,L as useButtonElementContent,ue as useButtonElementDesign,ne as useDeckElementContent,k as useImageElementContent,se as useImageElementDesign,O as useInputboxElementContent,Ee as useInstantsiteJsApi,fe as useLayoutElementDesign,re as useLogoElementContent,pe as useLogoElementDesign,G as useMenuElementContent,ee as useNavigationMenuElementContent,A as useSelectboxElementContent,ve as useSelectboxElementDesign,le as useTextElementDesign,C as useTextareaElementContent,ae as useTextareaElementDesign,R as useToggleElementContent,ce as useToggleElementDesign,s as useVueBaseProps};
|