@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.
Files changed (306) hide show
  1. package/dist/account-menu.d.ts +1 -1
  2. package/dist/account-menu.js +1 -1
  3. package/dist/account-settings.d.ts +1 -1
  4. package/dist/account-settings.js +1 -1
  5. package/dist/avatar/defaults.d.ts +22 -2
  6. package/dist/avatar/defaults.js +20 -7
  7. package/dist/avatar/defaults.js.map +1 -1
  8. package/dist/{avatar-BdZcfkWR.d.ts → avatar-B_na7r1U.d.ts} +16 -0
  9. package/dist/avatar.d.ts +22 -2
  10. package/dist/avatar.js +20 -7
  11. package/dist/avatar.js.map +1 -1
  12. package/dist/blocks.css +37 -0
  13. package/dist/chat.js +1 -1
  14. package/dist/chunk-3PRYL2LS.js +2 -0
  15. package/dist/chunk-3PRYL2LS.js.map +1 -0
  16. package/dist/{chunk-HK525THY.js → chunk-5MPPIGCB.js} +18 -7
  17. package/dist/chunk-5MPPIGCB.js.map +1 -0
  18. package/dist/{chunk-CSRKYZ53.js → chunk-CZHPWLNW.js} +1 -1
  19. package/dist/{chunk-PZ4FJOD5.js → chunk-HLEBSAGC.js} +5 -1
  20. package/dist/{chunk-PZ4FJOD5.js.map → chunk-HLEBSAGC.js.map} +1 -1
  21. package/dist/chunk-M3T5RQYV.js +34 -0
  22. package/dist/chunk-M3T5RQYV.js.map +1 -0
  23. package/dist/{chunk-EUJ7337V.js → chunk-TISDOZH3.js} +18 -7
  24. package/dist/chunk-TISDOZH3.js.map +1 -0
  25. package/dist/chunk-W64RAX4N.js +79 -0
  26. package/dist/chunk-W64RAX4N.js.map +1 -0
  27. package/dist/chunk-ZFR6ZNXD.js +203 -0
  28. package/dist/chunk-ZFR6ZNXD.js.map +1 -0
  29. package/dist/collection-switcher.d.ts +1 -1
  30. package/dist/{default-avatar-D9kiSFNB.d.ts → default-avatar-BL0nJFti.d.ts} +16 -0
  31. package/dist/entity-header.d.ts +1 -1
  32. package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
  33. package/dist/index.js +7 -7
  34. package/dist/kind-config-editor.js +3 -2
  35. package/dist/kind-config-editor.js.map +1 -1
  36. package/dist/map.d.ts +6 -6
  37. package/dist/match-dialog.js +1 -1
  38. package/dist/media-grid.d.ts +16 -0
  39. package/dist/media-grid.js +1 -1
  40. package/dist/money-input.js +6 -70
  41. package/dist/money-input.js.map +1 -1
  42. package/dist/native.d.ts +16 -0
  43. package/dist/native.js +17 -6
  44. package/dist/native.js.map +1 -1
  45. package/dist/nav-bar.d.ts +13 -2
  46. package/dist/nav-bar.js +71 -54
  47. package/dist/nav-bar.js.map +1 -1
  48. package/dist/notification-preferences.js +2 -1
  49. package/dist/notification-preferences.js.map +1 -1
  50. package/dist/price-catalogue-editor.d.ts +117 -0
  51. package/dist/price-catalogue-editor.js +194 -0
  52. package/dist/price-catalogue-editor.js.map +1 -0
  53. package/dist/promo-code-field.js +1 -1
  54. package/dist/schema-DgjBz7-8.d.ts +242 -0
  55. package/dist/schema-form.d.ts +106 -0
  56. package/dist/schema-form.js +268 -0
  57. package/dist/schema-form.js.map +1 -0
  58. package/dist/shop/booking.d.ts +2 -2
  59. package/dist/shop/booking.js +1 -1
  60. package/dist/shop/booking.js.map +1 -1
  61. package/dist/shop/bulletin.js +1 -1
  62. package/dist/shop/faq.d.ts +2 -1
  63. package/dist/shop/faq.js +1 -1
  64. package/dist/shop/faq.js.map +1 -1
  65. package/dist/shop/gallery.js +1 -1
  66. package/dist/shop/look.d.ts +43 -0
  67. package/dist/shop/look.js +52 -0
  68. package/dist/shop/look.js.map +1 -0
  69. package/dist/shop/policies.d.ts +2 -1
  70. package/dist/shop/policies.js +1 -1
  71. package/dist/shop/policies.js.map +1 -1
  72. package/dist/shop/reviews.d.ts +2 -1
  73. package/dist/shop/reviews.js +1 -1
  74. package/dist/shop/reviews.js.map +1 -1
  75. package/dist/shop/services.js +1 -1
  76. package/dist/shop/social.js +1 -1
  77. package/dist/shop/story.d.ts +2 -1
  78. package/dist/shop/story.js +1 -1
  79. package/dist/shop/story.js.map +1 -1
  80. package/dist/shop/team.js +1 -1
  81. package/dist/shop/video.js +1 -1
  82. package/dist/shop/visit.js +1 -1
  83. package/dist/shop-composer.d.ts +29 -0
  84. package/dist/shop-composer.js +156 -89
  85. package/dist/shop-composer.js.map +1 -1
  86. package/dist/shop.d.ts +6 -240
  87. package/dist/shop.js +24 -212
  88. package/dist/shop.js.map +1 -1
  89. package/dist/switch.js +2 -1
  90. package/dist/vertical-video.js +1 -1
  91. package/dist/wall.d.ts +7 -1
  92. package/dist/wall.js +5 -4
  93. package/dist/wall.js.map +1 -1
  94. package/package.json +59 -9
  95. package/registry/account-menu.json +1 -1
  96. package/registry/account-settings.json +1 -1
  97. package/registry/achievement.json +1 -1
  98. package/registry/action-bar.json +1 -1
  99. package/registry/activity-feed.json +1 -1
  100. package/registry/agenda.json +1 -1
  101. package/registry/alert.json +1 -1
  102. package/registry/analysis-report.json +1 -1
  103. package/registry/anatomy-plate.json +1 -1
  104. package/registry/app-frame.json +2 -2
  105. package/registry/app-header.json +1 -1
  106. package/registry/app-shell.json +1 -1
  107. package/registry/argument-card.json +1 -1
  108. package/registry/audio-player.json +1 -1
  109. package/registry/auth-layout.json +1 -1
  110. package/registry/avatar.json +4 -4
  111. package/registry/badge.json +1 -1
  112. package/registry/bird-plate.json +1 -1
  113. package/registry/button.json +1 -1
  114. package/registry/captcha.json +1 -1
  115. package/registry/card-grid.json +1 -1
  116. package/registry/card.json +1 -1
  117. package/registry/catalogue-page.json +1 -1
  118. package/registry/changelog-page.json +1 -1
  119. package/registry/chapter.json +1 -1
  120. package/registry/chat.json +1 -1
  121. package/registry/checkbox.json +1 -1
  122. package/registry/chip-link.json +1 -1
  123. package/registry/chip-row.json +1 -1
  124. package/registry/chip.json +1 -1
  125. package/registry/choice-grid.json +1 -1
  126. package/registry/code-block.json +1 -1
  127. package/registry/collection-switcher.json +1 -1
  128. package/registry/combobox.json +1 -1
  129. package/registry/command.json +1 -1
  130. package/registry/comparison-table.json +1 -1
  131. package/registry/component-page.json +1 -1
  132. package/registry/confirm-button.json +1 -1
  133. package/registry/contact-page.json +1 -1
  134. package/registry/continue-prompt.json +1 -1
  135. package/registry/copy-button.json +1 -1
  136. package/registry/countdown.json +1 -1
  137. package/registry/cover-hero.json +1 -1
  138. package/registry/cta-panel.json +1 -1
  139. package/registry/dashboard-layout.json +1 -1
  140. package/registry/data-table.json +1 -1
  141. package/registry/date-picker.json +1 -1
  142. package/registry/decision-list.json +1 -1
  143. package/registry/description-list.json +1 -1
  144. package/registry/desktop-window.json +1 -1
  145. package/registry/detail-layout.json +1 -1
  146. package/registry/dialog.json +1 -1
  147. package/registry/docs-article-page.json +1 -1
  148. package/registry/docs-hub-page.json +1 -1
  149. package/registry/docs-layout.json +1 -1
  150. package/registry/docs-nav.json +1 -1
  151. package/registry/document-viewer.json +1 -1
  152. package/registry/doodle.json +1 -1
  153. package/registry/drop-overlay.json +1 -1
  154. package/registry/dropdown-menu.json +1 -1
  155. package/registry/elephant.json +2 -2
  156. package/registry/embed-facade.json +1 -1
  157. package/registry/empty-state.json +1 -1
  158. package/registry/engine-flow.json +1 -1
  159. package/registry/entity-header.json +1 -1
  160. package/registry/environment-notice.json +1 -1
  161. package/registry/error-page.json +1 -1
  162. package/registry/examples/price-catalogue-editor/default.d.ts +4 -0
  163. package/registry/examples/price-catalogue-editor/default.js +47 -0
  164. package/registry/examples/price-catalogue-editor/default.tsx +25 -0
  165. package/registry/examples/schema-form/default.d.ts +4 -0
  166. package/registry/examples/schema-form/default.js +29 -0
  167. package/registry/examples/schema-form/default.tsx +27 -0
  168. package/registry/examples/wall/pinned-note.js +2 -1
  169. package/registry/examples/wall/pinned-note.tsx +2 -1
  170. package/registry/field.json +1 -1
  171. package/registry/file-upload.json +1 -1
  172. package/registry/filter-bar.json +1 -1
  173. package/registry/flock.json +1 -1
  174. package/registry/footnote.json +1 -1
  175. package/registry/force-update-screen.json +1 -1
  176. package/registry/form.json +1 -1
  177. package/registry/gallery-page.json +1 -1
  178. package/registry/genui.json +1 -1
  179. package/registry/glossary-term.json +1 -1
  180. package/registry/glossary.json +1 -1
  181. package/registry/glow-card.json +1 -1
  182. package/registry/goal-gauge.json +1 -1
  183. package/registry/grade-stamp.json +1 -1
  184. package/registry/how-it-works-page.json +1 -1
  185. package/registry/image-cropper.json +1 -1
  186. package/registry/index.json +81 -8
  187. package/registry/iso.json +1 -1
  188. package/registry/kanban.json +1 -1
  189. package/registry/kbd.json +1 -1
  190. package/registry/kind-config-editor.json +1 -1
  191. package/registry/kpi-explained.json +1 -1
  192. package/registry/landing-page.json +1 -1
  193. package/registry/landscape.json +1 -1
  194. package/registry/language-switch.json +1 -1
  195. package/registry/legal-page.json +1 -1
  196. package/registry/link-card.json +1 -1
  197. package/registry/list.json +1 -1
  198. package/registry/loader.json +1 -1
  199. package/registry/longform-page.json +1 -1
  200. package/registry/maintenance-screen.json +1 -1
  201. package/registry/map.json +2 -2
  202. package/registry/margin-layout.json +1 -1
  203. package/registry/markdown.json +1 -1
  204. package/registry/marketing-layout.json +1 -1
  205. package/registry/marquee.json +1 -1
  206. package/registry/mascot-quote.json +1 -1
  207. package/registry/mascot-state.json +1 -1
  208. package/registry/mascots.json +1 -1
  209. package/registry/match-dialog.json +1 -1
  210. package/registry/media-capture.json +1 -1
  211. package/registry/media-gallery.json +1 -1
  212. package/registry/media-grid.json +1 -1
  213. package/registry/meta-row.json +1 -1
  214. package/registry/meter.json +1 -1
  215. package/registry/money-input.json +1 -1
  216. package/registry/nav-bar.json +30 -6
  217. package/registry/next-actions.json +1 -1
  218. package/registry/notification-preferences.json +1 -1
  219. package/registry/number-ticker.json +1 -1
  220. package/registry/opening-hours.json +1 -1
  221. package/registry/page-header.json +1 -1
  222. package/registry/page-hero.json +1 -1
  223. package/registry/page-index.json +1 -1
  224. package/registry/page.json +1 -1
  225. package/registry/pagination.json +1 -1
  226. package/registry/photo-grid.json +1 -1
  227. package/registry/pointer-light.json +1 -1
  228. package/registry/popover.json +1 -1
  229. package/registry/price-catalogue-editor.json +228 -0
  230. package/registry/pricing-page.json +1 -1
  231. package/registry/product-page.json +1 -1
  232. package/registry/profile-card.json +1 -1
  233. package/registry/progress.json +1 -1
  234. package/registry/promise-card.json +1 -1
  235. package/registry/promo-code-field.json +1 -1
  236. package/registry/proposal.json +1 -1
  237. package/registry/qr-code.json +1 -1
  238. package/registry/quota-meter.json +1 -1
  239. package/registry/radio-group.json +1 -1
  240. package/registry/rail-nav.json +2 -2
  241. package/registry/recipes.json +1 -1
  242. package/registry/retro-tv.json +1 -1
  243. package/registry/reviews.json +1 -1
  244. package/registry/router.json +1 -1
  245. package/registry/schema-form.json +253 -0
  246. package/registry/scroll-stage.json +1 -1
  247. package/registry/search-field.json +1 -1
  248. package/registry/section-backdrop.json +1 -1
  249. package/registry/separator.json +1 -1
  250. package/registry/service-card.json +1 -1
  251. package/registry/settings-layout.json +1 -1
  252. package/registry/shop-composer.json +10 -6
  253. package/registry/shop-gallery.json +1 -1
  254. package/registry/shop.json +51 -10
  255. package/registry/showcase.json +1 -1
  256. package/registry/signature.json +1 -1
  257. package/registry/site-cahier.json +1 -1
  258. package/registry/site-footer.json +2 -2
  259. package/registry/sites.json +1 -1
  260. package/registry/skeleton.json +1 -1
  261. package/registry/skip-link.json +1 -1
  262. package/registry/slider.json +1 -1
  263. package/registry/slot-picker.json +1 -1
  264. package/registry/slot.json +1 -1
  265. package/registry/specimen-tag.json +1 -1
  266. package/registry/speed-lines.json +1 -1
  267. package/registry/spinner.json +1 -1
  268. package/registry/split-view.json +1 -1
  269. package/registry/stage-banner.json +1 -1
  270. package/registry/stat.json +1 -1
  271. package/registry/status-chip.json +1 -1
  272. package/registry/status-page.json +1 -1
  273. package/registry/step-progress.json +1 -1
  274. package/registry/step-showcase.json +1 -1
  275. package/registry/stepper.json +1 -1
  276. package/registry/sticky-action.json +1 -1
  277. package/registry/stuck.json +1 -1
  278. package/registry/swipe-deck.json +1 -1
  279. package/registry/switch.json +1 -1
  280. package/registry/tabs.json +1 -1
  281. package/registry/tag-input.json +1 -1
  282. package/registry/tag-selector.json +1 -1
  283. package/registry/taped-photo.json +1 -1
  284. package/registry/terminal-replay.json +1 -1
  285. package/registry/text-style.json +1 -1
  286. package/registry/theme.json +1 -1
  287. package/registry/toast.json +1 -1
  288. package/registry/toc.json +1 -1
  289. package/registry/tooltip.json +1 -1
  290. package/registry/tree-view.json +1 -1
  291. package/registry/update-prompt.json +1 -1
  292. package/registry/upload-queue.json +1 -1
  293. package/registry/usage.json +1 -1
  294. package/registry/verified-badge.json +1 -1
  295. package/registry/versus-card.json +1 -1
  296. package/registry/vertical-video.json +1 -1
  297. package/registry/video-player.json +1 -1
  298. package/registry/video-trimmer.json +1 -1
  299. package/registry/virtual.json +1 -1
  300. package/registry/wall.json +47 -4
  301. package/registry/waveform.json +1 -1
  302. package/dist/chunk-A7MQPIEG.js +0 -31
  303. package/dist/chunk-A7MQPIEG.js.map +0 -1
  304. package/dist/chunk-EUJ7337V.js.map +0 -1
  305. package/dist/chunk-HK525THY.js.map +0 -1
  306. /package/dist/{chunk-CSRKYZ53.js.map → chunk-CZHPWLNW.js.map} +0 -0
