@arcanejs/toolkit 0.3.0 → 0.4.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 (53) hide show
  1. package/dist/backend/components/base.d.mts +5 -1
  2. package/dist/backend/components/base.d.ts +5 -1
  3. package/dist/backend/components/base.js +2 -2
  4. package/dist/backend/components/base.mjs +1 -1
  5. package/dist/backend/components/button.js +3 -3
  6. package/dist/backend/components/button.mjs +2 -2
  7. package/dist/backend/components/group.js +3 -3
  8. package/dist/backend/components/group.mjs +2 -2
  9. package/dist/backend/components/label.js +3 -3
  10. package/dist/backend/components/label.mjs +2 -2
  11. package/dist/backend/components/rect.js +3 -3
  12. package/dist/backend/components/rect.mjs +2 -2
  13. package/dist/backend/components/slider-button.d.mts +9 -4
  14. package/dist/backend/components/slider-button.d.ts +9 -4
  15. package/dist/backend/components/slider-button.js +3 -3
  16. package/dist/backend/components/slider-button.mjs +2 -2
  17. package/dist/backend/components/switch.d.mts +8 -1
  18. package/dist/backend/components/switch.d.ts +8 -1
  19. package/dist/backend/components/switch.js +3 -3
  20. package/dist/backend/components/switch.mjs +2 -2
  21. package/dist/backend/components/tabs.js +3 -3
  22. package/dist/backend/components/tabs.mjs +2 -2
  23. package/dist/backend/components/text-input.js +3 -3
  24. package/dist/backend/components/text-input.mjs +2 -2
  25. package/dist/backend/components/timeline.js +3 -3
  26. package/dist/backend/components/timeline.mjs +2 -2
  27. package/dist/{chunk-QUA3NBLD.js → chunk-4HHKW7VA.js} +4 -4
  28. package/dist/{chunk-J46AJUGE.js → chunk-4X3QY5EP.js} +3 -3
  29. package/dist/{chunk-H2UQDFTS.mjs → chunk-A2STBGBE.mjs} +28 -11
  30. package/dist/{chunk-WXSKMMCV.js → chunk-C2TVGO43.js} +3 -3
  31. package/dist/{chunk-NZUYU32Z.js → chunk-CFO5PSSK.js} +25 -20
  32. package/dist/{chunk-POUQGJN4.mjs → chunk-DBSYI5Z4.mjs} +1 -1
  33. package/dist/{chunk-IW3JCC73.js → chunk-DONU33U4.js} +3 -3
  34. package/dist/{chunk-TSC5C5XR.js → chunk-FLRGYURV.js} +2 -2
  35. package/dist/{chunk-DV5WTSFW.js → chunk-FUINWM5H.js} +2 -2
  36. package/dist/{chunk-EH73E5FP.mjs → chunk-G5QXW2L3.mjs} +1 -1
  37. package/dist/chunk-G7GFSIHY.js +76 -0
  38. package/dist/{chunk-YIXRQHTA.mjs → chunk-H734NV65.mjs} +1 -1
  39. package/dist/{chunk-7ITSSJE2.mjs → chunk-JOW3XRQI.mjs} +1 -1
  40. package/dist/{chunk-WIPEQNWR.js → chunk-K572ZPUS.js} +2 -2
  41. package/dist/{chunk-3Y3HRYLC.mjs → chunk-KBPQZJKE.mjs} +1 -1
  42. package/dist/{chunk-SMTUN6HG.mjs → chunk-KOKUFP6V.mjs} +1 -1
  43. package/dist/{chunk-NKNDCRUR.mjs → chunk-KR6LSBBX.mjs} +1 -1
  44. package/dist/{chunk-EDTJ75FT.mjs → chunk-PW7QVLLF.mjs} +6 -1
  45. package/dist/chunk-Q3NG5UUN.mjs +61 -0
  46. package/dist/chunk-Q5TEM6MM.js +61 -0
  47. package/dist/frontend.js.map +1 -1
  48. package/dist/index.js +11 -11
  49. package/dist/index.mjs +10 -10
  50. package/package.json +5 -3
  51. package/dist/chunk-DNCHAOYH.js +0 -42
  52. package/dist/chunk-YN3FZMXY.js +0 -59
  53. package/dist/chunk-YYM7PBRN.mjs +0 -42
