@open-feishu-card/adapter 0.3.5 → 0.3.6
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/dsl-to-raw.d.ts.map +1 -1
- package/dist/expand-dsl-colors.d.ts +24 -0
- package/dist/expand-dsl-colors.d.ts.map +1 -0
- package/dist/index.cjs +212 -129
- package/dist/index.js +212 -129
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/dsl-to-raw.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dsl-to-raw.d.ts","sourceRoot":"","sources":["../src/dsl-to-raw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAgC,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"dsl-to-raw.d.ts","sourceRoot":"","sources":["../src/dsl-to-raw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAgC,QAAQ,EAAE,MAAM,YAAY,CAAC;AAwCzE,gCAAgC;AAChC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAW/C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSL config.style.color 中的 cus-* 别名在 dslToRaw 时展开为渲染器已支持的
|
|
3
|
+
* customBackgroundStyle / textStyle.customColor(对齐飞书 RAW 真机字段)。
|
|
4
|
+
*/
|
|
5
|
+
import type { CardElement, TextStyle } from './types.js';
|
|
6
|
+
export type CustomColorEntry = {
|
|
7
|
+
light_mode: string;
|
|
8
|
+
dark_mode: string;
|
|
9
|
+
};
|
|
10
|
+
export type ColorRegistry = Record<string, CustomColorEntry>;
|
|
11
|
+
export declare function readColorRegistry(card: Record<string, unknown>): ColorRegistry;
|
|
12
|
+
export declare function isCustomColorAlias(value: unknown): value is string;
|
|
13
|
+
/** column / column_set background_style cus-N → customBackgroundStyle */
|
|
14
|
+
export declare function expandBackgroundStyleAlias(style: unknown, registry: ColorRegistry): {
|
|
15
|
+
light_mode: string;
|
|
16
|
+
dark_mode: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
/** textStyle.color cus-N → customColor(去掉 color,避免被当成命名色) */
|
|
19
|
+
export declare function expandTextStyleColor(textStyle: TextStyle | undefined, registry: ColorRegistry): TextStyle | undefined;
|
|
20
|
+
/** 递归展开 markdown 子树里的 cus-* 文字色 */
|
|
21
|
+
export declare function expandMarkdownElements(elements: CardElement[] | undefined, registry: ColorRegistry): CardElement[] | undefined;
|
|
22
|
+
/** markdown.font_color 且 content 无 <font> 时,包一层 font 再解析 */
|
|
23
|
+
export declare function wrapMarkdownContentWithFontColor(content: string, fontColor: string | undefined): string;
|
|
24
|
+
//# sourceMappingURL=expand-dsl-colors.d.ts.map
|
|
@@ -0,0 +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"}
|