@chatbi-v/xcml 2.0.0 → 2.1.0

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/index.d.cts CHANGED
@@ -397,6 +397,40 @@ declare function toXCMLNodeFromElement(name: string, attrs: Record<string, any>,
397
397
  */
398
398
  declare function preprocessXCML(md: string, knownTags?: string[]): string;
399
399
 
400
+ interface XTagPluginOptions {
401
+ /**
402
+ * 允许的标签名称列表,不包含前缀 'x-'
403
+ * @default ['chart', 'table', 'metric', 'list', 'card', 'toc']
404
+ */
405
+ tags?: string[];
406
+ }
407
+ /**
408
+ * 插件工厂:返回 marked 扩展/引擎插件(兼容 @ant-design/x-markdown)
409
+ */
410
+ declare function xTagPlugin(options?: XTagPluginOptions): {
411
+ level: string;
412
+ name: string;
413
+ start(src: string): number;
414
+ /**
415
+ * tokenizer:将 <x-*> 片段转为自定义 Token
416
+ */
417
+ tokenizer(src: string): {
418
+ type: string;
419
+ raw: string;
420
+ name: string;
421
+ attrs: Record<string, any>;
422
+ body: string;
423
+ } | undefined;
424
+ /**
425
+ * renderer:不返回原始 HTML,转为受控节点
426
+ */
427
+ renderer(token: any): {
428
+ type: string;
429
+ props: any;
430
+ body: any;
431
+ };
432
+ };
433
+
400
434
  interface XCMLProps {
401
435
  content?: string;
402
436
  stream?: AsyncIterable<string>;
@@ -999,8 +1033,8 @@ type ThemeProviderState = {
999
1033
  theme: Theme;
1000
1034
  setTheme: (theme: Theme) => void;
1001
1035
  };
1002
- declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, primaryColor, // Indigo 500 default
1036
+ declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, primaryColor, // Orange 600 (Sunset)
1003
1037
  storageKey, scoped, className, style, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
1004
1038
  declare const useTheme: () => ThemeProviderState;
1005
1039
 
1006
- export { AntVChartLoader, type AntVRendererOptions, type BaseChartProps, type BasicRenderersOptions, COMMON_PROPS, type ChartAxisConfig, type ChartComponent, type ChartLabelConfig, type ChartLegendConfig, type ChartProps, type ChartStrategy, type ColumnChartProps, DefaultEmptyPlaceholder, DefaultErrorPlaceholder, type DualAxesChartProps, type DualAxesChildConfig, type ExtendedRenderersOptions, type FunnelChartProps, type LineChartProps, type PieChartProps, type Theme, ThemeProvider, type XCMLBaseComponent, type XCMLBaseProps, XCMLCardWrapper, XCMLChart, type XCMLComponentSchema, type XCMLContext, XCMLEventBus, XCMLMarkdown, type XCMLPlugin, type XCMLPropertyCategory, type XCMLPropertyDefinition, type XCMLPropertyType, type XCMLProps, type XCMLRenderer, XCML_SCHEMAS, buildConfig, chartSchema, cleanPropsBySchema, columnChartSchema, columnStrategy, createAntVRenderers, createBasicRenderers, createExtendedRenderers, createRenderersWithAliases, deepMerge, dualAxesChartSchema, dualAxesStrategy, extractBaseStyles, funnelChartSchema, funnelStrategy, getChartStrategy, getTheme, lineChartSchema, lineStrategy, mergePropsAndBody, normalizeNodeData, normalizeTagName, parseArrayProp, parseInlineData, parseXCML, pieChartSchema, pieStrategy, preprocessXCML, renderXCML, strategies, stringifyToXCML, themeDark, themeLight, themeMap, toXCMLNodeFromElement, toXCMLTag, toXTag, useTheme, useXCMLComponent, useXCMLNode, validateDataSchema, validateXCMLNode, withXCMLCard, xcmlBus };
1040
+ export { AntVChartLoader, type AntVRendererOptions, type BaseChartProps, type BasicRenderersOptions, COMMON_PROPS, type ChartAxisConfig, type ChartComponent, type ChartLabelConfig, type ChartLegendConfig, type ChartProps, type ChartStrategy, type ColumnChartProps, DefaultEmptyPlaceholder, DefaultErrorPlaceholder, type DualAxesChartProps, type DualAxesChildConfig, type ExtendedRenderersOptions, type FunnelChartProps, type LineChartProps, type PieChartProps, type Theme, ThemeProvider, type XCMLBaseComponent, type XCMLBaseProps, XCMLCardWrapper, XCMLChart, type XCMLComponentSchema, type XCMLContext, XCMLEventBus, XCMLMarkdown, type XCMLPlugin, type XCMLPropertyCategory, type XCMLPropertyDefinition, type XCMLPropertyType, type XCMLProps, type XCMLRenderer, XCML_SCHEMAS, type XTagPluginOptions, buildConfig, chartSchema, cleanPropsBySchema, columnChartSchema, columnStrategy, createAntVRenderers, createBasicRenderers, createExtendedRenderers, createRenderersWithAliases, deepMerge, dualAxesChartSchema, dualAxesStrategy, extractBaseStyles, funnelChartSchema, funnelStrategy, getChartStrategy, getTheme, lineChartSchema, lineStrategy, mergePropsAndBody, normalizeNodeData, normalizeTagName, parseArrayProp, parseInlineData, parseXCML, pieChartSchema, pieStrategy, preprocessXCML, renderXCML, strategies, stringifyToXCML, themeDark, themeLight, themeMap, toXCMLNodeFromElement, toXCMLTag, toXTag, useTheme, useXCMLComponent, useXCMLNode, validateDataSchema, validateXCMLNode, withXCMLCard, xTagPlugin, xcmlBus };
package/dist/index.d.ts CHANGED
@@ -397,6 +397,40 @@ declare function toXCMLNodeFromElement(name: string, attrs: Record<string, any>,
397
397
  */
398
398
  declare function preprocessXCML(md: string, knownTags?: string[]): string;
399
399
 
400
+ interface XTagPluginOptions {
401
+ /**
402
+ * 允许的标签名称列表,不包含前缀 'x-'
403
+ * @default ['chart', 'table', 'metric', 'list', 'card', 'toc']
404
+ */
405
+ tags?: string[];
406
+ }
407
+ /**
408
+ * 插件工厂:返回 marked 扩展/引擎插件(兼容 @ant-design/x-markdown)
409
+ */
410
+ declare function xTagPlugin(options?: XTagPluginOptions): {
411
+ level: string;
412
+ name: string;
413
+ start(src: string): number;
414
+ /**
415
+ * tokenizer:将 <x-*> 片段转为自定义 Token
416
+ */
417
+ tokenizer(src: string): {
418
+ type: string;
419
+ raw: string;
420
+ name: string;
421
+ attrs: Record<string, any>;
422
+ body: string;
423
+ } | undefined;
424
+ /**
425
+ * renderer:不返回原始 HTML,转为受控节点
426
+ */
427
+ renderer(token: any): {
428
+ type: string;
429
+ props: any;
430
+ body: any;
431
+ };
432
+ };
433
+
400
434
  interface XCMLProps {
401
435
  content?: string;
402
436
  stream?: AsyncIterable<string>;
@@ -999,8 +1033,8 @@ type ThemeProviderState = {
999
1033
  theme: Theme;
1000
1034
  setTheme: (theme: Theme) => void;
1001
1035
  };
1002
- declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, primaryColor, // Indigo 500 default
1036
+ declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, primaryColor, // Orange 600 (Sunset)
1003
1037
  storageKey, scoped, className, style, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
1004
1038
  declare const useTheme: () => ThemeProviderState;
1005
1039
 
1006
- export { AntVChartLoader, type AntVRendererOptions, type BaseChartProps, type BasicRenderersOptions, COMMON_PROPS, type ChartAxisConfig, type ChartComponent, type ChartLabelConfig, type ChartLegendConfig, type ChartProps, type ChartStrategy, type ColumnChartProps, DefaultEmptyPlaceholder, DefaultErrorPlaceholder, type DualAxesChartProps, type DualAxesChildConfig, type ExtendedRenderersOptions, type FunnelChartProps, type LineChartProps, type PieChartProps, type Theme, ThemeProvider, type XCMLBaseComponent, type XCMLBaseProps, XCMLCardWrapper, XCMLChart, type XCMLComponentSchema, type XCMLContext, XCMLEventBus, XCMLMarkdown, type XCMLPlugin, type XCMLPropertyCategory, type XCMLPropertyDefinition, type XCMLPropertyType, type XCMLProps, type XCMLRenderer, XCML_SCHEMAS, buildConfig, chartSchema, cleanPropsBySchema, columnChartSchema, columnStrategy, createAntVRenderers, createBasicRenderers, createExtendedRenderers, createRenderersWithAliases, deepMerge, dualAxesChartSchema, dualAxesStrategy, extractBaseStyles, funnelChartSchema, funnelStrategy, getChartStrategy, getTheme, lineChartSchema, lineStrategy, mergePropsAndBody, normalizeNodeData, normalizeTagName, parseArrayProp, parseInlineData, parseXCML, pieChartSchema, pieStrategy, preprocessXCML, renderXCML, strategies, stringifyToXCML, themeDark, themeLight, themeMap, toXCMLNodeFromElement, toXCMLTag, toXTag, useTheme, useXCMLComponent, useXCMLNode, validateDataSchema, validateXCMLNode, withXCMLCard, xcmlBus };
1040
+ export { AntVChartLoader, type AntVRendererOptions, type BaseChartProps, type BasicRenderersOptions, COMMON_PROPS, type ChartAxisConfig, type ChartComponent, type ChartLabelConfig, type ChartLegendConfig, type ChartProps, type ChartStrategy, type ColumnChartProps, DefaultEmptyPlaceholder, DefaultErrorPlaceholder, type DualAxesChartProps, type DualAxesChildConfig, type ExtendedRenderersOptions, type FunnelChartProps, type LineChartProps, type PieChartProps, type Theme, ThemeProvider, type XCMLBaseComponent, type XCMLBaseProps, XCMLCardWrapper, XCMLChart, type XCMLComponentSchema, type XCMLContext, XCMLEventBus, XCMLMarkdown, type XCMLPlugin, type XCMLPropertyCategory, type XCMLPropertyDefinition, type XCMLPropertyType, type XCMLProps, type XCMLRenderer, XCML_SCHEMAS, type XTagPluginOptions, buildConfig, chartSchema, cleanPropsBySchema, columnChartSchema, columnStrategy, createAntVRenderers, createBasicRenderers, createExtendedRenderers, createRenderersWithAliases, deepMerge, dualAxesChartSchema, dualAxesStrategy, extractBaseStyles, funnelChartSchema, funnelStrategy, getChartStrategy, getTheme, lineChartSchema, lineStrategy, mergePropsAndBody, normalizeNodeData, normalizeTagName, parseArrayProp, parseInlineData, parseXCML, pieChartSchema, pieStrategy, preprocessXCML, renderXCML, strategies, stringifyToXCML, themeDark, themeLight, themeMap, toXCMLNodeFromElement, toXCMLTag, toXTag, useTheme, useXCMLComponent, useXCMLNode, validateDataSchema, validateXCMLNode, withXCMLCard, xTagPlugin, xcmlBus };