@arcanejs/toolkit 0.5.0 → 1.0.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.
Files changed (75) hide show
  1. package/dist/backend/components/base.d.mts +25 -22
  2. package/dist/backend/components/base.d.ts +25 -22
  3. package/dist/backend/components/base.js +2 -2
  4. package/dist/backend/components/base.mjs +1 -1
  5. package/dist/backend/components/button.d.mts +5 -3
  6. package/dist/backend/components/button.d.ts +5 -3
  7. package/dist/backend/components/button.js +3 -3
  8. package/dist/backend/components/button.mjs +2 -2
  9. package/dist/backend/components/group.d.mts +6 -4
  10. package/dist/backend/components/group.d.ts +6 -4
  11. package/dist/backend/components/group.js +3 -3
  12. package/dist/backend/components/group.mjs +2 -2
  13. package/dist/backend/components/label.d.mts +4 -3
  14. package/dist/backend/components/label.d.ts +4 -3
  15. package/dist/backend/components/label.js +3 -3
  16. package/dist/backend/components/label.mjs +2 -2
  17. package/dist/backend/components/rect.d.mts +4 -3
  18. package/dist/backend/components/rect.d.ts +4 -3
  19. package/dist/backend/components/rect.js +3 -3
  20. package/dist/backend/components/rect.mjs +2 -2
  21. package/dist/backend/components/slider-button.d.mts +6 -4
  22. package/dist/backend/components/slider-button.d.ts +6 -4
  23. package/dist/backend/components/slider-button.js +3 -3
  24. package/dist/backend/components/slider-button.mjs +2 -2
  25. package/dist/backend/components/switch.d.mts +6 -4
  26. package/dist/backend/components/switch.d.ts +6 -4
  27. package/dist/backend/components/switch.js +3 -3
  28. package/dist/backend/components/switch.mjs +2 -2
  29. package/dist/backend/components/tabs.d.mts +9 -8
  30. package/dist/backend/components/tabs.d.ts +9 -8
  31. package/dist/backend/components/tabs.js +3 -3
  32. package/dist/backend/components/tabs.mjs +2 -2
  33. package/dist/backend/components/text-input.d.mts +6 -4
  34. package/dist/backend/components/text-input.d.ts +6 -4
  35. package/dist/backend/components/text-input.js +3 -3
  36. package/dist/backend/components/text-input.mjs +2 -2
  37. package/dist/backend/components/timeline.d.mts +4 -3
  38. package/dist/backend/components/timeline.d.ts +4 -3
  39. package/dist/backend/components/timeline.js +3 -3
  40. package/dist/backend/components/timeline.mjs +2 -2
  41. package/dist/backend/util/index.d.mts +1 -1
  42. package/dist/backend/util/index.d.ts +1 -1
  43. package/dist/{chunk-Q5TEM6MM.js → chunk-25LALCAN.js} +17 -7
  44. package/dist/{chunk-IQ4SDDYP.js → chunk-5JPYL5IU.js} +3 -2
  45. package/dist/{chunk-KBPQZJKE.mjs → chunk-5TGGF5UJ.mjs} +17 -5
  46. package/dist/{chunk-PW7QVLLF.mjs → chunk-7SZA6JUN.mjs} +34 -3
  47. package/dist/{chunk-CFO5PSSK.js → chunk-ADH7RZG5.js} +54 -23
  48. package/dist/{chunk-C2TVGO43.js → chunk-ARRRZPUK.js} +5 -3
  49. package/dist/{chunk-ESMRIWOM.mjs → chunk-BDBRQJSI.mjs} +2 -1
  50. package/dist/{chunk-G5QXW2L3.mjs → chunk-EFNFSHV3.mjs} +16 -4
  51. package/dist/chunk-HNFNG5MD.js +55 -0
  52. package/dist/{chunk-SN2XKRYX.mjs → chunk-IBIEYR3L.mjs} +14 -4
  53. package/dist/{chunk-KR6LSBBX.mjs → chunk-ISHGZXPO.mjs} +14 -3
  54. package/dist/{chunk-DBSYI5Z4.mjs → chunk-LX5IL6WX.mjs} +2 -1
  55. package/dist/{chunk-JOW3XRQI.mjs → chunk-OAPIVG6M.mjs} +2 -1
  56. package/dist/{chunk-H734NV65.mjs → chunk-PXYXUWXE.mjs} +3 -1
  57. package/dist/{chunk-Q3NG5UUN.mjs → chunk-SBHNIFAS.mjs} +14 -4
  58. package/dist/{chunk-53DEDXHG.js → chunk-SIXWXDZW.js} +17 -7
  59. package/dist/{chunk-FUINWM5H.js → chunk-T4TMVBFM.js} +3 -2
  60. package/dist/{chunk-4HHKW7VA.js → chunk-TOPIQUBZ.js} +21 -9
  61. package/dist/{chunk-FLRGYURV.js → chunk-V5T44HCM.js} +3 -2
  62. package/dist/{chunk-4X3QY5EP.js → chunk-ZLJECS4H.js} +19 -7
  63. package/dist/{frontend.js → frontend/entrypoint.js} +20292 -20253
  64. package/dist/frontend/entrypoint.js.map +7 -0
  65. package/dist/frontend/index.d.mts +8 -0
  66. package/dist/frontend/index.d.ts +8 -0
  67. package/dist/frontend/index.js +143 -0
  68. package/dist/frontend/index.mjs +143 -0
  69. package/dist/index.d.mts +16 -3
  70. package/dist/index.d.ts +16 -3
  71. package/dist/index.js +33 -22
  72. package/dist/index.mjs +32 -21
  73. package/package.json +55 -29
  74. package/dist/chunk-DONU33U4.js +0 -44
  75. package/dist/frontend.js.map +0 -7
