@templatical/editor 0.54.1 → 0.54.2

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 (131) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-BBKVJ6HA.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-BuVbeQh-.js} +1 -1
  3. package/dist/{AiRewriteMenu-arKoTjsQ.js → AiRewriteMenu-ZpYJfm-O.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-BTieuBmH.js → BlockPreviewCanvas-DtOo5y3U.js} +6 -6
  5. package/dist/{CloudPanels-Hxdp0doU.js → CloudPanels-DQRWMc59.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-DTpMEDyh.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-BZn7-p9e.js} +1 -1
  8. package/dist/{LanguageMenu-BpxbIJEx.js → LanguageMenu-OOmQWVzO.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-XESwnJia.js} +8 -8
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-CAsBRoSm.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-bOf27Hg1.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-DH_6JFui.js} +2 -2
  13. package/dist/{ParagraphEditor-B38t4E2p.js → ParagraphEditor-XGUkV5Uw.js} +8 -8
  14. package/dist/{RestoreVersionDialog-n7FSmWXB.js → RestoreVersionDialog-C72kWccI.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-BZN8KRvR.js} +2 -2
  16. package/dist/{SaveBlockDialog-B94NpmDV.js → SaveBlockDialog-CKOnTMTU.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-C1vSc8iM.js → SavedBlocksBrowserModal-BrlNxqDH.js} +4 -4
  18. package/dist/{SavedBlocksPanels-DLDmIYeL.js → SavedBlocksPanels--lPR6gdh.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-ngf2sFEs.js → SavedBlocksPickBar-4ON4_KKl.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-BE0jZmRJ.js} +4 -4
  21. package/dist/{TestEmailModal-CB_9I1bl.js → TestEmailModal-BKmNGrZN.js} +5 -5
  22. package/dist/{TestEmailPanel-BUq-dbXQ.js → TestEmailPanel-DT1wllX3.js} +1 -1
  23. package/dist/{TitleEditor-BLP41rwy.js → TitleEditor-HjVZuUTB.js} +4 -4
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-BppchV2k.js} +617 -617
  25. package/dist/{TplModal-DFKqmJQz.js → TplModal-BFWOoK8l.js} +1 -1
  26. package/dist/{VersionHistoryPanels-DPxj3mec.js → VersionHistoryPanels-D4yNVLvq.js} +1 -1
  27. package/dist/{WrapperBlock-BdVIuGMR.js → WrapperBlock-BUzQTZuu.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-D91v9k0x.js} +1 -1
  29. package/dist/bundle-stats.json +5 -5
  30. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CAI18sdv.js} +2 -2
  31. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CAI18sdv.js.map} +1 -1
  32. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-CWEyMOF-.js} +2 -2
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-CWEyMOF-.js.map} +1 -1
  34. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js → AiRewriteMenu-BEepu1vo.js} +5 -5
  35. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js.map → AiRewriteMenu-BEepu1vo.js.map} +1 -1
  36. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js → BlockPreviewCanvas-B6ndvof2.js} +5 -5
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js.map → BlockPreviewCanvas-B6ndvof2.js.map} +1 -1
  38. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js → CloudPanels-BGwDb0jB.js} +2 -2
  39. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js.map → CloudPanels-BGwDb0jB.js.map} +1 -1
  40. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-B-0FsTj-.js} +5 -5
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-B-0FsTj-.js.map} +1 -1
  42. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-LyjMBDok.js} +3 -3
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-LyjMBDok.js.map} +1 -1
  44. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js → LanguageMenu-CGwMCOQ5.js} +4 -4
  45. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js.map → LanguageMenu-CGwMCOQ5.js.map} +1 -1
  46. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-PDKuo2J3.js} +4 -4
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js.map → LogicTagInsertButton-PDKuo2J3.js.map} +1 -1
  48. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-DoQHBJk2.js} +2 -2
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-DoQHBJk2.js.map} +1 -1
  50. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-Ct5IG4VW.js} +2 -2
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-Ct5IG4VW.js.map} +1 -1
  52. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-BMsnjphR.js} +3 -3
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-BMsnjphR.js.map} +1 -1
  54. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js → ParagraphEditor-CVW-kuHW.js} +9 -9
  55. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js.map → ParagraphEditor-CVW-kuHW.js.map} +1 -1
  56. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js → RestoreVersionDialog-7MFZz-Sb.js} +2 -2
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js.map → RestoreVersionDialog-7MFZz-Sb.js.map} +1 -1
  58. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-CiL-SkZg.js} +3 -3
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-CiL-SkZg.js.map} +1 -1
  60. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js → SaveBlockDialog-CxdekCYy.js} +5 -5
  61. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js.map → SaveBlockDialog-CxdekCYy.js.map} +1 -1
  62. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js → SavedBlocksBrowserModal-D9CAa2U3.js} +4 -4
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js.map → SavedBlocksBrowserModal-D9CAa2U3.js.map} +1 -1
  64. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js → SavedBlocksPanels-jfkYWtss.js} +2 -2
  65. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js.map → SavedBlocksPanels-jfkYWtss.js.map} +1 -1
  66. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js → SavedBlocksPickBar-yaCumC4j.js} +2 -2
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js.map → SavedBlocksPickBar-yaCumC4j.js.map} +1 -1
  68. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-SaV2UVh_.js} +5 -5
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-SaV2UVh_.js.map} +1 -1
  70. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js → TestEmailModal-ByfhP_sm.js} +6 -6
  71. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js.map → TestEmailModal-ByfhP_sm.js.map} +1 -1
  72. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js → TestEmailPanel-CfzpqpDs.js} +2 -2
  73. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js.map → TestEmailPanel-CfzpqpDs.js.map} +1 -1
  74. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js → TitleEditor-Ceb0YfWv.js} +4 -4
  75. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js.map → TitleEditor-Ceb0YfWv.js.map} +1 -1
  76. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-Cv6Rv1S-.js} +9 -9
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js.map → Toolbar-Cv6Rv1S-.js.map} +1 -1
  78. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js → TplModal-DGpGdwgf.js} +2 -2
  79. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js.map → TplModal-DGpGdwgf.js.map} +1 -1
  80. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js → VersionHistoryPanels-BJnHCMAH.js} +2 -2
  81. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js.map → VersionHistoryPanels-BJnHCMAH.js.map} +1 -1
  82. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js → WrapperBlock-C_uE5rPJ.js} +4 -4
  83. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js.map → WrapperBlock-C_uE5rPJ.js.map} +1 -1
  84. package/dist/cdn/chunks/{composables-Jc3uZuLs.js → composables-BxikPuC1.js} +449 -443
  85. package/dist/cdn/chunks/composables-BxikPuC1.js.map +1 -0
  86. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-D2DUaudp.js} +3 -3
  87. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-D2DUaudp.js.map} +1 -1
  88. package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-DuDWpKo7.js} +4 -4
  89. package/dist/cdn/chunks/{extensions-DcMKZpzh.js.map → extensions-DuDWpKo7.js.map} +1 -1
  90. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-Bn_hl4jd.js} +2 -2
  91. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js.map → normalizeMergeTagMarkup-Bn_hl4jd.js.map} +1 -1
  92. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-C9oavydG.js} +2 -2
  93. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-C9oavydG.js.map} +1 -1
  94. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-DfXoetOm.js} +2 -2
  95. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-DfXoetOm.js.map} +1 -1
  96. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-DPwkrn5v.js} +2 -2
  97. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-DPwkrn5v.js.map} +1 -1
  98. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-712f3ofG.js} +2 -2
  99. package/dist/cdn/chunks/{src-A_cKeTM_.js.map → src-712f3ofG.js.map} +1 -1
  100. package/dist/cdn/chunks/{src-8bYYJPCt.js → src-B2tQbzf6.js} +152 -146
  101. package/dist/cdn/chunks/src-B2tQbzf6.js.map +1 -0
  102. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-ZFw5fg_z.js} +40 -27
  103. package/dist/cdn/chunks/{src-BQUv2CYU.js.map → src-ZFw5fg_z.js.map} +1 -1
  104. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js → useLocalizedDisplay-DiNjT22M.js} +2 -2
  105. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DiNjT22M.js.map} +1 -1
  106. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-SvMW4g00.js} +2 -2
  107. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-SvMW4g00.js.map} +1 -1
  108. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-JLz3Pqcw.js} +2 -2
  109. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-JLz3Pqcw.js.map} +1 -1
  110. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-BcoPpkDS.js} +2 -2
  111. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-BcoPpkDS.js.map} +1 -1
  112. package/dist/cdn/editor.css +1 -1
  113. package/dist/cdn/editor.js +18 -18
  114. package/dist/{composables-XjYKaKhY.js → composables-BbPFRlBf.js} +908 -902
  115. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Dlrg88gS.js} +2 -2
  116. package/dist/{dist-Cdkm20M6.js → dist-C34cYI5S.js} +126 -113
  117. package/dist/{extensions-BJ184osp.js → extensions-xCiyqSg7.js} +16 -16
  118. package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → normalizeMergeTagMarkup-C7FGNURu.js} +22 -22
  119. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → preRenderCustomBlocks-DvbRa3L3.js} +3 -3
  120. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-D_ab7dD6.js} +5 -5
  121. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-DhAolBjt.js} +342 -342
  122. package/dist/style.css +1 -1
  123. package/dist/templatical-editor.js +190 -190
  124. package/dist/useLocalizedDisplay-C9MBFUr4.js +31 -0
  125. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-BmuakZBd.js} +1 -1
  126. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-DC4a8b_v.js} +3 -3
  127. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-BSxJai99.js} +1 -1
  128. package/package.json +7 -7
  129. package/dist/cdn/chunks/composables-Jc3uZuLs.js.map +0 -1
  130. package/dist/cdn/chunks/src-8bYYJPCt.js.map +0 -1
  131. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -1,6 +1,6 @@