@@ -15,7 +15,11 @@ declare abstract class Base<Props> implements Component {
15
15
  private readonly defaultProps;
16
16
  /** @hidden */
17
17
  private _props;
18
- constructor(defaultProps: Props, props?: Partial<Props>);
18
+ /** @hidden */
19
+ private _onPropsUpdated;
20
+ constructor(defaultProps: Props, props?: Partial<Props>, options?: {
21
+ onPropsUpdated?: () => void;
22
+ });
19
23
  log: () => Logger | null;
20
24
  get props(): Props;
21
25
  set props(props: Partial<Props>);
@@ -15,7 +15,11 @@ declare abstract class Base<Props> implements Component {
15
15
  private readonly defaultProps;
16
16
  /** @hidden */
17
17
  private _props;
18
- constructor(defaultProps: Props, props?: Partial<Props>);
18
+ /** @hidden */
19
+ private _onPropsUpdated;
20
+ constructor(defaultProps: Props, props?: Partial<Props>, options?: {
21
+ onPropsUpdated?: () => void;
22
+ });
19
23
  log: () => Logger | null;
20
24
  get props(): Props;
21
25
  set props(props: Partial<Props>);
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkNZUYU32Zjs = require('../../chunk-NZUYU32Z.js');
5
+ var _chunkCFO5PSSKjs = require('../../chunk-CFO5PSSK.js');
6
6
  require('../../chunk-3RG5ZIWI.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.Base = _chunkNZUYU32Zjs.Base; exports.BaseParent = _chunkNZUYU32Zjs.BaseParent; exports.EventEmitter = _chunkNZUYU32Zjs.EventEmitter;
11
+ exports.Base = _chunkCFO5PSSKjs.Base; exports.BaseParent = _chunkCFO5PSSKjs.BaseParent; exports.EventEmitter = _chunkCFO5PSSKjs.EventEmitter;
@@ -2,7 +2,7 @@ import {
2
2
  Base,
3
3
  BaseParent,
4
4
  EventEmitter
5
- } from "../../chunk-EDTJ75FT.mjs";
5
+ } from "../../chunk-PW7QVLLF.mjs";
6
6
  import "../../chunk-Y6FXYEAI.mjs";
7
7
  export {
8
8
  Base,
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJ46AJUGEjs = require('../../chunk-J46AJUGE.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunk4X3QY5EPjs = require('../../chunk-4X3QY5EP.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.Button = _chunkJ46AJUGEjs.Button;
8
+ exports.Button = _chunk4X3QY5EPjs.Button;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Button
3
- } from "../../chunk-EH73E5FP.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-G5QXW2L3.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  Button
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkQUA3NBLDjs = require('../../chunk-QUA3NBLD.js');
5
- require('../../chunk-NZUYU32Z.js');
4
+ var _chunk4HHKW7VAjs = require('../../chunk-4HHKW7VA.js');
5
+ require('../../chunk-CFO5PSSK.js');
6
6
  require('../../chunk-3RG5ZIWI.js');
7
7
 
8
8
 
9
9
 
10
- exports.Group = _chunkQUA3NBLDjs.Group; exports.GroupHeader = _chunkQUA3NBLDjs.GroupHeader;
10
+ exports.Group = _chunk4HHKW7VAjs.Group; exports.GroupHeader = _chunk4HHKW7VAjs.GroupHeader;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Group,
3
3
  GroupHeader
4
- } from "../../chunk-3Y3HRYLC.mjs";
5
- import "../../chunk-EDTJ75FT.mjs";
4
+ } from "../../chunk-KBPQZJKE.mjs";
5
+ import "../../chunk-PW7QVLLF.mjs";
6
6
  import "../../chunk-Y6FXYEAI.mjs";
7
7
  export {
8
8
  Group,
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTSC5C5XRjs = require('../../chunk-TSC5C5XR.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkFLRGYURVjs = require('../../chunk-FLRGYURV.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.Label = _chunkTSC5C5XRjs.Label;
8
+ exports.Label = _chunkFLRGYURVjs.Label;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Label
3
- } from "../../chunk-7ITSSJE2.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-JOW3XRQI.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  Label
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkWIPEQNWRjs = require('../../chunk-WIPEQNWR.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkK572ZPUSjs = require('../../chunk-K572ZPUS.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.Rect = _chunkWIPEQNWRjs.Rect;
8
+ exports.Rect = _chunkK572ZPUSjs.Rect;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Rect
3
- } from "../../chunk-SMTUN6HG.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-KOKUFP6V.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  Rect
@@ -6,19 +6,23 @@ import '@arcanejs/protocol/logging';
6
6
  type Events = {
7
7
  change: (value: number) => void | Promise<void>;
8
8
  };
9
- type SliderMode = 'writeThrough' | 'writeBack';
10
9
  type InternalProps = {
11
10
  min: number;
12
11
  max: number;
13
12
  step: number;
14
- value: number | null;
15
- mode: SliderMode;
13
+ value?: number;
14
+ defaultValue?: number;
16
15
  };
17
16
  type RequiredProps = 'value';
18
17
  type Props = Pick<InternalProps, RequiredProps> & Partial<Omit<InternalProps, RequiredProps>>;
19
18
  declare class SliderButton extends Base<InternalProps> implements Listenable<Events> {
20
19
  /** @hidden */
21
20
  private readonly events;
21
+ /**
22
+ * Manually manage the state of the slider,
23
+ * to support both controlled and uncontrolled inputs.
24
+ */
25
+ private _value;
22
26
  constructor(props?: Props);
23
27
  addListener: <T extends "change">(type: T, listener: Events[T]) => void;
24
28
  removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
@@ -28,6 +32,7 @@ declare class SliderButton extends Base<InternalProps> implements Listenable<Eve
28
32
  handleMessage(message: proto.ClientComponentMessage): void;
29
33
  setValue(value: number): void;
30
34
  private sanitizeNumber;
35
+ private onPropsUpdated;
31
36
  }
32
37
 
33
- export { type Events, type Props, SliderButton, type SliderMode };
38
+ export { type Events, type Props, SliderButton };
@@ -6,19 +6,23 @@ import '@arcanejs/protocol/logging';
6
6
  type Events = {
7
7
  change: (value: number) => void | Promise<void>;
8
8
  };
9
- type SliderMode = 'writeThrough' | 'writeBack';
10
9
  type InternalProps = {
11
10
  min: number;
12
11
  max: number;
13
12
  step: number;
14
- value: number | null;
15
- mode: SliderMode;
13
+ value?: number;
14
+ defaultValue?: number;
16
15
  };
17
16
  type RequiredProps = 'value';
18
17
  type Props = Pick<InternalProps, RequiredProps> & Partial<Omit<InternalProps, RequiredProps>>;
19
18
  declare class SliderButton extends Base<InternalProps> implements Listenable<Events> {
20
19
  /** @hidden */
21
20
  private readonly events;
21
+ /**
22
+ * Manually manage the state of the slider,
23
+ * to support both controlled and uncontrolled inputs.
24
+ */
25
+ private _value;
22
26
  constructor(props?: Props);
23
27
  addListener: <T extends "change">(type: T, listener: Events[T]) => void;
24
28
  removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
@@ -28,6 +32,7 @@ declare class SliderButton extends Base<InternalProps> implements Listenable<Eve
28
32
  handleMessage(message: proto.ClientComponentMessage): void;
29
33
  setValue(value: number): void;
30
34
  private sanitizeNumber;
35
+ private onPropsUpdated;
31
36
  }
32
37
 
33
- export { type Events, type Props, SliderButton, type SliderMode };
38
+ export { type Events, type Props, SliderButton };
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYN3FZMXYjs = require('../../chunk-YN3FZMXY.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkG7GFSIHYjs = require('../../chunk-G7GFSIHY.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.SliderButton = _chunkYN3FZMXYjs.SliderButton;
8
+ exports.SliderButton = _chunkG7GFSIHYjs.SliderButton;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SliderButton
3
- } from "../../chunk-H2UQDFTS.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-A2STBGBE.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  SliderButton
@@ -7,12 +7,18 @@ type Events = {
7
7
  change: (state: 'on' | 'off') => void | Promise<void>;
8
8
  };
9
9
  type InternalProps = {
10
- state: 'on' | 'off';
10
+ value?: 'on' | 'off';
11
+ defaultValue?: 'on' | 'off';
11
12
  };
12
13
  type Props = Partial<InternalProps>;
13
14
  declare class Switch extends Base<InternalProps> implements Listenable<Events> {
14
15
  /** @hidden */
15
16
  private readonly events;
17
+ /**
18
+ * Manually manage the state of the switch,
19
+ * to support both controlled and uncontrolled inputs.
20
+ */
21
+ private _value;
16
22
  constructor(props?: Props);
17
23
  addListener: <T extends "change">(type: T, listener: Events[T]) => void;
18
24
  removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
@@ -21,6 +27,7 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
21
27
  /** @hidden */
22
28
  handleMessage(message: proto.ClientComponentMessage): void;
23
29
  setValue(state: 'on' | 'off'): void;
30
+ private onPropsUpdated;
24
31
  }
25
32
 
26
33
  export { type Events, type Props, Switch };
@@ -7,12 +7,18 @@ type Events = {
7
7
  change: (state: 'on' | 'off') => void | Promise<void>;
8
8
  };
9
9
  type InternalProps = {
10
- state: 'on' | 'off';
10
+ value?: 'on' | 'off';
11
+ defaultValue?: 'on' | 'off';
11
12
  };
12
13
  type Props = Partial<InternalProps>;
13
14
  declare class Switch extends Base<InternalProps> implements Listenable<Events> {
14
15
  /** @hidden */
15
16
  private readonly events;
17
+ /**
18
+ * Manually manage the state of the switch,
19
+ * to support both controlled and uncontrolled inputs.
20
+ */
21
+ private _value;
16
22
  constructor(props?: Props);
17
23
  addListener: <T extends "change">(type: T, listener: Events[T]) => void;
18
24
  removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
@@ -21,6 +27,7 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
21
27
  /** @hidden */
22
28
  handleMessage(message: proto.ClientComponentMessage): void;
23
29
  setValue(state: 'on' | 'off'): void;
30
+ private onPropsUpdated;
24
31
  }
25
32
 
26
33
  export { type Events, type Props, Switch };
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDNCHAOYHjs = require('../../chunk-DNCHAOYH.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkQ5TEM6MMjs = require('../../chunk-Q5TEM6MM.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.Switch = _chunkDNCHAOYHjs.Switch;
8
+ exports.Switch = _chunkQ5TEM6MMjs.Switch;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Switch
3
- } from "../../chunk-YYM7PBRN.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-Q3NG5UUN.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  Switch
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkWXSKMMCVjs = require('../../chunk-WXSKMMCV.js');
5
- require('../../chunk-NZUYU32Z.js');
4
+ var _chunkC2TVGO43js = require('../../chunk-C2TVGO43.js');
5
+ require('../../chunk-CFO5PSSK.js');
6
6
  require('../../chunk-3RG5ZIWI.js');
7
7
 
8
8
 
9
9
 
10
- exports.Tab = _chunkWXSKMMCVjs.Tab; exports.Tabs = _chunkWXSKMMCVjs.Tabs;
10
+ exports.Tab = _chunkC2TVGO43js.Tab; exports.Tabs = _chunkC2TVGO43js.Tabs;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Tab,
3
3
  Tabs
4
- } from "../../chunk-YIXRQHTA.mjs";
5
- import "../../chunk-EDTJ75FT.mjs";
4
+ } from "../../chunk-H734NV65.mjs";
5
+ import "../../chunk-PW7QVLLF.mjs";
6
6
  import "../../chunk-Y6FXYEAI.mjs";
