@nocobase/plugin-ui-schema-storage 1.8.0-beta.9 → 1.9.0-alpha.1

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.
@@ -8,14 +8,14 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.8.0-beta.9",
12
- "@nocobase/database": "1.8.0-beta.9",
13
- "@nocobase/cache": "1.8.0-beta.9",
14
- "@nocobase/utils": "1.8.0-beta.9",
11
+ "@nocobase/client": "1.9.0-alpha.1",
12
+ "@nocobase/database": "1.9.0-alpha.1",
13
+ "@nocobase/cache": "1.9.0-alpha.1",
14
+ "@nocobase/utils": "1.9.0-alpha.1",
15
15
  "lodash": "4.17.21",
16
- "@nocobase/server": "1.8.0-beta.9",
17
- "@nocobase/plugin-localization": "1.8.0-beta.9",
18
- "@nocobase/actions": "1.8.0-beta.9",
19
- "@nocobase/resourcer": "1.8.0-beta.9",
16
+ "@nocobase/server": "1.9.0-alpha.1",
17
+ "@nocobase/plugin-localization": "1.9.0-alpha.1",
18
+ "@nocobase/actions": "1.9.0-alpha.1",
19
+ "@nocobase/resourcer": "1.9.0-alpha.1",
20
20
  "@formily/json-schema": "2.3.0"
21
21
  };
@@ -258,7 +258,13 @@ const _UiSchemaRepository = class _UiSchemaRepository extends import_database.Re
258
258
  if (!(s == null ? void 0 : s.schema)) {
259
259
  return;
260
260
  }
261
- const keys = ["title", "description", "x-component-props.title", "x-decorator-props.title"];
261
+ const keys = [
262
+ "title",
263
+ "description",
264
+ "x-component-props.title",
265
+ "x-decorator-props.title",
266
+ "x-component-props.content"
267
+ ];
262
268
  let r = false;
263
269
  for (const key of keys) {
264
270
  if (import_lodash.default.get(s == null ? void 0 : s.schema, key)) {
@@ -53,15 +53,24 @@ var import_server_hooks = require("./server-hooks");
53
53
  var import_model2 = require("./server-hooks/model");
54
54
  const compile = (title) => (title || "").replace(/{{\s*t\(["|'|`](.*)["|'|`]\)\s*}}/g, "$1");
55
55
  function extractFields(obj) {
56
- var _a, _b, _c, _d;
57
- return [
56
+ var _a, _b, _c, _d, _e;
57
+ const fields = [
58
58
  obj.title,
59
59
  obj.description,
60
60
  (_a = obj["x-component-props"]) == null ? void 0 : _a.title,
61
61
  (_b = obj["x-component-props"]) == null ? void 0 : _b.description,
62
62
  (_c = obj["x-decorator-props"]) == null ? void 0 : _c.title,
63
63
  (_d = obj["x-decorator-props"]) == null ? void 0 : _d.description
64
- ].filter((value) => value !== void 0 && value !== "");
64
+ ];
65
+ const content = (_e = obj["x-component-props"]) == null ? void 0 : _e.content;
66
+ if (typeof content === "string") {
67
+ const regex = /\{\{\s*t\s+['"]([^'"]+)['"]\s*\}\}/g;
68
+ let match;
69
+ while ((match = regex.exec(content)) !== null) {
70
+ fields.push(match[1]);
71
+ }
72
+ }
73
+ return fields.filter((value) => value !== void 0 && value !== "");
65
74
  }
66
75
  class PluginUISchemaStorageServer extends import_server.Plugin {
67
76
  serverHooks;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "UI schema 存储服务",
5
5
  "description": "Provides centralized UI schema storage service.",
6
6
  "description.zh-CN": "提供中心化的 UI schema 存储服务。",
7
- "version": "1.8.0-beta.9",
7
+ "version": "1.9.0-alpha.1",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/ui-schema-storage",
@@ -23,7 +23,7 @@
23
23
  "@nocobase/test": "1.x",
24
24
  "@nocobase/utils": "1.x"
25
25
  },
26
- "gitHead": "a3449d646c72965845f8c52e52fff9dba759c564",
26
+ "gitHead": "71ebde8a27da3c5c4d64194571804eeab6e95ce0",
27
27
  "keywords": [
28
28
  "System & security"
29
29
  ]