@orbitcommerce/constellation-docs 1.0.0 → 1.2.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.
Files changed (235) hide show
  1. package/dist/docs.css +14764 -2237
  2. package/dist/index.js +2 -2
  3. package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
  4. package/dist/pages/_address-data-L9BR499w.js +161 -0
  5. package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
  6. package/dist/pages/_card-art-0be5ncyV.js +18 -0
  7. package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
  8. package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
  9. package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
  10. package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
  11. package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
  12. package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
  13. package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
  14. package/dist/pages/address-block-BvxQWBTy.js +403 -0
  15. package/dist/pages/address-fields-CwSqro3W.js +277 -0
  16. package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
  17. package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
  18. package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
  19. package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
  20. package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
  21. package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
  22. package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
  23. package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
  24. package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
  25. package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
  26. package/dist/pages/board-card-D2tZY_mU.js +415 -0
  27. package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
  28. package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
  29. package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
  30. package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
  31. package/dist/pages/card-CXZ3V1d4.js +1612 -0
  32. package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
  33. package/dist/pages/chart-legend-B20AbakD.js +724 -0
  34. package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
  35. package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
  36. package/dist/pages/checklist-card-DEyykVFS.js +783 -0
  37. package/dist/pages/chip-Ck-o3Ui6.js +839 -0
  38. package/dist/pages/chip-list-k1LxXuCi.js +414 -0
  39. package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
  40. package/dist/pages/coachmark-Be2ghobT.js +366 -0
  41. package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
  42. package/dist/pages/collab-field-CfqqK7d2.js +696 -0
  43. package/dist/pages/color-field-CZpfcA-A.js +1127 -0
  44. package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
  45. package/dist/pages/column-mapper-TsTG39cl.js +502 -0
  46. package/dist/pages/combobox-DvK2j5tI.js +1334 -0
  47. package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
  48. package/dist/pages/comment-box-CDSGYhr5.js +346 -0
  49. package/dist/pages/composer-D4B0NgpA.js +689 -0
  50. package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
  51. package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
  52. package/dist/pages/context-menu-F9DV30ia.js +487 -0
  53. package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
  54. package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
  55. package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
  56. package/dist/pages/date-input-GOW067EB.js +956 -0
  57. package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
  58. package/dist/pages/date-time-BLKCXtVZ.js +678 -0
  59. package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
  60. package/dist/pages/description-list-BPeXn1eW.js +1268 -0
  61. package/dist/pages/device-switcher-BCaN99c1.js +554 -0
  62. package/dist/pages/dialog-CRpkRC98.js +3164 -0
  63. package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
  64. package/dist/pages/doodle-nzkqi2UI.js +201 -0
  65. package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
  66. package/dist/pages/drill-menu-cskH5mol.js +490 -0
  67. package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
  68. package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
  69. package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
  70. package/dist/pages/empty-state-4U2txFpI.js +1113 -0
  71. package/dist/pages/facet-filters-McbBeY9e.js +353 -0
  72. package/dist/pages/figure-D-HF5vCj.js +563 -0
  73. package/dist/pages/figure-strip-hg7txTc3.js +1381 -0
  74. package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
  75. package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
  76. package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
  77. package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
  78. package/dist/pages/form-grid-BfWCVlie.js +692 -0
  79. package/dist/pages/gallery-BBk2EOri.js +453 -0
  80. package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
  81. package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
  82. package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
  83. package/dist/pages/heatmap-BohgIcNk.js +507 -0
  84. package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
  85. package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
  86. package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
  87. package/dist/pages/hosted-field-BLh-53AE.js +208 -0
  88. package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
  89. package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
  90. package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
  91. package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
  92. package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
  93. package/dist/pages/image-cropper-NyougqLH.js +466 -0
  94. package/dist/pages/image-field-7knBv4mJ.js +567 -0
  95. package/dist/pages/import-result-CmTtGXW_.js +486 -0
  96. package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
  97. package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
  98. package/dist/pages/input-CzLCzfyx.js +2372 -0
  99. package/dist/pages/{installation-DpsX8G_n.js → installation-DRUWNVHP.js} +112 -29
  100. package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
  101. package/dist/pages/kanban-Dy9sPAI0.js +740 -0
  102. package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
  103. package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
  104. package/dist/pages/line-chart-CntWxeMF.js +1117 -0
  105. package/dist/pages/link-CXqvAg9z.js +689 -0
  106. package/dist/pages/link-picker-BMFGCC67.js +478 -0
  107. package/dist/pages/link-row-x8yaUuWc.js +595 -0
  108. package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
  109. package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
  110. package/dist/pages/loading-state-BNbCo51C.js +556 -0
  111. package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
  112. package/dist/pages/{logo-BfGF1Pq9.js → logo-D3a3QGKJ.js} +13 -13
  113. package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
  114. package/dist/pages/markdown-Ied72vMT.js +237 -0
  115. package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
  116. package/dist/pages/media-banner-DkStCia0.js +233 -0
  117. package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
  118. package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
  119. package/dist/pages/meta-line-D5p2TycR.js +371 -0
  120. package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
  121. package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
  122. package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
  123. package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
  124. package/dist/pages/number-input-CuyMZg18.js +968 -0
  125. package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
  126. package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
  127. package/dist/pages/otp-input-CVRoX1mw.js +591 -0
  128. package/dist/pages/{overview-BPEbZQ6g.js → overview-BSfEqHY8.js} +4 -4
  129. package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
  130. package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
  131. package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
  132. package/dist/pages/password-field-DHEQKyUC.js +912 -0
  133. package/dist/pages/person-cell-BmjbADBz.js +564 -0
  134. package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
  135. package/dist/pages/plan-card-DRaA6RuB.js +621 -0
  136. package/dist/pages/plan-card-DtloWvMh.js +258 -0
  137. package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
  138. package/dist/pages/plan-grid-BCPvtP8J.js +251 -0
  139. package/dist/pages/point-list-BbPmZjsm.js +222 -0
  140. package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
  141. package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
  142. package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
  143. package/dist/pages/price-CRBLoa9h.js +604 -0
  144. package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
  145. package/dist/pages/print-page-BkLv6bW8.js +513 -0
  146. package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
  147. package/dist/pages/progress-CP_awmo4.js +904 -0
  148. package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
  149. package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-CbiibLwn.js} +581 -18
  150. package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
  151. package/dist/pages/rating-CweKN2SX.js +471 -0
  152. package/dist/pages/record-layout-DUP_X0RL.js +719 -0
  153. package/dist/pages/record-pager-y9D7JFgb.js +278 -0
  154. package/dist/pages/registry-CNR7zpf7.js +594 -0
  155. package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.js} +4 -1
  156. package/dist/pages/repeater-BRZYKRQa.js +1351 -0
  157. package/dist/pages/reply-feedback-BDnHprla.js +192 -0
  158. package/dist/pages/reveal-BygENBbL.js +460 -0
  159. package/dist/pages/rich-text-DOFQZEpT.js +156 -0
  160. package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
  161. package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
  162. package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
  163. package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
  164. package/dist/pages/rule-list-DTCmIMpT.js +648 -0
  165. package/dist/pages/save-status-B5KkyMZP.js +378 -0
  166. package/dist/pages/schedule-YycI95O1.js +243 -0
  167. package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
  168. package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
  169. package/dist/pages/search-menu-DMuXyUUW.js +580 -0
  170. package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
  171. package/dist/pages/section-rail-BtTCETS5.js +637 -0
  172. package/dist/pages/section-v2Pubup9.js +639 -0
  173. package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
  174. package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
  175. package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
  176. package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
  177. package/dist/pages/serp-preview-BGwORjmo.js +346 -0
  178. package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
  179. package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
  180. package/dist/pages/share-list-D4wgBxKN.js +926 -0
  181. package/dist/pages/side-panel-CCtkrZjs.js +811 -0
  182. package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
  183. package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
  184. package/dist/pages/skip-link-BxznhSkz.js +252 -0
  185. package/dist/pages/slider-CAoPURKD.js +774 -0
  186. package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
  187. package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
  188. package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
  189. package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
  190. package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
  191. package/dist/pages/split-bar-DYgZnFID.js +414 -0
  192. package/dist/pages/split-button-Be08-VI-.js +335 -0
  193. package/dist/pages/split-pane-lSNZgTKt.js +523 -0
  194. package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
  195. package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
  196. package/dist/pages/status-dot-D99gAGsV.js +567 -0
  197. package/dist/pages/stepper-CxKTbEA-.js +1093 -0
  198. package/dist/pages/success-mark-CqFTOBEu.js +142 -0
  199. package/dist/pages/swatch-H_kNvHuC.js +565 -0
  200. package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
  201. package/dist/pages/table-mq_pNXza.js +3232 -0
  202. package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -21
  203. package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
  204. package/dist/pages/task-card-Dv0sR1-w.js +295 -0
  205. package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
  206. package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
  207. package/dist/pages/time-input-CA9-uZAa.js +442 -0
  208. package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
  209. package/dist/pages/timeline-BsMUTlpR.js +1798 -0
  210. package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
  211. package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
  212. package/dist/pages/toolbar-B9l_fHKy.js +754 -0
  213. package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
  214. package/dist/pages/translation-field-CTRXiF2N.js +251 -0
  215. package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
  216. package/dist/pages/tree-select-DU1qXHy_.js +492 -0
  217. package/dist/pages/tree-view-g_RjLtAb.js +739 -0
  218. package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
  219. package/dist/pages/unit-input-Dml4fjmK.js +659 -0
  220. package/dist/pages/upload-rules-yozEzSah.js +419 -0
  221. package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
  222. package/dist/pages/value-change-CnubDKyO.js +489 -0
  223. package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
  224. package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
  225. package/dist/pages/working-status-CENemSsw.js +389 -0
  226. package/manifest.json +10989 -1108
  227. package/package.json +3 -3
  228. package/dist/pages/card-DUggbis3.js +0 -659
  229. package/dist/pages/checkbox-DwimQaK3.js +0 -365
  230. package/dist/pages/dialog-BRAf4LMh.js +0 -1451
  231. package/dist/pages/empty-state-C-mLrXW2.js +0 -417
  232. package/dist/pages/input-KF9Gkawf.js +0 -1093
  233. package/dist/pages/registry-CroHzK9I.js +0 -244
  234. package/dist/pages/skeleton-DLuBhP46.js +0 -561
  235. package/dist/pages/table-AMoODng4.js +0 -607
