larkard 0.1.1 → 0.1.2
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/adapter/index.cjs +20 -19
- package/dist/adapter/index.js +2 -1
- package/dist/adapter/md-parse.d.ts.map +1 -1
- package/dist/{chunk-BMD67L5A.js → chunk-5CITR4BX.js} +2 -2
- package/dist/{chunk-4VLXPDHK.cjs → chunk-64Q7A362.cjs} +0 -40
- package/dist/{chunk-ZX4N4AUP.js → chunk-CRPWSRNM.js} +2 -1
- package/dist/{chunk-LFUKOODS.js → chunk-E66NSRYB.js} +1 -1
- package/dist/chunk-LYJGL4VE.js +63 -0
- package/dist/{chunk-XKJ2OLNJ.js → chunk-PDBOIFS3.js} +2 -2
- package/dist/{chunk-BI3SOQOF.cjs → chunk-QPQ4KFDE.cjs} +12 -12
- package/dist/{chunk-33T4REBK.js → chunk-RXUE4TST.js} +1 -37
- package/dist/{chunk-VYGAB4ZH.cjs → chunk-SGTRQI32.cjs} +10 -10
- package/dist/{chunk-VFJ4QPRG.js → chunk-VXK22NAZ.js} +1 -1
- package/dist/{chunk-MM5UOOA2.cjs → chunk-X2I7SHBY.cjs} +10 -10
- package/dist/{chunk-ADPNWRSB.cjs → chunk-X7B72PBG.cjs} +2 -1
- package/dist/{chunk-M33JXCUC.js → chunk-XR7ZZYBL.js} +2 -2
- package/dist/{chunk-HSVVJUIC.cjs → chunk-YBS4NP5V.cjs} +15 -15
- package/dist/chunk-YSA5ND2Y.cjs +69 -0
- package/dist/{chunk-OHQIQTRR.cjs → chunk-ZWTPTIAH.cjs} +7 -7
- package/dist/cli-bin.cjs +6 -5
- package/dist/cli-bin.js +5 -4
- package/dist/cli.cjs +6 -5
- package/dist/cli.js +5 -4
- package/dist/index.cjs +32 -31
- package/dist/index.js +4 -3
- package/dist/language-server/index.cjs +12 -11
- package/dist/language-server/index.js +5 -4
- package/dist/language-server/server.cjs +10 -9
- package/dist/language-server/server.js +5 -4
- package/dist/renderer/async.cjs +6 -5
- package/dist/renderer/async.js +4 -3
- package/dist/renderer/browser.cjs +27 -26
- package/dist/renderer/browser.js +4 -3
- package/dist/renderer/index.cjs +13 -12
- package/dist/renderer/index.js +3 -2
- package/dist/schema/index.cjs +135 -130
- package/dist/schema/index.js +2 -1
- package/dist/schema/markdown/escape.d.ts +6 -0
- package/dist/schema/markdown/escape.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/adapter/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkX7B72PBG_cjs = require('../chunk-X7B72PBG.cjs');
|
|
4
|
+
require('../chunk-YSA5ND2Y.cjs');
|
|
4
5
|
require('../chunk-MOCZJJ5P.cjs');
|
|
5
6
|
require('../chunk-ETV4XYOV.cjs');
|
|
6
7
|
|
|
@@ -8,73 +9,73 @@ require('../chunk-ETV4XYOV.cjs');
|
|
|
8
9
|
|
|
9
10
|
Object.defineProperty(exports, "createColorRegistry", {
|
|
10
11
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkX7B72PBG_cjs.createColorRegistry; }
|
|
12
13
|
});
|
|
13
14
|
Object.defineProperty(exports, "degradeUnknown", {
|
|
14
15
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkX7B72PBG_cjs.degradeUnknown; }
|
|
16
17
|
});
|
|
17
18
|
Object.defineProperty(exports, "dslToRaw", {
|
|
18
19
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkX7B72PBG_cjs.dslToRaw; }
|
|
20
21
|
});
|
|
21
22
|
Object.defineProperty(exports, "isCustomHexColor", {
|
|
22
23
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkX7B72PBG_cjs.isCustomHexColor; }
|
|
24
25
|
});
|
|
25
26
|
Object.defineProperty(exports, "isRawCardEnvelope", {
|
|
26
27
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkX7B72PBG_cjs.isRawCardEnvelope; }
|
|
28
29
|
});
|
|
29
30
|
Object.defineProperty(exports, "normalizeStoredCardColors", {
|
|
30
31
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkX7B72PBG_cjs.normalizeStoredCardColors; }
|
|
32
33
|
});
|
|
33
34
|
Object.defineProperty(exports, "parseInline", {
|
|
34
35
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkX7B72PBG_cjs.parseInline; }
|
|
36
37
|
});
|
|
37
38
|
Object.defineProperty(exports, "parseMarkdown", {
|
|
38
39
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkX7B72PBG_cjs.parseMarkdown; }
|
|
40
41
|
});
|
|
41
42
|
Object.defineProperty(exports, "rawCardToDsl", {
|
|
42
43
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkX7B72PBG_cjs.rawCardToDsl; }
|
|
44
45
|
});
|
|
45
46
|
Object.defineProperty(exports, "rawToDsl", {
|
|
46
47
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkX7B72PBG_cjs.rawToDsl; }
|
|
48
49
|
});
|
|
49
50
|
Object.defineProperty(exports, "readThemeColorDark", {
|
|
50
51
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkX7B72PBG_cjs.readThemeColorDark; }
|
|
52
53
|
});
|
|
53
54
|
Object.defineProperty(exports, "readThemeColorLight", {
|
|
54
55
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkX7B72PBG_cjs.readThemeColorLight; }
|
|
56
57
|
});
|
|
57
58
|
Object.defineProperty(exports, "registerColorEntry", {
|
|
58
59
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkX7B72PBG_cjs.registerColorEntry; }
|
|
60
61
|
});
|
|
61
62
|
Object.defineProperty(exports, "resolveCustomBackgroundLight", {
|
|
62
63
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkX7B72PBG_cjs.resolveCustomBackgroundLight; }
|
|
64
65
|
});
|
|
65
66
|
Object.defineProperty(exports, "resolveCustomBorderLight", {
|
|
66
67
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkX7B72PBG_cjs.resolveCustomBorderLight; }
|
|
68
69
|
});
|
|
69
70
|
Object.defineProperty(exports, "resolveTextStyleColor", {
|
|
70
71
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkX7B72PBG_cjs.resolveTextStyleColor; }
|
|
72
73
|
});
|
|
73
74
|
Object.defineProperty(exports, "resolveTextStyleCustomColorPair", {
|
|
74
75
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkX7B72PBG_cjs.resolveTextStyleCustomColorPair; }
|
|
76
77
|
});
|
|
77
78
|
Object.defineProperty(exports, "themePairToColorEntry", {
|
|
78
79
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkX7B72PBG_cjs.themePairToColorEntry; }
|
|
80
81
|
});
|
package/dist/adapter/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { createColorRegistry, degradeUnknown, dslToRaw, isCustomHexColor, isRawCardEnvelope, normalizeStoredCardColors, parseInline, parseMarkdown, rawCardToDsl, rawToDsl, readThemeColorDark, readThemeColorLight, registerColorEntry, resolveCustomBackgroundLight, resolveCustomBorderLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry } from '../chunk-
|
|
1
|
+
export { createColorRegistry, degradeUnknown, dslToRaw, isCustomHexColor, isRawCardEnvelope, normalizeStoredCardColors, parseInline, parseMarkdown, rawCardToDsl, rawToDsl, readThemeColorDark, readThemeColorLight, registerColorEntry, resolveCustomBackgroundLight, resolveCustomBorderLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry } from '../chunk-CRPWSRNM.js';
|
|
2
|
+
import '../chunk-LYJGL4VE.js';
|
|
2
3
|
import '../chunk-462CNCHD.js';
|
|
3
4
|
import '../chunk-PKBMQBKP.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"md-parse.d.ts","sourceRoot":"","sources":["../../src/adapter/md-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;wBAWwB,CAOxB,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"md-parse.d.ts","sourceRoot":"","sources":["../../src/adapter/md-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;wBAWwB,CAOxB,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAmCzD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAgKvD;AAgFD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,WAAW,EAAE,CAqG/E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DSL_SPACING_TOKENS } from './chunk-VQFDYCF4.js';
|
|
2
|
-
import { FeishuCardV2Schema } from './chunk-
|
|
3
|
-
import { dslToRaw } from './chunk-
|
|
2
|
+
import { FeishuCardV2Schema } from './chunk-RXUE4TST.js';
|
|
3
|
+
import { dslToRaw } from './chunk-CRPWSRNM.js';
|
|
4
4
|
import { __publicField } from './chunk-PKBMQBKP.js';
|
|
5
5
|
|
|
6
6
|
// src/core/parser.ts
|
|
@@ -1346,42 +1346,6 @@ var MarkdownDateTimeFormatSchema = zod.z.enum([
|
|
|
1346
1346
|
);
|
|
1347
1347
|
var MarkdownPersonStyleSchema = zod.z.enum(["normal", "capsule"]).describe("\u4EBA\u5458\u6807\u7B7E\u6837\u5F0F\uFF1Anormal\uFF08\u666E\u901A\uFF09/ capsule\uFF08\u80F6\u56CA\uFF09");
|
|
1348
1348
|
var MarkdownInlineAudioStyleSchema = zod.z.enum(["normal", "speak"]).describe("\u5185\u5D4C\u97F3\u9891\u6837\u5F0F\uFF1Anormal\uFF08\u4E09\u89D2\u64AD\u653E\uFF09/ speak\uFF08\u8BED\u97F3\u6C14\u6CE1\uFF09");
|
|
1349
|
-
|
|
1350
|
-
// src/schema/markdown/escape.ts
|
|
1351
|
-
var ESCAPE_MAP = [
|
|
1352
|
-
["&", "&"],
|
|
1353
|
-
["<", "<"],
|
|
1354
|
-
[">", ">"],
|
|
1355
|
-
["*", "*"],
|
|
1356
|
-
["~", "∼"],
|
|
1357
|
-
["-", "-"],
|
|
1358
|
-
["!", "!"],
|
|
1359
|
-
["/", "/"],
|
|
1360
|
-
["\\", "\"],
|
|
1361
|
-
["[", "["],
|
|
1362
|
-
["]", "]"],
|
|
1363
|
-
["(", "("],
|
|
1364
|
-
[")", ")"],
|
|
1365
|
-
["#", "#"],
|
|
1366
|
-
[":", ":"],
|
|
1367
|
-
["+", "+"],
|
|
1368
|
-
['"', """],
|
|
1369
|
-
["'", "'"],
|
|
1370
|
-
["`", "`"],
|
|
1371
|
-
["$", "$"],
|
|
1372
|
-
["_", "_"]
|
|
1373
|
-
];
|
|
1374
|
-
var ENTITIES = new Map(ESCAPE_MAP);
|
|
1375
|
-
var SPECIAL = new RegExp(
|
|
1376
|
-
`[${ESCAPE_MAP.map(([char]) => char.replace(/[\\\]\[\-^]/g, "\\$&")).join("")}]`,
|
|
1377
|
-
"g"
|
|
1378
|
-
);
|
|
1379
|
-
function escapeMarkdown(text) {
|
|
1380
|
-
return text.replace(SPECIAL, (char) => ENTITIES.get(char) ?? char);
|
|
1381
|
-
}
|
|
1382
|
-
var NBSP = " ";
|
|
1383
|
-
var ENSP = " ";
|
|
1384
|
-
var EMSP = " ";
|
|
1385
1349
|
function boolAttr(value) {
|
|
1386
1350
|
if (value === void 0) return void 0;
|
|
1387
1351
|
return value ? "true" : "false";
|
|
@@ -1890,8 +1854,6 @@ exports.CustomTextSizeSchema = CustomTextSizeSchema;
|
|
|
1890
1854
|
exports.DatePickerSchema = DatePickerSchema;
|
|
1891
1855
|
exports.DirectionSchema = DirectionSchema;
|
|
1892
1856
|
exports.DivSchema = DivSchema;
|
|
1893
|
-
exports.EMSP = EMSP;
|
|
1894
|
-
exports.ENSP = ENSP;
|
|
1895
1857
|
exports.ElementIdSchema = ElementIdSchema;
|
|
1896
1858
|
exports.ElementSchema = ElementSchema;
|
|
1897
1859
|
exports.FallbackSchema = FallbackSchema;
|
|
@@ -1936,7 +1898,6 @@ exports.MarkdownTextTagSchema = MarkdownTextTagSchema;
|
|
|
1936
1898
|
exports.MultiSelectPersonSchema = MultiSelectPersonSchema;
|
|
1937
1899
|
exports.MultiSelectStaticSchema = MultiSelectStaticSchema;
|
|
1938
1900
|
exports.MultiUrlSchema = MultiUrlSchema;
|
|
1939
|
-
exports.NBSP = NBSP;
|
|
1940
1901
|
exports.NoteChildSchema = NoteChildSchema;
|
|
1941
1902
|
exports.NoteSchema = NoteSchema;
|
|
1942
1903
|
exports.OpenUrlBehaviorSchema = OpenUrlBehaviorSchema;
|
|
@@ -1966,7 +1927,6 @@ exports.UdIconSchema = UdIconSchema;
|
|
|
1966
1927
|
exports.VerticalAlignSchema = VerticalAlignSchema;
|
|
1967
1928
|
exports.VideoSchema = VideoSchema;
|
|
1968
1929
|
exports.WidthModeSchema = WidthModeSchema;
|
|
1969
|
-
exports.escapeMarkdown = escapeMarkdown;
|
|
1970
1930
|
exports.markdown = markdown;
|
|
1971
1931
|
exports.refineBehaviorsByFormContext = refineBehaviorsByFormContext;
|
|
1972
1932
|
exports.renderAnchorTag = renderAnchorTag;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { decodeMarkdownEntities } from './chunk-LYJGL4VE.js';
|
|
1
2
|
import { EMOJI_KEY_TO_NAME } from './chunk-462CNCHD.js';
|
|
2
3
|
|
|
3
4
|
// src/adapter/md-parse.ts
|
|
@@ -14,7 +15,7 @@ function styleAttrs(s) {
|
|
|
14
15
|
return ts;
|
|
15
16
|
}
|
|
16
17
|
function makeText(content, s) {
|
|
17
|
-
const property = { content };
|
|
18
|
+
const property = { content: decodeMarkdownEntities(content) };
|
|
18
19
|
const ts = styleAttrs(s);
|
|
19
20
|
if (ts) property.textStyle = ts;
|
|
20
21
|
return { tag: "plain_text", property };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parse, resolveCardDocument, sanitize, serializeCardDocument, compile, checkSource, validate, repairDeviceIssues } from './chunk-
|
|
1
|
+
import { parse, resolveCardDocument, sanitize, serializeCardDocument, compile, checkSource, validate, repairDeviceIssues } from './chunk-5CITR4BX.js';
|
|
2
2
|
import { writeFileSync, readFileSync } from 'fs';
|
|
3
3
|
|
|
4
4
|
var COMMANDS = /* @__PURE__ */ new Set(["check", "validate", "lint", "compile", "sanitize", "clean", "build", "format"]);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/schema/markdown/escape.ts
|
|
2
|
+
var ESCAPE_MAP = [
|
|
3
|
+
["&", "&"],
|
|
4
|
+
["<", "<"],
|
|
5
|
+
[">", ">"],
|
|
6
|
+
["*", "*"],
|
|
7
|
+
["~", "∼"],
|
|
8
|
+
["-", "-"],
|
|
9
|
+
["!", "!"],
|
|
10
|
+
["/", "/"],
|
|
11
|
+
["\\", "\"],
|
|
12
|
+
["[", "["],
|
|
13
|
+
["]", "]"],
|
|
14
|
+
["(", "("],
|
|
15
|
+
[")", ")"],
|
|
16
|
+
["#", "#"],
|
|
17
|
+
[":", ":"],
|
|
18
|
+
["+", "+"],
|
|
19
|
+
['"', """],
|
|
20
|
+
["'", "'"],
|
|
21
|
+
["`", "`"],
|
|
22
|
+
["$", "$"],
|
|
23
|
+
["_", "_"]
|
|
24
|
+
];
|
|
25
|
+
var ENTITIES = new Map(ESCAPE_MAP);
|
|
26
|
+
var SPECIAL = new RegExp(
|
|
27
|
+
`[${ESCAPE_MAP.map(([char]) => char.replace(/[\\\]\[\-^]/g, "\\$&")).join("")}]`,
|
|
28
|
+
"g"
|
|
29
|
+
);
|
|
30
|
+
function escapeMarkdown(text) {
|
|
31
|
+
return text.replace(SPECIAL, (char) => ENTITIES.get(char) ?? char);
|
|
32
|
+
}
|
|
33
|
+
var NAMED_UNESCAPE = {
|
|
34
|
+
amp: "&",
|
|
35
|
+
lt: "<",
|
|
36
|
+
gt: ">",
|
|
37
|
+
quot: '"',
|
|
38
|
+
apos: "'",
|
|
39
|
+
nbsp: "\xA0",
|
|
40
|
+
ensp: "\u2002",
|
|
41
|
+
emsp: "\u2003",
|
|
42
|
+
sim: "~"
|
|
43
|
+
};
|
|
44
|
+
var ENTITY = /&(?:#(\d+)|#x([0-9a-fA-F]+)|([a-zA-Z][a-zA-Z0-9]*));/g;
|
|
45
|
+
function decodeMarkdownEntities(text) {
|
|
46
|
+
if (!text.includes("&")) return text;
|
|
47
|
+
return text.replace(ENTITY, (match, decimal, hex, name) => {
|
|
48
|
+
if (decimal !== void 0) {
|
|
49
|
+
const code = Number(decimal);
|
|
50
|
+
return Number.isFinite(code) && code >= 0 && code <= 1114111 ? String.fromCodePoint(code) : match;
|
|
51
|
+
}
|
|
52
|
+
if (hex !== void 0) {
|
|
53
|
+
const code = Number.parseInt(hex, 16);
|
|
54
|
+
return Number.isFinite(code) && code >= 0 && code <= 1114111 ? String.fromCodePoint(code) : match;
|
|
55
|
+
}
|
|
56
|
+
return NAMED_UNESCAPE[String(name).toLowerCase()] ?? match;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
var NBSP = " ";
|
|
60
|
+
var ENSP = " ";
|
|
61
|
+
var EMSP = " ";
|
|
62
|
+
|
|
63
|
+
export { EMSP, ENSP, NBSP, decodeMarkdownEntities, escapeMarkdown };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ICON_FONT_CSS, EMOJI_SPRITE_CSS, BASE_STYLES_CSS } from './chunk-DINOEQ4D.js';
|
|
2
|
-
import { vnodeToDom, buildCardVNode, hydrateFeishuAudios, hydrateFeishuTablePagers, CLS } from './chunk-
|
|
3
|
-
import { dslToRaw } from './chunk-
|
|
2
|
+
import { vnodeToDom, buildCardVNode, hydrateFeishuAudios, hydrateFeishuTablePagers, CLS } from './chunk-VXK22NAZ.js';
|
|
3
|
+
import { dslToRaw } from './chunk-CRPWSRNM.js';
|
|
4
4
|
|
|
5
5
|
// src/renderer/dom.ts
|
|
6
6
|
var BASE_STYLES_STYLE_ID = `${CLS}-base-styles`;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkQFNUJSCP_cjs = require('./chunk-QFNUJSCP.cjs');
|
|
4
4
|
var chunk2ICTWLIP_cjs = require('./chunk-2ICTWLIP.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkX7B72PBG_cjs = require('./chunk-X7B72PBG.cjs');
|
|
6
6
|
var chunkMOCZJJ5P_cjs = require('./chunk-MOCZJJ5P.cjs');
|
|
7
7
|
|
|
8
8
|
// src/renderer/constants.ts
|
|
@@ -629,7 +629,7 @@ function resolveTextFontToken(raw) {
|
|
|
629
629
|
function textStyleToModifiers(textStyle) {
|
|
630
630
|
if (!textStyle) return [];
|
|
631
631
|
const out = [];
|
|
632
|
-
const color =
|
|
632
|
+
const color = chunkX7B72PBG_cjs.resolveTextStyleColor(textStyle) ?? textStyle?.color?.trim();
|
|
633
633
|
if (color && color !== "default" && !/^(#|rgb|hsl)/i.test(color)) out.push(color);
|
|
634
634
|
const attrs = textStyle.attributes || [];
|
|
635
635
|
if (attrs.includes("bold")) out.push("bold");
|
|
@@ -644,7 +644,7 @@ function textStyleToStyle(textStyle) {
|
|
|
644
644
|
if (attrs.includes("bold")) style.fontWeight = "600";
|
|
645
645
|
if (attrs.includes("italic")) style.fontStyle = "italic";
|
|
646
646
|
if (attrs.includes("strikethrough")) style.textDecoration = "line-through";
|
|
647
|
-
const color =
|
|
647
|
+
const color = chunkX7B72PBG_cjs.resolveTextStyleColor(textStyle) ?? textStyle.color;
|
|
648
648
|
if (color) {
|
|
649
649
|
const token = resolveTextFontToken(color);
|
|
650
650
|
if (token) style.color = `var(--${token})`;
|
|
@@ -934,7 +934,7 @@ function bgStyleToColor(style) {
|
|
|
934
934
|
}
|
|
935
935
|
function propertyBackgroundColor(property) {
|
|
936
936
|
if (!property) return null;
|
|
937
|
-
const custom =
|
|
937
|
+
const custom = chunkX7B72PBG_cjs.resolveCustomBackgroundLight(property);
|
|
938
938
|
if (custom) {
|
|
939
939
|
const c = resolveColor(custom);
|
|
940
940
|
if (c) return c;
|
|
@@ -1542,7 +1542,7 @@ function renderHeaderTextLeaf(node, ctx, className) {
|
|
|
1542
1542
|
if (isMd) {
|
|
1543
1543
|
let elements = Array.isArray(p.elements) ? p.elements : [];
|
|
1544
1544
|
if (elements.length === 0 && typeof p.content === "string" && p.content) {
|
|
1545
|
-
elements =
|
|
1545
|
+
elements = chunkX7B72PBG_cjs.parseMarkdown(p.content);
|
|
1546
1546
|
}
|
|
1547
1547
|
if (elements.length === 0) return null;
|
|
1548
1548
|
return h("div", { className }, renderElements(elements, ctx));
|
|
@@ -1932,7 +1932,7 @@ function registerBuiltins() {
|
|
|
1932
1932
|
if (tag === "markdown" && !Array.isArray(property.elements)) {
|
|
1933
1933
|
const content = typeof property.content === "string" ? property.content : "";
|
|
1934
1934
|
if (!content) return null;
|
|
1935
|
-
property.elements =
|
|
1935
|
+
property.elements = chunkX7B72PBG_cjs.parseMarkdown(content);
|
|
1936
1936
|
}
|
|
1937
1937
|
const node = { tag, property };
|
|
1938
1938
|
if (tag === "plain_text" && !extractText(node)) return null;
|
|
@@ -2191,7 +2191,7 @@ function registerBuiltins() {
|
|
|
2191
2191
|
const borderObj = isRecord(p.border) ? p.border : void 0;
|
|
2192
2192
|
const hasBorder = p.hasBorder === true || p.has_border === true || !!borderObj;
|
|
2193
2193
|
if (hasBorder) {
|
|
2194
|
-
const borderColor =
|
|
2194
|
+
const borderColor = chunkX7B72PBG_cjs.readThemeColorLight(borderObj?.customBorderColor ?? borderObj?.custom_border_color) ?? chunkX7B72PBG_cjs.resolveCustomBorderLight(p) ?? resolveBorderColor(borderObj?.color ?? borderObj?.borderColor ?? p.borderColor);
|
|
2195
2195
|
if (borderColor) style.border = `1px solid ${borderColor}`;
|
|
2196
2196
|
}
|
|
2197
2197
|
style["--universal-card-audio-border-width"] = "1px";
|
|
@@ -2199,9 +2199,9 @@ function registerBuiltins() {
|
|
|
2199
2199
|
borderObj?.corner_radius ?? borderObj?.cornerRadius ?? p.corner_radius ?? p.cornerRadius
|
|
2200
2200
|
);
|
|
2201
2201
|
if (radius) style.borderRadius = radius;
|
|
2202
|
-
const bg =
|
|
2202
|
+
const bg = chunkX7B72PBG_cjs.resolveCustomBackgroundLight(p) ?? bgStyleToColor(p.backgroundColor ?? p.background_color ?? p.background_style ?? p.backgroundStyle);
|
|
2203
2203
|
if (bg) style["--universal-card-audio-bg"] = bg;
|
|
2204
|
-
const fillRaw =
|
|
2204
|
+
const fillRaw = chunkX7B72PBG_cjs.readThemeColorLight(p.customFillColor ?? p.custom_fill_color) ?? p.fill_color ?? p.fillColor;
|
|
2205
2205
|
if (typeof fillRaw === "string") {
|
|
2206
2206
|
const fill = resolveColor(fillRaw);
|
|
2207
2207
|
if (fill) style["--universal-card-audio-fill-color"] = fill;
|
|
@@ -2333,7 +2333,7 @@ function registerBuiltins() {
|
|
|
2333
2333
|
const hasActions = Array.isArray(p.actions) && p.actions.length > 0;
|
|
2334
2334
|
const clickable = !disabled && (Boolean(url) || hasActions);
|
|
2335
2335
|
const borderNamed = p.border_color ?? p.borderColor;
|
|
2336
|
-
const borderCustom =
|
|
2336
|
+
const borderCustom = chunkX7B72PBG_cjs.resolveCustomBorderLight(p);
|
|
2337
2337
|
const borderColorResolved = (borderCustom ? resolveBorderColor(borderCustom) : void 0) ?? resolveBorderColor(borderNamed);
|
|
2338
2338
|
const hasBorder = p.hasBorder === true || p.has_border === true;
|
|
2339
2339
|
const borderColor = hasBorder ? borderColorResolved : void 0;
|
|
@@ -3562,7 +3562,7 @@ function renderCell(value, col, ctx, lines) {
|
|
|
3562
3562
|
if (typeof value === "object" && value.tag) {
|
|
3563
3563
|
mdEl = value;
|
|
3564
3564
|
} else if (typeof value === "string") {
|
|
3565
|
-
mdEl = { tag: "markdown", property: { elements:
|
|
3565
|
+
mdEl = { tag: "markdown", property: { elements: chunkX7B72PBG_cjs.parseMarkdown(value) } };
|
|
3566
3566
|
}
|
|
3567
3567
|
if (mdEl) {
|
|
3568
3568
|
const withLines = type === "lark_md" && lines != null ? { ...mdEl, property: { ...mdEl.property || {}, lines } } : mdEl;
|
|
@@ -3692,7 +3692,7 @@ function renderCardToString(card, options = {}) {
|
|
|
3692
3692
|
return vnodeToString(buildCardVNode(card, options));
|
|
3693
3693
|
}
|
|
3694
3694
|
function renderDslToString(dsl, options = {}) {
|
|
3695
|
-
return renderCardToString(
|
|
3695
|
+
return renderCardToString(chunkX7B72PBG_cjs.dslToRaw(dsl), options);
|
|
3696
3696
|
}
|
|
3697
3697
|
|
|
3698
3698
|
exports.AUDIO_HYDRATED_ATTR = AUDIO_HYDRATED_ATTR;
|
|
@@ -1344,42 +1344,6 @@ var MarkdownDateTimeFormatSchema = z.enum([
|
|
|
1344
1344
|
);
|
|
1345
1345
|
var MarkdownPersonStyleSchema = z.enum(["normal", "capsule"]).describe("\u4EBA\u5458\u6807\u7B7E\u6837\u5F0F\uFF1Anormal\uFF08\u666E\u901A\uFF09/ capsule\uFF08\u80F6\u56CA\uFF09");
|
|
1346
1346
|
var MarkdownInlineAudioStyleSchema = z.enum(["normal", "speak"]).describe("\u5185\u5D4C\u97F3\u9891\u6837\u5F0F\uFF1Anormal\uFF08\u4E09\u89D2\u64AD\u653E\uFF09/ speak\uFF08\u8BED\u97F3\u6C14\u6CE1\uFF09");
|
|
1347
|
-
|
|
1348
|
-
// src/schema/markdown/escape.ts
|
|
1349
|
-
var ESCAPE_MAP = [
|
|
1350
|
-
["&", "&"],
|
|
1351
|
-
["<", "<"],
|
|
1352
|
-
[">", ">"],
|
|
1353
|
-
["*", "*"],
|
|
1354
|
-
["~", "∼"],
|
|
1355
|
-
["-", "-"],
|
|
1356
|
-
["!", "!"],
|
|
1357
|
-
["/", "/"],
|
|
1358
|
-
["\\", "\"],
|
|
1359
|
-
["[", "["],
|
|
1360
|
-
["]", "]"],
|
|
1361
|
-
["(", "("],
|
|
1362
|
-
[")", ")"],
|
|
1363
|
-
["#", "#"],
|
|
1364
|
-
[":", ":"],
|
|
1365
|
-
["+", "+"],
|
|
1366
|
-
['"', """],
|
|
1367
|
-
["'", "'"],
|
|
1368
|
-
["`", "`"],
|
|
1369
|
-
["$", "$"],
|
|
1370
|
-
["_", "_"]
|
|
1371
|
-
];
|
|
1372
|
-
var ENTITIES = new Map(ESCAPE_MAP);
|
|
1373
|
-
var SPECIAL = new RegExp(
|
|
1374
|
-
`[${ESCAPE_MAP.map(([char]) => char.replace(/[\\\]\[\-^]/g, "\\$&")).join("")}]`,
|
|
1375
|
-
"g"
|
|
1376
|
-
);
|
|
1377
|
-
function escapeMarkdown(text) {
|
|
1378
|
-
return text.replace(SPECIAL, (char) => ENTITIES.get(char) ?? char);
|
|
1379
|
-
}
|
|
1380
|
-
var NBSP = " ";
|
|
1381
|
-
var ENSP = " ";
|
|
1382
|
-
var EMSP = " ";
|
|
1383
1347
|
function boolAttr(value) {
|
|
1384
1348
|
if (value === void 0) return void 0;
|
|
1385
1349
|
return value ? "true" : "false";
|
|
@@ -1859,4 +1823,4 @@ var CARD_ELEMENT_TAGS = [
|
|
|
1859
1823
|
];
|
|
1860
1824
|
var CARD_TOP_LEVEL_KEYS = ["schema", "config", "header", "body"];
|
|
1861
1825
|
|
|
1862
|
-
export { ActionRequestBehaviorSchema, AudioSchema, AvatarSchema, BEHAVIORS_REQUIRED_OUTSIDE_FORM, BehaviorSchema, BehaviorsSchema, BodySchema, ButtonSchema, CARD_ELEMENT_TAGS, CARD_TOP_LEVEL_KEYS, CallbackBehaviorSchema, CardLinkSchema, ChartSchema, CheckerSchema, ClientMessageBehaviorSchema, CollapseDividerSchema, CollapsiblePanelSchema, ColorSchema, ColumnSchema, ColumnSetSchema, ConfigSchema, ConfirmSchema, CornerRadiusSchema, CustomColorSchema, CustomIconSchema, CustomTextSizeSchema, DatePickerSchema, DirectionSchema, DivSchema,
|
|
1826
|
+
export { ActionRequestBehaviorSchema, AudioSchema, AvatarSchema, BEHAVIORS_REQUIRED_OUTSIDE_FORM, BehaviorSchema, BehaviorsSchema, BodySchema, ButtonSchema, CARD_ELEMENT_TAGS, CARD_TOP_LEVEL_KEYS, CallbackBehaviorSchema, CardLinkSchema, ChartSchema, CheckerSchema, ClientMessageBehaviorSchema, CollapseDividerSchema, CollapsiblePanelSchema, ColorSchema, ColumnSchema, ColumnSetSchema, ConfigSchema, ConfirmSchema, CornerRadiusSchema, CustomColorSchema, CustomIconSchema, CustomTextSizeSchema, DatePickerSchema, DirectionSchema, DivSchema, ElementIdSchema, ElementSchema, FallbackSchema, FallbackTextElementSchema, FeishuCardSchema, FeishuCardV2Schema, FeishuEmojiTokenSchema, FormSchema, HeaderSchema, HeaderTemplateSchema, HorizontalAlignSchema, HrSchema, I18nStringMapSchema, IconSchema, IconTokenSchema, ImageSchema, ImgCombinationSchema, InputSchema, InteractiveContainerSchema, InteractiveWidthSchema, MarkdownAnchorTagSchema, MarkdownAtTagSchema, MarkdownCodeLanguageSchema, MarkdownContentBuilder, MarkdownDateTimeFormatSchema, MarkdownFontTagSchema, MarkdownInlineAudioStyleSchema, MarkdownInlineAudioTagSchema, MarkdownLinkTagSchema, MarkdownLocalDateTimeTagSchema, MarkdownNumberTagSchema, MarkdownPersonStyleSchema, MarkdownPersonTagSchema, MarkdownSchema, MarkdownTextObjectSchema, MarkdownTextSizeCustomKeySchema, MarkdownTextSizeEnumSchema, MarkdownTextSizePixelSchema, MarkdownTextSizeSchema, MarkdownTextTagColorSchema, MarkdownTextTagSchema, MultiSelectPersonSchema, MultiSelectStaticSchema, MultiUrlSchema, NoteChildSchema, NoteSchema, OpenUrlBehaviorSchema, OverflowSchema, PersonListSchema, PersonSchema, PickerDatetimeSchema, PickerTimeSchema, PlainTextObjectSchema, SelectBorderTypeSchema, SelectImgSchema, SelectPersonSchema, SelectStaticSchema, SpacingTokenSchema, SpacingValueSchema, StandardIconSchema, StreamingConfigSchema, StyledTextObjectSchema, SummarySchema, TableSchema, TextObjectSchema, TextSizeSchema, TextTagColorSchema, TextTagSchema, TipsTextSchema, UdIconSchema, VerticalAlignSchema, VideoSchema, WidthModeSchema, markdown, refineBehaviorsByFormContext, renderAnchorTag, renderAtTag, renderFontTag, renderInlineAudioTag, renderLinkTag, renderLocalDateTimeTag, renderNumberTag, renderPersonTag, renderTextTag };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkH4M2WTIP_cjs = require('./chunk-H4M2WTIP.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkQPQ4KFDE_cjs = require('./chunk-QPQ4KFDE.cjs');
|
|
5
|
+
var chunkX7B72PBG_cjs = require('./chunk-X7B72PBG.cjs');
|
|
6
6
|
|
|
7
7
|
// src/renderer/dom.ts
|
|
8
|
-
var BASE_STYLES_STYLE_ID = `${
|
|
9
|
-
var ICON_FONT_STYLE_ID = `${
|
|
10
|
-
var EMOJI_SPRITE_STYLE_ID = `${
|
|
8
|
+
var BASE_STYLES_STYLE_ID = `${chunkQPQ4KFDE_cjs.CLS}-base-styles`;
|
|
9
|
+
var ICON_FONT_STYLE_ID = `${chunkQPQ4KFDE_cjs.CLS}-icon-font`;
|
|
10
|
+
var EMOJI_SPRITE_STYLE_ID = `${chunkQPQ4KFDE_cjs.CLS}-emoji-sprite`;
|
|
11
11
|
function getDocument(options) {
|
|
12
12
|
return options.document || (typeof document !== "undefined" ? document : null);
|
|
13
13
|
}
|
|
@@ -26,19 +26,19 @@ function renderCard(card, options = {}) {
|
|
|
26
26
|
const doc = getDocument(options);
|
|
27
27
|
if (!doc) throw new Error("[FeishuCard] renderCard \u9700\u8981 DOM \u73AF\u5883\uFF1BNode \u7AEF\u8BF7\u7528 renderCardToString");
|
|
28
28
|
ensureStyle(doc, BASE_STYLES_STYLE_ID, chunkH4M2WTIP_cjs.BASE_STYLES_CSS);
|
|
29
|
-
const dom =
|
|
30
|
-
|
|
29
|
+
const dom = chunkQPQ4KFDE_cjs.vnodeToDom(
|
|
30
|
+
chunkQPQ4KFDE_cjs.buildCardVNode(card, { ...options, injectAssets: (asset) => injectAssets(doc, asset) }),
|
|
31
31
|
doc
|
|
32
32
|
);
|
|
33
33
|
if (!dom) throw new Error("[FeishuCard] \u6E32\u67D3\u7ED3\u679C\u4E3A\u7A7A");
|
|
34
34
|
if (dom instanceof Element || typeof dom.querySelectorAll === "function") {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
chunkQPQ4KFDE_cjs.hydrateFeishuAudios(dom);
|
|
36
|
+
chunkQPQ4KFDE_cjs.hydrateFeishuTablePagers(dom);
|
|
37
37
|
}
|
|
38
38
|
return dom;
|
|
39
39
|
}
|
|
40
40
|
function renderDsl(dsl, options = {}) {
|
|
41
|
-
return renderCard(
|
|
41
|
+
return renderCard(chunkX7B72PBG_cjs.dslToRaw(dsl), options);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
exports.renderCard = renderCard;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HEADER_BG_LIGHT } from './chunk-PBF3NXUI.js';
|
|
2
2
|
import { BASE_FONT_SIZE, BASE_LINE_HEIGHT, TEXT_SIZE_MAP, lineHeightForFontSize, HEADING_LEVELS, textLineHeight } from './chunk-ZC3PQI6F.js';
|
|
3
|
-
import { resolveCustomBorderLight, parseMarkdown, dslToRaw, resolveTextStyleColor, resolveCustomBackgroundLight, readThemeColorLight } from './chunk-
|
|
3
|
+
import { resolveCustomBorderLight, parseMarkdown, dslToRaw, resolveTextStyleColor, resolveCustomBackgroundLight, readThemeColorLight } from './chunk-CRPWSRNM.js';
|
|
4
4
|
import { EMOJI_KEY_TO_NAME } from './chunk-462CNCHD.js';
|
|
5
5
|
|
|
6
6
|
// src/renderer/constants.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZWTPTIAH_cjs = require('./chunk-ZWTPTIAH.cjs');
|
|
4
|
+
var chunk64Q7A362_cjs = require('./chunk-64Q7A362.cjs');
|
|
5
5
|
|
|
6
6
|
// src/language-server/index.ts
|
|
7
7
|
function toLspRange(range) {
|
|
@@ -28,8 +28,8 @@ function toLspDiagnostic(diagnostic) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function analyze(source) {
|
|
31
|
-
const result =
|
|
32
|
-
const parsed =
|
|
31
|
+
const result = chunkZWTPTIAH_cjs.checkSource(source);
|
|
32
|
+
const parsed = chunkZWTPTIAH_cjs.parse(source);
|
|
33
33
|
return {
|
|
34
34
|
diagnostics: result.diagnostics.map(toLspDiagnostic),
|
|
35
35
|
ast: parsed.ast
|
|
@@ -41,13 +41,13 @@ var TOP_LEVEL_DETAIL = {
|
|
|
41
41
|
header: "\u5361\u7247\u5934\uFF08title / subtitle / template / icon\uFF09",
|
|
42
42
|
body: "\u5361\u7247\u6B63\u6587 { elements: [...] }"
|
|
43
43
|
};
|
|
44
|
-
var CARD_TOP_LEVEL_KEYS_COMPLETIONS =
|
|
44
|
+
var CARD_TOP_LEVEL_KEYS_COMPLETIONS = chunk64Q7A362_cjs.CARD_TOP_LEVEL_KEYS.map((key) => ({
|
|
45
45
|
label: key,
|
|
46
46
|
kind: 14,
|
|
47
47
|
// Keyword
|
|
48
48
|
detail: TOP_LEVEL_DETAIL[key] ?? key
|
|
49
49
|
}));
|
|
50
|
-
var ELEMENT_TAG_COMPLETIONS =
|
|
50
|
+
var ELEMENT_TAG_COMPLETIONS = chunk64Q7A362_cjs.CARD_ELEMENT_TAGS.map((tag) => ({
|
|
51
51
|
label: tag,
|
|
52
52
|
kind: 22,
|
|
53
53
|
// Struct
|
|
@@ -129,12 +129,12 @@ function quickFixes(source, range) {
|
|
|
129
129
|
return actions;
|
|
130
130
|
}
|
|
131
131
|
function sanitizeAllAction(source) {
|
|
132
|
-
const parsed =
|
|
133
|
-
const resolved =
|
|
132
|
+
const parsed = chunkZWTPTIAH_cjs.parse(source);
|
|
133
|
+
const resolved = chunkZWTPTIAH_cjs.resolveCardDocument(parsed);
|
|
134
134
|
if (!resolved) return void 0;
|
|
135
|
-
const { stripped, card } =
|
|
135
|
+
const { stripped, card } = chunkZWTPTIAH_cjs.sanitize(resolved.cardData, { mode: "strip" });
|
|
136
136
|
if (stripped.length === 0) return void 0;
|
|
137
|
-
const output =
|
|
137
|
+
const output = chunkZWTPTIAH_cjs.serializeCardDocument(resolved, card);
|
|
138
138
|
const lines = source.split("\n");
|
|
139
139
|
const lastLine = lines.length - 1;
|
|
140
140
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkYSA5ND2Y_cjs = require('./chunk-YSA5ND2Y.cjs');
|
|
3
4
|
var chunkMOCZJJ5P_cjs = require('./chunk-MOCZJJ5P.cjs');
|
|
4
5
|
|
|
5
6
|
// src/adapter/md-parse.ts
|
|
@@ -16,7 +17,7 @@ function styleAttrs(s) {
|
|
|
16
17
|
return ts;
|
|
17
18
|
}
|
|
18
19
|
function makeText(content, s) {
|
|
19
|
-
const property = { content };
|
|
20
|
+
const property = { content: chunkYSA5ND2Y_cjs.decodeMarkdownEntities(content) };
|
|
20
21
|
const ts = styleAttrs(s);
|
|
21
22
|
if (ts) property.textStyle = ts;
|
|
22
23
|
return { tag: "plain_text", property };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { checkSource, parse, resolveCardDocument, sanitize, serializeCardDocument } from './chunk-
|
|
2
|
-
import { CARD_TOP_LEVEL_KEYS, CARD_ELEMENT_TAGS } from './chunk-
|
|
1
|
+
import { checkSource, parse, resolveCardDocument, sanitize, serializeCardDocument } from './chunk-5CITR4BX.js';
|
|
2
|
+
import { CARD_TOP_LEVEL_KEYS, CARD_ELEMENT_TAGS } from './chunk-RXUE4TST.js';
|
|
3
3
|
|
|
4
4
|
// src/language-server/index.ts
|
|
5
5
|
function toLspRange(range) {
|