@nocobase/plugin-action-bulk-edit 2.1.0-alpha.11 → 2.1.0-alpha.13

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.
@@ -9,7 +9,7 @@
9
9
 
10
10
  module.exports = {
11
11
  "@formily/react": "2.3.7",
12
- "@nocobase/client": "2.1.0-alpha.11",
12
+ "@nocobase/client": "2.1.0-alpha.13",
13
13
  "antd": "5.24.2",
14
14
  "react": "18.2.0",
15
15
  "react-i18next": "11.18.6",
@@ -18,10 +18,10 @@ module.exports = {
18
18
  "@formily/core": "2.3.7",
19
19
  "lodash": "4.17.21",
20
20
  "@formily/shared": "2.3.7",
21
- "@nocobase/utils": "2.1.0-alpha.11",
22
- "@nocobase/flow-engine": "2.1.0-alpha.11",
23
- "@nocobase/server": "2.1.0-alpha.11",
24
- "@nocobase/test": "2.1.0-alpha.11",
21
+ "@nocobase/utils": "2.1.0-alpha.13",
22
+ "@nocobase/server": "2.1.0-alpha.13",
23
+ "@nocobase/test": "2.1.0-alpha.13",
25
24
  "@emotion/css": "11.13.0",
25
+ "@nocobase/flow-engine": "2.1.0-alpha.13",
26
26
  "ahooks": "3.7.8"
27
27
  };
@@ -6,9 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import type { FlowSchemaContribution } from '@nocobase/flow-engine';
10
9
  import { Plugin } from '@nocobase/server';
11
10
  export declare class PluginActionBulkEditServer extends Plugin {
12
- getFlowSchemaContributions(): FlowSchemaContribution;
13
11
  }
14
12
  export default PluginActionBulkEditServer;
@@ -31,11 +31,7 @@ __export(plugin_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(plugin_exports);
33
33
  var import_server = require("@nocobase/server");
34
- var import_flow_schema_contributions = require("./flow-schema-contributions");
35
34
  class PluginActionBulkEditServer extends import_server.Plugin {
36
- getFlowSchemaContributions() {
37
- return import_flow_schema_contributions.flowSchemaContribution;
38
- }
39
35
  }
40
36
  var plugin_default = PluginActionBulkEditServer;
41
37
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-action-bulk-edit",
3
- "version": "2.1.0-alpha.11",
3
+ "version": "2.1.0-alpha.13",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/action-bulk-edit",
6
6
  "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/action-bulk-edit",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "editionLevel": 0
26
26
  },
27
- "gitHead": "bb96d633a6371afb586072ff516bd0613c757db0",
27
+ "gitHead": "2807a8948412d9c235115a31a81a66f7c82dd173",
28
28
  "keywords": [
29
29
  "Actions"
30
30
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import type { FlowSchemaContribution } from '@nocobase/flow-engine';
10
- export declare const flowSchemaContribution: FlowSchemaContribution;
@@ -1,382 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var flow_schema_contributions_exports = {};
28
- __export(flow_schema_contributions_exports, {
29
- flowSchemaContribution: () => flowSchemaContribution
30
- });
31
- module.exports = __toCommonJS(flow_schema_contributions_exports);
32
- const genericModelNodeSchema = {
33
- type: "object",
34
- required: ["uid", "use"],
35
- properties: {
36
- uid: { type: "string" },
37
- use: { type: "string" }
38
- },
39
- additionalProperties: true
40
- };
41
- const gridRowsSchema = {
42
- type: "object",
43
- description: "Map of row ids to column definitions. Each row value is a string[][] where every inner array lists the child model UIDs rendered inside one column.",
44
- additionalProperties: {
45
- type: "array",
46
- items: {
47
- type: "array",
48
- items: {
49
- type: "string"
50
- }
51
- }
52
- }
53
- };
54
- const gridSizesSchema = {
55
- type: "object",
56
- description: "Map of row ids to column widths. Each width array uses the 24-column grid system, for example [12, 12] or [8, 8, 8].",
57
- additionalProperties: {
58
- type: "array",
59
- items: {
60
- type: "number"
61
- }
62
- }
63
- };
64
- const gridRowOrderSchema = {
65
- type: "array",
66
- description: "Optional explicit row order. When omitted, the persisted row key order is used.",
67
- items: {
68
- type: "string"
69
- }
70
- };
71
- const createGridLayoutStepParamsSchema = () => ({
72
- type: "object",
73
- properties: {
74
- gridSettings: {
75
- type: "object",
76
- properties: {
77
- grid: {
78
- type: "object",
79
- description: "Persisted multi-row, multi-column grid layout.",
80
- properties: {
81
- rows: gridRowsSchema,
82
- sizes: gridSizesSchema,
83
- rowOrder: gridRowOrderSchema
84
- },
85
- additionalProperties: false
86
- }
87
- },
88
- additionalProperties: true
89
- }
90
- },
91
- additionalProperties: true
92
- });
93
- const createGridLayoutStepParamsValue = (rows, sizes, rowOrder) => ({
94
- gridSettings: {
95
- grid: {
96
- rows,
97
- sizes,
98
- rowOrder
99
- }
100
- }
101
- });
102
- const createGridLayoutItems = (itemUses, prefix, count) => Array.from({ length: count }, (_, index) => ({
103
- uid: `${prefix}-item-${index + 1}`,
104
- use: itemUses[index % itemUses.length]
105
- }));
106
- const createGridLayoutDocs = (options) => {
107
- const minimalItems = createGridLayoutItems(options.itemUses, `${options.prefix}-minimal`, 1);
108
- const standardItems = createGridLayoutItems(options.itemUses, `${options.prefix}-standard`, 5);
109
- const customSizeItems = createGridLayoutItems(options.itemUses, `${options.prefix}-sizes`, 5);
110
- return {
111
- minimalExample: {
112
- uid: `${options.prefix}-grid`,
113
- use: options.use,
114
- stepParams: createGridLayoutStepParamsValue({ rowMain: [[minimalItems[0].uid]] }, { rowMain: [24] }, ["rowMain"]),
115
- subModels: {
116
- items: minimalItems
117
- }
118
- },
119
- commonPatterns: [
120
- {
121
- title: "Single row with one column",
122
- description: "Use one row with a single 24-column slot when the grid only needs one child model.",
123
- snippet: {
124
- use: options.use,
125
- stepParams: createGridLayoutStepParamsValue({ rowMain: [[minimalItems[0].uid]] }, { rowMain: [24] }, [
126
- "rowMain"
127
- ]),
128
- subModels: {
129
- items: minimalItems
130
- }
131
- }
132
- },
133
- {
134
- title: "Two rows with 2 + 3 columns",
135
- description: "The first row has 2 columns and the second row has 3 columns with equal widths.",
136
- snippet: {
137
- use: options.use,
138
- stepParams: createGridLayoutStepParamsValue(
139
- {
140
- rowTop: [[standardItems[0].uid], [standardItems[1].uid]],
141
- rowBottom: [[standardItems[2].uid], [standardItems[3].uid], [standardItems[4].uid]]
142
- },
143
- {
144
- rowTop: [12, 12],
145
- rowBottom: [8, 8, 8]
146
- },
147
- ["rowTop", "rowBottom"]
148
- ),
149
- subModels: {
150
- items: standardItems
151
- }
152
- }
153
- },
154
- {
155
- title: "Two rows with custom column sizes",
156
- description: "Use sizes to express non-equal column widths while keeping the rows definition stable.",
157
- snippet: {
158
- use: options.use,
159
- stepParams: createGridLayoutStepParamsValue(
160
- {
161
- rowTop: [[customSizeItems[0].uid], [customSizeItems[1].uid]],
162
- rowBottom: [[customSizeItems[2].uid], [customSizeItems[3].uid], [customSizeItems[4].uid]]
163
- },
164
- {
165
- rowTop: [8, 16],
166
- rowBottom: [6, 10, 8]
167
- },
168
- ["rowTop", "rowBottom"]
169
- ),
170
- subModels: {
171
- items: customSizeItems
172
- }
173
- }
174
- }
175
- ],
176
- dynamicHints: options.dynamicHints || []
177
- };
178
- };
179
- const bulkEditBlockGridModelInternalSchemaContribution = {
180
- use: "BulkEditBlockGridModel",
181
- title: "Bulk edit block grid",
182
- source: "plugin",
183
- strict: false,
184
- exposure: "internal",
185
- suggestedUses: ["BulkEditActionModel"],
186
- stepParamsSchema: createGridLayoutStepParamsSchema(),
187
- subModelSlots: {
188
- items: {
189
- type: "array",
190
- dynamic: true,
191
- schema: genericModelNodeSchema,
192
- description: "Bulk edit grid items depend on runtime block registries."
193
- }
194
- },
195
- skeleton: {
196
- uid: "todo-bulk-edit-grid-uid",
197
- use: "BulkEditBlockGridModel",
198
- subModels: {
199
- items: []
200
- }
201
- },
202
- docs: createGridLayoutDocs({
203
- use: "BulkEditBlockGridModel",
204
- itemUses: ["TableBlockModel", "JSBlockModel", "MarkdownBlockModel"],
205
- prefix: "bulk-edit-grid",
206
- dynamicHints: [
207
- {
208
- kind: "dynamic-children",
209
- path: "BulkEditBlockGridModel.subModels.items",
210
- message: "Bulk edit page blocks depend on runtime block registries and collection context.",
211
- "x-flow": {
212
- slotRules: {
213
- slotKey: "items",
214
- type: "array"
215
- },
216
- contextRequirements: ["block registry", "collection context"],
217
- unresolvedReason: "runtime-bulk-edit-grid-items"
218
- }
219
- }
220
- ]
221
- })
222
- };
223
- const bulkEditChildPageTabModelInternalSchemaContribution = {
224
- use: "BulkEditChildPageTabModel",
225
- title: "Bulk edit child page tab",
226
- source: "plugin",
227
- strict: false,
228
- exposure: "internal",
229
- suggestedUses: ["BulkEditActionModel"],
230
- subModelSlots: {
231
- grid: {
232
- type: "object",
233
- use: "BulkEditBlockGridModel",
234
- description: "Bulk edit tab content grid."
235
- }
236
- },
237
- skeleton: {
238
- uid: "todo-bulk-edit-tab-uid",
239
- use: "BulkEditChildPageTabModel",
240
- subModels: {
241
- grid: {
242
- uid: "todo-bulk-edit-tab-grid-uid",
243
- use: "BulkEditBlockGridModel"
244
- }
245
- }
246
- }
247
- };
248
- const bulkEditActionModelSchemaContribution = {
249
- use: "BulkEditActionModel",
250
- title: "Bulk edit action",
251
- source: "plugin",
252
- strict: false,
253
- stepParamsSchema: {
254
- type: "object",
255
- properties: {
256
- bulkEditSettings: {
257
- type: "object",
258
- properties: {
259
- editMode: {
260
- type: "object",
261
- properties: {
262
- value: {
263
- type: "string",
264
- enum: ["selected", "all"]
265
- }
266
- },
267
- required: ["value"],
268
- additionalProperties: false
269
- }
270
- },
271
- additionalProperties: true
272
- }
273
- },
274
- additionalProperties: true
275
- },
276
- subModelSlots: {
277
- page: {
278
- type: "object",
279
- use: "ChildPageModel",
280
- description: "Popup child page used to host bulk edit tabs.",
281
- childSchemaPatch: {
282
- subModelSlots: {
283
- tabs: {
284
- type: "array",
285
- uses: ["BulkEditChildPageTabModel"],
286
- description: "Bulk edit tabs."
287
- }
288
- }
289
- }
290
- }
291
- },
292
- skeleton: {
293
- uid: "todo-bulk-edit-action-uid",
294
- use: "BulkEditActionModel",
295
- stepParams: {
296
- bulkEditSettings: {
297
- editMode: {
298
- value: "selected"
299
- }
300
- }
301
- },
302
- subModels: {
303
- page: {
304
- uid: "todo-bulk-edit-page-uid",
305
- use: "ChildPageModel",
306
- stepParams: {
307
- pageSettings: {
308
- general: {
309
- displayTitle: false,
310
- enableTabs: true
311
- }
312
- }
313
- },
314
- subModels: {
315
- tabs: [
316
- {
317
- uid: "todo-bulk-edit-tab-uid",
318
- use: "BulkEditChildPageTabModel",
319
- stepParams: {
320
- pageTabSettings: {
321
- tab: {
322
- title: "Bulk edit"
323
- }
324
- }
325
- },
326
- subModels: {
327
- grid: {
328
- uid: "todo-bulk-edit-grid-uid",
329
- use: "BulkEditBlockGridModel"
330
- }
331
- }
332
- }
333
- ]
334
- }
335
- }
336
- }
337
- },
338
- docs: {
339
- minimalExample: {
340
- uid: "bulk-edit-users",
341
- use: "BulkEditActionModel",
342
- stepParams: {
343
- bulkEditSettings: {
344
- editMode: {
345
- value: "selected"
346
- }
347
- }
348
- },
349
- subModels: {
350
- page: {
351
- uid: "bulk-edit-users-page",
352
- use: "ChildPageModel"
353
- }
354
- }
355
- },
356
- dynamicHints: [
357
- {
358
- kind: "dynamic-children",
359
- path: "BulkEditActionModel.subModels.page.subModels.tabs[*].subModels.grid.subModels.items",
360
- message: "Bulk edit blocks inside the popup grid depend on runtime block registries.",
361
- "x-flow": {
362
- contextRequirements: ["block registry", "collection context"],
363
- unresolvedReason: "runtime-bulk-edit-grid-items"
364
- }
365
- }
366
- ]
367
- }
368
- };
369
- const flowSchemaContribution = {
370
- models: [
371
- bulkEditBlockGridModelInternalSchemaContribution,
372
- bulkEditChildPageTabModelInternalSchemaContribution,
373
- bulkEditActionModelSchemaContribution
374
- ],
375
- defaults: {
376
- source: "plugin"
377
- }
378
- };
379
- // Annotate the CommonJS export names for ESM import in node:
380
- 0 && (module.exports = {
381
- flowSchemaContribution
382
- });