@templatical/editor 0.27.5 → 0.27.6

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 (137) hide show
  1. package/dist/{AiChatSidebar-LstHjwBU.js → AiChatSidebar-jbpwD_4k.js} +7 -7
  2. package/dist/{AiFeatureMenu-YE9qqElA.js → AiFeatureMenu-BeZR46ZG.js} +4 -4
  3. package/dist/{BlockIssueBadge-DKaFQNxW.js → BlockIssueBadge-B8wQY1tM.js} +2 -2
  4. package/dist/{BlockPreviewCanvas-CF7r-mw4.js → BlockPreviewCanvas-CIjts7SP.js} +1 -1
  5. package/dist/{CloudHeaderExtras-msYo6uhq.js → CloudHeaderExtras-mMqnnTi1.js} +2 -2
  6. package/dist/{CloudPanels-DCeNSwXy.js → CloudPanels-fiTneIeJ.js} +4 -4
  7. package/dist/{CollaboratorBar-D1Tx8cds.js → CollaboratorBar-C48K85la.js} +2 -2
  8. package/dist/{ColorPicker-BNfy9BdG.js → ColorPicker-Bc1lGovM.js} +1 -1
  9. package/dist/{CommentsPanel-c5LmzlNN.js → CommentsPanel-D5Ljv1oj.js} +1 -1
  10. package/dist/{CommentsSidebar-Bm1DxFb5.js → CommentsSidebar-C5mDJVjC.js} +10 -10
  11. package/dist/{CountdownToolbar-D-o_hwsO.js → CountdownToolbar-B-9EdQvm.js} +1 -1
  12. package/dist/{DesignReferenceSidebar-C8WTApc5.js → DesignReferenceSidebar-DOy4ENYv.js} +5 -5
  13. package/dist/{IssuesPanel-D49aJjLS.js → IssuesPanel-DZUehVZS.js} +5 -5
  14. package/dist/{MergeTagModeToggle-CVzJY9b2.js → MergeTagModeToggle-Fn9Q1SrJ.js} +2 -2
  15. package/dist/{ParagraphEditor-CoN76ofC.js → ParagraphEditor-BwTQoxxF.js} +7 -7
  16. package/dist/{RestoreVersionDialog-DUXGp-Nw.js → RestoreVersionDialog-CVuUY3CK.js} +4 -4
  17. package/dist/{RichTextEditorContent-DxicfnPf.js → RichTextEditorContent-CoXoAfZ1.js} +3 -3
  18. package/dist/{SaveBlockDialog-D0B9SKf9.js → SaveBlockDialog-Bn5JtRSE.js} +8 -9
  19. package/dist/{SavedBlocksBrowserModal-vdci8i18.js → SavedBlocksBrowserModal-WWGhUC8R.js} +9 -10
  20. package/dist/{SavedBlocksPanels-CTmlYwIT.js → SavedBlocksPanels-R_4C58EN.js} +1 -1
  21. package/dist/{SavedBlocksPickBar-DMtV1UKQ.js → SavedBlocksPickBar-D5KZVvvu.js} +2 -2
  22. package/dist/{TemplateScoringPanel-BFsUqnXR.js → TemplateScoringPanel-Cz25F9Cf.js} +10 -10
  23. package/dist/{TestEmailModal-4pHgNCmg.js → TestEmailModal-C_C228mX.js} +7 -7
  24. package/dist/{TestEmailPanel-kp84Z0hs.js → TestEmailPanel-D7YOLrOb.js} +1 -1
  25. package/dist/{TitleEditor-BdRlIm67.js → TitleEditor-XOQQlb1V.js} +4 -4
  26. package/dist/{TplModal-CUV1Sd-2.js → TplModal-DLXIufsn.js} +6 -4
  27. package/dist/{VersionHistoryMenu-CrIVG_SN.js → VersionHistoryMenu-Bk5zEClP.js} +10 -10
  28. package/dist/{VersionHistoryPanels-dyV9JP5G.js → VersionHistoryPanels-D-km60IA.js} +1 -1
  29. package/dist/{VersionPreviewBanner-Bb1cnMZ3.js → VersionPreviewBanner-PMaxy3tA.js} +1 -1
  30. package/dist/{blockTypeIcons-B13kXe55.js → blockTypeIcons-BG5c5gc8.js} +2 -2
  31. package/dist/bundle-stats.json +6 -6
  32. package/dist/cdn/chunks/{AiChatSidebar-tZqbhmuJ.js → AiChatSidebar-hq9GgASn.js} +2 -2
  33. package/dist/cdn/chunks/{AiChatSidebar-tZqbhmuJ.js.map → AiChatSidebar-hq9GgASn.js.map} +1 -1
  34. package/dist/cdn/chunks/{AiFeatureMenu-CS62uVuh.js → AiFeatureMenu-B8B-XgQB.js} +3 -3
  35. package/dist/cdn/chunks/{AiFeatureMenu-CS62uVuh.js.map → AiFeatureMenu-B8B-XgQB.js.map} +1 -1
  36. package/dist/cdn/chunks/{BlockIssueBadge-D9L8j7Db.js → BlockIssueBadge-DOvq0xJb.js} +2 -2
  37. package/dist/cdn/chunks/{BlockIssueBadge-D9L8j7Db.js.map → BlockIssueBadge-DOvq0xJb.js.map} +1 -1
  38. package/dist/cdn/chunks/{BlockPreviewCanvas-DcCqg909.js → BlockPreviewCanvas-ZN-5MezA.js} +2 -2
  39. package/dist/cdn/chunks/{BlockPreviewCanvas-DcCqg909.js.map → BlockPreviewCanvas-ZN-5MezA.js.map} +1 -1
  40. package/dist/cdn/chunks/{CloudHeaderExtras-d_8bZemh.js → CloudHeaderExtras-Dbd6brlz.js} +3 -3
  41. package/dist/cdn/chunks/{CloudHeaderExtras-d_8bZemh.js.map → CloudHeaderExtras-Dbd6brlz.js.map} +1 -1
  42. package/dist/cdn/chunks/{CloudPanels-DVtJkWsj.js → CloudPanels-CxkGH1dy.js} +5 -5
  43. package/dist/cdn/chunks/CloudPanels-CxkGH1dy.js.map +1 -0
  44. package/dist/cdn/chunks/{CollaboratorBar-CpHDWa9D.js → CollaboratorBar-DpP8oKTU.js} +3 -3
  45. package/dist/cdn/chunks/{CollaboratorBar-CpHDWa9D.js.map → CollaboratorBar-DpP8oKTU.js.map} +1 -1
  46. package/dist/cdn/chunks/{ColorPicker-QPBbkWAs.js → ColorPicker-BsYEtL7B.js} +2 -2
  47. package/dist/cdn/chunks/{ColorPicker-QPBbkWAs.js.map → ColorPicker-BsYEtL7B.js.map} +1 -1
  48. package/dist/cdn/chunks/{CommentsPanel-COhQMagD.js → CommentsPanel-B1B_UQ2z.js} +2 -2
  49. package/dist/cdn/chunks/{CommentsPanel-COhQMagD.js.map → CommentsPanel-B1B_UQ2z.js.map} +1 -1
  50. package/dist/cdn/chunks/{CommentsSidebar-vzLX-_h3.js → CommentsSidebar-B4waNT5L.js} +2 -2
  51. package/dist/cdn/chunks/{CommentsSidebar-vzLX-_h3.js.map → CommentsSidebar-B4waNT5L.js.map} +1 -1
  52. package/dist/cdn/chunks/{CountdownToolbar-CMJVzd97.js → CountdownToolbar-DhJg2sQa.js} +2 -2
  53. package/dist/cdn/chunks/{CountdownToolbar-CMJVzd97.js.map → CountdownToolbar-DhJg2sQa.js.map} +1 -1
  54. package/dist/cdn/chunks/{DesignReferenceSidebar-npLxDRJI.js → DesignReferenceSidebar-4Ds4D0M0.js} +2 -2
  55. package/dist/cdn/chunks/{DesignReferenceSidebar-npLxDRJI.js.map → DesignReferenceSidebar-4Ds4D0M0.js.map} +1 -1
  56. package/dist/cdn/chunks/{IssuesPanel-CTGlv7HF.js → IssuesPanel-CyGgRHuI.js} +2 -2
  57. package/dist/cdn/chunks/{IssuesPanel-CTGlv7HF.js.map → IssuesPanel-CyGgRHuI.js.map} +1 -1
  58. package/dist/cdn/chunks/{MergeTagModeToggle-CkpKFx9N.js → MergeTagModeToggle-B_oHsH0i.js} +2 -2
  59. package/dist/cdn/chunks/{MergeTagModeToggle-CkpKFx9N.js.map → MergeTagModeToggle-B_oHsH0i.js.map} +1 -1
  60. package/dist/cdn/chunks/{ParagraphEditor-CbP_rcqb.js → ParagraphEditor-9GPXDRns.js} +5 -5
  61. package/dist/cdn/chunks/{ParagraphEditor-CbP_rcqb.js.map → ParagraphEditor-9GPXDRns.js.map} +1 -1
  62. package/dist/cdn/chunks/{RestoreVersionDialog-DYI-M27i.js → RestoreVersionDialog-BWewwJIZ.js} +4 -4
  63. package/dist/cdn/chunks/RestoreVersionDialog-BWewwJIZ.js.map +1 -0
  64. package/dist/cdn/chunks/{RichTextEditorContent-C-kbbKaq.js → RichTextEditorContent-DWD1--Yi.js} +3 -3
  65. package/dist/cdn/chunks/{RichTextEditorContent-C-kbbKaq.js.map → RichTextEditorContent-DWD1--Yi.js.map} +1 -1
  66. package/dist/cdn/chunks/{SaveBlockDialog-BBwDyRpC.js → SaveBlockDialog-DUyrK4nE.js} +7 -8
  67. package/dist/cdn/chunks/SaveBlockDialog-DUyrK4nE.js.map +1 -0
  68. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B_zqSoWl.js → SavedBlocksBrowserModal-DZrk2Fxx.js} +8 -9
  69. package/dist/cdn/chunks/SavedBlocksBrowserModal-DZrk2Fxx.js.map +1 -0
  70. package/dist/cdn/chunks/{SavedBlocksPanels-B_XNxwzs.js → SavedBlocksPanels-iSAXI4IM.js} +2 -2
  71. package/dist/cdn/chunks/{SavedBlocksPanels-B_XNxwzs.js.map → SavedBlocksPanels-iSAXI4IM.js.map} +1 -1
  72. package/dist/cdn/chunks/{SavedBlocksPickBar-C3BP5941.js → SavedBlocksPickBar-CFeccSg9.js} +3 -3
  73. package/dist/cdn/chunks/{SavedBlocksPickBar-C3BP5941.js.map → SavedBlocksPickBar-CFeccSg9.js.map} +1 -1
  74. package/dist/cdn/chunks/{TemplateScoringPanel-MvdrkgqL.js → TemplateScoringPanel-Ct5p7X_i.js} +7 -7
  75. package/dist/cdn/chunks/{TemplateScoringPanel-MvdrkgqL.js.map → TemplateScoringPanel-Ct5p7X_i.js.map} +1 -1
  76. package/dist/cdn/chunks/{TestEmailModal-CnoOTm5c.js → TestEmailModal-BJo6q_Dm.js} +7 -7
  77. package/dist/cdn/chunks/TestEmailModal-BJo6q_Dm.js.map +1 -0
  78. package/dist/cdn/chunks/{TestEmailPanel-BcvY4bL7.js → TestEmailPanel-LuLd-ErE.js} +2 -2
  79. package/dist/cdn/chunks/{TestEmailPanel-BcvY4bL7.js.map → TestEmailPanel-LuLd-ErE.js.map} +1 -1
  80. package/dist/cdn/chunks/{TitleEditor-5Ytpa9n2.js → TitleEditor-BsGfiDXQ.js} +4 -4
  81. package/dist/cdn/chunks/{TitleEditor-5Ytpa9n2.js.map → TitleEditor-BsGfiDXQ.js.map} +1 -1
  82. package/dist/cdn/chunks/{TplModal-pGADKFOL.js → TplModal-lUdHsbjL.js} +7 -5
  83. package/dist/cdn/chunks/TplModal-lUdHsbjL.js.map +1 -0
  84. package/dist/cdn/chunks/{VersionHistoryMenu-BNYSIjVj.js → VersionHistoryMenu-CXMPsVMR.js} +4 -4
  85. package/dist/cdn/chunks/{VersionHistoryMenu-BNYSIjVj.js.map → VersionHistoryMenu-CXMPsVMR.js.map} +1 -1
  86. package/dist/cdn/chunks/{VersionHistoryPanels-CSryv5rE.js → VersionHistoryPanels-oTKA6TUS.js} +2 -2
  87. package/dist/cdn/chunks/{VersionHistoryPanels-CSryv5rE.js.map → VersionHistoryPanels-oTKA6TUS.js.map} +1 -1
  88. package/dist/cdn/chunks/{VersionPreviewBanner-C4mr6y2u.js → VersionPreviewBanner-7DZLUVaE.js} +2 -2
  89. package/dist/cdn/chunks/{VersionPreviewBanner-C4mr6y2u.js.map → VersionPreviewBanner-7DZLUVaE.js.map} +1 -1
  90. package/dist/cdn/chunks/{blockTypeIcons-A9qFb1cR.js → blockTypeIcons-D8dtoELC.js} +2 -2
  91. package/dist/cdn/chunks/{blockTypeIcons-A9qFb1cR.js.map → blockTypeIcons-D8dtoELC.js.map} +1 -1
  92. package/dist/cdn/chunks/{createCloudRuntime-DYDf_-rN.js → createCloudRuntime-CedWXagq.js} +2 -2
  93. package/dist/cdn/chunks/{createCloudRuntime-DYDf_-rN.js.map → createCloudRuntime-CedWXagq.js.map} +1 -1
  94. package/dist/cdn/chunks/{icons-Dl5bcXmT.js → icons-BrdgOeXm.js} +18 -18
  95. package/dist/cdn/chunks/{icons-Dl5bcXmT.js.map → icons-BrdgOeXm.js.map} +1 -1
  96. package/dist/cdn/chunks/{src-BDUi-9js.js → src-BS2ClsbB.js} +25 -25
  97. package/dist/cdn/chunks/src-BS2ClsbB.js.map +1 -0
  98. package/dist/cdn/chunks/{src-DNhD7a2v.js → src-rhf0R6xZ.js} +2 -2
  99. package/dist/cdn/chunks/{src-DNhD7a2v.js.map → src-rhf0R6xZ.js.map} +1 -1
  100. package/dist/cdn/chunks/{useEditorCore-DTpSiO4S.js → useEditorCore-CwJIw1Uy.js} +19 -19
  101. package/dist/cdn/chunks/{useEditorCore-DTpSiO4S.js.map → useEditorCore-CwJIw1Uy.js.map} +1 -1
  102. package/dist/cdn/editor.css +1 -1
  103. package/dist/cdn/editor.js +20 -20
  104. package/dist/cdn/editor.js.map +1 -1
  105. package/dist/{check-GRcTaHlZ.js → check-C2h94k_8.js} +1 -1
  106. package/dist/{chevron-down-NUIAa2Qf.js → chevron-down-ulZzvfvk.js} +1 -1
  107. package/dist/{chevron-up-Bjf2BQtL.js → chevron-up-8g-VtBW4.js} +1 -1
  108. package/dist/{circle-alert-FpQ8ykQL.js → circle-alert-BJFqBtRt.js} +1 -1
  109. package/dist/{clock-CaOM1DC-.js → clock-C-1JiH38.js} +1 -1
  110. package/dist/{createLucideIcon-CAmDKr5Z.js → createLucideIcon-DJb_1j1D.js} +2 -2
  111. package/dist/{image-up-CIGT4cSb.js → image-up-0rvCz8rh.js} +1 -1
  112. package/dist/{info-9YwKinXj.js → info-CXvc-MZk.js} +1 -1
  113. package/dist/{loader-circle-QyURl47g.js → loader-circle-DQIuGTFk.js} +1 -1
  114. package/dist/{message-circle-C9pycEzV.js → message-circle-BqX2Y80d.js} +1 -1
  115. package/dist/{pencil-BvW86jVn.js → pencil-DpGX5hCB.js} +1 -1
  116. package/dist/{refresh-cw-BDAUomac.js → refresh-cw-B13pUg95.js} +1 -1
  117. package/dist/{scan-line-B5EvAPSG.js → scan-line-BDZEtA92.js} +1 -1
  118. package/dist/{send-BAUn7DLp.js → send-DQ52s_T6.js} +1 -1
  119. package/dist/{shield-check-CLGywlg0.js → shield-check-C4uQTy20.js} +1 -1
  120. package/dist/{sparkles-X6C0spo6.js → sparkles-CphMFXxu.js} +1 -1
  121. package/dist/style.css +1 -1
  122. package/dist/templatical-editor.js +31 -31
  123. package/dist/{text-align-start-C6FXOoEj.js → text-align-start-Cem3VGu8.js} +1 -1
  124. package/dist/{trash-2-balHkQP4.js → trash-2-ijNDbe1n.js} +1 -1
  125. package/dist/{triangle-alert-D2JBEr6k.js → triangle-alert-C1e0A199.js} +1 -1
  126. package/dist/{upload-D70OYprI.js → upload-CXwGBFi0.js} +1 -1
  127. package/dist/{useEditorCore--_kmTxxX.js → useEditorCore-BfPXdBsv.js} +9 -9
  128. package/dist/{useScrollToBlock-DcImB73T.js → useScrollToBlock-B3H6frtG.js} +1 -1
  129. package/dist/{x-DTUPbuwx.js → x-eZrtE6uf.js} +1 -1
  130. package/package.json +8 -8
  131. package/dist/cdn/chunks/CloudPanels-DVtJkWsj.js.map +0 -1
  132. package/dist/cdn/chunks/RestoreVersionDialog-DYI-M27i.js.map +0 -1
  133. package/dist/cdn/chunks/SaveBlockDialog-BBwDyRpC.js.map +0 -1
  134. package/dist/cdn/chunks/SavedBlocksBrowserModal-B_zqSoWl.js.map +0 -1
  135. package/dist/cdn/chunks/TestEmailModal-CnoOTm5c.js.map +0 -1
  136. package/dist/cdn/chunks/TplModal-pGADKFOL.js.map +0 -1
  137. package/dist/cdn/chunks/src-BDUi-9js.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveBlockDialog-DUyrK4nE.js","names":[],"sources":["../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SavedBlockPreviewRow.vue","../../../src/components/SaveBlockDialog.vue","../../../src/components/SaveBlockDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One reorderable row in the save dialog's preview list: a grip handle beside a\n * scaled-down render of the real block.\n *\n * The preview is the same `BlockPreviewCanvas` the browser modal uses, so\n * a row shows what the block actually looks like rather than a description of\n * it. That canvas is fixed at the 600px email width every block component\n * renders against, so the row shrinks it with `transform: scale()` instead of\n * re-flowing it at dialog width — a re-flow would show a layout the recipient\n * will never see.\n *\n * `transform` doesn't participate in layout, so the frame would keep reserving\n * the full unscaled height; a `ResizeObserver` mirrors the scaled height back\n * onto it. The handle is a sibling of the scaled subtree, so it stays full size\n * and keeps its real hit area.\n *\n * Row chrome uses the raw theme tokens, not the `--tpl-chrome-*` aliases: the\n * chrome is an ancestor and a sibling of the rendered email content, never a\n * descendant, so the `.tpl-block-content` token override can't reach it.\n */\nimport BlockPreviewCanvas from \"./BlockPreviewCanvas.vue\";\nimport { useI18n } from \"../composables\";\nimport { CUSTOM_BLOCK_DEFINITIONS_KEY, EDITOR_KEY } from \"../keys\";\nimport { getEmailFrameWidth } from \"../utils/emailFrameWidth\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { ChevronDown, ChevronUp, GripVertical } from \"@lucide/vue\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, onBeforeUnmount, onMounted, ref } from \"vue\";\n\nconst props = defineProps<{\n block: Block;\n /** 1-based position in the list — spoken by the handle's label. */\n position: number;\n total: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"move\", delta: -1 | 1): void;\n}>();\n\nconst { t, format } = useI18n();\n// Optional: absent when the consumer registers no custom blocks.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst editor = inject(EDITOR_KEY, null);\n\n/**\n * The width the nested `BlockPreviewCanvas` actually renders at.\n *\n * MUST come from the same helper the canvas uses, because the scale factor below\n * divides by it: a mismatch scales every row by the wrong amount, so a template\n * with a custom body width would overflow its frame or under-fill it. Rows are\n * always the desktop width — the save dialog has no viewport control.\n */\nconst previewWidth = computed(() =>\n getEmailFrameWidth(editor?.content.value.settings),\n);\n/**\n * Collapsed height for a tall block. A hero card or a multi-row section would\n * otherwise be taller than the whole list, leaving one row on screen — and\n * seeing the rows together is what makes them orderable. Anything taller\n * collapses to this, fades out at the cut, and can be expanded in place.\n */\nconst COLLAPSED_HEIGHT = 240;\n\nconst frameEl = ref<HTMLElement | null>(null);\nconst contentEl = ref<HTMLElement | null>(null);\nconst scale = ref(1);\n/** Scaled height of the whole block; `null` until first measured. */\nconst fullHeight = ref<number | null>(null);\nconst expanded = ref(false);\n\nlet observer: ResizeObserver | null = null;\n\n/** Only a block taller than the collapsed cap needs fading or expanding. */\nconst isClipped = computed(\n () => fullHeight.value !== null && fullHeight.value > COLLAPSED_HEIGHT,\n);\n\nconst frameHeight = computed(() => {\n if (fullHeight.value === null) return null;\n if (expanded.value || !isClipped.value) return fullHeight.value;\n return COLLAPSED_HEIGHT;\n});\n\nfunction measure(): void {\n const frame = frameEl.value;\n const content = contentEl.value;\n if (!frame || !content) return;\n const width = frame.clientWidth;\n if (width <= 0) return;\n // Never scale up: a dialog wider than the email would blow the preview past\n // its real proportions.\n const next = Math.min(1, width / previewWidth.value);\n scale.value = next;\n fullHeight.value = content.offsetHeight * next;\n}\n\nonMounted(() => {\n measure();\n // Absent in non-DOM test environments. Without it the frame simply falls back\n // to the untransformed height and clips — degraded, never broken.\n if (typeof ResizeObserver === \"undefined\") return;\n observer = new ResizeObserver(() => measure());\n if (frameEl.value) observer.observe(frameEl.value);\n if (contentEl.value) observer.observe(contentEl.value);\n});\n\nonBeforeUnmount(() => {\n observer?.disconnect();\n observer = null;\n});\n\nconst blockLabel = computed(() =>\n getBlockLabel(props.block, t, customBlockDefinitions),\n);\n\nconst handleLabel = computed(() =>\n format(t.savedBlocks.reorderHandle, {\n block: blockLabel.value,\n position: props.position,\n total: props.total,\n }),\n);\n\nconst toggleLabel = computed(() =>\n format(\n expanded.value\n ? t.savedBlocks.collapsePreview\n : t.savedBlocks.expandPreview,\n { block: blockLabel.value },\n ),\n);\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-reorder-row\"\n :data-block-id=\"block.id\"\n class=\"tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]\"\n style=\"background-color: var(--tpl-bg)\"\n >\n <!-- Sortable's `handle` selector points here, so a pointer-drag can only\n start from the grip — never from the preview itself. -->\n <button\n type=\"button\"\n data-testid=\"saved-blocks-reorder-handle\"\n class=\"tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"handleLabel\"\n :title=\"t.savedBlocks.reorderHint\"\n @keydown.up.prevent=\"emit('move', -1)\"\n @keydown.down.prevent=\"emit('move', 1)\"\n >\n <GripVertical :size=\"14\" :stroke-width=\"1.5\" />\n </button>\n\n <div class=\"tpl:relative tpl:min-w-0 tpl:flex-1\">\n <div\n ref=\"frameEl\"\n class=\"tpl:overflow-hidden\"\n :style=\"{\n height: frameHeight !== null ? `${frameHeight}px` : undefined,\n }\"\n >\n <div\n ref=\"contentEl\"\n :style=\"{\n width: `${previewWidth}px`,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }\"\n >\n <BlockPreviewCanvas :blocks=\"[block]\" />\n </div>\n </div>\n\n <!-- Fade over the cut, so a clipped block reads as truncated rather than\n as a block that simply ends there. Pointer-transparent: it sits over\n the preview, and swallowing clicks would break the row. -->\n <div\n v-if=\"isClipped && !expanded\"\n data-testid=\"saved-blocks-preview-fade\"\n aria-hidden=\"true\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10\"\n style=\"\n background: linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n );\n \"\n />\n\n <button\n v-if=\"isClipped\"\n type=\"button\"\n data-testid=\"saved-blocks-preview-toggle\"\n class=\"tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]\"\n :aria-label=\"toggleLabel\"\n :aria-expanded=\"expanded\"\n @click=\"expanded = !expanded\"\n >\n <component\n :is=\"expanded ? ChevronUp : ChevronDown\"\n :size=\"11\"\n :stroke-width=\"2\"\n />\n {{ expanded ? t.savedBlocks.collapse : t.savedBlocks.expand }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport SavedBlockPreviewRow from \"./SavedBlockPreviewRow.vue\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport {\n CUSTOM_BLOCK_DEFINITIONS_KEY,\n EDITOR_KEY,\n SAVED_BLOCKS_KEY,\n requireInject,\n} from \"../keys\";\nimport { getBlockLabel } from \"../utils/blockTypeLabels\";\nimport { LoaderCircle } from \"@lucide/vue\";\nimport { VueDraggable } from \"vue-draggable-plus\";\nimport type { Block } from \"@templatical/types\";\nimport { computed, inject, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n /**\n * Blocks chosen during the canvas pick session, in the order they were\n * picked — `pickedIds` is built from a `Set`, which iterates in insertion\n * order. That order seeds the reorderable list below. Every id must be a\n * top-level block, which is what the session guarantees.\n */\n pickedIds: readonly string[];\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"saved\"): void;\n}>();\n\nconst { t, format } = useI18n();\nconst editor = requireInject(EDITOR_KEY, \"SaveBlockDialog\");\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SaveBlockDialog\");\n// Optional: a consumer with no custom blocks never provides definitions, and\n// the label helper degrades to the type slug rather than throwing.\nconst customBlockDefinitions = inject(CUSTOM_BLOCK_DEFINITIONS_KEY, []);\n\nconst name = ref(\"\");\nconst category = ref(\"\");\nconst isSaving = ref(false);\nconst error = ref<string | null>(null);\nconst announcement = ref(\"\");\n\n/**\n * The order the blocks will be saved in: seeded from the pick order, then owned\n * by this dialog once the user drags a row.\n *\n * Ids rather than blocks, deliberately. Resolving late means a block edited\n * while the dialog is open (a collaborator in Cloud) is persisted as it stands\n * at save time, not as it looked when the dialog opened, and an id that stops\n * resolving drops out on its own instead of leaving a stale snapshot behind.\n */\nconst orderedIds = ref<string[]>([]);\n\n/**\n * The picked blocks in the list's current order. Ids that no longer resolve (a\n * block deleted mid-session) simply drop out.\n */\nconst pickedBlocks = computed(() => {\n const byId = new Map(editor.content.value.blocks.map((b) => [b.id, b]));\n return orderedIds.value\n .map((id) => byId.get(id))\n .filter((b): b is Block => b !== undefined);\n});\n\n/**\n * Sortable's model. The setter reads ids straight back off the emitted entries\n * rather than storing them, so a Sortable `el` expando can never reach the\n * payload `create()` sends to the provider — and because the getter is already\n * filtered, writing through it prunes unresolvable ids too.\n */\nconst orderedBlocks = computed<Block[]>({\n get: () => pickedBlocks.value,\n set: (blocks) => {\n orderedIds.value = blocks.map((b) => b.id);\n },\n});\n\n/** Keyboard reorder from a focused grip: swap with the neighbouring row. */\nfunction moveBlock(blockId: string, delta: -1 | 1): void {\n const order = pickedBlocks.value.map((b) => b.id);\n const from = order.indexOf(blockId);\n const to = from + delta;\n if (from === -1 || to < 0 || to >= order.length) return;\n [order[from], order[to]] = [order[to], order[from]];\n orderedIds.value = order;\n\n const moved = pickedBlocks.value[to];\n announcement.value = moved\n ? format(t.savedBlocks.reorderAnnouncement, {\n block: label(moved),\n position: to + 1,\n total: order.length,\n })\n : \"\";\n}\n\n/** Custom blocks read as the consumer's name for them, not the type `custom`. */\nfunction label(block: Block): string {\n return getBlockLabel(block, t, customBlockDefinitions);\n}\n\n/** e.g. \"Title, Paragraph, Button\" — what the user is about to save. */\nconst summary = computed(() => pickedBlocks.value.map(label).join(\", \"));\n\n// `immediate` matters: the dialog is mounted lazily behind a `v-if` on the\n// same state that drives `visible`, so it can mount with `visible` already\n// true and would otherwise never reset the name field or seed the order.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n name.value = \"\";\n category.value = \"\";\n error.value = null;\n announcement.value = \"\";\n orderedIds.value = [...props.pickedIds];\n }\n },\n { immediate: true },\n);\n\nconst canSave = computed(\n () =>\n name.value.trim().length > 0 &&\n pickedBlocks.value.length > 0 &&\n !isSaving.value,\n);\n\nasync function handleSave(): Promise<void> {\n if (!canSave.value) return;\n\n const blocks = pickedBlocks.value;\n // Defence in depth: never persist an empty saved block (it would list as\n // \"0 block(s)\" and insert nothing). Guards a pick set whose ids no longer\n // resolve to anything on the canvas.\n if (blocks.length === 0) return;\n\n isSaving.value = true;\n error.value = null;\n\n try {\n // Empty stays undefined rather than \"\": an entry is either categorised or\n // it isn't, and a blank string would show up as a nameless filter option.\n await savedBlocks.create(\n name.value.trim(),\n blocks,\n category.value.trim() || undefined,\n );\n emit(\"saved\");\n emit(\"close\");\n } catch (err) {\n error.value = (err as Error).message;\n } finally {\n isSaving.value = false;\n }\n}\n\nfunction handleClose(): void {\n if (!isSaving.value) {\n emit(\"close\");\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n handleSave();\n }\n if (event.key === \"Escape\") {\n handleClose();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-busy=\"isSaving\"\n aria-labelledby=\"tpl-save-block-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <h3\n id=\"tpl-save-block-title\"\n class=\"tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.saveAsBlock }}\n </h3>\n\n <!-- Saved block name -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.name }}\n </label>\n <input\n v-model=\"name\"\n type=\"text\"\n data-testid=\"saved-blocks-name-input\"\n :placeholder=\"t.savedBlocks.namePlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n </div>\n\n <!-- Category: free text, with the already-used categories offered as\n suggestions. A datalist rather than a <select> because the set is\n derived from existing entries — there is no registry to pick from,\n and the first entry in a category has to be able to name it. -->\n <div class=\"tpl:mb-3 tpl:shrink-0\">\n <label\n for=\"tpl-save-block-category\"\n class=\"tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ t.savedBlocks.category }}\n </label>\n <input\n id=\"tpl-save-block-category\"\n v-model=\"category\"\n type=\"text\"\n data-testid=\"saved-blocks-category-input\"\n list=\"tpl-saved-block-categories\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-[var(--tpl-shadow-sm)] tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n :disabled=\"isSaving\"\n />\n <datalist id=\"tpl-saved-block-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n </div>\n\n <!-- Summary of what the pick session chose. Which blocks were picked is\n settled on the canvas — the dialog re-presents them only so the user\n can see and order what they're about to save. -->\n <p\n data-testid=\"saved-blocks-save-summary\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]\"\n >\n {{ format(t.savedBlocks.savingCount, { count: pickedBlocks.length }) }}\n <span class=\"tpl:text-[var(--tpl-text-dim)]\">{{ summary }}</span>\n </p>\n\n <!-- Reorderable preview. Seeded in pick order and saved in whatever order\n the list ends up in. Its own Sortable instance with no `group`, so it\n can never exchange items with the canvas or a section column. -->\n <p\n v-if=\"pickedBlocks.length > 1\"\n class=\"tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.reorderHint }}\n </p>\n <!-- The only growing region: takes whatever the dialog's backdrop cap\n leaves after the fixed chrome, rather than a hand-tuned vh guess that\n a row expanding to full height would blow past. `min-h-0` is what\n lets a flex child actually shrink below its content and scroll. -->\n <VueDraggable\n v-model=\"orderedBlocks\"\n data-testid=\"saved-blocks-reorder-list\"\n :animation=\"150\"\n ghost-class=\"tpl-ghost\"\n drag-class=\"tpl-dragging\"\n handle=\".tpl-saved-block-reorder-handle\"\n :force-fallback=\"true\"\n class=\"tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto\"\n >\n <SavedBlockPreviewRow\n v-for=\"(block, index) in orderedBlocks\"\n :key=\"block.id\"\n :block=\"block\"\n :position=\"index + 1\"\n :total=\"orderedBlocks.length\"\n @move=\"(delta) => moveBlock(block.id, delta)\"\n />\n </VueDraggable>\n\n <!-- Keyboard reorder announcement region (visually hidden, live) -->\n <div\n class=\"tpl-sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ announcement }}\n </div>\n\n <!-- Error message -->\n <p\n v-if=\"error\"\n role=\"alert\"\n class=\"tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]\"\n >\n {{ error }}\n </p>\n\n <!-- Actions -->\n <div class=\"tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2\">\n <button\n type=\"button\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n :disabled=\"isSaving\"\n :class=\"{\n 'tpl:cursor-not-allowed tpl:opacity-50': isSaving,\n }\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!canSave\"\n @click=\"handleSave\"\n >\n <span v-if=\"isSaving\" class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <LoaderCircle\n class=\"tpl:animate-spin\"\n :size=\"12\"\n :stroke-width=\"2\"\n />\n {{ t.savedBlocks.saving }}\n </span>\n <span v-else>\n {{ t.savedBlocks.save }}\n </span>\n </button>\n </div>\n </div>\n </TplModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;wCAgEM,IAAmB;;;;;;;;;EAlCzB,IAAM,IAAQ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,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,IAAA,EAAA,GAEzB,EAiBS,UAAA;KAhBP,MAAK;KACJ,OAAK,EAAE,EAAA,CAAA,CAAe;KACtB,UAAQ,CAAG,GAAA;KACX,SAAO;IAEI,GAAA,CAAA,EAAA,SAAZ,EAAA,GAAA,EAOO,QAPP,IAOO,CANL,EAIE,EAAA,CAAA,GAAA;KAHA,OAAM;KACL,MAAM;KACN,gBAAc;IACf,CAAA,GAAA,EAAA,MACF,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,CAAA,CAAA,CAAA,MAEzB,EAAA,GAAA,EAEO,QAAA,IAAA,EADF,EAAA,CAAA,CAAC,CAAC,YAAY,IAAI,GAAA,CAAA,EAAA,GAAA,IAAA,EAAA,CAAA,CAAA"}
