@nocobase/plugin-theme-editor 0.18.0-alpha.9 → 0.19.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.
@@ -1,13 +1,13 @@
1
1
  module.exports = {
2
- "@nocobase/client": "0.18.0-alpha.9",
2
+ "@nocobase/client": "0.19.0-alpha.1",
3
3
  "react": "18.2.0",
4
- "antd": "5.12.2",
4
+ "antd": "5.12.8",
5
5
  "lodash": "4.17.21",
6
- "@nocobase/server": "0.18.0-alpha.9",
6
+ "@nocobase/server": "0.19.0-alpha.1",
7
7
  "@ant-design/cssinjs": "1.18.1",
8
8
  "@ant-design/icons": "5.2.6",
9
- "@nocobase/utils": "0.18.0-alpha.9",
9
+ "@nocobase/utils": "0.19.0-alpha.1",
10
10
  "react-i18next": "11.18.6",
11
- "@nocobase/database": "0.18.0-alpha.9",
11
+ "@nocobase/database": "0.19.0-alpha.1",
12
12
  "@emotion/css": "11.11.2"
13
13
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@nocobase/database").CollectionOptions;
2
+ export default _default;
@@ -0,0 +1,52 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var theme_config_exports = {};
19
+ __export(theme_config_exports, {
20
+ default: () => theme_config_default
21
+ });
22
+ module.exports = __toCommonJS(theme_config_exports);
23
+ var import_database = require("@nocobase/database");
24
+ var theme_config_default = (0, import_database.defineCollection)({
25
+ name: "themeConfig",
26
+ dumpRules: "required",
27
+ fields: [
28
+ // 主题配置内容,一个 JSON 字符串
29
+ {
30
+ type: "json",
31
+ name: "config"
32
+ },
33
+ // 主题是否可选
34
+ {
35
+ type: "boolean",
36
+ name: "optional"
37
+ },
38
+ {
39
+ type: "boolean",
40
+ name: "isBuiltIn"
41
+ },
42
+ {
43
+ type: "uid",
44
+ name: "uid"
45
+ },
46
+ {
47
+ type: "radio",
48
+ name: "default",
49
+ defaultValue: false
50
+ }
51
+ ]
52
+ });
@@ -1,5 +1,6 @@
1
1
  import { Migration } from '@nocobase/server';
2
- export default class ThemeEditorMigration extends Migration {
2
+ export default class extends Migration {
3
+ appVersion: string;
3
4
  up(): Promise<void>;
4
5
  down(): Promise<void>;
5
6
  }
@@ -17,13 +17,14 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var theme_editor_exports = {};
19
19
  __export(theme_editor_exports, {
20
- default: () => ThemeEditorMigration
20
+ default: () => theme_editor_default
21
21
  });
22
22
  module.exports = __toCommonJS(theme_editor_exports);
23
23
  var import_server = require("@nocobase/server");
24
24
  var import_utils = require("@nocobase/utils");
25
25
  var import_builtinThemes = require("../builtinThemes");
26
- class ThemeEditorMigration extends import_server.Migration {
26
+ class theme_editor_default extends import_server.Migration {
27
+ appVersion = "<0.14.0-alpha.8";
27
28
  async up() {
28
29
  const result = await this.app.version.satisfies("<0.14.0-alpha.8");
29
30
  if (!result) {
@@ -1,5 +1,6 @@
1
1
  import { Migration } from '@nocobase/server';
2
- export default class ThemeEditorMigration extends Migration {
2
+ export default class extends Migration {
3
+ appVersion: string;
3
4
  up(): Promise<void>;
4
5
  down(): Promise<void>;
5
6
  }
@@ -17,11 +17,12 @@ var __copyProps = (to, from, except, desc) => {
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
  var add_default_field_exports = {};
19
19
  __export(add_default_field_exports, {
20
- default: () => ThemeEditorMigration
20
+ default: () => add_default_field_default
21
21
  });
22
22
  module.exports = __toCommonJS(add_default_field_exports);
23
23
  var import_server = require("@nocobase/server");
24
- class ThemeEditorMigration extends import_server.Migration {
24
+ class add_default_field_default extends import_server.Migration {
25
+ appVersion = "<0.17.0-alpha.5";
25
26
  async up() {
26
27
  var _a;
27
28
  const result = await this.app.version.satisfies("<0.17.0-alpha.5");
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
  var plugin_exports = {};
19
29
  __export(plugin_exports, {
@@ -22,7 +32,7 @@ __export(plugin_exports, {
22
32
  });
23
33
  module.exports = __toCommonJS(plugin_exports);
24
34
  var import_server = require("@nocobase/server");
25
- var import_path = require("path");
35
+ var import_path = __toESM(require("path"));
26
36
  var import_builtinThemes = require("./builtinThemes");
27
37
  class ThemeEditorPlugin extends import_server.Plugin {
28
38
  theme;
@@ -31,34 +41,7 @@ class ThemeEditorPlugin extends import_server.Plugin {
31
41
  async beforeLoad() {
32
42
  }
33
43
  async load() {
34
- this.db.collection({
35
- name: "themeConfig",
36
- fields: [
37
- // 主题配置内容,一个 JSON 字符串
38
- {
39
- type: "json",
40
- name: "config"
41
- },
42
- // 主题是否可选
43
- {
44
- type: "boolean",
45
- name: "optional"
46
- },
47
- {
48
- type: "boolean",
49
- name: "isBuiltIn"
50
- },
51
- {
52
- type: "uid",
53
- name: "uid"
54
- },
55
- {
56
- type: "radio",
57
- name: "default",
58
- defaultValue: false
59
- }
60
- ]
61
- });
44
+ await this.importCollections(import_path.default.resolve(__dirname, "./collections"));
62
45
  this.db.addMigrations({
63
46
  namespace: "theme-editor",
64
47
  directory: (0, import_path.resolve)(__dirname, "./migrations"),
package/dist/types.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import type { ThemeConfig as Config } from '@nocobase/client';
2
2
  import type { ReactElement } from 'react';
3
- export type ThemeConfig = Config & {
4
- name?: string;
5
- };
3
+ export type ThemeConfig = Config;
6
4
  export interface ThemeItem {
7
5
  id: number;
8
6
  /** 主题配置内容,一个 JSON 字符串 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-theme-editor",
3
- "version": "0.18.0-alpha.9",
3
+ "version": "0.19.0-alpha.1",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Theme editor",
6
6
  "displayName.zh-CN": "主题编辑器",
@@ -30,5 +30,5 @@
30
30
  "@nocobase/test": "0.x",
31
31
  "@nocobase/utils": "0.x"
32
32
  },
33
- "gitHead": "34ca0df4eede2e83fc86297b0fe19eba970e2b1b"
33
+ "gitHead": "64601944412fc4d2e2bd05f4b982118dd28247dc"
34
34
  }