@templatical/editor 0.6.4 → 0.6.5

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 (128) hide show
  1. package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-B2MT0M58.js} +34 -34
  2. package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-w5ek3Z76.js} +62 -62
  3. package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-uXTxJh06.js} +20 -20
  4. package/dist/{cdn/chunks/BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C0S6kPC4.js} +10 -9
  5. package/dist/{CloudEditor-nzrRhHIi.js → CloudEditor-_GaYluN7.js} +441 -441
  6. package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-C4eXJkXW.js} +20 -20
  7. package/dist/CommentsSidebar-BQROg36f.js +441 -0
  8. package/dist/{cdn/chunks/CountdownBlock-5YdT1uUu.js → CountdownBlock-Bxqe7zwL.js} +21 -22
  9. package/dist/CountdownToolbar-CpFAnjSo.js +210 -0
  10. package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-CfqpcWX6.js} +52 -52
  11. package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-CFkDkjBb.js} +1 -1
  12. package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-EDKHLJtb.js} +79 -79
  13. package/dist/{ModulePreviewCanvas-CHdOwV_4.js → ModulePreviewCanvas-MQxat34K.js} +29 -29
  14. package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Dw8dN1Pt.js} +88 -88
  15. package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-C8IP9HOZ.js} +218 -218
  16. package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CK3Om7ES.js} +38 -38
  17. package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-Bgu0FVr6.js} +34 -34
  18. package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-aSULEKUJ.js} +33 -33
  19. package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-BIAeCAEP.js} +82 -82
  20. package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-wcbmmWCs.js} +30 -30
  21. package/dist/{TitleEditor-fStSADI-.js → TitleEditor-21D8_OUQ.js} +67 -67
  22. package/dist/{TplModal-BwSfxIHf.js → TplModal-CINtyB6Y.js} +14 -14
  23. package/dist/{accessibility-e8JYu_zd.js → accessibility-BgUEA-Ai.js} +1 -1
  24. package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-DKetBdJx.js} +2 -2
  25. package/dist/bundle-stats.json +6 -6
  26. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BMSGhaNU.js} +34 -34
  27. package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BMSGhaNU.js.map} +1 -1
  28. package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-hNba-JqQ.js} +16 -16
  29. package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js.map → AiFeatureMenu-hNba-JqQ.js.map} +1 -1
  30. package/dist/{BlockA11yBadge-CXDLqkcJ.js → cdn/chunks/BlockA11yBadge-BIR88CvN.js} +11 -12
  31. package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-BIR88CvN.js.map} +1 -1
  32. package/dist/cdn/chunks/{CloudEditor-dwzWDF_n.js → CloudEditor-D2G2nNpQ.js} +425 -425
  33. package/dist/cdn/chunks/{CloudEditor-dwzWDF_n.js.map → CloudEditor-D2G2nNpQ.js.map} +1 -1
  34. package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-Btzom8dY.js} +20 -20
  35. package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js.map → CollaboratorBar-Btzom8dY.js.map} +1 -1
  36. package/dist/cdn/chunks/CountdownBlock-BJSAJlJ1.js +93 -0
  37. package/dist/cdn/chunks/{CountdownBlock-5YdT1uUu.js.map → CountdownBlock-BJSAJlJ1.js.map} +1 -1
  38. package/dist/cdn/chunks/CountdownToolbar-DbknNrIi.js +212 -0
  39. package/dist/cdn/chunks/{CountdownToolbar-DXPXrbAA.js.map → CountdownToolbar-DbknNrIi.js.map} +1 -1
  40. package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js → ModuleBrowserModal-BvAuW8O5.js} +43 -43
  41. package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js.map → ModuleBrowserModal-BvAuW8O5.js.map} +1 -1
  42. package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js → ModulePreviewCanvas-CYtt0boo.js} +23 -23
  43. package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js.map → ModulePreviewCanvas-CYtt0boo.js.map} +1 -1
  44. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-CVfo9ztG.js} +108 -108
  45. package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-CVfo9ztG.js.map} +1 -1
  46. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-DCo58JP8.js} +187 -187
  47. package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-DCo58JP8.js.map} +1 -1
  48. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BzCThv84.js} +33 -33
  49. package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BzCThv84.js.map} +1 -1
  50. package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-S2Lix1LD.js} +27 -27
  51. package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js.map → SaveModuleDialog-S2Lix1LD.js.map} +1 -1
  52. package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-CYzAMuUW.js} +66 -66
  53. package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js.map → TitleEditor-CYzAMuUW.js.map} +1 -1
  54. package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js → blockTypeIcons-DOzUHoor.js} +3 -3
  55. package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js.map → blockTypeIcons-DOzUHoor.js.map} +1 -1
  56. package/dist/cdn/chunks/draggable-CNhyCGIO.js +4804 -0
  57. package/dist/cdn/chunks/draggable-CNhyCGIO.js.map +1 -0
  58. package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-wafZZ0-_.js} +95 -95
  59. package/dist/cdn/chunks/{extensions-DIxF31tA.js.map → extensions-wafZZ0-_.js.map} +1 -1
  60. package/dist/cdn/chunks/{features-DEMb13KS.js → features-B4tNvoi4.js} +2260 -2267
  61. package/dist/cdn/chunks/features-B4tNvoi4.js.map +1 -0
  62. package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-B5nBFtvb.js} +2 -2
  63. package/dist/cdn/chunks/{icons-CsLTcirh.js.map → icons-B5nBFtvb.js.map} +1 -1
  64. package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BLaoBxHe.js} +1397 -1397
  65. package/dist/cdn/chunks/{media-library-CVaNvhpM.js.map → media-library-BLaoBxHe.js.map} +1 -1
  66. package/dist/cdn/chunks/{pusher-CDbNlZBE.js → pusher-bjpcqCZG.js} +2 -2
  67. package/dist/cdn/chunks/{pusher-CDbNlZBE.js.map → pusher-bjpcqCZG.js.map} +1 -1
  68. package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-D920ZxXf.js} +3 -3
  69. package/dist/cdn/chunks/{quality-BaBfc54_.js.map → quality-D920ZxXf.js.map} +1 -1
  70. package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-Yk30CckU.js} +3 -3
  71. package/dist/cdn/chunks/{renderer-CUxvx7ro.js.map → renderer-Yk30CckU.js.map} +1 -1
  72. package/dist/{rolldown-runtime-BZGGJVDF.js → cdn/chunks/rolldown-runtime-C266TIVP.js} +5 -5
  73. package/dist/cdn/chunks/{src-CRaqN-p8.js → src-kLJg7Y0m.js} +171 -171
  74. package/dist/cdn/chunks/{src-CRaqN-p8.js.map → src-kLJg7Y0m.js.map} +1 -1
  75. package/dist/cdn/chunks/styles-DrVLif14.js +2944 -0
  76. package/dist/cdn/chunks/styles-DrVLif14.js.map +1 -0
  77. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-IyIsncxY.js} +45 -46
  78. package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-IyIsncxY.js.map} +1 -1
  79. package/dist/cdn/editor.css +1 -1
  80. package/dist/cdn/editor.js +122 -122
  81. package/dist/cdn/editor.js.map +1 -1
  82. package/dist/{check-Da05j8yl.js → check-Bg5yrRmX.js} +1 -1
  83. package/dist/{chevron-down-R2uY34iD.js → chevron-down-tee-ghFi.js} +1 -1
  84. package/dist/{circle-alert-DZuGWPX-.js → circle-alert-C0L9pUQ4.js} +1 -1
  85. package/dist/{clock-CRp2sIub.js → clock-CDlEdqiP.js} +1 -1
  86. package/dist/{cloud-DEk_b4CR.js → cloud-a3VovHva.js} +145 -145
  87. package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-Di4mqmGn.js} +9 -9
  88. package/dist/{dist-B1IR0bpH.js → dist-BzRLLpfq.js} +107 -107
  89. package/dist/{dist-BFawx6IS.js → dist-Pk4MhWMP.js} +35 -35
  90. package/dist/{extensions-CUcl9Ok4.js → extensions-BF39Siqk.js} +103 -103
  91. package/dist/{image-up-MBZKKg9p.js → image-up-1D_3XDdO.js} +1 -1
  92. package/dist/index.d.ts +6 -6
  93. package/dist/{info-CJEC7piy.js → info-DTGrc0Bx.js} +1 -1
  94. package/dist/{keys-ciNfSSGj.js → keys-Bqs_0du9.js} +1 -1
  95. package/dist/{loader-circle-DsY5Yg33.js → loader-circle-_9bP23op.js} +1 -1
  96. package/dist/{message-circle-yElBbR2C.js → message-circle-gzy2ZGJ3.js} +1 -1
  97. package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-BNAhAmtL.js} +1 -1
  98. package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
  99. package/dist/{scan-line-D0vcUekt.js → scan-line-DUEg6DoT.js} +1 -1
  100. package/dist/{send-DH4oDQqC.js → send-BatIZC9a.js} +1 -1
  101. package/dist/{shield-check-CfJgs2Hd.js → shield-check-C5Gv2cM1.js} +1 -1
  102. package/dist/{sparkles-CvRXGqFs.js → sparkles-D1IGi_cC.js} +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/styles-CwJQsnSp.js +3173 -0
  105. package/dist/templatical-editor.js +99 -99
  106. package/dist/{text-align-start-BT9VUDxK.js → text-align-start-DG3aAH7Y.js} +1 -1
  107. package/dist/{trash-2-DbP2Y6t2.js → trash-2-424iqbpN.js} +1 -1
  108. package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DWQySIE2.js} +1 -1
  109. package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-CL_AwWwi.js} +4 -4
  110. package/dist/useEditorCore-DLd-5qMg.js +3784 -0
  111. package/dist/{useI18n-lb2DHDiu.js → useI18n-CgmQftNf.js} +4 -4
  112. package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-vpwrZ9eQ.js} +3 -3
  113. package/dist/vue.runtime.esm-bundler-Bxqkjqhc.js +4300 -0
  114. package/dist/{x-u2oVmjN_.js → x-Dlaenqta.js} +1 -1
  115. package/package.json +8 -8
  116. package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
  117. package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
  118. package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
  119. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
  120. package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
  121. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
  122. package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
  123. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
  124. package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
  125. package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
  126. package/dist/styles-DEXEkBvg.js +0 -3176
  127. package/dist/useEditorCore-C6ost42Q.js +0 -9342
  128. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +0 -5775
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-C3pa2siy.js";
1
+ import { t as e } from "./createLucideIcon-Di4mqmGn.js";
2
2
  var t = e("x", [["path", {
3
3
  d: "M18 6 6 18",
4
4
  key: "1bl5f8"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@templatical/editor",
3
3
  "description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "bugs": "https://github.com/templatical/sdk/issues",
6
6
  "devDependencies": {
7
7
  "@lucide/vue": "^1.11.0",
@@ -31,11 +31,11 @@
31
31
  "vite-plugin-dts": "^4.5.4",
32
32
  "vitest": "^4.1.5",
33
33
  "vue": "^3.5.33",
34
+ "vue-draggable-plus": "^0.6.0",
34
35
  "vue-tsc": "^3.2.7",
35
- "vuedraggable": "^4.1.0",
36
- "@templatical/core": "0.6.4",
37
- "@templatical/quality": "0.6.4",
38
- "@templatical/types": "0.6.4"
36
+ "@templatical/core": "0.6.5",
37
+ "@templatical/quality": "0.6.5",
38
+ "@templatical/types": "0.6.5"
39
39
  },
40
40
  "exports": {
41
41
  ".": {
@@ -63,9 +63,9 @@
63
63
  "license": "SEE LICENSE IN LICENSE",
64
64
  "module": "./dist/templatical-editor.js",
65
65
  "peerDependencies": {
66
- "@templatical/media-library": "0.6.4",
67
- "@templatical/quality": "0.6.4",
68
- "@templatical/renderer": "0.6.4"
66
+ "@templatical/media-library": "0.6.5",
67
+ "@templatical/quality": "0.6.5",
68
+ "@templatical/renderer": "0.6.5"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "@templatical/renderer": {
@@ -1,441 +0,0 @@
1
- import { Dt as e, H as t, M as n, Mt as r, O as i, Ot as a, P as o, Q as s, S as c, V as l, _ as u, b as d, d as f, g as p, h as m, it as h, m as g, p as _, s as v, t as y, y as ee, z as b } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
- import { O as x, i as te, m as ne, u as re } from "./keys-ciNfSSGj.js";
3
- import { t as ie } from "./useI18n-lb2DHDiu.js";
4
- import { t as S } from "./createLucideIcon-C3pa2siy.js";
5
- import { t as ae } from "./check-Da05j8yl.js";
6
- import { t as oe } from "./chevron-down-R2uY34iD.js";
7
- import { t as C } from "./loader-circle-DsY5Yg33.js";
8
- import { t as w } from "./message-circle-yElBbR2C.js";
9
- import { t as T } from "./send-DH4oDQqC.js";
10
- import { t as E } from "./trash-2-DbP2Y6t2.js";
11
- import { t as D } from "./x-u2oVmjN_.js";
12
- import { t as O } from "./_plugin-vue_export-helper-B0hnzhyu.js";
13
- import { n as se } from "./useCloudI18n-BuIwR6OE.js";
14
- import { t as ce } from "./formatRelativeTime-BOEf47hq.js";
15
- var le = S("chevron-up", [["path", {
16
- d: "m18 15-6-6-6 6",
17
- key: "153udz"
18
- }]]), ue = S("circle-check", [["circle", {
19
- cx: "12",
20
- cy: "12",
21
- r: "10",
22
- key: "1mglay"
23
- }], ["path", {
24
- d: "m9 12 2 2 4-4",
25
- key: "dzmm74"
26
- }]]), k = S("pencil", [["path", {
27
- d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
28
- key: "1a8usu"
29
- }], ["path", {
30
- d: "m15 5 4 4",
31
- key: "1mk7zo"
32
- }]]), de = S("reply", [["path", {
33
- d: "M20 18v-2a4 4 0 0 0-4-4H4",
34
- key: "5vmcpk"
35
- }], ["path", {
36
- d: "m9 17-5-5 5-5",
37
- key: "nvlc11"
38
- }]]), fe = {
39
- key: 0,
40
- class: "tpl-comments-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
41
- }, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, me = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, he = {
42
- key: 0,
43
- class: "tpl:ml-1 tpl:inline-flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
44
- }, ge = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, _e = { class: "tpl:flex-1 tpl:overflow-y-auto" }, ve = {
45
- key: 0,
46
- class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
47
- }, ye = {
48
- key: 1,
49
- class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"
50
- }, be = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, xe = {
51
- key: 2,
52
- class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
53
- }, Se = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, Ce = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, we = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Te = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ee = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, De = {
54
- key: 0,
55
- class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
56
- }, Oe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, ke = ["title", "onClick"], Ae = ["title", "onClick"], je = ["title", "onClick"], Me = {
57
- key: 0,
58
- class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px] tpl:text-[var(--tpl-primary)]"
59
- }, Ne = {
60
- key: 0,
61
- class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]"
62
- }, Pe = ["onClick"], Fe = {
63
- key: 2,
64
- class: "tpl:mt-2"
65
- }, Ie = ["onKeydown"], Le = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Re = ["disabled", "onClick"], ze = {
66
- key: 3,
67
- class: "tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
68
- }, Be = {
69
- key: 4,
70
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
71
- }, Ve = { class: "tpl:flex-1" }, He = ["onClick"], Ue = {
72
- key: 5,
73
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
74
- }, We = ["title", "onClick"], Ge = ["onClick"], Ke = {
75
- key: 0,
76
- class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
77
- }, qe = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Je = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Ye = { class: "tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Xe = { class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Ze = {
78
- key: 0,
79
- class: "tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]"
80
- }, Qe = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, $e = ["title", "onClick"], et = ["title", "onClick"], tt = {
81
- key: 0,
82
- class: "tpl:mt-1.5"
83
- }, nt = ["onKeydown"], rt = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, it = ["disabled", "onClick"], at = {
84
- key: 1,
85
- class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]"
86
- }, ot = {
87
- key: 2,
88
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
89
- }, st = { class: "tpl:flex-1" }, ct = ["onClick"], lt = {
90
- key: 0,
91
- class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
92
- }, ut = { class: "tpl:flex tpl:items-end tpl:gap-2" }, dt = ["placeholder", "onKeydown"], ft = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, pt = ["disabled", "onClick"], mt = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, ht = {
93
- key: 0,
94
- class: "tpl:flex tpl:min-h-[68px] tpl:items-center tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]"
95
- }, gt = {
96
- key: 1,
97
- class: "tpl-comments-input-wrapper tpl:flex tpl:min-h-[68px] tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]"
98
- }, _t = ["placeholder", "disabled"], vt = ["disabled"], A = /* @__PURE__ */ O(/* @__PURE__ */ c({
99
- __name: "CommentsSidebar",
100
- props: { visible: { type: Boolean } },
101
- emits: ["close", "filterBlock"],
102
- setup(c, { expose: S, emit: O }) {
103
- let A = c, j = O, { format: M } = ie(), { t: N } = se(), P = x(ne, "CommentsSidebar"), yt = x(te, "CommentsSidebar"), F = x(re, "CommentsSidebar"), I = s("unresolved"), L = s(null), R = s(""), z = s(null), B = s(""), V = s(null), H = s(""), U = s(/* @__PURE__ */ new Set()), W = s(null), G = s(null), bt = _(() => yt.userConfig?.id ?? null), xt = _(() => {
104
- let e = /* @__PURE__ */ new Set();
105
- for (let t of P.content.value.blocks) if (e.add(t.id), t.type === "section") for (let n of t.children) for (let t of n) e.add(t.id);
106
- return e;
107
- });
108
- function St(e) {
109
- return e ? !xt.value.has(e) : !1;
110
- }
111
- let Ct = _(() => I.value !== "block" || !L.value ? !1 : !(P.savedBlockIds?.value.has(L.value) ?? !0)), K = _(() => {
112
- let e = F.comments.value;
113
- return I.value === "unresolved" ? e = e.filter((e) => !e.resolved_at) : I.value === "block" && L.value && (e = e.filter((e) => e.block_id === L.value)), e;
114
- });
115
- b(() => A.visible, (e) => {
116
- e && F.loadComments();
117
- }), b(() => P.state.selectedBlockId, (e) => {
118
- I.value === "block" && e && (L.value = e);
119
- });
120
- function q(e, t) {
121
- I.value = e, L.value = e === "block" ? t ?? null : null;
122
- }
123
- function wt(e) {
124
- q("block", e), j("filterBlock", e);
125
- }
126
- function Tt(e) {
127
- U.value.has(e) ? U.value.delete(e) : U.value.add(e);
128
- }
129
- function Et(e) {
130
- z.value = e, B.value = "", V.value = null, U.value.has(e) || U.value.add(e);
131
- }
132
- function Dt() {
133
- z.value = null, B.value = "";
134
- }
135
- function J(e) {
136
- V.value = e.id, H.value = e.body, z.value = null;
137
- }
138
- function Y() {
139
- V.value = null, H.value = "";
140
- }
141
- function X(e) {
142
- W.value = e;
143
- }
144
- function Ot() {
145
- W.value = null;
146
- }
147
- async function Z() {
148
- let e = R.value.trim();
149
- if (!e) return;
150
- let t = I.value === "block" ? L.value : void 0;
151
- await F.addComment(e, t ?? void 0), R.value = "";
152
- }
153
- async function kt(e) {
154
- let t = B.value.trim();
155
- if (!t) return;
156
- let n = F.comments.value.find((t) => t.id === e);
157
- await F.addComment(t, n?.block_id ?? void 0, e), z.value = null, B.value = "";
158
- }
159
- async function Q(e) {
160
- let t = H.value.trim();
161
- t && (await F.editComment(e, t), V.value = null, H.value = "");
162
- }
163
- async function At(e) {
164
- await F.removeComment(e), W.value = null;
165
- }
166
- async function jt(e) {
167
- await F.toggleResolve(e);
168
- }
169
- function $(e) {
170
- return e.author_identifier === bt.value;
171
- }
172
- function Mt(e) {
173
- return ce(e, N.snapshotHistory) ?? e;
174
- }
175
- function Nt(e) {
176
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
177
- }
178
- function Pt(e, t) {
179
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), kt(t));
180
- }
181
- function Ft(e, t) {
182
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q(t)), e.key === "Escape" && Y();
183
- }
184
- function It() {
185
- i(() => {
186
- G.value?.focus();
187
- });
188
- }
189
- return S({
190
- filterByBlock: wt,
191
- focusNewComment: It
192
- }), (i, s) => (n(), m(y, {
193
- "enter-active-class": "tpl-comments-slide-enter-active",
194
- "enter-from-class": "tpl:translate-x-full",
195
- "enter-to-class": "tpl:translate-x-0",
196
- "leave-active-class": "tpl-comments-slide-leave-active",
197
- "leave-from-class": "tpl:translate-x-0",
198
- "leave-to-class": "tpl:translate-x-full"
199
- }, {
200
- default: l(() => [c.visible ? (n(), u("div", fe, [
201
- g("div", pe, [g("div", me, [
202
- d(h(w), {
203
- size: 13,
204
- "stroke-width": 2
205
- }),
206
- g("span", null, r(h(N).comments.title), 1),
207
- h(F).unresolvedCount.value > 0 ? (n(), u("span", he, r(h(F).unresolvedCount.value), 1)) : p("", !0)
208
- ]), g("button", {
209
- class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
210
- onClick: s[0] ||= (e) => j("close")
211
- }, [d(h(D), {
212
- size: 14,
213
- "stroke-width": 2
214
- })])]),
215
- g("div", ge, [
216
- g("button", {
217
- class: e(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", I.value === "unresolved" ? "tpl-comment-filter--active" : ""]),
218
- onClick: s[1] ||= (e) => q("unresolved")
219
- }, r(h(N).comments.filterUnresolved), 3),
220
- g("button", {
221
- class: e(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", I.value === "all" ? "tpl-comment-filter--active" : ""]),
222
- onClick: s[2] ||= (e) => q("all")
223
- }, r(h(N).comments.filterAll), 3),
224
- h(P).state.selectedBlockId ? (n(), u("button", {
225
- key: 0,
226
- class: e(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", I.value === "block" ? "tpl-comment-filter--active" : ""]),
227
- onClick: s[3] ||= (e) => q("block", h(P).state.selectedBlockId ?? void 0)
228
- }, r(h(N).comments.filterBlock), 3)) : p("", !0)
229
- ]),
230
- g("div", _e, [h(F).isLoading.value ? (n(), u("div", ve, [d(h(C), {
231
- class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
232
- size: 24,
233
- "stroke-width": 2
234
- })])) : K.value.length === 0 ? (n(), u("div", ye, [d(h(w), {
235
- size: 32,
236
- "stroke-width": 1.5,
237
- class: "tpl:text-[var(--tpl-text-dim)]"
238
- }), g("p", be, r(I.value === "all" ? h(N).comments.noCommentsHint : h(N).comments.noComments), 1)])) : (n(), u("div", xe, [(n(!0), u(f, null, o(K.value, (i) => (n(), u("div", {
239
- key: i.id,
240
- class: "tpl-comment-thread"
241
- }, [
242
- g("div", Se, [
243
- g("div", Ce, [g("div", we, [
244
- g("span", Te, r($(i) ? h(N).comments.ownedByYou : i.author_name), 1),
245
- g("span", Ee, r(Mt(i.created_at)), 1),
246
- i.updated_at === i.created_at ? p("", !0) : (n(), u("span", De, " (" + r(h(N).comments.edited) + ") ", 1))
247
- ]), g("div", Oe, [
248
- g("button", {
249
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
250
- title: i.resolved_at ? h(N).comments.unresolve : h(N).comments.resolve,
251
- onClick: (e) => jt(i.id)
252
- }, [d(h(ue), {
253
- size: 13,
254
- "stroke-width": 2,
255
- class: "tpl-resolve-icon",
256
- style: a({ color: i.resolved_at ? "var(--tpl-primary)" : void 0 })
257
- }, null, 8, ["style"])], 8, ke),
258
- $(i) ? (n(), u("button", {
259
- key: 0,
260
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
261
- title: h(N).comments.edit,
262
- onClick: (e) => J(i)
263
- }, [d(h(k), {
264
- size: 12,
265
- "stroke-width": 2
266
- })], 8, Ae)) : p("", !0),
267
- $(i) ? (n(), u("button", {
268
- key: 1,
269
- class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
270
- title: h(N).comments.delete,
271
- onClick: (e) => X(i.id)
272
- }, [d(h(E), {
273
- size: 12,
274
- "stroke-width": 2
275
- })], 8, je)) : p("", !0)
276
- ])]),
277
- d(y, { name: "tpl-resolve" }, {
278
- default: l(() => [i.resolved_at ? (n(), u("div", Me, [d(h(ae), {
279
- size: 10,
280
- "stroke-width": 2.5
281
- }), g("span", null, r(h(M)(h(N).comments.resolvedBy, { name: i.resolved_by_name ?? "" })), 1)])) : p("", !0)]),
282
- _: 2
283
- }, 1024),
284
- i.block_id && St(i.block_id) ? (n(), u("span", Ne, r(h(N).comments.missingBlock), 1)) : i.block_id ? (n(), u("button", {
285
- key: 1,
286
- class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
287
- onClick: (e) => h(P).selectBlock(i.block_id ?? "")
288
- }, " Block ", 8, Pe)) : p("", !0),
289
- V.value === i.id ? (n(), u("div", Fe, [t(g("textarea", {
290
- "onUpdate:modelValue": s[4] ||= (e) => H.value = e,
291
- class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
292
- rows: "3",
293
- onKeydown: (e) => Ft(e, i.id)
294
- }, null, 40, Ie), [[v, H.value]]), g("div", Le, [g("button", {
295
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
296
- disabled: !H.value.trim() || h(F).isSubmitting.value,
297
- onClick: (e) => Q(i.id)
298
- }, r(h(N).comments.save), 9, Re), g("button", {
299
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
300
- onClick: s[5] ||= (e) => Y()
301
- }, r(h(N).comments.cancel), 1)])])) : (n(), u("p", ze, r(i.body), 1)),
302
- W.value === i.id ? (n(), u("div", Be, [
303
- g("span", Ve, r(h(N).comments.deleteConfirm), 1),
304
- g("button", {
305
- class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]",
306
- onClick: (e) => At(i.id)
307
- }, r(h(N).comments.delete), 9, He),
308
- g("button", {
309
- class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
310
- onClick: s[6] ||= (e) => Ot()
311
- }, r(h(N).comments.cancel), 1)
312
- ])) : p("", !0),
313
- V.value !== i.id && W.value !== i.id ? (n(), u("div", Ue, [g("button", {
314
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
315
- title: h(N).comments.reply,
316
- onClick: (e) => Et(i.id)
317
- }, [d(h(de), {
318
- size: 13,
319
- "stroke-width": 2,
320
- class: "tpl:text-[var(--tpl-primary)]"
321
- })], 8, We), (i.replies?.length ?? 0) > 0 ? (n(), u("button", {
322
- key: 0,
323
- class: "tpl:flex tpl:items-center tpl:gap-0.5 tpl:text-[11px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
324
- onClick: (e) => Tt(i.id)
325
- }, [U.value.has(i.id) ? (n(), m(h(le), {
326
- key: 0,
327
- size: 11,
328
- "stroke-width": 2
329
- })) : (n(), m(h(oe), {
330
- key: 1,
331
- size: 11,
332
- "stroke-width": 2
333
- })), ee(" " + r((i.replies?.length ?? 0) === 1 ? h(M)(h(N).comments.replyOne, { count: String(i.replies?.length ?? 0) }) : h(M)(h(N).comments.replyMany, { count: String(i.replies?.length ?? 0) })), 1)], 8, Ge)) : p("", !0)])) : p("", !0)
334
- ]),
335
- d(y, { name: "tpl-replies" }, {
336
- default: l(() => [U.value.has(i.id) && (i.replies?.length ?? 0) > 0 ? (n(), u("div", Ke, [(n(!0), u(f, null, o(i.replies, (a, o) => (n(), u("div", {
337
- key: a.id,
338
- class: e(["tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5", o < (i.replies?.length ?? 0) - 1 ? "tpl:mb-2" : ""])
339
- }, [
340
- g("div", qe, [g("div", Je, [
341
- g("span", Ye, r($(a) ? h(N).comments.ownedByYou : a.author_name), 1),
342
- g("span", Xe, r(Mt(a.created_at)), 1),
343
- a.updated_at === a.created_at ? p("", !0) : (n(), u("span", Ze, " (" + r(h(N).comments.edited) + ") ", 1))
344
- ]), g("div", Qe, [$(a) ? (n(), u("button", {
345
- key: 0,
346
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
347
- title: h(N).comments.edit,
348
- onClick: (e) => J(a)
349
- }, [d(h(k), {
350
- size: 11,
351
- "stroke-width": 2
352
- })], 8, $e)) : p("", !0), $(a) ? (n(), u("button", {
353
- key: 1,
354
- class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
355
- title: h(N).comments.delete,
356
- onClick: (e) => X(a.id)
357
- }, [d(h(E), {
358
- size: 11,
359
- "stroke-width": 2
360
- })], 8, et)) : p("", !0)])]),
361
- V.value === a.id ? (n(), u("div", tt, [t(g("textarea", {
362
- "onUpdate:modelValue": s[7] ||= (e) => H.value = e,
363
- class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
364
- rows: "2",
365
- onKeydown: (e) => Ft(e, a.id)
366
- }, null, 40, nt), [[v, H.value]]), g("div", rt, [g("button", {
367
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
368
- disabled: !H.value.trim() || h(F).isSubmitting.value,
369
- onClick: (e) => Q(a.id)
370
- }, r(h(N).comments.save), 9, it), g("button", {
371
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
372
- onClick: s[8] ||= (e) => Y()
373
- }, r(h(N).comments.cancel), 1)])])) : (n(), u("p", at, r(a.body), 1)),
374
- W.value === a.id ? (n(), u("div", ot, [
375
- g("span", st, r(h(N).comments.deleteConfirm), 1),
376
- g("button", {
377
- class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]",
378
- onClick: (e) => At(a.id)
379
- }, r(h(N).comments.delete), 9, ct),
380
- g("button", {
381
- class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
382
- onClick: s[9] ||= (e) => Ot()
383
- }, r(h(N).comments.cancel), 1)
384
- ])) : p("", !0)
385
- ], 2))), 128))])) : p("", !0)]),
386
- _: 2
387
- }, 1024),
388
- d(y, { name: "tpl-replies" }, {
389
- default: l(() => [z.value === i.id ? (n(), u("div", lt, [g("div", ut, [t(g("textarea", {
390
- "onUpdate:modelValue": s[10] ||= (e) => B.value = e,
391
- class: "tpl:flex-1 tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
392
- placeholder: h(N).comments.replyPlaceholder,
393
- rows: "2",
394
- onKeydown: (e) => Pt(e, i.id)
395
- }, null, 40, dt), [[v, B.value]]), g("div", ft, [g("button", {
396
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]",
397
- disabled: !B.value.trim() || h(F).isSubmitting.value,
398
- onClick: (e) => kt(i.id)
399
- }, [d(h(T), {
400
- size: 14,
401
- "stroke-width": 2
402
- })], 8, pt), g("button", {
403
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
404
- onClick: s[11] ||= (e) => Dt()
405
- }, [d(h(D), {
406
- size: 14,
407
- "stroke-width": 2
408
- })])])])])) : p("", !0)]),
409
- _: 2
410
- }, 1024)
411
- ]))), 128))]))]),
412
- g("div", mt, [Ct.value ? (n(), u("div", ht, r(h(N).comments.saveTemplateFirst), 1)) : (n(), u("div", gt, [t(g("textarea", {
413
- ref_key: "newCommentInput",
414
- ref: G,
415
- "onUpdate:modelValue": s[12] ||= (e) => R.value = e,
416
- class: "tpl:max-h-24 tpl:min-h-[48px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-xs tpl:outline-none tpl:text-[var(--tpl-text)]",
417
- placeholder: h(N).comments.placeholder,
418
- disabled: h(F).isSubmitting.value,
419
- rows: "2",
420
- onKeydown: Nt
421
- }, null, 40, _t), [[v, R.value]]), g("button", {
422
- class: "tpl-comments-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]",
423
- disabled: !R.value.trim() || h(F).isSubmitting.value,
424
- onClick: Z
425
- }, [h(F).isSubmitting.value ? (n(), m(h(C), {
426
- key: 0,
427
- class: "tpl-spinner",
428
- size: 16,
429
- "stroke-width": 2
430
- })) : (n(), m(h(T), {
431
- key: 1,
432
- size: 16,
433
- "stroke-width": 2
434
- }))], 8, vt)]))])
435
- ])) : p("", !0)]),
436
- _: 1
437
- }));
438
- }
439
- }), [["__scopeId", "data-v-d204f573"]]);
440
- //#endregion
441
- export { A as default };
@@ -1,92 +0,0 @@
1
- import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
2
- import { M as t, Mt as n, Ot as r, P as i, Q as a, S as o, _ as s, d as c, g as l, it as u, m as d, p as f } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
3
- import { o as p } from "./dist-B1IR0bpH.js";
4
- import { t as m } from "./useI18n-lb2DHDiu.js";
5
- //#region src/components/blocks/CountdownBlock.vue?vue&type=script&setup=true&lang.ts
6
- var h = {
7
- key: 0,
8
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-8 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
9
- }, g = {
10
- key: 1,
11
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-4 tpl:text-xs tpl:text-[var(--tpl-text-dim)] tpl:opacity-50"
12
- }, _ = { class: "tpl:text-center" }, v = /* @__PURE__ */ o({
13
- __name: "CountdownBlock",
14
- props: {
15
- block: {},
16
- viewport: {}
17
- },
18
- setup(e) {
19
- let o = e, { t: v } = m(), y = a(Date.now());
20
- p(() => {
21
- y.value = Date.now();
22
- }, 1e3);
23
- let b = f(() => {
24
- if (!o.block.targetDate) return null;
25
- let e = new Date(o.block.targetDate);
26
- return isNaN(e.getTime()) ? null : e.getTime();
27
- }), x = f(() => b.value ? y.value >= b.value : !1), S = f(() => {
28
- if (!b.value || x.value) return {
29
- days: 0,
30
- hours: 0,
31
- minutes: 0,
32
- seconds: 0
33
- };
34
- let e = b.value - y.value, t = Math.floor(e / 1e3);
35
- return {
36
- days: Math.floor(t / 86400),
37
- hours: Math.floor(t % 86400 / 3600),
38
- minutes: Math.floor(t % 3600 / 60),
39
- seconds: t % 60
40
- };
41
- }), C = f(() => {
42
- let e = [];
43
- return o.block.showDays && e.push({
44
- value: String(S.value.days).padStart(2, "0"),
45
- label: o.block.labelDays
46
- }), o.block.showHours && e.push({
47
- value: String(S.value.hours).padStart(2, "0"),
48
- label: o.block.labelHours
49
- }), o.block.showMinutes && e.push({
50
- value: String(S.value.minutes).padStart(2, "0"),
51
- label: o.block.labelMinutes
52
- }), o.block.showSeconds && e.push({
53
- value: String(S.value.seconds).padStart(2, "0"),
54
- label: o.block.labelSeconds
55
- }), e;
56
- }), w = f(() => ({
57
- backgroundColor: o.block.backgroundColor,
58
- fontFamily: o.block.fontFamily || "inherit"
59
- })), T = f(() => ({
60
- fontSize: `${o.block.digitFontSize}px`,
61
- fontWeight: "bold",
62
- color: o.block.digitColor,
63
- lineHeight: "1.2"
64
- })), E = f(() => ({
65
- fontSize: `${o.block.labelFontSize}px`,
66
- color: o.block.labelColor,
67
- marginTop: "4px"
68
- })), D = f(() => ({
69
- fontSize: `${o.block.digitFontSize}px`,
70
- color: o.block.digitColor,
71
- fontFamily: o.block.fontFamily || "inherit"
72
- }));
73
- return (a, o) => e.block.targetDate ? x.value && e.block.hideOnExpiry ? (t(), s("div", g, n(u(v).countdown.hidden), 1)) : x.value ? (t(), s("div", {
74
- key: 2,
75
- style: r(w.value),
76
- class: "tpl:py-4 tpl:text-center"
77
- }, [d("span", { style: r({
78
- fontSize: `${e.block.digitFontSize}px`,
79
- color: e.block.digitColor
80
- }) }, n(e.block.expiredMessage), 5)], 4)) : (t(), s("div", {
81
- key: 3,
82
- style: r(w.value),
83
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4"
84
- }, [(t(!0), s(c, null, i(C.value, (i, a) => (t(), s(c, { key: i.label }, [a > 0 ? (t(), s("span", {
85
- key: 0,
86
- style: r(D.value),
87
- class: "tpl:self-start"
88
- }, n(e.block.separator), 5)) : l("", !0), d("div", _, [d("div", { style: r(T.value) }, n(i.value), 5), d("div", { style: r(E.value) }, n(i.label), 5)])], 64))), 128))], 4)) : (t(), s("div", h, n(u(v).countdown.setDate), 1));
89
- }
90
- }), y = /* @__PURE__ */ e({ default: () => b }), b = v;
91
- //#endregion
92
- export { y as n, b as t };