@lightspeed/crane 1.2.2 → 1.2.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.4 - 2025-06-02
4
+
5
+ ### Added
6
+
7
+ - **Storefront (experimental):** add multipage template support in the 'deploy' flow.
8
+ - **Storefront (experimental):** add external layout support during compilation of multipage templates.
9
+ - **Storefront (experimental):** implement external layout selection and deployment integration for multipage templates.
10
+ - **Local Preview (experimental):** add structural support for local custom section preview generation.
11
+ - Add validation for translation label properties in custom section configuration files during the 'build' command.
12
+ - Add typing for all the available font sets in the custom section configuration files.
13
+
14
+ ### Changed
15
+
16
+ - Update versions of 'unbuild' and 'vite-plugin-static-copy' dependencies.
17
+
18
+ ### Fixed
19
+
20
+ - Fix the validation flow for template section showcase overrides.
21
+
22
+ ## 1.2.3 - 2025-05-15
23
+
24
+ ### Changed
25
+
26
+ - Update the custom header's 'Navigation' component to display a hover-activated category dropdown.
27
+
28
+ ### Fixed
29
+
30
+ - Fix the image validation for custom section and template configuration files during the 'build' command.
31
+
3
32
  ## 1.2.2 - 2025-05-12
4
33
 
5
34
  _If you are upgrading: please see [UPGRADE.md](UPGRADE.md)._
package/README.md CHANGED
@@ -122,3 +122,5 @@ For more information regarding the notable changes for each versioned release an
122
122
 
123
123
  - [CHANGELOG](CHANGELOG.md)
124
124
  - [UPGRADE](UPGRADE.md)
125
+
126
+ Note: for visitors through the `npmjs.com` site, please refer to the individual files in the `Code` tab of the package repository, as the links above will not work.
package/dist/app.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import type { Ref, App, Component } from 'vue';
2
+ import { App, Ref, Component } from 'vue';
3
3
 
