@templatical/editor 0.0.4 → 0.0.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 (163) hide show
  1. package/dist/AiChatSidebar-CNhSl_ty.js +228 -0
  2. package/dist/{AiFeatureMenu-K44aZa_P.js → AiFeatureMenu-BFVsjUJY.js} +23 -23
  3. package/dist/CloudEditor-Bz5Xkxej.js +1082 -0
  4. package/dist/{CollaboratorBar-BuCEcdbB.js → CollaboratorBar-D2Gu5Xj2.js} +3 -3
  5. package/dist/{CommentsSidebar-2lcqMfIP.js → CommentsSidebar-CTeEAZTj.js} +131 -131
  6. package/dist/{DesignReferenceSidebar-CNMu4Zrx.js → DesignReferenceSidebar-u2tKSQK0.js} +52 -52
  7. package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack--aUassFH.js} +1 -1
  8. package/dist/{ModuleBrowserModal-CvQ0xyQf.js → ModuleBrowserModal-DNxODPlX.js} +58 -58
  9. package/dist/{ModulePreviewCanvas-Be2B3Y07.js → ModulePreviewCanvas-DnGe1Y-2.js} +32 -32
  10. package/dist/ParagraphEditor-CYrzYJO5.js +688 -0
  11. package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BeqlWlWB.js} +2 -2
  12. package/dist/{SaveModuleDialog-BaaeH5Xm.js → SaveModuleDialog-Kde6X13X.js} +25 -25
  13. package/dist/{SnapshotHistory-BPfjiuu1.js → SnapshotHistory-B3EfIcLW.js} +7 -7
  14. package/dist/TemplateScoringPanel-D2vCRGgx.js +254 -0
  15. package/dist/{TestEmailModal-DIAlB3e_.js → TestEmailModal-Egk0DFDf.js} +3 -3
  16. package/dist/{TitleEditor-D9DPjQkX.js → TitleEditor-DwUpo4gF.js} +11 -11
  17. package/dist/{TplModal-CmTSvCY-.js → TplModal-BCruYWks.js} +4 -4
  18. package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-5TQrnOhO.js} +2 -2
  19. package/dist/{blockTypeIcons-D1RTWOkx.js → blockTypeIcons-rW4BUUNC.js} +2 -2
  20. package/dist/cdn/chunks/{AiFeatureMenu-lxVm1RjH.js → AiFeatureMenu-Dcbshcfu.js} +16 -16
  21. package/dist/cdn/chunks/AiFeatureMenu-Dcbshcfu.js.map +1 -0
  22. package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js +1056 -0
  23. package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +1 -0
  24. package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js → CollaboratorBar-sToKJfHi.js} +4 -4
  25. package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js.map → CollaboratorBar-sToKJfHi.js.map} +1 -1
  26. package/dist/cdn/chunks/{ModuleBrowserModal-CxDXzkKS.js → ModuleBrowserModal-BNhwXbWw.js} +52 -52
  27. package/dist/cdn/chunks/ModuleBrowserModal-BNhwXbWw.js.map +1 -0
  28. package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js → ModulePreviewCanvas-DylUylPU.js} +3 -3
  29. package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js.map → ModulePreviewCanvas-DylUylPU.js.map} +1 -1
  30. package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js +539 -0
  31. package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js.map +1 -0
  32. package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js → RichTextEditorContent-DvyIO3nR.js} +5 -5
  33. package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js.map → RichTextEditorContent-DvyIO3nR.js.map} +1 -1
  34. package/dist/cdn/chunks/{SaveModuleDialog-DVna2xUl.js → SaveModuleDialog-DvbSHvhF.js} +24 -24
  35. package/dist/cdn/chunks/SaveModuleDialog-DvbSHvhF.js.map +1 -0
  36. package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js → TitleEditor-tS3mgoVr.js} +10 -10
  37. package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js.map → TitleEditor-tS3mgoVr.js.map} +1 -1
  38. package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js → blockTypeIcons-DbnbyEQE.js} +3 -3
  39. package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js.map → blockTypeIcons-DbnbyEQE.js.map} +1 -1
  40. package/dist/cdn/chunks/{de-BvYD17KT.js → de-CgUR_S5I.js} +1 -1
  41. package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-CgUR_S5I.js.map} +1 -1
  42. package/dist/cdn/chunks/{de-BB3dgVOc.js → de-D8oDPhBD.js} +1 -1
  43. package/dist/cdn/chunks/de-D8oDPhBD.js.map +1 -0
  44. package/dist/cdn/chunks/{dist-B878xb_62.js → dist-BUmN5e4r.js} +15 -12
  45. package/dist/cdn/chunks/dist-BUmN5e4r.js.map +1 -0
  46. package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-m78lz0gI.js} +1591 -1563
  47. package/dist/cdn/chunks/draggable-m78lz0gI.js.map +1 -0
  48. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-CNNgvDqx.js} +1 -1
  49. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-CNNgvDqx.js.map} +1 -1
  50. package/dist/cdn/chunks/{en-CpotcOPr.js → en-BBmfBDqY.js} +1 -1
  51. package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-BBmfBDqY.js.map} +1 -1
  52. package/dist/cdn/chunks/{en-DeDcpnoS.js → en-HseRPPeK.js} +1 -1
  53. package/dist/cdn/chunks/en-HseRPPeK.js.map +1 -0
  54. package/dist/cdn/chunks/{extensions-B_kcV0tK.js → extensions-ClpY3m0W.js} +31 -31
  55. package/dist/cdn/chunks/{extensions-B_kcV0tK.js.map → extensions-ClpY3m0W.js.map} +1 -1
  56. package/dist/cdn/chunks/{features-ofOGnSC0.js → features-B5dGxWLi.js} +1645 -1608
  57. package/dist/cdn/chunks/features-B5dGxWLi.js.map +1 -0
  58. package/dist/cdn/chunks/{icons-bIb7PBOE.js → icons-hflTyPmb.js} +8 -8
  59. package/dist/cdn/chunks/icons-hflTyPmb.js.map +1 -0
  60. package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-BxyRVCKv.js} +24 -17
  61. package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +1 -0
  62. package/dist/cdn/chunks/{media-library-BIYzV2Y2.js → media-library-Dgy-V-JA.js} +547 -543
  63. package/dist/cdn/chunks/{media-library-BIYzV2Y2.js.map → media-library-Dgy-V-JA.js.map} +1 -1
  64. package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-D-m2WSdL.js} +10 -7
  65. package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +1 -0
  66. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
  67. package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
  68. package/dist/cdn/chunks/{src-BuW9oYtm.js → src-TDwMmqm0.js} +7 -7
  69. package/dist/cdn/chunks/{src-BuW9oYtm.js.map → src-TDwMmqm0.js.map} +1 -1
  70. package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js → styleConstants-DFe3I4Op.js} +6 -6
  71. package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
  72. package/dist/cdn/chunks/{styles-DQFExz-T.js → styles-hCOCOR6K.js} +1229 -1101
  73. package/dist/cdn/chunks/styles-hCOCOR6K.js.map +1 -0
  74. package/dist/cdn/chunks/{tiptap-DplY-S-k.js → tiptap-C28NLMX8.js} +1531 -1309
  75. package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +1 -0
  76. package/dist/cdn/editor.css +1 -1
  77. package/dist/cdn/editor.js +112 -141
  78. package/dist/cdn/editor.js.map +1 -1
  79. package/dist/{check-B7kDuZmP.js → check-B5S-C0bz.js} +1 -1
  80. package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-CjsV1T0W.js} +1 -1
  81. package/dist/{circle-alert-E2vYPs5r.js → circle-alert-CVTmJHKW.js} +1 -1
  82. package/dist/{clock-lWIIQA3C.js → clock-CAjdSHBy.js} +1 -1
  83. package/dist/{dist-CG-vEqSU.js → dist-Ac4o1O4a.js} +2 -2
  84. package/dist/{dist-BkIys9zn.js → dist-B4LTlrAn.js} +6 -6
  85. package/dist/{dist-ChAGLpWo.js → dist-BTtKPcd2.js} +2 -2
  86. package/dist/{dist-C1BIRHCQ.js → dist-CBr-qhie.js} +2 -2
  87. package/dist/{dist-DmOE-Ubp.js → dist-COOFiBFV.js} +2 -2
  88. package/dist/{dist-4LiM9FDd.js → dist-COguaIvm.js} +2 -2
  89. package/dist/{dist-Bu7veieH.js → dist-Crqkuf-w.js} +2 -2
  90. package/dist/{dist-DkypH7qG.js → dist-DEJZ9iAU.js} +2 -2
  91. package/dist/{dist-D_HQYSY-.js → dist-DHYuVJ_7.js} +2 -2
  92. package/dist/{dist-C_ymrGFi.js → dist-DJrDTuRr.js} +973 -958
  93. package/dist/{dist-DysAFIPy.js → dist-DPM-DFvh.js} +142 -114
  94. package/dist/{dist-DrvKRSU6.js → dist-DfqLGwSF.js} +2 -2
  95. package/dist/dist-DmVOCJjI.js +5 -0
  96. package/dist/{extensions-DEjfEFhD.js → extensions-C6xp_B7K.js} +3 -3
  97. package/dist/{image-up-X4xIq4ea.js → image-up-vZa1Txr-.js} +1 -1
  98. package/dist/index.d.ts +223 -0
  99. package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-C02owkex.js} +20 -15
  100. package/dist/{loader-circle-BTQQxC3l.js → loader-circle-DilFjHSk.js} +1 -1
  101. package/dist/{message-circle-Blgm6V_h.js → message-circle-Dpcnc2oa.js} +1 -1
  102. package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-4r7rkHHX.js} +1 -1
  103. package/dist/rolldown-runtime-gEudmnaM.js +23 -0
  104. package/dist/{scan-line-7lZPfOdm.js → scan-line-684IxPQ0.js} +1 -1
  105. package/dist/{send-C0ltAQrv.js → send-ChDw64yL.js} +1 -1
  106. package/dist/{shield-check-f-qv4RKs.js → shield-check-9dhLdyST.js} +1 -1
  107. package/dist/{sparkles-KhBCGlqB.js → sparkles-Co9fkDcv.js} +1 -1
  108. package/dist/{styleConstants-D4SOZGBV.js → styleConstants-RV3eYwkD.js} +6 -6
  109. package/dist/styles-nvxFh6L6.js +3557 -0
  110. package/dist/templatical-editor.css +1 -1
  111. package/dist/templatical-editor.js +111 -141
  112. package/dist/templatical-editor.umd.cjs +63 -73
  113. package/dist/{trash-2-OwjZ-guZ.js → trash-2-CZkMtjeC.js} +1 -1
  114. package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-Dvt51agD.js} +1 -1
  115. package/dist/{useEditorCore-CjwRMl7K.js → useEditorCore-ColJh1ST.js} +1183 -1182
  116. package/dist/{x-CGlq2XQe.js → x-CU2XZOkQ.js} +1 -1
  117. package/package.json +52 -49
  118. package/dist/AiChatSidebar-CjfhTZwo.js +0 -214
  119. package/dist/CloudEditor-DFyuRxUV.js +0 -926
  120. package/dist/ParagraphEditor-CcMPnbDr.js +0 -652
  121. package/dist/TemplateScoringPanel-D58A23Vq.js +0 -249
  122. package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +0 -2
  123. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +0 -1
  124. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +0 -900
  125. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +0 -1
  126. package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +0 -2
  127. package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +0 -2
  128. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +0 -1
  129. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +0 -503
  130. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +0 -1
  131. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +0 -1
  132. package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +0 -2
  133. package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +0 -2
  134. package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +0 -2
  135. package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
  136. package/dist/cdn/chunks/dist-B6AUkMyh.js +0 -2
  137. package/dist/cdn/chunks/dist-B878xb_62.js.map +0 -1
  138. package/dist/cdn/chunks/dist-Bf1Op9A1.js +0 -2
  139. package/dist/cdn/chunks/dist-BkETaOfw.js +0 -2
  140. package/dist/cdn/chunks/dist-CJcMnY7o.js +0 -2
  141. package/dist/cdn/chunks/dist-CWsl6S1K.js +0 -2
  142. package/dist/cdn/chunks/dist-CllLxIMQ.js +0 -2
  143. package/dist/cdn/chunks/dist-Cs0wFwdw.js +0 -2
  144. package/dist/cdn/chunks/dist-DLWHlekl.js +0 -2
  145. package/dist/cdn/chunks/dist-DS3_HVpX.js +0 -2
  146. package/dist/cdn/chunks/dist-DTXopj1a.js +0 -2
  147. package/dist/cdn/chunks/dist-DnwLoNLm.js +0 -2
  148. package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
  149. package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
  150. package/dist/cdn/chunks/features-ofOGnSC0.js.map +0 -1
  151. package/dist/cdn/chunks/icons-bIb7PBOE.js.map +0 -1
  152. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
  153. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
  154. package/dist/cdn/chunks/styles-DQFExz-T.js.map +0 -1
  155. package/dist/cdn/chunks/tiptap-DplY-S-k.js.map +0 -1
  156. package/dist/dist-Dxnd0GRf.js +0 -5
  157. package/dist/styles-CgLaxDfu.js +0 -3428
  158. /package/dist/{de-D7TLGIPA.js → de-Dh8ON-dm.js} +0 -0
  159. /package/dist/{emojiData-BfWQS72m.js → emojiData-Qc8mH_zW.js} +0 -0
  160. /package/dist/{en-DvtiEMwP.js → en-C7IShRSD.js} +0 -0
  161. /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-D8f6NR7i.js} +0 -0
  162. /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
  163. /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { n as e } from "./_plugin-vue_export-helper-B1-bu7yR.js";
