@next-bricks/visual-builder 1.39.15 → 1.39.17

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 (125) hide show
  1. package/dist/bricks.json +10 -10
  2. package/dist/chunks/{5522.678c03f6.js → 4577.f016e9de.js} +3 -3
  3. package/dist/chunks/4577.f016e9de.js.map +1 -0
  4. package/dist/chunks/6411.40f47da3.js +3 -0
  5. package/dist/chunks/6411.40f47da3.js.map +1 -0
  6. package/dist/chunks/7085.3c330b29.js +3 -0
  7. package/dist/chunks/7085.3c330b29.js.map +1 -0
  8. package/dist/chunks/9653.ac443b19.js +2 -0
  9. package/dist/chunks/9653.ac443b19.js.map +1 -0
  10. package/dist/chunks/chat-conversation.0ffc333f.js +3 -0
  11. package/dist/chunks/chat-conversation.0ffc333f.js.map +1 -0
  12. package/dist/chunks/chat-preview.36976c55.js.map +1 -1
  13. package/dist/chunks/contract-select.252b9e45.js +3 -0
  14. package/dist/chunks/contract-select.252b9e45.js.map +1 -0
  15. package/dist/chunks/generate-snippets-context-menu.56acf448.js.map +1 -1
  16. package/dist/chunks/main.1cb52df3.js +2 -0
  17. package/dist/chunks/{main.1c5337dd.js.map → main.1cb52df3.js.map} +1 -1
  18. package/dist/chunks/page-arch-node.379284ad.js +3 -0
  19. package/dist/chunks/page-arch-node.379284ad.js.map +1 -0
  20. package/dist/chunks/pre-generated-config-preview.cfbc2a1e.js.map +1 -1
  21. package/dist/chunks/pre-generated-config.a027788b.js.map +1 -1
  22. package/dist/chunks/pre-generated-container.dcfa8cc9.js.map +1 -1
  23. package/dist/chunks/pre-generated-preview.8e699675.js.map +1 -1
  24. package/dist/chunks/pre-generated-table-view.8a9d5527.js.map +1 -1
  25. package/dist/chunks/property-editor.dea9895b.js +2 -0
  26. package/dist/chunks/property-editor.dea9895b.js.map +1 -0
  27. package/dist/chunks/raw-data-preview.0bf12da3.js.map +1 -1
  28. package/dist/chunks/raw-metric-preview.c503481e.js.map +1 -1
  29. package/dist/chunks/workbench-action-list.c67329ed.js.map +1 -1
  30. package/dist/chunks/workbench-action.5b993227.js.map +1 -1
  31. package/dist/chunks/workbench-pane.5c4866a6.js +3 -0
  32. package/dist/chunks/workbench-pane.5c4866a6.js.map +1 -0
  33. package/dist/chunks/workbench-sidebar.01731e99.js.map +1 -1
  34. package/dist/chunks/{workbench-tree.e71a583f.js → workbench-tree.7097bd88.js} +3 -3
  35. package/dist/chunks/workbench-tree.7097bd88.js.map +1 -0
  36. package/dist/examples.json +47 -5
  37. package/dist/index.93f39de8.js +2 -0
  38. package/dist/{index.90916d4c.js.map → index.93f39de8.js.map} +1 -1
  39. package/dist/manifest.json +217 -63
  40. package/dist/types.json +36 -36
  41. package/dist-types/chat-conversation/index.d.ts +7 -1
  42. package/dist-types/chat-preview/index.d.ts +20 -1
  43. package/dist-types/contract-select/index.d.ts +16 -1
  44. package/dist-types/generate-snippets-context-menu/index.d.ts +17 -1
  45. package/dist-types/page-arch-node/index.d.ts +25 -1
  46. package/dist-types/pre-generated-config/index.d.ts +16 -1
  47. package/dist-types/pre-generated-config-preview/index.d.ts +13 -1
  48. package/dist-types/pre-generated-container/index.d.ts +3 -1
  49. package/dist-types/pre-generated-preview/index.d.ts +6 -1
  50. package/dist-types/pre-generated-table-view/index.d.ts +1 -1
  51. package/dist-types/property-editor/index.d.ts +10 -4
  52. package/dist-types/raw-data-preview/index.d.ts +9 -1
  53. package/dist-types/raw-metric-preview/index.d.ts +8 -1
  54. package/dist-types/workbench-action/index.d.ts +7 -0
  55. package/dist-types/workbench-action-list/index.d.ts +3 -0
  56. package/dist-types/workbench-pane/index.d.ts +4 -0
  57. package/dist-types/workbench-sidebar/index.d.ts +2 -0
  58. package/dist-types/workbench-tree/index.d.ts +19 -6
  59. package/docs/chat-conversation.md +51 -31
  60. package/docs/chat-conversation.react.md +115 -0
  61. package/docs/chat-preview.md +83 -0
  62. package/docs/chat-preview.react.md +105 -0
  63. package/docs/contract-select.md +97 -0
  64. package/docs/contract-select.react.md +95 -0
  65. package/docs/generate-snippets-context-menu.md +141 -0
  66. package/docs/generate-snippets-context-menu.react.md +134 -0
  67. package/docs/page-arch-node.md +87 -1
  68. package/docs/page-arch-node.react.md +97 -0
  69. package/docs/pre-generated-config-preview.md +74 -0
  70. package/docs/pre-generated-config-preview.react.md +82 -0
  71. package/docs/pre-generated-config.md +96 -0
  72. package/docs/pre-generated-config.react.md +78 -0
  73. package/docs/pre-generated-container.md +56 -0
  74. package/docs/pre-generated-container.react.md +62 -0
  75. package/docs/pre-generated-preview.md +83 -0
  76. package/docs/pre-generated-preview.react.md +92 -0
  77. package/docs/pre-generated-table-view.md +46 -0
  78. package/docs/pre-generated-table-view.react.md +36 -0
  79. package/docs/property-editor.md +44 -1
  80. package/docs/property-editor.react.md +97 -0
  81. package/docs/raw-data-preview.md +75 -1643
  82. package/docs/raw-data-preview.react.md +154 -0
  83. package/docs/raw-metric-preview.md +93 -0
  84. package/docs/raw-metric-preview.react.md +94 -0
  85. package/docs/workbench-action-list.md +80 -0
  86. package/docs/workbench-action-list.react.md +85 -0
  87. package/docs/workbench-action.md +80 -0
  88. package/docs/workbench-action.react.md +76 -0
  89. package/docs/workbench-history-action.md +42 -1
  90. package/docs/workbench-history-action.react.md +54 -0
  91. package/docs/workbench-pane.md +105 -0
  92. package/docs/workbench-pane.react.md +90 -0
  93. package/docs/workbench-sidebar.md +88 -0
  94. package/docs/workbench-sidebar.react.md +66 -0
  95. package/docs/workbench-tree.md +217 -0
  96. package/docs/workbench-tree.react.md +180 -0
  97. package/package.json +2 -2
  98. package/dist/chunks/36.b158228e.js +0 -3
  99. package/dist/chunks/36.b158228e.js.map +0 -1
  100. package/dist/chunks/5522.678c03f6.js.map +0 -1
  101. package/dist/chunks/7085.c58ac475.js +0 -3
  102. package/dist/chunks/7085.c58ac475.js.map +0 -1
  103. package/dist/chunks/9653.e857fdaf.js +0 -2
  104. package/dist/chunks/9653.e857fdaf.js.map +0 -1
  105. package/dist/chunks/chat-conversation.d873f6d5.js +0 -3
  106. package/dist/chunks/chat-conversation.d873f6d5.js.map +0 -1
  107. package/dist/chunks/contract-select.ff891ded.js +0 -3
  108. package/dist/chunks/contract-select.ff891ded.js.map +0 -1
  109. package/dist/chunks/main.1c5337dd.js +0 -2
  110. package/dist/chunks/page-arch-node.974674c0.js +0 -3
  111. package/dist/chunks/page-arch-node.974674c0.js.map +0 -1
  112. package/dist/chunks/property-editor.6de6adf4.js +0 -2
  113. package/dist/chunks/property-editor.6de6adf4.js.map +0 -1
  114. package/dist/chunks/workbench-pane.7e85de42.js +0 -3
  115. package/dist/chunks/workbench-pane.7e85de42.js.map +0 -1
  116. package/dist/chunks/workbench-tree.e71a583f.js.map +0 -1
  117. package/dist/index.90916d4c.js +0 -2
  118. /package/dist/chunks/{5522.678c03f6.js.LICENSE.txt → 4577.f016e9de.js.LICENSE.txt} +0 -0
  119. /package/dist/chunks/{36.b158228e.js.LICENSE.txt → 6411.40f47da3.js.LICENSE.txt} +0 -0
  120. /package/dist/chunks/{7085.c58ac475.js.LICENSE.txt → 7085.3c330b29.js.LICENSE.txt} +0 -0
  121. /package/dist/chunks/{chat-conversation.d873f6d5.js.LICENSE.txt → chat-conversation.0ffc333f.js.LICENSE.txt} +0 -0
  122. /package/dist/chunks/{contract-select.ff891ded.js.LICENSE.txt → contract-select.252b9e45.js.LICENSE.txt} +0 -0
  123. /package/dist/chunks/{page-arch-node.974674c0.js.LICENSE.txt → page-arch-node.379284ad.js.LICENSE.txt} +0 -0
  124. /package/dist/chunks/{workbench-pane.7e85de42.js.LICENSE.txt → workbench-pane.5c4866a6.js.LICENSE.txt} +0 -0
  125. /package/dist/chunks/{workbench-tree.e71a583f.js.LICENSE.txt → workbench-tree.7097bd88.js.LICENSE.txt} +0 -0