@@ -1,9 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
2
2
 
3
3
 
4
- var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
4
+ var _chunkADH7RZG5js = require('./chunk-ADH7RZG5.js');
5
5
 
6
6
  // src/backend/components/group.ts
7
+ var _core = require('@arcanejs/protocol/core'); var proto = _interopRequireWildcard(_core);
7
8
  var GROUP_DEFAULT_STYLE = {
8
9
  direction: "horizontal"
9
10
  };
@@ -12,21 +13,31 @@ var DEFAULT_PROPS = {
12
13
  title: null,
13
14
  labels: null
14
15
  };
15
- var GroupHeader = (_class = class extends _chunkCFO5PSSKjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
16
+ var GroupHeader = (_class = class extends _chunkADH7RZG5js.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
16
17
  __init() {this.validateChildren = () => {
17
18
  }}
18
19
  /** @hidden */
19
20
  __init2() {this.getProtoInfo = (idMap) => ({
21
+ namespace: "core",
20
22
  component: "group-header",
21
23
  key: idMap.getId(this),
22
24
  children: this.getChildren().map((c) => c.getProtoInfo(idMap))
23
25
  })}
24
26
  }, _class);
25
- var Group = (_class2 = class extends _chunkCFO5PSSKjs.BaseParent {
27
+ var Group = (_class2 = class extends _chunkADH7RZG5js.BaseParent {
26
28
  /** @hidden */
27
- __init3() {this.events = new (0, _chunkCFO5PSSKjs.EventEmitter)()}
29
+ __init3() {this.events = new (0, _chunkADH7RZG5js.EventEmitter)()}
28
30
  constructor(props) {
29
- super(DEFAULT_PROPS, props);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);;
31
+ super(DEFAULT_PROPS, props, {
32
+ onPropsUpdated: (oldProps) => this.events.processPropChanges(
33
+ {
34
+ onTitleChanged: "title-changed"
35
+ },
36
+ oldProps,
37
+ this.props
38
+ )
39
+ });_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);;
40
+ this.triggerInitialPropsUpdate();
30
41
  }
31
42
  __init4() {this.addListener = this.events.addListener}
32
43
  __init5() {this.removeListener = this.events.removeListener}
@@ -70,17 +81,18 @@ var Group = (_class2 = class extends _chunkCFO5PSSKjs.BaseParent {
70
81
  const headers = [];
71
82
  for (const c of this.getChildren()) {
72
83
  const childProto = c.getProtoInfo(idMap);
73
- if (childProto.component === "group-header") {
84
+ if (proto.isCoreComponent(childProto) && childProto.component === "group-header") {
74
85
  headers.push(childProto);
75
86
  } else {
76
87
  children.push(childProto);
77
88
  }
78
89
  }
79
90
  return {
91
+ namespace: "core",
80
92
  component: "group",
81
93
  key: idMap.getId(this),
82
94
  title: _nullishCoalesce(this.props.title, () => ( void 0)),
83
- direction: this.props.direction,
95
+ direction: _nullishCoalesce(this.props.direction, () => ( DEFAULT_PROPS.direction)),
84
96
  border: this.props.border,
85
97
  wrap: this.props.wrap,
86
98
  children,
@@ -92,7 +104,7 @@ var Group = (_class2 = class extends _chunkCFO5PSSKjs.BaseParent {
92
104
  }}
93
105
  /** @hidden */
94
106
  __init15() {this.handleMessage = (message) => {
95
- if (message.component === "group") {
107
+ if (proto.isCoreComponentMessage(message, "group")) {
96
108
  this.events.emit("title-changed", message.title);
97
109
  }
98
110
  }}
@@ -1,15 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
3
+ var _chunkADH7RZG5js = require('./chunk-ADH7RZG5.js');
4
4
 
5
5
  // src/backend/components/label.ts
6
- var Label = class extends _chunkCFO5PSSKjs.Base {
6
+ var Label = class extends _chunkADH7RZG5js.Base {
7
7
  constructor(props) {
8
8
  super({ text: null }, props);
9
9
  }
10
10
  /** @hidden */
11
11
  getProtoInfo(idMap) {
12
12
  return {
13
+ namespace: "core",
13
14
  component: "label",
14
15
  key: idMap.getId(this),
15
16
  bold: this.props.bold,
@@ -1,20 +1,31 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
2
2
 
3
3
 
4
- var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
4
+ var _chunkADH7RZG5js = require('./chunk-ADH7RZG5.js');
5
5
 
6
6
  // src/backend/components/button.ts
7
+ var _core = require('@arcanejs/protocol/core'); var proto = _interopRequireWildcard(_core);
7
8
  var DEFAULT_PROPS = {
8
9
  text: null,
9
10
  icon: null,
10
11
  mode: "normal",
11
- error: null
12
+ error: null,
13
+ onClick: null
12
14
  };
13
- var Button = (_class = class extends _chunkCFO5PSSKjs.Base {
15
+ var Button = (_class = class extends _chunkADH7RZG5js.Base {
14
16
  /** @hidden */
15
- __init() {this.events = new (0, _chunkCFO5PSSKjs.EventEmitter)()}
17
+ __init() {this.events = new (0, _chunkADH7RZG5js.EventEmitter)()}
16
18
  constructor(props) {
17
- super(DEFAULT_PROPS, props);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);;
19
+ super(DEFAULT_PROPS, props, {
20
+ onPropsUpdated: (oldProps) => this.events.processPropChanges(
21
+ {
22
+ onClick: "click"
23
+ },
24
+ oldProps,
25
+ this.props
26
+ )
27
+ });_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);;
28
+ this.triggerInitialPropsUpdate();
18
29
  }
19
30
  __init2() {this.addListener = this.events.addListener}
20
31
  __init3() {this.removeListener = this.events.removeListener}
@@ -36,6 +47,7 @@ var Button = (_class = class extends _chunkCFO5PSSKjs.Base {
36
47
  /** @hidden */
37
48
  __init7() {this.getProtoInfo = (idMap) => {
38
49
  return {
50
+ namespace: "core",
39
51
  component: "button",
40
52
  key: idMap.getId(this),
41
53
  text: this.props.text || "",
@@ -45,7 +57,7 @@ var Button = (_class = class extends _chunkCFO5PSSKjs.Base {
45
57
  }}
46
58
  /** @hidden */
47
59
  __init8() {this.handleMessage = (message) => {
48
- if (message.component === "button") {
60
+ if (proto.isCoreComponentMessage(message, "button")) {
49
61
  this.events.emit("click").then(() => {
50
62
  if (this.props.error) {
51
63
  this.updateProps({