package/dist/shop.d.ts CHANGED
@@ -1,195 +1,9 @@
1
- import * as z from 'zod/mini';
2
- export { a as ShopFrame, b as ShopFrameProps, S as ShopPhoto, c as ShopSection, d as ShopSectionProps } from './frame-D6Xv83t8.js';
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 { SECTION_DEFINITIONS, SECTION_TYPES, SHOP_KEY_ATTRIBUTE, SHOP_LIMITS, SHOP_MIGRATIONS, SHOP_SCHEMA_VERSION, connectShopPreview, createMigrator, defineSection, migrateShopPage, parseShopPage, postToPreview, readPreviewMessage, sectionDefinition, shopPageSchema, shopStarters };
316
- export type { LocalizedText, MigrationResult, ParsedSection, PreviewMessage, Section, SectionDefinition, SectionOf, SectionSpec, SectionType, ShopMigration, ShopPage, ShopPageIssue, ShopPageResult, ShopStarterId };
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-A7MQPIEG.js";
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 z4 from "zod/mini";
17
+ import * as z from "zod/mini";
208
18
  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))
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 = z4.discriminatedUnion(
23
+ var sectionUnion = z.discriminatedUnion(
214
24
  "type",
215
25
  SECTION_DEFINITIONS.map((d) => d.schema)
216
26
  );
217
- var shopPageSchema = z4.object({
218
- schema: z4.literal(SHOP_SCHEMA_VERSION),
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: z4.optional(z4.enum(["compact", "airy"])),
222
- sections: z4.array(sectionUnion).check(z4.minLength(1), z4.maxLength(SHOP_LIMITS.sections))
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
- z4.superRefine((page, ctx) => {
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 = (key2) => root.querySelector(`[${SHOP_KEY_ATTRIBUTE}="${key2}"]`);
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 = (key2) => key2;
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, key2) => ({ key: key2, type: "booking", variant, settings: { count: 4 } });
324
- var gallery = (variant, key2, extra = {}) => ({
325
- key: key2,
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" },