@@ -1,23 +1,22 @@
1
1
  import { B as e, F as t, H as n, N as r, Q as i, R as ee, S as a, U as o, a as s, at as c, b as l, c as u, ct as d, f, g as p, h as m, k as te, l as h, lt as ne, m as g, o as _, p as v, u as y, ut as b, x as re } from "./draggable-BfpsXFg7.js";
2
- import "./useEditorCore-DTpSiO4S.js";
2
+ import "./useEditorCore-CwJIw1Uy.js";
3
3
  import { L as ie, W as x, h as ae } from "./keys-oJdkdtPn.js";
4
4
  import { t as oe } from "./useI18n-4sUbTM3Y.js";
5
- import { K as se, N as ce, Y as S, d as le, n as ue } from "./icons-Dl5bcXmT.js";
5
+ import { K as se, N as ce, Y as S, d as le, n as ue } from "./icons-BrdgOeXm.js";
6
6
  import { v as de } from "./styleConstants-C_YAPdQS.js";
7
- import { t as C } from "./blockTypeIcons-A9qFb1cR.js";
7
+ import { t as C } from "./blockTypeIcons-D8dtoELC.js";
8
8
  import { t as fe } from "./formatRelativeTime-CtUU-QZ8.js";
9
- import { t as pe } from "./TplModal-pGADKFOL.js";
9
+ import { t as pe } from "./TplModal-lUdHsbjL.js";
10
10
  //#region src/components/SavedBlocksBrowserModal.vue?vue&type=script&setup=true&lang.ts
