larkard 0.1.0 → 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.
Files changed (40) hide show
  1. package/dist/adapter/index.cjs +20 -19
  2. package/dist/adapter/index.js +2 -1
  3. package/dist/adapter/md-parse.d.ts.map +1 -1
  4. package/dist/{chunk-BMD67L5A.js → chunk-5CITR4BX.js} +2 -2
  5. package/dist/{chunk-4VLXPDHK.cjs → chunk-64Q7A362.cjs} +0 -40
  6. package/dist/{chunk-ZX4N4AUP.js → chunk-CRPWSRNM.js} +2 -1
  7. package/dist/{chunk-LFUKOODS.js → chunk-E66NSRYB.js} +1 -1
  8. package/dist/chunk-LYJGL4VE.js +63 -0
  9. package/dist/{chunk-XKJ2OLNJ.js → chunk-PDBOIFS3.js} +2 -2
  10. package/dist/{chunk-BI3SOQOF.cjs → chunk-QPQ4KFDE.cjs} +12 -12
  11. package/dist/{chunk-33T4REBK.js → chunk-RXUE4TST.js} +1 -37
  12. package/dist/{chunk-VYGAB4ZH.cjs → chunk-SGTRQI32.cjs} +10 -10
  13. package/dist/{chunk-VFJ4QPRG.js → chunk-VXK22NAZ.js} +1 -1
  14. package/dist/{chunk-MM5UOOA2.cjs → chunk-X2I7SHBY.cjs} +10 -10
  15. package/dist/{chunk-ADPNWRSB.cjs → chunk-X7B72PBG.cjs} +2 -1
  16. package/dist/{chunk-M33JXCUC.js → chunk-XR7ZZYBL.js} +2 -2
  17. package/dist/{chunk-HSVVJUIC.cjs → chunk-YBS4NP5V.cjs} +15 -15
  18. package/dist/chunk-YSA5ND2Y.cjs +69 -0
  19. package/dist/{chunk-OHQIQTRR.cjs → chunk-ZWTPTIAH.cjs} +7 -7
  20. package/dist/cli-bin.cjs +6 -5
  21. package/dist/cli-bin.js +5 -4
  22. package/dist/cli.cjs +6 -5
  23. package/dist/cli.js +5 -4
  24. package/dist/index.cjs +32 -31
  25. package/dist/index.js +4 -3
  26. package/dist/language-server/index.cjs +12 -11
  27. package/dist/language-server/index.js +5 -4
  28. package/dist/language-server/server.cjs +10 -9
  29. package/dist/language-server/server.js +5 -4
  30. package/dist/renderer/async.cjs +6 -5
  31. package/dist/renderer/async.js +4 -3
  32. package/dist/renderer/browser.cjs +27 -26
  33. package/dist/renderer/browser.js +4 -3
  34. package/dist/renderer/index.cjs +13 -12
  35. package/dist/renderer/index.js +3 -2
  36. package/dist/schema/index.cjs +135 -130
  37. package/dist/schema/index.js +2 -1
  38. package/dist/schema/markdown/escape.d.ts +6 -0
  39. package/dist/schema/markdown/escape.d.ts.map +1 -1
  40. package/package.json +3 -3
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkADPNWRSB_cjs = require('../chunk-ADPNWRSB.cjs');
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 chunkADPNWRSB_cjs.createColorRegistry; }
12
+ get: function () { return chunkX7B72PBG_cjs.createColorRegistry; }
12
13
  });
13
14
  Object.defineProperty(exports, "degradeUnknown", {
14
15
  enumerable: true,
15
- get: function () { return chunkADPNWRSB_cjs.degradeUnknown; }
16
+ get: function () { return chunkX7B72PBG_cjs.degradeUnknown; }
16
17
  });
17
18
  Object.defineProperty(exports, "dslToRaw", {
18
19
  enumerable: true,
19
- get: function () { return chunkADPNWRSB_cjs.dslToRaw; }
20
+ get: function () { return chunkX7B72PBG_cjs.dslToRaw; }
20
21
  });
