@open-feishu-card/adapter 0.3.6 → 0.3.9

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.
@@ -23,4 +23,6 @@ export declare function resolveTextStyleCustomColorPair(textStyle: unknown): The
23
23
  export declare function themePairToColorEntry(pair: ThemeColorPair): CustomColorEntry | undefined;
24
24
  /** Light hex/rgba from column (or container) custom background, if any. */
25
25
  export declare function resolveCustomBackgroundLight(property: unknown): string | undefined;
26
+ /** Light hex/rgba from interactive_container custom border color, if any. */
27
+ export declare function resolveCustomBorderLight(property: unknown): string | undefined;
26
28
  //# sourceMappingURL=custom-colors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-colors.d.ts","sourceRoot":"","sources":["../src/custom-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO5E;AAED,0FAA0F;AAC1F,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAQ9F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,GAAG,SAAS,CAQxF;AAED,2EAA2E;AAC3E,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKlF"}
1
+ {"version":3,"file":"custom-colors.d.ts","sourceRoot":"","sources":["../src/custom-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO5E;AAED,0FAA0F;AAC1F,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAQ9F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,GAAG,SAAS,CAQxF;AAED,2EAA2E;AAC3E,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKlF;AAED,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAK9E"}
@@ -17,7 +17,12 @@ export declare function expandBackgroundStyleAlias(style: unknown, registry: Col
17
17
  } | undefined;
18
18
  /** textStyle.color cus-N → customColor(去掉 color,避免被当成命名色) */
19
19
  export declare function expandTextStyleColor(textStyle: TextStyle | undefined, registry: ColorRegistry): TextStyle | undefined;
20
- /** 递归展开 markdown 子树里的 cus-* 文字色 */
20
+ /** border_color / background_style 等 cus-N → customBackgroundStyle 形态(供 RAW 渲染器读取) */
21
+ export declare function expandColorAlias(style: unknown, registry: ColorRegistry): {
22
+ light_mode: string;
23
+ dark_mode: string;
24
+ } | undefined;
25
+ /** 递归展开 markdown / list 子树里的 cus-* 文字色 */
21
26
  export declare function expandMarkdownElements(elements: CardElement[] | undefined, registry: ColorRegistry): CardElement[] | undefined;
22
27
  /** markdown.font_color 且 content 无 <font> 时,包一层 font 再解析 */
23
28
  export declare function wrapMarkdownContentWithFontColor(content: string, fontColor: string | undefined): string;
@@ -1 +1 @@
1
- {"version":3,"file":"expand-dsl-colors.d.ts","sourceRoot":"","sources":["../src/expand-dsl-colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE7D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAiB9E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAElE;AAED,yEAAyE;AACzE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,GACtB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAKvD;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,QAAQ,EAAE,aAAa,GACtB,SAAS,GAAG,SAAS,CAWvB;AAED,mCAAmC;AACnC,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,EAAE,GAAG,SAAS,EACnC,QAAQ,EAAE,aAAa,GACtB,WAAW,EAAE,GAAG,SAAS,CAc3B;AAED,4DAA4D;AAC5D,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,CAGR"}
1
+ {"version":3,"file":"expand-dsl-colors.d.ts","sourceRoot":"","sources":["../src/expand-dsl-colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE7D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAiB9E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAElE;AAED,yEAAyE;AACzE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,GACtB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAKvD;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,QAAQ,EAAE,aAAa,GACtB,SAAS,GAAG,SAAS,CAWvB;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,GACtB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAEvD;AAED,0CAA0C;AAC1C,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,WAAW,EAAE,GAAG,SAAS,EACnC,QAAQ,EAAE,aAAa,GACtB,WAAW,EAAE,GAAG,SAAS,CAG3B;AAuCD,4DAA4D;AAC5D,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,CAGR"}
package/dist/index.cjs CHANGED
@@ -644,18 +644,38 @@ function expandTextStyleColor(textStyle, registry) {
644
644
  }
645
645
  function expandMarkdownElements(elements, registry) {
646
646
  if (!Array.isArray(elements)) return elements;
647
- return elements.map((el) => {
648
- const property = el.property ? { ...el.property } : void 0;
649
- if (!property) return el;
650
- if (Array.isArray(property.elements)) {
651
- property.elements = expandMarkdownElements(property.elements, registry);
652
- }
653
- if (property.textStyle) {
654
- const expanded = expandTextStyleColor(property.textStyle, registry);
655
- if (expanded) property.textStyle = expanded;
647
+ return elements.map((el) => expandMarkdownNode(el, registry));
648
+ }
649
+ function expandMarkdownNode(el, registry) {
650
+ const property = el.property ? { ...el.property } : void 0;
651
+ if (!property) return el;
652
+ let changed = property !== el.property;
653
+ if (Array.isArray(property.elements)) {
654
+ const next = expandMarkdownElements(property.elements, registry);
655
+ if (next !== property.elements) {
656
+ property.elements = next;
657
+ changed = true;
658
+ }
659
+ }
660
+ if (Array.isArray(property.items)) {
661
+ property.items = property.items.map((item) => {
662
+ if (!item || typeof item !== "object") return item;
663
+ const row = item;
664
+ if (!Array.isArray(row.elements)) return item;
665
+ const next = expandMarkdownElements(row.elements, registry);
666
+ if (next === row.elements) return item;
667
+ return { ...row, elements: next };
668
+ });
669
+ changed = true;
670
+ }
671
+ if (property.textStyle) {
672
+ const expanded = expandTextStyleColor(property.textStyle, registry);
673
+ if (expanded && expanded !== property.textStyle) {
674
+ property.textStyle = expanded;
675
+ changed = true;
656
676
  }
657
- return property === el.property ? el : { ...el, property };
658
- });
677
+ }
678
+ return changed ? { ...el, property } : el;
659
679
  }
660
680
  function wrapMarkdownContentWithFontColor(content, fontColor) {
661
681
  if (!fontColor || !content || /<font\s+color/i.test(content)) return content;
@@ -830,6 +850,18 @@ function buildProperty(el, tag, colors) {
830
850
  if (expanded) property.customBackgroundStyle = expanded;
831
851
  continue;
832
852
  }
853
+ if ((k === "border_color" || k === "borderColor") && tag === "interactive_container") {
854
+ const renamed = renameKey(k);
855
+ property[renamed] = v;
856
+ const expanded = expandBackgroundStyleAlias(v, colors);
857
+ if (expanded) {
858
+ property.customBorderColor = {
859
+ lightMode: expanded.light_mode,
860
+ darkMode: expanded.dark_mode
861
+ };
862
+ }
863
+ continue;
864
+ }
833
865
  if (tag === "column" && k === "width" && typeof v === "string") {
834
866
  const px = pxValue(v);
835
867
  if (px != null) {
@@ -953,18 +985,19 @@ function isRecord2(v) {
953
985
 
954
986
  // src/normalize-stored-colors.ts
955
987
  function createColorRegistry() {
956
- return { entries: {}, keyToAlias: /* @__PURE__ */ new Map(), bgSeq: 0, textSeq: 0 };
988
+ return { entries: {}, bgKeyToAlias: /* @__PURE__ */ new Map(), textKeyToAlias: /* @__PURE__ */ new Map(), bgSeq: 0, textSeq: 0 };
957
989
  }
958
990
  function colorEntryKey(entry) {
959
991
  return `${entry.light_mode}|${entry.dark_mode}`;
960
992
  }
961
993
  function registerColorEntry(registry, entry, prefix) {
962
994
  const key = colorEntryKey(entry);
963
- const existing = registry.keyToAlias.get(key);
995
+ const map = prefix === "cus-bg" ? registry.bgKeyToAlias : registry.textKeyToAlias;
996
+ const existing = map.get(key);
964
997
  if (existing) return existing;
965
998
  const alias = prefix === "cus-bg" ? `cus-bg-${registry.bgSeq++}` : `cus-text-${registry.textSeq++}`;
966
999
  registry.entries[alias] = entry;
967
- registry.keyToAlias.set(key, alias);
1000
+ map.set(key, alias);
968
1001
  return alias;
969
1002
  }
970
1003
  function hexColorToRgba(hex) {
@@ -984,29 +1017,69 @@ function hexColorToRgba(hex) {
984
1017
  }
985
1018
  return void 0;
986
1019
  }
987
- function readCustomBackgroundStyle(node) {
988
- const raw = node.custom_background_style;
1020
+ function readThemeColorPair(raw) {
989
1021
  if (!raw || typeof raw !== "object") return void 0;
990
1022
  const o = raw;
991
- const lightRaw = typeof o.light_mode === "string" ? o.light_mode : void 0;
992
- const darkRaw = typeof o.dark_mode === "string" ? o.dark_mode : void 0;
1023
+ const lightRaw = typeof o.light_mode === "string" ? o.light_mode : typeof o.lightMode === "string" ? o.lightMode : void 0;
1024
+ const darkRaw = typeof o.dark_mode === "string" ? o.dark_mode : typeof o.darkMode === "string" ? o.darkMode : void 0;
993
1025
  if (!lightRaw || !darkRaw) return void 0;
994
1026
  const light = lightRaw.startsWith("#") ? hexColorToRgba(lightRaw) : lightRaw;
995
1027
  const dark = darkRaw.startsWith("#") ? hexColorToRgba(darkRaw) : darkRaw;
996
1028
  if (!light || !dark) return void 0;
997
1029
  return { light_mode: light, dark_mode: dark };
998
1030
  }
1031
+ function readCustomBackgroundStyle(node) {
1032
+ return readThemeColorPair(node.custom_background_style);
1033
+ }
1034
+ function readCustomBorderColor(node) {
1035
+ return readThemeColorPair(node.custom_border_color ?? node.customBorderColor);
1036
+ }
1037
+ function seedRegistryFromConfigStyle(dsl, colorEntries, bgKeyToAlias, textKeyToAlias) {
1038
+ let bgSeq = 0;
1039
+ let textSeq = 0;
1040
+ const config = dsl.config;
1041
+ if (!config || typeof config !== "object") return { bgSeq, textSeq };
1042
+ const style = config.style;
1043
+ if (!style || typeof style !== "object") return { bgSeq, textSeq };
1044
+ const colors = style.color;
1045
+ if (!colors || typeof colors !== "object") return { bgSeq, textSeq };
1046
+ for (const [alias, entry] of Object.entries(colors)) {
1047
+ if (!entry || typeof entry !== "object") continue;
1048
+ const pair = entry;
1049
+ if (typeof pair.light_mode !== "string" || typeof pair.dark_mode !== "string") continue;
1050
+ const themePair = { light_mode: pair.light_mode, dark_mode: pair.dark_mode };
1051
+ colorEntries[alias] = themePair;
1052
+ const key = colorEntryKey(themePair);
1053
+ if (alias.startsWith("cus-text")) {
1054
+ textKeyToAlias.set(key, alias);
1055
+ const n = /^cus-text-(\d+)$/.exec(alias);
1056
+ if (n) textSeq = Math.max(textSeq, Number(n[1]) + 1);
1057
+ } else {
1058
+ bgKeyToAlias.set(key, alias);
1059
+ const n = /^cus-bg-(\d+)$/.exec(alias);
1060
+ if (n) bgSeq = Math.max(bgSeq, Number(n[1]) + 1);
1061
+ }
1062
+ }
1063
+ return { bgSeq, textSeq };
1064
+ }
999
1065
  function normalizeStoredCardColors(dsl, preRegistered) {
1000
1066
  const colorEntries = { ...preRegistered?.entries ?? {} };
1001
- const keyToAlias = new Map(preRegistered?.keyToAlias ?? []);
1067
+ const bgKeyToAlias = new Map(preRegistered?.bgKeyToAlias ?? []);
1068
+ const textKeyToAlias = new Map(preRegistered?.textKeyToAlias ?? []);
1002
1069
  let bgSeq = preRegistered?.bgSeq ?? 0;
1003
1070
  let textSeq = preRegistered?.textSeq ?? 0;
1071
+ if (!preRegistered) {
1072
+ const seeded = seedRegistryFromConfigStyle(dsl, colorEntries, bgKeyToAlias, textKeyToAlias);
1073
+ bgSeq = Math.max(bgSeq, seeded.bgSeq);
1074
+ textSeq = Math.max(textSeq, seeded.textSeq);
1075
+ }
1004
1076
  const ensureAlias = (prefix, entry) => {
1005
- const existing2 = keyToAlias.get(colorEntryKey(entry));
1077
+ const map = prefix === "cus-bg" ? bgKeyToAlias : textKeyToAlias;
1078
+ const existing2 = map.get(colorEntryKey(entry));
1006
1079
  if (existing2) return existing2;
1007
1080
  const alias = prefix === "cus-bg" ? `cus-bg-${bgSeq++}` : `cus-text-${textSeq++}`;
1008
1081
  colorEntries[alias] = entry;
1009
- keyToAlias.set(colorEntryKey(entry), alias);
1082
+ map.set(colorEntryKey(entry), alias);
1010
1083
  return alias;
1011
1084
  };
1012
1085
  const walk = (node) => {
@@ -1023,6 +1096,19 @@ function normalizeStoredCardColors(dsl, preRegistered) {
1023
1096
  delete obj.custom_background_style;
1024
1097
  }
1025
1098
  }
1099
+ if (obj.tag === "interactive_container") {
1100
+ const customBg = readCustomBackgroundStyle(obj);
1101
+ if (customBg) {
1102
+ obj.background_style = ensureAlias("cus-bg", customBg);
1103
+ delete obj.custom_background_style;
1104
+ }
1105
+ const border = readCustomBorderColor(obj);
1106
+ if (border) {
1107
+ obj.border_color = ensureAlias("cus-bg", border);
1108
+ delete obj.custom_border_color;
1109
+ delete obj.customBorderColor;
1110
+ }
1111
+ }
1026
1112
  if (obj.tag === "markdown" && typeof obj.content === "string") {
1027
1113
  normalizeMarkdownInlineHexColors(obj, ensureAlias, !!preRegistered);
1028
1114
  }
@@ -1067,11 +1153,17 @@ function normalizeStoredCardColors(dsl, preRegistered) {
1067
1153
  }
1068
1154
  if (!node || typeof node !== "object") return;
1069
1155
  const obj = node;
1070
- if (obj.tag === "markdown" && obj.font_color === void 0) {
1071
- const size = obj.text_size;
1072
- const content = typeof obj.content === "string" ? obj.content : "";
1073
- if (size === "small") obj.font_color = "cus-muted";
1074
- else if (size === "heading" || content.includes("**")) obj.font_color = "cus-accent";
1156
+ if (obj.tag === "markdown" && typeof obj.content === "string") {
1157
+ delete obj.font_color;
1158
+ const content = obj.content;
1159
+ if (!/<font\s+color=/i.test(content)) {
1160
+ const size = obj.text_size;
1161
+ if (size === "small") {
1162
+ obj.content = wrapMarkdownContentWithFontColor(content, "cus-muted");
1163
+ } else if (size === "heading" || content.includes("**")) {
1164
+ obj.content = wrapMarkdownContentWithFontColor(content, "cus-accent");
1165
+ }
1166
+ }
1075
1167
  }
1076
1168
  for (const value of Object.values(obj)) applyDefaultFontColors(value);
1077
1169
  };
@@ -1136,8 +1228,8 @@ function normalizeMarkdownInlineHexColors(obj, ensureAlias, keepFontTags = false
1136
1228
  const entry = hexColor(single[1]);
1137
1229
  if (entry) {
1138
1230
  const alias = ensureAlias("cus-text", entry);
1139
- if (obj.font_color === void 0) obj.font_color = alias;
1140
- obj.content = single[2];
1231
+ delete obj.font_color;
1232
+ obj.content = `<font color='${alias}'>${single[2]}</font>`;
1141
1233
  return;
1142
1234
  }
1143
1235
  }
@@ -1202,6 +1294,12 @@ function resolveCustomBackgroundLight(property) {
1202
1294
  const custom = p.custom_background_style ?? p.customBackgroundStyle;
1203
1295
  return readThemeColorLight(custom);
1204
1296
  }
1297
+ function resolveCustomBorderLight(property) {
1298
+ if (!property || typeof property !== "object") return void 0;
1299
+ const p = property;
1300
+ const custom = p.custom_border_color ?? p.customBorderColor;
1301
+ return readThemeColorLight(custom);
1302
+ }
1205
1303
 
1206
1304
  // src/raw-to-dsl.ts
1207
1305
  function isRawCardEnvelope(value) {
@@ -1321,8 +1419,39 @@ function convertRoot(root, ctx) {
1321
1419
  normalizeStoredCardColors(out, ctx.colors);
1322
1420
  return out;
1323
1421
  }
1324
- function convertConfig(_node) {
1325
- return { update_multi: true };
1422
+ function convertConfig(node) {
1423
+ const out = { update_multi: true };
1424
+ if (node.streamingMode === true || node.streaming_mode === true) {
1425
+ out.streaming_mode = true;
1426
+ }
1427
+ if (node.enableForwardInteraction === true || node.enable_forward_interaction === true) {
1428
+ out.enable_forward_interaction = true;
1429
+ }
1430
+ if (node.enableForward === false || node.enable_forward === false) {
1431
+ out.enable_forward = false;
1432
+ }
1433
+ if (typeof node.widthMode === "string") out.width_mode = node.widthMode;
1434
+ else if (typeof node.width_mode === "string") out.width_mode = node.width_mode;
1435
+ const summaryRaw = isRecord3(node.summary) ? node.summary : void 0;
1436
+ if (summaryRaw) {
1437
+ const summary = {};
1438
+ if (typeof summaryRaw.content === "string") summary.content = summaryRaw.content;
1439
+ if (isRecord3(summaryRaw.i18nContent)) summary.i18n_content = summaryRaw.i18nContent;
1440
+ else if (isRecord3(summaryRaw.i18n_content)) summary.i18n_content = summaryRaw.i18n_content;
1441
+ if (Object.keys(summary).length) out.summary = summary;
1442
+ }
1443
+ const streamingRaw = isRecord3(node.streamingConfig) ? node.streamingConfig : isRecord3(node.streaming_config) ? node.streaming_config : void 0;
1444
+ if (streamingRaw) {
1445
+ const sc = {};
1446
+ if (streamingRaw.printStrategy != null) sc.print_strategy = streamingRaw.printStrategy;
1447
+ else if (streamingRaw.print_strategy != null) sc.print_strategy = streamingRaw.print_strategy;
1448
+ if (streamingRaw.printFrequencyMs != null) sc.print_frequency_ms = streamingRaw.printFrequencyMs;
1449
+ else if (streamingRaw.print_frequency_ms != null) sc.print_frequency_ms = streamingRaw.print_frequency_ms;
1450
+ if (streamingRaw.printStep != null) sc.print_step = streamingRaw.printStep;
1451
+ else if (streamingRaw.print_step != null) sc.print_step = streamingRaw.print_step;
1452
+ if (Object.keys(sc).length) out.streaming_config = sc;
1453
+ }
1454
+ return out;
1326
1455
  }
1327
1456
  function convertHeader2(node, ctx) {
1328
1457
  const property = isRecord3(node.property) ? node.property : node;
@@ -2238,6 +2367,7 @@ exports.readThemeColorDark = readThemeColorDark;
2238
2367
  exports.readThemeColorLight = readThemeColorLight;
2239
2368
  exports.registerColorEntry = registerColorEntry;
2240
2369
  exports.resolveCustomBackgroundLight = resolveCustomBackgroundLight;
2370
+ exports.resolveCustomBorderLight = resolveCustomBorderLight;
2241
2371
  exports.resolveTextStyleColor = resolveTextStyleColor;
2242
2372
  exports.resolveTextStyleCustomColorPair = resolveTextStyleCustomColorPair;
2243
2373
  exports.themePairToColorEntry = themePairToColorEntry;
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export { dslToRaw } from './dsl-to-raw.js';
10
10
  export { rawToDsl, rawCardToDsl, isRawCardEnvelope, degradeUnknown, } from './raw-to-dsl.js';
11
11
  export { normalizeStoredCardColors, createColorRegistry, registerColorEntry } from './normalize-stored-colors.js';
12
12
  export type { CustomColorEntry } from './normalize-stored-colors.js';
13
- export { readThemeColorLight, readThemeColorDark, resolveCustomBackgroundLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry, isCustomHexColor, } from './custom-colors.js';
13
+ export { readThemeColorLight, readThemeColorDark, resolveCustomBackgroundLight, resolveCustomBorderLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry, isCustomHexColor, } from './custom-colors.js';
14
14
  export type { ThemeColorPair } from './custom-colors.js';
15
15
  export type { CardElement, ElementProperty, JsonCard } from './types.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClH,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClH,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,wBAAwB,EACxB,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -642,18 +642,38 @@ function expandTextStyleColor(textStyle, registry) {
642
642
  }
643
643
  function expandMarkdownElements(elements, registry) {
644
644
  if (!Array.isArray(elements)) return elements;
645
- return elements.map((el) => {
646
- const property = el.property ? { ...el.property } : void 0;
647
- if (!property) return el;
648
- if (Array.isArray(property.elements)) {
649
- property.elements = expandMarkdownElements(property.elements, registry);
650
- }
651
- if (property.textStyle) {
652
- const expanded = expandTextStyleColor(property.textStyle, registry);
653
- if (expanded) property.textStyle = expanded;
645
+ return elements.map((el) => expandMarkdownNode(el, registry));
646
+ }
647
+ function expandMarkdownNode(el, registry) {
648
+ const property = el.property ? { ...el.property } : void 0;
649
+ if (!property) return el;
650
+ let changed = property !== el.property;
651
+ if (Array.isArray(property.elements)) {
652
+ const next = expandMarkdownElements(property.elements, registry);
653
+ if (next !== property.elements) {
654
+ property.elements = next;
655
+ changed = true;
656
+ }
657
+ }
658
+ if (Array.isArray(property.items)) {
659
+ property.items = property.items.map((item) => {
660
+ if (!item || typeof item !== "object") return item;
661
+ const row = item;
662
+ if (!Array.isArray(row.elements)) return item;
663
+ const next = expandMarkdownElements(row.elements, registry);
664
+ if (next === row.elements) return item;
665
+ return { ...row, elements: next };
666
+ });
667
+ changed = true;
668
+ }
669
+ if (property.textStyle) {
670
+ const expanded = expandTextStyleColor(property.textStyle, registry);
671
+ if (expanded && expanded !== property.textStyle) {
672
+ property.textStyle = expanded;
673
+ changed = true;
654
674
  }
655
- return property === el.property ? el : { ...el, property };
656
- });
675
+ }
676
+ return changed ? { ...el, property } : el;
657
677
  }
658
678
  function wrapMarkdownContentWithFontColor(content, fontColor) {
659
679
  if (!fontColor || !content || /<font\s+color/i.test(content)) return content;
@@ -828,6 +848,18 @@ function buildProperty(el, tag, colors) {
828
848
  if (expanded) property.customBackgroundStyle = expanded;
829
849
  continue;
830
850
  }
851
+ if ((k === "border_color" || k === "borderColor") && tag === "interactive_container") {
852
+ const renamed = renameKey(k);
853
+ property[renamed] = v;
854
+ const expanded = expandBackgroundStyleAlias(v, colors);
855
+ if (expanded) {
856
+ property.customBorderColor = {
857
+ lightMode: expanded.light_mode,
858
+ darkMode: expanded.dark_mode
859
+ };
860
+ }
861
+ continue;
862
+ }
831
863
  if (tag === "column" && k === "width" && typeof v === "string") {
832
864
  const px = pxValue(v);
833
865
  if (px != null) {
@@ -951,18 +983,19 @@ function isRecord2(v) {
951
983
 
952
984
  // src/normalize-stored-colors.ts
953
985
  function createColorRegistry() {
954
- return { entries: {}, keyToAlias: /* @__PURE__ */ new Map(), bgSeq: 0, textSeq: 0 };
986
+ return { entries: {}, bgKeyToAlias: /* @__PURE__ */ new Map(), textKeyToAlias: /* @__PURE__ */ new Map(), bgSeq: 0, textSeq: 0 };
955
987
  }
956
988
  function colorEntryKey(entry) {
957
989
  return `${entry.light_mode}|${entry.dark_mode}`;
958
990
  }
959
991
  function registerColorEntry(registry, entry, prefix) {
960
992
  const key = colorEntryKey(entry);
961
- const existing = registry.keyToAlias.get(key);
993
+ const map = prefix === "cus-bg" ? registry.bgKeyToAlias : registry.textKeyToAlias;
994
+ const existing = map.get(key);
962
995
  if (existing) return existing;
963
996
  const alias = prefix === "cus-bg" ? `cus-bg-${registry.bgSeq++}` : `cus-text-${registry.textSeq++}`;
964
997
  registry.entries[alias] = entry;
965
- registry.keyToAlias.set(key, alias);
998
+ map.set(key, alias);
966
999
  return alias;
967
1000
  }
968
1001
  function hexColorToRgba(hex) {
@@ -982,29 +1015,69 @@ function hexColorToRgba(hex) {
982
1015
  }
983
1016
  return void 0;
984
1017
  }
985
- function readCustomBackgroundStyle(node) {
986
- const raw = node.custom_background_style;
1018
+ function readThemeColorPair(raw) {
987
1019
  if (!raw || typeof raw !== "object") return void 0;
988
1020
  const o = raw;
989
- const lightRaw = typeof o.light_mode === "string" ? o.light_mode : void 0;
990
- const darkRaw = typeof o.dark_mode === "string" ? o.dark_mode : void 0;
1021
+ const lightRaw = typeof o.light_mode === "string" ? o.light_mode : typeof o.lightMode === "string" ? o.lightMode : void 0;
1022
+ const darkRaw = typeof o.dark_mode === "string" ? o.dark_mode : typeof o.darkMode === "string" ? o.darkMode : void 0;
991
1023
  if (!lightRaw || !darkRaw) return void 0;
992
1024
  const light = lightRaw.startsWith("#") ? hexColorToRgba(lightRaw) : lightRaw;
993
1025
  const dark = darkRaw.startsWith("#") ? hexColorToRgba(darkRaw) : darkRaw;
994
1026
  if (!light || !dark) return void 0;
995
1027
  return { light_mode: light, dark_mode: dark };
996
1028
  }
1029
+ function readCustomBackgroundStyle(node) {
1030
+ return readThemeColorPair(node.custom_background_style);
1031
+ }
1032
+ function readCustomBorderColor(node) {
1033
+ return readThemeColorPair(node.custom_border_color ?? node.customBorderColor);
1034
+ }
1035
+ function seedRegistryFromConfigStyle(dsl, colorEntries, bgKeyToAlias, textKeyToAlias) {
1036
+ let bgSeq = 0;
1037
+ let textSeq = 0;
1038
+ const config = dsl.config;
1039
+ if (!config || typeof config !== "object") return { bgSeq, textSeq };
1040
+ const style = config.style;
1041
+ if (!style || typeof style !== "object") return { bgSeq, textSeq };
1042
+ const colors = style.color;
1043
+ if (!colors || typeof colors !== "object") return { bgSeq, textSeq };
1044
+ for (const [alias, entry] of Object.entries(colors)) {
1045
+ if (!entry || typeof entry !== "object") continue;
1046
+ const pair = entry;
1047
+ if (typeof pair.light_mode !== "string" || typeof pair.dark_mode !== "string") continue;
1048
+ const themePair = { light_mode: pair.light_mode, dark_mode: pair.dark_mode };
1049
+ colorEntries[alias] = themePair;
1050
+ const key = colorEntryKey(themePair);
1051
+ if (alias.startsWith("cus-text")) {
1052
+ textKeyToAlias.set(key, alias);
1053
+ const n = /^cus-text-(\d+)$/.exec(alias);
1054
+ if (n) textSeq = Math.max(textSeq, Number(n[1]) + 1);
1055
+ } else {
1056
+ bgKeyToAlias.set(key, alias);
1057
+ const n = /^cus-bg-(\d+)$/.exec(alias);
1058
+ if (n) bgSeq = Math.max(bgSeq, Number(n[1]) + 1);
1059
+ }
1060
+ }
1061
+ return { bgSeq, textSeq };
1062
+ }
997
1063
  function normalizeStoredCardColors(dsl, preRegistered) {
998
1064
  const colorEntries = { ...preRegistered?.entries ?? {} };
999
- const keyToAlias = new Map(preRegistered?.keyToAlias ?? []);
1065
+ const bgKeyToAlias = new Map(preRegistered?.bgKeyToAlias ?? []);
1066
+ const textKeyToAlias = new Map(preRegistered?.textKeyToAlias ?? []);
1000
1067
  let bgSeq = preRegistered?.bgSeq ?? 0;
1001
1068
  let textSeq = preRegistered?.textSeq ?? 0;
1069
+ if (!preRegistered) {
1070
+ const seeded = seedRegistryFromConfigStyle(dsl, colorEntries, bgKeyToAlias, textKeyToAlias);
1071
+ bgSeq = Math.max(bgSeq, seeded.bgSeq);
1072
+ textSeq = Math.max(textSeq, seeded.textSeq);
1073
+ }
1002
1074
  const ensureAlias = (prefix, entry) => {
1003
- const existing2 = keyToAlias.get(colorEntryKey(entry));
1075
+ const map = prefix === "cus-bg" ? bgKeyToAlias : textKeyToAlias;
1076
+ const existing2 = map.get(colorEntryKey(entry));
1004
1077
  if (existing2) return existing2;
1005
1078
  const alias = prefix === "cus-bg" ? `cus-bg-${bgSeq++}` : `cus-text-${textSeq++}`;
1006
1079
  colorEntries[alias] = entry;
1007
- keyToAlias.set(colorEntryKey(entry), alias);
1080
+ map.set(colorEntryKey(entry), alias);
1008
1081
  return alias;
1009
1082
  };
1010
1083
  const walk = (node) => {
@@ -1021,6 +1094,19 @@ function normalizeStoredCardColors(dsl, preRegistered) {
1021
1094
  delete obj.custom_background_style;
1022
1095
  }
1023
1096
  }
1097
+ if (obj.tag === "interactive_container") {
1098
+ const customBg = readCustomBackgroundStyle(obj);
1099
+ if (customBg) {
1100
+ obj.background_style = ensureAlias("cus-bg", customBg);
1101
+ delete obj.custom_background_style;
1102
+ }
1103
+ const border = readCustomBorderColor(obj);
1104
+ if (border) {
1105
+ obj.border_color = ensureAlias("cus-bg", border);
1106
+ delete obj.custom_border_color;
1107
+ delete obj.customBorderColor;
1108
+ }
1109
+ }
1024
1110
  if (obj.tag === "markdown" && typeof obj.content === "string") {
1025
1111
  normalizeMarkdownInlineHexColors(obj, ensureAlias, !!preRegistered);
1026
1112
  }
@@ -1065,11 +1151,17 @@ function normalizeStoredCardColors(dsl, preRegistered) {
1065
1151
  }
1066
1152
  if (!node || typeof node !== "object") return;
1067
1153
  const obj = node;
1068
- if (obj.tag === "markdown" && obj.font_color === void 0) {
1069
- const size = obj.text_size;
1070
- const content = typeof obj.content === "string" ? obj.content : "";
1071
- if (size === "small") obj.font_color = "cus-muted";
1072
- else if (size === "heading" || content.includes("**")) obj.font_color = "cus-accent";
1154
+ if (obj.tag === "markdown" && typeof obj.content === "string") {
1155
+ delete obj.font_color;
1156
+ const content = obj.content;
1157
+ if (!/<font\s+color=/i.test(content)) {
1158
+ const size = obj.text_size;
1159
+ if (size === "small") {
1160
+ obj.content = wrapMarkdownContentWithFontColor(content, "cus-muted");
1161
+ } else if (size === "heading" || content.includes("**")) {
1162
+ obj.content = wrapMarkdownContentWithFontColor(content, "cus-accent");
1163
+ }
1164
+ }
1073
1165
  }
1074
1166
  for (const value of Object.values(obj)) applyDefaultFontColors(value);
1075
1167
  };
@@ -1134,8 +1226,8 @@ function normalizeMarkdownInlineHexColors(obj, ensureAlias, keepFontTags = false
1134
1226
  const entry = hexColor(single[1]);
1135
1227
  if (entry) {
1136
1228
  const alias = ensureAlias("cus-text", entry);
1137
- if (obj.font_color === void 0) obj.font_color = alias;
1138
- obj.content = single[2];
1229
+ delete obj.font_color;
1230
+ obj.content = `<font color='${alias}'>${single[2]}</font>`;
1139
1231
  return;
1140
1232
  }
1141
1233
  }
@@ -1200,6 +1292,12 @@ function resolveCustomBackgroundLight(property) {
1200
1292
  const custom = p.custom_background_style ?? p.customBackgroundStyle;
1201
1293
  return readThemeColorLight(custom);
1202
1294
  }
1295
+ function resolveCustomBorderLight(property) {
1296
+ if (!property || typeof property !== "object") return void 0;
1297
+ const p = property;
1298
+ const custom = p.custom_border_color ?? p.customBorderColor;
1299
+ return readThemeColorLight(custom);
1300
+ }
1203
1301
 
1204
1302
  // src/raw-to-dsl.ts
1205
1303
  function isRawCardEnvelope(value) {
@@ -1319,8 +1417,39 @@ function convertRoot(root, ctx) {
1319
1417
  normalizeStoredCardColors(out, ctx.colors);
1320
1418
  return out;
1321
1419
  }
1322
- function convertConfig(_node) {
1323
- return { update_multi: true };
1420
+ function convertConfig(node) {
1421
+ const out = { update_multi: true };
1422
+ if (node.streamingMode === true || node.streaming_mode === true) {
1423
+ out.streaming_mode = true;
1424
+ }
1425
+ if (node.enableForwardInteraction === true || node.enable_forward_interaction === true) {
1426
+ out.enable_forward_interaction = true;
1427
+ }
1428
+ if (node.enableForward === false || node.enable_forward === false) {
1429
+ out.enable_forward = false;
1430
+ }
1431
+ if (typeof node.widthMode === "string") out.width_mode = node.widthMode;
1432
+ else if (typeof node.width_mode === "string") out.width_mode = node.width_mode;
1433
+ const summaryRaw = isRecord3(node.summary) ? node.summary : void 0;
1434
+ if (summaryRaw) {
1435
+ const summary = {};
1436
+ if (typeof summaryRaw.content === "string") summary.content = summaryRaw.content;
1437
+ if (isRecord3(summaryRaw.i18nContent)) summary.i18n_content = summaryRaw.i18nContent;
1438
+ else if (isRecord3(summaryRaw.i18n_content)) summary.i18n_content = summaryRaw.i18n_content;
1439
+ if (Object.keys(summary).length) out.summary = summary;
1440
+ }
1441
+ const streamingRaw = isRecord3(node.streamingConfig) ? node.streamingConfig : isRecord3(node.streaming_config) ? node.streaming_config : void 0;
1442
+ if (streamingRaw) {
1443
+ const sc = {};
1444
+ if (streamingRaw.printStrategy != null) sc.print_strategy = streamingRaw.printStrategy;
1445
+ else if (streamingRaw.print_strategy != null) sc.print_strategy = streamingRaw.print_strategy;
1446
+ if (streamingRaw.printFrequencyMs != null) sc.print_frequency_ms = streamingRaw.printFrequencyMs;
1447
+ else if (streamingRaw.print_frequency_ms != null) sc.print_frequency_ms = streamingRaw.print_frequency_ms;
1448
+ if (streamingRaw.printStep != null) sc.print_step = streamingRaw.printStep;
1449
+ else if (streamingRaw.print_step != null) sc.print_step = streamingRaw.print_step;
1450
+ if (Object.keys(sc).length) out.streaming_config = sc;
1451
+ }
1452
+ return out;
1324
1453
  }
1325
1454
  function convertHeader2(node, ctx) {
1326
1455
  const property = isRecord3(node.property) ? node.property : node;
@@ -2224,4 +2353,4 @@ function degradeUnknown(el) {
2224
2353
  return { tag: "unknown", raw_tag: rawTag, fallback: el };
2225
2354
  }
2226
2355
 
2227
- export { createColorRegistry, degradeUnknown, dslToRaw, isCustomHexColor, isRawCardEnvelope, normalizeStoredCardColors, rawCardToDsl, rawToDsl, readThemeColorDark, readThemeColorLight, registerColorEntry, resolveCustomBackgroundLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry };
2356
+ export { createColorRegistry, degradeUnknown, dslToRaw, isCustomHexColor, isRawCardEnvelope, normalizeStoredCardColors, rawCardToDsl, rawToDsl, readThemeColorDark, readThemeColorLight, registerColorEntry, resolveCustomBackgroundLight, resolveCustomBorderLight, resolveTextStyleColor, resolveTextStyleCustomColorPair, themePairToColorEntry };
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 飞书存储卡片时会将 config.style.color 的 cus-N 展开为 custom_background_style(#RRGGBBAA),
3
- * 并丢弃 config.style 与 markdown.font_color。回读底稿后须 normalize,否则 modify 再发会丢色。
3
+ * 并丢弃 config.style 与 markdown 内联字色。回读底稿后须 normalize,否则 modify 再发会丢色。
4
+ * 公开 DSL 用 content 内 <font color='cus-N'> 表达字色(飞书发送接口不接受 markdown.font_color)。
4
5
  */
5
6
  export type CustomColorEntry = {
6
7
  light_mode: string;
@@ -8,7 +9,9 @@ export type CustomColorEntry = {
8
9
  };
9
10
  export type ColorRegistry = {
10
11
  entries: Record<string, CustomColorEntry>;
11
- keyToAlias: Map<string, string>;
12
+ /** 背景/边框等同色复用 cus-bg-N,与文字 cus-text-N 分表,避免串 alias */
13
+ bgKeyToAlias: Map<string, string>;
14
+ textKeyToAlias: Map<string, string>;
12
15
  bgSeq: number;
13
16
  textSeq: number;
14
17
  };
@@ -18,7 +21,7 @@ export declare function registerColorEntry(registry: ColorRegistry, entry: Custo
18
21
  export declare function hexColorToRgba(hex: string): string | undefined;
19
22
  /**
20
23
  * 将飞书回读的 custom_background_style 还原为可再次发送的 background_style cus-N + config.style.color。
21
- * 若 markdown 缺少 font_color,按 text_size / 加粗内容补 cus-accent / cus-muted(飞书回读会丢 font_color)。
24
+ * 若 markdown 缺少内联字色,按 text_size / 加粗内容补 <font color='cus-accent'|'cus-muted'>(飞书回读会丢字色)。
22
25
  * rawToDsl 可传入已登记的文字自定义色(preRegistered),与背景色一并写入 config.style.color。
23
26
  */
24
27
  export declare function normalizeStoredCardColors(dsl: Record<string, unknown>, preRegistered?: ColorRegistry): void;
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-stored-colors.d.ts","sourceRoot":"","sources":["../src/normalize-stored-colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAE7D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAC5B,MAAM,CAUR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgB9D;AAiBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAmGN"}
1
+ {"version":3,"file":"normalize-stored-colors.d.ts","sourceRoot":"","sources":["../src/normalize-stored-colors.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,sDAAsD;IACtD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAE7D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAC5B,MAAM,CAWR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgB9D;AA8DD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CA+HN"}
@@ -1 +1 @@
1
- {"version":3,"file":"raw-to-dsl.d.ts","sourceRoot":"","sources":["../src/raw-to-dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAwBH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAcvD;AAojDD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8C9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGnF"}
1
+ {"version":3,"file":"raw-to-dsl.d.ts","sourceRoot":"","sources":["../src/raw-to-dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAwBH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAcvD;AAylDD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8C9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGnF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-feishu-card/adapter",
3
- "version": "0.3.6",
3
+ "version": "0.3.9",
4
4
  "description": "公开 DSL 与飞书内部 RAW JSON 的双向适配器;raw→DSL 对齐 feishu-raw-card-to-dsl",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",