@aswin.dev/editor 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-COL6Wm7p.js} +37 -37
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DWGPVtvC.js} +68 -68
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-duUFSfDf.js} +22 -22
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-Qs6HtXid.js} +12 -12
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-Bw-lbt61.js} +21 -21
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-BSH7uNP_.js} +58 -58
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-Ba2pfF57.js} +2 -2
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-6phxZSKI.js} +80 -80
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-BpUzQOJt.js} +87 -87
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-DNSzAB-I.js} +182 -182
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CrqPQdnk.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-zMQTpez7.js} +28 -28
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-Do-A5rYU.js} +45 -50
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-CS7o62zS.js} +75 -75
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-DGj_9V1u.js} +28 -28
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-C7IDnAoS.js} +68 -68
- package/dist/{TplModal-BwSfxIHf.js → TplModal-BAsVzcTb.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-C6LDKvmd.js} +19 -5
- package/dist/bundle-stats.json +7 -7
- package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-6ZmAvF0j.js} +485 -427
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
- package/dist/{de-Brqvgr43.js → de-DWcgp-7T.js} +209 -1
- package/dist/{dist-BaQIYPsn.js → dist-BUzw1buG.js} +1 -1
- package/dist/{dist-DjviJBCi.js → dist-BZyY-SS4.js} +1 -1
- package/dist/{dist-D6uC2xhi.js → dist-BadNx4qo.js} +1 -1
- package/dist/{dist-aRzjfSRN.js → dist-BesOh2mk.js} +1 -1
- package/dist/{dist-D90y8dvT.js → dist-Bz3M4RXG.js} +3 -3
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/{dist-DDJIWTRY.js → dist-C3T2AKtB.js} +1 -1
- package/dist/{dist-BFawx6IS.js → dist-C9ckKEZL.js} +51 -51
- package/dist/{dist-us-RpCWN.js → dist-CBItRG-Z.js} +1 -1
- package/dist/{dist-wzMIGj-D.js → dist-COSzWQUs.js} +1 -1
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/{dist-Cp0zXPAD.js → dist-DtiDUrX-.js} +1 -1
- package/dist/{dist-KoBJjK1G.js → dist-Dzt5foyL.js} +1 -1
- package/dist/{en-WDVp87TE.js → en-Cxd4fhNm.js} +209 -1
- package/dist/{extensions-CUcl9Ok4.js → extensions-D__hOlV1.js} +106 -106
- package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
- package/dist/index.d.ts +88 -11
- package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
- package/dist/{scan-line-D0vcUekt.js → scan-line-CzfFJO1o.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-D2eSo4GH.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-jkpgcC0-.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-Chm5CZfb.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +189 -126
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-CzBnJsW8.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-CtK2apEH.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-KpDVNbpn.js} +1 -1
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-DOKSZql1.js} +2 -2
- package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-wslttMH-.js} +2425 -2250
- package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-DX0XG5V9.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
- package/dist/{x-u2oVmjN_.js → x-BkaOMosX.js} +1 -1
- package/package.json +10 -10
- package/dist/CloudEditor-BCz1ZTYC.js +0 -1172
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +0 -97
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +0 -1
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +0 -59
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +0 -33
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +0 -51
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +0 -423
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +0 -544
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +0 -106
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +0 -119
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +0 -171
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
- package/dist/cdn/chunks/de-Ce-LbJ2J.js +0 -89
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +0 -1
- package/dist/cdn/chunks/de-D8CnZxV9.js +0 -523
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
- package/dist/cdn/chunks/de-RQrZR56a.js +0 -209
- package/dist/cdn/chunks/de-RQrZR56a.js.map +0 -1
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +0 -19
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +0 -1
- package/dist/cdn/chunks/en-8FHaQv4V.js +0 -523
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
- package/dist/cdn/chunks/en-Bl1ecfRF.js +0 -209
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +0 -1
- package/dist/cdn/chunks/en-DiCWK5fG.js +0 -89
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +0 -1
- package/dist/cdn/chunks/extensions-DIxF31tA.js +0 -598
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js +0 -6814
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/icons-CsLTcirh.js +0 -700
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +0 -3279
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +0 -1
- package/dist/cdn/chunks/media-library-CVaNvhpM.js +0 -6014
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +0 -2508
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +0 -1
- package/dist/cdn/chunks/quality-BaBfc54_.js +0 -1456
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +0 -32
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +0 -1
- package/dist/cdn/chunks/renderer-CUxvx7ro.js +0 -548
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
- package/dist/cdn/chunks/src-CRaqN-p8.js +0 -497
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +0 -14654
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +0 -1
- package/dist/cdn/editor.css +0 -2
- package/dist/cdn/editor.js +0 -250
- package/dist/cdn/editor.js.map +0 -1
- package/dist/dist-B1IR0bpH.js +0 -326
- package/dist/dist-DJmnUmW9.js +0 -362
- package/dist/keys-ciNfSSGj.js +0 -10
- package/dist/styleConstants-fWzlIIwN.js +0 -55
- package/dist/styles-DEXEkBvg.js +0 -3176
- /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-BVAJ4lgT.js} +0 -0
- /package/dist/{de-DCaaCE5s.js → de-GOtR9DwW.js} +0 -0
- /package/dist/{dist-iLBdeBDR.js → dist-DXa1uAMh.js} +0 -0
- /package/dist/{emojiData-PQyVa4bU.js → emojiData-DrBuvEoP.js} +0 -0
- /package/dist/{en-DXCyK4-X.js → en-dFFQVzNn.js} +0 -0
- /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-BhhO8yCl.js} +0 -0
- /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-BvCyLQII.js} +0 -0
- /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-DVuzNX1y.js} +0 -0
package/README.md
CHANGED
|
@@ -20,13 +20,13 @@ The visual editor for [Templatical](https://github.com/templatical/sdk) — an o
|
|
|
20
20
|
npm install @aswin.dev/editor
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`@
|
|
23
|
+
`@aswin.dev/renderer` is an optional peer — install it only if you need to convert templates to MJML. The two common cases are:
|
|
24
24
|
|
|
25
25
|
- **In the browser, alongside the editor**, when you call `editor.toMjml()` to export from the user's session.
|
|
26
26
|
- **In Node.js (or another runtime)**, when you only have stored template JSON and want to convert it to MJML server-side. You don't need the editor for this — install just the renderer.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
npm install @
|
|
29
|
+
npm install @aswin.dev/renderer
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
If you call `editor.toMjml()` without the renderer installed, it throws a clear error naming the missing package.
|
|
@@ -44,7 +44,7 @@ const editor = await init({
|
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
// Render to MJML when sending email — async; requires @
|
|
47
|
+
// Render to MJML when sending email — async; requires @aswin.dev/renderer
|
|
48
48
|
const mjml = await editor.toMjml();
|
|
49
49
|
|
|
50
50
|
// Always unmount when removing the editor (cleans up listeners + DOM)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as g, t as _ } from "./keys-
|
|
3
|
-
import { t as v } from "./useI18n-
|
|
4
|
-
import { t as y } from "./createLucideIcon-
|
|
5
|
-
import { t as b } from "./accessibility-
|
|
6
|
-
import { t as x } from "./circle-alert-
|
|
7
|
-
import { t as S } from "./info-
|
|
8
|
-
import { t as C } from "./triangle-alert-
|
|
1
|
+
import { At as e, C as t, D as n, F as r, Ft as i, N as a, R as o, _ as s, b as c, f as l, g as u, h as d, m as f, st as p, v as m, x as h } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { m as g, t as _ } from "./keys-CvX8D-8C.js";
|
|
3
|
+
import { t as v } from "./useI18n-C2xQZ6K9.js";
|
|
4
|
+
import { t as y } from "./createLucideIcon-ClREiSx3.js";
|
|
5
|
+
import { t as b } from "./accessibility-BU09xZrQ.js";
|
|
6
|
+
import { t as x } from "./circle-alert-ZQQc98HC.js";
|
|
7
|
+
import { t as S } from "./info-BSPGcsSM.js";
|
|
8
|
+
import { t as C } from "./triangle-alert-KpDVNbpn.js";
|
|
9
9
|
var w = y("arrow-right", [["path", {
|
|
10
10
|
d: "M5 12h14",
|
|
11
11
|
key: "1ays0h"
|
|
@@ -24,84 +24,84 @@ var w = y("arrow-right", [["path", {
|
|
|
24
24
|
}, M = { class: "tpl:ml-auto tpl:font-normal tpl:opacity-70" }, N = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "tpl:m-0 tpl:mb-3 tpl:flex tpl:list-none tpl:flex-col tpl:gap-2 tpl:p-0"
|
|
27
|
-
}, P = { class: "tpl:m-0 tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, F = { class: "tpl:m-0 tpl:mb-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, I = { class: "tpl:flex tpl:gap-1.5" }, L = ["onClick"], R = ["title", "onClick"], z = /* @__PURE__ */
|
|
27
|
+
}, P = { class: "tpl:m-0 tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, F = { class: "tpl:m-0 tpl:mb-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, I = { class: "tpl:flex tpl:gap-1.5" }, L = ["onClick"], R = ["title", "onClick"], z = /* @__PURE__ */ t({
|
|
28
28
|
__name: "AccessibilityPanel",
|
|
29
|
-
setup(
|
|
30
|
-
let { t: y, format: z } = v(), B =
|
|
29
|
+
setup(t) {
|
|
30
|
+
let { t: y, format: z } = v(), B = n(_, null), V = n(g, null), H = f(() => (B?.issues.value ?? []).filter((e) => e.severity === "error")), U = f(() => (B?.issues.value ?? []).filter((e) => e.severity === "warning")), W = f(() => (B?.issues.value ?? []).filter((e) => e.severity === "info")), G = f(() => H.value.length + U.value.length + W.value.length);
|
|
31
31
|
function K(e) {
|
|
32
32
|
V && e.blockId && V.selectBlock(e.blockId);
|
|
33
33
|
}
|
|
34
34
|
function q(e) {
|
|
35
35
|
B?.applyFix(e);
|
|
36
36
|
}
|
|
37
|
-
return (t,
|
|
38
|
-
|
|
37
|
+
return (t, n) => (a(), m("div", E, [d("header", D, [
|
|
38
|
+
h(p(b), {
|
|
39
39
|
size: 16,
|
|
40
40
|
"stroke-width": 1.5
|
|
41
41
|
}),
|
|
42
|
-
|
|
43
|
-
G.value > 0 ? (
|
|
42
|
+
d("h3", O, i(p(y).accessibility.panelTitle), 1),
|
|
43
|
+
G.value > 0 ? (a(), m("span", {
|
|
44
44
|
key: 0,
|
|
45
45
|
class: "tpl:ml-auto tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-0.5 tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]",
|
|
46
|
-
title:
|
|
47
|
-
}, i(G.value), 9, k)) :
|
|
48
|
-
]), !
|
|
46
|
+
title: p(z)(p(y).accessibility.issueCountTooltip, { count: G.value })
|
|
47
|
+
}, i(G.value), 9, k)) : s("", !0)
|
|
48
|
+
]), !p(B) || p(B).unavailable.value ? (a(), m("div", A)) : G.value === 0 ? (a(), m("div", j, i(p(y).accessibility.emptyState), 1)) : (a(!0), m(l, { key: 2 }, r([
|
|
49
49
|
{
|
|
50
50
|
key: "errors",
|
|
51
|
-
title:
|
|
52
|
-
icon:
|
|
51
|
+
title: p(y).accessibility.groupErrors,
|
|
52
|
+
icon: p(x),
|
|
53
53
|
items: H.value,
|
|
54
54
|
tone: "tpl:text-[var(--tpl-danger)]"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
key: "warnings",
|
|
58
|
-
title:
|
|
59
|
-
icon:
|
|
58
|
+
title: p(y).accessibility.groupWarnings,
|
|
59
|
+
icon: p(C),
|
|
60
60
|
items: U.value,
|
|
61
61
|
tone: "tpl:text-[var(--tpl-warning)]"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
key: "info",
|
|
65
|
-
title:
|
|
66
|
-
icon:
|
|
65
|
+
title: p(y).accessibility.groupInfo,
|
|
66
|
+
icon: p(S),
|
|
67
67
|
items: W.value,
|
|
68
68
|
tone: "tpl:text-[var(--tpl-text-muted)]"
|
|
69
69
|
}
|
|
70
|
-
], (t) => (
|
|
70
|
+
], (t) => (a(), m("section", { key: t.key }, [t.items.length > 0 ? (a(), m("header", {
|
|
71
71
|
key: 0,
|
|
72
72
|
class: e(["tpl:mb-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-[11px] tpl:font-semibold tpl:uppercase tpl:tracking-wide", t.tone])
|
|
73
73
|
}, [
|
|
74
|
-
(
|
|
74
|
+
(a(), u(o(t.icon), {
|
|
75
75
|
size: 12,
|
|
76
76
|
"stroke-width": 2
|
|
77
77
|
})),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
], 2)) :
|
|
78
|
+
c(" " + i(t.title) + " ", 1),
|
|
79
|
+
d("span", M, i(t.items.length), 1)
|
|
80
|
+
], 2)) : s("", !0), t.items.length > 0 ? (a(), m("ul", N, [(a(!0), m(l, null, r(t.items, (e) => (a(), m("li", {
|
|
81
81
|
key: `${e.ruleId}-${e.blockId ?? "template"}`,
|
|
82
82
|
class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3"
|
|
83
83
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
d("p", P, i(e.message), 1),
|
|
85
|
+
d("p", F, i(e.ruleId), 1),
|
|
86
|
+
d("div", I, [e.blockId ? (a(), m("button", {
|
|
87
87
|
key: 0,
|
|
88
88
|
type: "button",
|
|
89
89
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text)]",
|
|
90
90
|
onClick: (t) => K(e)
|
|
91
|
-
}, [
|
|
91
|
+
}, [h(p(w), {
|
|
92
92
|
size: 10,
|
|
93
93
|
"stroke-width": 2
|
|
94
|
-
}),
|
|
94
|
+
}), c(" " + i(p(y).accessibility.jump), 1)], 8, L)) : s("", !0), e.fix ? (a(), m("button", {
|
|
95
95
|
key: 1,
|
|
96
96
|
type: "button",
|
|
97
97
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-md tpl:bg-[var(--tpl-primary)] tpl:px-2 tpl:py-1 tpl:text-[11px] tpl:font-medium tpl:text-white",
|
|
98
98
|
title: e.fix.description,
|
|
99
99
|
onClick: (t) => q(e)
|
|
100
|
-
}, [
|
|
100
|
+
}, [h(p(T), {
|
|
101
101
|
size: 10,
|
|
102
102
|
"stroke-width": 2
|
|
103
|
-
}),
|
|
104
|
-
]))), 128))])) :
|
|
103
|
+
}), c(" " + i(p(y).accessibility.fix), 1)], 8, R)) : s("", !0)])
|
|
104
|
+
]))), 128))])) : s("", !0)]))), 128))]));
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
//#endregion
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as ue } from "./loader-circle-
|
|
7
|
-
import { t as de } from "./send-
|
|
8
|
-
import { t as x } from "./sparkles-
|
|
9
|
-
import { t as fe } from "./trash-2-
|
|
10
|
-
import { t as pe } from "./x-
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { i as
|
|
14
|
-
var
|
|
1
|
+
import { A as e, At as t, C as n, D as r, F as i, Ft as a, N as o, U as ee, V as s, W as te, _ as c, b as l, c as ne, et as u, f as d, g as f, h as p, k as re, st as m, t as ie, v as h, x as g } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { c as ae, l as oe } from "./dist-CivF9P8b.js";
|
|
3
|
+
import { A as _, i as se, l as v, m as ce, y as le } from "./keys-CvX8D-8C.js";
|
|
4
|
+
import { t as y } from "./createLucideIcon-ClREiSx3.js";
|
|
5
|
+
import { t as b } from "./circle-alert-ZQQc98HC.js";
|
|
6
|
+
import { t as ue } from "./loader-circle-Balo8p3d.js";
|
|
7
|
+
import { t as de } from "./send-D2eSo4GH.js";
|
|
8
|
+
import { t as x } from "./sparkles-Chm5CZfb.js";
|
|
9
|
+
import { t as fe } from "./trash-2-CtK2apEH.js";
|
|
10
|
+
import { t as pe } from "./x-BkaOMosX.js";
|
|
11
|
+
import { t as S } from "./LoadingTrack-Ba2pfF57.js";
|
|
12
|
+
import { t as C } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
|
|
13
|
+
import { i as w } from "./cloud-6ZmAvF0j.js";
|
|
14
|
+
var T = y("redo-2", [["path", {
|
|
15
15
|
d: "m15 14 5-5-5-5",
|
|
16
16
|
key: "12vg1m"
|
|
17
17
|
}], ["path", {
|
|
18
18
|
d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
|
|
19
19
|
key: "6uklza"
|
|
20
|
-
}]]),
|
|
20
|
+
}]]), E = y("undo-2", [["path", {
|
|
21
21
|
d: "M9 14 4 9l5-5",
|
|
22
22
|
key: "102s5s"
|
|
23
23
|
}], ["path", {
|
|
@@ -26,27 +26,27 @@ var w = b("redo-2", [["path", {
|
|
|
26
26
|
}]]);
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/composables/useAliveFlag.ts
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
}),
|
|
29
|
+
function D() {
|
|
30
|
+
let t = { alive: !0 };
|
|
31
|
+
return e(() => {
|
|
32
|
+
t.alive = !1;
|
|
33
|
+
}), t;
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/cloud/components/AiChatSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
37
|
-
var
|
|
37
|
+
var O = {
|
|
38
38
|
key: 0,
|
|
39
39
|
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)]"
|
|
40
|
-
},
|
|
40
|
+
}, k = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, A = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, j = { class: "tpl:flex tpl:items-center tpl:gap-1" }, M = ["title"], N = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col" }, P = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
43
|
-
},
|
|
43
|
+
}, F = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, I = {
|
|
44
44
|
key: 1,
|
|
45
45
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
46
|
-
},
|
|
46
|
+
}, L = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, R = {
|
|
47
47
|
key: 2,
|
|
48
48
|
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
49
|
-
},
|
|
49
|
+
}, z = {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",
|
|
52
52
|
style: {
|
|
@@ -55,10 +55,10 @@ var D = {
|
|
|
55
55
|
"max-width": "85%",
|
|
56
56
|
"box-shadow": "var(--tpl-shadow)"
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, B = {
|
|
59
59
|
key: 1,
|
|
60
60
|
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
61
|
-
},
|
|
61
|
+
}, me = {
|
|
62
62
|
key: 1,
|
|
63
63
|
class: "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",
|
|
64
64
|
style: {
|
|
@@ -81,24 +81,24 @@ var D = {
|
|
|
81
81
|
"background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 50%,\n transparent\n )",
|
|
82
82
|
"backdrop-filter": "blur(2px)"
|
|
83
83
|
}
|
|
84
|
-
}, _e = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, ve = ["onClick"], ye = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, be = { 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)]" }, xe = ["placeholder", "disabled"], Se = ["disabled"], Ce = { class: "tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, V = /* @__PURE__ */
|
|
84
|
+
}, _e = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, ve = ["onClick"], ye = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, be = { 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)]" }, xe = ["placeholder", "disabled"], Se = ["disabled"], Ce = { class: "tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, V = /* @__PURE__ */ C(/* @__PURE__ */ n({
|
|
85
85
|
__name: "AiChatSidebar",
|
|
86
86
|
props: {
|
|
87
87
|
visible: { type: Boolean },
|
|
88
88
|
onApply: { type: Function }
|
|
89
89
|
},
|
|
90
90
|
emits: ["close"],
|
|
91
|
-
setup(
|
|
92
|
-
let
|
|
91
|
+
setup(e, { emit: n }) {
|
|
92
|
+
let y = e, C = n, V = _(v, "AiChatSidebar"), H = _(ce, "AiChatSidebar"), we = _(se, "AiChatSidebar"), U = r(le, []), W = D(), G = w({
|
|
93
93
|
authManager: we,
|
|
94
94
|
getTemplateId: () => H.state.template?.id ?? null,
|
|
95
|
-
onApply:
|
|
95
|
+
onApply: y.onApply,
|
|
96
96
|
onError: void 0
|
|
97
|
-
}), K =
|
|
97
|
+
}), K = u(""), q = u(null), J = u(!1), Y = u(0), { pause: X, resume: Te } = ae(() => {
|
|
98
98
|
let e = G.suggestions.value?.length ?? 0;
|
|
99
99
|
Y.value < e ? Y.value++ : X();
|
|
100
|
-
}, 150, { immediate: !1 }), { start: Ee } =
|
|
101
|
-
|
|
100
|
+
}, 150, { immediate: !1 }), { start: Ee } = oe(() => Te(), 100, { immediate: !1 });
|
|
101
|
+
s(() => G.suggestions.value?.length ?? 0, (e) => {
|
|
102
102
|
if (X(), e === 0) {
|
|
103
103
|
Y.value = 0;
|
|
104
104
|
return;
|
|
@@ -106,11 +106,11 @@ var D = {
|
|
|
106
106
|
Y.value = 0, Ee();
|
|
107
107
|
});
|
|
108
108
|
function Z() {
|
|
109
|
-
|
|
109
|
+
re(() => {
|
|
110
110
|
q.value && (q.value.scrollTop = q.value.scrollHeight);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
s(() => G.messages.value?.length ?? 0, () => Z()), s(() => y.visible, async (e) => {
|
|
114
114
|
if (e && !J.value) {
|
|
115
115
|
if (J.value = !0, await G.loadConversation(), !W.alive) return;
|
|
116
116
|
(G.messages.value?.length ?? 0) === 0 && H.content.value.blocks.length === 0 && G.loadSuggestions(H.content.value, U);
|
|
@@ -129,7 +129,7 @@ var D = {
|
|
|
129
129
|
function Oe(e) {
|
|
130
130
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
|
|
131
131
|
}
|
|
132
|
-
return (
|
|
132
|
+
return (n, r) => (o(), f(ie, {
|
|
133
133
|
"enter-active-class": "tpl-ai-slide-enter-active",
|
|
134
134
|
"enter-from-class": "tpl:translate-x-full",
|
|
135
135
|
"enter-to-class": "tpl:translate-x-0",
|
|
@@ -137,42 +137,42 @@ var D = {
|
|
|
137
137
|
"leave-from-class": "tpl:translate-x-0",
|
|
138
138
|
"leave-to-class": "tpl:translate-x-full"
|
|
139
139
|
}, {
|
|
140
|
-
default: ee(() => [
|
|
141
|
-
|
|
140
|
+
default: ee(() => [e.visible ? (o(), h("div", O, [
|
|
141
|
+
p("div", k, [p("div", A, [g(m(x), {
|
|
142
142
|
size: 13,
|
|
143
143
|
"stroke-width": 2
|
|
144
|
-
}),
|
|
144
|
+
}), p("span", null, a(m(V).aiChat.title), 1)]), p("div", j, [(m(G).messages.value?.length ?? 0) > 0 ? (o(), h("button", {
|
|
145
145
|
key: 0,
|
|
146
146
|
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
147
147
|
title: m(V).aiChat.clear,
|
|
148
|
-
onClick:
|
|
149
|
-
}, [
|
|
148
|
+
onClick: r[0] ||= (e) => m(G).clearChat()
|
|
149
|
+
}, [g(m(fe), {
|
|
150
150
|
size: 14,
|
|
151
151
|
"stroke-width": 2
|
|
152
|
-
})], 8,
|
|
152
|
+
})], 8, M)) : c("", !0), p("button", {
|
|
153
153
|
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
154
|
-
onClick:
|
|
155
|
-
}, [
|
|
154
|
+
onClick: r[1] ||= (e) => C("close")
|
|
155
|
+
}, [g(m(pe), {
|
|
156
156
|
size: 14,
|
|
157
157
|
"stroke-width": 2
|
|
158
158
|
})])])]),
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
p("div", N, [
|
|
160
|
+
p("div", {
|
|
161
161
|
ref_key: "messagesContainer",
|
|
162
162
|
ref: q,
|
|
163
163
|
class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4"
|
|
164
|
-
}, [m(G).isLoadingHistory.value ? (
|
|
164
|
+
}, [m(G).isLoadingHistory.value ? (o(), h("div", P, [g(m(ue), {
|
|
165
165
|
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
166
166
|
size: 24,
|
|
167
167
|
"stroke-width": 2
|
|
168
|
-
}),
|
|
168
|
+
}), p("p", F, a(m(V).aiChat.loadingHistory), 1)])) : (m(G).messages.value?.length ?? 0) === 0 ? (o(), h("div", I, [g(m(x), {
|
|
169
169
|
size: 32,
|
|
170
170
|
"stroke-width": 1.5,
|
|
171
171
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
172
|
-
}),
|
|
172
|
+
}), p("p", L, a(m(V).aiChat.placeholder), 1)])) : (o(), h("div", R, [(o(!0), h(d, null, i(m(G).messages.value, (e, t) => (o(), h("div", {
|
|
173
173
|
key: e.id,
|
|
174
174
|
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
175
|
-
}, [e.role === "user" ? (
|
|
175
|
+
}, [e.role === "user" ? (o(), h("div", z, a(e.content), 1)) : (o(), h("div", B, [!$(e.content) && m(G).isGenerating.value && t === (m(G).messages.value?.length ?? 0) - 1 ? (o(), f(S, { key: 0 })) : (o(), h("div", me, a($(e.content) || m(V).aiChat.applied), 1)), e.id === m(G).lastApplyMessageId.value && !m(G).isGenerating.value ? (o(), h("button", {
|
|
176
176
|
key: 2,
|
|
177
177
|
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",
|
|
178
178
|
style: {
|
|
@@ -180,50 +180,50 @@ var D = {
|
|
|
180
180
|
color: "var(--tpl-text-muted)",
|
|
181
181
|
"background-color": "transparent"
|
|
182
182
|
},
|
|
183
|
-
onClick:
|
|
184
|
-
}, [m(G).isLastChangeReverted.value ? (
|
|
183
|
+
onClick: r[2] ||= (e) => m(G).toggleLastRevert()
|
|
184
|
+
}, [m(G).isLastChangeReverted.value ? (o(), h(d, { key: 0 }, [g(m(T), {
|
|
185
185
|
size: 12,
|
|
186
186
|
"stroke-width": 2
|
|
187
|
-
}),
|
|
187
|
+
}), l(" " + a(m(V).aiChat.reapply), 1)], 64)) : (o(), h(d, { key: 1 }, [g(m(E), {
|
|
188
188
|
size: 12,
|
|
189
189
|
"stroke-width": 2
|
|
190
|
-
}),
|
|
191
|
-
m(G).error.value ? (
|
|
190
|
+
}), l(" " + a(m(V).aiChat.revert), 1)], 64))])) : c("", !0)]))]))), 128))]))], 512),
|
|
191
|
+
m(G).error.value ? (o(), h("div", he, [g(m(b), {
|
|
192
192
|
size: 14,
|
|
193
193
|
"stroke-width": 2,
|
|
194
194
|
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
195
|
-
}),
|
|
196
|
-
(m(G).suggestions.value?.length ?? 0) > 0 ? (
|
|
195
|
+
}), p("span", null, a(m(G).error.value === "ai_apply_failed" ? m(V).aiChat.applyFailed : m(V).aiChat.error), 1)])) : c("", !0),
|
|
196
|
+
(m(G).suggestions.value?.length ?? 0) > 0 ? (o(), h("div", ge, [p("div", _e, [(o(!0), h(d, null, i(m(G).suggestions.value ?? [], (e, n) => (o(), h("button", {
|
|
197
197
|
key: n,
|
|
198
|
-
class:
|
|
198
|
+
class: t(["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", (m(G).suggestions.value?.length ?? 0) - 1 - n < Y.value ? "tpl:translate-y-0 tpl:opacity-100" : "tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0"]),
|
|
199
199
|
style: {
|
|
200
200
|
"border-color": "var(--tpl-border)",
|
|
201
201
|
color: "var(--tpl-primary)",
|
|
202
202
|
"background-color": "var(--tpl-bg)",
|
|
203
203
|
"box-shadow": "var(--tpl-shadow)"
|
|
204
204
|
},
|
|
205
|
-
onClick: (
|
|
206
|
-
},
|
|
205
|
+
onClick: (t) => De(e)
|
|
206
|
+
}, a(e), 11, ve))), 128))])])) : c("", !0)
|
|
207
207
|
]),
|
|
208
|
-
|
|
209
|
-
"onUpdate:modelValue":
|
|
208
|
+
p("div", ye, [p("div", be, [te(p("textarea", {
|
|
209
|
+
"onUpdate:modelValue": r[3] ||= (e) => K.value = e,
|
|
210
210
|
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)]",
|
|
211
211
|
placeholder: m(V).aiChat.inputPlaceholder,
|
|
212
212
|
disabled: m(G).isGenerating.value,
|
|
213
213
|
rows: "3",
|
|
214
214
|
onKeydown: Oe
|
|
215
|
-
}, null, 40, xe), [[
|
|
215
|
+
}, null, 40, xe), [[ne, K.value]]), p("button", {
|
|
216
216
|
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)]",
|
|
217
217
|
disabled: !K.value.trim() || m(G).isGenerating.value,
|
|
218
218
|
onClick: Q
|
|
219
|
-
}, [
|
|
219
|
+
}, [g(m(de), {
|
|
220
220
|
size: 16,
|
|
221
221
|
"stroke-width": 2
|
|
222
|
-
})], 8, Se)]),
|
|
223
|
-
])) :
|
|
222
|
+
})], 8, Se)]), p("p", Ce, a(m(V).aiMenu.disclaimer), 1)])
|
|
223
|
+
])) : c("", !0)]),
|
|
224
224
|
_: 1
|
|
225
225
|
}));
|
|
226
226
|
}
|
|
227
|
-
}), [["__scopeId", "data-v-
|
|
227
|
+
}), [["__scopeId", "data-v-384b60d9"]]);
|
|
228
228
|
//#endregion
|
|
229
229
|
export { V as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./useEditorCore-
|
|
3
|
-
import {
|
|
4
|
-
import { t as p } from "./image-up-
|
|
5
|
-
import { t as m } from "./shield-check-
|
|
6
|
-
import { t as h } from "./sparkles-
|
|
7
|
-
import { t as g } from "./_plugin-vue_export-helper-
|
|
8
|
-
import { n as _ } from "./useCloudI18n-
|
|
1
|
+
import { C as e, F as t, Ft as n, N as r, R as i, f as a, g as o, h as s, jt as c, m as l, v as u } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import "./useEditorCore-wslttMH-.js";
|
|
3
|
+
import { A as d, n as f } from "./keys-CvX8D-8C.js";
|
|
4
|
+
import { t as p } from "./image-up-DT7gcJLN.js";
|
|
5
|
+
import { t as m } from "./shield-check-jkpgcC0-.js";
|
|
6
|
+
import { t as h } from "./sparkles-Chm5CZfb.js";
|
|
7
|
+
import { t as g } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
|
|
8
|
+
import { n as _ } from "./useCloudI18n-DOKSZql1.js";
|
|
9
9
|
//#region src/cloud/components/AiFeatureMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var v = {
|
|
11
11
|
class: "tpl-ai-feature-menu tpl:w-[280px] tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:py-1 tpl:bg-[var(--tpl-bg-elevated)] tpl:border tpl:border-[var(--tpl-border)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
@@ -13,11 +13,11 @@ var v = {
|
|
|
13
13
|
"backdrop-filter": "blur(8px)",
|
|
14
14
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
15
15
|
}
|
|
16
|
-
}, y = ["onClick"], b = { class: "tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5" }, x = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, S = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text-muted)]" }, C = /* @__PURE__ */ g(/* @__PURE__ */
|
|
16
|
+
}, y = ["onClick"], b = { class: "tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5" }, x = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, S = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text-muted)]" }, C = /* @__PURE__ */ g(/* @__PURE__ */ e({
|
|
17
17
|
__name: "AiFeatureMenu",
|
|
18
18
|
props: { activeFeature: {} },
|
|
19
19
|
emits: ["select"],
|
|
20
|
-
setup(
|
|
20
|
+
setup(e, { emit: g }) {
|
|
21
21
|
let C = g, { t: w } = _(), T = d(f, "AiFeatureMenu"), E = {
|
|
22
22
|
"ai-chat": "chat",
|
|
23
23
|
"design-reference": "designToTemplate",
|
|
@@ -35,29 +35,29 @@ var v = {
|
|
|
35
35
|
key: "scoring",
|
|
36
36
|
icon: m
|
|
37
37
|
}
|
|
38
|
-
], O =
|
|
38
|
+
], O = l(() => D.filter((e) => T.isFeatureEnabled(E[e.key])));
|
|
39
39
|
function k(e) {
|
|
40
40
|
return e === "ai-chat" ? w.aiMenu.aiAssistant : e === "design-reference" ? w.aiMenu.designToTemplate : w.aiMenu.templateScore;
|
|
41
41
|
}
|
|
42
42
|
function A(e) {
|
|
43
43
|
return e === "ai-chat" ? w.aiMenu.aiAssistantDesc : e === "design-reference" ? w.aiMenu.designToTemplateDesc : w.aiMenu.templateScoreDesc;
|
|
44
44
|
}
|
|
45
|
-
return (
|
|
46
|
-
key:
|
|
45
|
+
return (l, d) => (r(), u("div", v, [(r(!0), u(a, null, t(O.value, (t) => (r(), u("button", {
|
|
46
|
+
key: t.key,
|
|
47
47
|
class: "tpl-ai-feature-menu-item tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-start tpl:gap-3 tpl:border-none tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100",
|
|
48
|
-
style:
|
|
49
|
-
onClick: (e) => C("select",
|
|
50
|
-
}, [
|
|
48
|
+
style: c({ backgroundColor: e.activeFeature === t.key ? "var(--tpl-primary-light)" : "transparent" }),
|
|
49
|
+
onClick: (e) => C("select", t.key)
|
|
50
|
+
}, [s("div", {
|
|
51
51
|
class: "tpl:mt-0.5 tpl:flex tpl:size-7 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)]",
|
|
52
|
-
style:
|
|
53
|
-
backgroundColor:
|
|
54
|
-
color:
|
|
52
|
+
style: c({
|
|
53
|
+
backgroundColor: e.activeFeature === t.key ? "var(--tpl-primary)" : "var(--tpl-bg-active)",
|
|
54
|
+
color: e.activeFeature === t.key ? "var(--tpl-bg)" : "var(--tpl-text-muted)"
|
|
55
55
|
})
|
|
56
|
-
}, [(
|
|
56
|
+
}, [(r(), o(i(t.icon), {
|
|
57
57
|
size: 15,
|
|
58
58
|
"stroke-width": 2
|
|
59
|
-
}))], 4),
|
|
59
|
+
}))], 4), s("div", b, [s("span", x, n(k(t.key)), 1), s("span", S, n(A(t.key)), 1)])], 12, y))), 128))]));
|
|
60
60
|
}
|
|
61
|
-
}), [["__scopeId", "data-v-
|
|
61
|
+
}), [["__scopeId", "data-v-98d85462"]]);
|
|
62
62
|
//#endregion
|
|
63
63
|
export { C as default };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as l } from "./keys-
|
|
3
|
-
import { t as u } from "./useI18n-
|
|
4
|
-
import { t as d } from "./circle-alert-
|
|
5
|
-
import { t as f } from "./triangle-alert-
|
|
1
|
+
import { At as e, C as t, D as n, N as r, _ as i, g as a, m as o, st as s, v as c } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { t as l } from "./keys-CvX8D-8C.js";
|
|
3
|
+
import { t as u } from "./useI18n-C2xQZ6K9.js";
|
|
4
|
+
import { t as d } from "./circle-alert-ZQQc98HC.js";
|
|
5
|
+
import { t as f } from "./triangle-alert-KpDVNbpn.js";
|
|
6
6
|
//#region src/components/canvas/BlockA11yBadge.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var p = ["title", "aria-label"], m = /* @__PURE__ */
|
|
7
|
+
var p = ["title", "aria-label"], m = /* @__PURE__ */ t({
|
|
8
8
|
__name: "BlockA11yBadge",
|
|
9
9
|
props: { blockId: {} },
|
|
10
|
-
setup(
|
|
11
|
-
let m =
|
|
12
|
-
return (t,
|
|
10
|
+
setup(t) {
|
|
11
|
+
let m = t, { t: h } = u(), g = n(l, null), _ = o(() => (g?.issues.value ?? []).filter((e) => e.blockId === m.blockId)), v = o(() => _.value.some((e) => e.severity === "error") ? "error" : _.value.some((e) => e.severity === "warning") ? "warning" : null), y = o(() => v.value === "error" ? h.accessibility.badgeError : h.accessibility.badgeWarning);
|
|
12
|
+
return (t, n) => v.value ? (r(), c("span", {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: e(["tpl:absolute tpl:top-1 tpl:right-1 tpl:z-10 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)] tpl:ring-1 tpl:ring-[var(--tpl-border)]", v.value === "error" ? "tpl:text-[var(--tpl-danger)]" : "tpl:text-[var(--tpl-warning)]"]),
|
|
15
15
|
title: y.value,
|
|
16
16
|
"aria-label": y.value,
|
|
17
17
|
role: "img"
|
|
18
|
-
}, [v.value === "error" ? (
|
|
18
|
+
}, [v.value === "error" ? (r(), a(s(d), {
|
|
19
19
|
key: 0,
|
|
20
20
|
size: 14,
|
|
21
21
|
"stroke-width": 2.25,
|
|
22
22
|
fill: "currentColor",
|
|
23
23
|
stroke: "var(--tpl-bg)"
|
|
24
|
-
})) : (
|
|
24
|
+
})) : (r(), a(s(f), {
|
|
25
25
|
key: 1,
|
|
26
26
|
size: 14,
|
|
27
27
|
"stroke-width": 2.25,
|
|
28
28
|
fill: "currentColor",
|
|
29
29
|
stroke: "var(--tpl-bg)"
|
|
30
|
-
}))], 10, p)) :
|
|
30
|
+
}))], 10, p)) : i("", !0);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
//#endregion
|