@@ -0,0 +1,180 @@
1
+ ---
2
+ tagName: visual-builder.workbench-tree
3
+ displayName: WrappedVisualBuilderWorkbenchTree
4
+ description: 工作台树形组件,支持搜索、拖拽排序、折叠展开和节点操作
5
+ category: ""
6
+ source: "@next-bricks/visual-builder"
7
+ ---
8
+
9
+ # WrappedVisualBuilderWorkbenchTree
10
+
11
+ > 工作台树形组件,支持搜索、拖拽排序、折叠展开和节点操作
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedVisualBuilderWorkbenchTree } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | ------------------- | ------------------------------------------------------ | ---- | ------ | ----------------------------------------------- |
23
+ | nodes | `WorkbenchNodeData[]` | 是 | - | 树节点数据列表 |
24
+ | actions | `WorkbenchTreeAction[]` | 是 | - | 节点操作按钮配置列表 |
25
+ | actionsHidden | `boolean` | 是 | - | 是否隐藏节点操作按钮 |
26
+ | placeholder | `string` | 是 | - | 无数据时显示的占位文本 |
27
+ | isTransformName | `boolean` | 是 | - | 是否将节点名称转换为可读格式 |
28
+ | searchPlaceholder | `string` | 是 | - | 搜索框占位文本 |
29
+ | noSearch | `boolean` | 是 | - | 是否隐藏搜索框 |
30
+ | activeKey | `string \| number` | 是 | - | 当前激活节点的 key |
31
+ | showMatchedNodeOnly | `boolean` | 是 | - | 搜索时是否只显示匹配的节点 |
32
+ | matchNodeDataFields | `string \| string[]` | 是 | - | 搜索时匹配的节点数据字段,"\*" 表示匹配所有字段 |
33
+ | fixedActionsFor | `Record<string, unknown> \| Record<string, unknown>[]` | 是 | - | 始终显示操作按钮的节点数据条件 |
34
+ | collapsible | `boolean` | 是 | - | 是否启用节点折叠功能 |
35
+ | collapsedNodes | `string[]` | 是 | - | 当前已折叠节点的 ID 列表 |
36
+ | allowDrag | `boolean` | 是 | - | 是否允许拖拽排序 |
37
+ | allowDragToRoot | `boolean` | 是 | - | 是否允许拖拽到根节点位置 |
38
+ | allowDragToInside | `boolean` | 是 | - | 是否允许拖拽到节点内部成为子节点 |
39
+ | nodeKey | `string` | 是 | - | 节点唯一标识字段名 |
40
+ | skipNotify | `boolean` | 是 | - | 是否跳过节点点击时的通知 |
41
+
42
+ ## Events
43
+
44
+ | 事件 | detail | 说明 |
45
+ | ------------- | -------------------------------------------------------------------------------------- | --------------------------- |
46
+ | onActionClick | `ActionClickDetail` — { action: 操作标识, data: 节点数据 } | 点击节点操作按钮时触发 |
47
+ | onNodeClick | `unknown` — 节点的 data 数据 | 点击节点时触发 |
48
+ | onNodeDrop | `any` — 拖拽完成后的节点位置信息 | 拖拽节点完成时触发 |
49
+ | onContextMenu | `unknown` — { active: true, node: 节点的 data 数据, x: 鼠标 X 坐标, y: 鼠标 Y 坐标 } | 右键点击节点时触发 |
50
+ | onNodeToggle | `{ nodeId: string; collapsed: boolean; }` — { nodeId: 节点 ID, collapsed: 是否已折叠 } | 节点折叠/展开状态变化时触发 |
51
+
52
+ ## Examples
53
+
54
+ ### Basic
55
+
56
+ 展示基本的树形结构,包含节点数据和操作按钮。
57
+
58
+ ```tsx
59
+ <WrappedVisualBuilderWorkbenchTree
60
+ nodes={[
61
+ {
62
+ key: "1",
63
+ name: "页面A",
64
+ data: { id: "1", type: "page" },
65
+ children: [
66
+ { key: "1-1", name: "子页面A1", data: { id: "1-1", type: "page" } },
67
+ { key: "1-2", name: "子页面A2", data: { id: "1-2", type: "page" } },
68
+ ],
69
+ },
70
+ { key: "2", name: "页面B", data: { id: "2", type: "page" } },
71
+ ]}
72
+ actions={[
73
+ {
74
+ action: "add",
75
+ icon: { lib: "antd", icon: "plus", theme: "outlined" },
76
+ title: "新增",
77
+ },
78
+ {
79
+ action: "delete",
80
+ icon: { lib: "antd", icon: "delete", theme: "outlined" },
81
+ title: "删除",
82
+ },
83
+ ]}
84
+ actionsHidden={false}
85
+ placeholder="暂无页面"
86
+ searchPlaceholder="搜索页面"
87
+ noSearch={false}
88
+ activeKey="1"
89
+ showMatchedNodeOnly={false}
90
+ matchNodeDataFields={[]}
91
+ fixedActionsFor={[]}
92
+ collapsible={true}
93
+ collapsedNodes={[]}
94
+ allowDrag={false}
95
+ allowDragToRoot={false}
96
+ allowDragToInside={false}
97
+ nodeKey=""
98
+ skipNotify={false}
99
+ onNodeClick={(e) => console.log(e.detail)}
100
+ onActionClick={(e) => console.log(e.detail)}
101
+ />
102
+ ```
103
+
104
+ ### 可拖拽排序
105
+
106
+ 启用拖拽功能,支持在节点间拖拽调整顺序和层级。
107
+
108
+ ```tsx
109
+ <WrappedVisualBuilderWorkbenchTree
110
+ nodes={[
111
+ { key: "1", name: "构件A", data: { id: "1" }, children: [] },
112
+ {
113
+ key: "2",
114
+ name: "构件B",
115
+ data: { id: "2" },
116
+ children: [
117
+ { key: "2-1", name: "子构件B1", data: { id: "2-1" } },
118
+ { key: "2-2", name: "子构件B2", data: { id: "2-2" } },
119
+ ],
120
+ },
121
+ { key: "3", name: "构件C", data: { id: "3" }, children: [] },
122
+ ]}
123
+ actions={[]}
124
+ actionsHidden={true}
125
+ placeholder="暂无构件"
126
+ searchPlaceholder="搜索构件"
127
+ noSearch={false}
128
+ activeKey=""
129
+ showMatchedNodeOnly={false}
130
+ matchNodeDataFields={[]}
131
+ fixedActionsFor={[]}
132
+ collapsible={true}
133
+ collapsedNodes={[]}
134
+ allowDrag={true}
135
+ allowDragToRoot={true}
136
+ allowDragToInside={true}
137
+ nodeKey=""
138
+ skipNotify={false}
139
+ onNodeDrop={(e) => console.log(e.detail)}
140
+ onNodeToggle={(e) => console.log(e.detail)}
141
+ />
142
+ ```
143
+
144
+ ### 搜索和右键菜单
145
+
146
+ 启用节点数据字段搜索,并监听右键菜单事件。
147
+
148
+ ```tsx
149
+ <WrappedVisualBuilderWorkbenchTree
150
+ nodes={[
151
+ { key: "1", name: "登录页", data: { id: "1", path: "/login" } },
152
+ { key: "2", name: "首页", data: { id: "2", path: "/home" } },
153
+ { key: "3", name: "详情页", data: { id: "3", path: "/detail" } },
154
+ ]}
155
+ actions={[
156
+ {
157
+ action: "edit",
158
+ icon: { lib: "antd", icon: "edit", theme: "outlined" },
159
+ title: "编辑",
160
+ },
161
+ ]}
162
+ actionsHidden={false}
163
+ placeholder="暂无页面"
164
+ searchPlaceholder="搜索路径或名称"
165
+ noSearch={false}
166
+ activeKey="2"
167
+ showMatchedNodeOnly={true}
168
+ matchNodeDataFields={["path"]}
169
+ fixedActionsFor={[]}
170
+ collapsible={false}
171
+ collapsedNodes={[]}
172
+ allowDrag={false}
173
+ allowDragToRoot={false}
174
+ allowDragToInside={false}
175
+ nodeKey=""
176
+ skipNotify={false}
177
+ onContextMenu={(e) => console.log(e.detail)}
178
+ onActionClick={(e) => console.log(e.detail)}
179
+ />
180
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/visual-builder",
3
- "version": "1.39.15",
3
+ "version": "1.39.17",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/visual-builder",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,5 +46,5 @@
46
46
  "@next-bricks/icons": "*",
47
47
  "@next-bricks/vs": "*"
48
48
  },
49
- "gitHead": "d9afdaa0df73cd4225da5943b626efe93bf79398"
49
+ "gitHead": "2670992c377a46bcaed4f3ed70431bb5441c4bb7"
50
50
  }