@krizaka/ui 3.70.0 → 3.72.0
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/account-menu.d.ts +1 -1
- package/dist/account-menu.js +1 -1
- package/dist/account-settings.d.ts +1 -1
- package/dist/account-settings.js +1 -1
- package/dist/avatar/defaults.d.ts +22 -2
- package/dist/avatar/defaults.js +20 -7
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/{avatar-BdZcfkWR.d.ts → avatar-B_na7r1U.d.ts} +16 -0
- package/dist/avatar.d.ts +22 -2
- package/dist/avatar.js +20 -7
- package/dist/avatar.js.map +1 -1
- package/dist/blocks.css +37 -0
- package/dist/chat.js +1 -1
- package/dist/chunk-3PRYL2LS.js +2 -0
- package/dist/chunk-3PRYL2LS.js.map +1 -0
- package/dist/{chunk-HK525THY.js → chunk-5MPPIGCB.js} +18 -7
- package/dist/chunk-5MPPIGCB.js.map +1 -0
- package/dist/{chunk-CSRKYZ53.js → chunk-CZHPWLNW.js} +1 -1
- package/dist/{chunk-PZ4FJOD5.js → chunk-HLEBSAGC.js} +5 -1
- package/dist/{chunk-PZ4FJOD5.js.map → chunk-HLEBSAGC.js.map} +1 -1
- package/dist/chunk-M3T5RQYV.js +34 -0
- package/dist/chunk-M3T5RQYV.js.map +1 -0
- package/dist/{chunk-EUJ7337V.js → chunk-TISDOZH3.js} +18 -7
- package/dist/chunk-TISDOZH3.js.map +1 -0
- package/dist/chunk-W64RAX4N.js +79 -0
- package/dist/chunk-W64RAX4N.js.map +1 -0
- package/dist/chunk-ZFR6ZNXD.js +203 -0
- package/dist/chunk-ZFR6ZNXD.js.map +1 -0
- package/dist/collection-switcher.d.ts +1 -1
- package/dist/{default-avatar-D9kiSFNB.d.ts → default-avatar-BL0nJFti.d.ts} +16 -0
- package/dist/entity-header.d.ts +1 -1
- package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
- package/dist/index.js +7 -7
- package/dist/kind-config-editor.js +3 -2
- package/dist/kind-config-editor.js.map +1 -1
- package/dist/map.d.ts +6 -6
- package/dist/match-dialog.js +1 -1
- package/dist/media-grid.d.ts +16 -0
- package/dist/media-grid.js +1 -1
- package/dist/money-input.js +6 -70
- package/dist/money-input.js.map +1 -1
- package/dist/native.d.ts +16 -0
- package/dist/native.js +17 -6
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +13 -2
- package/dist/nav-bar.js +71 -54
- package/dist/nav-bar.js.map +1 -1
- package/dist/notification-preferences.js +2 -1
- package/dist/notification-preferences.js.map +1 -1
- package/dist/price-catalogue-editor.d.ts +117 -0
- package/dist/price-catalogue-editor.js +194 -0
- package/dist/price-catalogue-editor.js.map +1 -0
- package/dist/promo-code-field.js +1 -1
- package/dist/schema-DgjBz7-8.d.ts +242 -0
- package/dist/schema-form.d.ts +106 -0
- package/dist/schema-form.js +268 -0
- package/dist/schema-form.js.map +1 -0
- package/dist/shop/booking.d.ts +2 -2
- package/dist/shop/booking.js +1 -1
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/bulletin.js +1 -1
- package/dist/shop/faq.d.ts +2 -1
- package/dist/shop/faq.js +1 -1
- package/dist/shop/faq.js.map +1 -1
- package/dist/shop/gallery.js +1 -1
- package/dist/shop/look.d.ts +43 -0
- package/dist/shop/look.js +52 -0
- package/dist/shop/look.js.map +1 -0
- package/dist/shop/policies.d.ts +2 -1
- package/dist/shop/policies.js +1 -1
- package/dist/shop/policies.js.map +1 -1
- package/dist/shop/reviews.d.ts +2 -1
- package/dist/shop/reviews.js +1 -1
- package/dist/shop/reviews.js.map +1 -1
- package/dist/shop/services.js +1 -1
- package/dist/shop/social.js +1 -1
- package/dist/shop/story.d.ts +2 -1
- package/dist/shop/story.js +1 -1
- package/dist/shop/story.js.map +1 -1
- package/dist/shop/team.js +1 -1
- package/dist/shop/video.js +1 -1
- package/dist/shop/visit.js +1 -1
- package/dist/shop-composer.d.ts +29 -0
- package/dist/shop-composer.js +156 -89
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop.d.ts +6 -240
- package/dist/shop.js +24 -212
- package/dist/shop.js.map +1 -1
- package/dist/switch.js +2 -1
- package/dist/vertical-video.js +1 -1
- package/dist/wall.d.ts +7 -1
- package/dist/wall.js +5 -4
- package/dist/wall.js.map +1 -1
- package/package.json +59 -9
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +2 -2
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +4 -4
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/collection-switcher.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/price-catalogue-editor/default.d.ts +4 -0
- package/registry/examples/price-catalogue-editor/default.js +47 -0
- package/registry/examples/price-catalogue-editor/default.tsx +25 -0
- package/registry/examples/schema-form/default.d.ts +4 -0
- package/registry/examples/schema-form/default.js +29 -0
- package/registry/examples/schema-form/default.tsx +27 -0
- package/registry/examples/wall/pinned-note.js +2 -1
- package/registry/examples/wall/pinned-note.tsx +2 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +81 -8
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +30 -6
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +228 -0
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/proposal.json +1 -1
- package/registry/qr-code.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/schema-form.json +253 -0
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +10 -6
- package/registry/shop-gallery.json +1 -1
- package/registry/shop.json +51 -10
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +47 -4
- package/registry/waveform.json +1 -1
- package/dist/chunk-A7MQPIEG.js +0 -31
- package/dist/chunk-A7MQPIEG.js.map +0 -1
- package/dist/chunk-EUJ7337V.js.map +0 -1
- package/dist/chunk-HK525THY.js.map +0 -1
- /package/dist/{chunk-CSRKYZ53.js.map → chunk-CZHPWLNW.js.map} +0 -0
package/dist/shop.d.ts
CHANGED
|
@@ -1,195 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export {
|
|
1
|
+
import { S as ShopPage } from './schema-DgjBz7-8.js';
|
|
2
|
+
export { L as LocalizedText, P as ParsedSection, b as SECTION_DEFINITIONS, c as SECTION_TYPES, d as SHOP_SCHEMA_VERSION, a as Section, e as SectionDefinition, f as SectionOf, g as SectionSpec, h as SectionType, i as ShopPageIssue, j as ShopPageResult, k as defineSection, p as parseShopPage, s as sectionDefinition, l as shopPageSchema } from './schema-DgjBz7-8.js';
|
|
3
|
+
export { b as ShopFrame, c as ShopFrameProps, a as ShopPhoto, d as ShopSection, S as ShopSectionProps } from './frame-CNZ5VgDD.js';
|
|
4
|
+
import 'zod/mini';
|
|
3
5
|
import 'react';
|
|
4
6
|
|
|
5
|
-
/** The owner's words, in each language; the product's message is the fallback when a language is absent. */
|
|
6
|
-
declare const localizedText: z.ZodMiniObject<{
|
|
7
|
-
fr: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
|
-
en: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
type LocalizedText = z.output<typeof localizedText>;
|
|
11
|
-
|
|
12
|
-
type Shape = z.ZodMiniObject;
|
|
13
|
-
type BlockShapes = Record<string, Shape>;
|
|
14
|
-
/** What a section of a type is, once parsed. */
|
|
15
|
-
type ParsedSection<T extends string, V extends string, S extends Shape, B extends BlockShapes> = {
|
|
16
|
-
key: string;
|
|
17
|
-
type: T;
|
|
18
|
-
variant: V;
|
|
19
|
-
disabled?: boolean | undefined;
|
|
20
|
-
settings: z.output<S>;
|
|
21
|
-
text?: {
|
|
22
|
-
title?: z.output<typeof localizedText> | undefined;
|
|
23
|
-
lead?: z.output<typeof localizedText> | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
blocks?: {
|
|
26
|
-
[K in keyof B & string]: {
|
|
27
|
-
key: string;
|
|
28
|
-
type: K;
|
|
29
|
-
settings: z.output<B[K]>;
|
|
30
|
-
text?: Record<string, z.output<typeof localizedText>> | undefined;
|
|
31
|
-
};
|
|
32
|
-
}[keyof B & string][] | undefined;
|
|
33
|
-
};
|
|
34
|
-
type SectionSpec<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = {
|
|
35
|
-
/** The type's name: the `type` of a section. */
|
|
36
|
-
type: T;
|
|
37
|
-
/** Its variants; the first is the default one. */
|
|
38
|
-
variants: V;
|
|
39
|
-
/** The zod schema of its settings. */
|
|
40
|
-
settings: S;
|
|
41
|
-
/** The settings a new section starts with. */
|
|
42
|
-
settingsDefault: z.input<S>;
|
|
43
|
-
/** The block types it allows, each with the zod schema of its settings. None: the section has no blocks. */
|
|
44
|
-
blocks?: B;
|
|
45
|
-
/** The checks that read the whole section (a count, a combination); `issue(path, message)` refuses it. */
|
|
46
|
-
refine?: (section: ParsedSection<T, V[number], S, B>, issue: (path: (string | number)[], message: string) => void) => void;
|
|
47
|
-
};
|
|
48
|
-
type SectionDefinitionOf<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = SectionSpec<T, V, S, B> & {
|
|
49
|
-
readonly defaultVariant: V[number];
|
|
50
|
-
readonly blockTypes: readonly (keyof B & string)[];
|
|
51
|
-
/** The zod schema of a section of this type. */
|
|
52
|
-
readonly schema: z.ZodMiniType<ParsedSection<T, V[number], S, B>>;
|
|
53
|
-
};
|
|
54
|
-
/** Defines a section type. */
|
|
55
|
-
declare function defineSection<const T extends string, const V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes = Record<never, never>>(spec: SectionSpec<T, V, S, B>): SectionDefinitionOf<T, V, S, B>;
|
|
56
|
-
|
|
57
|
-
/** Every section type, in the order the composer lists them. */
|
|
58
|
-
declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonly ["poster", "split", "banner", "tv"], z.ZodMiniObject<{
|
|
59
|
-
media: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
60
|
-
focus: z.ZodMiniEnum<{
|
|
61
|
-
center: "center";
|
|
62
|
-
top: "top";
|
|
63
|
-
bottom: "bottom";
|
|
64
|
-
}>;
|
|
65
|
-
}, z.core.$strip>, {
|
|
66
|
-
fact: z.ZodMiniObject<{
|
|
67
|
-
kind: z.ZodMiniEnum<{
|
|
68
|
-
"open-now": "open-now";
|
|
69
|
-
area: "area";
|
|
70
|
-
score: "score";
|
|
71
|
-
}>;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
}>, SectionDefinitionOf<"services", readonly ["menu", "cards", "index", "carousel"], z.ZodMiniObject<{
|
|
74
|
-
source: z.ZodMiniEnum<{
|
|
75
|
-
all: "all";
|
|
76
|
-
pick: "pick";
|
|
77
|
-
}>;
|
|
78
|
-
groupBy: z.ZodMiniEnum<{
|
|
79
|
-
category: "category";
|
|
80
|
-
none: "none";
|
|
81
|
-
}>;
|
|
82
|
-
columns: z.ZodMiniUnion<[z.ZodMiniLiteral<1 | 2>, z.ZodMiniLiteral<1 | 2>]>;
|
|
83
|
-
aside: z.ZodMiniEnum<{
|
|
84
|
-
none: "none";
|
|
85
|
-
hours: "hours";
|
|
86
|
-
}>;
|
|
87
|
-
}, z.core.$strip>, {
|
|
88
|
-
service: z.ZodMiniObject<{
|
|
89
|
-
serviceId: z.ZodMiniString<string>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
}>, SectionDefinitionOf<"booking", readonly ["strip", "panel", "closing", "sticky"], z.ZodMiniObject<{
|
|
92
|
-
serviceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
|
-
count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 4 | 6>, z.ZodMiniLiteral<3 | 4 | 6>]>;
|
|
94
|
-
}, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"gallery", readonly ["mosaic", "filmstrip", "wall", "grid"], z.ZodMiniObject<{
|
|
95
|
-
source: z.ZodMiniEnum<{
|
|
96
|
-
all: "all";
|
|
97
|
-
pick: "pick";
|
|
98
|
-
}>;
|
|
99
|
-
texture: z.ZodMiniEnum<{
|
|
100
|
-
plaster: "plaster";
|
|
101
|
-
brick: "brick";
|
|
102
|
-
ridge: "ridge";
|
|
103
|
-
zellige: "zellige";
|
|
104
|
-
}>;
|
|
105
|
-
}, z.core.$strip>, {
|
|
106
|
-
photo: z.ZodMiniObject<{
|
|
107
|
-
mediaId: z.ZodMiniString<string>;
|
|
108
|
-
caption: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
note: z.ZodMiniObject<{
|
|
111
|
-
text: z.ZodMiniString<string>;
|
|
112
|
-
signature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
113
|
-
}, z.core.$strip>;
|
|
114
|
-
sign: z.ZodMiniObject<{}, z.core.$strip>;
|
|
115
|
-
}>, SectionDefinitionOf<"video", readonly ["tv", "shorts"], z.ZodMiniObject<{
|
|
116
|
-
cabinet: z.ZodMiniEnum<{
|
|
117
|
-
cabinet: "cabinet";
|
|
118
|
-
portable: "portable";
|
|
119
|
-
}>;
|
|
120
|
-
channel: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
121
|
-
}, z.core.$strip>, {
|
|
122
|
-
reel: z.ZodMiniObject<{
|
|
123
|
-
platform: z.ZodMiniEnum<{
|
|
124
|
-
tiktok: "tiktok";
|
|
125
|
-
"youtube-shorts": "youtube-shorts";
|
|
126
|
-
instagram: "instagram";
|
|
127
|
-
}>;
|
|
128
|
-
url: z.ZodMiniString<string>;
|
|
129
|
-
}, z.core.$strip>;
|
|
130
|
-
}>, SectionDefinitionOf<"reviews", readonly ["summary-cards", "quote", "strip"], z.ZodMiniObject<{
|
|
131
|
-
rule: z.ZodMiniEnum<{
|
|
132
|
-
best: "best";
|
|
133
|
-
latest: "latest";
|
|
134
|
-
}>;
|
|
135
|
-
count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 1 | 2>, z.ZodMiniLiteral<3 | 1 | 2>]>;
|
|
136
|
-
}, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"bulletin", readonly ["board", "banner"], z.ZodMiniObject<{}, z.core.$strip>, {
|
|
137
|
-
flyer: z.ZodMiniObject<{
|
|
138
|
-
text: z.ZodMiniString<string>;
|
|
139
|
-
signature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
140
|
-
until: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
141
|
-
}, z.core.$strip>;
|
|
142
|
-
}>, SectionDefinitionOf<"team", readonly ["row", "cards"], z.ZodMiniObject<{
|
|
143
|
-
source: z.ZodMiniEnum<{
|
|
144
|
-
all: "all";
|
|
145
|
-
pick: "pick";
|
|
146
|
-
}>;
|
|
147
|
-
}, z.core.$strip>, {
|
|
148
|
-
member: z.ZodMiniObject<{
|
|
149
|
-
memberId: z.ZodMiniString<string>;
|
|
150
|
-
}, z.core.$strip>;
|
|
151
|
-
}>, SectionDefinitionOf<"visit", readonly ["card", "map", "split"], z.ZodMiniObject<{
|
|
152
|
-
showPhone: z.ZodMiniBoolean<boolean>;
|
|
153
|
-
}, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"story", readonly ["quote", "owner"], z.ZodMiniObject<{
|
|
154
|
-
body: z.ZodMiniObject<{
|
|
155
|
-
fr: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
156
|
-
en: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
157
|
-
}, z.core.$strip>;
|
|
158
|
-
}, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"social", readonly ["links", "facade"], z.ZodMiniObject<{}, z.core.$strip>, {
|
|
159
|
-
link: z.ZodMiniObject<{
|
|
160
|
-
platform: z.ZodMiniEnum<{
|
|
161
|
-
tiktok: "tiktok";
|
|
162
|
-
"youtube-shorts": "youtube-shorts";
|
|
163
|
-
instagram: "instagram";
|
|
164
|
-
}>;
|
|
165
|
-
url: z.ZodMiniString<string>;
|
|
166
|
-
}, z.core.$strip>;
|
|
167
|
-
}>, SectionDefinitionOf<"faq", readonly ["list"], z.ZodMiniObject<{}, z.core.$strip>, {
|
|
168
|
-
question: z.ZodMiniObject<{
|
|
169
|
-
question: z.ZodMiniObject<{
|
|
170
|
-
fr: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
171
|
-
en: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
172
|
-
}, z.core.$strip>;
|
|
173
|
-
answer: z.ZodMiniObject<{
|
|
174
|
-
fr: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
175
|
-
en: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
176
|
-
}, z.core.$strip>;
|
|
177
|
-
}, z.core.$strip>;
|
|
178
|
-
}>, SectionDefinitionOf<"policies", readonly ["inline"], z.ZodMiniObject<{
|
|
179
|
-
show: z.ZodMiniArray<z.ZodMiniEnum<{
|
|
180
|
-
cancellation: "cancellation";
|
|
181
|
-
prices: "prices";
|
|
182
|
-
"booking-window": "booking-window";
|
|
183
|
-
}>>;
|
|
184
|
-
}, z.core.$strip>, Record<never, never>>];
|
|
185
|
-
type SectionDefinition = (typeof SECTION_DEFINITIONS)[number];
|
|
186
|
-
type SectionType = SectionDefinition["type"];
|
|
187
|
-
declare const SECTION_TYPES: readonly SectionType[];
|
|
188
|
-
/** The definition of a type. */
|
|
189
|
-
declare function sectionDefinition<T extends SectionType>(type: T): Extract<SectionDefinition, {
|
|
190
|
-
type: T;
|
|
191
|
-
}>;
|
|
192
|
-
|
|
193
7
|
/**
|
|
194
8
|
* The most a page, a section or a card list may hold. A salon page that stays a page that sells: bounded on purpose.
|
|
195
9
|
* @fixed: ADR-007 §3 — product limits of the document, never a business setting.
|
|
@@ -255,54 +69,6 @@ declare function connectShopPreview({ composerOrigin, onRefresh, root }: {
|
|
|
255
69
|
root?: Document;
|
|
256
70
|
}): () => void;
|
|
257
71
|
|
|
258
|
-
/** The version of the document's format; migrations are pure functions schema n → n + 1 (`migrate.ts`). */
|
|
259
|
-
declare const SHOP_SCHEMA_VERSION = 1;
|
|
260
|
-
/** A look preset by id and version (`@krizaka/tokens`): `salon-atelier`. The mode is the visitor's, never stored. */
|
|
261
|
-
declare const presetRef: z.ZodMiniObject<{
|
|
262
|
-
id: z.ZodMiniString<string>;
|
|
263
|
-
version: z.ZodMiniInt;
|
|
264
|
-
}, z.core.$strip>;
|
|
265
|
-
declare const shopPageSchema: z.ZodMiniObject<{
|
|
266
|
-
schema: z.ZodMiniLiteral<1>;
|
|
267
|
-
preset: z.ZodMiniObject<{
|
|
268
|
-
id: z.ZodMiniString<string>;
|
|
269
|
-
version: z.ZodMiniInt;
|
|
270
|
-
}, z.core.$strip>;
|
|
271
|
-
density: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
272
|
-
compact: "compact";
|
|
273
|
-
airy: "airy";
|
|
274
|
-
}>>;
|
|
275
|
-
sections: z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<Readonly<{
|
|
276
|
-
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
277
|
-
}>, z.core.$strip>, ...z.ZodMiniObject<Readonly<{
|
|
278
|
-
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
279
|
-
}>, z.core.$strip>[]], "type">>;
|
|
280
|
-
}, z.core.$strip>;
|
|
281
|
-
/** A section of any type, as parsed: its `settings` and `blocks` are the type's own. */
|
|
282
|
-
type Section = z.output<(typeof SECTION_DEFINITIONS)[number]["schema"]>;
|
|
283
|
-
type ShopPage = {
|
|
284
|
-
schema: typeof SHOP_SCHEMA_VERSION;
|
|
285
|
-
preset: z.output<typeof presetRef>;
|
|
286
|
-
density?: "compact" | "airy" | undefined;
|
|
287
|
-
sections: Section[];
|
|
288
|
-
};
|
|
289
|
-
type SectionOf<T extends SectionType> = Extract<Section, {
|
|
290
|
-
type: T;
|
|
291
|
-
}>;
|
|
292
|
-
type ShopPageIssue = {
|
|
293
|
-
path: string;
|
|
294
|
-
message: string;
|
|
295
|
-
};
|
|
296
|
-
type ShopPageResult = {
|
|
297
|
-
ok: true;
|
|
298
|
-
page: ShopPage;
|
|
299
|
-
} | {
|
|
300
|
-
ok: false;
|
|
301
|
-
issues: ShopPageIssue[];
|
|
302
|
-
};
|
|
303
|
-
/** Validates a document; an invalid one answers every issue with its path (`sections.2.variant`), for a 422. */
|
|
304
|
-
declare function parseShopPage(input: unknown): ShopPageResult;
|
|
305
|
-
|
|
306
72
|
declare const shopStarters: {
|
|
307
73
|
readonly salonCompact: ShopPage;
|
|
308
74
|
readonly salonEditorial: ShopPage;
|
|
@@ -312,5 +78,5 @@ declare const shopStarters: {
|
|
|
312
78
|
};
|
|
313
79
|
type ShopStarterId = keyof typeof shopStarters;
|
|
314
80
|
|
|
315
|
-
export {
|
|
316
|
-
export type {
|
|
81
|
+
export { SHOP_KEY_ATTRIBUTE, SHOP_LIMITS, SHOP_MIGRATIONS, ShopPage, connectShopPreview, createMigrator, migrateShopPage, postToPreview, readPreviewMessage, shopStarters };
|
|
82
|
+
export type { MigrationResult, PreviewMessage, ShopMigration, ShopStarterId };
|
package/dist/shop.js
CHANGED
|
@@ -1,227 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SECTION_DEFINITIONS,
|
|
3
|
+
SECTION_TYPES,
|
|
4
|
+
defineSection,
|
|
5
|
+
sectionDefinition
|
|
6
|
+
} from "./chunk-ZFR6ZNXD.js";
|
|
1
7
|
import {
|
|
2
8
|
SHOP_LIMITS
|
|
3
9
|
} from "./chunk-ZYHWJ7U5.js";
|
|
4
10
|
import {
|
|
5
11
|
ShopFrame,
|
|
6
12
|
ShopSection
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M3T5RQYV.js";
|
|
8
14
|
import "./chunk-B47WSPMP.js";
|
|
9
15
|
|
|
10
|
-
// src/shop/catalogue.ts
|
|
11
|
-
import * as z3 from "zod/mini";
|
|
12
|
-
|
|
13
|
-
// src/shop/define.ts
|
|
14
|
-
import * as z2 from "zod/mini";
|
|
15
|
-
|
|
16
|
-
// src/shop/text.ts
|
|
17
|
-
import * as z from "zod/mini";
|
|
18
|
-
var localizedText = z.object({
|
|
19
|
-
fr: z.optional(z.string().check(z.maxLength(600))),
|
|
20
|
-
en: z.optional(z.string().check(z.maxLength(600)))
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// src/shop/define.ts
|
|
24
|
-
var key = z2.string().check(z2.minLength(1), z2.maxLength(40), z2.regex(/^[A-Za-z0-9_-]+$/, "a key (letters, digits, - and _)"));
|
|
25
|
-
function defineSection(spec) {
|
|
26
|
-
const blockUnion = spec.blocks && Object.keys(spec.blocks).length > 0 ? z2.discriminatedUnion(
|
|
27
|
-
"type",
|
|
28
|
-
Object.entries(spec.blocks).map(
|
|
29
|
-
([type, settings]) => z2.object({ key, type: z2.literal(type), settings, text: z2.optional(z2.record(z2.string(), localizedText)) })
|
|
30
|
-
)
|
|
31
|
-
) : void 0;
|
|
32
|
-
const blocks = blockUnion ? z2.optional(z2.array(blockUnion).check(z2.maxLength(SHOP_LIMITS.blocks))) : z2.optional(z2.array(z2.never()).check(z2.maxLength(0)));
|
|
33
|
-
const base = z2.object({
|
|
34
|
-
key,
|
|
35
|
-
type: z2.literal(spec.type),
|
|
36
|
-
variant: z2.enum(spec.variants),
|
|
37
|
-
disabled: z2.optional(z2.boolean()),
|
|
38
|
-
settings: spec.settings,
|
|
39
|
-
text: z2.optional(z2.object({ title: z2.optional(localizedText), lead: z2.optional(localizedText) })),
|
|
40
|
-
blocks
|
|
41
|
-
});
|
|
42
|
-
const schema = base.check(
|
|
43
|
-
z2.superRefine((value, ctx) => {
|
|
44
|
-
spec.refine?.(value, (path, message) => ctx.issues.push({ code: "custom", message, path, input: value }));
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
return Object.freeze({
|
|
48
|
-
...spec,
|
|
49
|
-
defaultVariant: spec.variants[0],
|
|
50
|
-
blockTypes: Object.keys(spec.blocks ?? {}),
|
|
51
|
-
schema
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/shop/catalogue.ts
|
|
56
|
-
var ref = z3.string().check(z3.minLength(1), z3.maxLength(80));
|
|
57
|
-
var short = z3.string().check(z3.minLength(1), z3.maxLength(140));
|
|
58
|
-
var url = z3.string().check(z3.maxLength(300), z3.regex(/^https:\/\//, "an https address"));
|
|
59
|
-
var isoDay = z3.string().check(z3.regex(/^\d{4}-\d{2}-\d{2}$/, "a day (YYYY-MM-DD)"));
|
|
60
|
-
var source = z3.enum(["all", "pick"]);
|
|
61
|
-
var oneOf = (...n) => z3.union(n.map((v) => z3.literal(v)));
|
|
62
|
-
var platforms = ["tiktok", "youtube-shorts", "instagram"];
|
|
63
|
-
var heroSection = defineSection({
|
|
64
|
-
type: "hero",
|
|
65
|
-
variants: ["poster", "split", "banner", "tv"],
|
|
66
|
-
settings: z3.object({
|
|
67
|
-
/** The cover: a media id. Absent, the product's default for the trade. */
|
|
68
|
-
media: z3.optional(ref),
|
|
69
|
-
/** Where the photo is cropped to when the box is not its ratio. */
|
|
70
|
-
focus: z3.enum(["center", "top", "bottom"])
|
|
71
|
-
}),
|
|
72
|
-
settingsDefault: { focus: "center" },
|
|
73
|
-
blocks: { fact: z3.object({ kind: z3.enum(["open-now", "area", "score"]) }) }
|
|
74
|
-
});
|
|
75
|
-
var servicesSection = defineSection({
|
|
76
|
-
type: "services",
|
|
77
|
-
variants: ["menu", "cards", "index", "carousel"],
|
|
78
|
-
settings: z3.object({
|
|
79
|
-
/** `all` the shop's services, or `pick` the ones the `service` blocks name, in their order. */
|
|
80
|
-
source,
|
|
81
|
-
groupBy: z3.enum(["category", "none"]),
|
|
82
|
-
/** `menu` only: two columns when nothing sits beside it. */
|
|
83
|
-
columns: oneOf(1, 2),
|
|
84
|
-
/** `menu` only: the shop's hours, team and address beside the list (the host draws them from its own data). */
|
|
85
|
-
aside: z3.enum(["hours", "none"])
|
|
86
|
-
}),
|
|
87
|
-
settingsDefault: { source: "all", groupBy: "category", columns: 1, aside: "hours" },
|
|
88
|
-
blocks: { service: z3.object({ serviceId: ref }) },
|
|
89
|
-
refine: (section, issue) => {
|
|
90
|
-
if (section.settings.source === "pick" && (section.blocks ?? []).length === 0) issue(["blocks"], "pick at least one service");
|
|
91
|
-
if (section.variant === "cards" && (section.blocks ?? []).length > SHOP_LIMITS.cards) issue(["blocks"], `at most ${SHOP_LIMITS.cards} cards`);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
var bookingSection = defineSection({
|
|
95
|
-
type: "booking",
|
|
96
|
-
variants: ["strip", "panel", "closing", "sticky"],
|
|
97
|
-
settings: z3.object({
|
|
98
|
-
/** A service the times are for; absent, the next free times of any service. */
|
|
99
|
-
serviceId: z3.optional(ref),
|
|
100
|
-
/** `strip`: how many times it shows. */
|
|
101
|
-
count: oneOf(3, 4, 6)
|
|
102
|
-
}),
|
|
103
|
-
settingsDefault: { count: 4 }
|
|
104
|
-
});
|
|
105
|
-
var gallerySection = defineSection({
|
|
106
|
-
type: "gallery",
|
|
107
|
-
variants: ["mosaic", "filmstrip", "wall", "grid"],
|
|
108
|
-
settings: z3.object({
|
|
109
|
-
source,
|
|
110
|
-
/** `wall` only. */
|
|
111
|
-
texture: z3.enum(["plaster", "brick", "ridge", "zellige"])
|
|
112
|
-
}),
|
|
113
|
-
settingsDefault: { source: "all", texture: "plaster" },
|
|
114
|
-
blocks: {
|
|
115
|
-
photo: z3.object({ mediaId: ref, caption: z3.optional(short) }),
|
|
116
|
-
note: z3.object({ text: short, signature: z3.optional(z3.string().check(z3.maxLength(40))) }),
|
|
117
|
-
sign: z3.object({})
|
|
118
|
-
},
|
|
119
|
-
refine: (section, issue) => {
|
|
120
|
-
const photos = (section.blocks ?? []).filter((b) => b.type === "photo").length;
|
|
121
|
-
if (photos > SHOP_LIMITS.photos) issue(["blocks"], `at most ${SHOP_LIMITS.photos} photos`);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
var videoSection = defineSection({
|
|
125
|
-
type: "video",
|
|
126
|
-
variants: ["tv", "shorts"],
|
|
127
|
-
settings: z3.object({ cabinet: z3.enum(["cabinet", "portable"]), channel: z3.optional(z3.string().check(z3.maxLength(32))) }),
|
|
128
|
-
settingsDefault: { cabinet: "cabinet" },
|
|
129
|
-
blocks: { reel: z3.object({ platform: z3.enum(platforms), url }) }
|
|
130
|
-
});
|
|
131
|
-
var reviewsSection = defineSection({
|
|
132
|
-
type: "reviews",
|
|
133
|
-
variants: ["summary-cards", "quote", "strip"],
|
|
134
|
-
settings: z3.object({ rule: z3.enum(["best", "latest"]), count: oneOf(1, 2, 3) }),
|
|
135
|
-
settingsDefault: { rule: "best", count: 2 }
|
|
136
|
-
});
|
|
137
|
-
var bulletinSection = defineSection({
|
|
138
|
-
type: "bulletin",
|
|
139
|
-
variants: ["board", "banner"],
|
|
140
|
-
settings: z3.object({}),
|
|
141
|
-
settingsDefault: {},
|
|
142
|
-
blocks: { flyer: z3.object({ text: short, signature: z3.optional(z3.string().check(z3.maxLength(40))), until: z3.optional(isoDay) }) },
|
|
143
|
-
refine: (section, issue) => {
|
|
144
|
-
if ((section.blocks ?? []).length > SHOP_LIMITS.flyers) issue(["blocks"], `at most ${SHOP_LIMITS.flyers} flyers`);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
var teamSection = defineSection({
|
|
148
|
-
type: "team",
|
|
149
|
-
variants: ["row", "cards"],
|
|
150
|
-
settings: z3.object({ source }),
|
|
151
|
-
settingsDefault: { source: "all" },
|
|
152
|
-
blocks: { member: z3.object({ memberId: ref }) }
|
|
153
|
-
});
|
|
154
|
-
var visitSection = defineSection({
|
|
155
|
-
type: "visit",
|
|
156
|
-
variants: ["card", "map", "split"],
|
|
157
|
-
settings: z3.object({ showPhone: z3.boolean() }),
|
|
158
|
-
settingsDefault: { showPhone: true }
|
|
159
|
-
});
|
|
160
|
-
var storySection = defineSection({
|
|
161
|
-
type: "story",
|
|
162
|
-
variants: ["quote", "owner"],
|
|
163
|
-
settings: z3.object({ body: localizedText }),
|
|
164
|
-
settingsDefault: { body: {} }
|
|
165
|
-
});
|
|
166
|
-
var socialSection = defineSection({
|
|
167
|
-
type: "social",
|
|
168
|
-
variants: ["links", "facade"],
|
|
169
|
-
settings: z3.object({}),
|
|
170
|
-
settingsDefault: {},
|
|
171
|
-
blocks: { link: z3.object({ platform: z3.enum(platforms), url }) }
|
|
172
|
-
});
|
|
173
|
-
var faqSection = defineSection({
|
|
174
|
-
type: "faq",
|
|
175
|
-
variants: ["list"],
|
|
176
|
-
settings: z3.object({}),
|
|
177
|
-
settingsDefault: {},
|
|
178
|
-
blocks: { question: z3.object({ question: localizedText, answer: localizedText }) }
|
|
179
|
-
});
|
|
180
|
-
var policiesSection = defineSection({
|
|
181
|
-
type: "policies",
|
|
182
|
-
variants: ["inline"],
|
|
183
|
-
settings: z3.object({ show: z3.array(z3.enum(["cancellation", "prices", "booking-window"])).check(z3.maxLength(3)) }),
|
|
184
|
-
settingsDefault: { show: ["cancellation", "prices", "booking-window"] }
|
|
185
|
-
});
|
|
186
|
-
var SECTION_DEFINITIONS = [
|
|
187
|
-
heroSection,
|
|
188
|
-
servicesSection,
|
|
189
|
-
bookingSection,
|
|
190
|
-
gallerySection,
|
|
191
|
-
videoSection,
|
|
192
|
-
reviewsSection,
|
|
193
|
-
bulletinSection,
|
|
194
|
-
teamSection,
|
|
195
|
-
visitSection,
|
|
196
|
-
storySection,
|
|
197
|
-
socialSection,
|
|
198
|
-
faqSection,
|
|
199
|
-
policiesSection
|
|
200
|
-
];
|
|
201
|
-
var SECTION_TYPES = SECTION_DEFINITIONS.map((d) => d.type);
|
|
202
|
-
function sectionDefinition(type) {
|
|
203
|
-
return SECTION_DEFINITIONS.find((d) => d.type === type);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
16
|
// src/shop/schema.ts
|
|
207
|
-
import * as
|
|
17
|
+
import * as z from "zod/mini";
|
|
208
18
|
var SHOP_SCHEMA_VERSION = 1;
|
|
209
|
-
var presetRef =
|
|
210
|
-
id:
|
|
211
|
-
version:
|
|
19
|
+
var presetRef = z.object({
|
|
20
|
+
id: z.string().check(z.regex(/^[a-z]+-[a-z]+$/, "a preset id (trade-name)")),
|
|
21
|
+
version: z.int().check(z.minimum(1))
|
|
212
22
|
});
|
|
213
|
-
var sectionUnion =
|
|
23
|
+
var sectionUnion = z.discriminatedUnion(
|
|
214
24
|
"type",
|
|
215
25
|
SECTION_DEFINITIONS.map((d) => d.schema)
|
|
216
26
|
);
|
|
217
|
-
var shopPageSchema =
|
|
218
|
-
schema:
|
|
27
|
+
var shopPageSchema = z.object({
|
|
28
|
+
schema: z.literal(SHOP_SCHEMA_VERSION),
|
|
219
29
|
preset: presetRef,
|
|
220
30
|
/** Overrides the preset's density. */
|
|
221
|
-
density:
|
|
222
|
-
|
|
31
|
+
density: z.optional(z.enum(["compact", "airy"])),
|
|
32
|
+
/** One of the accents the look lists as tested (`krizaka`, `akinaza:accent-2`…): the owner's choice within the look. */
|
|
33
|
+
accent: z.optional(z.string().check(z.regex(/^[a-z]+(:accent-2)?$/, "an accent of the look"))),
|
|
34
|
+
sections: z.array(sectionUnion).check(z.minLength(1), z.maxLength(SHOP_LIMITS.sections))
|
|
223
35
|
}).check(
|
|
224
|
-
|
|
36
|
+
z.superRefine((page, ctx) => {
|
|
225
37
|
const add = (path, message) => ctx.issues.push({ code: "custom", message, path, input: page });
|
|
226
38
|
const seen = /* @__PURE__ */ new Set();
|
|
227
39
|
page.sections.forEach((section, i) => {
|
|
@@ -273,7 +85,7 @@ function postToPreview(target, origin, message) {
|
|
|
273
85
|
}
|
|
274
86
|
var SHOP_KEY_ATTRIBUTE = "data-shop-key";
|
|
275
87
|
function connectShopPreview({ composerOrigin, onRefresh, root = document }) {
|
|
276
|
-
const find = (
|
|
88
|
+
const find = (key) => root.querySelector(`[${SHOP_KEY_ATTRIBUTE}="${key}"]`);
|
|
277
89
|
const handler = (event) => {
|
|
278
90
|
if (event.origin !== composerOrigin) return;
|
|
279
91
|
const m = readPreviewMessage(event, composerOrigin);
|
|
@@ -296,7 +108,7 @@ function connectShopPreview({ composerOrigin, onRefresh, root = document }) {
|
|
|
296
108
|
}
|
|
297
109
|
|
|
298
110
|
// src/shop/starters.ts
|
|
299
|
-
var s = (
|
|
111
|
+
var s = (key) => key;
|
|
300
112
|
var doc = (preset, density, sections) => ({
|
|
301
113
|
schema: 1,
|
|
302
114
|
preset: { id: preset, version: 1 },
|
|
@@ -320,9 +132,9 @@ var menu = (columns, aside) => ({
|
|
|
320
132
|
variant: "menu",
|
|
321
133
|
settings: { source: "all", groupBy: "category", columns, aside }
|
|
322
134
|
});
|
|
323
|
-
var booking = (variant,
|
|
324
|
-
var gallery = (variant,
|
|
325
|
-
key
|
|
135
|
+
var booking = (variant, key) => ({ key, type: "booking", variant, settings: { count: 4 } });
|
|
136
|
+
var gallery = (variant, key, extra = {}) => ({
|
|
137
|
+
key,
|
|
326
138
|
type: "gallery",
|
|
327
139
|
variant,
|
|
328
140
|
settings: { source: "all", texture: "plaster" },
|