@krizaka/ui 3.64.0 → 3.64.1
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-header.d.ts +3 -3
- package/dist/blocks.css +41 -0
- package/dist/chunk-5D7NMUF6.js +35 -0
- package/dist/chunk-5D7NMUF6.js.map +1 -0
- package/dist/chunk-A7MQPIEG.js +31 -0
- package/dist/chunk-A7MQPIEG.js.map +1 -0
- package/dist/chunk-B47WSPMP.js +60 -0
- package/dist/chunk-B47WSPMP.js.map +1 -0
- package/dist/chunk-HKEAYSFS.js +19 -0
- package/dist/chunk-HKEAYSFS.js.map +1 -0
- package/dist/chunk-ZYHWJ7U5.js +20 -0
- package/dist/chunk-ZYHWJ7U5.js.map +1 -0
- package/dist/cover-hero.d.ts +4 -0
- package/dist/cover-hero.js +5 -2
- package/dist/cover-hero.js.map +1 -1
- package/dist/file-upload.d.ts +2 -2
- package/dist/frame-D6Xv83t8.d.ts +52 -0
- package/dist/language-switch.d.ts +9 -9
- package/dist/service-card.d.ts +25 -1
- package/dist/service-card.js +7 -3
- package/dist/service-card.js.map +1 -1
- package/dist/shop/booking.d.ts +36 -0
- package/dist/shop/booking.js +37 -0
- package/dist/shop/booking.js.map +1 -0
- package/dist/shop/bulletin.d.ts +28 -0
- package/dist/shop/bulletin.js +29 -0
- package/dist/shop/bulletin.js.map +1 -0
- package/dist/shop/demo.d.ts +135 -0
- package/dist/shop/demo.js +141 -0
- package/dist/shop/demo.js.map +1 -0
- package/dist/shop/faq.d.ts +20 -0
- package/dist/shop/faq.js +33 -0
- package/dist/shop/faq.js.map +1 -0
- package/dist/shop/gallery.d.ts +46 -0
- package/dist/shop/gallery.js +76 -0
- package/dist/shop/gallery.js.map +1 -0
- package/dist/shop/hero.d.ts +36 -0
- package/dist/shop/hero.js +70 -0
- package/dist/shop/hero.js.map +1 -0
- package/dist/shop/map-gate.d.ts +22 -0
- package/dist/shop/map-gate.js +34 -0
- package/dist/shop/map-gate.js.map +1 -0
- package/dist/shop/policies.d.ts +18 -0
- package/dist/shop/policies.js +16 -0
- package/dist/shop/policies.js.map +1 -0
- package/dist/shop/reviews.d.ts +25 -0
- package/dist/shop/reviews.js +47 -0
- package/dist/shop/reviews.js.map +1 -0
- package/dist/shop/services.d.ts +57 -0
- package/dist/shop/services.js +118 -0
- package/dist/shop/services.js.map +1 -0
- package/dist/shop/social.d.ts +27 -0
- package/dist/shop/social.js +27 -0
- package/dist/shop/social.js.map +1 -0
- package/dist/shop/story.d.ts +24 -0
- package/dist/shop/story.js +26 -0
- package/dist/shop/story.js.map +1 -0
- package/dist/shop/team.d.ts +24 -0
- package/dist/shop/team.js +26 -0
- package/dist/shop/team.js.map +1 -0
- package/dist/shop/video.d.ts +40 -0
- package/dist/shop/video.js +33 -0
- package/dist/shop/video.js.map +1 -0
- package/dist/shop/visit.d.ts +29 -0
- package/dist/shop/visit.js +38 -0
- package/dist/shop/visit.js.map +1 -0
- package/dist/shop-composer.d.ts +490 -0
- package/dist/shop-composer.js +2061 -0
- package/dist/shop-composer.js.map +1 -0
- package/dist/shop.d.ts +316 -0
- package/dist/shop.js +389 -0
- package/dist/shop.js.map +1 -0
- package/package.json +261 -3
- 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-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 +1 -1
- 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/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/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- 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/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/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/shop/booking-panel.d.ts +4 -0
- package/registry/examples/shop/booking-panel.js +12 -0
- package/registry/examples/shop/booking-panel.tsx +11 -0
- package/registry/examples/shop/booking-sticky.d.ts +4 -0
- package/registry/examples/shop/booking-sticky.js +15 -0
- package/registry/examples/shop/booking-sticky.tsx +12 -0
- package/registry/examples/shop/booking-strip.d.ts +4 -0
- package/registry/examples/shop/booking-strip.js +13 -0
- package/registry/examples/shop/booking-strip.tsx +12 -0
- package/registry/examples/shop/bulletin-banner.d.ts +4 -0
- package/registry/examples/shop/bulletin-banner.js +13 -0
- package/registry/examples/shop/bulletin-banner.tsx +12 -0
- package/registry/examples/shop/bulletin-board.d.ts +4 -0
- package/registry/examples/shop/bulletin-board.js +13 -0
- package/registry/examples/shop/bulletin-board.tsx +12 -0
- package/registry/examples/shop/cards.d.ts +4 -0
- package/registry/examples/shop/cards.js +13 -0
- package/registry/examples/shop/cards.tsx +12 -0
- package/registry/examples/shop/carousel.d.ts +4 -0
- package/registry/examples/shop/carousel.js +13 -0
- package/registry/examples/shop/carousel.tsx +12 -0
- package/registry/examples/shop/document.d.ts +4 -0
- package/registry/examples/shop/document.js +20 -0
- package/registry/examples/shop/document.tsx +13 -0
- package/registry/examples/shop/faq.d.ts +4 -0
- package/registry/examples/shop/faq.js +13 -0
- package/registry/examples/shop/faq.tsx +12 -0
- package/registry/examples/shop/gallery-filmstrip.d.ts +4 -0
- package/registry/examples/shop/gallery-filmstrip.js +13 -0
- package/registry/examples/shop/gallery-filmstrip.tsx +12 -0
- package/registry/examples/shop/gallery-grid.d.ts +4 -0
- package/registry/examples/shop/gallery-grid.js +13 -0
- package/registry/examples/shop/gallery-grid.tsx +12 -0
- package/registry/examples/shop/gallery-mosaic.d.ts +4 -0
- package/registry/examples/shop/gallery-mosaic.js +13 -0
- package/registry/examples/shop/gallery-mosaic.tsx +12 -0
- package/registry/examples/shop/gallery-wall.d.ts +4 -0
- package/registry/examples/shop/gallery-wall.js +13 -0
- package/registry/examples/shop/gallery-wall.tsx +12 -0
- package/registry/examples/shop/hero-banner.d.ts +4 -0
- package/registry/examples/shop/hero-banner.js +15 -0
- package/registry/examples/shop/hero-banner.tsx +14 -0
- package/registry/examples/shop/hero-poster.d.ts +4 -0
- package/registry/examples/shop/hero-poster.js +15 -0
- package/registry/examples/shop/hero-poster.tsx +14 -0
- package/registry/examples/shop/hero-split.d.ts +4 -0
- package/registry/examples/shop/hero-split.js +15 -0
- package/registry/examples/shop/hero-split.tsx +14 -0
- package/registry/examples/shop/hero-tv.d.ts +4 -0
- package/registry/examples/shop/hero-tv.js +15 -0
- package/registry/examples/shop/hero-tv.tsx +14 -0
- package/registry/examples/shop/index.d.ts +4 -0
- package/registry/examples/shop/index.js +13 -0
- package/registry/examples/shop/index.tsx +12 -0
- package/registry/examples/shop/menu-columns.d.ts +4 -0
- package/registry/examples/shop/menu-columns.js +13 -0
- package/registry/examples/shop/menu-columns.tsx +12 -0
- package/registry/examples/shop/menu.d.ts +4 -0
- package/registry/examples/shop/menu.js +25 -0
- package/registry/examples/shop/menu.tsx +21 -0
- package/registry/examples/shop/page.d.ts +4 -0
- package/registry/examples/shop/page.js +32 -0
- package/registry/examples/shop/page.tsx +27 -0
- package/registry/examples/shop/policies.d.ts +4 -0
- package/registry/examples/shop/policies.js +13 -0
- package/registry/examples/shop/policies.tsx +12 -0
- package/registry/examples/shop/reviews-quote.d.ts +4 -0
- package/registry/examples/shop/reviews-quote.js +13 -0
- package/registry/examples/shop/reviews-quote.tsx +12 -0
- package/registry/examples/shop/reviews-strip.d.ts +4 -0
- package/registry/examples/shop/reviews-strip.js +13 -0
- package/registry/examples/shop/reviews-strip.tsx +12 -0
- package/registry/examples/shop/reviews-summary-cards.d.ts +4 -0
- package/registry/examples/shop/reviews-summary-cards.js +13 -0
- package/registry/examples/shop/reviews-summary-cards.tsx +12 -0
- package/registry/examples/shop/social-facade.d.ts +4 -0
- package/registry/examples/shop/social-facade.js +13 -0
- package/registry/examples/shop/social-facade.tsx +12 -0
- package/registry/examples/shop/social-links.d.ts +4 -0
- package/registry/examples/shop/social-links.js +12 -0
- package/registry/examples/shop/social-links.tsx +11 -0
- package/registry/examples/shop/story-owner.d.ts +4 -0
- package/registry/examples/shop/story-owner.js +13 -0
- package/registry/examples/shop/story-owner.tsx +12 -0
- package/registry/examples/shop/story-quote.d.ts +4 -0
- package/registry/examples/shop/story-quote.js +13 -0
- package/registry/examples/shop/story-quote.tsx +12 -0
- package/registry/examples/shop/team-cards.d.ts +4 -0
- package/registry/examples/shop/team-cards.js +13 -0
- package/registry/examples/shop/team-cards.tsx +12 -0
- package/registry/examples/shop/team-row.d.ts +4 -0
- package/registry/examples/shop/team-row.js +13 -0
- package/registry/examples/shop/team-row.tsx +12 -0
- package/registry/examples/shop/video-shorts.d.ts +4 -0
- package/registry/examples/shop/video-shorts.js +14 -0
- package/registry/examples/shop/video-shorts.tsx +13 -0
- package/registry/examples/shop/video-tv.d.ts +4 -0
- package/registry/examples/shop/video-tv.js +13 -0
- package/registry/examples/shop/video-tv.tsx +12 -0
- package/registry/examples/shop/visit-card.d.ts +4 -0
- package/registry/examples/shop/visit-card.js +13 -0
- package/registry/examples/shop/visit-card.tsx +12 -0
- package/registry/examples/shop/visit-map.d.ts +4 -0
- package/registry/examples/shop/visit-map.js +13 -0
- package/registry/examples/shop/visit-map.tsx +12 -0
- package/registry/examples/shop/visit-split.d.ts +4 -0
- package/registry/examples/shop/visit-split.js +13 -0
- package/registry/examples/shop/visit-split.tsx +12 -0
- package/registry/examples/shop-composer/composer.d.ts +4 -0
- package/registry/examples/shop-composer/composer.js +17 -0
- package/registry/examples/shop-composer/composer.tsx +21 -0
- 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 +96 -6
- 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/nav-bar.json +2 -2
- 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/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/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/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 +24 -6
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +424 -0
- package/registry/shop.json +776 -0
- 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 +3 -3
- package/registry/waveform.json +1 -1
package/dist/shop.js
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SHOP_LIMITS
|
|
3
|
+
} from "./chunk-ZYHWJ7U5.js";
|
|
4
|
+
import {
|
|
5
|
+
ShopFrame,
|
|
6
|
+
ShopSection
|
|
7
|
+
} from "./chunk-A7MQPIEG.js";
|
|
8
|
+
import "./chunk-B47WSPMP.js";
|
|
9
|
+
|
|
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", "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
|
+
// src/shop/schema.ts
|
|
207
|
+
import * as z4 from "zod/mini";
|
|
208
|
+
var SHOP_SCHEMA_VERSION = 1;
|
|
209
|
+
var presetRef = z4.object({
|
|
210
|
+
id: z4.string().check(z4.regex(/^[a-z]+-[a-z]+$/, "a preset id (trade-name)")),
|
|
211
|
+
version: z4.int().check(z4.minimum(1))
|
|
212
|
+
});
|
|
213
|
+
var sectionUnion = z4.discriminatedUnion(
|
|
214
|
+
"type",
|
|
215
|
+
SECTION_DEFINITIONS.map((d) => d.schema)
|
|
216
|
+
);
|
|
217
|
+
var shopPageSchema = z4.object({
|
|
218
|
+
schema: z4.literal(SHOP_SCHEMA_VERSION),
|
|
219
|
+
preset: presetRef,
|
|
220
|
+
/** Overrides the preset's density. */
|
|
221
|
+
density: z4.optional(z4.enum(["compact", "airy"])),
|
|
222
|
+
sections: z4.array(sectionUnion).check(z4.minLength(1), z4.maxLength(SHOP_LIMITS.sections))
|
|
223
|
+
}).check(
|
|
224
|
+
z4.superRefine((page, ctx) => {
|
|
225
|
+
const add = (path, message) => ctx.issues.push({ code: "custom", message, path, input: page });
|
|
226
|
+
const seen = /* @__PURE__ */ new Set();
|
|
227
|
+
page.sections.forEach((section, i) => {
|
|
228
|
+
const s2 = section;
|
|
229
|
+
if (seen.has(s2.key)) add(["sections", i, "key"], `the key "${s2.key}" is used twice`);
|
|
230
|
+
seen.add(s2.key);
|
|
231
|
+
if (s2.type === "hero" && i !== 0) add(["sections", i, "type"], "the hero is the first section, and there is only one");
|
|
232
|
+
});
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
function parseShopPage(input) {
|
|
236
|
+
const result = shopPageSchema.safeParse(input);
|
|
237
|
+
if (result.success) return { ok: true, page: result.data };
|
|
238
|
+
return { ok: false, issues: result.error.issues.map((i) => ({ path: i.path.join("."), message: i.message })) };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/shop/migrate.ts
|
|
242
|
+
var SHOP_MIGRATIONS = [];
|
|
243
|
+
function createMigrator(migrations, current) {
|
|
244
|
+
return (input) => {
|
|
245
|
+
if (typeof input !== "object" || input === null || Array.isArray(input)) return { ok: false, reason: "a document is an object" };
|
|
246
|
+
let doc2 = input;
|
|
247
|
+
const from = doc2.schema;
|
|
248
|
+
if (typeof from !== "number" || !Number.isInteger(from) || from < 1) return { ok: false, reason: "the document has no schema version" };
|
|
249
|
+
if (from > current) return { ok: false, reason: `schema ${from} is newer than this code knows (${current})` };
|
|
250
|
+
for (let n = from; n < current; n++) {
|
|
251
|
+
const step = migrations.find((m) => m.from === n);
|
|
252
|
+
if (!step) return { ok: false, reason: `no migration from schema ${n}` };
|
|
253
|
+
doc2 = { ...step.up(doc2), schema: n + 1 };
|
|
254
|
+
}
|
|
255
|
+
return { ok: true, doc: doc2, from };
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
var migrateShopPage = createMigrator(SHOP_MIGRATIONS, SHOP_SCHEMA_VERSION);
|
|
259
|
+
|
|
260
|
+
// src/shop/preview.ts
|
|
261
|
+
var SOURCE = "krizaka-shop-composer";
|
|
262
|
+
var KEY = /^[A-Za-z0-9_-]{1,40}$/;
|
|
263
|
+
function readPreviewMessage(event, origin) {
|
|
264
|
+
if (event.origin !== origin) return null;
|
|
265
|
+
const d = event.data;
|
|
266
|
+
if (typeof d !== "object" || d === null || d.source !== SOURCE) return null;
|
|
267
|
+
if (d.type === "refresh") return { source: SOURCE, type: "refresh" };
|
|
268
|
+
if ((d.type === "select" || d.type === "scroll") && typeof d.key === "string" && KEY.test(d.key)) return { source: SOURCE, type: d.type, key: d.key };
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
function postToPreview(target, origin, message) {
|
|
272
|
+
target?.postMessage(message, origin);
|
|
273
|
+
}
|
|
274
|
+
var SHOP_KEY_ATTRIBUTE = "data-shop-key";
|
|
275
|
+
function connectShopPreview({ composerOrigin, onRefresh, root = document }) {
|
|
276
|
+
const find = (key2) => root.querySelector(`[${SHOP_KEY_ATTRIBUTE}="${key2}"]`);
|
|
277
|
+
const handler = (event) => {
|
|
278
|
+
if (event.origin !== composerOrigin) return;
|
|
279
|
+
const m = readPreviewMessage(event, composerOrigin);
|
|
280
|
+
if (!m) return;
|
|
281
|
+
if (m.type === "refresh") {
|
|
282
|
+
onRefresh?.();
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
for (const selected of root.querySelectorAll("[data-shop-selected]")) delete selected.dataset.shopSelected;
|
|
286
|
+
const el = find(m.key);
|
|
287
|
+
if (!el) return;
|
|
288
|
+
el.dataset.shopSelected = "";
|
|
289
|
+
if (m.type === "scroll") {
|
|
290
|
+
const reduced = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
291
|
+
el.scrollIntoView({ block: "center", behavior: reduced ? "auto" : "smooth" });
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
window.addEventListener("message", handler);
|
|
295
|
+
return () => window.removeEventListener("message", handler);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// src/shop/starters.ts
|
|
299
|
+
var s = (key2) => key2;
|
|
300
|
+
var doc = (preset, density, sections) => ({
|
|
301
|
+
schema: 1,
|
|
302
|
+
preset: { id: preset, version: 1 },
|
|
303
|
+
density,
|
|
304
|
+
sections
|
|
305
|
+
});
|
|
306
|
+
var hero = (variant) => ({
|
|
307
|
+
key: s("s_hero"),
|
|
308
|
+
type: "hero",
|
|
309
|
+
variant,
|
|
310
|
+
settings: { focus: "center" },
|
|
311
|
+
blocks: [
|
|
312
|
+
{ key: "b_open", type: "fact", settings: { kind: "open-now" } },
|
|
313
|
+
{ key: "b_area", type: "fact", settings: { kind: "area" } },
|
|
314
|
+
{ key: "b_score", type: "fact", settings: { kind: "score" } }
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
var menu = (columns, aside) => ({
|
|
318
|
+
key: s("s_services"),
|
|
319
|
+
type: "services",
|
|
320
|
+
variant: "menu",
|
|
321
|
+
settings: { source: "all", groupBy: "category", columns, aside }
|
|
322
|
+
});
|
|
323
|
+
var booking = (variant, key2) => ({ key: key2, type: "booking", variant, settings: { count: 4 } });
|
|
324
|
+
var gallery = (variant, key2, extra = {}) => ({
|
|
325
|
+
key: key2,
|
|
326
|
+
type: "gallery",
|
|
327
|
+
variant,
|
|
328
|
+
settings: { source: "all", texture: "plaster" },
|
|
329
|
+
...extra
|
|
330
|
+
});
|
|
331
|
+
var salonCompact = doc("salon-vitrine", "compact", [
|
|
332
|
+
hero("poster"),
|
|
333
|
+
booking("strip", "s_times"),
|
|
334
|
+
menu(1, "hours"),
|
|
335
|
+
gallery("filmstrip", "s_photos"),
|
|
336
|
+
{ key: "s_reviews", type: "reviews", variant: "summary-cards", settings: { rule: "best", count: 2 } },
|
|
337
|
+
booking("panel", "s_book")
|
|
338
|
+
]);
|
|
339
|
+
var salonEditorial = doc("salon-atelier", "airy", [
|
|
340
|
+
hero("split"),
|
|
341
|
+
{ key: "s_story", type: "story", variant: "quote", settings: { body: {} } },
|
|
342
|
+
menu(2, "none"),
|
|
343
|
+
gallery("mosaic", "s_photos"),
|
|
344
|
+
{ key: "s_visit", type: "visit", variant: "split", settings: { showPhone: true } },
|
|
345
|
+
booking("panel", "s_book")
|
|
346
|
+
]);
|
|
347
|
+
var salonGallery = doc("salon-atelier", "compact", [
|
|
348
|
+
hero("tv"),
|
|
349
|
+
gallery("mosaic", "s_photos"),
|
|
350
|
+
menu(1, "hours"),
|
|
351
|
+
gallery("wall", "s_wall", { blocks: [{ key: "b_note", type: "note", settings: { text: "Merci Jade !", signature: "Nadia" } }] }),
|
|
352
|
+
booking("sticky", "s_sticky")
|
|
353
|
+
]);
|
|
354
|
+
var petsRoute = doc("pets-canal", "compact", [
|
|
355
|
+
hero("poster"),
|
|
356
|
+
{ key: "s_visit", type: "visit", variant: "map", settings: { showPhone: false } },
|
|
357
|
+
menu(1, "none"),
|
|
358
|
+
booking("strip", "s_times"),
|
|
359
|
+
gallery("filmstrip", "s_photos")
|
|
360
|
+
]);
|
|
361
|
+
var petsJournal = doc("pets-carnet", "airy", [
|
|
362
|
+
hero("split"),
|
|
363
|
+
gallery("wall", "s_wall", { settings: { source: "all", texture: "ridge" } }),
|
|
364
|
+
menu(1, "none"),
|
|
365
|
+
{ key: "s_tv", type: "video", variant: "tv", settings: { cabinet: "portable" } },
|
|
366
|
+
booking("panel", "s_book")
|
|
367
|
+
]);
|
|
368
|
+
var shopStarters = { salonCompact, salonEditorial, salonGallery, petsRoute, petsJournal };
|
|
369
|
+
export {
|
|
370
|
+
SECTION_DEFINITIONS,
|
|
371
|
+
SECTION_TYPES,
|
|
372
|
+
SHOP_KEY_ATTRIBUTE,
|
|
373
|
+
SHOP_LIMITS,
|
|
374
|
+
SHOP_MIGRATIONS,
|
|
375
|
+
SHOP_SCHEMA_VERSION,
|
|
376
|
+
ShopFrame,
|
|
377
|
+
ShopSection,
|
|
378
|
+
connectShopPreview,
|
|
379
|
+
createMigrator,
|
|
380
|
+
defineSection,
|
|
381
|
+
migrateShopPage,
|
|
382
|
+
parseShopPage,
|
|
383
|
+
postToPreview,
|
|
384
|
+
readPreviewMessage,
|
|
385
|
+
sectionDefinition,
|
|
386
|
+
shopPageSchema,
|
|
387
|
+
shopStarters
|
|
388
|
+
};
|
|
389
|
+
//# sourceMappingURL=shop.js.map
|
package/dist/shop.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shop/catalogue.ts","../src/shop/define.ts","../src/shop/text.ts","../src/shop/schema.ts","../src/shop/migrate.ts","../src/shop/preview.ts","../src/shop/starters.ts"],"sourcesContent":["// The catalogue of section types (ADR-007 §3): each with its variants, its settings and the blocks it allows, as zod\n// schemas — the renderer, the validator and the composer's forms read the same definitions. The first variant of a type is\n// its default. Settings hold references and rules (ids, a source, a count), never a price or a text of the shop.\nimport * as z from \"zod/mini\";\n\nimport { defineSection } from \"./define\";\nimport { SHOP_LIMITS } from \"./limits\";\nimport { localizedText } from \"./text\";\n\n/** A reference to something the product holds (a service, a photo, a member): an opaque id. */\nconst ref = z.string().check(z.minLength(1), z.maxLength(80));\nconst short = z.string().check(z.minLength(1), z.maxLength(140));\nconst url = z.string().check(z.maxLength(300), z.regex(/^https:\\/\\//, \"an https address\"));\nconst isoDay = z.string().check(z.regex(/^\\d{4}-\\d{2}-\\d{2}$/, \"a day (YYYY-MM-DD)\"));\nconst source = z.enum([\"all\", \"pick\"]);\n/** One of a few numbers. */\nconst oneOf = <const N extends readonly [number, number, ...number[]]>(...n: N) => z.union(n.map((v) => z.literal(v)) as unknown as [z.ZodMiniLiteral<N[number]>, z.ZodMiniLiteral<N[number]>]);\n\nexport const platforms = [\"tiktok\", \"youtube-shorts\", \"instagram\"] as const;\n\nexport const heroSection = defineSection({\n type: \"hero\",\n variants: [\"poster\", \"split\", \"banner\", \"tv\"],\n settings: z.object({\n /** The cover: a media id. Absent, the product's default for the trade. */\n media: z.optional(ref),\n /** Where the photo is cropped to when the box is not its ratio. */\n focus: z.enum([\"center\", \"top\", \"bottom\"]),\n }),\n settingsDefault: { focus: \"center\" },\n blocks: { fact: z.object({ kind: z.enum([\"open-now\", \"area\", \"score\"]) }) },\n});\n\nexport const servicesSection = defineSection({\n type: \"services\",\n variants: [\"menu\", \"cards\", \"index\", \"carousel\"],\n settings: z.object({\n /** `all` the shop's services, or `pick` the ones the `service` blocks name, in their order. */\n source,\n groupBy: z.enum([\"category\", \"none\"]),\n /** `menu` only: two columns when nothing sits beside it. */\n columns: oneOf(1, 2),\n /** `menu` only: the shop's hours, team and address beside the list (the host draws them from its own data). */\n aside: z.enum([\"hours\", \"none\"]),\n }),\n settingsDefault: { source: \"all\", groupBy: \"category\", columns: 1, aside: \"hours\" },\n blocks: { service: z.object({ serviceId: ref }) },\n refine: (section, issue) => {\n if (section.settings.source === \"pick\" && (section.blocks ?? []).length === 0) issue([\"blocks\"], \"pick at least one service\");\n if (section.variant === \"cards\" && (section.blocks ?? []).length > SHOP_LIMITS.cards) issue([\"blocks\"], `at most ${SHOP_LIMITS.cards} cards`);\n },\n});\n\nexport const bookingSection = defineSection({\n type: \"booking\",\n variants: [\"strip\", \"panel\", \"sticky\"],\n settings: z.object({\n /** A service the times are for; absent, the next free times of any service. */\n serviceId: z.optional(ref),\n /** `strip`: how many times it shows. */\n count: oneOf(3, 4, 6),\n }),\n settingsDefault: { count: 4 },\n});\n\nexport const gallerySection = defineSection({\n type: \"gallery\",\n variants: [\"mosaic\", \"filmstrip\", \"wall\", \"grid\"],\n settings: z.object({\n source,\n /** `wall` only. */\n texture: z.enum([\"plaster\", \"brick\", \"ridge\", \"zellige\"]),\n }),\n settingsDefault: { source: \"all\", texture: \"plaster\" },\n blocks: {\n photo: z.object({ mediaId: ref, caption: z.optional(short) }),\n note: z.object({ text: short, signature: z.optional(z.string().check(z.maxLength(40))) }),\n sign: z.object({}),\n },\n refine: (section, issue) => {\n const photos = (section.blocks ?? []).filter((b) => b.type === \"photo\").length;\n if (photos > SHOP_LIMITS.photos) issue([\"blocks\"], `at most ${SHOP_LIMITS.photos} photos`);\n },\n});\n\nexport const videoSection = defineSection({\n type: \"video\",\n variants: [\"tv\", \"shorts\"],\n settings: z.object({ cabinet: z.enum([\"cabinet\", \"portable\"]), channel: z.optional(z.string().check(z.maxLength(32))) }),\n settingsDefault: { cabinet: \"cabinet\" },\n blocks: { reel: z.object({ platform: z.enum(platforms), url }) },\n});\n\nexport const reviewsSection = defineSection({\n type: \"reviews\",\n variants: [\"summary-cards\", \"quote\", \"strip\"],\n settings: z.object({ rule: z.enum([\"best\", \"latest\"]), count: oneOf(1, 2, 3) }),\n settingsDefault: { rule: \"best\", count: 2 },\n});\n\nexport const bulletinSection = defineSection({\n type: \"bulletin\",\n variants: [\"board\", \"banner\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { flyer: z.object({ text: short, signature: z.optional(z.string().check(z.maxLength(40))), until: z.optional(isoDay) }) },\n refine: (section, issue) => {\n if ((section.blocks ?? []).length > SHOP_LIMITS.flyers) issue([\"blocks\"], `at most ${SHOP_LIMITS.flyers} flyers`);\n },\n});\n\nexport const teamSection = defineSection({\n type: \"team\",\n variants: [\"row\", \"cards\"],\n settings: z.object({ source }),\n settingsDefault: { source: \"all\" },\n blocks: { member: z.object({ memberId: ref }) },\n});\n\nexport const visitSection = defineSection({\n type: \"visit\",\n variants: [\"card\", \"map\", \"split\"],\n settings: z.object({ showPhone: z.boolean() }),\n settingsDefault: { showPhone: true },\n});\n\nexport const storySection = defineSection({\n type: \"story\",\n variants: [\"quote\", \"owner\"],\n settings: z.object({ body: localizedText }),\n settingsDefault: { body: {} },\n});\n\nexport const socialSection = defineSection({\n type: \"social\",\n variants: [\"links\", \"facade\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { link: z.object({ platform: z.enum(platforms), url }) },\n});\n\nexport const faqSection = defineSection({\n type: \"faq\",\n variants: [\"list\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { question: z.object({ question: localizedText, answer: localizedText }) },\n});\n\nexport const policiesSection = defineSection({\n type: \"policies\",\n variants: [\"inline\"],\n settings: z.object({ show: z.array(z.enum([\"cancellation\", \"prices\", \"booking-window\"])).check(z.maxLength(3)) }),\n settingsDefault: { show: [\"cancellation\", \"prices\", \"booking-window\"] },\n});\n\n/** Every section type, in the order the composer lists them. */\nexport const SECTION_DEFINITIONS = [\n heroSection, servicesSection, bookingSection, gallerySection, videoSection, reviewsSection, bulletinSection,\n teamSection, visitSection, storySection, socialSection, faqSection, policiesSection,\n] as const;\n\nexport type SectionDefinition = (typeof SECTION_DEFINITIONS)[number];\nexport type SectionType = SectionDefinition[\"type\"];\nexport const SECTION_TYPES = SECTION_DEFINITIONS.map((d) => d.type) as readonly SectionType[];\n\n/** The definition of a type. */\nexport function sectionDefinition<T extends SectionType>(type: T): Extract<SectionDefinition, { type: T }> {\n return SECTION_DEFINITIONS.find((d) => d.type === type) as Extract<SectionDefinition, { type: T }>;\n}\n","// `defineSection` (ADR-007 §1): one section type = its variants, the zod schema of its settings, the blocks it allows\n// (each a zod schema) and the checks that need the whole section. It builds the zod schema of a section of this type, so\n// the renderer, the validator and the composer's generated forms agree.\nimport * as z from \"zod/mini\";\n\nimport { SHOP_LIMITS } from \"./limits\";\nimport { localizedText } from \"./text\";\n\ntype Shape = z.ZodMiniObject;\ntype BlockShapes = Record<string, Shape>;\n\n/** What a section of a type is, once parsed. */\nexport type ParsedSection<T extends string, V extends string, S extends Shape, B extends BlockShapes> = {\n key: string;\n type: T;\n variant: V;\n disabled?: boolean | undefined;\n settings: z.output<S>;\n text?: { title?: z.output<typeof localizedText> | undefined; lead?: z.output<typeof localizedText> | undefined } | undefined;\n blocks?: { [K in keyof B & string]: { key: string; type: K; settings: z.output<B[K]>; text?: Record<string, z.output<typeof localizedText>> | undefined } }[keyof B & string][] | undefined;\n};\n\nexport type SectionSpec<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = {\n /** The type's name: the `type` of a section. */\n type: T;\n /** Its variants; the first is the default one. */\n variants: V;\n /** The zod schema of its settings. */\n settings: S;\n /** The settings a new section starts with. */\n settingsDefault: z.input<S>;\n /** The block types it allows, each with the zod schema of its settings. None: the section has no blocks. */\n blocks?: B;\n /** The checks that read the whole section (a count, a combination); `issue(path, message)` refuses it. */\n refine?: (section: ParsedSection<T, V[number], S, B>, issue: (path: (string | number)[], message: string) => void) => void;\n};\n\nexport type SectionDefinitionOf<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = SectionSpec<T, V, S, B> & {\n readonly defaultVariant: V[number];\n readonly blockTypes: readonly (keyof B & string)[];\n /** The zod schema of a section of this type. */\n readonly schema: z.ZodMiniType<ParsedSection<T, V[number], S, B>>;\n};\n\nconst key = z.string().check(z.minLength(1), z.maxLength(40), z.regex(/^[A-Za-z0-9_-]+$/, \"a key (letters, digits, - and _)\"));\n\n/** Defines a section type. */\nexport function defineSection<const T extends string, const V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes = Record<never, never>>(\n spec: SectionSpec<T, V, S, B>,\n): SectionDefinitionOf<T, V, S, B> {\n const blockUnion = spec.blocks && Object.keys(spec.blocks).length > 0\n ? z.discriminatedUnion(\n \"type\",\n Object.entries(spec.blocks).map(([type, settings]) =>\n z.object({ key, type: z.literal(type), settings, text: z.optional(z.record(z.string(), localizedText)) }),\n ) as unknown as [z.ZodMiniObject, ...z.ZodMiniObject[]],\n )\n : undefined;\n const blocks = blockUnion\n ? z.optional(z.array(blockUnion).check(z.maxLength(SHOP_LIMITS.blocks)))\n : z.optional(z.array(z.never()).check(z.maxLength(0)));\n const base = z.object({\n key,\n type: z.literal(spec.type),\n variant: z.enum(spec.variants),\n disabled: z.optional(z.boolean()),\n settings: spec.settings,\n text: z.optional(z.object({ title: z.optional(localizedText), lead: z.optional(localizedText) })),\n blocks,\n });\n const schema = base.check(\n z.superRefine((value, ctx) => {\n spec.refine?.(value as never, (path, message) => ctx.issues.push({ code: \"custom\", message, path, input: value }));\n }),\n );\n return Object.freeze({\n ...spec,\n defaultVariant: spec.variants[0],\n blockTypes: Object.keys(spec.blocks ?? {}) as (keyof B & string)[],\n schema: schema as unknown as z.ZodMiniType<ParsedSection<T, V[number], S, B>>,\n });\n}\n","import * as z from \"zod/mini\";\n\n/** The owner's words, in each language; the product's message is the fallback when a language is absent. */\nexport const localizedText = z.object({\n fr: z.optional(z.string().check(z.maxLength(600))),\n en: z.optional(z.string().check(z.maxLength(600))),\n});\nexport type LocalizedText = z.output<typeof localizedText>;\n","// The document a shop page is (ADR-007 §1): an ordered list of sections, each a `type` × `variant` with its settings and\n// its blocks. Parsed on write (a route refuses an invalid one, with the path) and on read. The storage is the product's.\nimport * as z from \"zod/mini\";\n\nimport { SECTION_DEFINITIONS, type SectionType } from \"./catalogue\";\nimport { SHOP_LIMITS } from \"./limits\";\n\n/** The version of the document's format; migrations are pure functions schema n → n + 1 (`migrate.ts`). */\n// @fixed: ADR-007 §1 — the format version of the code, bumped with a migration; not a shop setting.\nexport const SHOP_SCHEMA_VERSION = 1;\n\n/** A look preset by id and version (`@krizaka/tokens`): `salon-atelier`. The mode is the visitor's, never stored. */\nexport const presetRef = z.object({\n id: z.string().check(z.regex(/^[a-z]+-[a-z]+$/, \"a preset id (trade-name)\")),\n version: z.int().check(z.minimum(1)),\n});\n\nconst sectionUnion = z.discriminatedUnion(\n \"type\",\n SECTION_DEFINITIONS.map((d) => d.schema) as unknown as [z.ZodMiniObject, ...z.ZodMiniObject[]],\n);\n\nexport const shopPageSchema = z\n .object({\n schema: z.literal(SHOP_SCHEMA_VERSION),\n preset: presetRef,\n /** Overrides the preset's density. */\n density: z.optional(z.enum([\"compact\", \"airy\"])),\n sections: z.array(sectionUnion).check(z.minLength(1), z.maxLength(SHOP_LIMITS.sections)),\n })\n .check(\n z.superRefine((page, ctx) => {\n const add = (path: (string | number)[], message: string) => ctx.issues.push({ code: \"custom\", message, path, input: page });\n const seen = new Set<string>();\n page.sections.forEach((section, i) => {\n const s = section as { key: string; type: string };\n if (seen.has(s.key)) add([\"sections\", i, \"key\"], `the key \"${s.key}\" is used twice`);\n seen.add(s.key);\n if (s.type === \"hero\" && i !== 0) add([\"sections\", i, \"type\"], \"the hero is the first section, and there is only one\");\n });\n }),\n );\n\n/** A section of any type, as parsed: its `settings` and `blocks` are the type's own. */\nexport type Section = z.output<(typeof SECTION_DEFINITIONS)[number][\"schema\"]>;\nexport type ShopPage = {\n schema: typeof SHOP_SCHEMA_VERSION;\n preset: z.output<typeof presetRef>;\n density?: \"compact\" | \"airy\" | undefined;\n sections: Section[];\n};\nexport type SectionOf<T extends SectionType> = Extract<Section, { type: T }>;\n\nexport type ShopPageIssue = { path: string; message: string };\nexport type ShopPageResult = { ok: true; page: ShopPage } | { ok: false; issues: ShopPageIssue[] };\n\n/** Validates a document; an invalid one answers every issue with its path (`sections.2.variant`), for a 422. */\nexport function parseShopPage(input: unknown): ShopPageResult {\n const result = shopPageSchema.safeParse(input);\n if (result.success) return { ok: true, page: result.data as unknown as ShopPage };\n return { ok: false, issues: result.error.issues.map((i) => ({ path: i.path.join(\".\"), message: i.message })) };\n}\n","// Migrations of the document (ADR-007 §1): pure functions schema n → n + 1, applied in memory when an older document is\n// read; the product writes the migrated one back on the next save. A newer document than this code knows is refused.\nimport { SHOP_SCHEMA_VERSION } from \"./schema\";\n\nexport type ShopMigration = {\n /** The schema it reads. */\n from: number;\n /** Pure: returns a new document, never mutates. */\n up: (doc: Record<string, unknown>) => Record<string, unknown>;\n};\n\n/** The migrations of the document, oldest first. Schema 1 is the first format: none yet. */\nexport const SHOP_MIGRATIONS: readonly ShopMigration[] = [];\n\nexport type MigrationResult = { ok: true; doc: Record<string, unknown>; from: number } | { ok: false; reason: string };\n\n/** A migrator over a list of migrations and a current version (the shop's own are `migrateShopPage`). */\nexport function createMigrator(migrations: readonly ShopMigration[], current: number) {\n return (input: unknown): MigrationResult => {\n if (typeof input !== \"object\" || input === null || Array.isArray(input)) return { ok: false, reason: \"a document is an object\" };\n let doc = input as Record<string, unknown>;\n const from = doc.schema;\n if (typeof from !== \"number\" || !Number.isInteger(from) || from < 1) return { ok: false, reason: \"the document has no schema version\" };\n if (from > current) return { ok: false, reason: `schema ${from} is newer than this code knows (${current})` };\n for (let n = from; n < current; n++) {\n const step = migrations.find((m) => m.from === n);\n if (!step) return { ok: false, reason: `no migration from schema ${n}` };\n doc = { ...step.up(doc), schema: n + 1 };\n }\n return { ok: true, doc, from };\n };\n}\n\n/** Brings a stored document to the current schema (then `parseShopPage` it). */\nexport const migrateShopPage = createMigrator(SHOP_MIGRATIONS, SHOP_SCHEMA_VERSION);\n","// The preview bridge (ADR-007 §5): the composer shows the product's real public page in an iframe of its own route\n// (`?draft=<id>`) and talks to it by `postMessage` — three messages only, every one origin-checked on both sides: `select` (outline\n// a section), `scroll` (bring it into view), `refresh` (the draft changed: reload the data). Nothing else crosses: no document, no\n// script, no style. Both halves are here, tiny and free of React, because the page side must not import the composer.\n\n/** The only messages: the composer to the page. */\nexport type PreviewMessage = { source: \"krizaka-shop-composer\"; type: \"select\" | \"scroll\"; key: string } | { source: \"krizaka-shop-composer\"; type: \"refresh\" };\n\nconst SOURCE = \"krizaka-shop-composer\";\nconst KEY = /^[A-Za-z0-9_-]{1,40}$/;\n\n/** Reads a message event: only if it comes from `origin`, is one of the three messages and carries a well-formed key. */\nexport function readPreviewMessage(event: Pick<MessageEvent, \"origin\" | \"data\">, origin: string): PreviewMessage | null {\n if (event.origin !== origin) return null;\n const d = event.data as Record<string, unknown> | null;\n if (typeof d !== \"object\" || d === null || d.source !== SOURCE) return null;\n if (d.type === \"refresh\") return { source: SOURCE, type: \"refresh\" };\n if ((d.type === \"select\" || d.type === \"scroll\") && typeof d.key === \"string\" && KEY.test(d.key)) return { source: SOURCE, type: d.type, key: d.key };\n return null;\n}\n\n/** The composer's side: posts to the preview's window, addressed to its origin only. */\nexport function postToPreview(target: Pick<Window, \"postMessage\"> | null | undefined, origin: string, message: PreviewMessage): void {\n target?.postMessage(message, origin);\n}\n\n/** The attribute that names a section in the preview page: `<div data-shop-key=\"s_8f2c\">` (a block: the outline is its ring). */\nexport const SHOP_KEY_ATTRIBUTE = \"data-shop-key\";\n\n/**\n * The page's side: outlines the selected section (`data-shop-selected`, drawn by `blocks.css`), scrolls it into view, and calls\n * `onRefresh` when the draft changed. Returns the function that removes it. Only runs in an iframe of the composer's origin.\n */\nexport function connectShopPreview({ composerOrigin, onRefresh, root = document }: { composerOrigin: string; onRefresh?: () => void; root?: Document }): () => void {\n const find = (key: string) => root.querySelector<HTMLElement>(`[${SHOP_KEY_ATTRIBUTE}=\"${key}\"]`);\n const handler = (event: MessageEvent) => {\n // The origin first, before anything else is read from the message.\n if (event.origin !== composerOrigin) return;\n const m = readPreviewMessage(event, composerOrigin);\n if (!m) return;\n if (m.type === \"refresh\") {\n onRefresh?.();\n return;\n }\n for (const selected of root.querySelectorAll<HTMLElement>(\"[data-shop-selected]\")) delete selected.dataset.shopSelected;\n const el = find(m.key);\n if (!el) return;\n el.dataset.shopSelected = \"\";\n if (m.type === \"scroll\") {\n const reduced = typeof matchMedia === \"function\" && matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n el.scrollIntoView({ block: \"center\", behavior: reduced ? \"auto\" : \"smooth\" });\n }\n };\n window.addEventListener(\"message\", handler);\n return () => window.removeEventListener(\"message\", handler);\n}\n","// The starter documents (ADR-007 §4, §8): the five compositions of the ADR as data — a section list and a preset. A\n// product's template becomes one of these; the composer's « Start from » lists them. They hold no price, no text of a\n// shop and no photo: references and rules only.\nimport type { SectionOf, ShopPage } from \"./schema\";\n\nconst s = (key: string) => key;\nconst doc = (preset: string, density: \"compact\" | \"airy\", sections: ShopPage[\"sections\"]): ShopPage => ({\n schema: 1,\n preset: { id: preset, version: 1 },\n density,\n sections,\n});\nconst hero = (variant: \"poster\" | \"split\" | \"banner\" | \"tv\"): SectionOf<\"hero\"> => ({\n key: s(\"s_hero\"),\n type: \"hero\",\n variant,\n settings: { focus: \"center\" },\n blocks: [\n { key: \"b_open\", type: \"fact\", settings: { kind: \"open-now\" } },\n { key: \"b_area\", type: \"fact\", settings: { kind: \"area\" } },\n { key: \"b_score\", type: \"fact\", settings: { kind: \"score\" } },\n ],\n});\nconst menu = (columns: 1 | 2, aside: \"hours\" | \"none\"): SectionOf<\"services\"> => ({\n key: s(\"s_services\"),\n type: \"services\",\n variant: \"menu\",\n settings: { source: \"all\", groupBy: \"category\", columns, aside },\n});\nconst booking = (variant: \"strip\" | \"panel\" | \"sticky\", key: string): SectionOf<\"booking\"> => ({ key, type: \"booking\", variant, settings: { count: 4 } });\nconst gallery = (variant: \"mosaic\" | \"filmstrip\" | \"wall\" | \"grid\", key: string, extra: Partial<Pick<SectionOf<\"gallery\">, \"settings\" | \"blocks\">> = {}): SectionOf<\"gallery\"> => ({\n key,\n type: \"gallery\",\n variant,\n settings: { source: \"all\", texture: \"plaster\" },\n ...extra,\n});\n\n/** The salon, compact: the poster, the next free times, the price board beside the hours, a filmstrip, the reviews. */\nexport const salonCompact = doc(\"salon-vitrine\", \"compact\", [\n hero(\"poster\"),\n booking(\"strip\", \"s_times\"),\n menu(1, \"hours\"),\n gallery(\"filmstrip\", \"s_photos\"),\n { key: \"s_reviews\", type: \"reviews\", variant: \"summary-cards\", settings: { rule: \"best\", count: 2 } },\n booking(\"panel\", \"s_book\"),\n]);\n\n/** The salon, editorial: a split hero, the quote, the two-column menu, the mosaic, the visit. */\nexport const salonEditorial = doc(\"salon-atelier\", \"airy\", [\n hero(\"split\"),\n { key: \"s_story\", type: \"story\", variant: \"quote\", settings: { body: {} } },\n menu(2, \"none\"),\n gallery(\"mosaic\", \"s_photos\"),\n { key: \"s_visit\", type: \"visit\", variant: \"split\", settings: { showPhone: true } },\n booking(\"panel\", \"s_book\"),\n]);\n\n/** The salon, gallery first: the sign and the old TV, the mosaic, the menu, the wall. */\nexport const salonGallery = doc(\"salon-atelier\", \"compact\", [\n hero(\"tv\"),\n gallery(\"mosaic\", \"s_photos\"),\n menu(1, \"hours\"),\n gallery(\"wall\", \"s_wall\", { blocks: [{ key: \"b_note\", type: \"note\", settings: { text: \"Merci Jade !\", signature: \"Nadia\" } }] }),\n booking(\"sticky\", \"s_sticky\"),\n]);\n\n/** The dog walker, route: the poster, the areas, the menu, the next free times, a filmstrip. */\nexport const petsRoute = doc(\"pets-canal\", \"compact\", [\n hero(\"poster\"),\n { key: \"s_visit\", type: \"visit\", variant: \"map\", settings: { showPhone: false } },\n menu(1, \"none\"),\n booking(\"strip\", \"s_times\"),\n gallery(\"filmstrip\", \"s_photos\"),\n]);\n\n/** The dog walker, journal: a hero on paper, the notebook wall, the menu, the TV with notes. */\nexport const petsJournal = doc(\"pets-carnet\", \"airy\", [\n hero(\"split\"),\n gallery(\"wall\", \"s_wall\", { settings: { source: \"all\", texture: \"ridge\" } }),\n menu(1, \"none\"),\n { key: \"s_tv\", type: \"video\", variant: \"tv\", settings: { cabinet: \"portable\" } },\n booking(\"panel\", \"s_book\"),\n]);\n\nexport const shopStarters = { salonCompact, salonEditorial, salonGallery, petsRoute, petsJournal } as const;\nexport type ShopStarterId = keyof typeof shopStarters;\n"],"mappings":";;;;;;;;;;AAGA,YAAYA,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