1
1
  import { C as e, F as t, G as n, O as r, R as i, _ as a, ct as o, f as s, g as c, h as l, l as u, m as d, n as f, p, pt as m, tt as h, x as g } from "./draggable-DepKdldn.js";
2
2
  import { et as _, it as v } from "./keys-CoQtCqNv.js";
3
- import { B as y } from "./composables-Jc3uZuLs.js";
3
+ import { B as y } from "./composables-BxikPuC1.js";
4
4
  import { n as b } from "./usePopoverPosition-BWAXWeBv.js";
5
5
  // src/components/TplModal.vue?vue&type=script&setup=true&lang.ts
6
6
  var x = ["data-tpl-theme"], S = /* @__PURE__ */ e({
@@ -48,4 +48,4 @@ var x = ["data-tpl-theme"], S = /* @__PURE__ */ e({
48
48
  });
49
49
  export { S as t };
50
50
 
51
- //# sourceMappingURL=TplModal-DDlR7mk3.js.map
51
+ //# sourceMappingURL=TplModal-DGpGdwgf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TplModal-DDlR7mk3.js","names":["_unref","_openBlock","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_createElementBlock","_normalizeStyle","_withModifiers","_createElementVNode","_renderSlot","_createCommentVNode","_sfc_main","defineComponent","openBlock","withCtx","inject","renderSlot","createElementBlock","unref","Teleport","createCommentVNode","createBlock","withModifiers","createBaseVNode","Transition","normalizeStyle","ref","createVNode","THEME_STYLES_KEY","UI_THEME_KEY","useFocusTrap","usePopoverRoot","_hoisted_1","TplModal_default","__emit","props","__props","emit","dialogRef","isVisible","computed","tplUiTheme","themeStyles","popoverRoot","handleKeydown","event","_cache","_ctx"],"sources":["../../../src/components/TplModal.vue","../../../src/components/TplModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useFocusTrap } from \"../composables\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport { computed, inject, ref } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"keydown\", event: KeyboardEvent): void;\n}>();\n\nconst dialogRef = ref<HTMLElement | null>(null);\nconst isVisible = computed(() => props.visible);\nuseFocusTrap(dialogRef, isVisible);\n\nconst tplUiTheme = inject(UI_THEME_KEY);\n\n// The backdrop below carries the bare `tpl` class, which re-declares every\n// `--tpl-*` token from the base `.tpl` rule. A custom property declared on an\n// element beats one inherited from an ancestor, so that re-declaration shadows\n// the consumer's `theme` config — which lives as inline styles on the editor\n// root — for this whole teleported subtree. Re-applying `themeStyles` here is\n// what restores it, and doing it on the backdrop covers every dialog rendered\n// through this wrapper rather than each one remembering to. `data-tpl-theme`\n// does the same job for the dark token block. See the invariant in\n// `tests/theme-token-scope.test.ts` (issue #487).\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst popoverRoot = usePopoverRoot();\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") {\n emit(\"close\");\n }\n emit(\"keydown\", event);\n}\n</script>\n\n<template>\n <Teleport v-if=\"popoverRoot\" :to=\"popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition tpl:duration-100\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <!-- The backdrop is the reference box every slotted panel caps against,\n which is why it owns the gutter (`p-4`) rather than each panel\n carrying its own margin. `inset-0` gives it a definite height; the\n wrapper below spans that height so a panel's percentage cap\n (`max-h-[90%]` / `max-h-[80%]`) has an unbroken chain to resolve\n through. Those numbers are the `vh` values they replaced, so an\n untrapped editor renders exactly as before.\n\n Panels must never cap in `vh`. `fixed` covers the viewport only while\n nothing traps it, and an ancestor with `transform`, `filter`,\n `backdrop-filter`, `will-change: transform`, `contain: paint`,\n `container-type` or a transform animation becomes the containing\n block for fixed descendants. The editor is embedded in someone\n else's page, so any of those can sit above it: `inset-0` then\n resolves to that ancestor's box while a `vh` cap still resolves to\n the viewport, and the panel overflows a container that usually also\n has `overflow: hidden`. That is issue #575 — in a 420px host inside a\n 720px viewport, a 648px panel clipped ~113px off both the top and the\n bottom, with no scrollbar to reach the buttons. Capping against the\n backdrop is self-correcting whether or not the trap is present.\n Locked by `tests/overlay-height-scope.test.ts`.\n\n The padding belongs here and not on the wrapper: preflight is\n omitted, so non-form elements keep `content-box` and padding on an\n `h-full` element would add to 100% and overflow by exactly the\n padding (the trap behind issue #115). The backdrop is `h-full` too,\n through the bare `tpl` class, so it is `box-border`: the gutter then\n shrinks its content box instead of making it 32px taller than the\n box it covers. -->\n <!-- `z-10` is the one z-index inside `.tpl-popover-root` that has to be\n real. The root is a single stacking context, so its residents\n otherwise paint in teleport-anchor order — and this modal's anchor is\n established when the editor mounts, while a link dialog's is\n established later, when a paragraph enters edit mode. Without a\n number, a picker opened FROM that dialog renders behind it. Any\n positive value beats the `auto` siblings; 10 stays far below the\n suggestion popup (9999) and `SmallScreenNotice` (10001), and cannot\n escape the root's own 10000 either way. -->\n <div\n v-if=\"visible\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl tpl:fixed tpl:inset-0 tpl:z-10 tpl:box-border tpl:flex tpl:items-center tpl:justify-center tpl:p-4\"\n style=\"\n background-color: var(--tpl-overlay);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n \"\n :style=\"themeStyles\"\n @click.self=\"emit('close')\"\n @keydown=\"handleKeydown\"\n >\n <!-- `h-full` only, deliberately no `w-full`: height is what has to\n become definite, and widening this element would change what\n `w-full` on a panel resolves against. Panels are shrink-to-fit\n horizontally — the test-email dialog stays compact until its\n preview opens, and the saved-blocks browser pins an explicit width\n precisely because this wrapper is shrink-to-fit. Constraining one\n axis leaves all of that intact.\n\n It repeats `@click.self` because it now covers the backdrop's full\n height: clicks in the gap above or below the panel land here, so\n without it click-outside-to-close would only work on the padding\n ring and the columns either side. -->\n <div\n ref=\"dialogRef\"\n class=\"tpl:flex tpl:h-full tpl:items-center tpl:justify-center\"\n @click.self=\"emit('close')\"\n >\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { useFocusTrap } from \"../composables\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport { computed, inject, ref } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"keydown\", event: KeyboardEvent): void;\n}>();\n\nconst dialogRef = ref<HTMLElement | null>(null);\nconst isVisible = computed(() => props.visible);\nuseFocusTrap(dialogRef, isVisible);\n\nconst tplUiTheme = inject(UI_THEME_KEY);\n\n// The backdrop below carries the bare `tpl` class, which re-declares every\n// `--tpl-*` token from the base `.tpl` rule. A custom property declared on an\n// element beats one inherited from an ancestor, so that re-declaration shadows\n// the consumer's `theme` config — which lives as inline styles on the editor\n// root — for this whole teleported subtree. Re-applying `themeStyles` here is\n// what restores it, and doing it on the backdrop covers every dialog rendered\n// through this wrapper rather than each one remembering to. `data-tpl-theme`\n// does the same job for the dark token block. See the invariant in\n// `tests/theme-token-scope.test.ts` (issue #487).\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst popoverRoot = usePopoverRoot();\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") {\n emit(\"close\");\n }\n emit(\"keydown\", event);\n}\n</script>\n\n<template>\n <Teleport v-if=\"popoverRoot\" :to=\"popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition tpl:duration-100\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <!-- The backdrop is the reference box every slotted panel caps against,\n which is why it owns the gutter (`p-4`) rather than each panel\n carrying its own margin. `inset-0` gives it a definite height; the\n wrapper below spans that height so a panel's percentage cap\n (`max-h-[90%]` / `max-h-[80%]`) has an unbroken chain to resolve\n through. Those numbers are the `vh` values they replaced, so an\n untrapped editor renders exactly as before.\n\n Panels must never cap in `vh`. `fixed` covers the viewport only while\n nothing traps it, and an ancestor with `transform`, `filter`,\n `backdrop-filter`, `will-change: transform`, `contain: paint`,\n `container-type` or a transform animation becomes the containing\n block for fixed descendants. The editor is embedded in someone\n else's page, so any of those can sit above it: `inset-0` then\n resolves to that ancestor's box while a `vh` cap still resolves to\n the viewport, and the panel overflows a container that usually also\n has `overflow: hidden`. That is issue #575 — in a 420px host inside a\n 720px viewport, a 648px panel clipped ~113px off both the top and the\n bottom, with no scrollbar to reach the buttons. Capping against the\n backdrop is self-correcting whether or not the trap is present.\n Locked by `tests/overlay-height-scope.test.ts`.\n\n The padding belongs here and not on the wrapper: preflight is\n omitted, so non-form elements keep `content-box` and padding on an\n `h-full` element would add to 100% and overflow by exactly the\n padding (the trap behind issue #115). The backdrop is `h-full` too,\n through the bare `tpl` class, so it is `box-border`: the gutter then\n shrinks its content box instead of making it 32px taller than the\n box it covers. -->\n <!-- `z-10` is the one z-index inside `.tpl-popover-root` that has to be\n real. The root is a single stacking context, so its residents\n otherwise paint in teleport-anchor order — and this modal's anchor is\n established when the editor mounts, while a link dialog's is\n established later, when a paragraph enters edit mode. Without a\n number, a picker opened FROM that dialog renders behind it. Any\n positive value beats the `auto` siblings; 10 stays far below the\n suggestion popup (9999) and `SmallScreenNotice` (10001), and cannot\n escape the root's own 10000 either way. -->\n <div\n v-if=\"visible\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl tpl:fixed tpl:inset-0 tpl:z-10 tpl:box-border tpl:flex tpl:items-center tpl:justify-center tpl:p-4\"\n style=\"\n background-color: var(--tpl-overlay);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n \"\n :style=\"themeStyles\"\n @click.self=\"emit('close')\"\n @keydown=\"handleKeydown\"\n >\n <!-- `h-full` only, deliberately no `w-full`: height is what has to\n become definite, and widening this element would change what\n `w-full` on a panel resolves against. Panels are shrink-to-fit\n horizontally — the test-email dialog stays compact until its\n preview opens, and the saved-blocks browser pins an explicit width\n precisely because this wrapper is shrink-to-fit. Constraining one\n axis leaves all of that intact.\n\n It repeats `@click.self` because it now covers the backdrop's full\n height: clicks in the gap above or below the panel land here, so\n without it click-outside-to-close would only work on the padding\n ring and the columns either side. -->\n <div\n ref=\"dialogRef\"\n class=\"tpl:flex tpl:h-full tpl:items-center tpl:justify-center\"\n @click.self=\"emit('close')\"\n >\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;EAMA,IAAMqC,IAAQC,GAIRC,IAAOH,GAKPI,IAAYZ,EAAwB,IAAI,GACxCa,IAAYC,QAAeL,EAAM,OAAO;EAC9C,EAAaG,GAAWC,CAAS;EAEjC,IAAME,IAAa1B,EAAOc,CAAY,GAWhCa,IAAc3B,EAAOa,GAAkB,IAAI,GAC3Ce,IAAcZ,EAAe;EAEnC,SAASa,EAAc,GAA4B;GAIjD,AAHIC,EAAM,QAAQ,YAChBR,EAAK,OAAO,GAEdA,EAAK,WAAWQ,CAAK;EACvB;E,iBAIkB/C,EAAA6C,CAAA,KAAhB5C,EAAA,GAAAC,EAiFWC,GAAA;;GAjFmB,IAAIH,EAAA6C,CAAA;E,IAChCzC,EA+EaC,GAAA;GA9EX,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;;GAwCf,SAAAC,QAgCM,CA/BEgC,EAAA,WADRrC,EAAA,GAAAM,EAgCM,OAAA;;IA9BH,kBAAgBP,EAAA2C,CAAA;IACjB,OAAM;IACN,OAICnC,EAAA,CAJD;KAAA,oBAAA;KAAA,mBAAA;KAAA,2BAAA;IAAA,GAKQR,EAAA4C,CAAA,CAAW,CAAA;IAClB,SAAK,AAAAI,EAAA,OAAAvC,GAAA,MAAO8B,EAAI,OAAA,GAAA,CAAA,MAAA,CAAA;IAChB,WAASO;G,IAcVpC,EAMM,OAAA;IALA,SAAA;IAAJ,KAAI8B;IACJ,OAAM;IACL,SAAK,AAAAQ,EAAA,OAAAvC,GAAA,MAAO8B,EAAI,OAAA,GAAA,CAAA,MAAA,CAAA;G,IAEjB5B,EAAQsC,EAAA,QAAA,SAAA,C"}
1
+ {"version":3,"file":"TplModal-DGpGdwgf.js","names":["_unref","_openBlock","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_createElementBlock","_normalizeStyle","_withModifiers","_createElementVNode","_renderSlot","_createCommentVNode","_sfc_main","defineComponent","openBlock","withCtx","inject","renderSlot","createElementBlock","unref","Teleport","createCommentVNode","createBlock","withModifiers","createBaseVNode","Transition","normalizeStyle","ref","createVNode","THEME_STYLES_KEY","UI_THEME_KEY","useFocusTrap","usePopoverRoot","_hoisted_1","TplModal_default","__emit","props","__props","emit","dialogRef","isVisible","computed","tplUiTheme","themeStyles","popoverRoot","handleKeydown","event","_cache","_ctx"],"sources":["../../../src/components/TplModal.vue","../../../src/components/TplModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useFocusTrap } from \"../composables\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport { computed, inject, ref } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"keydown\", event: KeyboardEvent): void;\n}>();\n\nconst dialogRef = ref<HTMLElement | null>(null);\nconst isVisible = computed(() => props.visible);\nuseFocusTrap(dialogRef, isVisible);\n\nconst tplUiTheme = inject(UI_THEME_KEY);\n\n// The backdrop below carries the bare `tpl` class, which re-declares every\n// `--tpl-*` token from the base `.tpl` rule. A custom property declared on an\n// element beats one inherited from an ancestor, so that re-declaration shadows\n// the consumer's `theme` config — which lives as inline styles on the editor\n// root — for this whole teleported subtree. Re-applying `themeStyles` here is\n// what restores it, and doing it on the backdrop covers every dialog rendered\n// through this wrapper rather than each one remembering to. `data-tpl-theme`\n// does the same job for the dark token block. See the invariant in\n// `tests/theme-token-scope.test.ts` (issue #487).\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst popoverRoot = usePopoverRoot();\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") {\n emit(\"close\");\n }\n emit(\"keydown\", event);\n}\n</script>\n\n<template>\n <Teleport v-if=\"popoverRoot\" :to=\"popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition tpl:duration-100\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <!-- The backdrop is the reference box every slotted panel caps against,\n which is why it owns the gutter (`p-4`) rather than each panel\n carrying its own margin. `inset-0` gives it a definite height; the\n wrapper below spans that height so a panel's percentage cap\n (`max-h-[90%]` / `max-h-[80%]`) has an unbroken chain to resolve\n through. Those numbers are the `vh` values they replaced, so an\n untrapped editor renders exactly as before.\n\n Panels must never cap in `vh`. `fixed` covers the viewport only while\n nothing traps it, and an ancestor with `transform`, `filter`,\n `backdrop-filter`, `will-change: transform`, `contain: paint`,\n `container-type` or a transform animation becomes the containing\n block for fixed descendants. The editor is embedded in someone\n else's page, so any of those can sit above it: `inset-0` then\n resolves to that ancestor's box while a `vh` cap still resolves to\n the viewport, and the panel overflows a container that usually also\n has `overflow: hidden`. That is issue #575 — in a 420px host inside a\n 720px viewport, a 648px panel clipped ~113px off both the top and the\n bottom, with no scrollbar to reach the buttons. Capping against the\n backdrop is self-correcting whether or not the trap is present.\n Locked by `tests/overlay-height-scope.test.ts`.\n\n The padding belongs here and not on the wrapper: preflight is\n omitted, so non-form elements keep `content-box` and padding on an\n `h-full` element would add to 100% and overflow by exactly the\n padding (the trap behind issue #115). The backdrop is `h-full` too,\n through the bare `tpl` class, so it is `box-border`: the gutter then\n shrinks its content box instead of making it 32px taller than the\n box it covers. -->\n <!-- `z-10` is the one z-index inside `.tpl-popover-root` that has to be\n real. The root is a single stacking context, so its residents\n otherwise paint in teleport-anchor order — and this modal's anchor is\n established when the editor mounts, while a link dialog's is\n established later, when a paragraph enters edit mode. Without a\n number, a picker opened FROM that dialog renders behind it. Any\n positive value beats the `auto` siblings; 10 stays far below the\n suggestion popup (9999) and `SmallScreenNotice` (10001), and cannot\n escape the root's own 10000 either way. -->\n <div\n v-if=\"visible\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl tpl:fixed tpl:inset-0 tpl:z-10 tpl:box-border tpl:flex tpl:items-center tpl:justify-center tpl:p-4\"\n style=\"\n background-color: var(--tpl-overlay);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n \"\n :style=\"themeStyles\"\n @click.self=\"emit('close')\"\n @keydown=\"handleKeydown\"\n >\n <!-- `h-full` only, deliberately no `w-full`: height is what has to\n become definite, and widening this element would change what\n `w-full` on a panel resolves against. Panels are shrink-to-fit\n horizontally — the test-email dialog stays compact until its\n preview opens, and the saved-blocks browser pins an explicit width\n precisely because this wrapper is shrink-to-fit. Constraining one\n axis leaves all of that intact.\n\n It repeats `@click.self` because it now covers the backdrop's full\n height: clicks in the gap above or below the panel land here, so\n without it click-outside-to-close would only work on the padding\n ring and the columns either side. -->\n <div\n ref=\"dialogRef\"\n class=\"tpl:flex tpl:h-full tpl:items-center tpl:justify-center\"\n @click.self=\"emit('close')\"\n >\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { useFocusTrap } from \"../composables\";\nimport { usePopoverRoot } from \"../composables/usePopoverRoot\";\nimport { THEME_STYLES_KEY, UI_THEME_KEY } from \"../keys\";\nimport { computed, inject, ref } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"keydown\", event: KeyboardEvent): void;\n}>();\n\nconst dialogRef = ref<HTMLElement | null>(null);\nconst isVisible = computed(() => props.visible);\nuseFocusTrap(dialogRef, isVisible);\n\nconst tplUiTheme = inject(UI_THEME_KEY);\n\n// The backdrop below carries the bare `tpl` class, which re-declares every\n// `--tpl-*` token from the base `.tpl` rule. A custom property declared on an\n// element beats one inherited from an ancestor, so that re-declaration shadows\n// the consumer's `theme` config — which lives as inline styles on the editor\n// root — for this whole teleported subtree. Re-applying `themeStyles` here is\n// what restores it, and doing it on the backdrop covers every dialog rendered\n// through this wrapper rather than each one remembering to. `data-tpl-theme`\n// does the same job for the dark token block. See the invariant in\n// `tests/theme-token-scope.test.ts` (issue #487).\nconst themeStyles = inject(THEME_STYLES_KEY, null);\nconst popoverRoot = usePopoverRoot();\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") {\n emit(\"close\");\n }\n emit(\"keydown\", event);\n}\n</script>\n\n<template>\n <Teleport v-if=\"popoverRoot\" :to=\"popoverRoot\">\n <Transition\n enter-active-class=\"tpl:transition\"\n enter-from-class=\"tpl:opacity-0\"\n enter-to-class=\"tpl:opacity-100\"\n leave-active-class=\"tpl:transition tpl:duration-100\"\n leave-from-class=\"tpl:opacity-100\"\n leave-to-class=\"tpl:opacity-0\"\n >\n <!-- The backdrop is the reference box every slotted panel caps against,\n which is why it owns the gutter (`p-4`) rather than each panel\n carrying its own margin. `inset-0` gives it a definite height; the\n wrapper below spans that height so a panel's percentage cap\n (`max-h-[90%]` / `max-h-[80%]`) has an unbroken chain to resolve\n through. Those numbers are the `vh` values they replaced, so an\n untrapped editor renders exactly as before.\n\n Panels must never cap in `vh`. `fixed` covers the viewport only while\n nothing traps it, and an ancestor with `transform`, `filter`,\n `backdrop-filter`, `will-change: transform`, `contain: paint`,\n `container-type` or a transform animation becomes the containing\n block for fixed descendants. The editor is embedded in someone\n else's page, so any of those can sit above it: `inset-0` then\n resolves to that ancestor's box while a `vh` cap still resolves to\n the viewport, and the panel overflows a container that usually also\n has `overflow: hidden`. That is issue #575 — in a 420px host inside a\n 720px viewport, a 648px panel clipped ~113px off both the top and the\n bottom, with no scrollbar to reach the buttons. Capping against the\n backdrop is self-correcting whether or not the trap is present.\n Locked by `tests/overlay-height-scope.test.ts`.\n\n The padding belongs here and not on the wrapper: preflight is\n omitted, so non-form elements keep `content-box` and padding on an\n `h-full` element would add to 100% and overflow by exactly the\n padding (the trap behind issue #115). The backdrop is `h-full` too,\n through the bare `tpl` class, so it is `box-border`: the gutter then\n shrinks its content box instead of making it 32px taller than the\n box it covers. -->\n <!-- `z-10` is the one z-index inside `.tpl-popover-root` that has to be\n real. The root is a single stacking context, so its residents\n otherwise paint in teleport-anchor order — and this modal's anchor is\n established when the editor mounts, while a link dialog's is\n established later, when a paragraph enters edit mode. Without a\n number, a picker opened FROM that dialog renders behind it. Any\n positive value beats the `auto` siblings; 10 stays far below the\n suggestion popup (9999) and `SmallScreenNotice` (10001), and cannot\n escape the root's own 10000 either way. -->\n <div\n v-if=\"visible\"\n :data-tpl-theme=\"tplUiTheme\"\n class=\"tpl tpl:fixed tpl:inset-0 tpl:z-10 tpl:box-border tpl:flex tpl:items-center tpl:justify-center tpl:p-4\"\n style=\"\n background-color: var(--tpl-overlay);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n \"\n :style=\"themeStyles\"\n @click.self=\"emit('close')\"\n @keydown=\"handleKeydown\"\n >\n <!-- `h-full` only, deliberately no `w-full`: height is what has to\n become definite, and widening this element would change what\n `w-full` on a panel resolves against. Panels are shrink-to-fit\n horizontally — the test-email dialog stays compact until its\n preview opens, and the saved-blocks browser pins an explicit width\n precisely because this wrapper is shrink-to-fit. Constraining one\n axis leaves all of that intact.\n\n It repeats `@click.self` because it now covers the backdrop's full\n height: clicks in the gap above or below the panel land here, so\n without it click-outside-to-close would only work on the padding\n ring and the columns either side. -->\n <div\n ref=\"dialogRef\"\n class=\"tpl:flex tpl:h-full tpl:items-center tpl:justify-center\"\n @click.self=\"emit('close')\"\n >\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;EAMA,IAAMqC,IAAQC,GAIRC,IAAOH,GAKPI,IAAYZ,EAAwB,IAAI,GACxCa,IAAYC,QAAeL,EAAM,OAAO;EAC9C,EAAaG,GAAWC,CAAS;EAEjC,IAAME,IAAa1B,EAAOc,CAAY,GAWhCa,IAAc3B,EAAOa,GAAkB,IAAI,GAC3Ce,IAAcZ,EAAe;EAEnC,SAASa,EAAc,GAA4B;GAIjD,AAHIC,EAAM,QAAQ,YAChBR,EAAK,OAAO,GAEdA,EAAK,WAAWQ,CAAK;EACvB;E,iBAIkB/C,EAAA6C,CAAA,KAAhB5C,EAAA,GAAAC,EAiFWC,GAAA;;GAjFmB,IAAIH,EAAA6C,CAAA;E,IAChCzC,EA+EaC,GAAA;GA9EX,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;;GAwCf,SAAAC,QAgCM,CA/BEgC,EAAA,WADRrC,EAAA,GAAAM,EAgCM,OAAA;;IA9BH,kBAAgBP,EAAA2C,CAAA;IACjB,OAAM;IACN,OAICnC,EAAA,CAJD;KAAA,oBAAA;KAAA,mBAAA;KAAA,2BAAA;IAAA,GAKQR,EAAA4C,CAAA,CAAW,CAAA;IAClB,SAAK,AAAAI,EAAA,OAAAvC,GAAA,MAAO8B,EAAI,OAAA,GAAA,CAAA,MAAA,CAAA;IAChB,WAASO;G,IAcVpC,EAMM,OAAA;IALA,SAAA;IAAJ,KAAI8B;IACJ,OAAM;IACL,SAAK,AAAAQ,EAAA,OAAAvC,GAAA,MAAO8B,EAAI,OAAA,GAAA,CAAA,MAAA,CAAA;G,IAEjB5B,EAAQsC,EAAA,QAAA,SAAA,C"}
@@ -4,7 +4,7 @@ var c = /* @__PURE__ */ e({
4
4
  __name: "VersionHistoryPanels",
5
5
  props: { feature: {} },
6
6
  setup(e) {
7
- let c = e, l = n(() => import("./VersionPreviewBanner-C4Ji8nu4.js")), u = n(() => import("./RestoreVersionDialog-DfNrVi0R.js"));
7
+ let c = e, l = n(() => import("./VersionPreviewBanner-C4Ji8nu4.js")), u = n(() => import("./RestoreVersionDialog-7MFZz-Sb.js"));
8
8
  async function d() {
9
9
  try {
10
10
  await c.feature.requestRestore();
@@ -43,4 +43,4 @@ var c = /* @__PURE__ */ e({
43
43
  });
44
44
  export { c as default };
45
45
 
46
- //# sourceMappingURL=VersionHistoryPanels-DJDeaf1B.js.map
46
+ //# sourceMappingURL=VersionHistoryPanels-BJnHCMAH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VersionHistoryPanels-DJDeaf1B.js","names":["_openBlock","_createElementBlock","_Fragment","_createBlock","_unref","_createCommentVNode","_sfc_main","defineComponent","openBlock","defineAsyncComponent","createElementBlock","unref","createCommentVNode","createBlock","Fragment","VersionHistoryPanels_default","props","__props","VersionPreviewBanner","RestoreVersionDialog","handleRequestRestore","handleSaveAndRestore","handleDiscardAndRestore","_cache"],"sources":["../../../src/components/VersionHistoryPanels.vue","../../../src/components/VersionHistoryPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Mount point for the version-history chrome that sits outside the header,\n * shared by the OSS and Cloud editors.\n *\n * Same shape as `SavedBlocksPanels.vue` / `TestEmailPanel.vue`: everything here\n * is `defineAsyncComponent` behind a `v-if` on its own state, and the editors in\n * turn lazy-load *this* wrapper and render it only when a\n * `VersionHistoryProvider` is configured — so a consumer without one downloads\n * none of it.\n *\n * The header's dropdown control is not here for one reason only: it has to sit\n * in the header's centre column. It is lazily imported at those two sites\n * instead, and covered by the same CDN chunk guard.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseVersionHistoryFeatureReturn } from \"../composables/useVersionHistoryFeature\";\n\nconst props = defineProps<{\n feature: UseVersionHistoryFeatureReturn;\n}>();\n\nconst VersionPreviewBanner = defineAsyncComponent(\n () => import(\"./VersionPreviewBanner.vue\"),\n);\n// Its own chunk, fetched only if a restore is attempted with unsaved work —\n// which for a Cloud session (autosave on) is the uncommon case.\nconst RestoreVersionDialog = defineAsyncComponent(\n () => import(\"./RestoreVersionDialog.vue\"),\n);\n\n/**\n * Every action here swallows its rejection: the feature already reported it\n * through `onError` and rolled the canvas back, and an unhandled rejection out\n * of a DOM event binding helps nobody.\n */\nasync function handleRequestRestore(): Promise<void> {\n try {\n await props.feature.requestRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleSaveAndRestore(): Promise<void> {\n try {\n await props.feature.saveAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleDiscardAndRestore(): Promise<void> {\n try {\n await props.feature.discardAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n</script>\n\n<template>\n <VersionPreviewBanner\n v-if=\"feature.isPreviewing.value\"\n :visible=\"feature.isPreviewing.value\"\n :can-restore=\"feature.canRestore.value\"\n @cancel=\"feature.cancelPreview()\"\n @confirm=\"handleRequestRestore\"\n />\n\n <RestoreVersionDialog\n v-if=\"feature.isConfirmingRestore.value\"\n :visible=\"feature.isConfirmingRestore.value\"\n :can-save=\"feature.canSaveBeforeRestore.value\"\n :is-busy=\"feature.isConfirmBusy.value\"\n @cancel=\"feature.cancelRestoreConfirm()\"\n @save-and-restore=\"handleSaveAndRestore\"\n @discard-and-restore=\"handleDiscardAndRestore\"\n />\n</template>\n","<script setup lang=\"ts\">\n/**\n * Mount point for the version-history chrome that sits outside the header,\n * shared by the OSS and Cloud editors.\n *\n * Same shape as `SavedBlocksPanels.vue` / `TestEmailPanel.vue`: everything here\n * is `defineAsyncComponent` behind a `v-if` on its own state, and the editors in\n * turn lazy-load *this* wrapper and render it only when a\n * `VersionHistoryProvider` is configured — so a consumer without one downloads\n * none of it.\n *\n * The header's dropdown control is not here for one reason only: it has to sit\n * in the header's centre column. It is lazily imported at those two sites\n * instead, and covered by the same CDN chunk guard.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseVersionHistoryFeatureReturn } from \"../composables/useVersionHistoryFeature\";\n\nconst props = defineProps<{\n feature: UseVersionHistoryFeatureReturn;\n}>();\n\nconst VersionPreviewBanner = defineAsyncComponent(\n () => import(\"./VersionPreviewBanner.vue\"),\n);\n// Its own chunk, fetched only if a restore is attempted with unsaved work —\n// which for a Cloud session (autosave on) is the uncommon case.\nconst RestoreVersionDialog = defineAsyncComponent(\n () => import(\"./RestoreVersionDialog.vue\"),\n);\n\n/**\n * Every action here swallows its rejection: the feature already reported it\n * through `onError` and rolled the canvas back, and an unhandled rejection out\n * of a DOM event binding helps nobody.\n */\nasync function handleRequestRestore(): Promise<void> {\n try {\n await props.feature.requestRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleSaveAndRestore(): Promise<void> {\n try {\n await props.feature.saveAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleDiscardAndRestore(): Promise<void> {\n try {\n await props.feature.discardAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n</script>\n\n<template>\n <VersionPreviewBanner\n v-if=\"feature.isPreviewing.value\"\n :visible=\"feature.isPreviewing.value\"\n :can-restore=\"feature.canRestore.value\"\n @cancel=\"feature.cancelPreview()\"\n @confirm=\"handleRequestRestore\"\n />\n\n <RestoreVersionDialog\n v-if=\"feature.isConfirmingRestore.value\"\n :visible=\"feature.isConfirmingRestore.value\"\n :can-save=\"feature.canSaveBeforeRestore.value\"\n :is-busy=\"feature.isConfirmBusy.value\"\n @cancel=\"feature.cancelRestoreConfirm()\"\n @save-and-restore=\"handleSaveAndRestore\"\n @discard-and-restore=\"handleDiscardAndRestore\"\n />\n</template>\n"],"mappings":";;;;;;EAkBA,IAAMgB,IAAQC,GAIRC,IAAuBT,QACrB,OAAO,qCACf,GAGMU,IAAuBV,QACrB,OAAO,qCACf;EAOA,eAAeW,IAAsC;GACnD,IAAI;IACF,MAAMJ,EAAM,QAAQ,eAAe;GACrC,QAAQ,CAER;EACF;EAEA,eAAeK,IAAsC;GACnD,IAAI;IACF,MAAML,EAAM,QAAQ,eAAe;GACrC,QAAQ,CAER;EACF;EAEA,eAAeM,IAAyC;GACtD,IAAI;IACF,MAAMN,EAAM,QAAQ,kBAAkB;GACxC,QAAQ,CAER;EACF;E,mCAKUC,EAAA,QAAQ,aAAa,SAD7BjB,EAAA,GAAAG,EAMEC,EAAAc,CAAA,GAAA;;GAJC,SAASD,EAAA,QAAQ,aAAa;GAC9B,eAAaA,EAAA,QAAQ,WAAW;GAChC,UAAM,AAAAM,EAAA,QAAA,MAAEN,EAAA,QAAQ,cAAa;GAC7B,WAASG;E,sDAIJH,EAAA,QAAQ,oBAAoB,SADpCjB,EAAA,GAAAG,EAQEC,EAAAe,CAAA,GAAA;;GANC,SAASF,EAAA,QAAQ,oBAAoB;GACrC,YAAUA,EAAA,QAAQ,qBAAqB;GACvC,WAASA,EAAA,QAAQ,cAAc;GAC/B,UAAM,AAAAM,EAAA,QAAA,MAAEN,EAAA,QAAQ,qBAAoB;GACpC,kBAAkBI;GAClB,qBAAqBC"}
1
+ {"version":3,"file":"VersionHistoryPanels-BJnHCMAH.js","names":["_openBlock","_createElementBlock","_Fragment","_createBlock","_unref","_createCommentVNode","_sfc_main","defineComponent","openBlock","defineAsyncComponent","createElementBlock","unref","createCommentVNode","createBlock","Fragment","VersionHistoryPanels_default","props","__props","VersionPreviewBanner","RestoreVersionDialog","handleRequestRestore","handleSaveAndRestore","handleDiscardAndRestore","_cache"],"sources":["../../../src/components/VersionHistoryPanels.vue","../../../src/components/VersionHistoryPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Mount point for the version-history chrome that sits outside the header,\n * shared by the OSS and Cloud editors.\n *\n * Same shape as `SavedBlocksPanels.vue` / `TestEmailPanel.vue`: everything here\n * is `defineAsyncComponent` behind a `v-if` on its own state, and the editors in\n * turn lazy-load *this* wrapper and render it only when a\n * `VersionHistoryProvider` is configured — so a consumer without one downloads\n * none of it.\n *\n * The header's dropdown control is not here for one reason only: it has to sit\n * in the header's centre column. It is lazily imported at those two sites\n * instead, and covered by the same CDN chunk guard.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseVersionHistoryFeatureReturn } from \"../composables/useVersionHistoryFeature\";\n\nconst props = defineProps<{\n feature: UseVersionHistoryFeatureReturn;\n}>();\n\nconst VersionPreviewBanner = defineAsyncComponent(\n () => import(\"./VersionPreviewBanner.vue\"),\n);\n// Its own chunk, fetched only if a restore is attempted with unsaved work —\n// which for a Cloud session (autosave on) is the uncommon case.\nconst RestoreVersionDialog = defineAsyncComponent(\n () => import(\"./RestoreVersionDialog.vue\"),\n);\n\n/**\n * Every action here swallows its rejection: the feature already reported it\n * through `onError` and rolled the canvas back, and an unhandled rejection out\n * of a DOM event binding helps nobody.\n */\nasync function handleRequestRestore(): Promise<void> {\n try {\n await props.feature.requestRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleSaveAndRestore(): Promise<void> {\n try {\n await props.feature.saveAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleDiscardAndRestore(): Promise<void> {\n try {\n await props.feature.discardAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n</script>\n\n<template>\n <VersionPreviewBanner\n v-if=\"feature.isPreviewing.value\"\n :visible=\"feature.isPreviewing.value\"\n :can-restore=\"feature.canRestore.value\"\n @cancel=\"feature.cancelPreview()\"\n @confirm=\"handleRequestRestore\"\n />\n\n <RestoreVersionDialog\n v-if=\"feature.isConfirmingRestore.value\"\n :visible=\"feature.isConfirmingRestore.value\"\n :can-save=\"feature.canSaveBeforeRestore.value\"\n :is-busy=\"feature.isConfirmBusy.value\"\n @cancel=\"feature.cancelRestoreConfirm()\"\n @save-and-restore=\"handleSaveAndRestore\"\n @discard-and-restore=\"handleDiscardAndRestore\"\n />\n</template>\n","<script setup lang=\"ts\">\n/**\n * Mount point for the version-history chrome that sits outside the header,\n * shared by the OSS and Cloud editors.\n *\n * Same shape as `SavedBlocksPanels.vue` / `TestEmailPanel.vue`: everything here\n * is `defineAsyncComponent` behind a `v-if` on its own state, and the editors in\n * turn lazy-load *this* wrapper and render it only when a\n * `VersionHistoryProvider` is configured — so a consumer without one downloads\n * none of it.\n *\n * The header's dropdown control is not here for one reason only: it has to sit\n * in the header's centre column. It is lazily imported at those two sites\n * instead, and covered by the same CDN chunk guard.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { UseVersionHistoryFeatureReturn } from \"../composables/useVersionHistoryFeature\";\n\nconst props = defineProps<{\n feature: UseVersionHistoryFeatureReturn;\n}>();\n\nconst VersionPreviewBanner = defineAsyncComponent(\n () => import(\"./VersionPreviewBanner.vue\"),\n);\n// Its own chunk, fetched only if a restore is attempted with unsaved work —\n// which for a Cloud session (autosave on) is the uncommon case.\nconst RestoreVersionDialog = defineAsyncComponent(\n () => import(\"./RestoreVersionDialog.vue\"),\n);\n\n/**\n * Every action here swallows its rejection: the feature already reported it\n * through `onError` and rolled the canvas back, and an unhandled rejection out\n * of a DOM event binding helps nobody.\n */\nasync function handleRequestRestore(): Promise<void> {\n try {\n await props.feature.requestRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleSaveAndRestore(): Promise<void> {\n try {\n await props.feature.saveAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n\nasync function handleDiscardAndRestore(): Promise<void> {\n try {\n await props.feature.discardAndRestore();\n } catch {\n /* reported through onError */\n }\n}\n</script>\n\n<template>\n <VersionPreviewBanner\n v-if=\"feature.isPreviewing.value\"\n :visible=\"feature.isPreviewing.value\"\n :can-restore=\"feature.canRestore.value\"\n @cancel=\"feature.cancelPreview()\"\n @confirm=\"handleRequestRestore\"\n />\n\n <RestoreVersionDialog\n v-if=\"feature.isConfirmingRestore.value\"\n :visible=\"feature.isConfirmingRestore.value\"\n :can-save=\"feature.canSaveBeforeRestore.value\"\n :is-busy=\"feature.isConfirmBusy.value\"\n @cancel=\"feature.cancelRestoreConfirm()\"\n @save-and-restore=\"handleSaveAndRestore\"\n @discard-and-restore=\"handleDiscardAndRestore\"\n />\n</template>\n"],"mappings":";;;;;;EAkBA,IAAMgB,IAAQC,GAIRC,IAAuBT,QACrB,OAAO,qCACf,GAGMU,IAAuBV,QACrB,OAAO,qCACf;EAOA,eAAeW,IAAsC;GACnD,IAAI;IACF,MAAMJ,EAAM,QAAQ,eAAe;GACrC,QAAQ,CAER;EACF;EAEA,eAAeK,IAAsC;GACnD,IAAI;IACF,MAAML,EAAM,QAAQ,eAAe;GACrC,QAAQ,CAER;EACF;EAEA,eAAeM,IAAyC;GACtD,IAAI;IACF,MAAMN,EAAM,QAAQ,kBAAkB;GACxC,QAAQ,CAER;EACF;E,mCAKUC,EAAA,QAAQ,aAAa,SAD7BjB,EAAA,GAAAG,EAMEC,EAAAc,CAAA,GAAA;;GAJC,SAASD,EAAA,QAAQ,aAAa;GAC9B,eAAaA,EAAA,QAAQ,WAAW;GAChC,UAAM,AAAAM,EAAA,QAAA,MAAEN,EAAA,QAAQ,cAAa;GAC7B,WAASG;E,sDAIJH,EAAA,QAAQ,oBAAoB,SADpCjB,EAAA,GAAAG,EAQEC,EAAAe,CAAA,GAAA;;GANC,SAASF,EAAA,QAAQ,oBAAoB;GACrC,YAAUA,EAAA,QAAQ,qBAAqB;GACvC,WAASA,EAAA,QAAQ,cAAc;GAC/B,UAAM,AAAAM,EAAA,QAAA,MAAEN,EAAA,QAAQ,qBAAoB;GACpC,kBAAkBI;GAClB,qBAAqBC"}
@@ -1,8 +1,8 @@
1
1
  import { B as e, C as t, F as n, H as r, L as i, O as a, _ as o, ct as s, dt as c, h as l, p as u, pt as d, u as f } from "./draggable-DepKdldn.js";
2
- import { n as p } from "./src-BQUv2CYU.js";
3
- import { S as m, o as h, w as g } from "./socialIcons-DeCYorUT.js";
2
+ import { n as p } from "./src-ZFw5fg_z.js";
3
+ import { S as m, o as h, w as g } from "./socialIcons-DPwkrn5v.js";
4
4
  import { B as _, C as v, T as y, l as b, v as x } from "./keys-CoQtCqNv.js";
5
- import { C as S, E as C, T as w, x as T } from "./composables-Jc3uZuLs.js";
5
+ import { C as S, E as C, T as w, x as T } from "./composables-BxikPuC1.js";
6
6
  // src/components/blocks/WrapperBlock.vue?vue&type=script&setup=true&lang.ts
7
7
  var E = ["data-block-id"], D = /* @__PURE__ */ t({
8
8
  name: "WrapperBlock",
@@ -43,4 +43,4 @@ var E = ["data-block-id"], D = /* @__PURE__ */ t({
43
43
  });
44
44
  export { D as t };
45
45
 
46
- //# sourceMappingURL=WrapperBlock-DRJnrgy-.js.map
46
+ //# sourceMappingURL=WrapperBlock-C_uE5rPJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WrapperBlock-DRJnrgy-.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_normalizeStyle","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_sfc_main","resolveDynamicComponent","defineComponent","openBlock","watch","renderList","inject","createElementBlock","unref","normalizeClass","createBlock","computed","normalizeStyle","Fragment","SYNTAX_PRESETS","getBackgroundLookupUrl","matchImageBoxWidth","useResolvedBackgroundUrl","MERGE_TAG_SYNTAX_KEY","IMAGE_URL_RESOLVER_KEY","LAYOUT_KEY","BLOCK_REGISTRY_KEY","EDITOR_KEY","getCachedBlockWrapperStyle","resolveBlockComponent","getWrapperStyle","backgroundImageHostClass","_hoisted_1","WrapperBlock_default","props","__props","blockRegistry","imageUrlResolver","syntax","editor","layout","bandBackgroundUrl","wrapperStyle","childBackgroundUrls","url","child","urls","childBoxes","getBlockComponent","block","style"],"sources":["../../../src/components/blocks/WrapperBlock.vue","../../../src/components/blocks/WrapperBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n backgroundImageHostClass,\n getCachedBlockWrapperStyle,\n getWrapperStyle,\n resolveBlockComponent,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n ViewportSize,\n WrapperBlock as WrapperBlockType,\n} from \"@templatical/types\";\nimport { SYNTAX_PRESETS } from \"@templatical/types\";\nimport { computed, inject, watch } from \"vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n EDITOR_KEY,\n IMAGE_URL_RESOLVER_KEY,\n LAYOUT_KEY,\n MERGE_TAG_SYNTAX_KEY,\n} from \"../../keys\";\nimport { matchImageBoxWidth } from \"../../utils/imageRoom\";\nimport {\n getBackgroundLookupUrl,\n useResolvedBackgroundUrl,\n} from \"../../composables/useImageUrlResolver\";\n\ndefineOptions({ name: \"WrapperBlock\" });\n\nconst props = defineProps<{\n block: WrapperBlockType;\n viewport: ViewportSize;\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst editor = inject(EDITOR_KEY, null);\nconst layout = inject(LAYOUT_KEY, undefined);\n\nconst bandBackgroundUrl = useResolvedBackgroundUrl(\n () => props.block.backgroundImage,\n);\n\nconst wrapperStyle = computed(\n () =>\n getWrapperStyle(props.block, {\n backgroundImageUrl: bandBackgroundUrl.value,\n }) ?? {},\n);\n\n// A child section sits in a plain box here, not a BlockWrapper, so nothing else\n// resolves its background image. The lookups start from this band; each box\n// then paints the cached result (`getCachedBlockWrapperStyle`). Layout content\n// is configuration rather than typed input, so there is no debounce.\nconst childBackgroundUrls = computed(() =>\n props.block.children.flatMap((child) => {\n const url =\n child.type === \"section\"\n ? getBackgroundLookupUrl(child.backgroundImage, syntax)\n : undefined;\n return url ? [url] : [];\n }),\n);\nif (imageUrlResolver) {\n watch(\n childBackgroundUrls,\n (urls) => {\n for (const url of urls) imageUrlResolver.lookup(url);\n },\n { immediate: true },\n );\n}\n\nconst childBoxes = computed(() =>\n props.block.children.map((child) => ({\n child,\n style: getCachedBlockWrapperStyle(\n child,\n imageUrlResolver,\n syntax,\n matchImageBoxWidth(\n child,\n editor?.content.value,\n layout,\n editor?.activeLocale?.value ?? undefined,\n ),\n ),\n })),\n);\n\nfunction getBlockComponent(block: Block) {\n // Children resolve through the registry (title, section, …). No local\n // fallback map: a Canvas import of PreviewSectionBlock (or a preview import\n // of SectionBlock) would pull the other surface's tree into this band.\n return resolveBlockComponent(block, blockRegistry, {});\n}\n</script>\n\n<template>\n <div\n data-testid=\"layout-wrapper\"\n class=\"tpl-email-surface tpl:w-full\"\n :style=\"wrapperStyle\"\n :class=\"backgroundImageHostClass(wrapperStyle)\"\n >\n <div\n v-for=\"{ child, style } in childBoxes\"\n :key=\"child.id\"\n :data-block-id=\"child.id\"\n :style=\"style\"\n :class=\"backgroundImageHostClass(style)\"\n >\n <component\n :is=\"getBlockComponent(child)\"\n :block=\"child\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport {\n backgroundImageHostClass,\n getCachedBlockWrapperStyle,\n getWrapperStyle,\n resolveBlockComponent,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n ViewportSize,\n WrapperBlock as WrapperBlockType,\n} from \"@templatical/types\";\nimport { SYNTAX_PRESETS } from \"@templatical/types\";\nimport { computed, inject, watch } from \"vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n EDITOR_KEY,\n IMAGE_URL_RESOLVER_KEY,\n LAYOUT_KEY,\n MERGE_TAG_SYNTAX_KEY,\n} from \"../../keys\";\nimport { matchImageBoxWidth } from \"../../utils/imageRoom\";\nimport {\n getBackgroundLookupUrl,\n useResolvedBackgroundUrl,\n} from \"../../composables/useImageUrlResolver\";\n\ndefineOptions({ name: \"WrapperBlock\" });\n\nconst props = defineProps<{\n block: WrapperBlockType;\n viewport: ViewportSize;\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst editor = inject(EDITOR_KEY, null);\nconst layout = inject(LAYOUT_KEY, undefined);\n\nconst bandBackgroundUrl = useResolvedBackgroundUrl(\n () => props.block.backgroundImage,\n);\n\nconst wrapperStyle = computed(\n () =>\n getWrapperStyle(props.block, {\n backgroundImageUrl: bandBackgroundUrl.value,\n }) ?? {},\n);\n\n// A child section sits in a plain box here, not a BlockWrapper, so nothing else\n// resolves its background image. The lookups start from this band; each box\n// then paints the cached result (`getCachedBlockWrapperStyle`). Layout content\n// is configuration rather than typed input, so there is no debounce.\nconst childBackgroundUrls = computed(() =>\n props.block.children.flatMap((child) => {\n const url =\n child.type === \"section\"\n ? getBackgroundLookupUrl(child.backgroundImage, syntax)\n : undefined;\n return url ? [url] : [];\n }),\n);\nif (imageUrlResolver) {\n watch(\n childBackgroundUrls,\n (urls) => {\n for (const url of urls) imageUrlResolver.lookup(url);\n },\n { immediate: true },\n );\n}\n\nconst childBoxes = computed(() =>\n props.block.children.map((child) => ({\n child,\n style: getCachedBlockWrapperStyle(\n child,\n imageUrlResolver,\n syntax,\n matchImageBoxWidth(\n child,\n editor?.content.value,\n layout,\n editor?.activeLocale?.value ?? undefined,\n ),\n ),\n })),\n);\n\nfunction getBlockComponent(block: Block) {\n // Children resolve through the registry (title, section, …). No local\n // fallback map: a Canvas import of PreviewSectionBlock (or a preview import\n // of SectionBlock) would pull the other surface's tree into this band.\n return resolveBlockComponent(block, blockRegistry, {});\n}\n</script>\n\n<template>\n <div\n data-testid=\"layout-wrapper\"\n class=\"tpl-email-surface tpl:w-full\"\n :style=\"wrapperStyle\"\n :class=\"backgroundImageHostClass(wrapperStyle)\"\n >\n <div\n v-for=\"{ child, style } in childBoxes\"\n :key=\"child.id\"\n :data-block-id=\"child.id\"\n :style=\"style\"\n :class=\"backgroundImageHostClass(style)\"\n >\n <component\n :is=\"getBlockComponent(child)\"\n :block=\"child\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EA6BA,IAAMsC,IAAQC,GAKRC,IAAgBzB,EAAOe,GAAoB,IAAI,GAC/CW,IAAmB1B,EAAOa,GAAwB,IAAI,GACtDc,IAAS3B,EAAOY,GAAsBJ,EAAe,MAAM,GAC3DoB,IAAS5B,EAAOgB,GAAY,IAAI,GAChCa,IAAS7B,EAAOc,GAAY,KAAA,CAAS,GAErCgB,IAAoBnB,QAClBY,EAAM,MAAM,eACpB,GAEMQ,IAAe1B,QAEjBc,EAAgBI,EAAM,OAAO,EAC3B,oBAAoBO,EAAkB,MACxC,CAAC,KAAK,CAAC,CACX,GAMME,IAAsB3B,QAC1BkB,EAAM,MAAM,SAAS,SAAS,MAAU;GACtC,IAAMU,IACJC,EAAM,SAAS,YACXzB,EAAuByB,EAAM,iBAAiBP,CAAM,IACpD,KAAA;GACN,OAAOM,IAAM,CAACA,CAAG,IAAI,CAAC;EACxB,CAAC,CACH;EACA,AAAIP,KACF5B,EACEkC,IACC,MAAS;GACR,KAAK,IAAMC,KAAOE,GAAM,EAAiB,OAAOF,CAAG;EACrD,GACA,EAAE,WAAW,GAAK,CACpB;EAGF,IAAMG,IAAa/B,QACjBkB,EAAM,MAAM,SAAS,KAAK,OAAW;GACnC;GACA,OAAON,EACLiB,GACAR,GACAC,GACAjB,EACEwB,GACAN,GAAQ,QAAQ,OAChBC,GACAD,GAAQ,cAAc,SAAS,KAAA,CACjC,CACF;EACF,EAAE,CACJ;EAEA,SAASS,EAAkB,GAAc;GAIvC,OAAOnB,EAAsBoB,GAAOb,GAAe,CAAC,CAAC;EACvD;E,kBAIExC,EAAA,GAAAC,EAmBM,OAAA;GAlBJ,eAAY;GACZ,OAAKC,EAAA,CAAC,gCAEEC,EAAAgC,CAAA,CAAwB,CAACW,EAAA,KAAY,CAAA,CAAA;GAD5C,OAAK1C,EAAE0C,EAAA,KAAY;E,KAGpB9C,EAAA,EAAA,GAAAC,EAYMI,GAAA,MAAAC,EAXuB6C,EAAA,QAAU,EAA5B,UAAO,gBADlBnD,EAAA,GAAAC,EAYM,OAAA;GAVH,KAAKgD,EAAM;GACX,iBAAeA,EAAM;GACrB,OAAK7C,EAAEkD,CAAK;GACZ,OAAKpD,EAAEC,EAAAgC,CAAA,CAAwB,CAACmB,CAAK,CAAA;E,KAEtCtD,EAAA,GAAAO,EAIEC,EAHK4C,EAAkBH,CAAK,CAAA,GAAA;GAC3B,OAAOA;GACP,UAAUV,EAAA"}
1
+ {"version":3,"file":"WrapperBlock-C_uE5rPJ.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_normalizeStyle","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_sfc_main","resolveDynamicComponent","defineComponent","openBlock","watch","renderList","inject","createElementBlock","unref","normalizeClass","createBlock","computed","normalizeStyle","Fragment","SYNTAX_PRESETS","getBackgroundLookupUrl","matchImageBoxWidth","useResolvedBackgroundUrl","MERGE_TAG_SYNTAX_KEY","IMAGE_URL_RESOLVER_KEY","LAYOUT_KEY","BLOCK_REGISTRY_KEY","EDITOR_KEY","getCachedBlockWrapperStyle","resolveBlockComponent","getWrapperStyle","backgroundImageHostClass","_hoisted_1","WrapperBlock_default","props","__props","blockRegistry","imageUrlResolver","syntax","editor","layout","bandBackgroundUrl","wrapperStyle","childBackgroundUrls","url","child","urls","childBoxes","getBlockComponent","block","style"],"sources":["../../../src/components/blocks/WrapperBlock.vue","../../../src/components/blocks/WrapperBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n backgroundImageHostClass,\n getCachedBlockWrapperStyle,\n getWrapperStyle,\n resolveBlockComponent,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n ViewportSize,\n WrapperBlock as WrapperBlockType,\n} from \"@templatical/types\";\nimport { SYNTAX_PRESETS } from \"@templatical/types\";\nimport { computed, inject, watch } from \"vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n EDITOR_KEY,\n IMAGE_URL_RESOLVER_KEY,\n LAYOUT_KEY,\n MERGE_TAG_SYNTAX_KEY,\n} from \"../../keys\";\nimport { matchImageBoxWidth } from \"../../utils/imageRoom\";\nimport {\n getBackgroundLookupUrl,\n useResolvedBackgroundUrl,\n} from \"../../composables/useImageUrlResolver\";\n\ndefineOptions({ name: \"WrapperBlock\" });\n\nconst props = defineProps<{\n block: WrapperBlockType;\n viewport: ViewportSize;\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst editor = inject(EDITOR_KEY, null);\nconst layout = inject(LAYOUT_KEY, undefined);\n\nconst bandBackgroundUrl = useResolvedBackgroundUrl(\n () => props.block.backgroundImage,\n);\n\nconst wrapperStyle = computed(\n () =>\n getWrapperStyle(props.block, {\n backgroundImageUrl: bandBackgroundUrl.value,\n }) ?? {},\n);\n\n// A child section sits in a plain box here, not a BlockWrapper, so nothing else\n// resolves its background image. The lookups start from this band; each box\n// then paints the cached result (`getCachedBlockWrapperStyle`). Layout content\n// is configuration rather than typed input, so there is no debounce.\nconst childBackgroundUrls = computed(() =>\n props.block.children.flatMap((child) => {\n const url =\n child.type === \"section\"\n ? getBackgroundLookupUrl(child.backgroundImage, syntax)\n : undefined;\n return url ? [url] : [];\n }),\n);\nif (imageUrlResolver) {\n watch(\n childBackgroundUrls,\n (urls) => {\n for (const url of urls) imageUrlResolver.lookup(url);\n },\n { immediate: true },\n );\n}\n\nconst childBoxes = computed(() =>\n props.block.children.map((child) => ({\n child,\n style: getCachedBlockWrapperStyle(\n child,\n imageUrlResolver,\n syntax,\n matchImageBoxWidth(\n child,\n editor?.content.value,\n layout,\n editor?.activeLocale?.value ?? undefined,\n ),\n ),\n })),\n);\n\nfunction getBlockComponent(block: Block) {\n // Children resolve through the registry (title, section, …). No local\n // fallback map: a Canvas import of PreviewSectionBlock (or a preview import\n // of SectionBlock) would pull the other surface's tree into this band.\n return resolveBlockComponent(block, blockRegistry, {});\n}\n</script>\n\n<template>\n <div\n data-testid=\"layout-wrapper\"\n class=\"tpl-email-surface tpl:w-full\"\n :style=\"wrapperStyle\"\n :class=\"backgroundImageHostClass(wrapperStyle)\"\n >\n <div\n v-for=\"{ child, style } in childBoxes\"\n :key=\"child.id\"\n :data-block-id=\"child.id\"\n :style=\"style\"\n :class=\"backgroundImageHostClass(style)\"\n >\n <component\n :is=\"getBlockComponent(child)\"\n :block=\"child\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport {\n backgroundImageHostClass,\n getCachedBlockWrapperStyle,\n getWrapperStyle,\n resolveBlockComponent,\n} from \"../../utils/blockComponentResolver\";\nimport type {\n Block,\n ViewportSize,\n WrapperBlock as WrapperBlockType,\n} from \"@templatical/types\";\nimport { SYNTAX_PRESETS } from \"@templatical/types\";\nimport { computed, inject, watch } from \"vue\";\nimport {\n BLOCK_REGISTRY_KEY,\n EDITOR_KEY,\n IMAGE_URL_RESOLVER_KEY,\n LAYOUT_KEY,\n MERGE_TAG_SYNTAX_KEY,\n} from \"../../keys\";\nimport { matchImageBoxWidth } from \"../../utils/imageRoom\";\nimport {\n getBackgroundLookupUrl,\n useResolvedBackgroundUrl,\n} from \"../../composables/useImageUrlResolver\";\n\ndefineOptions({ name: \"WrapperBlock\" });\n\nconst props = defineProps<{\n block: WrapperBlockType;\n viewport: ViewportSize;\n}>();\n\nconst blockRegistry = inject(BLOCK_REGISTRY_KEY, null);\nconst imageUrlResolver = inject(IMAGE_URL_RESOLVER_KEY, null);\nconst syntax = inject(MERGE_TAG_SYNTAX_KEY, SYNTAX_PRESETS.liquid);\nconst editor = inject(EDITOR_KEY, null);\nconst layout = inject(LAYOUT_KEY, undefined);\n\nconst bandBackgroundUrl = useResolvedBackgroundUrl(\n () => props.block.backgroundImage,\n);\n\nconst wrapperStyle = computed(\n () =>\n getWrapperStyle(props.block, {\n backgroundImageUrl: bandBackgroundUrl.value,\n }) ?? {},\n);\n\n// A child section sits in a plain box here, not a BlockWrapper, so nothing else\n// resolves its background image. The lookups start from this band; each box\n// then paints the cached result (`getCachedBlockWrapperStyle`). Layout content\n// is configuration rather than typed input, so there is no debounce.\nconst childBackgroundUrls = computed(() =>\n props.block.children.flatMap((child) => {\n const url =\n child.type === \"section\"\n ? getBackgroundLookupUrl(child.backgroundImage, syntax)\n : undefined;\n return url ? [url] : [];\n }),\n);\nif (imageUrlResolver) {\n watch(\n childBackgroundUrls,\n (urls) => {\n for (const url of urls) imageUrlResolver.lookup(url);\n },\n { immediate: true },\n );\n}\n\nconst childBoxes = computed(() =>\n props.block.children.map((child) => ({\n child,\n style: getCachedBlockWrapperStyle(\n child,\n imageUrlResolver,\n syntax,\n matchImageBoxWidth(\n child,\n editor?.content.value,\n layout,\n editor?.activeLocale?.value ?? undefined,\n ),\n ),\n })),\n);\n\nfunction getBlockComponent(block: Block) {\n // Children resolve through the registry (title, section, …). No local\n // fallback map: a Canvas import of PreviewSectionBlock (or a preview import\n // of SectionBlock) would pull the other surface's tree into this band.\n return resolveBlockComponent(block, blockRegistry, {});\n}\n</script>\n\n<template>\n <div\n data-testid=\"layout-wrapper\"\n class=\"tpl-email-surface tpl:w-full\"\n :style=\"wrapperStyle\"\n :class=\"backgroundImageHostClass(wrapperStyle)\"\n >\n <div\n v-for=\"{ child, style } in childBoxes\"\n :key=\"child.id\"\n :data-block-id=\"child.id\"\n :style=\"style\"\n :class=\"backgroundImageHostClass(style)\"\n >\n <component\n :is=\"getBlockComponent(child)\"\n :block=\"child\"\n :viewport=\"viewport\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EA6BA,IAAMsC,IAAQC,GAKRC,IAAgBzB,EAAOe,GAAoB,IAAI,GAC/CW,IAAmB1B,EAAOa,GAAwB,IAAI,GACtDc,IAAS3B,EAAOY,GAAsBJ,EAAe,MAAM,GAC3DoB,IAAS5B,EAAOgB,GAAY,IAAI,GAChCa,IAAS7B,EAAOc,GAAY,KAAA,CAAS,GAErCgB,IAAoBnB,QAClBY,EAAM,MAAM,eACpB,GAEMQ,IAAe1B,QAEjBc,EAAgBI,EAAM,OAAO,EAC3B,oBAAoBO,EAAkB,MACxC,CAAC,KAAK,CAAC,CACX,GAMME,IAAsB3B,QAC1BkB,EAAM,MAAM,SAAS,SAAS,MAAU;GACtC,IAAMU,IACJC,EAAM,SAAS,YACXzB,EAAuByB,EAAM,iBAAiBP,CAAM,IACpD,KAAA;GACN,OAAOM,IAAM,CAACA,CAAG,IAAI,CAAC;EACxB,CAAC,CACH;EACA,AAAIP,KACF5B,EACEkC,IACC,MAAS;GACR,KAAK,IAAMC,KAAOE,GAAM,EAAiB,OAAOF,CAAG;EACrD,GACA,EAAE,WAAW,GAAK,CACpB;EAGF,IAAMG,IAAa/B,QACjBkB,EAAM,MAAM,SAAS,KAAK,OAAW;GACnC;GACA,OAAON,EACLiB,GACAR,GACAC,GACAjB,EACEwB,GACAN,GAAQ,QAAQ,OAChBC,GACAD,GAAQ,cAAc,SAAS,KAAA,CACjC,CACF;EACF,EAAE,CACJ;EAEA,SAASS,EAAkB,GAAc;GAIvC,OAAOnB,EAAsBoB,GAAOb,GAAe,CAAC,CAAC;EACvD;E,kBAIExC,EAAA,GAAAC,EAmBM,OAAA;GAlBJ,eAAY;GACZ,OAAKC,EAAA,CAAC,gCAEEC,EAAAgC,CAAA,CAAwB,CAACW,EAAA,KAAY,CAAA,CAAA;GAD5C,OAAK1C,EAAE0C,EAAA,KAAY;E,KAGpB9C,EAAA,EAAA,GAAAC,EAYMI,GAAA,MAAAC,EAXuB6C,EAAA,QAAU,EAA5B,UAAO,gBADlBnD,EAAA,GAAAC,EAYM,OAAA;GAVH,KAAKgD,EAAM;GACX,iBAAeA,EAAM;GACrB,OAAK7C,EAAEkD,CAAK;GACZ,OAAKpD,EAAEC,EAAAgC,CAAA,CAAwB,CAACmB,CAAK,CAAA;E,KAEtCtD,EAAA,GAAAO,EAIEC,EAHK4C,EAAkBH,CAAK,CAAA,GAAA;GAC3B,OAAOA;GACP,UAAUV,EAAA"}