11
11
  var me = {
12
12
  role: "dialog",
13
13
  "aria-modal": "true",
14
14
  "data-testid": "saved-blocks-browser",
15
15
  "aria-labelledby": "tpl-saved-blocks-browser-title",
16
- class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-[1000px] tpl:max-w-[calc(100vw_-_2*var(--tpl-base-size))] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
16
+ class: "tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-[1000px] tpl:max-w-full tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
17
17
  style: {
18
18
  "background-color": "var(--tpl-bg-elevated)",
19
- "box-shadow": "var(--tpl-shadow-xl)",
20
- "max-height": "90vh"
19
+ "box-shadow": "var(--tpl-shadow-xl)"
21
20
  }
22
21
  }, he = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, ge = {
23
22
  id: "tpl-saved-blocks-browser-title",
@@ -63,7 +62,7 @@ var me = {
63
62
  props: { visible: { type: Boolean } },
64
63
  emits: ["close", "insert"],
65
64
  setup(a, { emit: A }) {
66
- let tt = a, j = A, nt = re(() => import("./BlockPreviewCanvas-DcCqg909.js").then((e) => e.n)), { t: M, format: N } = oe(), P = x(ie, "SavedBlocksBrowserModal"), F = x(ae, "SavedBlocksBrowserModal"), I = i(""), L = i(""), R = i(null), z = i(null), B = i(null), V = i(""), H = i(""), U = i(null), W = i("end"), G = f(() => {
65
+ let tt = a, j = A, nt = re(() => import("./BlockPreviewCanvas-ZN-5MezA.js").then((e) => e.n)), { t: M, format: N } = oe(), P = x(ie, "SavedBlocksBrowserModal"), F = x(ae, "SavedBlocksBrowserModal"), I = i(""), L = i(""), R = i(null), z = i(null), B = i(null), V = i(""), H = i(""), U = i(null), W = i("end"), G = f(() => {
67
66
  let e = I.value.trim().toLowerCase(), t = L.value;
68
67
  return P.savedBlocks.value.filter((n) => !(e && !n.name.toLowerCase().includes(e) || t && n.category !== t));
69
68
  }), K = f(() => P.isLoading.value && P.savedBlocks.value.length === 0), rt = f(() => I.value.trim().length > 0 || L.value !== ""), q = f(() => R.value ? P.savedBlocks.value.find((e) => e.id === R.value) ?? null : null), it = f(() => {
@@ -320,4 +319,4 @@ var me = {
320
319
  //#endregion
321
320
  export { A as default };
322
321
 
323
- //# sourceMappingURL=SavedBlocksBrowserModal-B_zqSoWl.js.map
322
+ //# sourceMappingURL=SavedBlocksBrowserModal-DZrk2Fxx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedBlocksBrowserModal-DZrk2Fxx.js","names":[],"sources":["../../../src/components/SavedBlocksBrowserModal.vue","../../../src/components/SavedBlocksBrowserModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport { blockTypeIcons } from \"../utils/blockTypeIcons\";\nimport { formatRelativeTime } from \"../utils/formatRelativeTime\";\nimport { SAVED_BLOCKS_KEY, EDITOR_KEY, requireInject } from \"../keys\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport { Package, Pencil, Search, Trash2, X } from \"@lucide/vue\";\nimport { computed, defineAsyncComponent, nextTick, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"insert\", saved: SavedBlock, insertIndex: number | undefined): void;\n}>();\n\nconst BlockPreviewCanvas = defineAsyncComponent(\n () => import(\"./BlockPreviewCanvas.vue\"),\n);\n\nconst { t, format } = useI18n();\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SavedBlocksBrowserModal\");\nconst editor = requireInject(EDITOR_KEY, \"SavedBlocksBrowserModal\");\n\nconst searchQuery = ref(\"\");\n/** `\"\"` = no category filter. Matched exactly against `SavedBlock.category`. */\nconst categoryFilter = ref(\"\");\nconst selectedId = ref<string | null>(null);\nconst confirmDeleteId = ref<string | null>(null);\nconst renamingId = ref<string | null>(null);\nconst renameDraft = ref(\"\");\nconst renameCategoryDraft = ref(\"\");\nconst renameInput = ref<HTMLInputElement | null>(null);\n// 'end' = append, 'beginning' = index 0, or block id = after that block\nconst insertPosition = ref<string>(\"end\");\n\n// Order is the provider's to decide — the editor never re-sorts. Whatever\n// `list()` returns is what the user sees (the bundled localStorage adapter, for\n// instance, returns newest-first). Filters only narrow; they never reorder.\n//\n// Both filters run in memory over the loaded entries rather than round-tripping\n// to the provider: that keeps a BYO provider at four dumb methods, and it is\n// what lets the category options below be derived at all — a provider-filtered\n// response could not tell us which other categories exist.\nconst filtered = computed(() => {\n const query = searchQuery.value.trim().toLowerCase();\n const category = categoryFilter.value;\n return savedBlocks.savedBlocks.value.filter((b) => {\n if (query && !b.name.toLowerCase().includes(query)) return false;\n if (category && b.category !== category) return false;\n return true;\n });\n});\n\n/**\n * The list is fetched when this modal opens, not at editor mount, so a first\n * open can arrive before the provider answers. Show the skeleton only while\n * there is *nothing* to display: on a reopen the previous entries render\n * immediately and the refetch lands underneath them.\n *\n * Without this the empty state would claim \"No saved blocks yet\" for the whole\n * duration of the request — false, not merely unhelpful.\n */\nconst isInitialLoad = computed(\n () =>\n savedBlocks.isLoading.value && savedBlocks.savedBlocks.value.length === 0,\n);\n\n/** Whether any filter is narrowing the list — drives the empty-state copy. */\nconst isFiltering = computed(\n () => searchQuery.value.trim().length > 0 || categoryFilter.value !== \"\",\n);\n\nconst selected = computed(() => {\n if (!selectedId.value) return null;\n return (\n savedBlocks.savedBlocks.value.find((b) => b.id === selectedId.value) ?? null\n );\n});\n\ninterface PositionOption {\n value: string;\n label: string;\n}\n\nconst positionOptions = computed<PositionOption[]>(() => {\n const options: PositionOption[] = [\n { value: \"beginning\", label: t.savedBlocks.insertAtBeginning },\n ];\n const blocks = editor.content.value.blocks;\n for (let i = 0; i < blocks.length; i++) {\n const block = blocks[i];\n const typeKey = block.type as keyof typeof t.blocks;\n const label = t.blocks[typeKey] ?? block.type;\n options.push({\n value: block.id,\n label: format(t.savedBlocks.insertAfterBlock, {\n block: `${label} ${i + 1}`,\n }),\n });\n }\n options.push({ value: \"end\", label: t.savedBlocks.insertAtEnd });\n return options;\n});\n\nconst resolvedInsertIndex = computed<number | undefined>(() => {\n if (insertPosition.value === \"end\") return undefined;\n if (insertPosition.value === \"beginning\") return 0;\n const blocks = editor.content.value.blocks;\n const idx = blocks.findIndex((b) => b.id === insertPosition.value);\n if (idx !== -1) return idx + 1;\n return undefined;\n});\n\n// `immediate` matters: the modal is mounted lazily behind a `v-if` on the same\n// state that drives `visible`, so it can mount with `visible` already true and\n// would otherwise never resolve the default insert position.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n searchQuery.value = \"\";\n categoryFilter.value = \"\";\n selectedId.value = null;\n confirmDeleteId.value = null;\n renamingId.value = null;\n // Default to after selected block, or end\n const selectedBlockId = editor.state.selectedBlockId;\n if (selectedBlockId) {\n const idx = editor.content.value.blocks.findIndex(\n (b) => b.id === selectedBlockId,\n );\n insertPosition.value = idx !== -1 ? selectedBlockId : \"end\";\n } else {\n insertPosition.value = \"end\";\n }\n }\n },\n { immediate: true },\n);\n\nfunction getBlockTypeIcons(\n saved: SavedBlock,\n): { type: string; icon: unknown }[] {\n const icons: { type: string; icon: unknown }[] = [];\n const seen = new Set<string>();\n for (const block of saved.content) {\n if (!seen.has(block.type) && blockTypeIcons[block.type]) {\n seen.add(block.type);\n icons.push({ type: block.type, icon: blockTypeIcons[block.type] });\n }\n if (icons.length >= 5) break;\n }\n return icons;\n}\n\nfunction getRemainingTypeCount(saved: SavedBlock): number {\n const types = new Set(saved.content.map((b) => b.type));\n return Math.max(0, types.size - 5);\n}\n\n/** Compact \"5m ago\" label, or \"\" when the provider supplies no usable timestamp. */\nfunction relativeLabel(saved: SavedBlock): string {\n const raw = saved.updatedAt ?? saved.createdAt;\n if (!raw) return \"\";\n return formatRelativeTime(raw, t.time, format) ?? \"\";\n}\n\n/** Absolute timestamp for the row's tooltip — locale-formatted, no i18n keys. */\nfunction absoluteLabel(saved: SavedBlock): string {\n const raw = saved.updatedAt ?? saved.createdAt;\n if (!raw) return \"\";\n const parsed = new Date(raw);\n return Number.isNaN(parsed.getTime()) ? \"\" : parsed.toLocaleString();\n}\n\nasync function handleDelete(id: string): Promise<void> {\n try {\n await savedBlocks.remove(id);\n if (selectedId.value === id) {\n selectedId.value = null;\n }\n } finally {\n confirmDeleteId.value = null;\n }\n}\n\nasync function startRename(saved: SavedBlock): Promise<void> {\n // The pencil is already hidden when editing isn't permitted; this stops a\n // programmatic call opening an editor whose commit could only fail.\n if (!savedBlocks.canUpdateBlock(saved)) return;\n renamingId.value = saved.id;\n renameDraft.value = saved.name;\n renameCategoryDraft.value = saved.category ?? \"\";\n confirmDeleteId.value = null;\n await nextTick();\n renameInput.value?.focus();\n renameInput.value?.select();\n}\n\nfunction cancelRename(): void {\n renamingId.value = null;\n renameDraft.value = \"\";\n renameCategoryDraft.value = \"\";\n}\n\nasync function commitRename(id: string): Promise<void> {\n // Guards two races: Escape sets `renamingId` to null and the unmounting\n // input can still emit `blur`, and Enter commits then blurs. Either would\n // otherwise fire a second, unwanted update.\n if (renamingId.value !== id) return;\n const nextName = renameDraft.value.trim();\n const nextCategory = renameCategoryDraft.value.trim();\n const current = savedBlocks.savedBlocks.value.find((b) => b.id === id);\n\n // An empty name is not a rename — fall back to what's stored, so clearing\n // the field and blurring can't wipe the entry's name.\n const patch: Partial<{ name: string; category: string }> = {};\n if (nextName && nextName !== current?.name) patch.name = nextName;\n // \"\" is meaningful here: it clears the category. Only skip when unchanged.\n if (nextCategory !== (current?.category ?? \"\")) patch.category = nextCategory;\n\n // Skip the round-trip when nothing actually changed.\n if (Object.keys(patch).length === 0) {\n cancelRename();\n return;\n }\n try {\n await savedBlocks.update(id, patch);\n } finally {\n cancelRename();\n }\n}\n\n/**\n * Commit when focus leaves the edit row entirely — not when it moves between\n * the name and category inputs. A plain `@blur` on each input would commit\n * (and unmount the row) the moment the user tabbed from one to the other.\n */\nfunction onEditFocusOut(event: FocusEvent, id: string): void {\n const row = event.currentTarget as HTMLElement;\n const next = event.relatedTarget as Node | null;\n if (next && row.contains(next)) return;\n void commitRename(id);\n}\n\nfunction handleInsert(): void {\n if (selected.value) {\n emit(\"insert\", selected.value, resolvedInsertIndex.value);\n }\n}\n\nfunction handleClose(): void {\n emit(\"close\");\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n // While renaming, Enter/Escape belong to the inline input, not the dialog.\n if (renamingId.value) return;\n if (event.key === \"Escape\") {\n handleClose();\n }\n if (event.key === \"Enter\" && selected.value) {\n event.preventDefault();\n handleInsert();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <!-- Explicit width, not `w-full`: the modal's parent is shrink-to-fit, so\n `width: 100%` resolved against its own contents and the 600px preview\n canvas drove the dialog's size — it measured 523px with nothing selected\n and 965px with a block selected, nearly doubling on click. A pinned\n width makes every state identical and stops any future right-pane\n content from moving it. `max-w-full` keeps it inside the backdrop on\n narrow hosts — a percentage, so it neither reintroduces the `rem`\n sensitivity of issue #209 nor the viewport mismatch of issue #575; the\n preview scrolls within. -->\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n data-testid=\"saved-blocks-browser\"\n aria-labelledby=\"tpl-saved-blocks-browser-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-[1000px] tpl:max-w-full tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <!-- Header -->\n <div\n class=\"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]\"\n >\n <h3\n id=\"tpl-saved-blocks-browser-title\"\n class=\"tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.browse }}\n </h3>\n <button\n :aria-label=\"t.savedBlocks.close\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n @click=\"handleClose\"\n >\n <X :size=\"16\" :stroke-width=\"2\" />\n </button>\n </div>\n\n <!-- Body -->\n <div class=\"tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden\">\n <!-- Left panel: saved block list -->\n <div\n class=\"tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden\"\n >\n <!-- Search + category filter -->\n <div\n class=\"tpl:flex tpl:flex-col tpl:gap-2 tpl:px-4 tpl:pt-4 tpl:pb-3\"\n >\n <div class=\"tpl:relative\">\n <Search\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]\"\n />\n <input\n v-model=\"searchQuery\"\n type=\"text\"\n :placeholder=\"t.savedBlocks.search\"\n :disabled=\"isInitialLoad\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n />\n </div>\n <!-- Only worth showing once something is actually categorised. -->\n <select\n v-if=\"savedBlocks.categories.value.length > 0\"\n v-model=\"categoryFilter\"\n data-testid=\"saved-blocks-category-filter\"\n :aria-label=\"t.savedBlocks.filterByCategory\"\n class=\"tpl:h-8 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n >\n <option value=\"\">{{ t.savedBlocks.allCategories }}</option>\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n >\n {{ option }}\n </option>\n </select>\n </div>\n\n <!-- Suggestions for the inline category editor, shared by every row -->\n <datalist id=\"tpl-saved-block-browser-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n\n <!-- List -->\n <div class=\"tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4\">\n <!-- Skeleton rows: same height and gap as a real card, so the pane\n doesn't resize when the entries land. `aria-busy` on the region\n is what a screen reader announces; the bars are decorative. -->\n <div\n v-if=\"isInitialLoad\"\n data-testid=\"saved-blocks-loading\"\n class=\"tpl:flex tpl:flex-col tpl:gap-1\"\n role=\"status\"\n aria-busy=\"true\"\n :aria-label=\"t.savedBlocks.loading\"\n >\n <div\n v-for=\"n in 3\"\n :key=\"n\"\n aria-hidden=\"true\"\n class=\"tpl-saved-block-skeleton tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]\"\n />\n <div\n class=\"tpl:mt-2 tpl:h-2.5 tpl:w-1/4 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]\"\n />\n </div>\n </div>\n\n <div\n v-else-if=\"filtered.length > 0\"\n class=\"tpl:flex tpl:flex-col tpl:gap-1\"\n >\n <template v-for=\"item in filtered\" :key=\"item.id\">\n <!-- Inline rename replaces the whole row: an <input> nested\n inside the card <button> would be invalid markup and\n wouldn't focus reliably. -->\n <div\n v-if=\"renamingId === item.id\"\n class=\"tpl:flex tpl:w-full tpl:flex-col tpl:gap-1 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-primary)]\"\n style=\"background-color: var(--tpl-primary-light)\"\n @focusout=\"onEditFocusOut($event, item.id)\"\n >\n <input\n :ref=\"(el) => (renameInput = el as HTMLInputElement | null)\"\n v-model=\"renameDraft\"\n type=\"text\"\n :aria-label=\"t.savedBlocks.rename\"\n class=\"tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n @keydown.enter.prevent.stop=\"commitRename(item.id)\"\n @keydown.esc.prevent.stop=\"cancelRename()\"\n />\n <input\n v-model=\"renameCategoryDraft\"\n type=\"text\"\n data-testid=\"saved-blocks-edit-category\"\n :aria-label=\"t.savedBlocks.category\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n list=\"tpl-saved-block-browser-categories\"\n class=\"tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n @keydown.enter.prevent.stop=\"commitRename(item.id)\"\n @keydown.esc.prevent.stop=\"cancelRename()\"\n />\n </div>\n\n <button\n v-else\n type=\"button\"\n data-testid=\"saved-block-card\"\n :aria-pressed=\"selectedId === item.id\"\n class=\"tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]\"\n :style=\"{\n borderColor:\n selectedId === item.id\n ? 'var(--tpl-primary)'\n : 'var(--tpl-border)',\n backgroundColor:\n selectedId === item.id\n ? 'var(--tpl-primary-light)'\n : 'transparent',\n }\"\n @click=\"selectedId = item.id\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <span\n class=\"tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ item.name }}\n </span>\n <span\n class=\"tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]\"\n >\n {{\n format(t.savedBlocks.blockCount, {\n count: item.content.length,\n })\n }}\n </span>\n </div>\n <div\n v-if=\"item.category\"\n class=\"tpl:mt-1 tpl:flex tpl:items-center\"\n >\n <span\n data-testid=\"saved-block-category\"\n class=\"tpl:max-w-full tpl:truncate tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]\"\n >\n {{ item.category }}\n </span>\n </div>\n <div class=\"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1\">\n <component\n :is=\"icon.icon\"\n v-for=\"icon in getBlockTypeIcons(item)\"\n :key=\"icon.type\"\n :size=\"14\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <span\n v-if=\"getRemainingTypeCount(item) > 0\"\n class=\"tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n +{{ getRemainingTypeCount(item) }}\n </span>\n <span\n v-if=\"relativeLabel(item)\"\n data-testid=\"saved-block-updated\"\n class=\"tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n :title=\"absoluteLabel(item)\"\n >\n {{ relativeLabel(item) }}\n </span>\n <button\n v-if=\"confirmDeleteId === item.id\"\n :aria-label=\"t.savedBlocks.deleteConfirm\"\n class=\"tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]\"\n style=\"background-color: transparent\"\n @click.stop=\"handleDelete(item.id)\"\n >\n {{ t.savedBlocks.deleteConfirm }}\n </button>\n <!-- Hidden, not disabled: an action the user can't perform\n is better absent than greyed out. `ml-auto` moves to\n whichever button survives so the row stays aligned. -->\n <template v-else>\n <button\n v-if=\"savedBlocks.canUpdateBlock(item)\"\n class=\"tpl-saved-block-rename-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"t.savedBlocks.rename\"\n :title=\"t.savedBlocks.rename\"\n @click.stop=\"startRename(item)\"\n >\n <Pencil :size=\"12\" :stroke-width=\"1.5\" />\n </button>\n <button\n v-if=\"savedBlocks.canDeleteBlock(item)\"\n class=\"tpl-saved-block-delete-btn tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n :class=\"{\n 'tpl:ml-auto': !savedBlocks.canUpdateBlock(item),\n }\"\n :aria-label=\"t.savedBlocks.delete\"\n :title=\"t.savedBlocks.delete\"\n @click.stop=\"confirmDeleteId = item.id\"\n >\n <Trash2 :size=\"12\" :stroke-width=\"1.5\" />\n </button>\n </template>\n </div>\n </button>\n </template>\n </div>\n\n <!-- Empty state — only once we actually know the library is empty -->\n <div\n v-else\n class=\"tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12\"\n >\n <Package\n :size=\"32\"\n :stroke-width=\"1\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <p\n v-if=\"isFiltering\"\n class=\"tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.noResults }}\n </p>\n <template v-else>\n <p class=\"tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.empty }}\n </p>\n <p\n class=\"tpl:mt-1 tpl:max-w-[220px] tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.emptyHint }}\n </p>\n </template>\n </div>\n </div>\n </div>\n\n <!-- Right panel: preview -->\n <div\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]\"\n >\n <div\n v-if=\"selected\"\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden\"\n >\n <!-- Visual preview -->\n <div class=\"tpl:flex-1 tpl:overflow-y-auto tpl:p-4\">\n <BlockPreviewCanvas :blocks=\"selected.content\" />\n </div>\n </div>\n\n <!-- Empty preview state -->\n <div\n v-else\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4\"\n >\n <Package\n :size=\"32\"\n :stroke-width=\"1\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <p\n class=\"tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.selectToPreview }}\n </p>\n </div>\n </div>\n </div>\n\n <!-- Footer -->\n <div\n class=\"tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <label\n class=\"tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.insertPosition }}\n </label>\n <select\n v-model=\"insertPosition\"\n class=\"tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n >\n <option\n v-for=\"opt in positionOptions\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n >\n {{ opt.label }}\n </option>\n </select>\n </div>\n <div class=\"tpl:flex tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-browser-close\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.close }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!selected\"\n @click=\"handleInsert\"\n >\n {{ t.savedBlocks.insert }}\n </button>\n </div>\n </div>\n </div>\n </TplModal>\n</template>\n\n<style>\n/* Subtle breathing so the placeholders read as \"loading\" rather than as empty\n rows. `prefers-reduced-motion` holds them still at full opacity — the bars\n still communicate shape without animating. */\n.tpl-saved-block-skeleton {\n animation: tpl-saved-block-pulse 1.4s ease-in-out infinite;\n}\n\n@keyframes tpl-saved-block-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.55;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tpl-saved-block-skeleton {\n animation: none;\n }\n}\n\n.tpl-saved-block-delete-btn:hover {\n color: var(--tpl-danger) !important;\n}\n\n.tpl-saved-block-rename-btn:hover {\n color: var(--tpl-primary) !important;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { primaryBtnClass } from \"../constants/styleConstants\";\nimport TplModal from \"./TplModal.vue\";\nimport { useI18n } from \"../composables\";\nimport { blockTypeIcons } from \"../utils/blockTypeIcons\";\nimport { formatRelativeTime } from \"../utils/formatRelativeTime\";\nimport { SAVED_BLOCKS_KEY, EDITOR_KEY, requireInject } from \"../keys\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport { Package, Pencil, Search, Trash2, X } from \"@lucide/vue\";\nimport { computed, defineAsyncComponent, nextTick, ref, watch } from \"vue\";\n\nconst props = defineProps<{\n visible: boolean;\n}>();\n\nconst emit = defineEmits<{\n (e: \"close\"): void;\n (e: \"insert\", saved: SavedBlock, insertIndex: number | undefined): void;\n}>();\n\nconst BlockPreviewCanvas = defineAsyncComponent(\n () => import(\"./BlockPreviewCanvas.vue\"),\n);\n\nconst { t, format } = useI18n();\nconst savedBlocks = requireInject(SAVED_BLOCKS_KEY, \"SavedBlocksBrowserModal\");\nconst editor = requireInject(EDITOR_KEY, \"SavedBlocksBrowserModal\");\n\nconst searchQuery = ref(\"\");\n/** `\"\"` = no category filter. Matched exactly against `SavedBlock.category`. */\nconst categoryFilter = ref(\"\");\nconst selectedId = ref<string | null>(null);\nconst confirmDeleteId = ref<string | null>(null);\nconst renamingId = ref<string | null>(null);\nconst renameDraft = ref(\"\");\nconst renameCategoryDraft = ref(\"\");\nconst renameInput = ref<HTMLInputElement | null>(null);\n// 'end' = append, 'beginning' = index 0, or block id = after that block\nconst insertPosition = ref<string>(\"end\");\n\n// Order is the provider's to decide — the editor never re-sorts. Whatever\n// `list()` returns is what the user sees (the bundled localStorage adapter, for\n// instance, returns newest-first). Filters only narrow; they never reorder.\n//\n// Both filters run in memory over the loaded entries rather than round-tripping\n// to the provider: that keeps a BYO provider at four dumb methods, and it is\n// what lets the category options below be derived at all — a provider-filtered\n// response could not tell us which other categories exist.\nconst filtered = computed(() => {\n const query = searchQuery.value.trim().toLowerCase();\n const category = categoryFilter.value;\n return savedBlocks.savedBlocks.value.filter((b) => {\n if (query && !b.name.toLowerCase().includes(query)) return false;\n if (category && b.category !== category) return false;\n return true;\n });\n});\n\n/**\n * The list is fetched when this modal opens, not at editor mount, so a first\n * open can arrive before the provider answers. Show the skeleton only while\n * there is *nothing* to display: on a reopen the previous entries render\n * immediately and the refetch lands underneath them.\n *\n * Without this the empty state would claim \"No saved blocks yet\" for the whole\n * duration of the request — false, not merely unhelpful.\n */\nconst isInitialLoad = computed(\n () =>\n savedBlocks.isLoading.value && savedBlocks.savedBlocks.value.length === 0,\n);\n\n/** Whether any filter is narrowing the list — drives the empty-state copy. */\nconst isFiltering = computed(\n () => searchQuery.value.trim().length > 0 || categoryFilter.value !== \"\",\n);\n\nconst selected = computed(() => {\n if (!selectedId.value) return null;\n return (\n savedBlocks.savedBlocks.value.find((b) => b.id === selectedId.value) ?? null\n );\n});\n\ninterface PositionOption {\n value: string;\n label: string;\n}\n\nconst positionOptions = computed<PositionOption[]>(() => {\n const options: PositionOption[] = [\n { value: \"beginning\", label: t.savedBlocks.insertAtBeginning },\n ];\n const blocks = editor.content.value.blocks;\n for (let i = 0; i < blocks.length; i++) {\n const block = blocks[i];\n const typeKey = block.type as keyof typeof t.blocks;\n const label = t.blocks[typeKey] ?? block.type;\n options.push({\n value: block.id,\n label: format(t.savedBlocks.insertAfterBlock, {\n block: `${label} ${i + 1}`,\n }),\n });\n }\n options.push({ value: \"end\", label: t.savedBlocks.insertAtEnd });\n return options;\n});\n\nconst resolvedInsertIndex = computed<number | undefined>(() => {\n if (insertPosition.value === \"end\") return undefined;\n if (insertPosition.value === \"beginning\") return 0;\n const blocks = editor.content.value.blocks;\n const idx = blocks.findIndex((b) => b.id === insertPosition.value);\n if (idx !== -1) return idx + 1;\n return undefined;\n});\n\n// `immediate` matters: the modal is mounted lazily behind a `v-if` on the same\n// state that drives `visible`, so it can mount with `visible` already true and\n// would otherwise never resolve the default insert position.\nwatch(\n () => props.visible,\n (visible) => {\n if (visible) {\n searchQuery.value = \"\";\n categoryFilter.value = \"\";\n selectedId.value = null;\n confirmDeleteId.value = null;\n renamingId.value = null;\n // Default to after selected block, or end\n const selectedBlockId = editor.state.selectedBlockId;\n if (selectedBlockId) {\n const idx = editor.content.value.blocks.findIndex(\n (b) => b.id === selectedBlockId,\n );\n insertPosition.value = idx !== -1 ? selectedBlockId : \"end\";\n } else {\n insertPosition.value = \"end\";\n }\n }\n },\n { immediate: true },\n);\n\nfunction getBlockTypeIcons(\n saved: SavedBlock,\n): { type: string; icon: unknown }[] {\n const icons: { type: string; icon: unknown }[] = [];\n const seen = new Set<string>();\n for (const block of saved.content) {\n if (!seen.has(block.type) && blockTypeIcons[block.type]) {\n seen.add(block.type);\n icons.push({ type: block.type, icon: blockTypeIcons[block.type] });\n }\n if (icons.length >= 5) break;\n }\n return icons;\n}\n\nfunction getRemainingTypeCount(saved: SavedBlock): number {\n const types = new Set(saved.content.map((b) => b.type));\n return Math.max(0, types.size - 5);\n}\n\n/** Compact \"5m ago\" label, or \"\" when the provider supplies no usable timestamp. */\nfunction relativeLabel(saved: SavedBlock): string {\n const raw = saved.updatedAt ?? saved.createdAt;\n if (!raw) return \"\";\n return formatRelativeTime(raw, t.time, format) ?? \"\";\n}\n\n/** Absolute timestamp for the row's tooltip — locale-formatted, no i18n keys. */\nfunction absoluteLabel(saved: SavedBlock): string {\n const raw = saved.updatedAt ?? saved.createdAt;\n if (!raw) return \"\";\n const parsed = new Date(raw);\n return Number.isNaN(parsed.getTime()) ? \"\" : parsed.toLocaleString();\n}\n\nasync function handleDelete(id: string): Promise<void> {\n try {\n await savedBlocks.remove(id);\n if (selectedId.value === id) {\n selectedId.value = null;\n }\n } finally {\n confirmDeleteId.value = null;\n }\n}\n\nasync function startRename(saved: SavedBlock): Promise<void> {\n // The pencil is already hidden when editing isn't permitted; this stops a\n // programmatic call opening an editor whose commit could only fail.\n if (!savedBlocks.canUpdateBlock(saved)) return;\n renamingId.value = saved.id;\n renameDraft.value = saved.name;\n renameCategoryDraft.value = saved.category ?? \"\";\n confirmDeleteId.value = null;\n await nextTick();\n renameInput.value?.focus();\n renameInput.value?.select();\n}\n\nfunction cancelRename(): void {\n renamingId.value = null;\n renameDraft.value = \"\";\n renameCategoryDraft.value = \"\";\n}\n\nasync function commitRename(id: string): Promise<void> {\n // Guards two races: Escape sets `renamingId` to null and the unmounting\n // input can still emit `blur`, and Enter commits then blurs. Either would\n // otherwise fire a second, unwanted update.\n if (renamingId.value !== id) return;\n const nextName = renameDraft.value.trim();\n const nextCategory = renameCategoryDraft.value.trim();\n const current = savedBlocks.savedBlocks.value.find((b) => b.id === id);\n\n // An empty name is not a rename — fall back to what's stored, so clearing\n // the field and blurring can't wipe the entry's name.\n const patch: Partial<{ name: string; category: string }> = {};\n if (nextName && nextName !== current?.name) patch.name = nextName;\n // \"\" is meaningful here: it clears the category. Only skip when unchanged.\n if (nextCategory !== (current?.category ?? \"\")) patch.category = nextCategory;\n\n // Skip the round-trip when nothing actually changed.\n if (Object.keys(patch).length === 0) {\n cancelRename();\n return;\n }\n try {\n await savedBlocks.update(id, patch);\n } finally {\n cancelRename();\n }\n}\n\n/**\n * Commit when focus leaves the edit row entirely — not when it moves between\n * the name and category inputs. A plain `@blur` on each input would commit\n * (and unmount the row) the moment the user tabbed from one to the other.\n */\nfunction onEditFocusOut(event: FocusEvent, id: string): void {\n const row = event.currentTarget as HTMLElement;\n const next = event.relatedTarget as Node | null;\n if (next && row.contains(next)) return;\n void commitRename(id);\n}\n\nfunction handleInsert(): void {\n if (selected.value) {\n emit(\"insert\", selected.value, resolvedInsertIndex.value);\n }\n}\n\nfunction handleClose(): void {\n emit(\"close\");\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n // While renaming, Enter/Escape belong to the inline input, not the dialog.\n if (renamingId.value) return;\n if (event.key === \"Escape\") {\n handleClose();\n }\n if (event.key === \"Enter\" && selected.value) {\n event.preventDefault();\n handleInsert();\n }\n}\n</script>\n\n<template>\n <TplModal :visible=\"visible\" @close=\"handleClose\" @keydown=\"handleKeydown\">\n <!-- Explicit width, not `w-full`: the modal's parent is shrink-to-fit, so\n `width: 100%` resolved against its own contents and the 600px preview\n canvas drove the dialog's size — it measured 523px with nothing selected\n and 965px with a block selected, nearly doubling on click. A pinned\n width makes every state identical and stops any future right-pane\n content from moving it. `max-w-full` keeps it inside the backdrop on\n narrow hosts — a percentage, so it neither reintroduces the `rem`\n sensitivity of issue #209 nor the viewport mismatch of issue #575; the\n preview scrolls within. -->\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n data-testid=\"saved-blocks-browser\"\n aria-labelledby=\"tpl-saved-blocks-browser-title\"\n class=\"tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-[1000px] tpl:max-w-full tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]\"\n style=\"\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <!-- Header -->\n <div\n class=\"tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]\"\n >\n <h3\n id=\"tpl-saved-blocks-browser-title\"\n class=\"tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ t.savedBlocks.browse }}\n </h3>\n <button\n :aria-label=\"t.savedBlocks.close\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n @click=\"handleClose\"\n >\n <X :size=\"16\" :stroke-width=\"2\" />\n </button>\n </div>\n\n <!-- Body -->\n <div class=\"tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden\">\n <!-- Left panel: saved block list -->\n <div\n class=\"tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden\"\n >\n <!-- Search + category filter -->\n <div\n class=\"tpl:flex tpl:flex-col tpl:gap-2 tpl:px-4 tpl:pt-4 tpl:pb-3\"\n >\n <div class=\"tpl:relative\">\n <Search\n :size=\"14\"\n :stroke-width=\"2\"\n class=\"tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]\"\n />\n <input\n v-model=\"searchQuery\"\n type=\"text\"\n :placeholder=\"t.savedBlocks.search\"\n :disabled=\"isInitialLoad\"\n class=\"tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n />\n </div>\n <!-- Only worth showing once something is actually categorised. -->\n <select\n v-if=\"savedBlocks.categories.value.length > 0\"\n v-model=\"categoryFilter\"\n data-testid=\"saved-blocks-category-filter\"\n :aria-label=\"t.savedBlocks.filterByCategory\"\n class=\"tpl:h-8 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n >\n <option value=\"\">{{ t.savedBlocks.allCategories }}</option>\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n >\n {{ option }}\n </option>\n </select>\n </div>\n\n <!-- Suggestions for the inline category editor, shared by every row -->\n <datalist id=\"tpl-saved-block-browser-categories\">\n <option\n v-for=\"option in savedBlocks.categories.value\"\n :key=\"option\"\n :value=\"option\"\n />\n </datalist>\n\n <!-- List -->\n <div class=\"tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4\">\n <!-- Skeleton rows: same height and gap as a real card, so the pane\n doesn't resize when the entries land. `aria-busy` on the region\n is what a screen reader announces; the bars are decorative. -->\n <div\n v-if=\"isInitialLoad\"\n data-testid=\"saved-blocks-loading\"\n class=\"tpl:flex tpl:flex-col tpl:gap-1\"\n role=\"status\"\n aria-busy=\"true\"\n :aria-label=\"t.savedBlocks.loading\"\n >\n <div\n v-for=\"n in 3\"\n :key=\"n\"\n aria-hidden=\"true\"\n class=\"tpl-saved-block-skeleton tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)]\"\n >\n <div\n class=\"tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]\"\n />\n <div\n class=\"tpl:mt-2 tpl:h-2.5 tpl:w-1/4 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]\"\n />\n </div>\n </div>\n\n <div\n v-else-if=\"filtered.length > 0\"\n class=\"tpl:flex tpl:flex-col tpl:gap-1\"\n >\n <template v-for=\"item in filtered\" :key=\"item.id\">\n <!-- Inline rename replaces the whole row: an <input> nested\n inside the card <button> would be invalid markup and\n wouldn't focus reliably. -->\n <div\n v-if=\"renamingId === item.id\"\n class=\"tpl:flex tpl:w-full tpl:flex-col tpl:gap-1 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-primary)]\"\n style=\"background-color: var(--tpl-primary-light)\"\n @focusout=\"onEditFocusOut($event, item.id)\"\n >\n <input\n :ref=\"(el) => (renameInput = el as HTMLInputElement | null)\"\n v-model=\"renameDraft\"\n type=\"text\"\n :aria-label=\"t.savedBlocks.rename\"\n class=\"tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n @keydown.enter.prevent.stop=\"commitRename(item.id)\"\n @keydown.esc.prevent.stop=\"cancelRename()\"\n />\n <input\n v-model=\"renameCategoryDraft\"\n type=\"text\"\n data-testid=\"saved-blocks-edit-category\"\n :aria-label=\"t.savedBlocks.category\"\n :placeholder=\"t.savedBlocks.categoryPlaceholder\"\n list=\"tpl-saved-block-browser-categories\"\n class=\"tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n @keydown.enter.prevent.stop=\"commitRename(item.id)\"\n @keydown.esc.prevent.stop=\"cancelRename()\"\n />\n </div>\n\n <button\n v-else\n type=\"button\"\n data-testid=\"saved-block-card\"\n :aria-pressed=\"selectedId === item.id\"\n class=\"tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]\"\n :style=\"{\n borderColor:\n selectedId === item.id\n ? 'var(--tpl-primary)'\n : 'var(--tpl-border)',\n backgroundColor:\n selectedId === item.id\n ? 'var(--tpl-primary-light)'\n : 'transparent',\n }\"\n @click=\"selectedId = item.id\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <span\n class=\"tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]\"\n >\n {{ item.name }}\n </span>\n <span\n class=\"tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]\"\n >\n {{\n format(t.savedBlocks.blockCount, {\n count: item.content.length,\n })\n }}\n </span>\n </div>\n <div\n v-if=\"item.category\"\n class=\"tpl:mt-1 tpl:flex tpl:items-center\"\n >\n <span\n data-testid=\"saved-block-category\"\n class=\"tpl:max-w-full tpl:truncate tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]\"\n >\n {{ item.category }}\n </span>\n </div>\n <div class=\"tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1\">\n <component\n :is=\"icon.icon\"\n v-for=\"icon in getBlockTypeIcons(item)\"\n :key=\"icon.type\"\n :size=\"14\"\n :stroke-width=\"1.5\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <span\n v-if=\"getRemainingTypeCount(item) > 0\"\n class=\"tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n >\n +{{ getRemainingTypeCount(item) }}\n </span>\n <span\n v-if=\"relativeLabel(item)\"\n data-testid=\"saved-block-updated\"\n class=\"tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]\"\n :title=\"absoluteLabel(item)\"\n >\n {{ relativeLabel(item) }}\n </span>\n <button\n v-if=\"confirmDeleteId === item.id\"\n :aria-label=\"t.savedBlocks.deleteConfirm\"\n class=\"tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]\"\n style=\"background-color: transparent\"\n @click.stop=\"handleDelete(item.id)\"\n >\n {{ t.savedBlocks.deleteConfirm }}\n </button>\n <!-- Hidden, not disabled: an action the user can't perform\n is better absent than greyed out. `ml-auto` moves to\n whichever button survives so the row stays aligned. -->\n <template v-else>\n <button\n v-if=\"savedBlocks.canUpdateBlock(item)\"\n class=\"tpl-saved-block-rename-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n :aria-label=\"t.savedBlocks.rename\"\n :title=\"t.savedBlocks.rename\"\n @click.stop=\"startRename(item)\"\n >\n <Pencil :size=\"12\" :stroke-width=\"1.5\" />\n </button>\n <button\n v-if=\"savedBlocks.canDeleteBlock(item)\"\n class=\"tpl-saved-block-delete-btn tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]\"\n :class=\"{\n 'tpl:ml-auto': !savedBlocks.canUpdateBlock(item),\n }\"\n :aria-label=\"t.savedBlocks.delete\"\n :title=\"t.savedBlocks.delete\"\n @click.stop=\"confirmDeleteId = item.id\"\n >\n <Trash2 :size=\"12\" :stroke-width=\"1.5\" />\n </button>\n </template>\n </div>\n </button>\n </template>\n </div>\n\n <!-- Empty state — only once we actually know the library is empty -->\n <div\n v-else\n class=\"tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12\"\n >\n <Package\n :size=\"32\"\n :stroke-width=\"1\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <p\n v-if=\"isFiltering\"\n class=\"tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.noResults }}\n </p>\n <template v-else>\n <p class=\"tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.empty }}\n </p>\n <p\n class=\"tpl:mt-1 tpl:max-w-[220px] tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.emptyHint }}\n </p>\n </template>\n </div>\n </div>\n </div>\n\n <!-- Right panel: preview -->\n <div\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]\"\n >\n <div\n v-if=\"selected\"\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden\"\n >\n <!-- Visual preview -->\n <div class=\"tpl:flex-1 tpl:overflow-y-auto tpl:p-4\">\n <BlockPreviewCanvas :blocks=\"selected.content\" />\n </div>\n </div>\n\n <!-- Empty preview state -->\n <div\n v-else\n class=\"tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4\"\n >\n <Package\n :size=\"32\"\n :stroke-width=\"1\"\n class=\"tpl:text-[var(--tpl-text-dim)]\"\n />\n <p\n class=\"tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.selectToPreview }}\n </p>\n </div>\n </div>\n </div>\n\n <!-- Footer -->\n <div\n class=\"tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]\"\n >\n <div class=\"tpl:flex tpl:items-center tpl:gap-2\">\n <label\n class=\"tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]\"\n >\n {{ t.savedBlocks.insertPosition }}\n </label>\n <select\n v-model=\"insertPosition\"\n class=\"tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]\"\n >\n <option\n v-for=\"opt in positionOptions\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n >\n {{ opt.label }}\n </option>\n </select>\n </div>\n <div class=\"tpl:flex tpl:gap-2\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-browser-close\"\n class=\"tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"handleClose\"\n >\n {{ t.savedBlocks.close }}\n </button>\n <button\n type=\"button\"\n :class=\"primaryBtnClass\"\n :disabled=\"!selected\"\n @click=\"handleInsert\"\n >\n {{ t.savedBlocks.insert }}\n </button>\n </div>\n </div>\n </div>\n </TplModal>\n</template>\n\n<style>\n/* Subtle breathing so the placeholders read as \"loading\" rather than as empty\n rows. `prefers-reduced-motion` holds them still at full opacity — the bars\n still communicate shape without animating. */\n.tpl-saved-block-skeleton {\n animation: tpl-saved-block-pulse 1.4s ease-in-out infinite;\n}\n\n@keyframes tpl-saved-block-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.55;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tpl-saved-block-skeleton {\n animation: none;\n }\n}\n\n.tpl-saved-block-delete-btn:hover {\n color: var(--tpl-danger) !important;\n}\n\n.tpl-saved-block-rename-btn:hover {\n color: var(--tpl-primary) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,IAAM,KAAQ,GAIR,IAAO,GAKP,KAAqB,SACnB,OAAO,mCACf,CAAA,MAAA,MAAA,EAAA,CAAA,CAAA,GAEM,EAAE,MAAG,cAAW,GAAQ,GACxB,IAAc,EAAc,IAAkB,yBAAyB,GACvE,IAAS,EAAc,IAAY,yBAAyB,GAE5D,IAAc,EAAI,EAAE,GAEpB,IAAiB,EAAI,EAAE,GACvB,IAAa,EAAmB,IAAI,GACpC,IAAkB,EAAmB,IAAI,GACzC,IAAa,EAAmB,IAAI,GACpC,IAAc,EAAI,EAAE,GACpB,IAAsB,EAAI,EAAE,GAC5B,IAAc,EAA6B,IAAI,GAE/C,IAAiB,EAAY,KAAK,GAU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,CAAC,YAAY,MAAM,GAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -5,7 +5,7 @@ var c = /* @__PURE__ */ t({
5
5
  __name: "SavedBlocksPanels",
6
6
  props: { feature: {} },
7
7
  setup(t) {
8
- let c = t, l = s(() => import("./SavedBlocksPickBar-C3BP5941.js")), u = s(() => import("./SaveBlockDialog-BBwDyRpC.js")), d = s(() => import("./SavedBlocksBrowserModal-B_zqSoWl.js"));
8
+ let c = t, l = s(() => import("./SavedBlocksPickBar-CFeccSg9.js")), u = s(() => import("./SaveBlockDialog-DUyrK4nE.js")), d = s(() => import("./SavedBlocksBrowserModal-DZrk2Fxx.js"));
9
9
  function f(e, t) {
10
10
  c.feature.insert(e, t);
11
11
  }
@@ -35,4 +35,4 @@ var c = /* @__PURE__ */ t({
35
35
  //#endregion
36
36
  export { c as default };
37
37
 
38
- //# sourceMappingURL=SavedBlocksPanels-B_XNxwzs.js.map
38
+ //# sourceMappingURL=SavedBlocksPanels-iSAXI4IM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SavedBlocksPanels-B_XNxwzs.js","names":[],"sources":["../../../src/components/SavedBlocksPanels.vue","../../../src/components/SavedBlocksPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Mount point for the saved-blocks UI, shared by the OSS and Cloud editors.\n *\n * Everything here is `defineAsyncComponent` rendered behind `v-if` on its own\n * state, so each chunk is fetched only when actually needed —\n * `defineAsyncComponent` triggers its `import()` on first render, not at\n * definition time. `Editor.vue` in turn lazy-loads *this* wrapper and renders\n * it only when a `SavedBlocksProvider` is configured, so a consumer without one\n * downloads none of it.\n *\n * The pick bar lives here rather than in `Editor.vue` so the editor shell needs\n * no knowledge of saved blocks, and the lazy-load guarantee covers the bar too.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport type { UseSavedBlocksFeatureReturn } from \"../composables/useSavedBlocksFeature\";\n\nconst props = defineProps<{\n feature: UseSavedBlocksFeatureReturn;\n}>();\n\nconst SavedBlocksPickBar = defineAsyncComponent(\n () => import(\"./SavedBlocksPickBar.vue\"),\n);\nconst SaveBlockDialog = defineAsyncComponent(\n () => import(\"./SaveBlockDialog.vue\"),\n);\nconst SavedBlocksBrowserModal = defineAsyncComponent(\n () => import(\"./SavedBlocksBrowserModal.vue\"),\n);\n\nfunction handleInsert(\n saved: SavedBlock,\n insertIndex: number | undefined,\n): void {\n props.feature.insert(saved, insertIndex);\n}\n</script>\n\n<template>\n <SavedBlocksPickBar\n v-if=\"feature.isPicking.value\"\n :count=\"feature.pickedCount.value\"\n @confirm=\"feature.confirmPicking()\"\n @cancel=\"feature.cancelPicking()\"\n />\n\n <SaveBlockDialog\n v-if=\"feature.isSaveDialogOpen.value\"\n :visible=\"feature.isSaveDialogOpen.value\"\n :picked-ids=\"[...feature.pickedIds.value]\"\n @close=\"feature.closeSaveDialog()\"\n @saved=\"feature.refresh()\"\n />\n\n <SavedBlocksBrowserModal\n v-if=\"feature.isBrowserOpen.value\"\n :visible=\"feature.isBrowserOpen.value\"\n @close=\"feature.closeBrowser()\"\n @insert=\"handleInsert\"\n />\n</template>\n","<script setup lang=\"ts\">\n/**\n * Mount point for the saved-blocks UI, shared by the OSS and Cloud editors.\n *\n * Everything here is `defineAsyncComponent` rendered behind `v-if` on its own\n * state, so each chunk is fetched only when actually needed —\n * `defineAsyncComponent` triggers its `import()` on first render, not at\n * definition time. `Editor.vue` in turn lazy-loads *this* wrapper and renders\n * it only when a `SavedBlocksProvider` is configured, so a consumer without one\n * downloads none of it.\n *\n * The pick bar lives here rather than in `Editor.vue` so the editor shell needs\n * no knowledge of saved blocks, and the lazy-load guarantee covers the bar too.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport type { UseSavedBlocksFeatureReturn } from \"../composables/useSavedBlocksFeature\";\n\nconst props = defineProps<{\n feature: UseSavedBlocksFeatureReturn;\n}>();\n\nconst SavedBlocksPickBar = defineAsyncComponent(\n () => import(\"./SavedBlocksPickBar.vue\"),\n);\nconst SaveBlockDialog = defineAsyncComponent(\n () => import(\"./SaveBlockDialog.vue\"),\n);\nconst SavedBlocksBrowserModal = defineAsyncComponent(\n () => import(\"./SavedBlocksBrowserModal.vue\"),\n);\n\nfunction handleInsert(\n saved: SavedBlock,\n insertIndex: number | undefined,\n): void {\n props.feature.insert(saved, insertIndex);\n}\n</script>\n\n<template>\n <SavedBlocksPickBar\n v-if=\"feature.isPicking.value\"\n :count=\"feature.pickedCount.value\"\n @confirm=\"feature.confirmPicking()\"\n @cancel=\"feature.cancelPicking()\"\n />\n\n <SaveBlockDialog\n v-if=\"feature.isSaveDialogOpen.value\"\n :visible=\"feature.isSaveDialogOpen.value\"\n :picked-ids=\"[...feature.pickedIds.value]\"\n @close=\"feature.closeSaveDialog()\"\n @saved=\"feature.refresh()\"\n />\n\n <SavedBlocksBrowserModal\n v-if=\"feature.isBrowserOpen.value\"\n :visible=\"feature.isBrowserOpen.value\"\n @close=\"feature.closeBrowser()\"\n @insert=\"handleInsert\"\n />\n</template>\n"],"mappings":";;;;;;;EAkBA,IAAM,IAAQ,GAIR,IAAqB,QACnB,OAAO,mCACf,GACM,IAAkB,QAChB,OAAO,gCACf,GACM,IAA0B,QACxB,OAAO,wCACf;EAEA,SAAS,EACP,GACA,GACM;GACN,EAAM,QAAQ,OAAO,GAAO,CAAW;EACzC;;GAKU,EAAA,QAAQ,UAAU,SAD1B,EAAA,GAAA,EAKE,EAAA,CAAA,GAAA;;IAHC,OAAO,EAAA,QAAQ,YAAY;IAC3B,WAAO,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,eAAc;IAC/B,UAAM,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,cAAa;;GAIxB,EAAA,QAAQ,iBAAiB,SADjC,EAAA,GAAA,EAME,EAAA,CAAA,GAAA;;IAJC,SAAS,EAAA,QAAQ,iBAAiB;IAClC,cAAU,CAAA,GAAM,EAAA,QAAQ,UAAU,KAAK;IACvC,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,gBAAe;IAC9B,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,QAAO;;GAIjB,EAAA,QAAQ,cAAc,SAD9B,EAAA,GAAA,EAKE,EAAA,CAAA,GAAA;;IAHC,SAAS,EAAA,QAAQ,cAAc;IAC/B,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,aAAY;IAC3B,UAAQ"}
1
+ {"version":3,"file":"SavedBlocksPanels-iSAXI4IM.js","names":[],"sources":["../../../src/components/SavedBlocksPanels.vue","../../../src/components/SavedBlocksPanels.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Mount point for the saved-blocks UI, shared by the OSS and Cloud editors.\n *\n * Everything here is `defineAsyncComponent` rendered behind `v-if` on its own\n * state, so each chunk is fetched only when actually needed —\n * `defineAsyncComponent` triggers its `import()` on first render, not at\n * definition time. `Editor.vue` in turn lazy-loads *this* wrapper and renders\n * it only when a `SavedBlocksProvider` is configured, so a consumer without one\n * downloads none of it.\n *\n * The pick bar lives here rather than in `Editor.vue` so the editor shell needs\n * no knowledge of saved blocks, and the lazy-load guarantee covers the bar too.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport type { UseSavedBlocksFeatureReturn } from \"../composables/useSavedBlocksFeature\";\n\nconst props = defineProps<{\n feature: UseSavedBlocksFeatureReturn;\n}>();\n\nconst SavedBlocksPickBar = defineAsyncComponent(\n () => import(\"./SavedBlocksPickBar.vue\"),\n);\nconst SaveBlockDialog = defineAsyncComponent(\n () => import(\"./SaveBlockDialog.vue\"),\n);\nconst SavedBlocksBrowserModal = defineAsyncComponent(\n () => import(\"./SavedBlocksBrowserModal.vue\"),\n);\n\nfunction handleInsert(\n saved: SavedBlock,\n insertIndex: number | undefined,\n): void {\n props.feature.insert(saved, insertIndex);\n}\n</script>\n\n<template>\n <SavedBlocksPickBar\n v-if=\"feature.isPicking.value\"\n :count=\"feature.pickedCount.value\"\n @confirm=\"feature.confirmPicking()\"\n @cancel=\"feature.cancelPicking()\"\n />\n\n <SaveBlockDialog\n v-if=\"feature.isSaveDialogOpen.value\"\n :visible=\"feature.isSaveDialogOpen.value\"\n :picked-ids=\"[...feature.pickedIds.value]\"\n @close=\"feature.closeSaveDialog()\"\n @saved=\"feature.refresh()\"\n />\n\n <SavedBlocksBrowserModal\n v-if=\"feature.isBrowserOpen.value\"\n :visible=\"feature.isBrowserOpen.value\"\n @close=\"feature.closeBrowser()\"\n @insert=\"handleInsert\"\n />\n</template>\n","<script setup lang=\"ts\">\n/**\n * Mount point for the saved-blocks UI, shared by the OSS and Cloud editors.\n *\n * Everything here is `defineAsyncComponent` rendered behind `v-if` on its own\n * state, so each chunk is fetched only when actually needed —\n * `defineAsyncComponent` triggers its `import()` on first render, not at\n * definition time. `Editor.vue` in turn lazy-loads *this* wrapper and renders\n * it only when a `SavedBlocksProvider` is configured, so a consumer without one\n * downloads none of it.\n *\n * The pick bar lives here rather than in `Editor.vue` so the editor shell needs\n * no knowledge of saved blocks, and the lazy-load guarantee covers the bar too.\n */\nimport { defineAsyncComponent } from \"vue\";\nimport type { SavedBlock } from \"@templatical/types\";\nimport type { UseSavedBlocksFeatureReturn } from \"../composables/useSavedBlocksFeature\";\n\nconst props = defineProps<{\n feature: UseSavedBlocksFeatureReturn;\n}>();\n\nconst SavedBlocksPickBar = defineAsyncComponent(\n () => import(\"./SavedBlocksPickBar.vue\"),\n);\nconst SaveBlockDialog = defineAsyncComponent(\n () => import(\"./SaveBlockDialog.vue\"),\n);\nconst SavedBlocksBrowserModal = defineAsyncComponent(\n () => import(\"./SavedBlocksBrowserModal.vue\"),\n);\n\nfunction handleInsert(\n saved: SavedBlock,\n insertIndex: number | undefined,\n): void {\n props.feature.insert(saved, insertIndex);\n}\n</script>\n\n<template>\n <SavedBlocksPickBar\n v-if=\"feature.isPicking.value\"\n :count=\"feature.pickedCount.value\"\n @confirm=\"feature.confirmPicking()\"\n @cancel=\"feature.cancelPicking()\"\n />\n\n <SaveBlockDialog\n v-if=\"feature.isSaveDialogOpen.value\"\n :visible=\"feature.isSaveDialogOpen.value\"\n :picked-ids=\"[...feature.pickedIds.value]\"\n @close=\"feature.closeSaveDialog()\"\n @saved=\"feature.refresh()\"\n />\n\n <SavedBlocksBrowserModal\n v-if=\"feature.isBrowserOpen.value\"\n :visible=\"feature.isBrowserOpen.value\"\n @close=\"feature.closeBrowser()\"\n @insert=\"handleInsert\"\n />\n</template>\n"],"mappings":";;;;;;;EAkBA,IAAM,IAAQ,GAIR,IAAqB,QACnB,OAAO,mCACf,GACM,IAAkB,QAChB,OAAO,gCACf,GACM,IAA0B,QACxB,OAAO,wCACf;EAEA,SAAS,EACP,GACA,GACM;GACN,EAAM,QAAQ,OAAO,GAAO,CAAW;EACzC;;GAKU,EAAA,QAAQ,UAAU,SAD1B,EAAA,GAAA,EAKE,EAAA,CAAA,GAAA;;IAHC,OAAO,EAAA,QAAQ,YAAY;IAC3B,WAAO,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,eAAc;IAC/B,UAAM,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,cAAa;;GAIxB,EAAA,QAAQ,iBAAiB,SADjC,EAAA,GAAA,EAME,EAAA,CAAA,GAAA;;IAJC,SAAS,EAAA,QAAQ,iBAAiB;IAClC,cAAU,CAAA,GAAM,EAAA,QAAQ,UAAU,KAAK;IACvC,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,gBAAe;IAC9B,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,QAAO;;GAIjB,EAAA,QAAQ,cAAc,SAD9B,EAAA,GAAA,EAKE,EAAA,CAAA,GAAA;;IAHC,SAAS,EAAA,QAAQ,cAAc;IAC/B,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAQ,aAAY;IAC3B,UAAQ"}
@@ -1,7 +1,7 @@
1
1
  import { N as e, S as t, at as n, b as r, g as i, p as a, ut as o, y as s } from "./draggable-BfpsXFg7.js";
2
- import "./useEditorCore-DTpSiO4S.js";
2
+ import "./useEditorCore-CwJIw1Uy.js";
3
3
  import { t as c } from "./useI18n-4sUbTM3Y.js";
4
- import { Bt as l, n as u } from "./icons-Dl5bcXmT.js";
4
+ import { Bt as l, n as u } from "./icons-BrdgOeXm.js";
5
5
  //#region src/components/SavedBlocksPickBar.vue?vue&type=script&setup=true&lang.ts
6
6
  var d = {
7
7
  "data-testid": "saved-blocks-pick-bar",
@@ -51,4 +51,4 @@ var d = {
51
51
  //#endregion
52
52
  export { v as default };
53
53
 
54
- //# sourceMappingURL=SavedBlocksPickBar-C3BP5941.js.map
54
+ //# sourceMappingURL=SavedBlocksPickBar-CFeccSg9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SavedBlocksPickBar-C3BP5941.js","names":[],"sources":["../../../src/components/SavedBlocksPickBar.vue","../../../src/components/SavedBlocksPickBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Floating bar for an active pick session: how many blocks are picked, plus\n * Save and Cancel.\n *\n * Positioned like `EditorFooter` — absolute inside `.tpl`, NOT inside the\n * canvas body, whose `overflow: auto` would clip it. The rail offsets are the\n * non-preview ones because a session can't be active in preview mode\n * (`useSavedBlocksFeature` cancels it if preview turns on).\n */\nimport { useI18n } from \"../composables\";\nimport { Bookmark, X } from \"@lucide/vue\";\n\nconst props = defineProps<{\n count: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"confirm\"): void;\n (e: \"cancel\"): void;\n}>();\n\nconst { t, format } = useI18n();\n\nfunction handleConfirm(): void {\n if (props.count > 0) emit(\"confirm\");\n}\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-pick-bar\"\n class=\"tpl:absolute tpl:bottom-10 tpl:left-12 tpl:right-[320px] tpl:z-50 tpl:flex tpl:justify-center tpl:px-4\"\n style=\"pointer-events: none\"\n >\n <div\n role=\"toolbar\"\n :aria-label=\"t.savedBlocks.pickToolbar\"\n class=\"tpl-scale-in tpl:flex tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:py-2 tpl:pl-4 tpl:pr-2 tpl:border-[var(--tpl-border)]\"\n style=\"\n pointer-events: auto;\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col\">\n <span\n data-testid=\"saved-blocks-pick-count\"\n class=\"tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]\"\n >\n {{ format(t.savedBlocks.pickCount, { count }) }}\n </span>\n <span class=\"tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.pickHint }}\n </span>\n </div>\n\n <div class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-cancel\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"emit('cancel')\"\n >\n <X :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-confirm\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)]\"\n :disabled=\"count === 0\"\n @click=\"handleConfirm\"\n >\n <Bookmark :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.save }}\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Floating bar for an active pick session: how many blocks are picked, plus\n * Save and Cancel.\n *\n * Positioned like `EditorFooter` — absolute inside `.tpl`, NOT inside the\n * canvas body, whose `overflow: auto` would clip it. The rail offsets are the\n * non-preview ones because a session can't be active in preview mode\n * (`useSavedBlocksFeature` cancels it if preview turns on).\n */\nimport { useI18n } from \"../composables\";\nimport { Bookmark, X } from \"@lucide/vue\";\n\nconst props = defineProps<{\n count: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"confirm\"): void;\n (e: \"cancel\"): void;\n}>();\n\nconst { t, format } = useI18n();\n\nfunction handleConfirm(): void {\n if (props.count > 0) emit(\"confirm\");\n}\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-pick-bar\"\n class=\"tpl:absolute tpl:bottom-10 tpl:left-12 tpl:right-[320px] tpl:z-50 tpl:flex tpl:justify-center tpl:px-4\"\n style=\"pointer-events: none\"\n >\n <div\n role=\"toolbar\"\n :aria-label=\"t.savedBlocks.pickToolbar\"\n class=\"tpl-scale-in tpl:flex tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:py-2 tpl:pl-4 tpl:pr-2 tpl:border-[var(--tpl-border)]\"\n style=\"\n pointer-events: auto;\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col\">\n <span\n data-testid=\"saved-blocks-pick-count\"\n class=\"tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]\"\n >\n {{ format(t.savedBlocks.pickCount, { count }) }}\n </span>\n <span class=\"tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.pickHint }}\n </span>\n </div>\n\n <div class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-cancel\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"emit('cancel')\"\n >\n <X :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-confirm\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)]\"\n :disabled=\"count === 0\"\n @click=\"handleConfirm\"\n >\n <Bookmark :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.save }}\n </button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAaA,IAAM,IAAQ,GAIR,IAAO,GAKP,EAAE,MAAG,cAAW,EAAQ;EAE9B,SAAS,IAAsB;GAC7B,AAAI,EAAM,QAAQ,KAAG,EAAK,SAAS;EACrC;oBAIE,EAAA,GAAA,EAiDM,OAjDN,GAiDM,CA5CJ,EA2CM,OAAA;GA1CJ,MAAK;GACJ,cAAY,EAAA,CAAA,CAAC,CAAC,YAAY;GAC3B,OAAM;GACN,OAAA;IAAA,kBAAA;IAAA,oBAAA;IAAA,cAAA;GAAA;EAMA,GAAA,CAAA,EAUM,OAVN,GAUM,CATJ,EAKO,QALP,GAKO,EADF,EAAA,CAAA,CAAM,CAAC,EAAA,CAAA,CAAC,CAAC,YAAY,WAAS,EAAA,OAAI,EAAA,MAAK,CAAA,CAAA,GAAA,CAAA,GAE5C,EAEO,QAFP,GAEO,EADF,EAAA,CAAA,CAAC,CAAC,YAAY,QAAQ,GAAA,CAAA,CAAA,CAAA,GAI7B,EAoBM,OApBN,GAoBM,CAnBJ,EAQS,UAAA;GAPP,MAAK;GACL,eAAY;GACZ,OAAM;GACL,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,QAAA;EAEZ,GAAA,CAAA,EAAkC,EAAA,CAAA,GAAA;GAA9B,MAAM;GAAK,gBAAc;EAAK,CAAA,GAAA,EAAA,MAClC,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,CAAA,CAAA,CAAA,GAEzB,EASS,UAAA;GARP,MAAK;GACL,eAAY;GACZ,OAAM;GACL,UAAU,EAAA,UAAK;GACf,SAAO;EAER,GAAA,CAAA,EAAyC,EAAA,CAAA,GAAA;GAA9B,MAAM;GAAK,gBAAc;EAAK,CAAA,GAAA,EAAA,MACzC,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,IAAI,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"SavedBlocksPickBar-CFeccSg9.js","names":[],"sources":["../../../src/components/SavedBlocksPickBar.vue","../../../src/components/SavedBlocksPickBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Floating bar for an active pick session: how many blocks are picked, plus\n * Save and Cancel.\n *\n * Positioned like `EditorFooter` — absolute inside `.tpl`, NOT inside the\n * canvas body, whose `overflow: auto` would clip it. The rail offsets are the\n * non-preview ones because a session can't be active in preview mode\n * (`useSavedBlocksFeature` cancels it if preview turns on).\n */\nimport { useI18n } from \"../composables\";\nimport { Bookmark, X } from \"@lucide/vue\";\n\nconst props = defineProps<{\n count: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"confirm\"): void;\n (e: \"cancel\"): void;\n}>();\n\nconst { t, format } = useI18n();\n\nfunction handleConfirm(): void {\n if (props.count > 0) emit(\"confirm\");\n}\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-pick-bar\"\n class=\"tpl:absolute tpl:bottom-10 tpl:left-12 tpl:right-[320px] tpl:z-50 tpl:flex tpl:justify-center tpl:px-4\"\n style=\"pointer-events: none\"\n >\n <div\n role=\"toolbar\"\n :aria-label=\"t.savedBlocks.pickToolbar\"\n class=\"tpl-scale-in tpl:flex tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:py-2 tpl:pl-4 tpl:pr-2 tpl:border-[var(--tpl-border)]\"\n style=\"\n pointer-events: auto;\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col\">\n <span\n data-testid=\"saved-blocks-pick-count\"\n class=\"tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]\"\n >\n {{ format(t.savedBlocks.pickCount, { count }) }}\n </span>\n <span class=\"tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.pickHint }}\n </span>\n </div>\n\n <div class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-cancel\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"emit('cancel')\"\n >\n <X :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-confirm\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)]\"\n :disabled=\"count === 0\"\n @click=\"handleConfirm\"\n >\n <Bookmark :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.save }}\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Floating bar for an active pick session: how many blocks are picked, plus\n * Save and Cancel.\n *\n * Positioned like `EditorFooter` — absolute inside `.tpl`, NOT inside the\n * canvas body, whose `overflow: auto` would clip it. The rail offsets are the\n * non-preview ones because a session can't be active in preview mode\n * (`useSavedBlocksFeature` cancels it if preview turns on).\n */\nimport { useI18n } from \"../composables\";\nimport { Bookmark, X } from \"@lucide/vue\";\n\nconst props = defineProps<{\n count: number;\n}>();\n\nconst emit = defineEmits<{\n (e: \"confirm\"): void;\n (e: \"cancel\"): void;\n}>();\n\nconst { t, format } = useI18n();\n\nfunction handleConfirm(): void {\n if (props.count > 0) emit(\"confirm\");\n}\n</script>\n\n<template>\n <div\n data-testid=\"saved-blocks-pick-bar\"\n class=\"tpl:absolute tpl:bottom-10 tpl:left-12 tpl:right-[320px] tpl:z-50 tpl:flex tpl:justify-center tpl:px-4\"\n style=\"pointer-events: none\"\n >\n <div\n role=\"toolbar\"\n :aria-label=\"t.savedBlocks.pickToolbar\"\n class=\"tpl-scale-in tpl:flex tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-lg)] tpl:border tpl:py-2 tpl:pl-4 tpl:pr-2 tpl:border-[var(--tpl-border)]\"\n style=\"\n pointer-events: auto;\n background-color: var(--tpl-bg-elevated);\n box-shadow: var(--tpl-shadow-xl);\n \"\n >\n <div class=\"tpl:flex tpl:flex-col\">\n <span\n data-testid=\"saved-blocks-pick-count\"\n class=\"tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]\"\n >\n {{ format(t.savedBlocks.pickCount, { count }) }}\n </span>\n <span class=\"tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]\">\n {{ t.savedBlocks.pickHint }}\n </span>\n </div>\n\n <div class=\"tpl:flex tpl:items-center tpl:gap-1.5\">\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-cancel\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]\"\n @click=\"emit('cancel')\"\n >\n <X :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.cancel }}\n </button>\n <button\n type=\"button\"\n data-testid=\"saved-blocks-pick-confirm\"\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-on-primary)]\"\n :disabled=\"count === 0\"\n @click=\"handleConfirm\"\n >\n <Bookmark :size=\"13\" :stroke-width=\"2\" />\n {{ t.savedBlocks.save }}\n </button>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAaA,IAAM,IAAQ,GAIR,IAAO,GAKP,EAAE,MAAG,cAAW,EAAQ;EAE9B,SAAS,IAAsB;GAC7B,AAAI,EAAM,QAAQ,KAAG,EAAK,SAAS;EACrC;oBAIE,EAAA,GAAA,EAiDM,OAjDN,GAiDM,CA5CJ,EA2CM,OAAA;GA1CJ,MAAK;GACJ,cAAY,EAAA,CAAA,CAAC,CAAC,YAAY;GAC3B,OAAM;GACN,OAAA;IAAA,kBAAA;IAAA,oBAAA;IAAA,cAAA;GAAA;EAMA,GAAA,CAAA,EAUM,OAVN,GAUM,CATJ,EAKO,QALP,GAKO,EADF,EAAA,CAAA,CAAM,CAAC,EAAA,CAAA,CAAC,CAAC,YAAY,WAAS,EAAA,OAAI,EAAA,MAAK,CAAA,CAAA,GAAA,CAAA,GAE5C,EAEO,QAFP,GAEO,EADF,EAAA,CAAA,CAAC,CAAC,YAAY,QAAQ,GAAA,CAAA,CAAA,CAAA,GAI7B,EAoBM,OApBN,GAoBM,CAnBJ,EAQS,UAAA;GAPP,MAAK;GACL,eAAY;GACZ,OAAM;GACL,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,QAAA;EAEZ,GAAA,CAAA,EAAkC,EAAA,CAAA,GAAA;GAA9B,MAAM;GAAK,gBAAc;EAAK,CAAA,GAAA,EAAA,MAClC,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,MAAM,GAAA,CAAA,CAAA,CAAA,GAEzB,EASS,UAAA;GARP,MAAK;GACL,eAAY;GACZ,OAAM;GACL,UAAU,EAAA,UAAK;GACf,SAAO;EAER,GAAA,CAAA,EAAyC,EAAA,CAAA,GAAA;GAA9B,MAAM;GAAK,gBAAc;EAAK,CAAA,GAAA,EAAA,MACzC,EAAG,EAAA,CAAA,CAAC,CAAC,YAAY,IAAI,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { B as e, E as t, F as n, H as r, N as i, Q as ee, R as a, S as o, at as s, b as c, ct as l, g as u, h as d, lt as f, m as p, n as m, p as h, u as g, ut as _, y as v } from "./draggable-BfpsXFg7.js";
2
2
  import { R as te, T as ne, W as y, h as b } from "./keys-oJdkdtPn.js";
3
- import { E as x, It as S, Mt as C, O as re, dt as ie, it as ae, k as w, n as oe, t as se, u as ce, wt as le, z as T } from "./icons-Dl5bcXmT.js";
3
+ import { E as x, It as S, Mt as C, O as re, Tt as ie, dt as ae, it as oe, k as w, n as se, t as ce, u as le, z as T } from "./icons-BrdgOeXm.js";
4
4
  import { t as ue } from "./LoadingTrack-Dp_QZvAK.js";
5
5
  import { t as E } from "./_plugin-vue_export-helper-B3ysoDQm.js";
6
6
  import { n as D } from "./useCloudI18n-Ch-SiRjU.js";
@@ -79,9 +79,9 @@ var M = {
79
79
  "bestPractices"
80
80
  ], Ae = {
81
81
  spam: re,
82
- readability: le,
82
+ readability: ie,
83
83
  accessibility: x,
84
- bestPractices: se
84
+ bestPractices: ce
85
85
  };
86
86
  function Q() {
87
87
  J.score(q.content.value, Y);
@@ -123,7 +123,7 @@ var M = {
123
123
  })], 8, I)) : d("", !0), h("button", {
124
124
  class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-muted)]",
125
125
  onClick: t[1] ||= (e) => G("close")
126
- }, [c(s(oe), {
126
+ }, [c(s(se), {
127
127
  size: 14,
128
128
  "stroke-width": 2
129
129
  })])])]), h("div", L, [s(J).isScoring.value ? (i(), u("div", R, [h("p", z, _(s(K).scoring.scoring), 1), c(ue, { class: "tpl:w-3/4" })])) : s(J).error.value && !s(J).scoringResult.value ? (i(), u("div", B, [
@@ -186,7 +186,7 @@ var M = {
186
186
  ], 8, pe), X.value[e] ? (i(), u("div", ge, [s(J).scoringResult.value.categories[e].findings.length === 0 ? (i(), u("div", _e, _(s(K).scoring.noFindings), 1)) : d("", !0), (i(!0), u(g, null, n(s(J).scoringResult.value.categories[e].findings, (e) => (i(), u("div", {
187
187
  key: e.id,
188
188
  class: "tpl:border-t tpl:px-3 tpl:py-2.5 tpl:first:border-t-0 tpl:border-[var(--tpl-border-light)]"
189
- }, [h("div", ve, [(i(), p(a(s(e.severity === "high" ? C : e.severity === "medium" ? ce : ie)), {
189
+ }, [h("div", ve, [(i(), p(a(s(e.severity === "high" ? C : e.severity === "medium" ? le : ae)), {
190
190
  size: 13,
191
191
  "stroke-width": 2,
192
192
  class: "tpl:mt-0.5 tpl:shrink-0",
@@ -205,7 +205,7 @@ var M = {
205
205
  style: { "background-color": "transparent" },
206
206
  disabled: s(J).fixingFindingId.value !== null,
207
207
  onClick: (t) => je(e)
208
- }, [s(J).fixingFindingId.value === e.id ? (i(), p(s(ae), {
208
+ }, [s(J).fixingFindingId.value === e.id ? (i(), p(s(oe), {
209
209
  key: 0,
210
210
  class: "tpl-spinner",
211
211
  size: 11,
@@ -228,4 +228,4 @@ var M = {
228
228
  //#endregion
229
229
  export { W as default };
230
230
 
231
- //# sourceMappingURL=TemplateScoringPanel-MvdrkgqL.js.map
231
+ //# sourceMappingURL=TemplateScoringPanel-Ct5p7X_i.js.map