21
22
  Object.defineProperty(exports, "isCustomHexColor", {
22
23
  enumerable: true,
23
- get: function () { return chunkADPNWRSB_cjs.isCustomHexColor; }
24
+ get: function () { return chunkX7B72PBG_cjs.isCustomHexColor; }
24
25
  });
25
26
  Object.defineProperty(exports, "isRawCardEnvelope", {
26
27
  enumerable: true,
27
- get: function () { return chunkADPNWRSB_cjs.isRawCardEnvelope; }
28
+ get: function () { return chunkX7B72PBG_cjs.isRawCardEnvelope; }
28
29
  });
29
30
  Object.defineProperty(exports, "normalizeStoredCardColors", {
30
31
  enumerable: true,
31
- get: function () { return chunkADPNWRSB_cjs.normalizeStoredCardColors; }
32
+ get: function () { return chunkX7B72PBG_cjs.normalizeStoredCardColors; }
32
33
  });
33
34
  Object.defineProperty(exports, "parseInline", {
34
35
  enumerable: true,
35
- get: function () { return chunkADPNWRSB_cjs.parseInline; }
36
+ get: function () { return chunkX7B72PBG_cjs.parseInline; }
36
37
  });
37
38
  Object.defineProperty(exports, "parseMarkdown", {
38
39
  enumerable: true,
39
- get: function () { return chunkADPNWRSB_cjs.parseMarkdown; }
40
+ get: function () { return chunkX7B72PBG_cjs.parseMarkdown; }
40
41
  });
41
42
  Object.defineProperty(exports, "rawCardToDsl", {
42
43
  enumerable: true,
43
- get: function () { return chunkADPNWRSB_cjs.rawCardToDsl; }
44
+ get: function () { return chunkX7B72PBG_cjs.rawCardToDsl; }
44
45
  });
45
46
  Object.defineProperty(exports, "rawToDsl", {
46
47
  enumerable: true,
47
- get: function () { return chunkADPNWRSB_cjs.rawToDsl; }
48
+ get: function () { return chunkX7B72PBG_cjs.rawToDsl; }
48
49
  });
49
50
  Object.defineProperty(exports, "readThemeColorDark", {
50
51
  enumerable: true,
51
- get: function () { return chunkADPNWRSB_cjs.readThemeColorDark; }
52
+ get: function () { return chunkX7B72PBG_cjs.readThemeColorDark; }
52
53
  });
53
54
  Object.defineProperty(exports, "readThemeColorLight", {
54
55
  enumerable: true,
55
- get: function () { return chunkADPNWRSB_cjs.readThemeColorLight; }
56
+ get: function () { return chunkX7B72PBG_cjs.readThemeColorLight; }
56
57
  });
57
58
  Object.defineProperty(exports, "registerColorEntry", {
58
59
  enumerable: true,
59
- get: function () { return chunkADPNWRSB_cjs.registerColorEntry; }
60
+ get: function () { return chunkX7B72PBG_cjs.registerColorEntry; }
60
61
  });
61
62
  Object.defineProperty(exports, "resolveCustomBackgroundLight", {
62
63
  enumerable: true,
63
- get: function () { return chunkADPNWRSB_cjs.resolveCustomBackgroundLight; }
64
+ get: function () { return chunkX7B72PBG_cjs.resolveCustomBackgroundLight; }
64
65
  });
65
66
  Object.defineProperty(exports, "resolveCustomBorderLight", {
66
67
  enumerable: true,
67
- get: function () { return chunkADPNWRSB_cjs.resolveCustomBorderLight; }
68
+ get: function () { return chunkX7B72PBG_cjs.resolveCustomBorderLight; }
68
69
  });
69
70
  Object.defineProperty(exports, "resolveTextStyleColor", {
70
71
  enumerable: true,
71
- get: function () { return chunkADPNWRSB_cjs.resolveTextStyleColor; }
72
+ get: function () { return chunkX7B72PBG_cjs.resolveTextStyleColor; }
72
73
  });