7
7
  export {
8
8
  Tab,
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkIW3JCC73js = require('../../chunk-IW3JCC73.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkDONU33U4js = require('../../chunk-DONU33U4.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.TextInput = _chunkIW3JCC73js.TextInput;
8
+ exports.TextInput = _chunkDONU33U4js.TextInput;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TextInput
3
- } from "../../chunk-NKNDCRUR.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-KR6LSBBX.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  TextInput
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDV5WTSFWjs = require('../../chunk-DV5WTSFW.js');
4
- require('../../chunk-NZUYU32Z.js');
3
+ var _chunkFUINWM5Hjs = require('../../chunk-FUINWM5H.js');
4
+ require('../../chunk-CFO5PSSK.js');
5
5
  require('../../chunk-3RG5ZIWI.js');
6
6
 
7
7
 
8
- exports.Timeline = _chunkDV5WTSFWjs.Timeline;
8
+ exports.Timeline = _chunkFUINWM5Hjs.Timeline;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Timeline
3
- } from "../../chunk-POUQGJN4.mjs";
4
- import "../../chunk-EDTJ75FT.mjs";
3
+ } from "../../chunk-DBSYI5Z4.mjs";
4
+ import "../../chunk-PW7QVLLF.mjs";
5
5
  import "../../chunk-Y6FXYEAI.mjs";
