@nocobase/plugin-ui-templates 2.0.0-alpha.57

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 (106) hide show
  1. package/LICENSE.txt +172 -0
  2. package/build.config.ts +12 -0
  3. package/client.js +1 -0
  4. package/dist/client/collections/flowModelTemplates.d.ts +67 -0
  5. package/dist/client/components/FlowModelTemplatesPage.d.ts +12 -0
  6. package/dist/client/components/TemplateSelectOption.d.ts +20 -0
  7. package/dist/client/constants.d.ts +9 -0
  8. package/dist/client/hooks/useFlowModelTemplateActions.d.ts +24 -0
  9. package/dist/client/index.d.ts +13 -0
  10. package/dist/client/index.js +10 -0
  11. package/dist/client/locale.d.ts +18 -0
  12. package/dist/client/menuExtensions.d.ts +9 -0
  13. package/dist/client/models/ReferenceBlockModel.d.ts +47 -0
  14. package/dist/client/models/ReferenceFormGridModel.d.ts +38 -0
  15. package/dist/client/models/SubModelTemplateImporterModel.d.ts +55 -0
  16. package/dist/client/models/referenceShared.d.ts +23 -0
  17. package/dist/client/openViewActionExtensions.d.ts +10 -0
  18. package/dist/client/schemas/flowModelTemplates.d.ts +11 -0
  19. package/dist/client/subModelMenuExtensions.d.ts +10 -0
  20. package/dist/client/utils/infiniteSelect.d.ts +28 -0
  21. package/dist/client/utils/refHost.d.ts +20 -0
  22. package/dist/client/utils/templateCompatibility.d.ts +91 -0
  23. package/dist/client.d.ts +9 -0
  24. package/dist/client.js +42 -0
  25. package/dist/externalVersion.js +24 -0
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.js +48 -0
  28. package/dist/locale/de-DE.json +14 -0
  29. package/dist/locale/en-US.json +72 -0
  30. package/dist/locale/es-ES.json +14 -0
  31. package/dist/locale/fr-FR.json +14 -0
  32. package/dist/locale/hu-HU.json +14 -0
  33. package/dist/locale/id-ID.json +14 -0
  34. package/dist/locale/it-IT.json +14 -0
  35. package/dist/locale/ja-JP.json +14 -0
  36. package/dist/locale/ko-KR.json +14 -0
  37. package/dist/locale/nl-NL.json +14 -0
  38. package/dist/locale/pt-BR.json +14 -0
  39. package/dist/locale/ru-RU.json +14 -0
  40. package/dist/locale/tr-TR.json +14 -0
  41. package/dist/locale/uk-UA.json +14 -0
  42. package/dist/locale/vi-VN.json +14 -0
  43. package/dist/locale/zh-CN.json +71 -0
  44. package/dist/locale/zh-TW.json +14 -0
  45. package/dist/server/collections/flowModelTemplateUsages.d.ts +11 -0
  46. package/dist/server/collections/flowModelTemplateUsages.js +71 -0
  47. package/dist/server/collections/flowModelTemplates.d.ts +11 -0
  48. package/dist/server/collections/flowModelTemplates.js +96 -0
  49. package/dist/server/index.d.ts +9 -0
  50. package/dist/server/index.js +42 -0
  51. package/dist/server/plugin.d.ts +17 -0
  52. package/dist/server/plugin.js +242 -0
  53. package/dist/server/resources/flowModelTemplateUsages.d.ts +19 -0
  54. package/dist/server/resources/flowModelTemplateUsages.js +91 -0
  55. package/dist/server/resources/flowModelTemplates.d.ts +20 -0
  56. package/dist/server/resources/flowModelTemplates.js +267 -0
  57. package/package.json +37 -0
  58. package/server.js +1 -0
  59. package/src/client/__tests__/openViewActionExtensions.test.ts +1208 -0
  60. package/src/client/collections/flowModelTemplates.ts +131 -0
  61. package/src/client/components/FlowModelTemplatesPage.tsx +78 -0
  62. package/src/client/components/TemplateSelectOption.tsx +106 -0
  63. package/src/client/constants.ts +10 -0
  64. package/src/client/hooks/useFlowModelTemplateActions.tsx +137 -0
  65. package/src/client/index.ts +54 -0
  66. package/src/client/locale.ts +40 -0
  67. package/src/client/menuExtensions.tsx +1033 -0
  68. package/src/client/models/ReferenceBlockModel.tsx +793 -0
  69. package/src/client/models/ReferenceFormGridModel.tsx +302 -0
  70. package/src/client/models/SubModelTemplateImporterModel.tsx +634 -0
  71. package/src/client/models/__tests__/ReferenceBlockModel.test.tsx +482 -0
  72. package/src/client/models/__tests__/ReferenceFormGridModel.test.tsx +175 -0
  73. package/src/client/models/__tests__/SubModelTemplateImporterModel.test.ts +447 -0
  74. package/src/client/models/referenceShared.tsx +99 -0
  75. package/src/client/openViewActionExtensions.tsx +981 -0
  76. package/src/client/schemas/flowModelTemplates.ts +264 -0
  77. package/src/client/subModelMenuExtensions.ts +103 -0
  78. package/src/client/utils/infiniteSelect.ts +150 -0
  79. package/src/client/utils/refHost.ts +44 -0
  80. package/src/client/utils/templateCompatibility.ts +374 -0
  81. package/src/client.ts +10 -0
  82. package/src/index.ts +11 -0
  83. package/src/locale/de-DE.json +14 -0
  84. package/src/locale/en-US.json +72 -0
  85. package/src/locale/es-ES.json +14 -0
  86. package/src/locale/fr-FR.json +14 -0
  87. package/src/locale/hu-HU.json +14 -0
  88. package/src/locale/id-ID.json +14 -0
  89. package/src/locale/it-IT.json +14 -0
  90. package/src/locale/ja-JP.json +14 -0
  91. package/src/locale/ko-KR.json +14 -0
  92. package/src/locale/nl-NL.json +14 -0
  93. package/src/locale/pt-BR.json +14 -0
  94. package/src/locale/ru-RU.json +14 -0
  95. package/src/locale/tr-TR.json +14 -0
  96. package/src/locale/uk-UA.json +14 -0
  97. package/src/locale/vi-VN.json +14 -0
  98. package/src/locale/zh-CN.json +71 -0
  99. package/src/locale/zh-TW.json +14 -0
  100. package/src/server/__tests__/template-usage.test.ts +351 -0
  101. package/src/server/collections/flowModelTemplateUsages.ts +51 -0
  102. package/src/server/collections/flowModelTemplates.ts +76 -0
  103. package/src/server/index.ts +10 -0
  104. package/src/server/plugin.ts +236 -0
  105. package/src/server/resources/flowModelTemplateUsages.ts +61 -0
  106. package/src/server/resources/flowModelTemplates.ts +251 -0