@@ -0,0 +1,1631 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { a as SlotOnlyPage, i as ShopHome, n as SHOP_STYLES, r as ShopHeader, t as SALE_PAGE_IMAGE } from "./_preview-specimens-DKQC9HAo.js";
5
+ import { useEffect, useRef, useState } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Badge, Button, Card, CookieBannerPreview, PreviewFrame, SegmentedControl } from "@orbitcommerce/constellation";
8
+ //#region src/pages/components/preview-frame.tsx
9
+ var SHOP_HOME = `<!doctype html>
10
+ <html lang="en-GB">
11
+ <head>
12
+ <meta charset="utf-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
14
+ <style>
15
+ body { margin: 0; font-family: system-ui, sans-serif; background: #fafaf9; color: #1c1917; }
16
+ header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #e7e5e4; }
17
+ h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
18
+ nav { color: #78716c; font-size: 14px; }
19
+ main { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 24px; }
20
+ article { overflow: hidden; border: 1px solid #e7e5e4; border-radius: 12px; background: #ffffff; }
21
+ .thumb { height: 110px; }
22
+ .body { display: grid; gap: 4px; padding: 14px 16px; }
23
+ .name { font-size: 15px; font-weight: 600; }
24
+ .price { color: #0d9488; font-variant-numeric: tabular-nums; }
25
+ @media (max-width: 540px) { main { grid-template-columns: minmax(0, 1fr); } }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <header>
30
+ <h1>Harbour &amp; Heath</h1>
31
+ <nav>Shop · Journal · About</nav>
32
+ </header>
33
+ <main>
34
+ <article>
35
+ <div class="thumb" style="background: #0d9488"></div>
36
+ <div class="body"><span class="name">Arden oak side table</span><span class="price">£89.00</span></div>
37
+ </article>
38
+ <article>
39
+ <div class="thumb" style="background: #b45309"></div>
40
+ <div class="body"><span class="name">Linen cushion cover</span><span class="price">£18.00</span></div>
41
+ </article>
42
+ </main>
43
+ </body>
44
+ </html>`;
45
+ var TITLE = "Preview of the Harbour & Heath home page";
46
+ var PLUGIN_PAGE = `<!doctype html>
47
+ <html lang="en-GB">
48
+ <head>
49
+ <meta charset="utf-8" />
50
+ <style>
51
+ body { margin: 0; font-family: system-ui, sans-serif; color: #1c1917; }
52
+ main { display: grid; gap: 12px; padding: 20px; }
53
+ h1 { margin: 0; font-size: 17px; }
54
+ p { margin: 0; color: #57534e; font-size: 14px; line-height: 1.5; }
55
+ ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
56
+ li { display: flex; justify-content: space-between; padding: 10px 12px; border: 1px solid #e7e5e4; border-radius: 10px; font-size: 14px; }
57
+ button { justify-self: start; padding: 8px 14px; border: 1px solid #d6d3d1; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; }
58
+ </style>
59
+ </head>
60
+ <body>
61
+ <main>
62
+ <h1>Stock sync</h1>
63
+ <p>Three warehouses are connected. Stock levels were last read four minutes ago.</p>
64
+ <ul id="list">
65
+ <li><span>Leeds</span><span>1,284 items</span></li>
66
+ <li><span>Bristol</span><span>906 items</span></li>
67
+ <li><span>Glasgow</span><span>412 items</span></li>
68
+ </ul>
69
+ <button type="button" id="more">Show more</button>
70
+ </main>
71
+ <script>
72
+ const post = (message) => parent.postMessage(message, '*')
73
+ const size = () => post({ type: 'resize', height: document.documentElement.scrollHeight })
74
+ new ResizeObserver(size).observe(document.body)
75
+ setTimeout(() => post({ type: 'ready' }), 1200)
76
+ document.getElementById('more').addEventListener('click', () => {
77
+ for (const name of ['Cardiff', 'Belfast', 'Norwich']) {
78
+ const row = document.createElement('li')
79
+ row.innerHTML = '<span>' + name + '</span><span>Not read yet</span>'
80
+ document.getElementById('list').append(row)
81
+ }
82
+ })
83
+ <\/script>
84
+ </body>
85
+ </html>`;
86
+ /** A product sheet as a page, standing in for the PDF the designer draws (a PDF would need no sandbox: sandbox={false}). */
87
+ var SHEET_PAGE = `<!doctype html>
88
+ <html lang="en-GB">
89
+ <head>
90
+ <meta charset="utf-8" />
91
+ <style>
92
+ body { margin: 0; background: #e7e5e4; font-family: system-ui, sans-serif; color: #1c1917; }
93
+ .page { width: 595px; min-height: 760px; margin: 24px auto; padding: 40px; box-sizing: border-box; background: #fff; }
94
+ h1 { margin: 0 0 6px; font-size: 26px; }
95
+ .sku { color: #78716c; font-size: 13px; }
96
+ .photo { height: 240px; margin: 24px 0; border-radius: 8px; background: #0d9488; }
97
+ table { width: 100%; border-collapse: collapse; font-size: 13px; }
98
+ td { padding: 8px 0; border-bottom: 1px solid #e7e5e4; }
99
+ td + td { text-align: right; }
100
+ </style>
101
+ </head>
102
+ <body>
103
+ <div class="page">
104
+ <h1>Arden oak side table</h1>
105
+ <div class="sku">SKU HH-ARD-014 · Solid oak, oiled</div>
106
+ <div class="photo"></div>
107
+ <table>
108
+ <tr><td>Width</td><td>450 mm</td></tr>
109
+ <tr><td>Depth</td><td>450 mm</td></tr>
110
+ <tr><td>Height</td><td>520 mm</td></tr>
111
+ <tr><td>Price</td><td>£89.00</td></tr>
112
+ </table>
113
+ </div>
114
+ </body>
115
+ </html>`;
116
+ function Preview() {
117
+ return /* @__PURE__ */ jsx("div", {
118
+ className: "preview-frame-preview",
119
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
120
+ title: TITLE,
121
+ srcDoc: SHOP_HOME,
122
+ height: 132,
123
+ toolbar: false
124
+ })
125
+ });
126
+ }
127
+ function ShopPreview() {
128
+ return /* @__PURE__ */ jsx("div", {
129
+ className: "preview-frame-demo",
130
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
131
+ title: TITLE,
132
+ srcDoc: SHOP_HOME,
133
+ height: 320,
134
+ toolbarStart: /* @__PURE__ */ jsx("span", {
135
+ className: "preview-frame-demo__page",
136
+ children: "harbourandheath.co.uk"
137
+ })
138
+ })
139
+ });
140
+ }
141
+ function Devices() {
142
+ const [device, setDevice] = useState("desktop");
143
+ return /* @__PURE__ */ jsxs("div", {
144
+ className: "preview-frame-stack",
145
+ children: [/* @__PURE__ */ jsx(PreviewFrame, {
146
+ title: TITLE,
147
+ srcDoc: SHOP_HOME,
148
+ height: 320,
149
+ device,
150
+ onDeviceChange: setDevice
151
+ }), /* @__PURE__ */ jsxs("p", {
152
+ className: "preview-frame-demo__note",
153
+ children: [
154
+ "Showing the ",
155
+ /* @__PURE__ */ jsx("code", { children: device }),
156
+ " width."
157
+ ]
158
+ })]
159
+ });
160
+ }
161
+ function OneDevice() {
162
+ return /* @__PURE__ */ jsx("div", {
163
+ className: "preview-frame-demo",
164
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
165
+ title: TITLE,
166
+ srcDoc: SHOP_HOME,
167
+ height: 320,
168
+ defaultDevice: "phone",
169
+ devices: ["phone"]
170
+ })
171
+ });
172
+ }
173
+ function Widths() {
174
+ return /* @__PURE__ */ jsx("div", {
175
+ className: "preview-frame-demo",
176
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
177
+ title: TITLE,
178
+ srcDoc: SHOP_HOME,
179
+ height: 320,
180
+ device: "tablet",
181
+ widths: { tablet: 820 }
182
+ })
183
+ });
184
+ }
185
+ function ScalePair() {
186
+ return /* @__PURE__ */ jsxs("div", {
187
+ className: "preview-frame-pair",
188
+ children: [/* @__PURE__ */ jsxs("div", {
189
+ className: "preview-frame-demo__cell",
190
+ children: [/* @__PURE__ */ jsx("p", {
191
+ className: "preview-frame-demo__label",
192
+ children: "scale=\"fit\""
193
+ }), /* @__PURE__ */ jsx(PreviewFrame, {
194
+ title: `${TITLE} at fit`,
195
+ srcDoc: SHOP_HOME,
196
+ height: 300,
197
+ device: "tablet",
198
+ scale: "fit"
199
+ })]
200
+ }), /* @__PURE__ */ jsxs("div", {
201
+ className: "preview-frame-demo__cell",
202
+ children: [/* @__PURE__ */ jsx("p", {
203
+ className: "preview-frame-demo__label",
204
+ children: "scale=\"none\""
205
+ }), /* @__PURE__ */ jsx(PreviewFrame, {
206
+ title: `${TITLE} at none`,
207
+ srcDoc: SHOP_HOME,
208
+ height: 300,
209
+ device: "tablet",
210
+ scale: "none"
211
+ })]
212
+ })]
213
+ });
214
+ }
215
+ function Toolbar$1() {
216
+ return /* @__PURE__ */ jsx("div", {
217
+ className: "preview-frame-demo",
218
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
219
+ title: TITLE,
220
+ srcDoc: SHOP_HOME,
221
+ height: 320,
222
+ toolbarStart: /* @__PURE__ */ jsx("span", {
223
+ className: "preview-frame-demo__page",
224
+ children: "harbourandheath.co.uk"
225
+ }),
226
+ toolbarEnd: /* @__PURE__ */ jsx(Button, {
227
+ size: "sm",
228
+ variant: "soft",
229
+ children: "Publish"
230
+ })
231
+ })
232
+ });
233
+ }
234
+ function NoToolbar() {
235
+ return /* @__PURE__ */ jsx("div", {
236
+ className: "preview-frame-demo",
237
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
238
+ title: TITLE,
239
+ srcDoc: SHOP_HOME,
240
+ height: 280,
241
+ toolbar: false
242
+ })
243
+ });
244
+ }
245
+ function Loading() {
246
+ return /* @__PURE__ */ jsx("div", {
247
+ className: "preview-frame-demo",
248
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
249
+ title: TITLE,
250
+ srcDoc: SHOP_HOME,
251
+ height: 320,
252
+ onLoad: () => {},
253
+ onReload: () => {}
254
+ })
255
+ });
256
+ }
257
+ function Errored() {
258
+ return /* @__PURE__ */ jsx("div", {
259
+ className: "preview-frame-demo",
260
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
261
+ title: TITLE,
262
+ srcDoc: SHOP_HOME,
263
+ height: 320,
264
+ error: "This page is not published yet"
265
+ })
266
+ });
267
+ }
268
+ function PluginBlock() {
269
+ const frameRef = useRef(null);
270
+ const [ready, setReady] = useState(false);
271
+ const [height, setHeight] = useState();
272
+ useEffect(() => {
273
+ const listen = (event) => {
274
+ if (event.source !== frameRef.current?.contentWindow) return;
275
+ if (event.data?.type === "ready") setReady(true);
276
+ if (event.data?.type === "resize") setHeight(event.data.height);
277
+ };
278
+ window.addEventListener("message", listen);
279
+ return () => window.removeEventListener("message", listen);
280
+ }, []);
281
+ return /* @__PURE__ */ jsx("div", {
282
+ className: "preview-frame-demo",
283
+ children: /* @__PURE__ */ jsx("div", {
284
+ className: "preview-frame-plugin",
285
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
286
+ title: "Stock sync",
287
+ srcDoc: PLUGIN_PAGE,
288
+ frameRef,
289
+ allow: "clipboard-read; clipboard-write",
290
+ bare: true,
291
+ height: "auto",
292
+ minHeight: 200,
293
+ contentHeight: height,
294
+ widths: { desktop: null },
295
+ devices: ["desktop"],
296
+ loading: !ready,
297
+ loadingLabel: "Connecting to Stock sync…",
298
+ reload: false,
299
+ toolbar: false
300
+ })
301
+ })
302
+ });
303
+ }
304
+ function Rendering() {
305
+ const [busy, setBusy] = useState(false);
306
+ useEffect(() => {
307
+ if (!busy) return;
308
+ const timer = setTimeout(() => setBusy(false), 1600);
309
+ return () => clearTimeout(timer);
310
+ }, [busy]);
311
+ return /* @__PURE__ */ jsx("div", {
312
+ className: "preview-frame-demo",
313
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
314
+ title: "Preview of the Arden oak side table product sheet",
315
+ srcDoc: SHEET_PAGE,
316
+ height: 340,
317
+ devices: ["desktop"],
318
+ widths: { desktop: 680 },
319
+ busy,
320
+ reload: false,
321
+ toolbarStart: /* @__PURE__ */ jsx("span", {
322
+ className: "preview-frame-demo__page",
323
+ children: busy ? "Rendering preview" : "Live preview"
324
+ }),
325
+ toolbarEnd: /* @__PURE__ */ jsx(Button, {
326
+ size: "sm",
327
+ variant: "secondary",
328
+ onClick: () => setBusy(true),
329
+ disabled: busy,
330
+ children: "Change the price"
331
+ })
332
+ })
333
+ });
334
+ }
335
+ function PluginError() {
336
+ return /* @__PURE__ */ jsx("div", {
337
+ className: "preview-frame-demo",
338
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
339
+ title: "Stock sync",
340
+ srcDoc: PLUGIN_PAGE,
341
+ height: 300,
342
+ devices: ["desktop"],
343
+ reload: false,
344
+ error: "Stock sync did not respond. It may be down for a moment, or the publisher may need to know.",
345
+ errorActions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
346
+ size: "sm",
347
+ variant: "ghost",
348
+ children: "Back to plugins"
349
+ }), /* @__PURE__ */ jsx(Button, {
350
+ size: "sm",
351
+ variant: "secondary",
352
+ children: "Contact the publisher"
353
+ })] })
354
+ })
355
+ });
356
+ }
357
+ function SideBySidePair() {
358
+ return /* @__PURE__ */ jsx("div", {
359
+ className: "preview-frame-wide",
360
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
361
+ title: TITLE,
362
+ srcDoc: SHOP_HOME,
363
+ layout: "side-by-side",
364
+ height: 380,
365
+ toolbarStart: /* @__PURE__ */ jsx("span", {
366
+ className: "preview-frame-demo__page",
367
+ children: "Storefront preview"
368
+ })
369
+ })
370
+ });
371
+ }
372
+ function FillBox() {
373
+ return /* @__PURE__ */ jsx("div", {
374
+ className: "preview-frame-demo",
375
+ children: /* @__PURE__ */ jsx("div", {
376
+ className: "preview-frame-fill",
377
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
378
+ title: TITLE,
379
+ srcDoc: SHOP_HOME,
380
+ height: "100%",
381
+ bare: true,
382
+ devices: ["desktop"],
383
+ widths: { desktop: null },
384
+ toolbar: false
385
+ })
386
+ })
387
+ });
388
+ }
389
+ function Heights() {
390
+ return /* @__PURE__ */ jsxs("div", {
391
+ className: "preview-frame-pair",
392
+ children: [/* @__PURE__ */ jsxs("div", {
393
+ className: "preview-frame-demo__cell",
394
+ children: [/* @__PURE__ */ jsxs("p", {
395
+ className: "preview-frame-demo__label",
396
+ children: [
397
+ "height=",
398
+ "{",
399
+ "280",
400
+ "}"
401
+ ]
402
+ }), /* @__PURE__ */ jsx(PreviewFrame, {
403
+ title: `${TITLE} at 280`,
404
+ srcDoc: SHOP_HOME,
405
+ height: 280,
406
+ toolbar: false
407
+ })]
408
+ }), /* @__PURE__ */ jsxs("div", {
409
+ className: "preview-frame-demo__cell",
410
+ children: [/* @__PURE__ */ jsx("p", {
411
+ className: "preview-frame-demo__label",
412
+ children: "height=\"40vh\""
413
+ }), /* @__PURE__ */ jsx(PreviewFrame, {
414
+ title: `${TITLE} at 40vh`,
415
+ srcDoc: SHOP_HOME,
416
+ height: "40vh",
417
+ toolbar: false
418
+ })]
419
+ })]
420
+ });
421
+ }
422
+ function Matrix() {
423
+ return /* @__PURE__ */ jsxs("div", {
424
+ className: "preview-frame-stack",
425
+ children: [
426
+ /* @__PURE__ */ jsx(PreviewFrame, {
427
+ title: `${TITLE} desktop`,
428
+ srcDoc: SHOP_HOME,
429
+ height: 260,
430
+ toolbar: false
431
+ }),
432
+ /* @__PURE__ */ jsx(PreviewFrame, {
433
+ title: `${TITLE} phone`,
434
+ srcDoc: SHOP_HOME,
435
+ height: 260,
436
+ toolbar: false,
437
+ defaultDevice: "phone",
438
+ devices: ["phone"]
439
+ }),
440
+ /* @__PURE__ */ jsx(PreviewFrame, {
441
+ title: `${TITLE} failed`,
442
+ srcDoc: SHOP_HOME,
443
+ height: 260,
444
+ toolbar: false,
445
+ error: "This page is not published yet"
446
+ })
447
+ ]
448
+ });
449
+ }
450
+ function LivePreview() {
451
+ return /* @__PURE__ */ jsx("div", {
452
+ className: "preview-frame-demo",
453
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
454
+ title: "Preview of the Harbour & Heath home page",
455
+ isolate: true,
456
+ isolateStyles: SHOP_STYLES,
457
+ height: 360,
458
+ toolbarStart: /* @__PURE__ */ jsx("span", {
459
+ className: "preview-frame-demo__page",
460
+ children: "Home page draft"
461
+ }),
462
+ children: /* @__PURE__ */ jsx(ShopHome, {})
463
+ })
464
+ });
465
+ }
466
+ var CANVAS_WIDTHS = [
467
+ {
468
+ value: "1100",
469
+ label: "1100px"
470
+ },
471
+ {
472
+ value: "900",
473
+ label: "900px"
474
+ },
475
+ {
476
+ value: "700",
477
+ label: "700px"
478
+ }
479
+ ];
480
+ function CanvasWidth() {
481
+ const [width, setWidth] = useState("900");
482
+ return /* @__PURE__ */ jsxs("div", {
483
+ className: "preview-frame-stack",
484
+ children: [/* @__PURE__ */ jsx(SegmentedControl, {
485
+ size: "sm",
486
+ "aria-label": "Canvas width",
487
+ value: width,
488
+ options: CANVAS_WIDTHS,
489
+ onValueChange: setWidth
490
+ }), /* @__PURE__ */ jsx(PreviewFrame, {
491
+ title: "Preview of the Harbour & Heath home page",
492
+ isolate: true,
493
+ isolateStyles: SHOP_STYLES,
494
+ width: Number(width),
495
+ height: 300,
496
+ toolbar: false,
497
+ children: /* @__PURE__ */ jsx(ShopHome, {})
498
+ })]
499
+ });
500
+ }
501
+ function HeaderBand() {
502
+ return /* @__PURE__ */ jsx("div", {
503
+ className: "preview-frame-demo",
504
+ children: /* @__PURE__ */ jsx("div", {
505
+ className: "preview-frame-band",
506
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
507
+ title: "Preview of the Harbour & Heath header",
508
+ thumbnail: true,
509
+ bare: true,
510
+ lazy: false,
511
+ height: "auto",
512
+ isolate: true,
513
+ isolateStyles: SHOP_STYLES,
514
+ children: /* @__PURE__ */ jsx(ShopHeader, {})
515
+ })
516
+ })
517
+ });
518
+ }
519
+ var TEMPLATES = [
520
+ {
521
+ name: "Harbour home",
522
+ meta: "Home page, edited today",
523
+ kind: "live"
524
+ },
525
+ {
526
+ name: "Autumn sale",
527
+ meta: "Landing page, saved picture",
528
+ kind: "image"
529
+ },
530
+ {
531
+ name: "Account",
532
+ meta: "Account page, no sections yet",
533
+ kind: "blank"
534
+ },
535
+ {
536
+ name: "Gift guide",
537
+ meta: "Landing page, not published",
538
+ kind: "error"
539
+ }
540
+ ];
541
+ function TemplateCards() {
542
+ return /* @__PURE__ */ jsx("div", {
543
+ className: "preview-frame-cards",
544
+ children: TEMPLATES.map((template) => /* @__PURE__ */ jsxs(Card, {
545
+ padding: "none",
546
+ className: "preview-frame-card",
547
+ children: [/* @__PURE__ */ jsx("div", {
548
+ className: "preview-frame-card__cover",
549
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
550
+ title: `Preview of ${template.name}`,
551
+ thumbnail: true,
552
+ bare: true,
553
+ isolate: true,
554
+ isolateStyles: SHOP_STYLES,
555
+ image: template.kind === "image" ? SALE_PAGE_IMAGE : void 0,
556
+ error: template.kind === "error" ? "Not published yet" : void 0,
557
+ children: template.kind === "blank" ? /* @__PURE__ */ jsx(SlotOnlyPage, {}) : /* @__PURE__ */ jsx(ShopHome, {})
558
+ })
559
+ }), /* @__PURE__ */ jsxs("div", {
560
+ className: "preview-frame-card__body",
561
+ children: [/* @__PURE__ */ jsx("span", {
562
+ className: "preview-frame-card__name",
563
+ children: template.name
564
+ }), /* @__PURE__ */ jsx("span", {
565
+ className: "preview-frame-card__meta",
566
+ children: template.meta
567
+ })]
568
+ })]
569
+ }, template.name))
570
+ });
571
+ }
572
+ function RowThumbnails() {
573
+ return /* @__PURE__ */ jsx("div", {
574
+ className: "preview-frame-rows",
575
+ children: [{
576
+ name: "Home",
577
+ path: "/",
578
+ badge: "Published"
579
+ }, {
580
+ name: "Account",
581
+ path: "/account",
582
+ badge: "Draft",
583
+ blank: true
584
+ }].map((page) => /* @__PURE__ */ jsxs("div", {
585
+ className: "preview-frame-row",
586
+ children: [
587
+ /* @__PURE__ */ jsx("div", {
588
+ className: "preview-frame-row__thumb",
589
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
590
+ title: `Preview of ${page.name}`,
591
+ thumbnail: true,
592
+ isolate: true,
593
+ isolateStyles: SHOP_STYLES,
594
+ children: page.blank ? /* @__PURE__ */ jsx(SlotOnlyPage, {}) : /* @__PURE__ */ jsx(ShopHome, {})
595
+ })
596
+ }),
597
+ /* @__PURE__ */ jsxs("div", {
598
+ className: "preview-frame-row__text",
599
+ children: [/* @__PURE__ */ jsx("span", {
600
+ className: "preview-frame-card__name",
601
+ children: page.name
602
+ }), /* @__PURE__ */ jsx("span", {
603
+ className: "preview-frame-card__meta",
604
+ children: page.path
605
+ })]
606
+ }),
607
+ /* @__PURE__ */ jsx(Badge, {
608
+ tone: page.blank ? "neutral" : "positive",
609
+ children: page.badge
610
+ })
611
+ ]
612
+ }, page.name))
613
+ });
614
+ }
615
+ function FallbackTiles() {
616
+ return /* @__PURE__ */ jsxs("div", {
617
+ className: "preview-frame-tiles",
618
+ children: [
619
+ /* @__PURE__ */ jsxs("div", {
620
+ className: "preview-frame-demo__cell",
621
+ children: [/* @__PURE__ */ jsx("p", {
622
+ className: "preview-frame-demo__label",
623
+ children: "loading"
624
+ }), /* @__PURE__ */ jsx("div", {
625
+ className: "preview-frame-tile",
626
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
627
+ title: "Preview on its way",
628
+ thumbnail: true,
629
+ lazy: false,
630
+ loading: true,
631
+ children: null
632
+ })
633
+ })]
634
+ }),
635
+ /* @__PURE__ */ jsxs("div", {
636
+ className: "preview-frame-demo__cell",
637
+ children: [/* @__PURE__ */ jsx("p", {
638
+ className: "preview-frame-demo__label",
639
+ children: "no content"
640
+ }), /* @__PURE__ */ jsx("div", {
641
+ className: "preview-frame-tile",
642
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
643
+ title: "Empty preview",
644
+ thumbnail: true,
645
+ children: null
646
+ })
647
+ })]
648
+ }),
649
+ /* @__PURE__ */ jsxs("div", {
650
+ className: "preview-frame-demo__cell",
651
+ children: [/* @__PURE__ */ jsx("p", {
652
+ className: "preview-frame-demo__label",
653
+ children: "error"
654
+ }), /* @__PURE__ */ jsx("div", {
655
+ className: "preview-frame-tile",
656
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
657
+ title: "Failed preview",
658
+ thumbnail: true,
659
+ error: "Not published yet",
660
+ children: /* @__PURE__ */ jsx(ShopHome, {})
661
+ })
662
+ })]
663
+ }),
664
+ /* @__PURE__ */ jsxs("div", {
665
+ className: "preview-frame-demo__cell",
666
+ children: [/* @__PURE__ */ jsx("p", {
667
+ className: "preview-frame-demo__label",
668
+ children: "fallback"
669
+ }), /* @__PURE__ */ jsx("div", {
670
+ className: "preview-frame-tile",
671
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
672
+ title: "Preview",
673
+ thumbnail: true,
674
+ fallback: /* @__PURE__ */ jsx("span", { children: "No home page yet" }),
675
+ children: null
676
+ })
677
+ })]
678
+ })
679
+ ]
680
+ });
681
+ }
682
+ function CookieStage() {
683
+ return /* @__PURE__ */ jsx("div", {
684
+ className: "preview-frame-demo",
685
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
686
+ title: "Preview of the cookie banner",
687
+ toolbar: false,
688
+ height: 300,
689
+ widths: { desktop: null },
690
+ overlay: /* @__PURE__ */ jsx(CookieBannerPreview, { policyLabel: "Cookie policy" }),
691
+ children: /* @__PURE__ */ jsx("p", {
692
+ className: "preview-frame-mock__page",
693
+ children: "Your page"
694
+ })
695
+ })
696
+ });
697
+ }
698
+ function Page() {
699
+ return /* @__PURE__ */ jsxs(DocPage, {
700
+ title: "Preview frame",
701
+ status: "new",
702
+ importNames: ["PreviewFrame", "PREVIEW_DEVICE_WIDTHS"],
703
+ lead: "A page shown at a device width and scaled down to fit a narrower stage: a URL or HTML in an iframe, or live content drawn from React. A toolbar switches device, reloads and opens the page in a new tab; as a thumbnail it is an inert still for cards and rows.",
704
+ children: [
705
+ /* @__PURE__ */ jsxs(Section$1, {
706
+ id: "basics",
707
+ title: "Basics",
708
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
709
+ "Give PreviewFrame a ",
710
+ /* @__PURE__ */ jsx("code", { children: "title" }),
711
+ " (it names the iframe) and either a ",
712
+ /* @__PURE__ */ jsx("code", { children: "src" }),
713
+ " or some",
714
+ " ",
715
+ /* @__PURE__ */ jsx("code", { children: "srcDoc" }),
716
+ ". It draws a toolbar and a sunken stage, and fits the page inside: a device wider than the stage is scaled down, so the whole page is visible at once."
717
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
718
+ "Reach for it to show a page the person is building or reviewing: a theme, a storefront, a campaign. For a picture or a chart, use the component that draws it; for one of a few fixed views of the same thing, a",
719
+ " ",
720
+ /* @__PURE__ */ jsx(DocLink, {
721
+ to: "/components/segmented-control",
722
+ children: "SegmentedControl"
723
+ }),
724
+ " in place is simpler. The frame is not a way to embed a page into the layout: it is a preview, with a toolbar, and the page inside it scrolls and behaves on its own."
725
+ ] })] }),
726
+ children: [
727
+ /* @__PURE__ */ jsx(Example, {
728
+ align: "fill",
729
+ code: `
730
+ <PreviewFrame
731
+ title="Preview of the Harbour & Heath home page"
732
+ srcDoc={shopHomePage}
733
+ height={320}
734
+ toolbarStart={<span>harbourandheath.co.uk</span>}
735
+ />`,
736
+ children: /* @__PURE__ */ jsx(ShopPreview, {})
737
+ }),
738
+ /* @__PURE__ */ jsx(DocTable, {
739
+ columns: ["Reach for", "When"],
740
+ rows: [
741
+ [/* @__PURE__ */ jsx("code", { children: "PreviewFrame" }), "A page shown at a device width, with a toolbar to switch device, reload and open it in a new tab."],
742
+ [/* @__PURE__ */ jsx(DocLink, {
743
+ to: "/components/segmented-control",
744
+ children: "SegmentedControl"
745
+ }), "A few fixed views of the same thing on the page itself, not a whole page in a frame."],
746
+ ["An image or chart", "Something that is drawn by a component, not a page that loads and scrolls."]
747
+ ]
748
+ }),
749
+ /* @__PURE__ */ jsxs(Note, {
750
+ title: "The sandbox",
751
+ children: [
752
+ "HTML given as ",
753
+ /* @__PURE__ */ jsx("code", { children: "srcDoc" }),
754
+ " would run as the dashboard's own origin, so by default it gets",
755
+ " ",
756
+ /* @__PURE__ */ jsx("code", { children: "allow-scripts allow-forms allow-popups" }),
757
+ " and no ",
758
+ /* @__PURE__ */ jsx("code", { children: "allow-same-origin" }),
759
+ ": a script in a theme or a merchant's page runs in an opaque origin and cannot read the dashboard's page, its storage or its cookies, or call its API as the person signed in. A ",
760
+ /* @__PURE__ */ jsx("code", { children: "src" }),
761
+ " keeps ",
762
+ /* @__PURE__ */ jsx("code", { children: "allow-same-origin" }),
763
+ ", so the page works as it does on its own site, which is safe for a page served from another origin. A ",
764
+ /* @__PURE__ */ jsx("code", { children: "src" }),
765
+ " on the dashboard's own origin needs the same care: pass a ",
766
+ /* @__PURE__ */ jsx("code", { children: "sandbox" }),
767
+ " without ",
768
+ /* @__PURE__ */ jsx("code", { children: "allow-same-origin" }),
769
+ ", or serve previews from another origin."
770
+ ]
771
+ })
772
+ ]
773
+ }),
774
+ /* @__PURE__ */ jsxs(Section$1, {
775
+ id: "devices",
776
+ title: "Devices",
777
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
778
+ "The switch offers Desktop (1280px), Tablet (768px) and Phone (390px), each scaled down to fit a narrower stage, so Desktop shows the desktop layout even in a side panel or on a phone. Desktop is drawn edge to edge, and a stage wider than 1280px is filled; Tablet and Phone are screens of their own, inset, rounded and raised. Leave ",
779
+ /* @__PURE__ */ jsx("code", { children: "device" }),
780
+ " off and the frame keeps its own state from",
781
+ " ",
782
+ /* @__PURE__ */ jsx("code", { children: "defaultDevice" }),
783
+ " (",
784
+ /* @__PURE__ */ jsx("code", { children: "\"desktop\"" }),
785
+ " by default); pass it with",
786
+ " ",
787
+ /* @__PURE__ */ jsx("code", { children: "onDeviceChange" }),
788
+ " to hold the device yourself. ",
789
+ /* @__PURE__ */ jsx("code", { children: "devices" }),
790
+ " lists what the switch offers; one device hides it. ",
791
+ /* @__PURE__ */ jsx("code", { children: "widths" }),
792
+ " overrides a width, or sets it to ",
793
+ /* @__PURE__ */ jsx("code", { children: "null" }),
794
+ " to draw the page at the stage's own width: ",
795
+ /* @__PURE__ */ jsx("code", { children: "widths={{ desktop: null }}" }),
796
+ " fills the stage however narrow it is."
797
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
798
+ "The widths live in ",
799
+ /* @__PURE__ */ jsx("code", { children: "PREVIEW_DEVICE_WIDTHS" }),
800
+ ": ",
801
+ /* @__PURE__ */ jsx("code", { children: "{ desktop: 1280, tablet: 768, phone: 390 }" }),
802
+ ". Switching device snaps from one width to the next."
803
+ ] })] }),
804
+ children: [
805
+ /* @__PURE__ */ jsx(Example, {
806
+ align: "fill",
807
+ code: `
808
+ const [device, setDevice] = useState<PreviewDevice>('desktop')
809
+
810
+ <PreviewFrame
811
+ title="Preview of the Harbour & Heath home page"
812
+ srcDoc={shopHomePage}
813
+ height={320}
814
+ device={device}
815
+ onDeviceChange={setDevice}
816
+ />`,
817
+ children: /* @__PURE__ */ jsx(Devices, {})
818
+ }),
819
+ /* @__PURE__ */ jsx(SubSection, {
820
+ title: "One device, no switch",
821
+ description: /* @__PURE__ */ jsxs("p", { children: [
822
+ "A preview that is always at one width draws no switch: give ",
823
+ /* @__PURE__ */ jsx("code", { children: "devices" }),
824
+ " a single entry and set",
825
+ " ",
826
+ /* @__PURE__ */ jsx("code", { children: "defaultDevice" }),
827
+ " to match. The toolbar keeps its reload and open actions."
828
+ ] }),
829
+ children: /* @__PURE__ */ jsx(Example, {
830
+ align: "fill",
831
+ code: `<PreviewFrame title="…" srcDoc={shopHomePage} height={320} defaultDevice="phone" devices={['phone']} />`,
832
+ children: /* @__PURE__ */ jsx(OneDevice, {})
833
+ })
834
+ }),
835
+ /* @__PURE__ */ jsx(SubSection, {
836
+ title: "A width of your own",
837
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "widths" }), " overrides the device widths in px. Here a tablet is drawn at 820px, the width a particular storefront breaks at."] }),
838
+ children: /* @__PURE__ */ jsx(Example, {
839
+ align: "fill",
840
+ code: `<PreviewFrame title="…" srcDoc={shopHomePage} height={320} device="tablet" widths={{ tablet: 820 }} />`,
841
+ children: /* @__PURE__ */ jsx(Widths, {})
842
+ })
843
+ })
844
+ ]
845
+ }),
846
+ /* @__PURE__ */ jsxs(Section$1, {
847
+ id: "scaling",
848
+ title: "Scaling",
849
+ description: /* @__PURE__ */ jsxs("p", { children: [
850
+ "When a device is wider than the stage, ",
851
+ /* @__PURE__ */ jsx("code", { children: "scale=\"fit\"" }),
852
+ " (the default) shrinks it so the whole page is in view, from the top centre. ",
853
+ /* @__PURE__ */ jsx("code", { children: "scale=\"none\"" }),
854
+ " keeps it at full width and lets the stage scroll sideways, so the page is seen at its real size, a part of it at a time."
855
+ ] }),
856
+ children: [/* @__PURE__ */ jsx(Example, {
857
+ align: "fill",
858
+ code: `
859
+ <PreviewFrame title="…" srcDoc={shopHomePage} height={300} device="tablet" scale="fit" />
860
+ <PreviewFrame title="…" srcDoc={shopHomePage} height={300} device="tablet" scale="none" />`,
861
+ children: /* @__PURE__ */ jsx(ScalePair, {})
862
+ }), /* @__PURE__ */ jsx(Note, { children: "The frame measures its own stage, not the window, so a preview in a side panel scales the same way as one on a wide page. Where there is no way to measure, it draws at full width and lets the stage scroll." })]
863
+ }),
864
+ /* @__PURE__ */ jsx(Section$1, {
865
+ id: "height",
866
+ title: "Height",
867
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "height" }), " is the stage's height, a number of px (640 by default) or any CSS length. It sets the room the page is shown in; the page scrolls inside its frame as it would on a device."] }),
868
+ children: /* @__PURE__ */ jsx(Example, {
869
+ align: "fill",
870
+ code: `
871
+ <PreviewFrame title="…" srcDoc={shopHomePage} height={280} toolbar={false} />
872
+ <PreviewFrame title="…" srcDoc={shopHomePage} height="40vh" toolbar={false} />`,
873
+ children: /* @__PURE__ */ jsx(Heights, {})
874
+ })
875
+ }),
876
+ /* @__PURE__ */ jsxs(Section$1, {
877
+ id: "toolbar",
878
+ title: "Toolbar",
879
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
880
+ "The toolbar holds the device switch, a reload button and, when there is a ",
881
+ /* @__PURE__ */ jsx("code", { children: "src" }),
882
+ ", a link that opens the page in a new tab. Put a page name or address before the switch with ",
883
+ /* @__PURE__ */ jsx("code", { children: "toolbarStart" }),
884
+ ", and your own action after the rest with ",
885
+ /* @__PURE__ */ jsx("code", { children: "toolbarEnd" }),
886
+ " (a Publish button, a status).",
887
+ " ",
888
+ /* @__PURE__ */ jsxs("code", { children: ["toolbar=", "{false}"] }),
889
+ " draws none of it."
890
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
891
+ "Open in a new tab appears only for a ",
892
+ /* @__PURE__ */ jsx("code", { children: "src" }),
893
+ ": an ",
894
+ /* @__PURE__ */ jsx("code", { children: "srcDoc" }),
895
+ " is HTML with nowhere to point, so the link is left out."
896
+ ] })] }),
897
+ children: [/* @__PURE__ */ jsx(Example, {
898
+ align: "fill",
899
+ code: `
900
+ <PreviewFrame
901
+ title="…"
902
+ srcDoc={shopHomePage}
903
+ height={320}
904
+ toolbarStart={<span>harbourandheath.co.uk</span>}
905
+ toolbarEnd={<Button size="sm" variant="soft">Publish</Button>}
906
+ />`,
907
+ children: /* @__PURE__ */ jsx(Toolbar$1, {})
908
+ }), /* @__PURE__ */ jsx(SubSection, {
909
+ title: "No toolbar",
910
+ description: /* @__PURE__ */ jsx("p", { children: "For a still, or a frame inside a card that already has its own actions, draw none." }),
911
+ children: /* @__PURE__ */ jsx(Example, {
912
+ align: "fill",
913
+ code: `<PreviewFrame title="…" srcDoc={shopHomePage} height={280} toolbar={false} />`,
914
+ children: /* @__PURE__ */ jsx(NoToolbar, {})
915
+ })
916
+ })]
917
+ }),
918
+ /* @__PURE__ */ jsx(Section$1, {
919
+ id: "loading",
920
+ title: "Loading",
921
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
922
+ "From the moment it is drawn, again whenever its ",
923
+ /* @__PURE__ */ jsx("code", { children: "src" }),
924
+ " or ",
925
+ /* @__PURE__ */ jsx("code", { children: "srcDoc" }),
926
+ " changes (the person picks another page), and after every reload, the frame shows a spinner over the stage and a polite status says \"Loading preview\", so a screen reader hears that the page is on its way. When the page arrives the layer goes and ",
927
+ /* @__PURE__ */ jsx("code", { children: "onLoad" }),
928
+ " is called."
929
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
930
+ "Reload builds a fresh frame, sets the loading state and calls ",
931
+ /* @__PURE__ */ jsx("code", { children: "onReload" }),
932
+ ", so a host can fetch the page again before it loads. Try again on the error layer does the same."
933
+ ] })] }),
934
+ children: /* @__PURE__ */ jsx(Example, {
935
+ align: "fill",
936
+ code: `
937
+ <PreviewFrame title="…" srcDoc={shopHomePage} height={320} onLoad={() => {}} onReload={() => {}} />`,
938
+ children: /* @__PURE__ */ jsx(Loading, {})
939
+ })
940
+ }),
941
+ /* @__PURE__ */ jsx(Section$1, {
942
+ id: "error",
943
+ title: "Error",
944
+ description: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("p", { children: [
945
+ "An iframe cannot say that a page failed to load: a refused, empty or error page still fires load. So when the host knows the preview is broken, it passes ",
946
+ /* @__PURE__ */ jsx("code", { children: "error" }),
947
+ ": the words are shown over the stage with a Try again button, and the frame stays mounted underneath, ready to reload."
948
+ ] }) }),
949
+ children: /* @__PURE__ */ jsx(Example, {
950
+ align: "fill",
951
+ code: `
952
+ <PreviewFrame
953
+ title="…"
954
+ srcDoc={shopHomePage}
955
+ height={320}
956
+ error="This page is not published yet"
957
+ />`,
958
+ children: /* @__PURE__ */ jsx(Errored, {})
959
+ })
960
+ }),
961
+ /* @__PURE__ */ jsxs(Section$1, {
962
+ id: "live",
963
+ title: "Live content",
964
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
965
+ "Give PreviewFrame children instead of a ",
966
+ /* @__PURE__ */ jsx("code", { children: "src" }),
967
+ " and it draws them on the stage the way it draws a page: laid out at the device's width (1280px for desktop) and scaled to fit, with the same device switch. A page-builder render, a template or a mock arrives this way, with no iframe to boot and nothing to load."
968
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
969
+ /* @__PURE__ */ jsx("code", { children: "isolate" }),
970
+ " draws the content inside a shadow root, so the dashboard's styles never reach it and its own never leak out; pass its stylesheet as text in ",
971
+ /* @__PURE__ */ jsx("code", { children: "isolateStyles" }),
972
+ ". The kit's tokens still reach it (custom properties are inherited) but its classes do not, so isolate content that brings its own styles, not a mock built from the kit. The content's box is a size container, so a storefront's container queries answer to the device's width: switch to Phone and the product grid folds to one column."
973
+ ] })] }),
974
+ children: [
975
+ /* @__PURE__ */ jsx(Example, {
976
+ align: "fill",
977
+ code: `
978
+ <PreviewFrame
979
+ title="Preview of the Harbour & Heath home page"
980
+ isolate
981
+ isolateStyles={shopStyles}
982
+ height={360}
983
+ toolbarStart={<span>Home page draft</span>}
984
+ >
985
+ <ShopHome />
986
+ </PreviewFrame>`,
987
+ children: /* @__PURE__ */ jsx(LivePreview, {})
988
+ }),
989
+ /* @__PURE__ */ jsx(SubSection, {
990
+ title: "A width of the canvas's own",
991
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "width" }), " lays the content out at a width in px in place of the device's: the width a person dragged a builder canvas to. It is followed at once, as the pointer moves; a change of device glides instead, its width and scale moving together in 320ms, as the canvas does on a preset (under reduced motion it snaps). A page in an iframe snaps either way, since gliding would lay the framed page out on every frame."] }),
992
+ children: /* @__PURE__ */ jsx(Example, {
993
+ align: "fill",
994
+ code: `
995
+ const [width, setWidth] = useState('900')
996
+
997
+ <SegmentedControl aria-label="Canvas width" value={width} options={widths} onValueChange={setWidth} />
998
+ <PreviewFrame title="…" isolate isolateStyles={shopStyles} width={Number(width)} height={300} toolbar={false}>
999
+ <ShopHome />
1000
+ </PreviewFrame>`,
1001
+ children: /* @__PURE__ */ jsx(CanvasWidth, {})
1002
+ })
1003
+ }),
1004
+ /* @__PURE__ */ jsx(SubSection, {
1005
+ title: "As tall as the content",
1006
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "height=\"auto\"" }), " makes the stage as tall as the content once it is scaled, so a header or a footer band above and below a builder canvas takes exactly its own height. Here the shop's header is drawn at desktop width as an inert, bare band."] }),
1007
+ children: /* @__PURE__ */ jsx(Example, {
1008
+ align: "fill",
1009
+ code: `
1010
+ <PreviewFrame title="Preview of the Harbour & Heath header" thumbnail bare lazy={false} height="auto" isolate isolateStyles={shopStyles}>
1011
+ <ShopHeader />
1012
+ </PreviewFrame>`,
1013
+ children: /* @__PURE__ */ jsx(HeaderBand, {})
1014
+ })
1015
+ }),
1016
+ /* @__PURE__ */ jsx(SubSection, {
1017
+ title: "A stage for mocks",
1018
+ description: /* @__PURE__ */ jsxs("p", { children: [
1019
+ "A still of something the storefront draws over its pages (a cookie banner, a chat bubble) needs a stage, not a page: ",
1020
+ /* @__PURE__ */ jsx("code", { children: "widths={{ desktop: null }}" }),
1021
+ " draws the children at the stage's own width, unscaled, and ",
1022
+ /* @__PURE__ */ jsx("code", { children: "overlay" }),
1023
+ " pins what floats over the page to the screen, where it stays as the page scrolls under it. The",
1024
+ " ",
1025
+ /* @__PURE__ */ jsx(DocLink, {
1026
+ to: "/components/widget-preview",
1027
+ children: "widget previews"
1028
+ }),
1029
+ " are drawn for it. Children too can pin themselves to the edges of the content's box, which is positioned."
1030
+ ] }),
1031
+ children: /* @__PURE__ */ jsx(Example, {
1032
+ align: "fill",
1033
+ code: `
1034
+ <PreviewFrame
1035
+ title="Preview of the cookie banner"
1036
+ toolbar={false}
1037
+ height={300}
1038
+ widths={{ desktop: null }}
1039
+ overlay={<CookieBannerPreview policyLabel="Cookie policy" />}
1040
+ >
1041
+ <p>Your page</p>
1042
+ </PreviewFrame>`,
1043
+ children: /* @__PURE__ */ jsx(CookieStage, {})
1044
+ })
1045
+ })
1046
+ ]
1047
+ }),
1048
+ /* @__PURE__ */ jsxs(Section$1, {
1049
+ id: "thumbnails",
1050
+ title: "Thumbnails",
1051
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
1052
+ /* @__PURE__ */ jsx("code", { children: "thumbnail" }),
1053
+ " makes the frame an inert still for a template card, a page row or a picker: no toolbar, no pointer events, hidden from assistive technology and out of the tab order, since the card around it names it and takes the click. It fills the box it is put in (give the box an aspect ratio), and its corners are a tile's. ",
1054
+ /* @__PURE__ */ jsx("code", { children: "bare" }),
1055
+ " drops the stage's hairline, corners and ground, for a cover that the card frames."
1056
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
1057
+ "A thumbnail is lazy: it waits behind a skeleton until it is within 400px of the viewport, then mounts and stays, so a grid of fifty templates boots only the ones near the screen. Pass ",
1058
+ /* @__PURE__ */ jsx("code", { children: "lazy" }),
1059
+ " to any frame to do the same, or ",
1060
+ /* @__PURE__ */ jsx("code", { children: "lazy={false}" }),
1061
+ " to mount at once. When there is a stored picture of the page, ",
1062
+ /* @__PURE__ */ jsx("code", { children: "image" }),
1063
+ " shows it first, covering the stage from the top, and nothing live is mounted; if it fails to load, the content is drawn instead."
1064
+ ] })] }),
1065
+ children: [/* @__PURE__ */ jsx(Example, {
1066
+ align: "fill",
1067
+ code: `
1068
+ <Card padding="none">
1069
+ <div className="cover">{/* aspect-ratio: 16 / 10 */}
1070
+ <PreviewFrame title="Preview of Harbour home" thumbnail bare isolate isolateStyles={shopStyles}>
1071
+ <ShopHome />
1072
+ </PreviewFrame>
1073
+ </div>
1074
+ …
1075
+ </Card>
1076
+
1077
+ <PreviewFrame title="Preview of Autumn sale" thumbnail bare image={salePagePicture}>…</PreviewFrame>`,
1078
+ children: /* @__PURE__ */ jsx(TemplateCards, {})
1079
+ }), /* @__PURE__ */ jsx(SubSection, {
1080
+ title: "In a list row",
1081
+ description: /* @__PURE__ */ jsx("p", { children: "A page list's 104 × 64 thumbnail is the same frame in a smaller box, with its stage's tile corners and hairline. A tile too small for its sentence keeps the icon alone." }),
1082
+ children: /* @__PURE__ */ jsx(Example, {
1083
+ align: "fill",
1084
+ code: `
1085
+ <div className="thumb">{/* 104 × 64 */}
1086
+ <PreviewFrame title="Preview of Home" thumbnail isolate isolateStyles={shopStyles}>
1087
+ <ShopHome />
1088
+ </PreviewFrame>
1089
+ </div>`,
1090
+ children: /* @__PURE__ */ jsx(RowThumbnails, {})
1091
+ })
1092
+ })]
1093
+ }),
1094
+ /* @__PURE__ */ jsx(Section$1, {
1095
+ id: "fallback",
1096
+ title: "Fallback tile",
1097
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
1098
+ /* @__PURE__ */ jsxs("p", { children: [
1099
+ "Live content that is empty (",
1100
+ /* @__PURE__ */ jsx("code", { children: "null" }),
1101
+ " or ",
1102
+ /* @__PURE__ */ jsx("code", { children: "false" }),
1103
+ "), that throws while it draws, or that draws nothing a person can see is shown as a tile: an icon and a sentence, unscaled, on the stage's own ground. Each frame catches its own content's error, so one saved page with an element the preview cannot draw is one tile, not a broken list; ",
1104
+ /* @__PURE__ */ jsx("code", { children: "onContentError" }),
1105
+ " hears about it. A thumbnail also checks its content once it has settled (1.5s): no words, no picture and next to no elements reads as blank, which a white tile would make look like a bug. Turn the check on or off with ",
1106
+ /* @__PURE__ */ jsx("code", { children: "detectBlank" }),
1107
+ ". A blank render stays mounted out of sight behind its tile, and the moment it draws something (a template fetched per card arriving) the tile goes."
1108
+ ] }),
1109
+ /* @__PURE__ */ jsxs("p", { children: [
1110
+ "Content the host is still fetching is not empty: pass ",
1111
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
1112
+ " while it is on its way and a skeleton holds its place, the status says \"Loading preview\", and the blank check starts only once it is false."
1113
+ ] }),
1114
+ /* @__PURE__ */ jsxs("p", { children: [
1115
+ "A failed or blank render is tried again when ",
1116
+ /* @__PURE__ */ jsx("code", { children: "contentKey" }),
1117
+ " changes (the content was saved again), or on Reload. An ",
1118
+ /* @__PURE__ */ jsx("code", { children: "error" }),
1119
+ " the host knows of (the content could not be fetched) is a thumbnail's failed tile, with the host's words, since a still cannot hold an alert and a button. Replace the tile's insides with ",
1120
+ /* @__PURE__ */ jsx("code", { children: "fallback" }),
1121
+ "."
1122
+ ] })
1123
+ ] }),
1124
+ children: /* @__PURE__ */ jsx(Example, {
1125
+ align: "fill",
1126
+ code: `
1127
+ <PreviewFrame title="…" thumbnail loading>{null}</PreviewFrame>
1128
+ <PreviewFrame title="…" thumbnail>{null}</PreviewFrame>
1129
+ <PreviewFrame title="…" thumbnail error="Not published yet"><ShopHome /></PreviewFrame>
1130
+ <PreviewFrame title="…" thumbnail fallback={<span>No home page yet</span>}>{null}</PreviewFrame>`,
1131
+ children: /* @__PURE__ */ jsx(FallbackTiles, {})
1132
+ })
1133
+ }),
1134
+ /* @__PURE__ */ jsxs(Section$1, {
1135
+ id: "hosting",
1136
+ title: "Hosting a page",
1137
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
1138
+ "A plugin's page, a product sheet or an email is a page the dashboard hosts, and talks to.",
1139
+ " ",
1140
+ /* @__PURE__ */ jsx("code", { children: "frameRef" }),
1141
+ " hands over the iframe for ",
1142
+ /* @__PURE__ */ jsx("code", { children: "postMessage" }),
1143
+ " (a new one after each reload, so each is a new handshake), and ",
1144
+ /* @__PURE__ */ jsx("code", { children: "allow" }),
1145
+ " passes browser features through (the clipboard). When the host knows better than the iframe whether the page is ready, it holds ",
1146
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
1147
+ " itself: here the page has loaded but the layer stays, with ",
1148
+ /* @__PURE__ */ jsx("code", { children: "loadingLabel" }),
1149
+ " under the spinner, until the page says it is ready."
1150
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
1151
+ "With ",
1152
+ /* @__PURE__ */ jsx("code", { children: "height=\"auto\"" }),
1153
+ ", ",
1154
+ /* @__PURE__ */ jsx("code", { children: "contentHeight" }),
1155
+ " is the height the page asked for in a message the host has checked: the stage follows it, never under ",
1156
+ /* @__PURE__ */ jsx("code", { children: "minHeight" }),
1157
+ " (300 by default) and never over 10000, and a value that is not a height is ignored. Press Show more inside the plugin and the frame grows. ",
1158
+ /* @__PURE__ */ jsx("code", { children: "bare" }),
1159
+ " drops the stage's hairline and ground, and ",
1160
+ /* @__PURE__ */ jsx("code", { children: "reload={false}" }),
1161
+ " ",
1162
+ "hides Reload on its own."
1163
+ ] })] }),
1164
+ children: [
1165
+ /* @__PURE__ */ jsx(Example, {
1166
+ align: "fill",
1167
+ code: `
1168
+ const frameRef = useRef<HTMLIFrameElement>(null)
1169
+ const [ready, setReady] = useState(false)
1170
+ const [height, setHeight] = useState<number>()
1171
+ // A message listener that checks event.source === frameRef.current?.contentWindow (and the origin) sets both.
1172
+
1173
+ <PreviewFrame
1174
+ title="Stock sync"
1175
+ srcDoc={pluginPage}
1176
+ frameRef={frameRef}
1177
+ allow="clipboard-read; clipboard-write"
1178
+ bare
1179
+ height="auto"
1180
+ minHeight={200}
1181
+ contentHeight={height}
1182
+ widths={{ desktop: null }}
1183
+ devices={['desktop']}
1184
+ loading={!ready}
1185
+ loadingLabel="Connecting to Stock sync…"
1186
+ reload={false}
1187
+ toolbar={false}
1188
+ />`,
1189
+ children: /* @__PURE__ */ jsx(PluginBlock, {})
1190
+ }),
1191
+ /* @__PURE__ */ jsx(SubSection, {
1192
+ title: "Busy over the last render",
1193
+ description: /* @__PURE__ */ jsxs("p", { children: [
1194
+ /* @__PURE__ */ jsx("code", { children: "busy" }),
1195
+ " washes over the stage while the host renders the next version (a product sheet after an edit), with \"Rendering preview\" at the top, said in the status when a render starts. The last render stays in view and scrolls underneath. A PDF the dashboard made itself needs ",
1196
+ /* @__PURE__ */ jsx("code", { children: "sandbox={false}" }),
1197
+ ": a browser will not show a PDF in a sandboxed frame. HTML given as ",
1198
+ /* @__PURE__ */ jsx("code", { children: "srcDoc" }),
1199
+ " keeps its opaque origin whatever is passed."
1200
+ ] }),
1201
+ children: /* @__PURE__ */ jsx(Example, {
1202
+ align: "fill",
1203
+ code: `
1204
+ const [busy, setBusy] = useState(false)
1205
+
1206
+ <PreviewFrame
1207
+ title="Preview of the Arden oak side table product sheet"
1208
+ srcDoc={productSheetPage}
1209
+ height={340}
1210
+ devices={['desktop']}
1211
+ widths={{ desktop: 680 }}
1212
+ busy={busy}
1213
+ reload={false}
1214
+ toolbarStart={<span>{busy ? 'Rendering preview' : 'Live preview'}</span>}
1215
+ toolbarEnd={<Button size="sm" variant="secondary" onClick={() => setBusy(true)}>Change the price</Button>}
1216
+ />
1217
+
1218
+ // The designer's real preview is a PDF it made: src={pdfUrl} sandbox={false} loading={false}`,
1219
+ children: /* @__PURE__ */ jsx(Rendering, {})
1220
+ })
1221
+ }),
1222
+ /* @__PURE__ */ jsx(SubSection, {
1223
+ title: "Ways out of an error",
1224
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "errorActions" }), " puts the host's own ways out on the error layer, before Try again: back to where the person came from, or a way to reach whoever can fix it."] }),
1225
+ children: /* @__PURE__ */ jsx(Example, {
1226
+ align: "fill",
1227
+ code: `
1228
+ <PreviewFrame
1229
+ title="Stock sync"
1230
+ srcDoc={pluginPage}
1231
+ height={300}
1232
+ devices={['desktop']}
1233
+ reload={false}
1234
+ error="Stock sync did not respond. It may be down for a moment, or the publisher may need to know."
1235
+ errorActions={
1236
+ <>
1237
+ <Button size="sm" variant="ghost">Back to plugins</Button>
1238
+ <Button size="sm" variant="secondary">Contact the publisher</Button>
1239
+ </>
1240
+ }
1241
+ />`,
1242
+ children: /* @__PURE__ */ jsx(PluginError, {})
1243
+ })
1244
+ }),
1245
+ /* @__PURE__ */ jsx(SubSection, {
1246
+ title: "Filling the canvas",
1247
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "height=\"100%\"" }), " fills the box the frame is put in, toolbar and all: a plugin's own page taking the rest of the dashboard's canvas. Give that box a height (a flex column's remaining room, an aspect ratio); nothing inside the frame counts towards its size."] }),
1248
+ children: /* @__PURE__ */ jsx(Example, {
1249
+ align: "fill",
1250
+ code: `
1251
+ <div style={{ height: 300 }}>
1252
+ <PreviewFrame title="…" srcDoc={shopHomePage} height="100%" bare devices={['desktop']} widths={{ desktop: null }} toolbar={false} />
1253
+ </div>`,
1254
+ children: /* @__PURE__ */ jsx(FillBox, {})
1255
+ })
1256
+ })
1257
+ ]
1258
+ }),
1259
+ /* @__PURE__ */ jsx(Section$1, {
1260
+ id: "side-by-side",
1261
+ title: "Side by side",
1262
+ description: /* @__PURE__ */ jsxs("p", { children: [
1263
+ /* @__PURE__ */ jsx("code", { children: "layout=\"side-by-side\"" }),
1264
+ " shows several devices at once, each on its own stage under its name and one toolbar: a storefront's desktop and phone views together. ",
1265
+ /* @__PURE__ */ jsx("code", { children: "devices" }),
1266
+ " picks them (desktop and phone by default); each screen keeps its own proportions for the stage's height, desktop takes the rest, and the pair stacks when the frame is narrow. Reload reloads every screen, one error layer covers them all, and the frame is loading until each has loaded. ",
1267
+ /* @__PURE__ */ jsx("code", { children: "frameRefs" }),
1268
+ " hands over each screen's iframe, by device."
1269
+ ] }),
1270
+ children: /* @__PURE__ */ jsx(Example, {
1271
+ align: "fill",
1272
+ code: `
1273
+ <PreviewFrame
1274
+ title="Preview of the Harbour & Heath home page"
1275
+ srcDoc={shopHomePage}
1276
+ layout="side-by-side"
1277
+ height={380}
1278
+ toolbarStart={<span>Storefront preview</span>}
1279
+ />`,
1280
+ children: /* @__PURE__ */ jsx(SideBySidePair, {})
1281
+ })
1282
+ }),
1283
+ /* @__PURE__ */ jsx(Section$1, {
1284
+ id: "themes",
1285
+ title: "In both themes",
1286
+ children: /* @__PURE__ */ jsx(ThemePair, {
1287
+ align: "fill",
1288
+ minHeight: 360,
1289
+ children: /* @__PURE__ */ jsx(Matrix, {})
1290
+ })
1291
+ }),
1292
+ /* @__PURE__ */ jsx(Section$1, {
1293
+ id: "accessibility",
1294
+ title: "Accessibility",
1295
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
1296
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "title" }), " is required: it names the iframe for assistive technology (\"Preview of the Harbour & Heath home page\"), so a screen reader can tell the preview from the page around it."] }),
1297
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1298
+ "The device switch is a named radio group (\"Preview size\", from ",
1299
+ /* @__PURE__ */ jsx("code", { children: "labels.device" }),
1300
+ "), with Desktop, Tablet and Phone, reachable by Tab and chosen with the arrow keys."
1301
+ ] }),
1302
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1303
+ "Reload and Open in a new tab are buttons named from the labels. The link carries",
1304
+ " ",
1305
+ /* @__PURE__ */ jsx("code", { children: "target=\"_blank\"" }),
1306
+ " and ",
1307
+ /* @__PURE__ */ jsx("code", { children: "rel=\"noopener noreferrer\"" }),
1308
+ "."
1309
+ ] }),
1310
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1311
+ "Loading is announced in a polite status, in the page from the first render and empty until there is something to say. The error layer is a ",
1312
+ /* @__PURE__ */ jsx("code", { children: "role=\"alert\"" }),
1313
+ ", read at once, with a Try again button."
1314
+ ] }),
1315
+ "The page inside the frame brings its own structure and focus order. The frame adds no landmark of its own, and the toolbar comes before the preview in the source.",
1316
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1317
+ "Live content sits in a group named by ",
1318
+ /* @__PURE__ */ jsx("code", { children: "title" }),
1319
+ ", so a screen reader can tell where the preview starts and ends. Its own controls stay reachable, and a glide to a new width moves nothing that holds focus."
1320
+ ] }),
1321
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1322
+ "A thumbnail is ",
1323
+ /* @__PURE__ */ jsx("code", { children: "aria-hidden" }),
1324
+ " and ",
1325
+ /* @__PURE__ */ jsx("code", { children: "inert" }),
1326
+ ": it is never announced, never focused and never clicked. Name the card or the row around it, and make that the target."
1327
+ ] })
1328
+ ] })
1329
+ }),
1330
+ /* @__PURE__ */ jsxs(Section$1, {
1331
+ id: "guidelines",
1332
+ title: "Guidelines",
1333
+ children: [/* @__PURE__ */ jsx(DoDont, {
1334
+ do: {
1335
+ children: /* @__PURE__ */ jsx("div", {
1336
+ className: "preview-frame-demo",
1337
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
1338
+ title: TITLE,
1339
+ srcDoc: SHOP_HOME,
1340
+ height: 200,
1341
+ defaultDevice: "phone",
1342
+ devices: ["phone"]
1343
+ })
1344
+ }),
1345
+ caption: "Give the preview a real title and the width that matters. The device switch shows the page as a person will meet it."
1346
+ },
1347
+ dont: {
1348
+ children: /* @__PURE__ */ jsx("div", {
1349
+ className: "preview-frame-demo",
1350
+ children: /* @__PURE__ */ jsx(PreviewFrame, {
1351
+ title: TITLE,
1352
+ srcDoc: SHOP_HOME,
1353
+ height: 200,
1354
+ toolbar: false,
1355
+ scale: "none",
1356
+ device: "tablet"
1357
+ })
1358
+ }),
1359
+ caption: "A full-width device with no toolbar and no fitting: the page runs off the side, with nothing to switch or reload."
1360
+ }
1361
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
1362
+ "Title the preview with the page it shows (\"Preview of the Harbour & Heath home page\"), never \"Preview\" alone.",
1363
+ "Offer the devices that matter for the page. A storefront wants phone and desktop; a dashboard may want desktop only.",
1364
+ "Keep the toolbar. Reload and Open in a new tab are what make a preview trustworthy, and the switch is how a phone view is checked.",
1365
+ "Pass error when the host knows the page is broken. The frame cannot tell on its own, and a blank stage reads as a slow page.",
1366
+ "Keep the stage a sensible height and let the page scroll inside it. A very tall stage pushes the rest of the page out of view."
1367
+ ] })]
1368
+ }),
1369
+ /* @__PURE__ */ jsx(Fragment$1, {}),
1370
+ /* @__PURE__ */ jsxs(Section$1, {
1371
+ id: "props",
1372
+ title: "Props",
1373
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute. The ref, className and style go to the root." }),
1374
+ children: [
1375
+ /* @__PURE__ */ jsx(PropsTable, { rows: [
1376
+ {
1377
+ name: "title",
1378
+ type: "string",
1379
+ required: true,
1380
+ description: "Names the iframe for assistive technology."
1381
+ },
1382
+ {
1383
+ name: "src",
1384
+ type: "string",
1385
+ description: "The page to show. With a src, the toolbar draws an open-in-a-new-tab link."
1386
+ },
1387
+ {
1388
+ name: "srcDoc",
1389
+ type: "string",
1390
+ description: "HTML to show instead of src. No network is needed, and there is nothing to open in a new tab."
1391
+ },
1392
+ {
1393
+ name: "device",
1394
+ type: "'desktop' | 'tablet' | 'phone'",
1395
+ description: "Controlled device. Leave it off to let the frame keep its own state."
1396
+ },
1397
+ {
1398
+ name: "defaultDevice",
1399
+ type: "'desktop' | 'tablet' | 'phone'",
1400
+ default: "'desktop'",
1401
+ description: "Starting device when uncontrolled."
1402
+ },
1403
+ {
1404
+ name: "onDeviceChange",
1405
+ type: "(device: PreviewDevice) => void",
1406
+ description: "Called with the new device when the switch moves."
1407
+ },
1408
+ {
1409
+ name: "devices",
1410
+ type: "PreviewDevice[]",
1411
+ default: "all three",
1412
+ description: "Devices the switch offers, in order. One device hides the switch. Side by side, the devices drawn (desktop and phone by default)."
1413
+ },
1414
+ {
1415
+ name: "layout",
1416
+ type: "'single' | 'side-by-side'",
1417
+ default: "'single'",
1418
+ description: "Side by side draws every device at once, each on its own stage under its name, under one toolbar."
1419
+ },
1420
+ {
1421
+ name: "widths",
1422
+ type: "Partial<Record<PreviewDevice, number | null>>",
1423
+ description: "Overrides of the device widths in px. null draws the page at the stage's own width."
1424
+ },
1425
+ {
1426
+ name: "scale",
1427
+ type: "'fit' | 'none'",
1428
+ default: "'fit'",
1429
+ description: "Fit scales a device wider than the stage down to it; none scrolls the stage sideways."
1430
+ },
1431
+ {
1432
+ name: "height",
1433
+ type: "number | string",
1434
+ default: "640, or '100%' for a thumbnail",
1435
+ description: "The stage's height, a number of px or any CSS length. 'auto' makes it as tall as live content once scaled."
1436
+ },
1437
+ {
1438
+ name: "contentHeight",
1439
+ type: "number",
1440
+ description: "At height='auto', the height a page in an iframe asked for. Kept between minHeight and 10000; one that is not a height is ignored."
1441
+ },
1442
+ {
1443
+ name: "minHeight",
1444
+ type: "number",
1445
+ default: "300 for a page, none for live content",
1446
+ description: "At height='auto', the least the stage is, in px before scaling."
1447
+ },
1448
+ {
1449
+ name: "toolbar",
1450
+ type: "boolean",
1451
+ default: "true",
1452
+ description: "Draw the toolbar (device switch, reload, open in a new tab)."
1453
+ },
1454
+ {
1455
+ name: "reload",
1456
+ type: "boolean",
1457
+ default: "true for a page; live content: onReload given",
1458
+ description: "Offer Reload in the toolbar."
1459
+ },
1460
+ {
1461
+ name: "toolbarStart",
1462
+ type: "ReactNode",
1463
+ description: "Before the switch: a page name or address."
1464
+ },
1465
+ {
1466
+ name: "toolbarEnd",
1467
+ type: "ReactNode",
1468
+ description: "After the actions: your own button or status."
1469
+ },
1470
+ {
1471
+ name: "sandbox",
1472
+ type: "string | false",
1473
+ default: "srcDoc: 'allow-scripts allow-forms allow-popups'; src: 'allow-scripts allow-same-origin allow-forms allow-popups'",
1474
+ description: "Passed to the iframe. srcDoc HTML runs in an opaque origin, so its scripts cannot reach the dashboard. For a src on the dashboard's own origin (a blob: URL is one), pass one without allow-same-origin. false draws none, for a PDF the dashboard made; srcDoc ignores it."
1475
+ },
1476
+ {
1477
+ name: "allow",
1478
+ type: "string",
1479
+ description: "Passed to the iframe's allow: the browser features the page may use."
1480
+ },
1481
+ {
1482
+ name: "frameRef",
1483
+ type: "Ref<HTMLIFrameElement>",
1484
+ description: "The iframe itself, for postMessage. Each reload hands over a new one."
1485
+ },
1486
+ {
1487
+ name: "frameRefs",
1488
+ type: "Partial<Record<PreviewDevice, Ref<HTMLIFrameElement>>>",
1489
+ description: "Side by side, each screen’s iframe, by device."
1490
+ },
1491
+ {
1492
+ name: "loading",
1493
+ type: "boolean",
1494
+ description: "Held by the host: while true the loading layer stays, whatever the iframe says. Left out, it goes when the iframe loads. Live content shows a skeleton while it is true."
1495
+ },
1496
+ {
1497
+ name: "loadingLabel",
1498
+ type: "string",
1499
+ description: "Words under the loading spinner, also said when a load starts."
1500
+ },
1501
+ {
1502
+ name: "busy",
1503
+ type: "boolean",
1504
+ default: "false",
1505
+ description: "A wash over the last render, with \"Rendering preview\", while the host renders the next."
1506
+ },
1507
+ {
1508
+ name: "errorActions",
1509
+ type: "ReactNode",
1510
+ description: "The host's own ways out on the error layer, before Try again."
1511
+ },
1512
+ {
1513
+ name: "children",
1514
+ type: "ReactNode",
1515
+ description: "Live content, drawn on the stage instead of an iframe when there is no src or srcDoc. null or false shows the empty tile."
1516
+ },
1517
+ {
1518
+ name: "overlay",
1519
+ type: "ReactNode",
1520
+ description: "Drawn over the page, pinned to the screen rather than the page: the floating widget previews."
1521
+ },
1522
+ {
1523
+ name: "width",
1524
+ type: "number",
1525
+ description: "A width in px of its own, in place of the device's (a canvas dragged by its edge). Followed at once; a change of device glides."
1526
+ },
1527
+ {
1528
+ name: "thumbnail",
1529
+ type: "boolean",
1530
+ default: "false",
1531
+ description: "An inert still: no toolbar, no pointer events, aria-hidden, inert. Lazy, blank-checked and 100% high by default."
1532
+ },
1533
+ {
1534
+ name: "bare",
1535
+ type: "boolean",
1536
+ default: "false",
1537
+ description: "No hairline, corners or sunken ground on the stage, for a host that frames it."
1538
+ },
1539
+ {
1540
+ name: "lazy",
1541
+ type: "boolean",
1542
+ default: "thumbnail",
1543
+ description: "Mount the page or the content within 400px of the viewport, with a skeleton until then."
1544
+ },
1545
+ {
1546
+ name: "image",
1547
+ type: "string",
1548
+ description: "A stored picture of the page, shown first, covering the stage from the top. The page or content shows if it fails to load."
1549
+ },
1550
+ {
1551
+ name: "fallback",
1552
+ type: "ReactNode",
1553
+ description: "The fallback tile's insides, for content that is empty, threw or drew nothing."
1554
+ },
1555
+ {
1556
+ name: "detectBlank",
1557
+ type: "boolean",
1558
+ default: "thumbnail",
1559
+ description: "Show the empty tile when live content drew nothing a person can see, once it has settled (1.5s)."
1560
+ },
1561
+ {
1562
+ name: "contentKey",
1563
+ type: "string | number",
1564
+ description: "Names the live content; when it changes, content that threw or drew nothing is tried again."
1565
+ },
1566
+ {
1567
+ name: "onContentError",
1568
+ type: "(error: unknown) => void",
1569
+ description: "Called when live content throws while drawing; the failed tile shows in its place."
1570
+ },
1571
+ {
1572
+ name: "isolate",
1573
+ type: "boolean",
1574
+ default: "false",
1575
+ description: "Draw live content in a shadow root: the page's styles do not reach it and its own do not leak out."
1576
+ },
1577
+ {
1578
+ name: "isolateStyles",
1579
+ type: "string | string[]",
1580
+ description: "Stylesheets (CSS text) for inside the shadow root."
1581
+ },
1582
+ {
1583
+ name: "error",
1584
+ type: "ReactNode",
1585
+ description: "When the host knows the preview failed: the words shown, with Try again. A thumbnail shows them on its failed tile."
1586
+ },
1587
+ {
1588
+ name: "onReload",
1589
+ type: "() => void",
1590
+ description: "Called by Try again and by Reload, after the frame reloads. Live content shows Reload only when it is given."
1591
+ },
1592
+ {
1593
+ name: "onLoad",
1594
+ type: "() => void",
1595
+ description: "Called when the frame loads; side by side, once every screen has."
1596
+ },
1597
+ {
1598
+ name: "labels",
1599
+ type: "Partial<PreviewFrameLabels>",
1600
+ description: "Words for another language. Anything left out stays English; previewFrameLabels is the English set."
1601
+ }
1602
+ ] }),
1603
+ /* @__PURE__ */ jsx(SubSection, {
1604
+ title: "PreviewFrameLabels",
1605
+ children: /* @__PURE__ */ jsx(DocTable, {
1606
+ columns: ["Word", "Default"],
1607
+ rows: [
1608
+ [/* @__PURE__ */ jsx("code", { children: "device" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Preview size\": names the device switch." })],
1609
+ [/* @__PURE__ */ jsx("code", { children: "desktop, tablet, phone" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Desktop\", \"Tablet\", \"Phone\": the switch options." })],
1610
+ [/* @__PURE__ */ jsx("code", { children: "reload" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Reload preview\": names the reload button." })],
1611
+ [/* @__PURE__ */ jsx("code", { children: "openInNewTab" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Open in a new tab\": names the link." })],
1612
+ [/* @__PURE__ */ jsx("code", { children: "loading" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Loading preview\": announced while the page loads." })],
1613
+ [/* @__PURE__ */ jsx("code", { children: "retry" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Try again\": the error layer's button." })],
1614
+ [/* @__PURE__ */ jsx("code", { children: "empty" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Nothing to preview yet\": the fallback tile when there is nothing to show, or live content drew nothing." })],
1615
+ [/* @__PURE__ */ jsx("code", { children: "unavailable" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Preview unavailable\": the fallback tile when live content could not be drawn." })],
1616
+ [/* @__PURE__ */ jsx("code", { children: "busy" }), /* @__PURE__ */ jsx(Fragment$1, { children: "\"Rendering preview\": on the busy wash, and said when it starts." })]
1617
+ ]
1618
+ })
1619
+ }),
1620
+ /* @__PURE__ */ jsxs(Note, { children: [
1621
+ "The device widths are in ",
1622
+ /* @__PURE__ */ jsx("code", { children: "PREVIEW_DEVICE_WIDTHS" }),
1623
+ ", exported so a page can read them without repeating the numbers."
1624
+ ] })
1625
+ ]
1626
+ })
1627
+ ]
1628
+ });
1629
+ }
1630
+ //#endregion
1631
+ export { Page, Preview };