1
+ import { n as e } from "./_plugin-vue_export-helper-5TQrnOhO.js";
2
2
  var t = e("x", [["path", {
3
3
  d: "M18 6 6 18",
4
4
  key: "1bl5f8"
package/package.json CHANGED
@@ -1,15 +1,39 @@
1
1
  {
2
2
  "name": "@templatical/editor",
3
- "version": "0.0.4",
4
- "publishConfig": {
5
- "access": "public"
6
- },
7
3
  "description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
8
- "license": "SEE LICENSE IN LICENSE",
9
- "type": "module",
10
- "main": "./dist/templatical-editor.umd.cjs",
11
- "module": "./dist/templatical-editor.js",
12
- "types": "./dist/index.d.ts",
4
+ "version": "0.0.6",
5
+ "dependencies": {
6
+ "@lucide/vue": "^1.11.0",
7
+ "@templatical/core": "workspace:*",
8
+ "@templatical/types": "workspace:*",
9
+ "@tiptap/core": "^3.22.4",
10
+ "@tiptap/extension-color": "^3.22.4",
11
+ "@tiptap/extension-font-family": "^3.22.4",
12
+ "@tiptap/extension-highlight": "^3.22.4",
13
+ "@tiptap/extension-link": "^3.22.4",
14
+ "@tiptap/extension-subscript": "^3.22.4",
15
+ "@tiptap/extension-superscript": "^3.22.4",
16
+ "@tiptap/extension-text-align": "^3.22.4",
17
+ "@tiptap/extension-text-style": "^3.22.4",
18
+ "@tiptap/extension-underline": "^3.22.4",
19
+ "@tiptap/starter-kit": "^3.22.4",
20
+ "@tiptap/vue-3": "^3.22.4",
21
+ "@vueuse/core": "^14.2.1",
22
+ "liquidjs": "^10.25.7",
23
+ "vanilla-colorful": "^0.7.2",
24
+ "vuedraggable": "^4.1.0"
25
+ },
26
+ "devDependencies": {
27
+ "@vitejs/plugin-vue": "^6.0.6",
28
+ "@vue/test-utils": "^2.4.8",
29
+ "happy-dom": "^20.9.0",
30
+ "typescript": "^6.0.3",
31
+ "vite": "^8.0.10",
32
+ "vite-plugin-dts": "^4.5.4",
33
+ "vitest": "^4.1.5",
34
+ "vue": "^3.5.33",
35
+ "vue-tsc": "^3.2.7"
36
+ },
13
37
  "exports": {
14
38
  ".": {
15
39
  "types": "./dist/index.d.ts",
@@ -21,39 +45,14 @@
21
45
  "files": [
22
46
  "dist"
23
47
  ],
24
- "scripts": {
25
- "build": "vite build",
26
- "build:cdn": "vite build --config vite.cdn.config.ts",
27
- "build:all": "vite build && vite build --config vite.cdn.config.ts",
28
- "test": "vitest run",
29
- "typecheck": "vue-tsc --noEmit"
30
- },
31
- "dependencies": {
32
- "@templatical/core": "workspace:*",
33
- "@templatical/types": "workspace:*",
34
- "@tiptap/core": "^3.22.0",
35
- "@tiptap/extension-color": "^3.22.0",
36
- "@tiptap/extension-font-family": "^3.22.0",
37
- "@tiptap/extension-highlight": "^3.22.0",
38
- "@tiptap/extension-link": "^3.22.0",
39
- "@tiptap/extension-subscript": "^3.22.0",
40
- "@tiptap/extension-superscript": "^3.22.0",
41
- "@tiptap/extension-text-align": "^3.22.0",
42
- "@tiptap/extension-text-style": "^3.22.0",
43
- "@tiptap/extension-underline": "^3.22.0",
44
- "@tiptap/starter-kit": "^3.22.0",
45
- "@tiptap/vue-3": "^3.22.0",
46
- "@vueuse/core": "^14.0.0",
47
- "liquidjs": "^10.0.0",
48
- "@lucide/vue": "^1.0.0",
49
- "vanilla-colorful": "^0.7.2",
50
- "vuedraggable": "^4.1.0"
51
- },
48
+ "license": "SEE LICENSE IN LICENSE",
49
+ "main": "./dist/templatical-editor.umd.cjs",
50
+ "module": "./dist/templatical-editor.js",
52
51
  "peerDependencies": {
53
- "vue": "^3.5.0",
54
- "tailwindcss": "^4.0.0",
55
- "@templatical/renderer": "^0.0.4",
56
- "@templatical/media-library": "workspace:*"
52
+ "@templatical/media-library": "workspace:*",
53
+ "@templatical/renderer": "^0.0.6",
54
+ "tailwindcss": "^4.2.4",
55
+ "vue": "^3.5.0"
57
56
  },
58
57
  "peerDependenciesMeta": {
59
58
  "@templatical/renderer": {
@@ -63,12 +62,16 @@
63
62
  "optional": true
64
63
  }
65
64
  },
66
- "devDependencies": {
67
- "@vitejs/plugin-vue": "^6.0.0",
68
- "typescript": "^6.0.0",
69
- "vite": "^8.0.0",
70
- "vitest": "^4.0.0",
71
- "vue": "^3.5.0",
72
- "vue-tsc": "^3.0.0"
73
- }
65
+ "publishConfig": {
66
+ "access": "public"
67
+ },
68
+ "scripts": {
69
+ "build": "vite build",
70
+ "build:all": "vite build && vite build --config vite.cdn.config.ts",
71
+ "build:cdn": "vite build --config vite.cdn.config.ts",
72
+ "test": "vitest run",
73
+ "typecheck": "vue-tsc --noEmit"
74
+ },
75
+ "type": "module",
76
+ "types": "./dist/index.d.ts"
74
77
  }
@@ -1,214 +0,0 @@
1
- import { o as e, s as t } from "./dist-CG-vEqSU.js";
2
- import { C as n, f as ee, g as te, r as ne } from "./keys-C0MQRs8d.js";
3
- import { n as r, t as i } from "./_plugin-vue_export-helper-B1-bu7yR.js";
4
- import { t as re } from "./circle-alert-E2vYPs5r.js";
5
- import { t as ie } from "./loader-circle-BTQQxC3l.js";
6
- import { t as ae } from "./send-C0ltAQrv.js";
7
- import { t as a } from "./sparkles-KhBCGlqB.js";
8
- import { t as oe } from "./trash-2-OwjZ-guZ.js";
9
- import { t as se } from "./x-CGlq2XQe.js";
10
- import { t as ce } from "./LoadingTrack-vK8W2PJf.js";
11
- import { Fragment as o, Transition as le, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, nextTick as h, normalizeClass as ue, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, vModelText as de, watch as x, withCtx as fe, withDirectives as pe } from "vue";
12
- import { useAiChat as S } from "@templatical/core/cloud";
13
- var C = r("redo-2", [["path", {
14
- d: "m15 14 5-5-5-5",
15
- key: "12vg1m"
16
- }], ["path", {
17
- d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
18
- key: "6uklza"
19
- }]]), w = r("undo-2", [["path", {
20
- d: "M9 14 4 9l5-5",
21
- key: "102s5s"
22
- }], ["path", {
23
- d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
24
- key: "f3b9sd"
25
- }]]), T = {
26
- key: 0,
27
- class: "tpl-ai-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)]"
28
- }, E = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, D = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, O = { class: "tpl:flex tpl:items-center tpl:gap-1" }, k = ["title"], A = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col" }, j = {
29
- key: 0,
30
- class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
31
- }, M = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, N = {
32
- key: 1,
33
- class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
34
- }, P = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, F = {
35
- key: 2,
36
- class: "tpl:flex tpl:flex-col tpl:gap-4"
37
- }, I = {
38
- key: 0,
39
- class: "tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",
40
- style: {
41
- "background-color": "var(--tpl-primary-light)",
42
- color: "var(--tpl-text)",
43
- "max-width": "85%",
44
- "box-shadow": "var(--tpl-shadow)"
45
- }
46
- }, L = {
47
- key: 1,
48
- class: "tpl:flex tpl:flex-col tpl:gap-2"
49
- }, R = {
50
- key: 1,
51
- class: "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",
52
- style: {
53
- "max-width": "85%",
54
- "background-color": "var(--tpl-bg)",
55
- color: "var(--tpl-text)",
56
- "box-shadow": "var(--tpl-shadow)"
57
- }
58
- }, z = {
59
- key: 0,
60
- class: "tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",
61
- style: {
62
- "background-color": "var(--tpl-danger-light)",
63
- color: "var(--tpl-danger)"
64
- }
65
- }, B = {
66
- key: 1,
67
- class: "tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3",
68
- style: {
69
- "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 50%,\n transparent\n )",
70
- "backdrop-filter": "blur(2px)"
71
- }
72
- }, me = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, he = ["onClick"], ge = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, _e = { class: "tpl-ai-input-wrapper tpl:flex 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)]" }, ve = ["placeholder", "disabled"], ye = ["disabled"], be = { class: "tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, V = /* @__PURE__ */ i(/* @__PURE__ */ p({
73
- __name: "AiChatSidebar",
74
- props: {
75
- visible: { type: Boolean },
76
- onApply: { type: Function }
77
- },
78
- emits: ["close"],
79
- setup(r, { emit: i }) {
80
- let p = r, V = i, H = m(n), U = m(ee), xe = m(ne), W = m(te, []), G = S({
81
- authManager: xe,
82
- getTemplateId: () => U.state.template?.id ?? null,
83
- onApply: p.onApply,
84
- onError: void 0
85
- }), K = _(""), q = _(null), J = _(!1), Y = _(0), { pause: X, resume: Se } = e(() => {
86
- let e = G.suggestions.value?.length ?? 0;
87
- Y.value < e ? Y.value++ : X();
88
- }, 150, { immediate: !1 }), { start: Ce } = t(() => Se(), 100, { immediate: !1 });
89
- x(() => G.suggestions.value?.length ?? 0, (e) => {
90
- if (X(), e === 0) {
91
- Y.value = 0;
92
- return;
93
- }
94
- Y.value = 0, Ce();
95
- });
96
- function Z() {
97
- h(() => {
98
- q.value && (q.value.scrollTop = q.value.scrollHeight);
99
- });
100
- }
101
- x(() => G.messages.value?.length ?? 0, () => Z()), x(() => p.visible, async (e) => {
102
- e && !J.value && (J.value = !0, await G.loadConversation(), (G.messages.value?.length ?? 0) === 0 && U.content.value.blocks.length === 0 && G.loadSuggestions(U.content.value, W));
103
- });
104
- async function Q() {
105
- let e = K.value.trim();
106
- !e || G.isGenerating.value || (K.value = "", G.error.value = null, G.failedPrompt.value = null, Z(), await G.sendPrompt(e, U.content.value, W), G.failedPrompt.value && (K.value = G.failedPrompt.value), Z());
107
- }
108
- function $(e) {
109
- return e.replace(/```json[\s\S]*?```/g, "").replace(/```json[\s\S]*/g, "").trim();
110
- }
111
- function we(e) {
112
- X(), K.value = e, Q();
113
- }
114
- function Te(e) {
115
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
116
- }
117
- return (e, t) => (g(), s(le, {
118
- "enter-active-class": "tpl-ai-slide-enter-active",
119
- "enter-from-class": "tpl:translate-x-full",
120
- "enter-to-class": "tpl:translate-x-0",
121
- "leave-active-class": "tpl-ai-slide-leave-active",
122
- "leave-from-class": "tpl:translate-x-0",
123
- "leave-to-class": "tpl:translate-x-full"
124
- }, {
125
- default: fe(() => [r.visible ? (g(), l("div", T, [
126
- u("div", E, [u("div", D, [f(b(a), {
127
- size: 13,
128
- "stroke-width": 2
129
- }), u("span", null, y(b(H).aiChat.title), 1)]), u("div", O, [(b(G).messages.value?.length ?? 0) > 0 ? (g(), l("button", {
130
- key: 0,
131
- class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
132
- title: b(H).aiChat.clear,
133
- onClick: t[0] ||= (e) => b(G).clearChat()
134
- }, [f(b(oe), {
135
- size: 14,
136
- "stroke-width": 2
137
- })], 8, k)) : c("", !0), u("button", {
138
- class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
139
- onClick: t[1] ||= (e) => V("close")
140
- }, [f(b(se), {
141
- size: 14,
142
- "stroke-width": 2
143
- })])])]),
144
- u("div", A, [
145
- u("div", {
146
- ref_key: "messagesContainer",
147
- ref: q,
148
- class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4"
149
- }, [b(G).isLoadingHistory.value ? (g(), l("div", j, [f(b(ie), {
150
- class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
151
- size: 24,
152
- "stroke-width": 2
153
- }), u("p", M, y(b(H).aiChat.loadingHistory), 1)])) : (b(G).messages.value?.length ?? 0) === 0 ? (g(), l("div", N, [f(b(a), {
154
- size: 32,
155
- "stroke-width": 1.5,
156
- class: "tpl:text-[var(--tpl-text-dim)]"
157
- }), u("p", P, y(b(H).aiChat.placeholder), 1)])) : (g(), l("div", F, [(g(!0), l(o, null, v(b(G).messages.value, (e, n) => (g(), l("div", {
158
- key: e.id,
159
- class: "tpl:flex tpl:flex-col tpl:gap-2"
160
- }, [e.role === "user" ? (g(), l("div", I, y(e.content), 1)) : (g(), l("div", L, [!$(e.content) && b(G).isGenerating.value && n === (b(G).messages.value?.length ?? 0) - 1 ? (g(), s(ce, { key: 0 })) : (g(), l("div", R, y($(e.content) || b(H).aiChat.applied), 1)), e.id === b(G).lastApplyMessageId.value && !b(G).isGenerating.value ? (g(), l("button", {
161
- key: 2,
162
- class: "tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:self-start tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
163
- style: {
164
- "border-color": "var(--tpl-border)",
165
- color: "var(--tpl-text-muted)",
166
- "background-color": "transparent"
167
- },
168
- onClick: t[2] ||= (e) => b(G).toggleLastRevert()
169
- }, [b(G).isLastChangeReverted.value ? (g(), l(o, { key: 0 }, [f(b(C), {
170
- size: 12,
171
- "stroke-width": 2
172
- }), d(" " + y(b(H).aiChat.reapply), 1)], 64)) : (g(), l(o, { key: 1 }, [f(b(w), {
173
- size: 12,
174
- "stroke-width": 2
175
- }), d(" " + y(b(H).aiChat.revert), 1)], 64))])) : c("", !0)]))]))), 128))]))], 512),
176
- b(G).error.value ? (g(), l("div", z, [f(b(re), {
177
- size: 14,
178
- "stroke-width": 2,
179
- class: "tpl:mt-0.5 tpl:shrink-0"
180
- }), u("span", null, y(b(G).error.value === "ai_apply_failed" ? b(H).aiChat.applyFailed : b(H).aiChat.error), 1)])) : c("", !0),
181
- (b(G).suggestions.value?.length ?? 0) > 0 ? (g(), l("div", B, [u("div", me, [(g(!0), l(o, null, v(b(G).suggestions.value ?? [], (e, t) => (g(), l("button", {
182
- key: t,
183
- class: ue(["tpl-suggestion-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out", (b(G).suggestions.value?.length ?? 0) - 1 - t < Y.value ? "tpl:translate-y-0 tpl:opacity-100" : "tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0"]),
184
- style: {
185
- "border-color": "var(--tpl-border)",
186
- color: "var(--tpl-primary)",
187
- "background-color": "var(--tpl-bg)",
188
- "box-shadow": "var(--tpl-shadow)"
189
- },
190
- onClick: (t) => we(e)
191
- }, y(e), 11, he))), 128))])])) : c("", !0)
192
- ]),
193
- u("div", ge, [u("div", _e, [pe(u("textarea", {
194
- "onUpdate:modelValue": t[3] ||= (e) => K.value = e,
195
- class: "tpl:max-h-32 tpl:min-h-[64px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none tpl:text-[var(--tpl-text)]",
196
- placeholder: b(H).aiChat.inputPlaceholder,
197
- disabled: b(G).isGenerating.value,
198
- rows: "3",
199
- onKeydown: Te
200
- }, null, 40, ve), [[de, K.value]]), u("button", {
201
- class: "tpl-ai-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)]",
202
- disabled: !K.value.trim() || b(G).isGenerating.value,
203
- onClick: Q
204
- }, [f(b(ae), {
205
- size: 16,
206
- "stroke-width": 2
207
- })], 8, ye)]), u("p", be, y(b(H).aiMenu.disclaimer), 1)])
208
- ])) : c("", !0)]),
209
- _: 1
210
- }));
211
- }
212
- }), [["__scopeId", "data-v-2735cdb5"]]);
213
- //#endregion
214
- export { V as default };