@@ -0,0 +1,374 @@
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
+ import { NAMESPACE } from '../locale';
11
+
12
+ export const TEMPLATE_LIST_PAGE_SIZE = 20;
13
+
14
+ export function normalizeStr(value: unknown): string {
15
+ if (typeof value === 'string') return value.trim();
16
+ if (typeof value === 'number' || typeof value === 'boolean') return String(value).trim();
17
+ return '';
18
+ }
19
+
20
+ const toFiniteNumber = (value: unknown): number | undefined => {
21
+ if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
22
+ if (typeof value === 'string') {
23
+ const v = value.trim();
24
+ if (!v) return undefined;
25
+ const n = Number(v);
26
+ return Number.isFinite(n) ? n : undefined;
27
+ }
28
+ return undefined;
29
+ };
30
+
31
+ export function parseResourceListResponse<T = any>(res: any): { rows: T[]; count?: number } {
32
+ let cur = res;
33
+ if (cur && typeof cur === 'object' && 'data' in cur) {
34
+ cur = (cur as any).data;
35
+ }
36
+
37
+ // unwrap nested `data` layers (axios/rc-request differences)
38
+ for (let i = 0; i < 4; i++) {
39
+ if (Array.isArray(cur)) break;
40
+ if (cur && typeof cur === 'object' && Array.isArray((cur as any).rows)) break;
41
+ if (cur && typeof cur === 'object' && 'data' in cur) {
42
+ cur = (cur as any).data;
43
+ continue;
44
+ }
45
+ break;
46
+ }
47
+
48
+ const rows = Array.isArray(cur?.rows) ? cur.rows : Array.isArray(cur) ? cur : [];
49
+ const count = toFiniteNumber((cur as any)?.count ?? (cur as any)?.total ?? (cur as any)?.totalCount);
50
+ return { rows, count };
51
+ }
52
+
53
+ export function calcHasMore(args: { page: number; pageSize: number; rowsLength: number; count?: number }): boolean {
54
+ const count = args.count;
55
+ if (typeof count === 'number') {
56
+ return args.page * args.pageSize < count;
57
+ }
58
+ return args.rowsLength >= args.pageSize;
59
+ }
60
+
61
+ export function tWithNs(ctx: any, key: string, options?: Record<string, any>): string {
62
+ const opt = { ns: [NAMESPACE, 'client'], nsMode: 'fallback', ...(options || {}) };
63
+ return typeof ctx?.t === 'function' ? ctx.t(key, opt) : key;
64
+ }
65
+
66
+ function getDataSourceManager(ctx: any, override?: any) {
67
+ return (
68
+ override ||
69
+ ctx?.dataSourceManager ||
70
+ ctx?.model?.context?.dataSourceManager ||
71
+ ctx?.engine?.context?.dataSourceManager
72
+ );
73
+ }
74
+
75
+ export function resolveTargetResourceByAssociation(
76
+ ctx: any,
77
+ init: { dataSourceKey?: unknown; collectionName?: unknown; associationName?: unknown },
78
+ options?: { dataSourceManager?: any },
79
+ ): { dataSourceKey: string; collectionName: string } | undefined {
80
+ const dataSourceKey = normalizeStr(init?.dataSourceKey);
81
+ const collectionName = normalizeStr(init?.collectionName);
82
+ const associationName = normalizeStr(init?.associationName);
83
+ if (!dataSourceKey || !associationName) return undefined;
84
+
85
+ const parts = associationName.split('.').filter(Boolean);
86
+ const inferredBaseCollectionName = parts.length > 1 ? parts[0] : '';
87
+ const baseCollectionName = inferredBaseCollectionName || collectionName;
88
+ const fieldPath = parts.length > 1 ? parts.slice(1).join('.') : associationName;
89
+ if (!baseCollectionName || !fieldPath) return undefined;
90
+
91
+ const dsManager = getDataSourceManager(ctx, options?.dataSourceManager);
92
+ const baseCollection = dsManager?.getCollection?.(dataSourceKey, baseCollectionName);
93
+ const field = baseCollection?.getFieldByPath?.(fieldPath) || baseCollection?.getField?.(fieldPath);
94
+ const targetCollection = field?.targetCollection;
95
+ const targetDataSourceKey = normalizeStr(targetCollection?.dataSourceKey);
96
+ const targetCollectionName = normalizeStr(targetCollection?.name);
97
+ if (!targetDataSourceKey || !targetCollectionName) return undefined;
98
+ return { dataSourceKey: targetDataSourceKey, collectionName: targetCollectionName };
99
+ }
100
+
101
+ export function resolveBaseResourceByAssociation(init: {
102
+ dataSourceKey?: unknown;
103
+ collectionName?: unknown;
104
+ associationName?: unknown;
105
+ }): { dataSourceKey: string; collectionName: string } | undefined {
106
+ const dataSourceKey = normalizeStr(init?.dataSourceKey);
107
+ const collectionName = normalizeStr(init?.collectionName);
108
+ const associationName = normalizeStr(init?.associationName);
109
+ if (!dataSourceKey || !associationName) return undefined;
110
+
111
+ const parts = associationName.split('.').filter(Boolean);
112
+ const inferredBaseCollectionName = parts.length > 1 ? parts[0] : '';
113
+ const baseCollectionName = inferredBaseCollectionName || collectionName;
114
+ if (!baseCollectionName) return undefined;
115
+ return { dataSourceKey, collectionName: baseCollectionName };
116
+ }
117
+
118
+ export function resolveExpectedResourceInfoByModelChain(
119
+ ctx: any,
120
+ startModel?: any,
121
+ options?: {
122
+ maxDepth?: number;
123
+ dataSourceManager?: any;
124
+ fallbackCollectionFromCtx?: boolean;
125
+ includeAssociationName?: boolean;
126
+ },
127
+ ): { dataSourceKey?: string; collectionName?: string; associationName?: string } {
128
+ const maxDepth = options?.maxDepth ?? 8;
129
+ const includeAssociationName = !!options?.includeAssociationName;
130
+ const fallbackCollectionFromCtx = !!options?.fallbackCollectionFromCtx;
131
+
132
+ let cur: any = startModel;
133
+ let depth = 0;
134
+ while (cur && depth < maxDepth) {
135
+ const init = cur?.getStepParams?.('resourceSettings', 'init') || {};
136
+ const expectedAssociationName = normalizeStr(init?.associationName);
137
+
138
+ const assocResolved = resolveTargetResourceByAssociation(ctx, init, {
139
+ dataSourceManager: options?.dataSourceManager,
140
+ });
141
+ if (assocResolved) {
142
+ return {
143
+ ...assocResolved,
144
+ ...(includeAssociationName && expectedAssociationName ? { associationName: expectedAssociationName } : {}),
145
+ };
146
+ }
147
+
148
+ try {
149
+ const c = (cur as any)?.collection || (fallbackCollectionFromCtx ? (ctx as any)?.collection : undefined);
150
+ const dataSourceKey = normalizeStr(c?.dataSourceKey);
151
+ const collectionName = normalizeStr(c?.name);
152
+ if (dataSourceKey && collectionName) {
153
+ return {
154
+ dataSourceKey,
155
+ collectionName,
156
+ ...(includeAssociationName && expectedAssociationName ? { associationName: expectedAssociationName } : {}),
157
+ };
158
+ }
159
+ } catch {
160
+ // ignore
161
+ }
162
+
163
+ const dataSourceKey = normalizeStr(init?.dataSourceKey);
164
+ const collectionName = normalizeStr(init?.collectionName);
165
+ if (dataSourceKey && collectionName) {
166
+ return {
167
+ dataSourceKey,
168
+ collectionName,
169
+ ...(includeAssociationName && expectedAssociationName ? { associationName: expectedAssociationName } : {}),
170
+ };
171
+ }
172
+
173
+ cur = cur?.parent;
174
+ depth++;
175
+ }
176
+ return {};
177
+ }
178
+
179
+ export type TemplateAssociationMatchStrategy = 'none' | 'exactIfTemplateHasAssociationName' | 'associationResourceOnly';
180
+
181
+ /**
182
+ * 推断弹窗模板是否需要 record/source 上下文。
183
+ * 用于避免 Collection 模板被误判为 Record 模板(尤其是默认值里带 `{{ ctx.record.* }}` 的情况)。
184
+ */
185
+ export type PopupTemplateContextFlags = {
186
+ hasFilterByTk: boolean;
187
+ hasSourceId: boolean;
188
+ /** 是否有足够信息确定 hasFilterByTk(用于运行时决定是否覆盖) */
189
+ confidentFilterByTk: boolean;
190
+ /** 是否有足够信息确定 hasSourceId */
191
+ confidentSourceId: boolean;
192
+ };
193
+
194
+ export type ActionSceneType = 'record' | 'collection' | 'both' | undefined;
195
+
196
+ /**
197
+ * 根据 Model 类的 _isScene 方法推断 action 场景类型
198
+ */
199
+ export function resolveActionScene(
200
+ getModelClass: ((use: string) => any) | undefined,
201
+ useModel?: unknown,
202
+ ): ActionSceneType {
203
+ const useKey = normalizeStr(useModel);
204
+ if (!useKey || !getModelClass) return undefined;
205
+ const ModelClass = getModelClass(useKey);
206
+ if (!ModelClass) return undefined;
207
+ const isScene = ModelClass?._isScene;
208
+ if (typeof isScene !== 'function') return undefined;
209
+ const isRecord = !!isScene.call(ModelClass, 'record');
210
+ const isCollection = !!isScene.call(ModelClass, 'collection');
211
+ if (isRecord && isCollection) return 'both';
212
+ if (isRecord) return 'record';
213
+ if (isCollection) return 'collection';
214
+ return undefined;
215
+ }
216
+
217
+ const includesRecordVar = (expr: string): boolean => expr.includes('ctx.record');
218
+ const includesResourceVar = (expr: string): boolean => expr.includes('ctx.resource');
219
+
220
+ /**
221
+ * 推断弹窗模板的 filterByTk/sourceId 上下文需求
222
+ */
223
+ export function inferPopupTemplateContextFlags(
224
+ scene: ActionSceneType,
225
+ filterByTkExpr?: string,
226
+ sourceIdExpr?: string,
227
+ ): PopupTemplateContextFlags {
228
+ const filterByTkStr = normalizeStr(filterByTkExpr);
229
+ const sourceIdStr = normalizeStr(sourceIdExpr);
230
+
231
+ const isCollectionOnly = scene === 'collection';
232
+ const isRecordOnly = scene === 'record';
233
+
234
+ let hasFilterByTk = false;
235
+ let confidentFilterByTk = false;
236
+
237
+ if (filterByTkStr) {
238
+ // Collection-only 模板里出现 `{{ ctx.record.* }}` 通常来自默认值,不应视为"模板需要 record 场景"
239
+ if (isCollectionOnly && includesRecordVar(filterByTkStr)) {
240
+ hasFilterByTk = false;
241
+ confidentFilterByTk = true;
242
+ } else {
243
+ hasFilterByTk = true;
244
+ confidentFilterByTk = true;
245
+ }
246
+ } else if (isRecordOnly) {
247
+ // record 场景模板未配置 filterByTk 时,仍按 record 场景处理
248
+ hasFilterByTk = true;
249
+ confidentFilterByTk = true;
250
+ } else if (isCollectionOnly) {
251
+ hasFilterByTk = false;
252
+ confidentFilterByTk = true;
253
+ } else {
254
+ hasFilterByTk = false;
255
+ confidentFilterByTk = false;
256
+ }
257
+
258
+ let hasSourceId = false;
259
+ let confidentSourceId = false;
260
+
261
+ if (sourceIdStr) {
262
+ // Collection-only 模板里出现 `{{ ctx.resource.* }}` 大多无意义,避免把 Record/关联上下文的 sourceId 透传到纯 collection 模板
263
+ if (isCollectionOnly && includesResourceVar(sourceIdStr)) {
264
+ hasSourceId = false;
265
+ confidentSourceId = true;
266
+ } else {
267
+ hasSourceId = true;
268
+ confidentSourceId = true;
269
+ }
270
+ } else {
271
+ hasSourceId = false;
272
+ // sourceId 没有强推断规则:仅在显式存在时才认为模板需要
273
+ confidentSourceId = false;
274
+ }
275
+
276
+ return { hasFilterByTk, hasSourceId, confidentFilterByTk, confidentSourceId };
277
+ }
278
+
279
+ /**
280
+ * 从已保存的 openView params 中提取 PopupTemplateContextFlags(用于 copy 模式或无法获取模板记录时的兜底)
281
+ */
282
+ export function extractPopupTemplateContextFlagsFromParams(params: {
283
+ popupTemplateHasFilterByTk?: boolean;
284
+ popupTemplateHasSourceId?: boolean;
285
+ }): PopupTemplateContextFlags {
286
+ return {
287
+ hasFilterByTk: typeof params?.popupTemplateHasFilterByTk === 'boolean' ? params.popupTemplateHasFilterByTk : false,
288
+ hasSourceId: typeof params?.popupTemplateHasSourceId === 'boolean' ? params.popupTemplateHasSourceId : false,
289
+ confidentFilterByTk: false,
290
+ confidentSourceId: false,
291
+ };
292
+ }
293
+
294
+ export function getTemplateAvailabilityDisabledReason(
295
+ ctx: any,
296
+ tpl: { dataSourceKey?: unknown; collectionName?: unknown; associationName?: unknown },
297
+ expected: { dataSourceKey?: unknown; collectionName?: unknown; associationName?: unknown },
298
+ options?: { dataSourceManager?: any; checkResource?: boolean; associationMatch?: TemplateAssociationMatchStrategy },
299
+ ): string | undefined {
300
+ const checkResource = options?.checkResource !== false;
301
+ const associationMatch = options?.associationMatch ?? 'none';
302
+
303
+ const expectedDataSourceKey = normalizeStr(expected?.dataSourceKey);
304
+ const expectedCollectionName = normalizeStr(expected?.collectionName);
305
+ const expectedAssociationName = normalizeStr(expected?.associationName);
306
+
307
+ const tplAssociationName = normalizeStr(tpl?.associationName);
308
+
309
+ const getAssociationMismatchReason = (): string | undefined => {
310
+ if (associationMatch === 'none') return undefined;
311
+ if (associationMatch === 'exactIfTemplateHasAssociationName') {
312
+ if (!tplAssociationName) return undefined;
313
+ if (expectedAssociationName === tplAssociationName) return undefined;
314
+ const none = tWithNs(ctx, 'No association');
315
+ return tWithNs(ctx, 'Template association mismatch', {
316
+ expected: expectedAssociationName || none,
317
+ actual: tplAssociationName || none,
318
+ });
319
+ }
320
+
321
+ const isAssociationResource = (v: string) => !!v && v.includes('.');
322
+ const tplAssociationResource = isAssociationResource(tplAssociationName) ? tplAssociationName : '';
323
+ if (!tplAssociationResource) return undefined;
324
+ const expectedAssociationResource = isAssociationResource(expectedAssociationName) ? expectedAssociationName : '';
325
+ if (tplAssociationResource === expectedAssociationResource) return undefined;
326
+ const none = tWithNs(ctx, 'No association');
327
+ return tWithNs(ctx, 'Template association mismatch', {
328
+ expected: expectedAssociationResource || none,
329
+ actual: tplAssociationResource || none,
330
+ });
331
+ };
332
+
333
+ if (!checkResource) {
334
+ return getAssociationMismatchReason();
335
+ }
336
+
337
+ if (!expectedDataSourceKey || !expectedCollectionName) return undefined;
338
+
339
+ const baseTplDataSourceKey = normalizeStr(tpl?.dataSourceKey);
340
+ const baseTplCollectionName = normalizeStr(tpl?.collectionName);
341
+ const tplResolved = tplAssociationName
342
+ ? resolveTargetResourceByAssociation(
343
+ ctx,
344
+ {
345
+ dataSourceKey: baseTplDataSourceKey,
346
+ collectionName: baseTplCollectionName,
347
+ associationName: tplAssociationName,
348
+ },
349
+ { dataSourceManager: options?.dataSourceManager },
350
+ )
351
+ : undefined;
352
+ const tplDataSourceKey = tplResolved?.dataSourceKey || baseTplDataSourceKey;
353
+ const tplCollectionName = tplResolved?.collectionName || baseTplCollectionName;
354
+
355
+ if (!tplDataSourceKey || !tplCollectionName) {
356
+ return tWithNs(ctx, 'Template missing data source/collection info');
357
+ }
358
+
359
+ if (tplDataSourceKey === expectedDataSourceKey && tplCollectionName === expectedCollectionName) {
360
+ return getAssociationMismatchReason();
361
+ }
362
+
363
+ const isSameDataSource = tplDataSourceKey === expectedDataSourceKey;
364
+ if (isSameDataSource) {
365
+ return tWithNs(ctx, 'Template collection mismatch', {
366
+ expected: expectedCollectionName,
367
+ actual: tplCollectionName,
368
+ });
369
+ }
370
+ return tWithNs(ctx, 'Template data source mismatch', {
371
+ expected: `${expectedDataSourceKey}/${expectedCollectionName}`,
372
+ actual: `${tplDataSourceKey}/${tplCollectionName}`,
373
+ });
374
+ }
package/src/client.ts ADDED
@@ -0,0 +1,10 @@
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
+ export { default } from './client/index';
package/src/index.ts ADDED
@@ -0,0 +1,11 @@
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
+ export * from './server';
11
+ export { default } from './server';
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "UI templates": "UI templates",
3
+ "Block templates (v2)": "Block templates (v2)",
4
+ "Popup templates (v2)": "Popup templates (v2)",
5
+ "Actions": "Actions",
6
+ "Are you sure you want to delete this item? This action cannot be undone.": "Are you sure you want to delete this item? This action cannot be undone.",
7
+ "Block UID": "Block UID",
8
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
9
+ "Block template": "Block template",
10
+ "Select block template": "Select block template",
11
+ "Block templates": "Block templates",
12
+ "Duplicate": "Duplicate",
13
+ "Delete template": "Delete template",
14
+ "Edit": "Edit",
15
+ "Edit template": "Edit template",
16
+ "Mode": "Mode",
17
+ "Other blocks": "Other blocks",
18
+ "Please configure target block": "Please configure target block",
19
+ "Reference": "Reference",
20
+ "Saved": "Saved",
21
+ "Search templates": "Search templates",
22
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
23
+ "Target UID": "Target UID",
24
+ "Target block is invalid": "Target block is invalid",
25
+ "Template": "Template",
26
+ "Cannot resolve template parameter {{param}}": "Missing {{param}}, cannot use",
27
+ "Template description": "Template description",
28
+ "Template name": "Template name",
29
+ "Template name is required": "Template name is required",
30
+ "Template settings": "Template settings",
31
+ "Template is in use and cannot be deleted": "Template is in use and cannot be deleted",
32
+ "Usage count": "Usage count",
33
+ "Deleted": "Deleted",
34
+ "Using reference fields will remove existing fields": "Using reference fields will remove existing fields.",
35
+ "This block already references field template, please convert fields to copy first": "This block already references a field template. Please convert fields to duplicate first.",
36
+ "Convert reference to duplicate": "Convert reference to duplicate",
37
+ "Save as template": "Save as template",
38
+ "Convert reference to duplicate is unavailable": "Convert reference to duplicate is unavailable",
39
+ "Are you sure to convert this template block to copy mode?": "Are you sure to convert this template block to duplicate mode?",
40
+ "Convert reference fields to duplicate": "Convert reference fields to duplicate",
41
+ "Field template": "Field template",
42
+ "Are you sure to convert referenced fields to copy mode?": "Are you sure to convert referenced fields to duplicate mode?",
43
+ "Template missing data source/collection info": "Template missing data source/collection info",
44
+ "Template collection mismatch": "Collection mismatch: requires \"{{expected}}\", but template is for \"{{actual}}\"",
45
+ "Template data source mismatch": "Data source mismatch: requires \"{{expected}}\", but template is for \"{{actual}}\"",
46
+ "No association": "(none)",
47
+ "Template association mismatch": "Association mismatch: requires \"{{expected}}\", but template is for \"{{actual}}\"",
48
+ "Popup template": "Popup template",
49
+ "Popup templates": "Popup templates",
50
+ "Select popup template": "Select popup template",
51
+ "Replace current block with reference template": "Replace current block with reference template",
52
+ "Replace current popup with reference template": "Replace current popup with reference template",
53
+ "Are you sure to convert this pop-up to copy mode?": "Are you sure to convert this pop-up to duplicate mode?",
54
+ "This pop-up is not using a popup template": "This pop-up is not using a popup template",
55
+ "Converted": "Converted",
56
+ "Only Popup can be saved as popup template": "Only Popup can be saved as popup template",
57
+ "Popup template not found": "Popup template not found",
58
+ "Failed to duplicate pop-up": "Failed to duplicate pop-up",
59
+ "Failed to copy popup from template": "Failed to duplicate popup from template",
60
+ "Template field section description": "The field section of the specified block template will be used",
61
+ "Reference mode description": "Modifying the block will update all places that reference this template.",
62
+ "Duplicate mode description": "Generates new content based on the template. All UIDs (including child node UIDs) will be regenerated. Cross-block UID references will no longer work after duplication.",
63
+ "Save mode": "Save mode",
64
+ "Convert current block to template": "Convert current block to template",
65
+ "Convert current block to template description": "The current block itself will become a template reference",
66
+ "Duplicate current block as template": "Duplicate current block as template",
67
+ "Duplicate current block as template description": "Keep original block, create a copy as template",
68
+ "Convert current popup to template": "Convert current popup to template",
69
+ "Convert current popup to template description": "The current popup itself will become a template reference",
70
+ "Duplicate current popup as template": "Duplicate current popup as template",
71
+ "Duplicate current popup as template description": "Keep original popup, create a copy as template"
72
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "Block UID": "Block UID",
3
+ "Block UID is already set and cannot be modified": "Block UID is already set and cannot be modified",
4
+ "Copy": "Copy",
5
+ "Other blocks": "Other blocks",
6
+ "Please configure target block": "Please configure target block",
7
+ "Reference": "Reference",
8
+ "Reference block": "Reference block",
9
+ "Reference mode": "Reference mode",
10
+ "Reference settings": "Reference settings",
11
+ "Some configurations using uid may need to be reconfigured": "Some configurations using uid may need to be reconfigured",
12
+ "Target UID": "Target UID",
13
+ "Target block is invalid": "Target block is invalid"
14
+ }