@airalogy/aimd-recorder 1.22.0 → 1.23.0
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 +61 -0
- package/README.zh-CN.md +61 -0
- package/dist/{AimdDnaSequenceField-Bhj28fP8.js → AimdDnaSequenceField-JzxsGmRf.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-D7c01UqN.js → AimdEditor.vue_vue_type_style_index_0_lang-v82TdP_I.js} +1978 -1899
- package/dist/AimdEntityRefField-O0FwJDC0.js +229 -0
- package/dist/{AimdMarkdownField-GS15pv4z.js → AimdMarkdownField-Dd6M3zOI.js} +18 -18
- package/dist/{AimdMarkdownNoteField-H9WP8tR6.js → AimdMarkdownNoteField-DCkJg80X.js} +23 -23
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-B50G9-kH.js → arc-Bw7VOW6S.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-D9mBEbpY.js → architectureDiagram-3BPJPVTR-B4RdL02h.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-Cs4swgto.js → blockDiagram-GPEHLZMM-B5skMgx6.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-C12HKS3r.js → c4Diagram-AAUBKEIU-DDxL4a7C.js} +2 -2
- package/dist/{channel-D69VnjVz.js → channel-CQ1fnqoz.js} +1 -1
- package/dist/{chunk-2J33WTMH-oc-89G5c.js → chunk-2J33WTMH-B08Yr5NK.js} +1 -1
- package/dist/{chunk-4BX2VUAB-BDJS9G3r.js → chunk-4BX2VUAB-CyCffaPa.js} +1 -1
- package/dist/{chunk-55IACEB6-BPl3uHcA.js → chunk-55IACEB6-CztHyBOI.js} +1 -1
- package/dist/{chunk-727SXJPM-pWe-vDGf.js → chunk-727SXJPM-CEVNkjmn.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-D-R5sIr1.js → chunk-AQP2D5EJ-C9t9hFOg.js} +3 -3
- package/dist/{chunk-FMBD7UC4-bo6Qyom1.js → chunk-FMBD7UC4-ulCTg3qb.js} +1 -1
- package/dist/{chunk-ND2GUHAM-DQMvtYV7.js → chunk-ND2GUHAM-D4Cbj52r.js} +1 -1
- package/dist/{chunk-QZHKN3VN-DlCn3HON.js → chunk-QZHKN3VN-Rpw3UPGi.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-DzUwWFwr.js → classDiagram-4FO5ZUOK-D8dNLFoj.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-DzUwWFwr.js → classDiagram-v2-Q7XG4LA2-D8dNLFoj.js} +2 -2
- package/dist/components.js +3459 -3146
- package/dist/composables.js +94 -90
- package/dist/{cose-bilkent-S5V4N54A-BXLMzfpO.js → cose-bilkent-S5V4N54A-CzjADqxr.js} +1 -1
- package/dist/{dagre-BM42HDAG-DHnofIh9.js → dagre-BM42HDAG-C79MwQe7.js} +3 -3
- package/dist/{diagram-2AECGRRQ-BqTTVPsm.js → diagram-2AECGRRQ-DaQ7DMBK.js} +2 -2
- package/dist/{diagram-5GNKFQAL-D5p1UVbw.js → diagram-5GNKFQAL-BpWKnfL3.js} +3 -3
- package/dist/{diagram-KO2AKTUF-Uuoz9cFn.js → diagram-KO2AKTUF-CedxET4p.js} +2 -2
- package/dist/{diagram-LMA3HP47-W001U31X.js → diagram-LMA3HP47-FKe9tb0g.js} +2 -2
- package/dist/{diagram-OG6HWLK6-DL516LDr.js → diagram-OG6HWLK6-Bmb8IKvp.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-CCxgMb67.js → erDiagram-TEJ5UH35-Chalz_c9.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-nXGdmC0O.js → flowDiagram-I6XJVG4X-DPelWotf.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-Bi9Ro7_Z.js → ganttDiagram-6RSMTGT7-o_Jm8a5l.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-w1kNAy4E.js → gitGraphDiagram-PVQCEYII-BiwDVfiM.js} +3 -3
- package/dist/{graph-CpOkL_eZ.js → graph-_GsibXVP.js} +1 -1
- package/dist/index-CGb0O6x4.js +2660 -0
- package/dist/index.js +118 -112
- package/dist/{infoDiagram-5YYISTIA-Bde_w9T1.js → infoDiagram-5YYISTIA-CaVHW6oJ.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-x5M1KR0l.js → ishikawaDiagram-YF4QCWOH--qCCMUuo.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-CIDQP8Zm.js → journeyDiagram-JHISSGLW-BsT-p1ex.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-CKgO7sG8.js → kanban-definition-UN3LZRKU-oCTOaobR.js} +2 -2
- package/dist/{layout-BZYprqYR.js → layout-CAhsv4x8.js} +2 -2
- package/dist/{linear-ClSH2F_v.js → linear-CumggsyF.js} +1 -1
- package/dist/{mermaid.core-CcRV6K2R.js → mermaid.core-D4wVfZ2X.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-s3h6uszV.js → mindmap-definition-RKZ34NQL-NTgweVec.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-CgiazyWv.js → pieDiagram-4H26LBE5-C1UJkrIn.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-DCPVgHoW.js → quadrantDiagram-W4KKPZXB-rCJc8QbP.js} +2 -2
- package/dist/record.js +4 -4
- package/dist/{requirementDiagram-4Y6WPE33-DE6F9oSB.js → requirementDiagram-4Y6WPE33-BzHGaPaB.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-DZZoFFr-.js → sankeyDiagram-5OEKKPKP-B--uus9e.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-DaYEOl60.js → sequenceDiagram-3UESZ5HK-D7javnYQ.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-BmgpHJlH.js → stateDiagram-AJRCARHV-DPsstQ8f.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-D49CHQD6.js → stateDiagram-v2-BHNVJYJU-BhhRcq6R.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DdVLoCkC.js → timeline-definition-PNZ67QCA-DgnJrK74.js} +2 -2
- package/dist/useCodeBlockRendering-f5pBgZ96.js +5083 -0
- package/dist/{vennDiagram-CIIHVFJN-CCcMKcd7.js → vennDiagram-CIIHVFJN-D1Q51ENl.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-R4UGgGWY.js → wardleyDiagram-YWT4CUSO-DMfLoeaa.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DyFhCubk.js → xychartDiagram-2RQKCTM6-DzF8t-UA.js} +2 -2
- package/package.json +4 -4
- package/src/__tests__/collector-field.test.ts +269 -0
- package/src/__tests__/record-search-render.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +64 -2
- package/src/components/AimdCollectorField.vue +233 -0
- package/src/components/AimdEntityRefField.vue +314 -0
- package/src/components/AimdRecorder.vue +109 -2
- package/src/components/AimdRecorderEditor.vue +23 -0
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +31 -0
- package/src/components/AimdVarField.vue +39 -2
- package/src/components/index.ts +4 -0
- package/src/components/recorderMilkdownPlugin.ts +9 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +32 -0
- package/src/composables/index.ts +12 -0
- package/src/composables/useCollectors.ts +399 -0
- package/src/composables/useVarHelpers.ts +130 -2
- package/src/index.ts +20 -2
- package/src/locales.ts +110 -2
- package/src/styles/collector-field.css +281 -0
- package/src/styles/recorder-surface.css +163 -0
- package/src/styles/recorder.css +1 -0
- package/src/types.ts +127 -1
- package/dist/index-Dkrf2LJl.js +0 -1308
- package/dist/useCodeBlockRendering-CCuoP52e.js +0 -6103
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { defineComponent as P, ref as w, computed as p, watch as Q, openBlock as a, createElementBlock as r, Fragment as q, renderList as x, createElementVNode as y, toDisplayString as l, createCommentVNode as f, withDirectives as j, withKeys as U, withModifiers as G, vModelText as H } from "vue";
|
|
2
|
+
import { N as J } from "./useCodeBlockRendering-f5pBgZ96.js";
|
|
3
|
+
const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "aimd-rec-entity-ref__selected"
|
|
6
|
+
}, X = { class: "aimd-rec-entity-ref__entity" }, Y = ["title"], Z = ["title"], ee = ["aria-label", "title", "onClick"], te = { class: "aimd-rec-entity-ref__search-row" }, ne = ["data-rec-focus-key", "disabled", "placeholder", "onKeydown"], ie = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "aimd-rec-entity-ref__hint"
|
|
9
|
+
}, se = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "aimd-rec-entity-ref__error"
|
|
12
|
+
}, ae = {
|
|
13
|
+
key: 3,
|
|
14
|
+
class: "aimd-rec-entity-ref__hint"
|
|
15
|
+
}, re = {
|
|
16
|
+
key: 4,
|
|
17
|
+
class: "aimd-rec-entity-ref__options"
|
|
18
|
+
}, le = ["disabled", "onClick"], oe = { class: "aimd-rec-entity-ref__option-label" }, ce = { class: "aimd-rec-entity-ref__option-id" }, ue = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "aimd-rec-entity-ref__option-description"
|
|
21
|
+
}, fe = /* @__PURE__ */ P({
|
|
22
|
+
__name: "AimdEntityRefField",
|
|
23
|
+
props: {
|
|
24
|
+
node: {},
|
|
25
|
+
value: {},
|
|
26
|
+
disabled: { type: Boolean },
|
|
27
|
+
messages: {},
|
|
28
|
+
fieldMeta: {},
|
|
29
|
+
type: {},
|
|
30
|
+
entityConfig: {},
|
|
31
|
+
entityResolvers: {},
|
|
32
|
+
record: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["change", "blur"],
|
|
35
|
+
setup(s, { emit: F }) {
|
|
36
|
+
const i = s, M = F, o = w(""), m = w([]), C = w(!1), k = w("");
|
|
37
|
+
let R = 0;
|
|
38
|
+
const E = p(() => `var:${i.node.id}`), S = p(() => i.entityConfig.entity || "entity"), z = p(() => {
|
|
39
|
+
const e = i.entityResolvers;
|
|
40
|
+
if (e)
|
|
41
|
+
return (i.entityConfig.source ? e[i.entityConfig.source] : void 0) ?? (i.entityConfig.entity ? e[i.entityConfig.entity] : void 0);
|
|
42
|
+
});
|
|
43
|
+
function u(e) {
|
|
44
|
+
return typeof e != "string" ? void 0 : e.trim() || void 0;
|
|
45
|
+
}
|
|
46
|
+
function h(e) {
|
|
47
|
+
if (typeof e == "string") {
|
|
48
|
+
const b = e.trim();
|
|
49
|
+
return b ? {
|
|
50
|
+
entity: S.value,
|
|
51
|
+
source: i.entityConfig.source,
|
|
52
|
+
id: b,
|
|
53
|
+
label: b
|
|
54
|
+
} : null;
|
|
55
|
+
}
|
|
56
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
57
|
+
return null;
|
|
58
|
+
const n = e, t = u(n.id) ?? u(n.value) ?? u(n.key);
|
|
59
|
+
if (!t) return null;
|
|
60
|
+
const d = u(n.label) ?? u(n.name) ?? u(n.title) ?? t, g = u(n.entity) ?? S.value, c = u(n.source) ?? i.entityConfig.source, _ = { ...n };
|
|
61
|
+
return delete _.disabled, {
|
|
62
|
+
..._,
|
|
63
|
+
entity: g,
|
|
64
|
+
id: t,
|
|
65
|
+
source: c,
|
|
66
|
+
label: d
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const v = p(() => {
|
|
70
|
+
if (i.entityConfig.multiple)
|
|
71
|
+
return (Array.isArray(i.value) ? i.value : i.value ? [i.value] : []).map((t) => h(t)).filter((t) => t !== null);
|
|
72
|
+
const e = h(i.value);
|
|
73
|
+
return e ? [e] : [];
|
|
74
|
+
}), A = p(() => new Set(
|
|
75
|
+
v.value.map((e) => `${e.source ?? ""}:${e.entity}:${e.id}`)
|
|
76
|
+
));
|
|
77
|
+
function I() {
|
|
78
|
+
return {
|
|
79
|
+
type: i.type,
|
|
80
|
+
normalizedType: J(i.type),
|
|
81
|
+
fieldKey: E.value,
|
|
82
|
+
node: i.node,
|
|
83
|
+
fieldMeta: i.fieldMeta,
|
|
84
|
+
entity: i.entityConfig.entity,
|
|
85
|
+
source: i.entityConfig.source,
|
|
86
|
+
query: o.value,
|
|
87
|
+
multiple: i.entityConfig.multiple,
|
|
88
|
+
record: i.record
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async function T() {
|
|
92
|
+
const e = o.value.trim(), n = z.value, t = ++R;
|
|
93
|
+
if (m.value = [], k.value = "", !n || !e) {
|
|
94
|
+
C.value = !1;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
C.value = !0;
|
|
98
|
+
try {
|
|
99
|
+
const g = await (typeof n == "function" ? n : n.search)(e, I());
|
|
100
|
+
t === R && (m.value = g.map((c) => h(c)).filter((c) => c !== null).map((c) => {
|
|
101
|
+
const _ = g.find((b) => h(b)?.id === c.id);
|
|
102
|
+
return {
|
|
103
|
+
..._ ?? c,
|
|
104
|
+
...c,
|
|
105
|
+
disabled: !!_?.disabled,
|
|
106
|
+
description: _?.description
|
|
107
|
+
};
|
|
108
|
+
}));
|
|
109
|
+
} catch {
|
|
110
|
+
t === R && (k.value = i.messages.entityRef.searchFailed);
|
|
111
|
+
} finally {
|
|
112
|
+
t === R && (C.value = !1);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
Q(
|
|
116
|
+
() => [
|
|
117
|
+
o.value,
|
|
118
|
+
i.entityResolvers,
|
|
119
|
+
i.entityConfig.entity,
|
|
120
|
+
i.entityConfig.source
|
|
121
|
+
],
|
|
122
|
+
() => {
|
|
123
|
+
T();
|
|
124
|
+
},
|
|
125
|
+
{ immediate: !0 }
|
|
126
|
+
);
|
|
127
|
+
function $(e) {
|
|
128
|
+
M("change", {
|
|
129
|
+
value: i.entityConfig.multiple ? e : e[0] ?? null
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function B(e) {
|
|
133
|
+
const n = h(e);
|
|
134
|
+
if (n) {
|
|
135
|
+
if (i.entityConfig.multiple) {
|
|
136
|
+
const t = `${n.source ?? ""}:${n.entity}:${n.id}`;
|
|
137
|
+
A.value.has(t) || $([...v.value, n]);
|
|
138
|
+
} else
|
|
139
|
+
$([n]);
|
|
140
|
+
o.value = "", m.value = [];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function N() {
|
|
144
|
+
const e = o.value.trim();
|
|
145
|
+
e && B(e);
|
|
146
|
+
}
|
|
147
|
+
function D(e) {
|
|
148
|
+
const n = v.value.filter((t, d) => d !== e);
|
|
149
|
+
$(n);
|
|
150
|
+
}
|
|
151
|
+
function L() {
|
|
152
|
+
$([]);
|
|
153
|
+
}
|
|
154
|
+
function V(e) {
|
|
155
|
+
return `${e.source ?? ""}:${e.entity}:${e.id}`;
|
|
156
|
+
}
|
|
157
|
+
function K(e) {
|
|
158
|
+
return e.label || e.id;
|
|
159
|
+
}
|
|
160
|
+
return (e, n) => (a(), r("span", O, [
|
|
161
|
+
v.value.length ? (a(), r("span", W, [
|
|
162
|
+
(a(!0), r(q, null, x(v.value, (t, d) => (a(), r("span", {
|
|
163
|
+
key: `${t.source ?? ""}:${t.entity}:${t.id}:${d}`,
|
|
164
|
+
class: "aimd-rec-entity-ref__chip"
|
|
165
|
+
}, [
|
|
166
|
+
y("span", X, l(t.entity), 1),
|
|
167
|
+
y("span", {
|
|
168
|
+
class: "aimd-rec-entity-ref__label",
|
|
169
|
+
title: K(t)
|
|
170
|
+
}, l(K(t)), 9, Y),
|
|
171
|
+
y("span", {
|
|
172
|
+
class: "aimd-rec-entity-ref__id",
|
|
173
|
+
title: t.id
|
|
174
|
+
}, l(t.id), 9, Z),
|
|
175
|
+
s.disabled ? f("", !0) : (a(), r("button", {
|
|
176
|
+
key: 0,
|
|
177
|
+
type: "button",
|
|
178
|
+
class: "aimd-rec-entity-ref__chip-remove",
|
|
179
|
+
"aria-label": s.messages.entityRef.remove,
|
|
180
|
+
title: s.messages.entityRef.remove,
|
|
181
|
+
onClick: (g) => D(d)
|
|
182
|
+
}, " × ", 8, ee))
|
|
183
|
+
]))), 128))
|
|
184
|
+
])) : f("", !0),
|
|
185
|
+
y("span", te, [
|
|
186
|
+
j(y("input", {
|
|
187
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => o.value = t),
|
|
188
|
+
"data-rec-focus-key": E.value,
|
|
189
|
+
class: "aimd-rec-inline__value-control aimd-rec-inline__input aimd-rec-inline__input--stacked aimd-rec-entity-ref__input",
|
|
190
|
+
disabled: s.disabled,
|
|
191
|
+
placeholder: z.value ? s.messages.entityRef.searchPlaceholder(S.value) : s.messages.entityRef.manualIdPlaceholder,
|
|
192
|
+
onKeydown: U(G(N, ["prevent"]), ["enter"]),
|
|
193
|
+
onBlur: n[1] || (n[1] = (t) => M("blur"))
|
|
194
|
+
}, null, 40, ne), [
|
|
195
|
+
[H, o.value]
|
|
196
|
+
]),
|
|
197
|
+
o.value.trim() && !s.disabled ? (a(), r("button", {
|
|
198
|
+
key: 0,
|
|
199
|
+
type: "button",
|
|
200
|
+
class: "aimd-rec-entity-ref__action",
|
|
201
|
+
onClick: N
|
|
202
|
+
}, l(s.entityConfig.multiple ? s.messages.entityRef.add : s.messages.entityRef.select), 1)) : f("", !0),
|
|
203
|
+
!s.entityConfig.multiple && v.value.length && !s.disabled ? (a(), r("button", {
|
|
204
|
+
key: 1,
|
|
205
|
+
type: "button",
|
|
206
|
+
class: "aimd-rec-entity-ref__action aimd-rec-entity-ref__action--secondary",
|
|
207
|
+
onClick: L
|
|
208
|
+
}, l(s.messages.entityRef.clear), 1)) : f("", !0)
|
|
209
|
+
]),
|
|
210
|
+
z.value ? k.value ? (a(), r("span", se, l(k.value), 1)) : o.value.trim() && !C.value && m.value.length === 0 ? (a(), r("span", ae, l(s.messages.entityRef.noMatches), 1)) : f("", !0) : (a(), r("span", ie, l(s.messages.entityRef.noResolver), 1)),
|
|
211
|
+
m.value.length ? (a(), r("span", re, [
|
|
212
|
+
(a(!0), r(q, null, x(m.value, (t) => (a(), r("button", {
|
|
213
|
+
key: V(t),
|
|
214
|
+
type: "button",
|
|
215
|
+
class: "aimd-rec-entity-ref__option",
|
|
216
|
+
disabled: s.disabled || t.disabled || A.value.has(V(t)),
|
|
217
|
+
onClick: (d) => B(t)
|
|
218
|
+
}, [
|
|
219
|
+
y("span", oe, l(K(t)), 1),
|
|
220
|
+
y("span", ce, l(t.id), 1),
|
|
221
|
+
t.description ? (a(), r("span", ue, l(t.description), 1)) : f("", !0)
|
|
222
|
+
], 8, le))), 128))
|
|
223
|
+
])) : f("", !0)
|
|
224
|
+
]));
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export {
|
|
228
|
+
fe as default
|
|
229
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as p, ref as m, watch as V, h as x, computed as l, shallowRef as te, onBeforeUnmount as oe, openBlock as r, createElementBlock as n, normalizeStyle as ie, normalizeClass as C, createElementVNode as s, toDisplayString as c, unref as v, createVNode as E, createCommentVNode as g, createBlock as re } from "vue";
|
|
2
|
-
import { g as ne, _ as de } from "./AimdEditor.vue_vue_type_style_index_0_lang-
|
|
3
|
-
import "./index-
|
|
4
|
-
import {
|
|
2
|
+
import { g as ne, _ as de } from "./AimdEditor.vue_vue_type_style_index_0_lang-v82TdP_I.js";
|
|
3
|
+
import "./index-CGb0O6x4.js";
|
|
4
|
+
import { Y as le, g as se } from "./useCodeBlockRendering-f5pBgZ96.js";
|
|
5
5
|
import "@airalogy/aimd-core";
|
|
6
6
|
import { renderToVue as ce, createMermaidRenderer as ue } from "@airalogy/aimd-renderer";
|
|
7
7
|
import { c as me } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
@@ -60,14 +60,14 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
60
60
|
setup(e) {
|
|
61
61
|
const t = m(""), i = m(!1);
|
|
62
62
|
let M = 0;
|
|
63
|
-
async function
|
|
63
|
+
async function X() {
|
|
64
64
|
const A = e.code.trim(), q = ++M;
|
|
65
65
|
if (!A) {
|
|
66
66
|
t.value = "", i.value = !1;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
|
-
const T = (await import("./mermaid.core-
|
|
70
|
+
const T = (await import("./mermaid.core-D4wVfZ2X.js").then((ae) => ae.bm)).default;
|
|
71
71
|
T.initialize({
|
|
72
72
|
startOnLoad: !1,
|
|
73
73
|
securityLevel: "strict"
|
|
@@ -83,7 +83,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
return V(() => e.code, () => {
|
|
86
|
-
|
|
86
|
+
X();
|
|
87
87
|
}, { immediate: !0 }), () => i.value ? x("pre", { class: "aimd-markdown-field__mermaid-fallback" }, e.code) : x("div", {
|
|
88
88
|
class: "aimd-markdown-field__mermaid",
|
|
89
89
|
innerHTML: t.value
|
|
@@ -118,7 +118,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
118
118
|
setup(e) {
|
|
119
119
|
return () => e.nodes;
|
|
120
120
|
}
|
|
121
|
-
}), I = l(() => !!o.value.trim()), f = l(() => h.value === "preview"), D = l(() => w(d.locale) ? "预览" : "Preview"), U = l(() => w(d.locale) ? "源码" : "Source"), j = l(() => w(d.locale) ? "暂无内容" : "No content"), W = l(() => w(d.locale) ? "Markdown 显示模式" : "Markdown view mode"),
|
|
121
|
+
}), I = l(() => !!o.value.trim()), f = l(() => h.value === "preview"), D = l(() => w(d.locale) ? "预览" : "Preview"), U = l(() => w(d.locale) ? "源码" : "Source"), j = l(() => w(d.locale) ? "暂无内容" : "No content"), W = l(() => w(d.locale) ? "Markdown 显示模式" : "Markdown view mode"), Y = l(() => ({
|
|
122
122
|
minimap: { enabled: !1 },
|
|
123
123
|
lineHeight: u.lineHeight,
|
|
124
124
|
padding: { top: 12, bottom: 12 },
|
|
@@ -150,19 +150,19 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
150
150
|
k.value = [], _.value = !0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Z() {
|
|
154
154
|
h.value = "preview", R();
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function G() {
|
|
157
157
|
h.value = "source";
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function J(e) {
|
|
160
160
|
u.syncEstimatedEditorHeight(e), e !== o.value && (o.value = e, S("update:modelValue", e));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function K(e) {
|
|
163
163
|
e.monaco && u.attachEditor(e.monaco);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Q(e) {
|
|
166
166
|
const t = b.value, i = e.relatedTarget;
|
|
167
167
|
!t || i && t.contains(i) || S("blur");
|
|
168
168
|
}
|
|
@@ -188,7 +188,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
188
188
|
"aimd-markdown-field--has-assigner-control": a.assignerControl || a.assignerStatus
|
|
189
189
|
}]),
|
|
190
190
|
style: ie(O.value),
|
|
191
|
-
onFocusout:
|
|
191
|
+
onFocusout: Q
|
|
192
192
|
}, [
|
|
193
193
|
s("span", fe, [
|
|
194
194
|
s("span", we, c(v(ne)("var", a.messages)), 1),
|
|
@@ -202,13 +202,13 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
202
202
|
type: "button",
|
|
203
203
|
class: C(["aimd-markdown-field__view-btn", { "aimd-markdown-field__view-btn--active": f.value }]),
|
|
204
204
|
"aria-pressed": f.value,
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: Z
|
|
206
206
|
}, c(D.value), 11, pe),
|
|
207
207
|
s("button", {
|
|
208
208
|
type: "button",
|
|
209
209
|
class: C(["aimd-markdown-field__view-btn", { "aimd-markdown-field__view-btn--active": !f.value }]),
|
|
210
210
|
"aria-pressed": !f.value,
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: G
|
|
212
212
|
}, c(U.value), 11, ge)
|
|
213
213
|
], 8, _e),
|
|
214
214
|
a.assignerControl || a.assignerStatus ? (r(), n("span", be, [
|
|
@@ -242,9 +242,9 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
242
242
|
"keep-inactive-editors-mounted": !1,
|
|
243
243
|
"min-height": v(B),
|
|
244
244
|
readonly: a.disabled,
|
|
245
|
-
"monaco-options":
|
|
246
|
-
"onUpdate:modelValue":
|
|
247
|
-
onReady:
|
|
245
|
+
"monaco-options": Y.value,
|
|
246
|
+
"onUpdate:modelValue": J,
|
|
247
|
+
onReady: K
|
|
248
248
|
}, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "min-height", "readonly", "monaco-options"]))
|
|
249
249
|
])
|
|
250
250
|
], 38));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as K, ref as h, computed as a, shallowRef as re, watch as
|
|
2
|
-
import { _ as we } from "./AimdEditor.vue_vue_type_style_index_0_lang-
|
|
3
|
-
import "./index-
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent as K, ref as h, computed as a, shallowRef as re, watch as R, onBeforeUnmount as se, openBlock as r, createElementBlock as m, normalizeStyle as ue, normalizeClass as U, createElementVNode as l, toDisplayString as s, createCommentVNode as ce, createBlock as me, unref as M, createVNode as fe, nextTick as ve } from "vue";
|
|
2
|
+
import { _ as we } from "./AimdEditor.vue_vue_type_style_index_0_lang-v82TdP_I.js";
|
|
3
|
+
import "./index-CGb0O6x4.js";
|
|
4
|
+
import { Y as he } from "./useCodeBlockRendering-f5pBgZ96.js";
|
|
5
5
|
import "@airalogy/aimd-core";
|
|
6
6
|
import { renderToVue as be } from "@airalogy/aimd-renderer";
|
|
7
7
|
import { c as _e } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
@@ -16,7 +16,7 @@ const ke = {
|
|
|
16
16
|
type: "button",
|
|
17
17
|
class: "aimd-markdown-note-field__view-btn aimd-markdown-note-field__view-btn--active",
|
|
18
18
|
"aria-pressed": "true"
|
|
19
|
-
},
|
|
19
|
+
}, Re = ["tabindex", "role"], Ve = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "aimd-markdown-note-field__preview-fallback"
|
|
22
22
|
}, Ce = {
|
|
@@ -46,23 +46,23 @@ const ke = {
|
|
|
46
46
|
function f(e) {
|
|
47
47
|
return e?.toLowerCase().startsWith("zh") ?? !1;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const V = h(null), P = h(null), n = h(N(t.modelValue)), u = _e({
|
|
50
50
|
getInitialValue: () => n.value,
|
|
51
|
-
getLayoutElement: () =>
|
|
51
|
+
getLayoutElement: () => V.value?.querySelector(".aimd-editor-container"),
|
|
52
52
|
minHeight: t.minHeight,
|
|
53
53
|
maxHeight: 420
|
|
54
54
|
}), B = u.editorHeight, W = a(() => ({
|
|
55
55
|
"--aimd-markdown-note-editor-height": `${B.value}px`
|
|
56
56
|
})), d = h(!1), _ = re([]), p = h(!1);
|
|
57
57
|
let C = 0, v = null, w = null, k = !1, F = !1;
|
|
58
|
-
const { preRenderer:
|
|
58
|
+
const { preRenderer: Y } = he(() => {
|
|
59
59
|
H();
|
|
60
|
-
}), c = a(() => !!n.value.trim()), S = a(() => c.value && !d.value), y = a(() => !t.disabled && (!c.value || d.value)),
|
|
60
|
+
}), c = a(() => !!n.value.trim()), S = a(() => c.value && !d.value), y = a(() => !t.disabled && (!c.value || d.value)), Z = a(() => !S.value && !y.value), j = a(() => f(t.locale) ? "关闭备注" : "Close note"), J = a(() => f(t.locale) ? "暂无备注" : "No notes"), L = a(() => f(t.locale) ? "预览" : "Preview"), A = a(() => f(t.locale) ? "源码" : "Source"), I = a(() => f(t.locale) ? "备注显示模式" : "Note view mode"), Q = a(() => ({
|
|
61
61
|
minimap: { enabled: !1 },
|
|
62
62
|
lineHeight: u.lineHeight,
|
|
63
63
|
padding: { top: 12, bottom: 12 },
|
|
64
64
|
scrollbar: { vertical: "auto", horizontal: "auto" }
|
|
65
|
-
})),
|
|
65
|
+
})), X = K({
|
|
66
66
|
name: "AimdMarkdownNotePreviewOutlet",
|
|
67
67
|
props: {
|
|
68
68
|
nodes: {
|
|
@@ -94,7 +94,7 @@ const ke = {
|
|
|
94
94
|
const E = await be(e, {
|
|
95
95
|
locale: t.locale,
|
|
96
96
|
elementRenderers: {
|
|
97
|
-
pre:
|
|
97
|
+
pre: Y
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
if (o !== C)
|
|
@@ -146,36 +146,36 @@ const ke = {
|
|
|
146
146
|
g();
|
|
147
147
|
}
|
|
148
148
|
function de(e) {
|
|
149
|
-
const o =
|
|
149
|
+
const o = V.value, E = e.relatedTarget;
|
|
150
150
|
!o || E && o.contains(E) || k || (g(), v = setTimeout(() => {
|
|
151
151
|
v = null;
|
|
152
152
|
const G = typeof document < "u" ? document.activeElement : null;
|
|
153
153
|
G instanceof Node && o.contains(G) || (c.value && (d.value = !1), b("blur"));
|
|
154
154
|
}, 0));
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return R(() => t.modelValue, (e) => {
|
|
157
157
|
const o = N(e);
|
|
158
158
|
o !== n.value && (n.value = o, u.syncEstimatedEditorHeight(o));
|
|
159
|
-
}),
|
|
159
|
+
}), R(
|
|
160
160
|
() => [n.value, t.locale],
|
|
161
161
|
() => {
|
|
162
162
|
z(), H();
|
|
163
163
|
},
|
|
164
164
|
{ immediate: !0 }
|
|
165
|
-
),
|
|
165
|
+
), R(() => t.disabled, () => {
|
|
166
166
|
z();
|
|
167
|
-
}),
|
|
167
|
+
}), R(y, (e) => {
|
|
168
168
|
e && !t.disabled && D();
|
|
169
169
|
}, { immediate: !0 }), se(() => {
|
|
170
170
|
g(), x(), u.dispose();
|
|
171
171
|
}), (e, o) => (r(), m("div", {
|
|
172
172
|
ref_key: "fieldRootRef",
|
|
173
|
-
ref:
|
|
173
|
+
ref: V,
|
|
174
174
|
class: U(["aimd-markdown-note-field", {
|
|
175
175
|
"aimd-markdown-note-field--disabled": i.disabled,
|
|
176
176
|
"aimd-markdown-note-field--preview": S.value,
|
|
177
177
|
"aimd-markdown-note-field--editor": y.value,
|
|
178
|
-
"aimd-markdown-note-field--empty":
|
|
178
|
+
"aimd-markdown-note-field--empty": Z.value
|
|
179
179
|
}]),
|
|
180
180
|
style: ue(W.value),
|
|
181
181
|
onFocusin: le,
|
|
@@ -204,11 +204,11 @@ const ke = {
|
|
|
204
204
|
onClick: ae,
|
|
205
205
|
onKeydown: ie
|
|
206
206
|
}, [
|
|
207
|
-
p.value ? (r(), m("pre",
|
|
207
|
+
p.value ? (r(), m("pre", Ve, s(n.value), 1)) : (r(), me(M(X), {
|
|
208
208
|
key: 1,
|
|
209
209
|
nodes: _.value
|
|
210
210
|
}, null, 8, ["nodes"]))
|
|
211
|
-
], 42,
|
|
211
|
+
], 42, Re)
|
|
212
212
|
])) : y.value ? (r(), m("div", Ce, [
|
|
213
213
|
l("div", Fe, [
|
|
214
214
|
l("span", {
|
|
@@ -229,7 +229,7 @@ const ke = {
|
|
|
229
229
|
type: "button",
|
|
230
230
|
class: "aimd-markdown-note-field__editor-close",
|
|
231
231
|
onClick: oe
|
|
232
|
-
}, s(
|
|
232
|
+
}, s(j.value), 1)
|
|
233
233
|
]),
|
|
234
234
|
fe(M(we), {
|
|
235
235
|
ref_key: "editorRef",
|
|
@@ -247,11 +247,11 @@ const ke = {
|
|
|
247
247
|
"keep-inactive-editors-mounted": !1,
|
|
248
248
|
"min-height": M(B),
|
|
249
249
|
readonly: i.disabled,
|
|
250
|
-
"monaco-options":
|
|
250
|
+
"monaco-options": Q.value,
|
|
251
251
|
"onUpdate:modelValue": ee,
|
|
252
252
|
onReady: ne
|
|
253
253
|
}, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "min-height", "readonly", "monaco-options"])
|
|
254
|
-
])) : (r(), m("div", xe, s(
|
|
254
|
+
])) : (r(), m("div", xe, s(J.value), 1))
|
|
255
255
|
], 38));
|
|
256
256
|
}
|
|
257
257
|
}), qe = /* @__PURE__ */ pe(Me, [["__scopeId", "data-v-21765085"]]);
|