@we-debug/core 0.43.4 → 0.44.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.44.0](https://github.com/dlhandsome/we-debug/compare/v0.43.5...v0.44.0) (2025-03-10)
7
+
8
+
9
+ ### Features
10
+
11
+ * support json view update ([12c0822](https://github.com/dlhandsome/we-debug/commit/12c0822fd4d1c87e893a0a61e087d8e5f2975a09))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.43.4](https://github.com/dlhandsome/we-debug/compare/v0.43.3...v0.43.4) (2025-03-10)
7
18
 
8
19
  **Note:** Version bump only for package @we-debug/core
@@ -3,6 +3,7 @@ import { compareFn } from '../types';
3
3
  export declare function getGroupsAllKeys(fn?: compareFn): string[];
4
4
  export declare function addRuleByGroup(k: string, rule: FormRule): void;
5
5
  export declare function addJsonViewByGroup(k: string, jsonview: JsonView): void;
6
+ export declare function updateJsonViewByGroup(k: string, jsonview: JsonView): void;
6
7
  export declare function getRuleByGroup(k: string): any;
7
8
  export declare function getJsonViewByGroup(k: string): any;
8
9
  export declare function removeGroupRule(k: string, rule: FormRule): void;
package/dist/api/group.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.removeGroupJsonView = exports.removeGroupRule = exports.getJsonViewByGroup = exports.getRuleByGroup = exports.addJsonViewByGroup = exports.addRuleByGroup = exports.getGroupsAllKeys = void 0;
6
+ exports.removeGroupJsonView = exports.removeGroupRule = exports.getJsonViewByGroup = exports.getRuleByGroup = exports.updateJsonViewByGroup = exports.addJsonViewByGroup = exports.addRuleByGroup = exports.getGroupsAllKeys = void 0;
7
7
  var index_1 = __importDefault(require("../store/index"));
8
8
  function getGroupsAllKeys(fn) {
9
9
  return index_1.default.group.getKeys(fn);
@@ -17,6 +17,10 @@ function addJsonViewByGroup(k, jsonview) {
17
17
  return index_1.default.group.add(k, jsonview);
18
18
  }
19
19
  exports.addJsonViewByGroup = addJsonViewByGroup;
20
+ function updateJsonViewByGroup(k, jsonview) {
21
+ return index_1.default.group.update(k, jsonview);
22
+ }
23
+ exports.updateJsonViewByGroup = updateJsonViewByGroup;
20
24
  function getRuleByGroup(k) {
21
25
  return index_1.default.group.get(k);
22
26
  }
@@ -2,5 +2,6 @@ import { JsonView } from '../model/index';
2
2
  import { IAddJsonViewOption } from '../types';
3
3
  export { createJsonView } from '../model/index';
4
4
  export declare function addJsonView(jsonview: JsonView, options?: IAddJsonViewOption): void;
5
+ export declare function updateJsonView(jsonview: JsonView, options?: IAddJsonViewOption): void;
5
6
  export declare function removeJsonView(jsonview: JsonView, options?: IAddJsonViewOption): void;
6
7
  export declare function getJsonView(): JsonView[];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getJsonView = exports.removeJsonView = exports.addJsonView = exports.createJsonView = void 0;
6
+ exports.getJsonView = exports.removeJsonView = exports.updateJsonView = exports.addJsonView = exports.createJsonView = void 0;
7
7
  var index_1 = __importDefault(require("../store/index"));
8
8
  var group_1 = require("./group");
9
9
  var index_2 = require("../model/index");
@@ -19,6 +19,17 @@ function addJsonView(jsonview, options) {
19
19
  index_1.default.event.emit('group:update');
20
20
  }
21
21
  exports.addJsonView = addJsonView;
22
+ function updateJsonView(jsonview, options) {
23
+ var _a;
24
+ index_1.default.jsonviews.update(jsonview);
25
+ var group = (_a = options === null || options === void 0 ? void 0 : options.group) === null || _a === void 0 ? void 0 : _a.name;
26
+ if (group) {
27
+ (0, group_1.updateJsonViewByGroup)(group, jsonview);
28
+ }
29
+ index_1.default.event.emit('jsonview:update');
30
+ index_1.default.event.emit('group:update');
31
+ }
32
+ exports.updateJsonView = updateJsonView;
22
33
  function removeJsonView(jsonview, options) {
23
34
  var _a;
24
35
  index_1.default.jsonviews.remove(jsonview);
@@ -6,4 +6,5 @@ export declare class MySet<T extends IBaseModel> {
6
6
  getById(id: number): T | undefined;
7
7
  add(s: T): void;
8
8
  remove(s: T): void;
9
+ update(s: T): void;
9
10
  }
package/dist/base/set.js CHANGED
@@ -24,6 +24,12 @@ var MySet = (function () {
24
24
  }
25
25
  }
26
26
  };
27
+ MySet.prototype.update = function (s) {
28
+ var index = this.arr.findIndex(function (item) { return item.id === s.id; });
29
+ if (index !== -1) {
30
+ this.arr[index] = s;
31
+ }
32
+ };
27
33
  return MySet;
28
34
  }());
29
35
  exports.MySet = MySet;
@@ -6,5 +6,6 @@ export declare class Group extends Store {
6
6
  constructor();
7
7
  getKeys(sortFn?: compareFn): string[];
8
8
  add(k: string, rule: FormRule | JsonView): void;
9
+ update(k: string, rule: FormRule | JsonView): void;
9
10
  remove(k: string, rule: FormRule | JsonView): void;
10
11
  }
@@ -36,6 +36,9 @@ var Group = (function (_super) {
36
36
  this.get(k).add(rule);
37
37
  }
38
38
  };
39
+ Group.prototype.update = function (k, rule) {
40
+ this.get(k).update(rule);
41
+ };
39
42
  Group.prototype.remove = function (k, rule) {
40
43
  var _a;
41
44
  var rules = (_a = this.get(k)) === null || _a === void 0 ? void 0 : _a.get();
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = "0.43.4";
4
+ exports.version = "0.44.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/core",
3
- "version": "0.43.4",
3
+ "version": "0.44.0",
4
4
  "description": "a useful debug tool for weapp",
5
5
  "author": {
6
6
  "name": "dlhandsome"
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@we-debug/plugin-appdata": "0.43.4",
28
- "@we-debug/plugin-error": "0.43.0",
29
- "@we-debug/plugin-launcher": "0.43.0",
30
- "@we-debug/plugin-network": "0.43.0",
31
- "@we-debug/plugin-router": "0.43.0",
32
- "@we-debug/plugin-ui-check": "0.43.0",
27
+ "@we-debug/plugin-appdata": "0.44.0",
28
+ "@we-debug/plugin-error": "0.44.0",
29
+ "@we-debug/plugin-launcher": "0.44.0",
30
+ "@we-debug/plugin-network": "0.44.0",
31
+ "@we-debug/plugin-router": "0.44.0",
32
+ "@we-debug/plugin-ui-check": "0.44.0",
33
33
  "deepmerge": "^4.2.2"
34
34
  },
35
35
  "readme": "ERROR: No README data found!",
@@ -39,5 +39,5 @@
39
39
  "@types/jest": "^29.5.11",
40
40
  "ts-jest": "^29.1.1"
41
41
  },
42
- "gitHead": "96b56563c8743eaccf33e7089370d8fe009d5ce0"
42
+ "gitHead": "d7451a394de645a2db8e32c81f07df47a6e5aa26"
43
43
  }