@next-bricks/visual-builder 1.36.30 → 1.37.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.
Files changed (60) hide show
  1. package/dist/bricks.json +26 -23
  2. package/dist/chunks/1304.a8196a2e.js +2 -0
  3. package/dist/chunks/1304.a8196a2e.js.map +1 -0
  4. package/dist/chunks/2464.b7163b41.js +2 -0
  5. package/dist/chunks/2464.b7163b41.js.map +1 -0
  6. package/dist/chunks/5522.ab1061cc.js +3 -0
  7. package/dist/chunks/{6297.cc718d3b.js.LICENSE.txt → 5522.ab1061cc.js.LICENSE.txt} +2 -0
  8. package/dist/chunks/5522.ab1061cc.js.map +1 -0
  9. package/dist/chunks/6117.7ee90157.js +1 -0
  10. package/dist/chunks/get-config-by-data-for-ai.3ce1ddd1.js +3 -0
  11. package/dist/chunks/get-config-by-data-for-ai.3ce1ddd1.js.LICENSE.txt +1 -0
  12. package/dist/chunks/get-config-by-data-for-ai.3ce1ddd1.js.map +1 -0
  13. package/dist/chunks/get-raw-data-system-prompts.e7339ae7.js +2 -0
  14. package/dist/chunks/get-raw-data-system-prompts.e7339ae7.js.map +1 -0
  15. package/dist/chunks/main.c8c9b11f.js +2 -0
  16. package/dist/chunks/main.c8c9b11f.js.map +1 -0
  17. package/dist/chunks/pre-generated-config-preview.dccb8a89.js +2 -0
  18. package/dist/chunks/pre-generated-config-preview.dccb8a89.js.map +1 -0
  19. package/dist/chunks/pre-generated-config.2339bb56.js +2 -0
  20. package/dist/chunks/pre-generated-config.2339bb56.js.map +1 -0
  21. package/dist/chunks/pre-generated-container.7a8711cd.js +2 -0
  22. package/dist/chunks/pre-generated-container.7a8711cd.js.map +1 -0
  23. package/dist/chunks/raw-data-preview.79a5f278.js +3 -0
  24. package/dist/chunks/raw-data-preview.79a5f278.js.map +1 -0
  25. package/dist/examples.json +6 -3
  26. package/dist/index.c58723df.js +2 -0
  27. package/dist/index.c58723df.js.map +1 -0
  28. package/dist/manifest.json +165 -92
  29. package/dist/types.json +1614 -805
  30. package/dist-types/bootstrap.d.ts +3 -0
  31. package/dist-types/data-providers/get-config-by-data-for-ai.d.ts +30 -0
  32. package/dist-types/data-providers/get-config-by-data-for-ai.spec.d.ts +1 -0
  33. package/dist-types/pre-generated-config/convertToBrickConf.d.ts +3 -0
  34. package/dist-types/pre-generated-config/i18n.d.ts +14 -0
  35. package/dist-types/pre-generated-config/index.d.ts +48 -0
  36. package/dist-types/pre-generated-config/index.spec.d.ts +1 -0
  37. package/dist-types/pre-generated-config-preview/index.d.ts +31 -0
  38. package/dist-types/pre-generated-config-preview/index.spec.d.ts +1 -0
  39. package/dist-types/raw-data-preview/convert.d.ts +1 -0
  40. package/dist-types/raw-data-preview/raw-data-interfaces.d.ts +1 -1
  41. package/dist-types/shared/getMemberAccessor.d.ts +1 -0
  42. package/dist-types/shared/getMemberAccessor.spec.d.ts +1 -0
  43. package/docs/pre-generated-config.md +3512 -0
  44. package/package.json +2 -2
  45. package/dist/chunks/1525.43329bb3.js +0 -2
  46. package/dist/chunks/1525.43329bb3.js.map +0 -1
  47. package/dist/chunks/1722.59f0e4b2.js +0 -1
  48. package/dist/chunks/6297.cc718d3b.js +0 -3
  49. package/dist/chunks/6297.cc718d3b.js.map +0 -1
  50. package/dist/chunks/get-raw-data-system-prompts.e306ead0.js +0 -2
  51. package/dist/chunks/get-raw-data-system-prompts.e306ead0.js.map +0 -1
  52. package/dist/chunks/main.f970ebdd.js +0 -2
  53. package/dist/chunks/main.f970ebdd.js.map +0 -1
  54. package/dist/chunks/pre-generated-container.a2840dd1.js +0 -2
  55. package/dist/chunks/pre-generated-container.a2840dd1.js.map +0 -1
  56. package/dist/chunks/raw-data-preview.39456503.js +0 -3
  57. package/dist/chunks/raw-data-preview.39456503.js.map +0 -1
  58. package/dist/index.80eef55c.js +0 -2
  59. package/dist/index.80eef55c.js.map +0 -1
  60. /package/dist/chunks/{raw-data-preview.39456503.js.LICENSE.txt → raw-data-preview.79a5f278.js.LICENSE.txt} +0 -0
