@4399ywkf/editor 0.9.1 → 0.9.3
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/dist/{DocView-R4E7QINT.js → DocView-YBRD4V4E.js} +6 -5
- package/dist/DocView-YBRD4V4E.js.map +1 -0
- package/dist/chunk-4MQS76M2.js +51666 -0
- package/dist/chunk-4MQS76M2.js.map +1 -0
- package/dist/chunk-ABMZOL26.js +116 -0
- package/dist/chunk-ABMZOL26.js.map +1 -0
- package/dist/{chunk-QMYT5WXO.js → chunk-MGSVKKK7.js} +2 -2
- package/dist/{chunk-QMYT5WXO.js.map → chunk-MGSVKKK7.js.map} +1 -1
- package/dist/chunk-UD6MDBTN.js +1192 -0
- package/dist/chunk-UD6MDBTN.js.map +1 -0
- package/dist/{code-types-Dqmit3xx.d.ts → code-types-BTrUO25D.d.ts} +9 -1
- package/dist/diagram-canvas-22ANCGUV.js +261 -0
- package/dist/diagram-canvas-22ANCGUV.js.map +1 -0
- package/dist/doc-runtime.js +45 -7
- package/dist/doc-runtime.js.map +1 -1
- package/dist/doc.d.ts +526 -54
- package/dist/doc.js +4 -3
- package/dist/doc.js.map +1 -1
- package/dist/docx.js +115 -13
- package/dist/docx.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/pdf.d.ts +2 -2
- package/dist/plugins/ai.js +1 -1
- package/dist/pptx.d.ts +2 -2
- package/dist/{registry-BQ5T1Yko.d.ts → registry-ByvNr_Fa.d.ts} +1 -1
- package/dist/sheet.d.ts +3 -3
- package/dist/style.css +1049 -6047
- package/package.json +21 -5
- package/dist/DocView-R4E7QINT.js.map +0 -1
- package/dist/chunk-OGRGQQ3D.js +0 -23747
- package/dist/chunk-OGRGQQ3D.js.map +0 -1
- package/dist/chunk-ZY5KLA7T.js +0 -258
- package/dist/chunk-ZY5KLA7T.js.map +0 -1
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
// src/components/tiptap-node/heading-node/heading-numbering.ts
|
|
2
|
+
var AUTO = "auto";
|
|
3
|
+
var AUTO_NUMBER_MAX_LEVEL = 5;
|
|
4
|
+
var MAX_SEQ_VALUE = 999999999;
|
|
5
|
+
var NUMBERING_CONTAINERS = /* @__PURE__ */ new Set(["doc", "callout", "tableCell", "tableHeader"]);
|
|
6
|
+
var isSeq = (v) => typeof v === "string" && v !== "";
|
|
7
|
+
var seqLevelOf = (v) => isSeq(v) ? v : AUTO;
|
|
8
|
+
function collectNumberedHeadings(doc, includePos = -1) {
|
|
9
|
+
const groups = [];
|
|
10
|
+
const walk = (node, start, list) => {
|
|
11
|
+
node.forEach((child, offset) => {
|
|
12
|
+
const pos = start + offset;
|
|
13
|
+
if (child.type.name === "heading") {
|
|
14
|
+
if (isSeq(child.attrs.seq) || pos === includePos) {
|
|
15
|
+
list.push({
|
|
16
|
+
pos,
|
|
17
|
+
level: Number(child.attrs.level) || 1,
|
|
18
|
+
seq: isSeq(child.attrs.seq) ? child.attrs.seq : AUTO,
|
|
19
|
+
seqLevel: seqLevelOf(child.attrs.seqLevel)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (child.isTextblock || child.isLeaf) return;
|
|
25
|
+
if (NUMBERING_CONTAINERS.has(child.type.name)) {
|
|
26
|
+
const inner = [];
|
|
27
|
+
groups.push(inner);
|
|
28
|
+
walk(child, pos + 1, inner);
|
|
29
|
+
} else {
|
|
30
|
+
walk(child, pos + 1, list);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const root = [];
|
|
35
|
+
groups.push(root);
|
|
36
|
+
walk(doc, 0, root);
|
|
37
|
+
return groups.filter((g) => g.length > 0);
|
|
38
|
+
}
|
|
39
|
+
function calOrderQueue(list) {
|
|
40
|
+
const queue = [];
|
|
41
|
+
let last = 0;
|
|
42
|
+
for (const item of list) {
|
|
43
|
+
const level = item.level;
|
|
44
|
+
if (item.seqLevel !== AUTO || queue.length === 0) {
|
|
45
|
+
queue.push([item]);
|
|
46
|
+
last = queue.length - 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
for (let n = last; n >= 0; n--) {
|
|
50
|
+
const head = queue[n][0];
|
|
51
|
+
const headLevel = head.level;
|
|
52
|
+
if (level >= headLevel || level < headLevel && head.seqLevel === AUTO) {
|
|
53
|
+
if (level === headLevel && head.seqLevel !== AUTO && item.seq !== AUTO) {
|
|
54
|
+
if (n === 0) {
|
|
55
|
+
queue.push([item]);
|
|
56
|
+
last = queue.length - 1;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
queue[n].push(item);
|
|
62
|
+
last = n;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
if (n === 0) {
|
|
66
|
+
queue.push([item]);
|
|
67
|
+
last = queue.length - 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return queue;
|
|
72
|
+
}
|
|
73
|
+
function getOrderLevelMap(group) {
|
|
74
|
+
const map = /* @__PURE__ */ new Map();
|
|
75
|
+
const first = group[0]?.seqLevel ?? AUTO;
|
|
76
|
+
let depth = first === AUTO ? 1 : Number.parseInt(first, 10) || 1;
|
|
77
|
+
const present = new Set(group.map((h) => h.level));
|
|
78
|
+
for (let level = 1; level <= 9; level++) {
|
|
79
|
+
if (present.has(level)) {
|
|
80
|
+
map.set(level, depth);
|
|
81
|
+
depth++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return map.size > 0 ? map : null;
|
|
85
|
+
}
|
|
86
|
+
function calcOrder(queue, initial = []) {
|
|
87
|
+
const result = /* @__PURE__ */ new Map();
|
|
88
|
+
let autoStream = [...initial];
|
|
89
|
+
let levelStream = [...initial];
|
|
90
|
+
for (const group of queue) {
|
|
91
|
+
const levelMap = getOrderLevelMap(group);
|
|
92
|
+
if (!levelMap) continue;
|
|
93
|
+
let useLevelStream = false;
|
|
94
|
+
let order;
|
|
95
|
+
for (const h of group) {
|
|
96
|
+
if (h.seqLevel !== AUTO) useLevelStream = true;
|
|
97
|
+
order = useLevelStream ? [...levelStream] : [...autoStream];
|
|
98
|
+
const depth = levelMap.get(h.level);
|
|
99
|
+
if (!depth) continue;
|
|
100
|
+
if (order.length === depth) order[depth - 1]++;
|
|
101
|
+
else if (order.length < depth) {
|
|
102
|
+
for (let i = order.length; i < depth; i++) order.push(1);
|
|
103
|
+
} else {
|
|
104
|
+
order.length = depth;
|
|
105
|
+
order[depth - 1]++;
|
|
106
|
+
}
|
|
107
|
+
if (h.seq !== AUTO) {
|
|
108
|
+
const n = Number.parseInt(h.seq, 10);
|
|
109
|
+
if (Number.isFinite(n)) order[depth - 1] = n;
|
|
110
|
+
}
|
|
111
|
+
result.set(h.pos, [...order]);
|
|
112
|
+
if (useLevelStream) levelStream = [...order];
|
|
113
|
+
else autoStream = [...order];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
function computeHeadingOrders(doc) {
|
|
119
|
+
const all = /* @__PURE__ */ new Map();
|
|
120
|
+
for (const list of collectNumberedHeadings(doc)) {
|
|
121
|
+
for (const [pos, order] of calcOrder(calOrderQueue(list))) all.set(pos, order);
|
|
122
|
+
}
|
|
123
|
+
return all;
|
|
124
|
+
}
|
|
125
|
+
function orderText(order) {
|
|
126
|
+
if (!order || order.length === 0) return null;
|
|
127
|
+
return order.length === 1 ? `${order[0]}.` : order.join(".");
|
|
128
|
+
}
|
|
129
|
+
function splitOrderText(text) {
|
|
130
|
+
if (!text) return { prefix: "", number: "" };
|
|
131
|
+
const parts = text.split(".");
|
|
132
|
+
while (parts.length > 1) {
|
|
133
|
+
const last = parts.pop();
|
|
134
|
+
if (last) return { number: last, prefix: `${parts.join(".")}.` };
|
|
135
|
+
}
|
|
136
|
+
return { number: parts[parts.length - 1], prefix: "" };
|
|
137
|
+
}
|
|
138
|
+
function siblingsOf(doc, pos, include = false) {
|
|
139
|
+
for (const list of collectNumberedHeadings(doc, include ? pos : -1)) {
|
|
140
|
+
const index = list.findIndex((h) => h.pos === pos);
|
|
141
|
+
if (index >= 0) return { list, index };
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
function previousSameLevel(doc, pos, include = false) {
|
|
146
|
+
return sameLevelNeighbor(doc, pos, -1, include);
|
|
147
|
+
}
|
|
148
|
+
function sameLevelNeighbor(doc, pos, step, include) {
|
|
149
|
+
const found = siblingsOf(doc, pos, include);
|
|
150
|
+
if (!found) return null;
|
|
151
|
+
const me = found.list[found.index];
|
|
152
|
+
for (let i = found.index + step; i >= 0 && i < found.list.length; i += step) {
|
|
153
|
+
const h = found.list[i];
|
|
154
|
+
if (h.level === me.level) return h;
|
|
155
|
+
if (h.level < me.level) return null;
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
function hasParentHeading(doc, pos, include = false) {
|
|
160
|
+
const found = siblingsOf(doc, pos, include);
|
|
161
|
+
if (!found) return false;
|
|
162
|
+
const { list, index } = found;
|
|
163
|
+
const me = list[index];
|
|
164
|
+
const scan = (step) => {
|
|
165
|
+
for (let i = index + step; i >= 0 && i < list.length; i += step) {
|
|
166
|
+
const h = list[i];
|
|
167
|
+
if (h.level === 1 && me.level === 1) return false;
|
|
168
|
+
if (h.level < me.level) return true;
|
|
169
|
+
}
|
|
170
|
+
return false;
|
|
171
|
+
};
|
|
172
|
+
return scan(1) || scan(-1);
|
|
173
|
+
}
|
|
174
|
+
function numberMenuState(doc, pos) {
|
|
175
|
+
const node = doc.nodeAt(pos);
|
|
176
|
+
if (!node || node.type.name !== "heading" || !isSeq(node.attrs.seq)) return null;
|
|
177
|
+
const orders = computeHeadingOrders(doc);
|
|
178
|
+
const order = orderText(orders.get(pos)) ?? "";
|
|
179
|
+
const { prefix, number } = splitOrderText(order);
|
|
180
|
+
const prev = previousSameLevel(doc, pos);
|
|
181
|
+
let continuing = false;
|
|
182
|
+
if (prev) {
|
|
183
|
+
const p = splitOrderText(orderText(orders.get(prev.pos)));
|
|
184
|
+
continuing = p.prefix === prefix && Number(number) === Number(p.number) + 1;
|
|
185
|
+
}
|
|
186
|
+
const seqLevel = seqLevelOf(node.attrs.seqLevel);
|
|
187
|
+
return {
|
|
188
|
+
order,
|
|
189
|
+
prefix,
|
|
190
|
+
number,
|
|
191
|
+
continueDisabled: !prev || continuing || seqLevel === AUTO && node.attrs.seq === AUTO,
|
|
192
|
+
restartDisabled: order === "1." || number === "1" && prefix === "",
|
|
193
|
+
restartChildDisabled: number === "1"
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function attrsForMenuAction(doc, pos, action) {
|
|
197
|
+
const node = doc.nodeAt(pos);
|
|
198
|
+
if (!node || node.type.name !== "heading") return null;
|
|
199
|
+
switch (action.kind) {
|
|
200
|
+
case "continue":
|
|
201
|
+
return { seq: AUTO, seqLevel: AUTO };
|
|
202
|
+
case "restart":
|
|
203
|
+
return { seq: "1", seqLevel: "1" };
|
|
204
|
+
case "restartChild":
|
|
205
|
+
return { seq: "1" };
|
|
206
|
+
case "custom": {
|
|
207
|
+
const value = Math.trunc(action.value);
|
|
208
|
+
if (!Number.isFinite(value) || value < 1 || value > MAX_SEQ_VALUE) return null;
|
|
209
|
+
const { prefix } = splitOrderText(orderText(computeHeadingOrders(doc).get(pos)));
|
|
210
|
+
const level = Number(node.attrs.level) || 1;
|
|
211
|
+
const needLevel = prefix === "" && level !== 1 && hasParentHeading(doc, pos);
|
|
212
|
+
return needLevel ? { seq: String(value), seqLevel: "1" } : { seq: String(value) };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
var MARKDOWN_SEQ_PATTERN = /^((?:\d+\.)+)\s$/;
|
|
217
|
+
function markdownSeqFor(doc, pos, typed) {
|
|
218
|
+
const node = doc.nodeAt(pos);
|
|
219
|
+
if (!node || node.type.name !== "heading") return null;
|
|
220
|
+
const parts = typed.split(".");
|
|
221
|
+
const typedNumber = Number.parseInt(parts[parts.length - 2], 10);
|
|
222
|
+
if (!Number.isFinite(typedNumber)) return null;
|
|
223
|
+
const typedDepth = parts.length - 1;
|
|
224
|
+
const level = Number(node.attrs.level) || 1;
|
|
225
|
+
const parent = hasParentHeading(doc, pos, true);
|
|
226
|
+
const up = sameLevelNeighbor(doc, pos, -1, true);
|
|
227
|
+
const down = sameLevelNeighbor(doc, pos, 1, true);
|
|
228
|
+
let position = "top";
|
|
229
|
+
let mergeSeq;
|
|
230
|
+
let mergeLevel;
|
|
231
|
+
if (!up && !down) position = "top";
|
|
232
|
+
else if (up && !down) position = "bottom";
|
|
233
|
+
else if (!up && down) position = "top";
|
|
234
|
+
else if (down) {
|
|
235
|
+
if (down.seq !== AUTO) {
|
|
236
|
+
const next = Number.parseInt(down.seq, 10);
|
|
237
|
+
if (next - 1 === typedNumber) {
|
|
238
|
+
position = "merge";
|
|
239
|
+
mergeSeq = String(next - 1);
|
|
240
|
+
mergeLevel = down.seqLevel;
|
|
241
|
+
} else position = "bottom";
|
|
242
|
+
} else position = "between";
|
|
243
|
+
}
|
|
244
|
+
const n = String(typedNumber);
|
|
245
|
+
const startLevel = typedDepth === 1 && level !== 1 && parent ? "1" : AUTO;
|
|
246
|
+
switch (position) {
|
|
247
|
+
case "top":
|
|
248
|
+
return typedDepth === 1 ? { seq: n, seqLevel: level !== 1 && parent ? "1" : AUTO } : { seq: n, seqLevel: AUTO };
|
|
249
|
+
case "merge":
|
|
250
|
+
return { seq: mergeSeq || AUTO, seqLevel: mergeLevel || AUTO };
|
|
251
|
+
default:
|
|
252
|
+
return typedNumber === 1 ? { seq: n, seqLevel: startLevel } : { seq: AUTO, seqLevel: AUTO };
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function computeHeadingOrdersFromJson(doc) {
|
|
256
|
+
const lists = [];
|
|
257
|
+
const byId2 = /* @__PURE__ */ new Map();
|
|
258
|
+
let nextId = 0;
|
|
259
|
+
const walk = (node, list) => {
|
|
260
|
+
for (const child of node.content ?? []) {
|
|
261
|
+
if (child.type === "heading") {
|
|
262
|
+
if (isSeq(child.attrs?.seq)) {
|
|
263
|
+
const id = nextId++;
|
|
264
|
+
byId2.set(id, child);
|
|
265
|
+
list.push({
|
|
266
|
+
pos: id,
|
|
267
|
+
level: Number(child.attrs?.level) || 1,
|
|
268
|
+
seq: String(child.attrs?.seq),
|
|
269
|
+
seqLevel: seqLevelOf(child.attrs?.seqLevel)
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
if (!child.content) continue;
|
|
275
|
+
if (child.type && NUMBERING_CONTAINERS.has(child.type)) {
|
|
276
|
+
const inner = [];
|
|
277
|
+
lists.push(inner);
|
|
278
|
+
walk(child, inner);
|
|
279
|
+
} else walk(child, list);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
const root = [];
|
|
283
|
+
lists.push(root);
|
|
284
|
+
walk(doc, root);
|
|
285
|
+
const out = /* @__PURE__ */ new Map();
|
|
286
|
+
for (const list of lists) {
|
|
287
|
+
for (const [id, order] of calcOrder(calOrderQueue(list))) {
|
|
288
|
+
const node = byId2.get(id);
|
|
289
|
+
const text = orderText(order);
|
|
290
|
+
if (node && text) out.set(node, text);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return out;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// src/components/tiptap-node/code-block-node/code-languages.ts
|
|
297
|
+
var CODE_LANGUAGES = [
|
|
298
|
+
{ id: "plaintext", label: "Plain Text", keywords: ["text", "txt", "纯文本"] },
|
|
299
|
+
{ id: "abap", label: "ABAP" },
|
|
300
|
+
{ id: "ada", label: "Ada" },
|
|
301
|
+
{ id: "apache", label: "Apache" },
|
|
302
|
+
{ id: "apex", label: "Apex" },
|
|
303
|
+
{ id: "asm", label: "Assembly", keywords: ["asm", "汇编"] },
|
|
304
|
+
{ id: "bash", label: "Bash", keywords: ["sh", "zsh", "ash", "csh", "tcsh"] },
|
|
305
|
+
{ id: "c", label: "C" },
|
|
306
|
+
{ id: "cmake", label: "CMake" },
|
|
307
|
+
{ id: "cobol", label: "COBOL" },
|
|
308
|
+
{ id: "coffee", label: "CoffeeScript", keywords: ["coffee"] },
|
|
309
|
+
{ id: "cpp", label: "C++", keywords: ["cpp", "c++"] },
|
|
310
|
+
{ id: "csharp", label: "C#", keywords: ["cs", "csharp", "c#"] },
|
|
311
|
+
{ id: "css", label: "CSS" },
|
|
312
|
+
{ id: "d", label: "D" },
|
|
313
|
+
{ id: "dart", label: "Dart" },
|
|
314
|
+
{ id: "pascal", label: "Delphi", keywords: ["pascal"] },
|
|
315
|
+
{ id: "diff", label: "Diff", keywords: ["patch"] },
|
|
316
|
+
{ id: "jinja", label: "Django", keywords: ["jinja"] },
|
|
317
|
+
{ id: "docker", label: "Dockerfile", keywords: ["docker"] },
|
|
318
|
+
{ id: "erlang", label: "Erlang" },
|
|
319
|
+
{ id: "fortran-free-form", label: "Fortran" },
|
|
320
|
+
{ id: "gherkin", label: "Gherkin", keywords: ["cucumber"] },
|
|
321
|
+
{ id: "glsl", label: "GLSL", keywords: ["opengl", "shader"] },
|
|
322
|
+
{ id: "go", label: "Go", keywords: ["golang"] },
|
|
323
|
+
{ id: "graphql", label: "GraphQL", keywords: ["gql"] },
|
|
324
|
+
{ id: "groovy", label: "Groovy" },
|
|
325
|
+
{ id: "haskell", label: "Haskell", keywords: ["hs"] },
|
|
326
|
+
{ id: "html", label: "HTML" },
|
|
327
|
+
{ id: "handlebars", label: "HTMLBars", keywords: ["handlebars", "hbs"] },
|
|
328
|
+
{ id: "http", label: "HTTP" },
|
|
329
|
+
{ id: "java", label: "Java", keywords: ["jsp"] },
|
|
330
|
+
{ id: "javascript", label: "JavaScript", keywords: ["js", "jsx"] },
|
|
331
|
+
{ id: "json", label: "JSON" },
|
|
332
|
+
{ id: "julia", label: "Julia" },
|
|
333
|
+
{ id: "kotlin", label: "Kotlin", keywords: ["kt"] },
|
|
334
|
+
{ id: "latex", label: "LaTeX", keywords: ["tex"] },
|
|
335
|
+
{ id: "common-lisp", label: "Lisp", keywords: ["lisp"] },
|
|
336
|
+
{ id: "lua", label: "Lua" },
|
|
337
|
+
{ id: "make", label: "Makefile", keywords: ["make"] },
|
|
338
|
+
{ id: "markdown", label: "Markdown", keywords: ["md"] },
|
|
339
|
+
{ id: "matlab", label: "MATLAB" },
|
|
340
|
+
{ id: "nginx", label: "Nginx" },
|
|
341
|
+
{ id: "objective-c", label: "Objective-C", keywords: ["objc"] },
|
|
342
|
+
{ id: "perl", label: "Perl" },
|
|
343
|
+
{ id: "php", label: "PHP" },
|
|
344
|
+
{ id: "powershell", label: "PowerShell", keywords: ["ps1"] },
|
|
345
|
+
{ id: "prolog", label: "Prolog" },
|
|
346
|
+
{ id: "properties", label: "Properties" },
|
|
347
|
+
{ id: "proto", label: "ProtoBuf", keywords: ["protobuf", "proto"] },
|
|
348
|
+
{ id: "python", label: "Python", keywords: ["py"] },
|
|
349
|
+
{ id: "r", label: "R" },
|
|
350
|
+
{ id: "ruby", label: "Ruby", keywords: ["rb"] },
|
|
351
|
+
{ id: "rust", label: "Rust", keywords: ["rs"] },
|
|
352
|
+
{ id: "sas", label: "SAS" },
|
|
353
|
+
{ id: "scala", label: "Scala" },
|
|
354
|
+
{ id: "scheme", label: "Scheme" },
|
|
355
|
+
{ id: "scss", label: "SCSS" },
|
|
356
|
+
{ id: "shellscript", label: "Shell", keywords: ["shell"] },
|
|
357
|
+
{ id: "solidity", label: "Solidity", keywords: ["sol"] },
|
|
358
|
+
{ id: "sql", label: "SQL" },
|
|
359
|
+
{ id: "swift", label: "Swift" },
|
|
360
|
+
{ id: "thrift", label: "Thrift" },
|
|
361
|
+
{ id: "toml", label: "TOML", keywords: ["ini"] },
|
|
362
|
+
{ id: "typescript", label: "TypeScript", keywords: ["ts", "tsx"] },
|
|
363
|
+
{ id: "vb", label: "Visual Basic", keywords: ["vb", "vbscript", "vbs"] },
|
|
364
|
+
{ id: "verilog", label: "Verilog" },
|
|
365
|
+
{ id: "vhdl", label: "VHDL" },
|
|
366
|
+
{ id: "xml", label: "XML", keywords: ["svg"] },
|
|
367
|
+
{ id: "yaml", label: "YAML", keywords: ["yml"] }
|
|
368
|
+
];
|
|
369
|
+
var byId = new Map(CODE_LANGUAGES.map((l) => [l.id, l]));
|
|
370
|
+
function findCodeLanguage(id) {
|
|
371
|
+
return id ? byId.get(id) ?? null : null;
|
|
372
|
+
}
|
|
373
|
+
function filterCodeLanguages(query) {
|
|
374
|
+
const q = query.trim().toLowerCase();
|
|
375
|
+
if (!q) return CODE_LANGUAGES;
|
|
376
|
+
const prefix = [];
|
|
377
|
+
const contains = [];
|
|
378
|
+
for (const lang of CODE_LANGUAGES) {
|
|
379
|
+
const terms = [lang.label.toLowerCase(), lang.id, ...lang.keywords ?? []];
|
|
380
|
+
if (terms.some((t) => t.startsWith(q))) prefix.push(lang);
|
|
381
|
+
else if (terms.some((t) => t.includes(q))) contains.push(lang);
|
|
382
|
+
}
|
|
383
|
+
return [...prefix, ...contains];
|
|
384
|
+
}
|
|
385
|
+
function resolveCodeLanguage(input) {
|
|
386
|
+
const q = (input ?? "").trim().toLowerCase();
|
|
387
|
+
if (!q) return null;
|
|
388
|
+
for (const lang of CODE_LANGUAGES) {
|
|
389
|
+
if (lang.id === q || lang.label.toLowerCase() === q || lang.keywords?.some((k) => k.toLowerCase() === q)) return lang.id;
|
|
390
|
+
}
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/components/tiptap-node/code-block-node/code-highlighter.ts
|
|
395
|
+
var PLAINTEXT = "plaintext";
|
|
396
|
+
var DEFAULT_THEMES = { light: "github-light", dark: "github-dark" };
|
|
397
|
+
var MAX_HIGHLIGHT_LENGTH = 1e5;
|
|
398
|
+
var MAX_HIGHLIGHT_LINES = 2e3;
|
|
399
|
+
var CACHE_MAX_ENTRIES = 256;
|
|
400
|
+
var CACHE_MAX_SOURCE_LENGTH = 2e6;
|
|
401
|
+
var DEFAULT_ALIASES = {
|
|
402
|
+
sh: "bash",
|
|
403
|
+
shell: "bash",
|
|
404
|
+
zsh: "bash",
|
|
405
|
+
py: "python",
|
|
406
|
+
golang: "go",
|
|
407
|
+
tsx: "tsx",
|
|
408
|
+
jsx: "jsx",
|
|
409
|
+
js: "javascript",
|
|
410
|
+
mjs: "javascript",
|
|
411
|
+
cjs: "javascript",
|
|
412
|
+
ts: "typescript",
|
|
413
|
+
yml: "yaml",
|
|
414
|
+
md: "markdown",
|
|
415
|
+
"c++": "cpp",
|
|
416
|
+
"c#": "csharp",
|
|
417
|
+
cs: "csharp",
|
|
418
|
+
rb: "ruby",
|
|
419
|
+
rs: "rust",
|
|
420
|
+
kt: "kotlin",
|
|
421
|
+
ps1: "powershell",
|
|
422
|
+
dockerfile: "docker",
|
|
423
|
+
text: PLAINTEXT,
|
|
424
|
+
txt: PLAINTEXT,
|
|
425
|
+
plain: PLAINTEXT
|
|
426
|
+
};
|
|
427
|
+
var DISPLAY_NAMES = {
|
|
428
|
+
bash: "Bash",
|
|
429
|
+
python: "Python",
|
|
430
|
+
go: "Go",
|
|
431
|
+
javascript: "JavaScript",
|
|
432
|
+
typescript: "TypeScript",
|
|
433
|
+
jsx: "JSX",
|
|
434
|
+
tsx: "TSX",
|
|
435
|
+
json: "JSON",
|
|
436
|
+
yaml: "YAML",
|
|
437
|
+
toml: "TOML",
|
|
438
|
+
html: "HTML",
|
|
439
|
+
css: "CSS",
|
|
440
|
+
scss: "SCSS",
|
|
441
|
+
less: "Less",
|
|
442
|
+
markdown: "Markdown",
|
|
443
|
+
sql: "SQL",
|
|
444
|
+
java: "Java",
|
|
445
|
+
kotlin: "Kotlin",
|
|
446
|
+
swift: "Swift",
|
|
447
|
+
c: "C",
|
|
448
|
+
cpp: "C++",
|
|
449
|
+
csharp: "C#",
|
|
450
|
+
rust: "Rust",
|
|
451
|
+
ruby: "Ruby",
|
|
452
|
+
php: "PHP",
|
|
453
|
+
lua: "Lua",
|
|
454
|
+
dart: "Dart",
|
|
455
|
+
docker: "Dockerfile",
|
|
456
|
+
powershell: "PowerShell",
|
|
457
|
+
xml: "XML",
|
|
458
|
+
vue: "Vue",
|
|
459
|
+
svelte: "Svelte",
|
|
460
|
+
graphql: "GraphQL",
|
|
461
|
+
nginx: "Nginx",
|
|
462
|
+
ini: "INI",
|
|
463
|
+
diff: "Diff",
|
|
464
|
+
gdscript: "GDScript"
|
|
465
|
+
};
|
|
466
|
+
function getLanguageDisplayName(normalized) {
|
|
467
|
+
return DISPLAY_NAMES[normalized] ?? findCodeLanguage(normalized)?.label ?? null;
|
|
468
|
+
}
|
|
469
|
+
function normalizeLanguageId(input) {
|
|
470
|
+
const raw = (input ?? "").trim().toLowerCase();
|
|
471
|
+
if (!raw) return PLAINTEXT;
|
|
472
|
+
return DEFAULT_ALIASES[raw] ?? raw;
|
|
473
|
+
}
|
|
474
|
+
function getCodeBlockTitle(attrs, normalizeLanguage = normalizeLanguageId) {
|
|
475
|
+
const label = attrs.label?.trim();
|
|
476
|
+
if (label) return label;
|
|
477
|
+
const raw = attrs.language?.trim();
|
|
478
|
+
if (!raw) return "纯文本";
|
|
479
|
+
const normalized = normalizeLanguage(raw);
|
|
480
|
+
if (normalized === PLAINTEXT) return "纯文本";
|
|
481
|
+
return getLanguageDisplayName(normalized) ?? raw;
|
|
482
|
+
}
|
|
483
|
+
function resolveShikiTheme(theme, isDark) {
|
|
484
|
+
if (!theme) return isDark ? DEFAULT_THEMES.dark : DEFAULT_THEMES.light;
|
|
485
|
+
if (typeof theme === "string") return theme;
|
|
486
|
+
return isDark ? theme.dark : theme.light;
|
|
487
|
+
}
|
|
488
|
+
var escapeHtml = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
489
|
+
function plaintextResult(source) {
|
|
490
|
+
return {
|
|
491
|
+
language: PLAINTEXT,
|
|
492
|
+
tokens: [],
|
|
493
|
+
html: `<pre class="shiki"><code>${escapeHtml(source)}</code></pre>`
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function exceedsLimits(source) {
|
|
497
|
+
if (source.length > MAX_HIGHLIGHT_LENGTH) return true;
|
|
498
|
+
let lines = 1;
|
|
499
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
500
|
+
if (source.charCodeAt(i) === 10) {
|
|
501
|
+
lines += 1;
|
|
502
|
+
if (lines > MAX_HIGHLIGHT_LINES) return true;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
var defaultLoader = () => import('shiki');
|
|
508
|
+
var sharedModules = /* @__PURE__ */ new Map();
|
|
509
|
+
var sharedHighlighters = /* @__PURE__ */ new WeakMap();
|
|
510
|
+
var pendingLoads = /* @__PURE__ */ new WeakMap();
|
|
511
|
+
function loadModule(loader) {
|
|
512
|
+
let pending = sharedModules.get(loader);
|
|
513
|
+
if (!pending) {
|
|
514
|
+
pending = loader().catch((error) => {
|
|
515
|
+
sharedModules.delete(loader);
|
|
516
|
+
throw error;
|
|
517
|
+
});
|
|
518
|
+
sharedModules.set(loader, pending);
|
|
519
|
+
}
|
|
520
|
+
return pending;
|
|
521
|
+
}
|
|
522
|
+
function loadHighlighter(shiki) {
|
|
523
|
+
let pending = sharedHighlighters.get(shiki);
|
|
524
|
+
if (!pending) {
|
|
525
|
+
pending = shiki.createHighlighter({ themes: [], langs: [] }).then((h) => h).catch((error) => {
|
|
526
|
+
sharedHighlighters.delete(shiki);
|
|
527
|
+
throw error;
|
|
528
|
+
});
|
|
529
|
+
sharedHighlighters.set(shiki, pending);
|
|
530
|
+
}
|
|
531
|
+
return pending;
|
|
532
|
+
}
|
|
533
|
+
function loadOnce(highlighter, key, run) {
|
|
534
|
+
let loads = pendingLoads.get(highlighter);
|
|
535
|
+
if (!loads) {
|
|
536
|
+
loads = /* @__PURE__ */ new Map();
|
|
537
|
+
pendingLoads.set(highlighter, loads);
|
|
538
|
+
}
|
|
539
|
+
let pending = loads.get(key);
|
|
540
|
+
if (!pending) {
|
|
541
|
+
pending = run().catch((error) => {
|
|
542
|
+
loads?.delete(key);
|
|
543
|
+
throw error;
|
|
544
|
+
});
|
|
545
|
+
loads.set(key, pending);
|
|
546
|
+
}
|
|
547
|
+
return pending;
|
|
548
|
+
}
|
|
549
|
+
function flattenTokens(lines) {
|
|
550
|
+
const out = [];
|
|
551
|
+
for (const line of lines) {
|
|
552
|
+
for (const token of line) {
|
|
553
|
+
if (!token.content) continue;
|
|
554
|
+
const start = token.offset;
|
|
555
|
+
const end = start + token.content.length;
|
|
556
|
+
const fontStyle = typeof token.fontStyle === "number" && token.fontStyle > 0 ? token.fontStyle : void 0;
|
|
557
|
+
if (!token.color && fontStyle === void 0) continue;
|
|
558
|
+
out.push({ start, end, color: token.color, fontStyle });
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
return out;
|
|
562
|
+
}
|
|
563
|
+
var configSerial = 0;
|
|
564
|
+
function createCodeHighlighter(options = {}, deps = {}) {
|
|
565
|
+
const loader = deps.loadShiki ?? defaultLoader;
|
|
566
|
+
const aliases = { ...DEFAULT_ALIASES, ...options.languageAliases ?? {} };
|
|
567
|
+
configSerial += 1;
|
|
568
|
+
const configId = configSerial;
|
|
569
|
+
const cache = /* @__PURE__ */ new Map();
|
|
570
|
+
let cachedSourceLength = 0;
|
|
571
|
+
let customLanguagesLoaded = null;
|
|
572
|
+
const normalizeLanguage = (input) => {
|
|
573
|
+
const raw = (input ?? "").trim().toLowerCase();
|
|
574
|
+
if (!raw) return PLAINTEXT;
|
|
575
|
+
return aliases[raw] ?? raw;
|
|
576
|
+
};
|
|
577
|
+
const evict = () => {
|
|
578
|
+
while (cache.size > CACHE_MAX_ENTRIES || cachedSourceLength > CACHE_MAX_SOURCE_LENGTH) {
|
|
579
|
+
const oldest = cache.keys().next();
|
|
580
|
+
if (oldest.done) break;
|
|
581
|
+
const entry = cache.get(oldest.value);
|
|
582
|
+
cache.delete(oldest.value);
|
|
583
|
+
if (entry) cachedSourceLength -= entry.size;
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
const forget = (key) => {
|
|
587
|
+
const entry = cache.get(key);
|
|
588
|
+
if (!entry) return;
|
|
589
|
+
cache.delete(key);
|
|
590
|
+
cachedSourceLength -= entry.size;
|
|
591
|
+
};
|
|
592
|
+
const ensureCustomLanguages = (highlighter) => {
|
|
593
|
+
if (!options.languages) return Promise.resolve();
|
|
594
|
+
if (!customLanguagesLoaded) {
|
|
595
|
+
customLanguagesLoaded = highlighter.loadLanguage(options.languages).catch((error) => {
|
|
596
|
+
customLanguagesLoaded = null;
|
|
597
|
+
throw error;
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
return customLanguagesLoaded;
|
|
601
|
+
};
|
|
602
|
+
const isKnownLanguage = (shiki, highlighter, lang) => {
|
|
603
|
+
if (lang === PLAINTEXT) return true;
|
|
604
|
+
if (highlighter.getLoadedLanguages().includes(lang)) return true;
|
|
605
|
+
return Object.hasOwn(shiki.bundledLanguages, lang);
|
|
606
|
+
};
|
|
607
|
+
const run = async (source, lang, theme) => {
|
|
608
|
+
const shiki = await loadModule(loader);
|
|
609
|
+
const highlighter = await loadHighlighter(shiki);
|
|
610
|
+
await loadOnce(highlighter, `theme:${theme}`, () => highlighter.loadTheme(theme));
|
|
611
|
+
await ensureCustomLanguages(highlighter);
|
|
612
|
+
const resolved = isKnownLanguage(shiki, highlighter, lang) ? lang : PLAINTEXT;
|
|
613
|
+
if (resolved !== PLAINTEXT && !highlighter.getLoadedLanguages().includes(resolved)) {
|
|
614
|
+
await loadOnce(
|
|
615
|
+
highlighter,
|
|
616
|
+
`lang:${resolved}`,
|
|
617
|
+
() => highlighter.loadLanguage(resolved)
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
const html = highlighter.codeToHtml(source, { lang: resolved, theme });
|
|
621
|
+
if (resolved === PLAINTEXT) return { language: PLAINTEXT, tokens: [], html };
|
|
622
|
+
const { tokens } = highlighter.codeToTokens(source, { lang: resolved, theme });
|
|
623
|
+
return { language: resolved, tokens: flattenTokens(tokens), html };
|
|
624
|
+
};
|
|
625
|
+
const highlight = (source, language, theme) => {
|
|
626
|
+
const lang = normalizeLanguage(language);
|
|
627
|
+
const resolvedTheme = theme ?? resolveShikiTheme(options.shikiTheme, false);
|
|
628
|
+
if (lang === PLAINTEXT && !source) return Promise.resolve(plaintextResult(source));
|
|
629
|
+
if (exceedsLimits(source)) return Promise.resolve(plaintextResult(source));
|
|
630
|
+
const key = `${configId}\0${resolvedTheme}\0${lang}\0${source}`;
|
|
631
|
+
const hit = cache.get(key);
|
|
632
|
+
if (hit) {
|
|
633
|
+
cache.delete(key);
|
|
634
|
+
cache.set(key, hit);
|
|
635
|
+
return hit.promise;
|
|
636
|
+
}
|
|
637
|
+
const promise = run(source, lang, resolvedTheme).catch(() => {
|
|
638
|
+
forget(key);
|
|
639
|
+
return plaintextResult(source);
|
|
640
|
+
});
|
|
641
|
+
cache.set(key, { promise, size: source.length });
|
|
642
|
+
cachedSourceLength += source.length;
|
|
643
|
+
evict();
|
|
644
|
+
return promise;
|
|
645
|
+
};
|
|
646
|
+
return { normalizeLanguage, highlight };
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// src/lib/doc-colors.ts
|
|
650
|
+
var swatch = (key, label, cssVar, light, dark) => ({
|
|
651
|
+
key,
|
|
652
|
+
label,
|
|
653
|
+
cssVar,
|
|
654
|
+
light,
|
|
655
|
+
dark
|
|
656
|
+
});
|
|
657
|
+
var TEXT_SWATCHES = [
|
|
658
|
+
swatch("gray", "灰色", "--tt-color-text-gray", "#8f959e", "#757575"),
|
|
659
|
+
swatch("red", "红色", "--tt-color-text-red", "#d83931", "#fa7873"),
|
|
660
|
+
swatch("orange", "橙色", "--tt-color-text-orange", "#de7802", "#f5a54a"),
|
|
661
|
+
swatch("yellow", "黄色", "--tt-color-text-yellow", "#dc9b04", "#fcd456"),
|
|
662
|
+
swatch("green", "绿色", "--tt-color-text-green", "#2ea121", "#6dd162"),
|
|
663
|
+
swatch("blue", "蓝色", "--tt-color-text-blue", "#245bdb", "#70a0ff"),
|
|
664
|
+
swatch("purple", "紫色", "--tt-color-text-purple", "#6425d0", "#a472fc")
|
|
665
|
+
];
|
|
666
|
+
var HIGHLIGHT_SWATCHES = [
|
|
667
|
+
swatch("gray", "浅灰", "--tt-color-highlight-gray", "#f2f3f5", "rgba(67,67,67,0.4)"),
|
|
668
|
+
swatch("red", "浅红", "--tt-color-highlight-red", "#fbbfbc", "rgba(240,91,86,0.28)"),
|
|
669
|
+
swatch(
|
|
670
|
+
"orange",
|
|
671
|
+
"浅橙",
|
|
672
|
+
"--tt-color-highlight-orange",
|
|
673
|
+
"rgba(254,212,164,0.8)",
|
|
674
|
+
"rgba(242,150,44,0.22)"
|
|
675
|
+
),
|
|
676
|
+
swatch(
|
|
677
|
+
"yellow",
|
|
678
|
+
"浅黄",
|
|
679
|
+
"--tt-color-highlight-yellow",
|
|
680
|
+
"rgba(255,246,122,0.8)",
|
|
681
|
+
"rgba(245,226,49,0.16)"
|
|
682
|
+
),
|
|
683
|
+
swatch(
|
|
684
|
+
"green",
|
|
685
|
+
"浅绿",
|
|
686
|
+
"--tt-color-highlight-green",
|
|
687
|
+
"rgba(183,237,177,0.8)",
|
|
688
|
+
"rgba(84,194,72,0.22)"
|
|
689
|
+
),
|
|
690
|
+
swatch(
|
|
691
|
+
"blue",
|
|
692
|
+
"浅蓝",
|
|
693
|
+
"--tt-color-highlight-blue",
|
|
694
|
+
"rgba(186,206,253,0.7)",
|
|
695
|
+
"rgba(76,136,255,0.28)"
|
|
696
|
+
),
|
|
697
|
+
swatch(
|
|
698
|
+
"purple",
|
|
699
|
+
"浅紫",
|
|
700
|
+
"--tt-color-highlight-purple",
|
|
701
|
+
"rgba(205,178,250,0.7)",
|
|
702
|
+
"rgba(151,98,245,0.31)"
|
|
703
|
+
),
|
|
704
|
+
swatch(
|
|
705
|
+
"gray-medium",
|
|
706
|
+
"中灰",
|
|
707
|
+
"--tt-color-highlight-gray-medium",
|
|
708
|
+
"rgba(222,224,227,0.8)",
|
|
709
|
+
"rgba(80,80,80,0.5)"
|
|
710
|
+
),
|
|
711
|
+
swatch(
|
|
712
|
+
"gray-strong",
|
|
713
|
+
"深灰",
|
|
714
|
+
"--tt-color-highlight-gray-strong",
|
|
715
|
+
"#bbbfc4",
|
|
716
|
+
"rgba(95,95,95,0.6)"
|
|
717
|
+
),
|
|
718
|
+
swatch(
|
|
719
|
+
"red-strong",
|
|
720
|
+
"深红",
|
|
721
|
+
"--tt-color-highlight-red-strong",
|
|
722
|
+
"#f76964",
|
|
723
|
+
"rgba(240,91,86,0.47)"
|
|
724
|
+
),
|
|
725
|
+
swatch(
|
|
726
|
+
"orange-strong",
|
|
727
|
+
"深橙",
|
|
728
|
+
"--tt-color-highlight-orange-strong",
|
|
729
|
+
"#ffa53d",
|
|
730
|
+
"rgba(242,150,44,0.36)"
|
|
731
|
+
),
|
|
732
|
+
swatch(
|
|
733
|
+
"yellow-strong",
|
|
734
|
+
"深黄",
|
|
735
|
+
"--tt-color-highlight-yellow-strong",
|
|
736
|
+
"#ffe928",
|
|
737
|
+
"rgba(245,226,49,0.26)"
|
|
738
|
+
),
|
|
739
|
+
swatch(
|
|
740
|
+
"green-strong",
|
|
741
|
+
"深绿",
|
|
742
|
+
"--tt-color-highlight-green-strong",
|
|
743
|
+
"#62d256",
|
|
744
|
+
"rgba(84,194,72,0.36)"
|
|
745
|
+
),
|
|
746
|
+
swatch(
|
|
747
|
+
"blue-strong",
|
|
748
|
+
"深蓝",
|
|
749
|
+
"--tt-color-highlight-blue-strong",
|
|
750
|
+
"rgba(78,131,253,0.55)",
|
|
751
|
+
"rgba(76,136,255,0.46)"
|
|
752
|
+
),
|
|
753
|
+
swatch(
|
|
754
|
+
"purple-strong",
|
|
755
|
+
"深紫",
|
|
756
|
+
"--tt-color-highlight-purple-strong",
|
|
757
|
+
"rgba(147,90,246,0.55)",
|
|
758
|
+
"rgba(151,98,245,0.51)"
|
|
759
|
+
)
|
|
760
|
+
];
|
|
761
|
+
var BLOCK_BACKGROUND_SWATCHES = [
|
|
762
|
+
swatch("gray", "浅灰", "--tt-color-block-gray", "rgba(245,246,247,0.9)", "rgba(67,67,67,0.3)"),
|
|
763
|
+
swatch("red", "浅红", "--tt-color-block-red", "#fef1f1", "rgba(240,91,86,0.14)"),
|
|
764
|
+
swatch("orange", "浅橙", "--tt-color-block-orange", "#fff5eb", "rgba(242,150,44,0.12)"),
|
|
765
|
+
swatch("yellow", "浅黄", "--tt-color-block-yellow", "#fefff0", "rgba(245,226,49,0.08)"),
|
|
766
|
+
swatch("green", "浅绿", "--tt-color-block-green", "#f0fbef", "rgba(84,194,72,0.12)"),
|
|
767
|
+
swatch("blue", "浅蓝", "--tt-color-block-blue", "#f0f4ff", "rgba(76,136,255,0.14)"),
|
|
768
|
+
swatch("purple", "浅紫", "--tt-color-block-purple", "#f6f1fe", "rgba(151,98,245,0.16)"),
|
|
769
|
+
swatch(
|
|
770
|
+
"neutral-strong",
|
|
771
|
+
"中灰",
|
|
772
|
+
"--tt-color-block-neutral-strong",
|
|
773
|
+
"#f2f3f5",
|
|
774
|
+
"rgba(80,80,80,0.45)"
|
|
775
|
+
),
|
|
776
|
+
swatch("gray-strong", "深灰", "--tt-color-block-gray-strong", "#eff0f1", "rgba(95,95,95,0.5)"),
|
|
777
|
+
swatch("red-strong", "深红", "--tt-color-block-red-strong", "#fde2e2", "rgba(240,91,86,0.26)"),
|
|
778
|
+
swatch(
|
|
779
|
+
"orange-strong",
|
|
780
|
+
"深橙",
|
|
781
|
+
"--tt-color-block-orange-strong",
|
|
782
|
+
"#feead2",
|
|
783
|
+
"rgba(242,150,44,0.22)"
|
|
784
|
+
),
|
|
785
|
+
swatch(
|
|
786
|
+
"yellow-strong",
|
|
787
|
+
"深黄",
|
|
788
|
+
"--tt-color-block-yellow-strong",
|
|
789
|
+
"#ffffcc",
|
|
790
|
+
"rgba(245,226,49,0.16)"
|
|
791
|
+
),
|
|
792
|
+
swatch(
|
|
793
|
+
"green-strong",
|
|
794
|
+
"深绿",
|
|
795
|
+
"--tt-color-block-green-strong",
|
|
796
|
+
"#d9f5d6",
|
|
797
|
+
"rgba(84,194,72,0.22)"
|
|
798
|
+
),
|
|
799
|
+
swatch("blue-strong", "深蓝", "--tt-color-block-blue-strong", "#e1eaff", "rgba(76,136,255,0.26)"),
|
|
800
|
+
swatch(
|
|
801
|
+
"purple-strong",
|
|
802
|
+
"深紫",
|
|
803
|
+
"--tt-color-block-purple-strong",
|
|
804
|
+
"#ece2fe",
|
|
805
|
+
"rgba(151,98,245,0.28)"
|
|
806
|
+
)
|
|
807
|
+
];
|
|
808
|
+
var CALLOUT_BORDER_SWATCHES = [
|
|
809
|
+
swatch(
|
|
810
|
+
"neutral",
|
|
811
|
+
"浅灰",
|
|
812
|
+
"--tt-color-callout-border-neutral",
|
|
813
|
+
"#eff0f1",
|
|
814
|
+
"rgba(255,255,255,0.12)"
|
|
815
|
+
),
|
|
816
|
+
swatch("red", "浅红", "--tt-color-callout-border-red", "#fbbfbc", "rgba(240,91,86,0.35)"),
|
|
817
|
+
swatch("orange", "浅橙", "--tt-color-callout-border-orange", "#fed4a4", "rgba(242,150,44,0.35)"),
|
|
818
|
+
swatch("yellow", "浅黄", "--tt-color-callout-border-yellow", "#fff67a", "rgba(245,226,49,0.3)"),
|
|
819
|
+
swatch("green", "浅绿", "--tt-color-callout-border-green", "#b7edb1", "rgba(84,194,72,0.35)"),
|
|
820
|
+
swatch("blue", "浅蓝", "--tt-color-callout-border-blue", "#bacefd", "rgba(76,136,255,0.38)"),
|
|
821
|
+
swatch("purple", "浅紫", "--tt-color-callout-border-purple", "#cdb2fa", "rgba(151,98,245,0.4)"),
|
|
822
|
+
swatch(
|
|
823
|
+
"neutral-strong",
|
|
824
|
+
"深灰",
|
|
825
|
+
"--tt-color-callout-border-neutral-strong",
|
|
826
|
+
"#dee0e3",
|
|
827
|
+
"rgba(255,255,255,0.22)"
|
|
828
|
+
),
|
|
829
|
+
swatch(
|
|
830
|
+
"red-strong",
|
|
831
|
+
"深红",
|
|
832
|
+
"--tt-color-callout-border-red-strong",
|
|
833
|
+
"#f98e8b",
|
|
834
|
+
"rgba(240,91,86,0.6)"
|
|
835
|
+
),
|
|
836
|
+
swatch(
|
|
837
|
+
"orange-strong",
|
|
838
|
+
"深橙",
|
|
839
|
+
"--tt-color-callout-border-orange-strong",
|
|
840
|
+
"#ffba6b",
|
|
841
|
+
"rgba(242,150,44,0.6)"
|
|
842
|
+
),
|
|
843
|
+
swatch(
|
|
844
|
+
"yellow-strong",
|
|
845
|
+
"深黄",
|
|
846
|
+
"--tt-color-callout-border-yellow-strong",
|
|
847
|
+
"#fff258",
|
|
848
|
+
"rgba(245,226,49,0.5)"
|
|
849
|
+
),
|
|
850
|
+
swatch(
|
|
851
|
+
"green-strong",
|
|
852
|
+
"深绿",
|
|
853
|
+
"--tt-color-callout-border-green-strong",
|
|
854
|
+
"#8ee085",
|
|
855
|
+
"rgba(84,194,72,0.6)"
|
|
856
|
+
),
|
|
857
|
+
swatch(
|
|
858
|
+
"blue-strong",
|
|
859
|
+
"深蓝",
|
|
860
|
+
"--tt-color-callout-border-blue-strong",
|
|
861
|
+
"#82a7fc",
|
|
862
|
+
"rgba(76,136,255,0.6)"
|
|
863
|
+
),
|
|
864
|
+
swatch(
|
|
865
|
+
"purple-strong",
|
|
866
|
+
"深紫",
|
|
867
|
+
"--tt-color-callout-border-purple-strong",
|
|
868
|
+
"#ad82f7",
|
|
869
|
+
"rgba(151,98,245,0.65)"
|
|
870
|
+
)
|
|
871
|
+
];
|
|
872
|
+
var LEGACY_SWATCHES = [
|
|
873
|
+
swatch("text-brown", "棕色", "--tt-color-text-brown", "#9f6b53", "#ba856f"),
|
|
874
|
+
swatch("text-pink", "粉色", "--tt-color-text-pink", "#c14c8a", "#d15796"),
|
|
875
|
+
swatch("highlight-brown", "棕色背景", "--tt-color-highlight-brown", "#f4eeee", "rgb(74,50,40)"),
|
|
876
|
+
swatch("highlight-pink", "粉色背景", "--tt-color-highlight-pink", "#fcf1f6", "rgb(78,44,60)")
|
|
877
|
+
];
|
|
878
|
+
var ALL_SWATCHES = [
|
|
879
|
+
...TEXT_SWATCHES,
|
|
880
|
+
...HIGHLIGHT_SWATCHES,
|
|
881
|
+
...BLOCK_BACKGROUND_SWATCHES,
|
|
882
|
+
...CALLOUT_BORDER_SWATCHES,
|
|
883
|
+
...LEGACY_SWATCHES
|
|
884
|
+
];
|
|
885
|
+
var swatchValue = (s) => `var(${s.cssVar})`;
|
|
886
|
+
var byVar = new Map(ALL_SWATCHES.map((s) => [s.cssVar, s]));
|
|
887
|
+
function clamp255(n) {
|
|
888
|
+
return Math.max(0, Math.min(255, Math.round(n)));
|
|
889
|
+
}
|
|
890
|
+
function hex2(n) {
|
|
891
|
+
return clamp255(n).toString(16).padStart(2, "0");
|
|
892
|
+
}
|
|
893
|
+
function resolveColorToHex(value) {
|
|
894
|
+
if (!value) return null;
|
|
895
|
+
const v = value.trim();
|
|
896
|
+
const varMatch = /^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(v);
|
|
897
|
+
if (varMatch) {
|
|
898
|
+
const known = byVar.get(varMatch[1]);
|
|
899
|
+
if (known) return resolveColorToHex(known.light);
|
|
900
|
+
return varMatch[2] ? resolveColorToHex(varMatch[2]) : null;
|
|
901
|
+
}
|
|
902
|
+
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(v);
|
|
903
|
+
if (hex) {
|
|
904
|
+
const h = hex[1].length === 3 ? [...hex[1]].map((c) => c + c).join("") : hex[1];
|
|
905
|
+
return `#${h.toLowerCase()}`;
|
|
906
|
+
}
|
|
907
|
+
const rgb = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(v);
|
|
908
|
+
if (rgb) {
|
|
909
|
+
const [r, g, b] = [rgb[1], rgb[2], rgb[3]].map(Number);
|
|
910
|
+
const a = rgb[4] === void 0 ? 1 : Math.max(0, Math.min(1, Number(rgb[4])));
|
|
911
|
+
const blend = (c) => c * a + 255 * (1 - a);
|
|
912
|
+
return `#${hex2(blend(r))}${hex2(blend(g))}${hex2(blend(b))}`;
|
|
913
|
+
}
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// src/components/tiptap-node/reminder-node/reminder.ts
|
|
918
|
+
var MINUTE = 6e4;
|
|
919
|
+
var HOUR = 60 * MINUTE;
|
|
920
|
+
var DAY = 24 * HOUR;
|
|
921
|
+
var WEEK = 7 * DAY;
|
|
922
|
+
var TIME_STEP_MINUTES = 30;
|
|
923
|
+
var TIMED_NOTIFY_OPTIONS = [
|
|
924
|
+
{ offset: 0, label: "事件发生时" },
|
|
925
|
+
{ offset: -5 * MINUTE, label: "提前 5 分钟" },
|
|
926
|
+
{ offset: -15 * MINUTE, label: "提前 15 分钟" },
|
|
927
|
+
{ offset: -30 * MINUTE, label: "提前 30 分钟" },
|
|
928
|
+
{ offset: -HOUR, label: "提前 1 小时" },
|
|
929
|
+
{ offset: -2 * HOUR, label: "提前 2 小时" },
|
|
930
|
+
{ offset: -DAY, label: "提前 1 天" },
|
|
931
|
+
{ offset: -2 * DAY, label: "提前 2 天" },
|
|
932
|
+
{ offset: -WEEK, label: "提前 1 周" }
|
|
933
|
+
];
|
|
934
|
+
var wholeDayOffset = (daysBefore, hour) => -((23 - hour) * HOUR + 59 * MINUTE + 59e3 + daysBefore * DAY);
|
|
935
|
+
var WHOLE_DAY_NOTIFY_OPTIONS = [
|
|
936
|
+
{ offset: wholeDayOffset(0, 9), label: "当天 (09:00)" },
|
|
937
|
+
{ offset: wholeDayOffset(1, 9), label: "提前 1 天 (09:00)" },
|
|
938
|
+
{ offset: wholeDayOffset(2, 9), label: "提前 2 天 (09:00)" },
|
|
939
|
+
{ offset: wholeDayOffset(7, 9), label: "提前 1 周 (09:00)" }
|
|
940
|
+
];
|
|
941
|
+
var WHOLE_DAY_EXTRA = { offset: wholeDayOffset(0, 18), label: "当天 (18:00)" };
|
|
942
|
+
function notifyOptions(data) {
|
|
943
|
+
if (!data.isWholeDay) return TIMED_NOTIFY_OPTIONS;
|
|
944
|
+
return data.notifyTime - data.expireTime === WHOLE_DAY_EXTRA.offset ? [...WHOLE_DAY_NOTIFY_OPTIONS, WHOLE_DAY_EXTRA] : WHOLE_DAY_NOTIFY_OPTIONS;
|
|
945
|
+
}
|
|
946
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
947
|
+
function endOfDay(ts) {
|
|
948
|
+
const d = new Date(ts);
|
|
949
|
+
d.setHours(23, 59, 59, 0);
|
|
950
|
+
return d.getTime();
|
|
951
|
+
}
|
|
952
|
+
function currentSlot(now) {
|
|
953
|
+
const d = new Date(now);
|
|
954
|
+
d.setMinutes(d.getMinutes() < TIME_STEP_MINUTES ? 0 : TIME_STEP_MINUTES, 0, 0);
|
|
955
|
+
return d.getTime();
|
|
956
|
+
}
|
|
957
|
+
function defaultReminder(query, now, createUserId = null) {
|
|
958
|
+
const q = query.trim().toLowerCase();
|
|
959
|
+
const base = { shouldNotify: true, createUserId };
|
|
960
|
+
if (q.startsWith("tod") || q.startsWith("tom")) {
|
|
961
|
+
const day = new Date(now);
|
|
962
|
+
if (q.startsWith("tom")) day.setDate(day.getDate() + 1);
|
|
963
|
+
const expireTime = endOfDay(day.getTime());
|
|
964
|
+
return { ...base, expireTime, isWholeDay: true, notifyTime: expireTime + WHOLE_DAY_NOTIFY_OPTIONS[0].offset };
|
|
965
|
+
}
|
|
966
|
+
if (q.startsWith("now")) {
|
|
967
|
+
const d2 = new Date(now);
|
|
968
|
+
d2.setSeconds(0, 0);
|
|
969
|
+
return { ...base, expireTime: d2.getTime(), isWholeDay: false, notifyTime: d2.getTime() };
|
|
970
|
+
}
|
|
971
|
+
const d = new Date(currentSlot(now));
|
|
972
|
+
d.setDate(d.getDate() + 1);
|
|
973
|
+
return { ...base, expireTime: d.getTime(), isWholeDay: false, notifyTime: d.getTime() };
|
|
974
|
+
}
|
|
975
|
+
function dayNumber(ts) {
|
|
976
|
+
const d = new Date(ts);
|
|
977
|
+
return Math.floor(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()) / DAY);
|
|
978
|
+
}
|
|
979
|
+
var weekNumber = (day) => Math.floor((day + 3) / 7);
|
|
980
|
+
var WEEKDAY = ["日", "一", "二", "三", "四", "五", "六"];
|
|
981
|
+
function reminderText(expireTime, isWholeDay, now) {
|
|
982
|
+
const d = new Date(expireTime);
|
|
983
|
+
const n = new Date(now);
|
|
984
|
+
const time = isWholeDay ? "" : ` ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
985
|
+
if (d.getFullYear() !== n.getFullYear()) return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日${time}`;
|
|
986
|
+
const day = dayNumber(expireTime);
|
|
987
|
+
const today = dayNumber(now);
|
|
988
|
+
let date;
|
|
989
|
+
if (day === today) date = "今天";
|
|
990
|
+
else if (day === today + 1) date = "明天";
|
|
991
|
+
else if (day === today - 1) date = "昨天";
|
|
992
|
+
else {
|
|
993
|
+
const weeks = weekNumber(day) - weekNumber(today);
|
|
994
|
+
if (weeks === 0) date = `本周${WEEKDAY[d.getDay()]}`;
|
|
995
|
+
else if (weeks === 1) date = `下周${WEEKDAY[d.getDay()]}`;
|
|
996
|
+
else date = `${d.getMonth() + 1}月${d.getDate()}日`;
|
|
997
|
+
}
|
|
998
|
+
return date + time;
|
|
999
|
+
}
|
|
1000
|
+
function reminderFullText(expireTime, isWholeDay) {
|
|
1001
|
+
const d = new Date(expireTime);
|
|
1002
|
+
const date = `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日`;
|
|
1003
|
+
return isWholeDay ? date : `${date},${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
1004
|
+
}
|
|
1005
|
+
function reminderColor(expireTime, now) {
|
|
1006
|
+
if (now > expireTime) return "red";
|
|
1007
|
+
if (expireTime - now <= WEEK) return "orange";
|
|
1008
|
+
return "blue";
|
|
1009
|
+
}
|
|
1010
|
+
function withDate(data, year, month, date) {
|
|
1011
|
+
const d = new Date(data.expireTime);
|
|
1012
|
+
d.setFullYear(year, month, date);
|
|
1013
|
+
const expireTime = d.getTime();
|
|
1014
|
+
return { ...data, expireTime, notifyTime: expireTime + (data.notifyTime - data.expireTime) };
|
|
1015
|
+
}
|
|
1016
|
+
function withTime(data, hours, minutes) {
|
|
1017
|
+
const d = new Date(data.expireTime);
|
|
1018
|
+
d.setHours(hours, minutes, 0, 0);
|
|
1019
|
+
const expireTime = d.getTime();
|
|
1020
|
+
return { ...data, expireTime, notifyTime: expireTime + (data.notifyTime - data.expireTime) };
|
|
1021
|
+
}
|
|
1022
|
+
function withWholeDay(data, isWholeDay, now) {
|
|
1023
|
+
if (isWholeDay === data.isWholeDay) return data;
|
|
1024
|
+
if (isWholeDay) {
|
|
1025
|
+
const expireTime = endOfDay(data.expireTime);
|
|
1026
|
+
return { ...data, isWholeDay, expireTime, notifyTime: expireTime + WHOLE_DAY_NOTIFY_OPTIONS[0].offset };
|
|
1027
|
+
}
|
|
1028
|
+
const slot = new Date(currentSlot(now));
|
|
1029
|
+
const d = new Date(data.expireTime);
|
|
1030
|
+
d.setHours(slot.getHours(), slot.getMinutes(), 0, 0);
|
|
1031
|
+
return { ...data, isWholeDay, expireTime: d.getTime(), notifyTime: d.getTime() };
|
|
1032
|
+
}
|
|
1033
|
+
function withNotify(data, shouldNotify) {
|
|
1034
|
+
const first = notifyOptions({ ...data, notifyTime: data.expireTime })[0];
|
|
1035
|
+
return { ...data, shouldNotify, notifyTime: data.expireTime + first.offset };
|
|
1036
|
+
}
|
|
1037
|
+
function withNotifyOffset(data, offset) {
|
|
1038
|
+
return { ...data, notifyTime: data.expireTime + offset };
|
|
1039
|
+
}
|
|
1040
|
+
var TIME_SLOTS = Array.from({ length: 24 * 60 / TIME_STEP_MINUTES }, (_, i) => {
|
|
1041
|
+
const m = i * TIME_STEP_MINUTES;
|
|
1042
|
+
return `${pad(Math.floor(m / 60))}:${pad(m % 60)}`;
|
|
1043
|
+
});
|
|
1044
|
+
function parseTimeInput(raw) {
|
|
1045
|
+
const m = /^\s*(\d{1,2})\s*[::]\s*(\d{2})\s*(am|pm)?\s*$/i.exec(raw);
|
|
1046
|
+
if (!m) return null;
|
|
1047
|
+
let hours = Number(m[1]);
|
|
1048
|
+
const minutes = Number(m[2]);
|
|
1049
|
+
const ampm = m[3]?.toLowerCase();
|
|
1050
|
+
if (ampm) {
|
|
1051
|
+
if (hours < 1 || hours > 12) return null;
|
|
1052
|
+
if (ampm === "pm" && hours !== 12) hours += 12;
|
|
1053
|
+
if (ampm === "am" && hours === 12) hours = 0;
|
|
1054
|
+
}
|
|
1055
|
+
if (hours > 23 || minutes > 59) return null;
|
|
1056
|
+
return { hours, minutes };
|
|
1057
|
+
}
|
|
1058
|
+
function formatTime(ts) {
|
|
1059
|
+
const d = new Date(ts);
|
|
1060
|
+
return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
1061
|
+
}
|
|
1062
|
+
function remindUsersLine(names) {
|
|
1063
|
+
let out = "提醒:";
|
|
1064
|
+
for (let i = 0; i < names.length; i++) {
|
|
1065
|
+
if (out.length > 35 && i > 0) return `${out}...还有 ${names.length - i} 人`;
|
|
1066
|
+
out += names[i] + (i !== names.length - 1 ? "," : "");
|
|
1067
|
+
}
|
|
1068
|
+
return out;
|
|
1069
|
+
}
|
|
1070
|
+
function calendarDays(year, month) {
|
|
1071
|
+
const first = new Date(year, month, 1);
|
|
1072
|
+
const start = new Date(year, month, 1 - first.getDay());
|
|
1073
|
+
return Array.from({ length: 42 }, (_, i) => {
|
|
1074
|
+
const d = new Date(start.getFullYear(), start.getMonth(), start.getDate() + i);
|
|
1075
|
+
return { year: d.getFullYear(), month: d.getMonth(), date: d.getDate() };
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
function normalizeReminder(attrs, now) {
|
|
1079
|
+
const expireTime = Number(attrs.expireTime);
|
|
1080
|
+
const valid = Number.isFinite(expireTime) && expireTime > 0;
|
|
1081
|
+
const exp = valid ? expireTime : defaultReminder("", now).expireTime;
|
|
1082
|
+
const notify = Number(attrs.notifyTime);
|
|
1083
|
+
return {
|
|
1084
|
+
expireTime: exp,
|
|
1085
|
+
isWholeDay: attrs.isWholeDay === true || attrs.isWholeDay === "true",
|
|
1086
|
+
shouldNotify: attrs.shouldNotify === true || attrs.shouldNotify === "true",
|
|
1087
|
+
// 缺 notifyTime 的按现在(飞书粘贴兜底)
|
|
1088
|
+
notifyTime: Number.isFinite(notify) && notify > 0 ? notify : now,
|
|
1089
|
+
createUserId: typeof attrs.createUserId === "string" ? attrs.createUserId : null
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// src/components/tiptap-node/collapsible-node/callout-style.ts
|
|
1094
|
+
function pick(list, key) {
|
|
1095
|
+
const hit = list.find((s) => s.key === key);
|
|
1096
|
+
if (!hit) throw new Error(`callout 色板里没有 ${key}`);
|
|
1097
|
+
return swatchValue(hit);
|
|
1098
|
+
}
|
|
1099
|
+
var bg = (key) => pick(BLOCK_BACKGROUND_SWATCHES, key);
|
|
1100
|
+
var border = (key) => pick(CALLOUT_BORDER_SWATCHES, key);
|
|
1101
|
+
var CALLOUT_PRESETS = {
|
|
1102
|
+
info: { emoji: "ℹ️", backgroundColor: bg("blue"), borderColor: border("blue"), textColor: null },
|
|
1103
|
+
tip: { emoji: "💡", backgroundColor: bg("green"), borderColor: border("green"), textColor: null },
|
|
1104
|
+
warning: {
|
|
1105
|
+
emoji: "⚠️",
|
|
1106
|
+
backgroundColor: bg("orange"),
|
|
1107
|
+
borderColor: border("orange"),
|
|
1108
|
+
textColor: null
|
|
1109
|
+
},
|
|
1110
|
+
danger: { emoji: "🚫", backgroundColor: bg("red"), borderColor: border("red"), textColor: null }
|
|
1111
|
+
};
|
|
1112
|
+
var FEISHU_DEFAULT_CALLOUT = {
|
|
1113
|
+
type: "tip",
|
|
1114
|
+
emoji: "💡",
|
|
1115
|
+
backgroundColor: bg("orange"),
|
|
1116
|
+
borderColor: border("orange"),
|
|
1117
|
+
textColor: null,
|
|
1118
|
+
title: null
|
|
1119
|
+
};
|
|
1120
|
+
function resolveCalloutLook(attrs) {
|
|
1121
|
+
const preset = CALLOUT_PRESETS[attrs.type] ?? CALLOUT_PRESETS.info;
|
|
1122
|
+
return {
|
|
1123
|
+
emoji: attrs.emoji ?? preset.emoji,
|
|
1124
|
+
backgroundColor: attrs.backgroundColor || preset.backgroundColor,
|
|
1125
|
+
borderColor: attrs.borderColor || preset.borderColor,
|
|
1126
|
+
textColor: attrs.textColor || preset.textColor
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
var BORDER_FOR_BACKGROUND = {
|
|
1130
|
+
gray: "neutral",
|
|
1131
|
+
red: "red",
|
|
1132
|
+
orange: "orange",
|
|
1133
|
+
yellow: "yellow",
|
|
1134
|
+
green: "green",
|
|
1135
|
+
blue: "blue",
|
|
1136
|
+
purple: "purple",
|
|
1137
|
+
"neutral-strong": "neutral-strong",
|
|
1138
|
+
"gray-strong": "neutral-strong",
|
|
1139
|
+
"red-strong": "red-strong",
|
|
1140
|
+
"orange-strong": "orange-strong",
|
|
1141
|
+
"yellow-strong": "yellow-strong",
|
|
1142
|
+
"green-strong": "green-strong",
|
|
1143
|
+
"blue-strong": "blue-strong",
|
|
1144
|
+
"purple-strong": "purple-strong"
|
|
1145
|
+
};
|
|
1146
|
+
function pairedBorderFor(background) {
|
|
1147
|
+
const key = BORDER_FOR_BACKGROUND[background.key];
|
|
1148
|
+
const hit = key ? CALLOUT_BORDER_SWATCHES.find((s) => s.key === key) : void 0;
|
|
1149
|
+
return hit ? swatchValue(hit) : null;
|
|
1150
|
+
}
|
|
1151
|
+
var CALLOUT_EMOJIS = [
|
|
1152
|
+
"💡",
|
|
1153
|
+
"📌",
|
|
1154
|
+
"✅",
|
|
1155
|
+
"❎",
|
|
1156
|
+
"❤️",
|
|
1157
|
+
"👍",
|
|
1158
|
+
"🎉",
|
|
1159
|
+
"🚫",
|
|
1160
|
+
"❗",
|
|
1161
|
+
"ℹ️",
|
|
1162
|
+
"⚠️",
|
|
1163
|
+
"🌟",
|
|
1164
|
+
"📚",
|
|
1165
|
+
"✏️",
|
|
1166
|
+
"✍️",
|
|
1167
|
+
"📍",
|
|
1168
|
+
"🥖",
|
|
1169
|
+
"⚽",
|
|
1170
|
+
"🎹",
|
|
1171
|
+
"🎼",
|
|
1172
|
+
"⛱️",
|
|
1173
|
+
"🎨",
|
|
1174
|
+
"🥇",
|
|
1175
|
+
"🏆",
|
|
1176
|
+
"🎁",
|
|
1177
|
+
"🌅",
|
|
1178
|
+
"🏕️",
|
|
1179
|
+
"🏖️",
|
|
1180
|
+
"🏝️",
|
|
1181
|
+
"🚅",
|
|
1182
|
+
"🥛",
|
|
1183
|
+
"🌰",
|
|
1184
|
+
"🍰",
|
|
1185
|
+
"🍞",
|
|
1186
|
+
"🦄",
|
|
1187
|
+
"🐵"
|
|
1188
|
+
];
|
|
1189
|
+
|
|
1190
|
+
export { AUTO, AUTO_NUMBER_MAX_LEVEL, BLOCK_BACKGROUND_SWATCHES, CALLOUT_BORDER_SWATCHES, CALLOUT_EMOJIS, FEISHU_DEFAULT_CALLOUT, HIGHLIGHT_SWATCHES, LEGACY_SWATCHES, MARKDOWN_SEQ_PATTERN, MAX_SEQ_VALUE, TEXT_SWATCHES, TIME_SLOTS, attrsForMenuAction, calendarDays, computeHeadingOrders, computeHeadingOrdersFromJson, createCodeHighlighter, defaultReminder, filterCodeLanguages, formatTime, getCodeBlockTitle, markdownSeqFor, normalizeReminder, notifyOptions, numberMenuState, orderText, pairedBorderFor, parseTimeInput, remindUsersLine, reminderColor, reminderFullText, reminderText, resolveCalloutLook, resolveCodeLanguage, resolveColorToHex, resolveShikiTheme, swatchValue, withDate, withNotify, withNotifyOffset, withTime, withWholeDay };
|
|
1191
|
+
//# sourceMappingURL=chunk-UD6MDBTN.js.map
|
|
1192
|
+
//# sourceMappingURL=chunk-UD6MDBTN.js.map
|