73
74
  Object.defineProperty(exports, "resolveTextStyleCustomColorPair", {
74
75
  enumerable: true,
75
- get: function () { return chunkADPNWRSB_cjs.resolveTextStyleCustomColorPair; }
76
+ get: function () { return chunkX7B72PBG_cjs.resolveTextStyleCustomColorPair; }
76
77
  });
77
78
  Object.defineProperty(exports, "themePairToColorEntry", {
78
79
  enumerable: true,
79
- get: function () { return chunkADPNWRSB_cjs.themePairToColorEntry; }
80
+ get: function () { return chunkX7B72PBG_cjs.themePairToColorEntry; }
80
81
  });
@@ -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-ZX4N4AUP.js';
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;AA+BzD;;;;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
+ {"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-33T4REBK.js';
3
- import { dslToRaw } from './chunk-ZX4N4AUP.js';
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
- ["<", "&#60;"],
1354
- [">", "&#62;"],
1355
- ["*", "&#42;"],
1356
- ["~", "&sim;"],
1357
- ["-", "&#45;"],
1358
- ["!", "&#33;"],
1359
- ["/", "&#47;"],
1360
- ["\\", "&#92;"],
1361
- ["[", "&#91;"],
1362
- ["]", "&#93;"],
1363
- ["(", "&#40;"],
1364
- [")", "&#41;"],
1365
- ["#", "&#35;"],
1366
- [":", "&#58;"],
1367
- ["+", "&#43;"],
1368
- ['"', "&#34;"],
1369
- ["'", "&#39;"],
1370
- ["`", "&#96;"],
1371
- ["$", "&#36;"],
1372
- ["_", "&#95;"]
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 = "&nbsp;";
1383
- var ENSP = "&ensp;";
1384
- var EMSP = "&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-BMD67L5A.js';
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
+ ["&", "&amp;"],
4
+ ["<", "&#60;"],
5
+ [">", "&#62;"],
6
+ ["*", "&#42;"],
7
+ ["~", "&sim;"],
8
+ ["-", "&#45;"],
9
+ ["!", "&#33;"],
10
+ ["/", "&#47;"],
11
+ ["\\", "&#92;"],
12
+ ["[", "&#91;"],
13
+ ["]", "&#93;"],
14
+ ["(", "&#40;"],
15
+ [")", "&#41;"],
16
+ ["#", "&#35;"],
17
+ [":", "&#58;"],
18
+ ["+", "&#43;"],
19
+ ['"', "&#34;"],
20
+ ["'", "&#39;"],
21
+ ["`", "&#96;"],
22
+ ["$", "&#36;"],
23
+ ["_", "&#95;"]
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 = "&nbsp;";
60
+ var ENSP = "&ensp;";
61
+ var EMSP = "&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-VFJ4QPRG.js';
3
- import { dslToRaw } from './chunk-ZX4N4AUP.js';
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 chunkADPNWRSB_cjs = require('./chunk-ADPNWRSB.cjs');
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 = chunkADPNWRSB_cjs.resolveTextStyleColor(textStyle) ?? textStyle?.color?.trim();
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 = chunkADPNWRSB_cjs.resolveTextStyleColor(textStyle) ?? textStyle.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 = chunkADPNWRSB_cjs.resolveCustomBackgroundLight(property);
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 = chunkADPNWRSB_cjs.parseMarkdown(p.content);
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 = chunkADPNWRSB_cjs.parseMarkdown(content);
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 = chunkADPNWRSB_cjs.readThemeColorLight(borderObj?.customBorderColor ?? borderObj?.custom_border_color) ?? chunkADPNWRSB_cjs.resolveCustomBorderLight(p) ?? resolveBorderColor(borderObj?.color ?? borderObj?.borderColor ?? p.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 = chunkADPNWRSB_cjs.resolveCustomBackgroundLight(p) ?? bgStyleToColor(p.backgroundColor ?? p.background_color ?? p.background_style ?? p.backgroundStyle);
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 = chunkADPNWRSB_cjs.readThemeColorLight(p.customFillColor ?? p.custom_fill_color) ?? p.fill_color ?? p.fillColor;
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 = chunkADPNWRSB_cjs.resolveCustomBorderLight(p);
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: chunkADPNWRSB_cjs.parseMarkdown(value) } };
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(chunkADPNWRSB_cjs.dslToRaw(dsl), options);
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
- ["&", "&amp;"],
1351
- ["<", "&#60;"],
1352
- [">", "&#62;"],
1353
- ["*", "&#42;"],
1354
- ["~", "&sim;"],
1355
- ["-", "&#45;"],
1356
- ["!", "&#33;"],
1357
- ["/", "&#47;"],
1358
- ["\\", "&#92;"],
1359
- ["[", "&#91;"],
1360
- ["]", "&#93;"],
1361
- ["(", "&#40;"],
1362
- [")", "&#41;"],
1363
- ["#", "&#35;"],
1364
- [":", "&#58;"],
1365
- ["+", "&#43;"],
1366
- ['"', "&#34;"],
1367
- ["'", "&#39;"],
1368
- ["`", "&#96;"],
1369
- ["$", "&#36;"],
1370
- ["_", "&#95;"]
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 = "&nbsp;";
1381
- var ENSP = "&ensp;";
1382
- var EMSP = "&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, EMSP, ENSP, 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, NBSP, 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, escapeMarkdown, markdown, refineBehaviorsByFormContext, renderAnchorTag, renderAtTag, renderFontTag, renderInlineAudioTag, renderLinkTag, renderLocalDateTimeTag, renderNumberTag, renderPersonTag, renderTextTag };
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 chunkBI3SOQOF_cjs = require('./chunk-BI3SOQOF.cjs');
5
- var chunkADPNWRSB_cjs = require('./chunk-ADPNWRSB.cjs');
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 = `${chunkBI3SOQOF_cjs.CLS}-base-styles`;
9
- var ICON_FONT_STYLE_ID = `${chunkBI3SOQOF_cjs.CLS}-icon-font`;
10
- var EMOJI_SPRITE_STYLE_ID = `${chunkBI3SOQOF_cjs.CLS}-emoji-sprite`;
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 = chunkBI3SOQOF_cjs.vnodeToDom(
30
- chunkBI3SOQOF_cjs.buildCardVNode(card, { ...options, injectAssets: (asset) => injectAssets(doc, asset) }),
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
- chunkBI3SOQOF_cjs.hydrateFeishuAudios(dom);
36
- chunkBI3SOQOF_cjs.hydrateFeishuTablePagers(dom);
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(chunkADPNWRSB_cjs.dslToRaw(dsl), options);
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-ZX4N4AUP.js';
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 chunkOHQIQTRR_cjs = require('./chunk-OHQIQTRR.cjs');
4
- var chunk4VLXPDHK_cjs = require('./chunk-4VLXPDHK.cjs');
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 = chunkOHQIQTRR_cjs.checkSource(source);
32
- const parsed = chunkOHQIQTRR_cjs.parse(source);
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 = chunk4VLXPDHK_cjs.CARD_TOP_LEVEL_KEYS.map((key) => ({
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 = chunk4VLXPDHK_cjs.CARD_ELEMENT_TAGS.map((tag) => ({
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 = chunkOHQIQTRR_cjs.parse(source);
133
- const resolved = chunkOHQIQTRR_cjs.resolveCardDocument(parsed);
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 } = chunkOHQIQTRR_cjs.sanitize(resolved.cardData, { mode: "strip" });
135
+ const { stripped, card } = chunkZWTPTIAH_cjs.sanitize(resolved.cardData, { mode: "strip" });
136
136
  if (stripped.length === 0) return void 0;
137
- const output = chunkOHQIQTRR_cjs.serializeCardDocument(resolved, card);
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-BMD67L5A.js';
2
- import { CARD_TOP_LEVEL_KEYS, CARD_ELEMENT_TAGS } from './chunk-33T4REBK.js';
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) {