4
4
  interface AppBaseContext {
5
5
  readonly appName: string;
@@ -56,8 +56,6 @@ interface GlobalDesign {
56
56
  customCss?: string;
57
57
  }
58
58
 
59
-
60
-
61
59
  interface VueBaseProps<CONTENT, DESIGN> {
62
60
  init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
63
61
  update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
@@ -66,6 +64,7 @@ interface VueBaseProps<CONTENT, DESIGN> {
66
64
  readonly design: Ref<DESIGN>;
67
65
  readonly defaults: Ref<Record<string, unknown>>;
68
66
  readonly site: Ref<SiteContent>;
67
+ readonly category?: Ref<Category | undefined>;
69
68
  readonly globalDesign: Ref<GlobalDesign>;
70
69
  }
71
70
  declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
@@ -154,7 +153,7 @@ declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
154
153
  performAction: (() => void) | undefined;
155
154
  id: string;
156
155
  title?: string | undefined;
157
- type?: string | undefined;
156
+ type?: ActionLinkType | undefined;
158
157
  link?: string | undefined;
159
158
  email?: string | undefined;
160
159
  phone?: string | undefined;
@@ -172,7 +171,7 @@ declare function useNavigationMenuElementContent<CONTENT>(): {
172
171
  performAction: (() => void) | undefined;
173
172
  id: string;
174
173
  title?: string | undefined;
175
- type?: string | undefined;
174
+ type?: ActionLinkType | undefined;
176
175
  link?: string | undefined;
177
176
  email?: string | undefined;
178
177
  phone?: string | undefined;
@@ -241,15 +240,6 @@ declare function useLogoElementContent<CONTENT>(): {
241
240
  };
242
241
  };
243
242
 
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
243
  declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
254
244
  font: string | undefined;
255
245
  size: number | GlobalTextSizeString | undefined;
@@ -301,10 +291,6 @@ declare function useLayoutElementDesign(): {
301
291
 
302
292
  declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
303
293
 
304
-
305
-
306
-
307
-
308
294
  interface VueServerAppExtensions {
309
295
  init?: (app: App<Element>) => void;
310
296
  render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
@@ -319,10 +305,6 @@ declare function createVueServerApp<C, D>(appComponent: Component, extensions?:
319
305
  };
320
306
  };
321
307
 
322
-
323
-
324
-
325
-
326
308
  interface VueClientAppExtensions {
327
309
  init?: (app: App<Element>) => void;
328
310
  mount?: <C, D, S extends AppBaseState<C, D>>(app: App<Element>, rootContainer: string, state: S) => void;
@@ -342,74 +324,84 @@ interface InstantsiteTilePromise {
342
324
  }
343
325
  interface InstantsiteJSAPI {
344
326
  /**
345
- * Retrieves the current site ID.
346
- *
347
- * @returns {number} The site ID.
348
- */
327
+ * Retrieves the current site ID.
328
+ *
329
+ * @returns {number} The site ID.
330
+ */
349
331
  getSiteId: () => number;
350
332
  /**
351
- * Retrieves the public token for a given app.
352
- *
353
- * @param {string} appId - The ID of the app.
354
- * @returns {string | undefined} The app's public token, or `undefined` if not found.
355
- */
333
+ * Retrieves the public token for a given app.
334
+ *
335
+ * @param {string} appId - The ID of the app.
336
+ * @returns {string | undefined} The app's public token, or `undefined` if not found.
337
+ */
356
338
  getAppPublicToken: (appId: string) => string | undefined;
357
339
  /**
358
- * Retrieves the public configuration for a given app.
359
- *
360
- * @param {string} appId - The ID of the app.
361
- * @returns {string | undefined} The app's public configuration, or `undefined` if not found.
362
- */
340
+ * Retrieves the public configuration for a given app.
341
+ *
342
+ * @param {string} appId - The ID of the app.
343
+ * @returns {string | undefined} The app's public configuration, or `undefined` if not found.
344
+ */
363
345
  getAppPublicConfig: (appId: string) => string | undefined;
364
346
  /**
365
- * An event that triggers when a tile is loaded.
366
- *
367
- * @type {InstantsiteTilePromise}
368
- *
369
- * @example
370
- * ```ts
371
- * const tileLoadedPromise = instantsiteJsApi?.onTileLoaded;
372
- *
373
- * tileLoadedPromise?.add((tileId) => {
374
- * console.log('Tile loaded:', tileId);
375
- * });
376
- * ```
377
- */
347
+ * An event that triggers when a tile is loaded.
348
+ *
349
+ * @type {InstantsiteTilePromise}
350
+ *
351
+ * @example
352
+ * ```ts
353
+ * const tileLoadedPromise = instantsiteJsApi?.onTileLoaded;
354
+ *
355
+ * tileLoadedPromise?.add((tileId) => {
356
+ * console.log('Tile loaded:', tileId);
357
+ * });
358
+ * ```
359
+ */
378
360
  onTileLoaded: InstantsiteTilePromise;
379
361
  /**
380
- * An event that triggers when a tile is unloaded.
381
- *
382
- * @type {InstantsiteTilePromise}
383
- *
384
- * @example
385
- * ```ts
386
- * const tileUnloadedPromise = instantsiteJsApi?.onTileUnloaded;
387
- *
388
- * tileUnloadedPromise?.add((tileId) => {
389
- * console.log('Tile unloaded:', tileId);
390
- * });
391
- * ```
392
- */
362
+ * An event that triggers when a tile is unloaded.
363
+ *
364
+ * @type {InstantsiteTilePromise}
365
+ *
366
+ * @example
367
+ * ```ts
368
+ * const tileUnloadedPromise = instantsiteJsApi?.onTileUnloaded;
369
+ *
370
+ * tileUnloadedPromise?.add((tileId) => {
371
+ * console.log('Tile unloaded:', tileId);
372
+ * });
373
+ * ```
374
+ */
393
375
  onTileUnloaded: InstantsiteTilePromise;
394
376
  /**
395
- * Opens the search page with the specified keyword.
396
- *
397
- * @param {string | undefined} keyword - The keyword to search for.
398
- * @returns {void}
399
- */
377
+ * Opens the search page with the specified keyword.
378
+ *
379
+ * @param {string | undefined} keyword - The keyword to search for.
380
+ * @returns {void}
381
+ */
400
382
  openSearchPage: (keyword: string | undefined) => void;
401
383
  }
402
384
 
403
385
  declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
404
386
 
387
+ declare const CatalogLayoutSlot: {
388
+ readonly PRODUCT_LIST: "CONTROLS";
389
+ readonly BOTTOM_BAR: "FOOTER";
390
+ };
391
+ declare const CategoryLayoutSlot: {
392
+ readonly CATEGORY_TITLE: "MAIN_TITLE";
393
+ readonly PRODUCT_LIST: "CONTROLS";
394
+ readonly BOTTOM_BAR: "FOOTER";
395
+ };
396
+ declare const ProductLayoutSlot: {
397
+ readonly TOP_BAR: "TOP_BAR";
398
+ readonly GALLERY: "GALLERY";
399
+ readonly SIDEBAR: "SIDEBAR";
400
+ readonly DESCRIPTION: "DESCRIPTION";
401
+ readonly REVIEW_LIST: "REVIEW_LIST";
402
+ readonly RELATED_PRODUCTS: "RELATED_PRODUCTS";
403
+ readonly BOTTOM_BAR: "FOOTER";
404
+ };
405
405
 
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
- export { EditorTypes, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
406
+ export { CatalogLayoutSlot, CategoryLayoutSlot, EditorTypes, ProductLayoutSlot, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
415
407
  export type { ButtonContent, Card, Deck, ImageContent, InputBoxContent, SelectBoxContent, TextAreaContent, ToggleContent };
package/dist/app.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import type { Ref, App, Component } from 'vue';
2
+ import { App, Ref, Component } from 'vue';
3
3
 
4
4
  interface AppBaseContext {
5
5
  readonly appName: string;
@@ -56,8 +56,6 @@ interface GlobalDesign {
56
56
  customCss?: string;
57
57
  }
58
58
 
59
-
60
-
61
59
  interface VueBaseProps<CONTENT, DESIGN> {
62
60
  init: (app: App<Element>, contextValue: AppBaseContext, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
63
61
  update: (app: App<Element>, contentValue: CONTENT, designValue: DESIGN, defaultsValue: Record<string, unknown>, externalContent: ExternalContentData, globalDesignValue: GlobalDesign) => void;
@@ -66,6 +64,7 @@ interface VueBaseProps<CONTENT, DESIGN> {
66
64
  readonly design: Ref<DESIGN>;
67
65
  readonly defaults: Ref<Record<string, unknown>>;
68
66
  readonly site: Ref<SiteContent>;
67
+ readonly category?: Ref<Category | undefined>;
69
68
  readonly globalDesign: Ref<GlobalDesign>;
70
69
  }
71
70
  declare function useVueBaseProps<CONTENT, DESIGN>(): VueBaseProps<CONTENT, DESIGN>;
@@ -154,7 +153,7 @@ declare function useMenuElementContent<CONTENT>(elementName: keyof CONTENT): {
154
153
  performAction: (() => void) | undefined;
155
154
  id: string;
156
155
  title?: string | undefined;
157
- type?: string | undefined;
156
+ type?: ActionLinkType | undefined;
158
157
  link?: string | undefined;
159
158
  email?: string | undefined;
160
159
  phone?: string | undefined;
@@ -172,7 +171,7 @@ declare function useNavigationMenuElementContent<CONTENT>(): {
172
171
  performAction: (() => void) | undefined;
173
172
  id: string;
174
173
  title?: string | undefined;
175
- type?: string | undefined;
174
+ type?: ActionLinkType | undefined;
176
175
  link?: string | undefined;
177
176
  email?: string | undefined;
178
177
  phone?: string | undefined;
@@ -241,15 +240,6 @@ declare function useLogoElementContent<CONTENT>(): {
241
240
  };
242
241
  };
243
242
 
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
243
  declare function useTextElementDesign<DESIGN>(elementName: keyof DESIGN): {
254
244
  font: string | undefined;
255
245
  size: number | GlobalTextSizeString | undefined;
@@ -301,10 +291,6 @@ declare function useLayoutElementDesign(): {
301
291
 
302
292
  declare function useLogoElementDesign<DESIGN>(): vue.ComputedRef<LogoDesignData>;
303
293
 
304
-
305
-
306
-
307
-
308
294
  interface VueServerAppExtensions {
309
295
  init?: (app: App<Element>) => void;
310
296
  render?: <C, D>(app: App<Element>, context: AppBaseContext, data: AppBaseData<C, D>) => void;
@@ -319,10 +305,6 @@ declare function createVueServerApp<C, D>(appComponent: Component, extensions?:
319
305
  };
320
306
  };
321
307
 
322
-
323
-
324
-
325
-
326
308
  interface VueClientAppExtensions {
327
309
  init?: (app: App<Element>) => void;
328
310
  mount?: <C, D, S extends AppBaseState<C, D>>(app: App<Element>, rootContainer: string, state: S) => void;
@@ -342,74 +324,84 @@ interface InstantsiteTilePromise {
342
324
  }
343
325
  interface InstantsiteJSAPI {
344
326
  /**
345
- * Retrieves the current site ID.
346
- *
347
- * @returns {number} The site ID.
348
- */
327
+ * Retrieves the current site ID.
328
+ *
329
+ * @returns {number} The site ID.
330
+ */
349
331
  getSiteId: () => number;
350
332
  /**
351
- * Retrieves the public token for a given app.
352
- *
353
- * @param {string} appId - The ID of the app.
354
- * @returns {string | undefined} The app's public token, or `undefined` if not found.
355
- */
333
+ * Retrieves the public token for a given app.
334
+ *
335
+ * @param {string} appId - The ID of the app.
336
+ * @returns {string | undefined} The app's public token, or `undefined` if not found.
337
+ */
356
338
  getAppPublicToken: (appId: string) => string | undefined;
357
339
  /**
358
- * Retrieves the public configuration for a given app.
359
- *
360
- * @param {string} appId - The ID of the app.
361
- * @returns {string | undefined} The app's public configuration, or `undefined` if not found.
362
- */
340
+ * Retrieves the public configuration for a given app.
341
+ *
342
+ * @param {string} appId - The ID of the app.
343
+ * @returns {string | undefined} The app's public configuration, or `undefined` if not found.
344
+ */
363
345
  getAppPublicConfig: (appId: string) => string | undefined;
364
346
  /**
365
- * An event that triggers when a tile is loaded.
366
- *
367
- * @type {InstantsiteTilePromise}
368
- *
369
- * @example
370
- * ```ts
371
- * const tileLoadedPromise = instantsiteJsApi?.onTileLoaded;
372
- *
373
- * tileLoadedPromise?.add((tileId) => {
374
- * console.log('Tile loaded:', tileId);
375
- * });
376
- * ```
377
- */
347
+ * An event that triggers when a tile is loaded.
348
+ *
349
+ * @type {InstantsiteTilePromise}
350
+ *
351
+ * @example
352
+ * ```ts
353
+ * const tileLoadedPromise = instantsiteJsApi?.onTileLoaded;
354
+ *
355
+ * tileLoadedPromise?.add((tileId) => {
356
+ * console.log('Tile loaded:', tileId);
357
+ * });
358
+ * ```
359
+ */
378
360
  onTileLoaded: InstantsiteTilePromise;
379
361
  /**
380
- * An event that triggers when a tile is unloaded.
381
- *
382
- * @type {InstantsiteTilePromise}
383
- *
384
- * @example
385
- * ```ts
386
- * const tileUnloadedPromise = instantsiteJsApi?.onTileUnloaded;
387
- *
388
- * tileUnloadedPromise?.add((tileId) => {
389
- * console.log('Tile unloaded:', tileId);
390
- * });
391
- * ```
392
- */
362
+ * An event that triggers when a tile is unloaded.
363
+ *
364
+ * @type {InstantsiteTilePromise}
365
+ *
366
+ * @example
367
+ * ```ts
368
+ * const tileUnloadedPromise = instantsiteJsApi?.onTileUnloaded;
369
+ *
370
+ * tileUnloadedPromise?.add((tileId) => {
371
+ * console.log('Tile unloaded:', tileId);
372
+ * });
373
+ * ```
374
+ */
393
375
  onTileUnloaded: InstantsiteTilePromise;
394
376
  /**
395
- * Opens the search page with the specified keyword.
396
- *
397
- * @param {string | undefined} keyword - The keyword to search for.
398
- * @returns {void}
399
- */
377
+ * Opens the search page with the specified keyword.
378
+ *
379
+ * @param {string | undefined} keyword - The keyword to search for.
380
+ * @returns {void}
381
+ */
400
382
  openSearchPage: (keyword: string | undefined) => void;
401
383
  }
402
384
 
403
385
  declare function useInstantsiteJsApi(): InstantsiteJSAPI | undefined;
404
386
 
387
+ declare const CatalogLayoutSlot: {
388
+ readonly PRODUCT_LIST: "CONTROLS";
389
+ readonly BOTTOM_BAR: "FOOTER";
390
+ };
391
+ declare const CategoryLayoutSlot: {
392
+ readonly CATEGORY_TITLE: "MAIN_TITLE";
393
+ readonly PRODUCT_LIST: "CONTROLS";
394
+ readonly BOTTOM_BAR: "FOOTER";
395
+ };
396
+ declare const ProductLayoutSlot: {
397
+ readonly TOP_BAR: "TOP_BAR";
398
+ readonly GALLERY: "GALLERY";
399
+ readonly SIDEBAR: "SIDEBAR";
400
+ readonly DESCRIPTION: "DESCRIPTION";
401
+ readonly REVIEW_LIST: "REVIEW_LIST";
402
+ readonly RELATED_PRODUCTS: "RELATED_PRODUCTS";
403
+ readonly BOTTOM_BAR: "FOOTER";
404
+ };
405
405
 
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
- export { EditorTypes, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
406
+ export { CatalogLayoutSlot, CategoryLayoutSlot, EditorTypes, ProductLayoutSlot, createVueClientApp, createVueServerApp, useBackgroundElementDesign, useButtonElementContent, useButtonElementDesign, useDeckElementContent, useImageElementContent, useImageElementDesign, useInputboxElementContent, useInstantsiteJsApi, useLayoutElementDesign, useLogoElementContent, useLogoElementDesign, useMenuElementContent, useNavigationMenuElementContent, useSelectboxElementContent, useSelectboxElementDesign, useTextElementDesign, useTextareaElementContent, useTextareaElementDesign, useToggleElementContent, useToggleElementDesign, useVueBaseProps };
415
407
  export type { ButtonContent, Card, Deck, ImageContent, InputBoxContent, SelectBoxContent, TextAreaContent, ToggleContent };
package/dist/app.mjs CHANGED
@@ -1 +1 @@
1
- import{getCurrentInstance as K,ref as m,computed as i,reactive as d,createSSRApp as P}from"vue";import{renderToString as U}from"vue/server-renderer";const y=new Map;function c(){const e=(l,r,a,v,g,s,u)=>{y.set(l._uid,{context:m(r),content:m(a),design:m(v),defaults:m(g),site:m(s?.site??{}),globalDesign:m(u)})},n=(l,r,a,v,g,s)=>{const u=y.get(l._uid);u!==void 0&&(u.content.value=r,u.design.value=a,u.defaults.value=v,u.site.value=g.site??{},u.globalDesign.value=s)},t=K()?.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,globalDesign:o?.globalDesign}}function O(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return X(o,e)}function X(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not inputbox`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}function C(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return F(o,e)}function F(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not textarea`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}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 W(e){if("tileId"in e)return e.tileId;if("tileIdForScroll"in e)return e.tileIdForScroll}function V(e){if("pageId"in e)return e.pageId;if("pageIdForNavigate"in e)return e.pageIdForNavigate}function H(e){if("pageUrl"in e)return e.pageUrl;switch(V(e)){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}}const L=(e,n)=>{if(!e||n)return;const{type:t,link:o,email:l,phone:r}=e,a=H(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(l)return()=>window.open(`mailto:${l}`,"_self");break;case b.TEL_LINK:if(r)return()=>window.open(`tel:${r}`,"_self");break;case b.SCROLL_TO_TILE:if(typeof document<"u")return()=>{const v=W(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 Y(e){return"title"in e&&"type"in e}function j(e,n,t){const o=i(()=>{const I=e.value[n];if(I!==void 0){if(Y(I))return I;throw new Error(`Element ${n} is not action link`)}}),l=i(()=>o.value?.title),r=i(()=>o.value?.type),a=i(()=>o.value?.link),v=i(()=>o.value?.email),g=i(()=>o.value?.phone),s=i(()=>o.value?.tileId?`tile-${o.value?.tileId}`:null),u=i(()=>o.value?.type==="GO_TO_STORE_LINK"?"products":o.value?.pageId),f=i(()=>o.value?.pageUrl),E=i(()=>!!l.value),B=i(()=>!!a.value),M=L(o.value,t);return d({title:l,type:r,link:a,email:v,phone:g,tileDivId:s,pageId:u,pageUrl:f,hasTitle:E,hasLink:B,performAction:M})}function x(e,n){const t=c(),o=i(()=>!!t.site?.value?.isPreviewMode),l=i(()=>n!==void 0?n:t.content.value!==void 0?t.content.value:{});return j(l,e,o.value)}function J(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=c(),o=i(()=>n!==void 0?n:t.content.value);return q(o,e)}function q(e,n){const t=i(()=>{const s=e.value[n];if(s!==void 0){if(J(s))return s;throw new Error(`Element ${n} is not image`)}}),o=i(()=>t.value===void 0?"":c().context.value.imageBuckets?.[t.value?.bucket]),l=i(()=>t.value!==void 0),r=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:l,lowResolutionMobileImage:r,highResolutionMobileImage:a,lowResolutionDesktopImage:v,highResolutionDesktopImage:g})}function Q(e){return"enabled"in e}function D(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return Z(o,e)}function Z(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(Q(r))return r;throw new Error(`Element ${n} is not toggle`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value?.enabled);return d({hasContent:o,value:l})}function R(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return ee(o,e)}function ee(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not selectbox`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}function te(e){return e!==null&&"items"in e}function A(e){const n=c(),t=i(()=>{const a=n.content.value[e];if(a!==void 0){if(te(a))return a;throw new Error(`Element ${e} is not an menu`)}}),o=i(()=>!!n.site?.value?.isPreviewMode),l=i(()=>t.value!==void 0),r=i(()=>t.value?.items?t.value.items.map(a=>({...a,performAction:L(a,o.value)})):[]);return d({hasContent:l,items:r})}const ne="menu";function oe(){return A(ne)}var G=(e=>(e.INPUTBOX="INPUTBOX",e.TEXTAREA="TEXTAREA",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e))(G||{});function ie(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 le(e){const n=c(),t=i(()=>{const r=n.content.value[e];if(r!==void 0){if(ie(r))return r;throw new Error(`Element ${e} is not of DECK type`)}}),o=i(()=>t.value!==void 0&&t.value.cards.length>0),l=i(()=>t.value?.cards);return d({hasContent:o,cards:l,getReactiveRef:re})}function re(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 R(t,e.settings);case"IMAGE":return k(t,e.settings);case"TOGGLE":return D(t,e.settings);case"BUTTON":return x(t,e.settings);default:return}}function ae(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 ue(){const e=c(),n=i(()=>{const a=e.content.value.logo;if(a!==void 0){if(ae(a))return a;throw new Error("Element logo is not LOGO")}}),t=i(()=>n.value?.type),o=i(()=>n.value?.text),l=i(()=>n.value?.image===void 0?"":e.context.value.imageBuckets?.[n.value.image.bucket]),r=i(()=>({lowResolutionMobileImage:T(n.value?.image?.set?.["cropped-webp-100x200"]?.url,l.value),highResolutionMobileImage:T(n.value?.image?.set?.["cropped-webp-1000x2000"]?.url,l.value),lowResolutionDesktopImage:T(n.value?.image?.set?.["webp-200x200"]?.url,l.value),highResolutionDesktopImage:T(n.value?.image?.set?.["webp-2000x2000"]?.url,l.value)}));return d({type:t,text:o,image:r})}function S(e,n){if(n===void 0)return;if(!n.startsWith("global."))return n.replaceAll("_"," ");const t=n.split(".").at(2);if(t!==void 0)return e.fontFamily?e.fontFamily[t].replaceAll("_"," "):void 0}function h(e,n,t){return n?S(e,n):S(e,t)}function $(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?e.textSize[t]:void 0}function _(e,n,t){return n?$(e,n):$(e,t)}function z(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?e.color[t]:void 0}function p(e,n,t){return n?z(e,n):z(e,t)}function se(e,n,t){return{visible:n?.visible??t?.visible??!1,width:n?.width??t?.width??1,color:p(e,n?.color,t?.color)}}function ce(e){const n=c(),t=i(()=>{const s=n.design.value[e],u=n.defaults.value[e],f=n.globalDesign.value;return{font:h(f,s?.font,u?.font),size:_(f,s?.size,u?.size),bold:s?.bold??u?.bold,italic:s?.italic??u?.italic,color:p(f,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),o=i(()=>t.value?.font),l=i(()=>t.value?.size),r=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({font:o,size:l,bold:r,italic:a,color:v,visible:g})}function ve(e){const n=c(),t=i(()=>{const u=n.design.value[e],f=n.defaults.value[e],E=n.globalDesign.value;return{font:h(E,u?.font,f?.font),size:_(E,u?.size,f?.size),bold:u?.bold??f?.bold,italic:u?.italic??f?.italic,color:p(E,u?.color,f?.color),visible:u?.visible??f?.visible??!1,whiteSpace:"pre-wrap"}}),o=i(()=>t.value?.font),l=i(()=>t.value?.size),r=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible),s=i(()=>t.value?.whiteSpace);return d({font:o,size:l,bold:r,italic:a,color:v,visible:g,whiteSpace:s})}function de(e){const n=c(),t=i(()=>{const s=n.design.value[e],u=n.defaults.value[e],f=n.globalDesign.value;return{appearance:s?.appearance??u?.appearance,font:h(f,s?.font,u?.font),size:s?.size??u?.size,style:s?.style??u?.style,color:p(f,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),o=i(()=>t.value?.appearance),l=i(()=>t.value?.font),r=i(()=>t.value?.size),a=i(()=>t.value?.style),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({appearance:o,font:l,size:r,style:a,color:v,visible:g})}function fe(e){const n=c(),t=i(()=>{const r=n.design.value[e],a=n.defaults.value[e],v=n.globalDesign.value;return{overlay:{type:r?.overlay?.type??a?.overlay?.type,solid:{color:p(v,r?.overlay?.solid?.color,a?.overlay?.solid?.color)},gradient:{fromColor:p(v,r?.overlay?.gradient?.fromColor,a?.overlay?.gradient?.fromColor),toColor:p(v,r?.overlay?.gradient?.toColor,a?.overlay?.gradient?.toColor)}},visible:r?.visible??a?.visible??!1}}),o=i(()=>t.value?.overlay),l=i(()=>t.value?.visible);return d({overlay:o,visible:l})}function ge(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e];return{enabled:l?.enabled??r?.enabled}}),o=i(()=>t.value?.enabled);return d({enabled:o})}function pe(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e];return{value:l?.value??r?.value}}),o=i(()=>t.value?.value);return d({value:o})}function be(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e],a=n.globalDesign.value;return{background:{type:l?.background?.type??r?.background?.type,solid:{color:p(a,l?.background?.solid?.color,r?.background?.solid?.color)},gradient:{fromColor:p(a,l?.background?.gradient?.fromColor,r?.background?.gradient?.fromColor),toColor:p(a,l?.background?.gradient?.toColor,r?.background?.gradient?.toColor)}}}}),o=i(()=>t.value?.background);return d({background:o})}function me(){const e=c(),n=i(()=>e.design.value.layout),t=i(()=>n.value);return d({layout:t})}function Ee(){const e=c();return i(()=>{const n=e.design.value.logo,t=e.defaults.value.logo,o=e.globalDesign.value;return{font:h(o,n?.font,t?.font),size:_(o,n?.size,t?.size),bold:n?.bold??t?.bold,italic:n?.italic??t?.italic,color:p(o,n?.color,t?.color),visible:n?.visible??t?.visible??!1,spacing:n?.spacing??t?.spacing??0,capitalization:n?.capitalization??t?.capitalization??"none",frame:se(o,n?.frame,t?.frame)}})}function N(e){return{app:P(e)}}function we(e,n){return{init:()=>{const{app:t}=N(e);return n?.init?.(t),{render:async(o,l)=>(c().init(t,o,l.content,l.design,l.defaults,l.externalContent,o.globalDesign),n?.render?.(t,o,l),{html:await U(t,{context:o}),state:{context:o,data:l}})}}}}function Te(e,n){return{init:()=>{const{app:t}=N(e);return n?.init?.(t),{mount:(o,l)=>{c().init(t,l.context,l.data.content,l.data.design,l.data.defaults,l.data.externalContent,l.context.globalDesign),n?.mount?.(t,o,l),t.mount(o)},update:o=>{c().update(t,o.data.content,o.data.design,o.data.defaults,o.data.externalContent,o.context.globalDesign),n?.update?.(t,o)},unmount:()=>{n?.unmount?.(t),t.unmount()}}}}}function he(){return globalThis.window.instantsite}export{G as EditorTypes,Te as createVueClientApp,we as createVueServerApp,be as useBackgroundElementDesign,x as useButtonElementContent,de as useButtonElementDesign,le as useDeckElementContent,k as useImageElementContent,fe as useImageElementDesign,O as useInputboxElementContent,he as useInstantsiteJsApi,me as useLayoutElementDesign,ue as useLogoElementContent,Ee as useLogoElementDesign,A as useMenuElementContent,oe as useNavigationMenuElementContent,R as useSelectboxElementContent,pe as useSelectboxElementDesign,ce as useTextElementDesign,C as useTextareaElementContent,ve as useTextareaElementDesign,D as useToggleElementContent,ge as useToggleElementDesign,c as useVueBaseProps};
1
+ import{getCurrentInstance as M,ref as b,computed as i,reactive as d,createSSRApp as U}from"vue";import{renderToString as K}from"vue/server-renderer";const w=new Map;function c(){const e=(l,r,a,v,g,s,u)=>{w.set(l._uid,{context:b(r),content:b(a),design:b(v),defaults:b(g),site:b(s?.site??{}),category:b(s?.category),globalDesign:b(u)})},n=(l,r,a,v,g,s)=>{const u=w.get(l._uid);u!==void 0&&(u.content.value=r,u.design.value=a,u.defaults.value=v,u.site.value=g.site??{},u.category.value=g.category,u.globalDesign.value=s)},t=M()?.appContext.app._uid??-1,o=w.get(t);return{init:e,update:n,context:o?.context,content:o?.content,design:o?.design,defaults:o?.defaults,site:o?.site,category:o?.category,globalDesign:o?.globalDesign}}function R(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return F(o,e)}function F(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not inputbox`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}function C(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return W(o,e)}function W(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not textarea`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}const E={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",GO_TO_CATEGORY:"GO_TO_CATEGORY"};function X(e){if("tileId"in e)return e.tileId;if("tileIdForScroll"in e)return e.tileIdForScroll}function Y(e){if("pageId"in e)return e.pageId;if("pageIdForNavigate"in e)return e.pageIdForNavigate}function V(e){if("pageUrl"in e)return e.pageUrl;switch(Y(e)){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}}const L=(e,n)=>{if(!e||n)return;const{type:t,link:o,email:l,phone:r}=e,a=V(e);switch(t){case E.HYPER_LINK:if(o)return()=>window.open(o,"_blank");break;case E.GO_TO_STORE:case E.GO_TO_STORE_LINK:return()=>window.open("/products","_self");case E.MAIL_LINK:if(l)return()=>window.open(`mailto:${l}`,"_self");break;case E.TEL_LINK:if(r)return()=>window.open(`tel:${r}`,"_self");break;case E.SCROLL_TO_TILE:if(typeof document<"u")return()=>{const v=X(e);document.getElementById(`tile-${v}`)?.scrollIntoView()};break;case E.GO_TO_PAGE:if(a)return()=>window.open(a,"_self");break;default:console.error(`Unknown type of ActionLink: ${t}`)}};function H(e){return"title"in e&&"type"in e}function j(e,n,t){const o=i(()=>{const _=e.value[n];if(_!==void 0){if(H(_))return _;throw new Error(`Element ${n} is not action link`)}}),l=i(()=>o.value?.title),r=i(()=>o.value?.type),a=i(()=>o.value?.link),v=i(()=>o.value?.email),g=i(()=>o.value?.phone),s=i(()=>o.value?.tileId?`tile-${o.value?.tileId}`:null),u=i(()=>o.value?.type==="GO_TO_STORE_LINK"?"products":o.value?.pageId),f=i(()=>o.value?.pageUrl),m=i(()=>!!l.value),$=i(()=>!!a.value),P=L(o.value,t);return d({title:l,type:r,link:a,email:v,phone:g,tileDivId:s,pageId:u,pageUrl:f,hasTitle:m,hasLink:$,performAction:P})}function h(e,n){const t=c(),o=i(()=>!!t.site?.value?.isPreviewMode),l=i(()=>n!==void 0?n:t.content.value!==void 0?t.content.value:{});return j(l,e,o.value)}function J(e){return"bucket"in e&&"borderInfo"in e&&"set"in e}function T(e,n){const t=new RegExp(/^https?:\/\//);return e!=null&&t.test(e)?e:`${n}/${e}`}function D(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return q(o,e)}function q(e,n){const t=i(()=>{const s=e.value[n];if(s!==void 0){if(J(s))return s;throw new Error(`Element ${n} is not image`)}}),o=i(()=>t.value===void 0?"":c().context.value.imageBuckets?.[t.value?.bucket]),l=i(()=>t.value!==void 0),r=i(()=>T(t.value?.set?.["cropped-webp-100x200"]?.url,o.value)),a=i(()=>T(t.value?.set?.["cropped-webp-1000x2000"]?.url,o.value)),v=i(()=>T(t.value?.set?.["webp-200x200"]?.url,o.value)),g=i(()=>T(t.value?.set?.["webp-2000x2000"]?.url,o.value));return d({hasContent:l,lowResolutionMobileImage:r,highResolutionMobileImage:a,lowResolutionDesktopImage:v,highResolutionDesktopImage:g})}function Q(e){return"enabled"in e}function A(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return Z(o,e)}function Z(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(Q(r))return r;throw new Error(`Element ${n} is not toggle`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value?.enabled);return d({hasContent:o,value:l})}function S(e,n){const t=c(),o=i(()=>n!==void 0?n:t.content.value);return ee(o,e)}function ee(e,n){const t=i(()=>{const r=e.value[n];if(r!==void 0){if(typeof r=="string")return r;throw new Error(`Element ${n} is not selectbox`)}}),o=i(()=>t.value!==void 0),l=i(()=>t.value);return d({hasContent:o,value:l})}function te(e){return e!==null&&"items"in e}function x(e){const n=c(),t=i(()=>{const a=n.content.value[e];if(a!==void 0){if(te(a))return a;throw new Error(`Element ${e} is not an menu`)}}),o=i(()=>!!n.site?.value?.isPreviewMode),l=i(()=>t.value!==void 0),r=i(()=>t.value?.items?t.value.items.map(a=>({...a,performAction:L(a,o.value)})):[]);return d({hasContent:l,items:r})}const ne="menu";function oe(){return x(ne)}var k=(e=>(e.INPUTBOX="INPUTBOX",e.TEXTAREA="TEXTAREA",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e))(k||{});function ie(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 le(e){const n=c(),t=i(()=>{const r=n.content.value[e];if(r!==void 0){if(ie(r))return r;throw new Error(`Element ${e} is not of DECK type`)}}),o=i(()=>t.value!==void 0&&t.value.cards.length>0),l=i(()=>t.value?.cards);return d({hasContent:o,cards:l,getReactiveRef:re})}function re(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 R(t,e.settings);case"SELECTBOX":return S(t,e.settings);case"IMAGE":return D(t,e.settings);case"TOGGLE":return A(t,e.settings);case"BUTTON":return h(t,e.settings);default:return}}function ae(e){return"type"in e&&("text"in e||"image"in e)}function O(e,n){const t=new RegExp(/^https?:\/\//);return e!==void 0&&t.test(e)?e:`${n}/${e}`}function ue(){const e=c(),n=i(()=>{const a=e.content.value.logo;if(a!==void 0){if(ae(a))return a;throw new Error("Element logo is not LOGO")}}),t=i(()=>n.value?.type),o=i(()=>n.value?.text),l=i(()=>n.value?.image===void 0?"":e.context.value.imageBuckets?.[n.value.image.bucket]),r=i(()=>({lowResolutionMobileImage:O(n.value?.image?.set?.["cropped-webp-100x200"]?.url,l.value),highResolutionMobileImage:O(n.value?.image?.set?.["cropped-webp-1000x2000"]?.url,l.value),lowResolutionDesktopImage:O(n.value?.image?.set?.["webp-200x200"]?.url,l.value),highResolutionDesktopImage:O(n.value?.image?.set?.["webp-2000x2000"]?.url,l.value)}));return d({type:t,text:o,image:r})}function G(e,n){if(n===void 0)return;if(!n.startsWith("global."))return n.replaceAll("_"," ");const t=n.split(".").at(2);if(t!==void 0)return e.fontFamily?e.fontFamily[t].replaceAll("_"," "):void 0}function I(e,n,t){return n?G(e,n):G(e,t)}function N(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?e.textSize[t]:void 0}function y(e,n,t){return n?N(e,n):N(e,t)}function B(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?e.color[t]:void 0}function p(e,n,t){return n?B(e,n):B(e,t)}function se(e,n,t){return{visible:n?.visible??t?.visible??!1,width:n?.width??t?.width??1,color:p(e,n?.color,t?.color)}}function ce(e){const n=c(),t=i(()=>{const s=n.design.value[e],u=n.defaults.value[e],f=n.globalDesign.value;return{font:I(f,s?.font,u?.font),size:y(f,s?.size,u?.size),bold:s?.bold??u?.bold,italic:s?.italic??u?.italic,color:p(f,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),o=i(()=>t.value?.font),l=i(()=>t.value?.size),r=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({font:o,size:l,bold:r,italic:a,color:v,visible:g})}function ve(e){const n=c(),t=i(()=>{const u=n.design.value[e],f=n.defaults.value[e],m=n.globalDesign.value;return{font:I(m,u?.font,f?.font),size:y(m,u?.size,f?.size),bold:u?.bold??f?.bold,italic:u?.italic??f?.italic,color:p(m,u?.color,f?.color),visible:u?.visible??f?.visible??!1,whiteSpace:"pre-wrap"}}),o=i(()=>t.value?.font),l=i(()=>t.value?.size),r=i(()=>t.value?.bold),a=i(()=>t.value?.italic),v=i(()=>t.value?.color),g=i(()=>t.value?.visible),s=i(()=>t.value?.whiteSpace);return d({font:o,size:l,bold:r,italic:a,color:v,visible:g,whiteSpace:s})}function de(e){const n=c(),t=i(()=>{const s=n.design.value[e],u=n.defaults.value[e],f=n.globalDesign.value;return{appearance:s?.appearance??u?.appearance,font:I(f,s?.font,u?.font),size:s?.size??u?.size,style:s?.style??u?.style,color:p(f,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),o=i(()=>t.value?.appearance),l=i(()=>t.value?.font),r=i(()=>t.value?.size),a=i(()=>t.value?.style),v=i(()=>t.value?.color),g=i(()=>t.value?.visible);return d({appearance:o,font:l,size:r,style:a,color:v,visible:g})}function fe(e){const n=c(),t=i(()=>{const r=n.design.value[e],a=n.defaults.value[e],v=n.globalDesign.value;return{overlay:{type:r?.overlay?.type??a?.overlay?.type,solid:{color:p(v,r?.overlay?.solid?.color,a?.overlay?.solid?.color)},gradient:{fromColor:p(v,r?.overlay?.gradient?.fromColor,a?.overlay?.gradient?.fromColor),toColor:p(v,r?.overlay?.gradient?.toColor,a?.overlay?.gradient?.toColor)}},visible:r?.visible??a?.visible??!1}}),o=i(()=>t.value?.overlay),l=i(()=>t.value?.visible);return d({overlay:o,visible:l})}function ge(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e];return{enabled:l?.enabled??r?.enabled}}),o=i(()=>t.value?.enabled);return d({enabled:o})}function pe(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e];return{value:l?.value??r?.value}}),o=i(()=>t.value?.value);return d({value:o})}function be(e){const n=c(),t=i(()=>{const l=n.design.value[e],r=n.defaults.value[e],a=n.globalDesign.value;return{background:{type:l?.background?.type??r?.background?.type,solid:{color:p(a,l?.background?.solid?.color,r?.background?.solid?.color)},gradient:{fromColor:p(a,l?.background?.gradient?.fromColor,r?.background?.gradient?.fromColor),toColor:p(a,l?.background?.gradient?.toColor,r?.background?.gradient?.toColor)}}}}),o=i(()=>t.value?.background);return d({background:o})}function Ee(){const e=c(),n=i(()=>e.design.value.layout),t=i(()=>n.value);return d({layout:t})}function me(){const e=c();return i(()=>{const n=e.design.value.logo,t=e.defaults.value.logo,o=e.globalDesign.value;return{font:I(o,n?.font,t?.font),size:y(o,n?.size,t?.size),bold:n?.bold??t?.bold,italic:n?.italic??t?.italic,color:p(o,n?.color,t?.color),visible:n?.visible??t?.visible??!1,spacing:n?.spacing??t?.spacing??0,capitalization:n?.capitalization??t?.capitalization??"none",frame:se(o,n?.frame,t?.frame)}})}function z(e){return{app:U(e)}}function Te(e,n){return{init:()=>{const{app:t}=z(e);return n?.init?.(t),{render:async(o,l)=>(c().init(t,o,l.content,l.design,l.defaults,l.externalContent,o.globalDesign),n?.render?.(t,o,l),{html:await K(t,{context:o}),state:{context:o,data:l}})}}}}function Oe(e,n){return{init:()=>{const{app:t}=z(e);return n?.init?.(t),{mount:(o,l)=>{c().init(t,l.context,l.data.content,l.data.design,l.data.defaults,l.data.externalContent,l.context.globalDesign),n?.mount?.(t,o,l),t.mount(o)},update:o=>{c().update(t,o.data.content,o.data.design,o.data.defaults,o.data.externalContent,o.context.globalDesign),n?.update?.(t,o)},unmount:()=>{n?.unmount?.(t),t.unmount()}}}}}function Ie(){return globalThis.window.instantsite}const _e={PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER"},we={CATEGORY_TITLE:"MAIN_TITLE",PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER"},ye={TOP_BAR:"TOP_BAR",GALLERY:"GALLERY",SIDEBAR:"SIDEBAR",DESCRIPTION:"DESCRIPTION",REVIEW_LIST:"REVIEW_LIST",RELATED_PRODUCTS:"RELATED_PRODUCTS",BOTTOM_BAR:"FOOTER"};export{_e as CatalogLayoutSlot,we as CategoryLayoutSlot,k as EditorTypes,ye as ProductLayoutSlot,Oe as createVueClientApp,Te as createVueServerApp,be as useBackgroundElementDesign,h as useButtonElementContent,de as useButtonElementDesign,le as useDeckElementContent,D as useImageElementContent,fe as useImageElementDesign,R as useInputboxElementContent,Ie as useInstantsiteJsApi,Ee as useLayoutElementDesign,ue as useLogoElementContent,me as useLogoElementDesign,x as useMenuElementContent,oe as useNavigationMenuElementContent,S as useSelectboxElementContent,pe as useSelectboxElementDesign,ce as useTextElementDesign,C as useTextareaElementContent,ve as useTextareaElementDesign,A as useToggleElementContent,ge as useToggleElementDesign,c as useVueBaseProps};