6
6
  export {
7
7
  Timeline
@@ -1,7 +1,7 @@
1
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;
2
2
 
3
3
 
4
- var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
4
+ var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
5
5
 
6
6
  // src/backend/components/group.ts
7
7
  var GROUP_DEFAULT_STYLE = {
@@ -12,7 +12,7 @@ var DEFAULT_PROPS = {
12
12
  title: null,
13
13
  labels: null
14
14
  };
15
- var GroupHeader = (_class = class extends _chunkNZUYU32Zjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
15
+ var GroupHeader = (_class = class extends _chunkCFO5PSSKjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
16
16
  __init() {this.validateChildren = () => {
17
17
  }}
18
18
  /** @hidden */
@@ -22,9 +22,9 @@ var GroupHeader = (_class = class extends _chunkNZUYU32Zjs.BaseParent {construct
22
22
  children: this.getChildren().map((c) => c.getProtoInfo(idMap))
23
23
  })}
24
24
  }, _class);
25
- var Group = (_class2 = class extends _chunkNZUYU32Zjs.BaseParent {
25
+ var Group = (_class2 = class extends _chunkCFO5PSSKjs.BaseParent {
26
26
  /** @hidden */
27
- __init3() {this.events = new (0, _chunkNZUYU32Zjs.EventEmitter)()}
27
+ __init3() {this.events = new (0, _chunkCFO5PSSKjs.EventEmitter)()}
28
28
  constructor(props) {
29
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);;
30
30
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
2
2
 
3
3
 
4
- var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
4
+ var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
5
5
 
6
6
  // src/backend/components/button.ts
7
7
  var DEFAULT_PROPS = {
@@ -10,9 +10,9 @@ var DEFAULT_PROPS = {
10
10
  mode: "normal",
11
11
  error: null
12
12
  };
13
- var Button = (_class = class extends _chunkNZUYU32Zjs.Base {
13
+ var Button = (_class = class extends _chunkCFO5PSSKjs.Base {
14
14
  /** @hidden */
15
- __init() {this.events = new (0, _chunkNZUYU32Zjs.EventEmitter)()}
15
+ __init() {this.events = new (0, _chunkCFO5PSSKjs.EventEmitter)()}
16
16
  constructor(props) {
17
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);;
18
18
  }
@@ -1,21 +1,27 @@
1
1
  import {
2
2
  Base,
3
3
  EventEmitter
4
- } from "./chunk-EDTJ75FT.mjs";
4
+ } from "./chunk-PW7QVLLF.mjs";
5
5
 
6
6
  // src/backend/components/slider-button.ts
7
7
  var DEFAULT_PROPS = {
8
- value: null,
9
8
  min: 0,
10
9
  max: 255,
11
- step: 5,
12
- mode: "writeBack"
10
+ step: 5
13
11
  };
14
12
  var SliderButton = class extends Base {
15
13
  /** @hidden */
16
14
  events = new EventEmitter();
15
+ /**
16
+ * Manually manage the state of the slider,
17
+ * to support both controlled and uncontrolled inputs.
18
+ */
19
+ _value = null;
17
20
  constructor(props) {
18
- super(DEFAULT_PROPS, props);
21
+ super(DEFAULT_PROPS, props, {
22
+ onPropsUpdated: () => this.onPropsUpdated()
23
+ });
24
+ this.onPropsUpdated();
19
25
  }
20
26
  addListener = this.events.addListener;
21
27
  removeListener = this.events.removeListener;
@@ -27,23 +33,27 @@ var SliderButton = class extends Base {
27
33
  min: this.props.min,
28
34
  max: this.props.max,
29
35
  step: this.props.step,
30
- value: this.props.value
36
+ value: this._value
31
37
  };
32
38
  }
33
39
  /** @hidden */
34
40
  handleMessage(message) {
35
41
  if (message.component !== "slider_button") return;
36
42
  const newValue = this.sanitizeNumber(message.value);
37
- if (this.props.value === newValue) return;
38
- if (this.props.mode === "writeBack") {
39
- this.updateProps({ value: newValue });
43
+ if (this._value === newValue) return;
44
+ if (this.props.value === void 0) {
45
+ this._value = newValue;
46
+ this.updateTree();
40
47
  }
41
48
  this.events.emit("change", newValue);
42
49
  }
43
50
  setValue(value) {
51
+ if (this.props.value) {
52
+ throw new Error("Cannot set value on controlled input");
53
+ }
44
54
  const newValue = this.sanitizeNumber(value);
45
- if (newValue === this.props.value) return;
46
- this.updateProps({ value });
55
+ if (this._value === newValue) return;
56
+ this._value = newValue;
47
57
  this.updateTree();
48
58
  }
49
59
  sanitizeNumber(value) {
@@ -52,6 +62,13 @@ var SliderButton = class extends Base {
52
62
  const clampedValue = Math.max(this.props.min, Math.min(this.props.max, v));
53
63
  return clampedValue;
54
64
  }
65
+ onPropsUpdated = () => {
66
+ if (this.props.value !== void 0) {
67
+ this._value = this.props.value;
68
+ } else if (this._value === null && this.props.defaultValue) {
69
+ this._value = this.props.defaultValue;
70
+ }
71
+ };
55
72
  };
56
73
 
57
74
  export {
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class; var _class2;
2
2
 
3
- var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
3
+ var _chunkCFO5PSSKjs = require('./chunk-CFO5PSSK.js');
4
4
 
5
5
  // src/backend/components/tabs.ts
6
- var Tab = (_class = class extends _chunkNZUYU32Zjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
6
+ var Tab = (_class = class extends _chunkCFO5PSSKjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
7
7
  __init() {this.validateChildren = (children) => {
8
8
  if (children.length > 1) {
9
9
  throw new Error("Tab can only have one child");
@@ -17,7 +17,7 @@ var Tab = (_class = class extends _chunkNZUYU32Zjs.BaseParent {constructor(...ar
17
17
  child: this.getChildren().slice(0, 1).map((c) => c.getProtoInfo(idMap))[0]
18
18
  })}
19
19
  }, _class);
20
- var Tabs = (_class2 = class extends _chunkNZUYU32Zjs.BaseParent {
20
+ var Tabs = (_class2 = class extends _chunkCFO5PSSKjs.BaseParent {
21
21
  __init3() {this.validateChildren = (children) => {
22
22
  for (const child of children) {
23
23
  if (!(child instanceof Tab)) {