@@ -21,3 +21,6 @@ import "./raw-data-preview/index.js";
21
21
  import "./data-providers/parse-path.js";
22
22
  import "./data-providers/batch-update-raw-data-generated-view.js";
23
23
  import "./data-providers/get-raw-data-system-prompts.js";
24
+ import "./pre-generated-config/index.js";
25
+ import "./pre-generated-config-preview/index.js";
26
+ import "./data-providers/get-config-by-data-for-ai.js";
@@ -0,0 +1,30 @@
1
+ export interface Data {
2
+ name: string;
3
+ value: unknown;
4
+ }
5
+ export type Config = NormalConfig | UnknownConfig;
6
+ export interface NormalConfig {
7
+ type: ConfigType;
8
+ attrList: Attr[];
9
+ dataList: unknown[];
10
+ containerOptions?: ContainerOption[];
11
+ }
12
+ export interface UnknownConfig {
13
+ type: "unknown";
14
+ error: string;
15
+ }
16
+ export interface Options {
17
+ dataType?: "context" | "state";
18
+ }
19
+ export type ConfigType = "list" | "list-with-pagination" | "object" | "unknown";
20
+ export interface Attr {
21
+ id: string;
22
+ name: string;
23
+ candidates?: unknown[];
24
+ }
25
+ export interface ContainerOption {
26
+ label: string;
27
+ value: string;
28
+ settings?: unknown;
29
+ }
30
+ export declare function getConfigByDataForAi(data: Data | undefined | null): Promise<Config>;
@@ -0,0 +1,3 @@
1
+ import type { BrickConf } from "@next-core/types";
2
+ import type { AttrConfig, ContainerConfig } from "./index.js";
3
+ export declare function convertToBrickConf(attrList: AttrConfig[], { type, dataName, dataType, settings }: ContainerConfig): BrickConf | null;
@@ -0,0 +1,14 @@
1
+ export declare enum K {
2
+ }
3
+ export declare const NS = "bricks/visual-builder/pre-generated-config";
4
+ export declare const locales: {
5
+ en: Locale;
6
+ zh: Locale;
7
+ };
8
+ export declare const t: any;
9
+ type Locale = {
10
+ [k in K]: string;
11
+ } & {
12
+ [k in K as `${k}_plural`]?: string;
13
+ };
14
+ export {};
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import type { BrickConf } from "@next-core/types";
4
+ import "@next-core/theme";
5
+ import type { VisualConfig } from "../raw-data-preview/raw-data-interfaces.js";
6
+ export interface PreGeneratedConfigProps {
7
+ previewUrl?: string;
8
+ attrList?: ObjectAttr[];
9
+ mockList?: Record<string, unknown>[];
10
+ containerConfig?: ContainerConfig;
11
+ }
12
+ export interface ObjectAttr {
13
+ id: string;
14
+ name: string;
15
+ enum?: unknown[];
16
+ candidates?: VisualConfig[];
17
+ }
18
+ export interface AttrConfig {
19
+ id: string;
20
+ name: string;
21
+ config?: VisualConfig;
22
+ }
23
+ export interface ContainerConfig {
24
+ type: "table" | "descriptions" | "cards" | "chart" | null | undefined;
25
+ dataName: string;
26
+ dataType?: "context" | "state";
27
+ settings?: {
28
+ pagination?: boolean;
29
+ fields?: Record<string, string>;
30
+ };
31
+ }
32
+ /**
33
+ * 构件 `visual-builder.pre-generated-config`
34
+ */
35
+ export declare class PreGeneratedConfig extends ReactNextElement implements PreGeneratedConfigProps {
36
+ #private;
37
+ accessor previewUrl: string | undefined;
38
+ accessor attrList: ObjectAttr[] | undefined;
39
+ accessor mockList: Record<string, unknown>[] | undefined;
40
+ accessor containerConfig: ContainerConfig | undefined;
41
+ render(): React.JSX.Element;
42
+ }
43
+ export interface PreGeneratedConfigComponentProps extends PreGeneratedConfigProps {
44
+ root: HTMLElement;
45
+ onChange: (payload: AttrConfig[]) => void;
46
+ onBrickChange: (payload: BrickConf | null) => void;
47
+ }
48
+ export declare function PreGeneratedConfigComponent({ previewUrl, attrList, mockList, containerConfig, root, onChange, onBrickChange, }: PreGeneratedConfigComponentProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import type { VisualConfig } from "../raw-data-preview/raw-data-interfaces";
5
+ export interface ObjectAttr {
6
+ id: string;
7
+ name: string;
8
+ enum?: unknown[];
9
+ config?: VisualConfig;
10
+ }
11
+ export interface PreGeneratedConfigPreviewProps {
12
+ previewUrl?: string;
13
+ container?: ContainerType;
14
+ attrList?: ObjectAttr[];
15
+ mockList?: Record<string, unknown>[];
16
+ }
17
+ export type ContainerType = "table" | "descriptions";
18
+ /**
19
+ * 构件 `visual-builder.pre-generated-config-preview`
20
+ */
21
+ export declare class PreGeneratedConfigPreview extends ReactNextElement implements PreGeneratedConfigPreviewProps {
22
+ accessor previewUrl: string | undefined;
23
+ accessor container: ContainerType | undefined;
24
+ accessor attrList: ObjectAttr[] | undefined;
25
+ accessor mockList: Record<string, unknown>[] | undefined;
26
+ render(): React.JSX.Element;
27
+ }
28
+ export interface PreGeneratedConfigPreviewComponentProps extends PreGeneratedConfigPreviewProps {
29
+ root: HTMLElement;
30
+ }
31
+ export declare function PreGeneratedConfigPreviewComponent({ root, previewUrl, container, attrList, mockList, }: PreGeneratedConfigPreviewComponentProps): React.JSX.Element;
@@ -1,3 +1,4 @@
1
1
  import type { BrickConf } from "@next-core/types";
2
2
  import type { VisualConfig } from "./raw-data-interfaces";
3
3
  export declare function convertToStoryboard(config: VisualConfig, attr: string): BrickConf | null;
4
+ export declare function lowLevelConvertToStoryboard(config: VisualConfig, attrAccessor: string): BrickConf | null;
@@ -4,7 +4,7 @@ export interface VisualConfig {
4
4
  /** 显示形式,默认为 text */
5
5
  display: "text" | "tag" | "link" | "icon" | "icon+text";
6
6
  /** 原始数据类型 */
7
- type: "integer" | "float" | "string" | "boolean" | "enum" | "enum-list" | "struct" | "struct-list" | "date" | "date-time";
7
+ type: "integer" | "float" | "string" | "boolean" | "enum" | "enum-list" | "struct" | "struct-list" | "json" | "date" | "date-time";
8
8
  /** 样式设置 */
9
9
  style?: VisualStyle;
10
10
  /** 根据区间设置不同的样式 */
@@ -0,0 +1 @@
1
+ export declare function getMemberAccessor(property: unknown): string;
@@ -0,0 +1 @@
1
+ export {};