@arcanejs/toolkit 0.5.1 → 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.
- package/dist/backend/components/base.d.mts +25 -22
- package/dist/backend/components/base.d.ts +25 -22
- package/dist/backend/components/base.js +2 -2
- package/dist/backend/components/base.mjs +1 -1
- package/dist/backend/components/button.d.mts +5 -3
- package/dist/backend/components/button.d.ts +5 -3
- package/dist/backend/components/button.js +3 -3
- package/dist/backend/components/button.mjs +2 -2
- package/dist/backend/components/group.d.mts +6 -4
- package/dist/backend/components/group.d.ts +6 -4
- package/dist/backend/components/group.js +3 -3
- package/dist/backend/components/group.mjs +2 -2
- package/dist/backend/components/label.d.mts +4 -3
- package/dist/backend/components/label.d.ts +4 -3
- package/dist/backend/components/label.js +3 -3
- package/dist/backend/components/label.mjs +2 -2
- package/dist/backend/components/rect.d.mts +4 -3
- package/dist/backend/components/rect.d.ts +4 -3
- package/dist/backend/components/rect.js +3 -3
- package/dist/backend/components/rect.mjs +2 -2
- package/dist/backend/components/slider-button.d.mts +6 -4
- package/dist/backend/components/slider-button.d.ts +6 -4
- package/dist/backend/components/slider-button.js +3 -3
- package/dist/backend/components/slider-button.mjs +2 -2
- package/dist/backend/components/switch.d.mts +6 -4
- package/dist/backend/components/switch.d.ts +6 -4
- package/dist/backend/components/switch.js +3 -3
- package/dist/backend/components/switch.mjs +2 -2
- package/dist/backend/components/tabs.d.mts +9 -8
- package/dist/backend/components/tabs.d.ts +9 -8
- package/dist/backend/components/tabs.js +3 -3
- package/dist/backend/components/tabs.mjs +2 -2
- package/dist/backend/components/text-input.d.mts +6 -4
- package/dist/backend/components/text-input.d.ts +6 -4
- package/dist/backend/components/text-input.js +3 -3
- package/dist/backend/components/text-input.mjs +2 -2
- package/dist/backend/components/timeline.d.mts +4 -3
- package/dist/backend/components/timeline.d.ts +4 -3
- package/dist/backend/components/timeline.js +3 -3
- package/dist/backend/components/timeline.mjs +2 -2
- package/dist/backend/util/index.d.mts +1 -1
- package/dist/backend/util/index.d.ts +1 -1
- package/dist/{chunk-Q5TEM6MM.js → chunk-25LALCAN.js} +17 -7
- package/dist/{chunk-IQ4SDDYP.js → chunk-5JPYL5IU.js} +3 -2
- package/dist/{chunk-KBPQZJKE.mjs → chunk-5TGGF5UJ.mjs} +17 -5
- package/dist/{chunk-PW7QVLLF.mjs → chunk-7SZA6JUN.mjs} +34 -3
- package/dist/{chunk-CFO5PSSK.js → chunk-ADH7RZG5.js} +54 -23
- package/dist/{chunk-C2TVGO43.js → chunk-ARRRZPUK.js} +5 -3
- package/dist/{chunk-ESMRIWOM.mjs → chunk-BDBRQJSI.mjs} +2 -1
- package/dist/{chunk-G5QXW2L3.mjs → chunk-EFNFSHV3.mjs} +16 -4
- package/dist/chunk-HNFNG5MD.js +55 -0
- package/dist/{chunk-SN2XKRYX.mjs → chunk-IBIEYR3L.mjs} +14 -4
- package/dist/{chunk-KR6LSBBX.mjs → chunk-ISHGZXPO.mjs} +14 -3
- package/dist/{chunk-DBSYI5Z4.mjs → chunk-LX5IL6WX.mjs} +2 -1
- package/dist/{chunk-JOW3XRQI.mjs → chunk-OAPIVG6M.mjs} +2 -1
- package/dist/{chunk-H734NV65.mjs → chunk-PXYXUWXE.mjs} +3 -1
- package/dist/{chunk-Q3NG5UUN.mjs → chunk-SBHNIFAS.mjs} +14 -4
- package/dist/{chunk-53DEDXHG.js → chunk-SIXWXDZW.js} +17 -7
- package/dist/{chunk-FUINWM5H.js → chunk-T4TMVBFM.js} +3 -2
- package/dist/{chunk-4HHKW7VA.js → chunk-TOPIQUBZ.js} +21 -9
- package/dist/{chunk-FLRGYURV.js → chunk-V5T44HCM.js} +3 -2
- package/dist/{chunk-4X3QY5EP.js → chunk-ZLJECS4H.js} +19 -7
- package/dist/{frontend.js → frontend/entrypoint.js} +20292 -20253
- package/dist/frontend/entrypoint.js.map +7 -0
- package/dist/frontend/index.d.mts +8 -0
- package/dist/frontend/index.d.ts +8 -0
- package/dist/frontend/index.js +143 -0
- package/dist/frontend/index.mjs +143 -0
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +33 -22
- package/dist/index.mjs +32 -21
- package/package.json +55 -29
- package/dist/chunk-DONU33U4.js +0 -44
- package/dist/frontend.js.map +0 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
3
|
import { Base, Listenable } from './base.mjs';
|
|
4
|
+
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type Events = {
|
|
@@ -9,9 +10,10 @@ type Events = {
|
|
|
9
10
|
type InternalProps = {
|
|
10
11
|
value?: 'on' | 'off';
|
|
11
12
|
defaultValue?: 'on' | 'off';
|
|
13
|
+
onChange?: Events['change'];
|
|
12
14
|
};
|
|
13
15
|
type Props = Partial<InternalProps>;
|
|
14
|
-
declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
16
|
+
declare class Switch extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> implements Listenable<Events> {
|
|
15
17
|
/** @hidden */
|
|
16
18
|
private readonly events;
|
|
17
19
|
/**
|
|
@@ -23,9 +25,9 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
|
23
25
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
24
26
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
25
27
|
/** @hidden */
|
|
26
|
-
getProtoInfo(idMap: IDMap): proto.
|
|
28
|
+
getProtoInfo(idMap: IDMap): proto.CoreComponent;
|
|
27
29
|
/** @hidden */
|
|
28
|
-
handleMessage(message:
|
|
30
|
+
handleMessage(message: AnyClientComponentMessage): void;
|
|
29
31
|
setValue(state: 'on' | 'off'): void;
|
|
30
32
|
private onPropsUpdated;
|
|
31
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
3
|
import { Base, Listenable } from './base.js';
|
|
4
|
+
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type Events = {
|
|
@@ -9,9 +10,10 @@ type Events = {
|
|
|
9
10
|
type InternalProps = {
|
|
10
11
|
value?: 'on' | 'off';
|
|
11
12
|
defaultValue?: 'on' | 'off';
|
|
13
|
+
onChange?: Events['change'];
|
|
12
14
|
};
|
|
13
15
|
type Props = Partial<InternalProps>;
|
|
14
|
-
declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
16
|
+
declare class Switch extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> implements Listenable<Events> {
|
|
15
17
|
/** @hidden */
|
|
16
18
|
private readonly events;
|
|
17
19
|
/**
|
|
@@ -23,9 +25,9 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
|
23
25
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
24
26
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
25
27
|
/** @hidden */
|
|
26
|
-
getProtoInfo(idMap: IDMap): proto.
|
|
28
|
+
getProtoInfo(idMap: IDMap): proto.CoreComponent;
|
|
27
29
|
/** @hidden */
|
|
28
|
-
handleMessage(message:
|
|
30
|
+
handleMessage(message: AnyClientComponentMessage): void;
|
|
29
31
|
setValue(state: 'on' | 'off'): void;
|
|
30
32
|
private onPropsUpdated;
|
|
31
33
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var _chunk25LALCANjs = require('../../chunk-25LALCAN.js');
|
|
4
|
+
require('../../chunk-ADH7RZG5.js');
|
|
5
5
|
require('../../chunk-3RG5ZIWI.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Switch =
|
|
8
|
+
exports.Switch = _chunk25LALCANjs.Switch;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import { BaseParent,
|
|
3
|
+
import { BaseParent, AnyComponent } from './base.mjs';
|
|
4
|
+
import '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type TabDefinition = {
|
|
7
8
|
name: string;
|
|
8
|
-
component:
|
|
9
|
+
component: AnyComponent;
|
|
9
10
|
};
|
|
10
11
|
type InternalTabProps = {
|
|
11
12
|
name: string;
|
|
12
13
|
};
|
|
13
14
|
type TabProps = InternalTabProps;
|
|
14
|
-
declare class Tab extends BaseParent<InternalTabProps> {
|
|
15
|
-
validateChildren: (children:
|
|
15
|
+
declare class Tab extends BaseParent<proto.CoreNamespace, proto.CoreComponent, InternalTabProps> {
|
|
16
|
+
validateChildren: (children: AnyComponent[]) => void;
|
|
16
17
|
/** @hidden */
|
|
17
18
|
getProtoInfo: (idMap: IDMap) => proto.TabComponent;
|
|
18
19
|
}
|
|
19
20
|
type InternalTabsProps = Record<never, never>;
|
|
20
21
|
type TabsProps = InternalTabsProps;
|
|
21
|
-
declare class Tabs extends BaseParent<InternalTabsProps> {
|
|
22
|
-
validateChildren: (children:
|
|
22
|
+
declare class Tabs extends BaseParent<proto.CoreNamespace, proto.CoreComponent, InternalTabsProps> {
|
|
23
|
+
validateChildren: (children: AnyComponent[]) => void;
|
|
23
24
|
constructor(props?: TabsProps);
|
|
24
25
|
addTabs(...tabs: TabDefinition[]): void;
|
|
25
|
-
addTab<C extends
|
|
26
|
+
addTab<C extends AnyComponent>(name: string, component: C): C;
|
|
26
27
|
/** @hidden */
|
|
27
28
|
getProtoInfo(idMap: IDMap): proto.TabsComponent;
|
|
28
29
|
}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import { BaseParent,
|
|
3
|
+
import { BaseParent, AnyComponent } from './base.js';
|
|
4
|
+
import '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type TabDefinition = {
|
|
7
8
|
name: string;
|
|
8
|
-
component:
|
|
9
|
+
component: AnyComponent;
|
|
9
10
|
};
|
|
10
11
|
type InternalTabProps = {
|
|
11
12
|
name: string;
|
|
12
13
|
};
|
|
13
14
|
type TabProps = InternalTabProps;
|
|
14
|
-
declare class Tab extends BaseParent<InternalTabProps> {
|
|
15
|
-
validateChildren: (children:
|
|
15
|
+
declare class Tab extends BaseParent<proto.CoreNamespace, proto.CoreComponent, InternalTabProps> {
|
|
16
|
+
validateChildren: (children: AnyComponent[]) => void;
|
|
16
17
|
/** @hidden */
|
|
17
18
|
getProtoInfo: (idMap: IDMap) => proto.TabComponent;
|
|
18
19
|
}
|
|
19
20
|
type InternalTabsProps = Record<never, never>;
|
|
20
21
|
type TabsProps = InternalTabsProps;
|
|
21
|
-
declare class Tabs extends BaseParent<InternalTabsProps> {
|
|
22
|
-
validateChildren: (children:
|
|
22
|
+
declare class Tabs extends BaseParent<proto.CoreNamespace, proto.CoreComponent, InternalTabsProps> {
|
|
23
|
+
validateChildren: (children: AnyComponent[]) => void;
|
|
23
24
|
constructor(props?: TabsProps);
|
|
24
25
|
addTabs(...tabs: TabDefinition[]): void;
|
|
25
|
-
addTab<C extends
|
|
26
|
+
addTab<C extends AnyComponent>(name: string, component: C): C;
|
|
26
27
|
/** @hidden */
|
|
27
28
|
getProtoInfo(idMap: IDMap): proto.TabsComponent;
|
|
28
29
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
4
|
+
var _chunkARRRZPUKjs = require('../../chunk-ARRRZPUK.js');
|
|
5
|
+
require('../../chunk-ADH7RZG5.js');
|
|
6
6
|
require('../../chunk-3RG5ZIWI.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.Tab =
|
|
10
|
+
exports.Tab = _chunkARRRZPUKjs.Tab; exports.Tabs = _chunkARRRZPUKjs.Tabs;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
3
|
import { Base, Listenable } from './base.mjs';
|
|
4
|
+
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type Events = {
|
|
@@ -8,18 +9,19 @@ type Events = {
|
|
|
8
9
|
};
|
|
9
10
|
type InternalProps = {
|
|
10
11
|
value: string | null;
|
|
12
|
+
onChange?: Events['change'];
|
|
11
13
|
};
|
|
12
14
|
type Props = Partial<InternalProps>;
|
|
13
|
-
declare class TextInput extends Base<InternalProps> implements Listenable<Events> {
|
|
15
|
+
declare class TextInput extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> implements Listenable<Events> {
|
|
14
16
|
/** @hidden */
|
|
15
17
|
private readonly events;
|
|
16
18
|
constructor(props?: Props);
|
|
17
19
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
18
20
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
19
21
|
/** @hidden */
|
|
20
|
-
getProtoInfo: (idMap: IDMap) => proto.
|
|
22
|
+
getProtoInfo: (idMap: IDMap) => proto.CoreComponent;
|
|
21
23
|
/** @hidden */
|
|
22
|
-
handleMessage: (message:
|
|
24
|
+
handleMessage: (message: AnyClientComponentMessage) => void;
|
|
23
25
|
getValue: () => string | null;
|
|
24
26
|
getValidatedValue: <T>(validator: (text: string) => T) => null | T;
|
|
25
27
|
setValue: (value: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
3
|
import { Base, Listenable } from './base.js';
|
|
4
|
+
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type Events = {
|
|
@@ -8,18 +9,19 @@ type Events = {
|
|
|
8
9
|
};
|
|
9
10
|
type InternalProps = {
|
|
10
11
|
value: string | null;
|
|
12
|
+
onChange?: Events['change'];
|
|
11
13
|
};
|
|
12
14
|
type Props = Partial<InternalProps>;
|
|
13
|
-
declare class TextInput extends Base<InternalProps> implements Listenable<Events> {
|
|
15
|
+
declare class TextInput extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> implements Listenable<Events> {
|
|
14
16
|
/** @hidden */
|
|
15
17
|
private readonly events;
|
|
16
18
|
constructor(props?: Props);
|
|
17
19
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
18
20
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
19
21
|
/** @hidden */
|
|
20
|
-
getProtoInfo: (idMap: IDMap) => proto.
|
|
22
|
+
getProtoInfo: (idMap: IDMap) => proto.CoreComponent;
|
|
21
23
|
/** @hidden */
|
|
22
|
-
handleMessage: (message:
|
|
24
|
+
handleMessage: (message: AnyClientComponentMessage) => void;
|
|
23
25
|
getValue: () => string | null;
|
|
24
26
|
getValidatedValue: <T>(validator: (text: string) => T) => null | T;
|
|
25
27
|
setValue: (value: string) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var _chunkHNFNG5MDjs = require('../../chunk-HNFNG5MD.js');
|
|
4
|
+
require('../../chunk-ADH7RZG5.js');
|
|
5
5
|
require('../../chunk-3RG5ZIWI.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.TextInput =
|
|
8
|
+
exports.TextInput = _chunkHNFNG5MDjs.TextInput;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
3
|
import { Base } from './base.mjs';
|
|
4
|
+
import '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type InternalProps = {
|
|
@@ -10,10 +11,10 @@ type InternalProps = {
|
|
|
10
11
|
source: proto.TimelineComponent['source'] | null;
|
|
11
12
|
};
|
|
12
13
|
type Props = Partial<InternalProps>;
|
|
13
|
-
declare class Timeline extends Base<InternalProps> {
|
|
14
|
+
declare class Timeline extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> {
|
|
14
15
|
constructor(props?: Props);
|
|
15
16
|
/** @hidden */
|
|
16
|
-
getProtoInfo: (idMap: IDMap) => proto.
|
|
17
|
+
getProtoInfo: (idMap: IDMap) => proto.CoreComponent;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export { type Props, Timeline };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as proto from '@arcanejs/protocol';
|
|
1
|
+
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
3
|
import { Base } from './base.js';
|
|
4
|
+
import '@arcanejs/protocol';
|
|
4
5
|
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type InternalProps = {
|
|
@@ -10,10 +11,10 @@ type InternalProps = {
|
|
|
10
11
|
source: proto.TimelineComponent['source'] | null;
|
|
11
12
|
};
|
|
12
13
|
type Props = Partial<InternalProps>;
|
|
13
|
-
declare class Timeline extends Base<InternalProps> {
|
|
14
|
+
declare class Timeline extends Base<proto.CoreNamespace, proto.CoreComponent, InternalProps> {
|
|
14
15
|
constructor(props?: Props);
|
|
15
16
|
/** @hidden */
|
|
16
|
-
getProtoInfo: (idMap: IDMap) => proto.
|
|
17
|
+
getProtoInfo: (idMap: IDMap) => proto.CoreComponent;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export { type Props, Timeline };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var _chunkT4TMVBFMjs = require('../../chunk-T4TMVBFM.js');
|
|
4
|
+
require('../../chunk-ADH7RZG5.js');
|
|
5
5
|
require('../../chunk-3RG5ZIWI.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Timeline =
|
|
8
|
+
exports.Timeline = _chunkT4TMVBFMjs.Timeline;
|
|
@@ -1,13 +1,14 @@
|
|
|
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
|
|
4
|
+
var _chunkADH7RZG5js = require('./chunk-ADH7RZG5.js');
|
|
5
5
|
|
|
6
6
|
// src/backend/components/switch.ts
|
|
7
|
+
var _core = require('@arcanejs/protocol/core'); var proto = _interopRequireWildcard(_core);
|
|
7
8
|
var DEFAULT_PROPS = {};
|
|
8
|
-
var Switch = (_class = class extends
|
|
9
|
+
var Switch = (_class = class extends _chunkADH7RZG5js.Base {
|
|
9
10
|
/** @hidden */
|
|
10
|
-
__init() {this.events = new (0,
|
|
11
|
+
__init() {this.events = new (0, _chunkADH7RZG5js.EventEmitter)()}
|
|
11
12
|
/**
|
|
12
13
|
* Manually manage the state of the switch,
|
|
13
14
|
* to support both controlled and uncontrolled inputs.
|
|
@@ -15,15 +16,24 @@ var Switch = (_class = class extends _chunkCFO5PSSKjs.Base {
|
|
|
15
16
|
__init2() {this._value = null}
|
|
16
17
|
constructor(props) {
|
|
17
18
|
super(DEFAULT_PROPS, props, {
|
|
18
|
-
onPropsUpdated: () =>
|
|
19
|
+
onPropsUpdated: (oldProps) => {
|
|
20
|
+
this.events.processPropChanges(
|
|
21
|
+
{
|
|
22
|
+
onChange: "change"
|
|
23
|
+
},
|
|
24
|
+
oldProps,
|
|
25
|
+
this.props
|
|
26
|
+
), this.onPropsUpdated();
|
|
27
|
+
}
|
|
19
28
|
});_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);;
|
|
20
|
-
this.
|
|
29
|
+
this.triggerInitialPropsUpdate();
|
|
21
30
|
}
|
|
22
31
|
__init3() {this.addListener = this.events.addListener}
|
|
23
32
|
__init4() {this.removeListener = this.events.removeListener}
|
|
24
33
|
/** @hidden */
|
|
25
34
|
getProtoInfo(idMap) {
|
|
26
35
|
return {
|
|
36
|
+
namespace: "core",
|
|
27
37
|
component: "switch",
|
|
28
38
|
key: idMap.getId(this),
|
|
29
39
|
state: _nullishCoalesce(this._value, () => ( "off"))
|
|
@@ -31,7 +41,7 @@ var Switch = (_class = class extends _chunkCFO5PSSKjs.Base {
|
|
|
31
41
|
}
|
|
32
42
|
/** @hidden */
|
|
33
43
|
handleMessage(message) {
|
|
34
|
-
if (message
|
|
44
|
+
if (proto.isCoreComponentMessage(message, "switch")) {
|
|
35
45
|
const state = this._value === "on" ? "off" : "on";
|
|
36
46
|
if (this.props.value === void 0) {
|
|
37
47
|
this._value = state;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkADH7RZG5js = require('./chunk-ADH7RZG5.js');
|
|
4
4
|
|
|
5
5
|
// src/backend/components/rect.ts
|
|
6
6
|
var DEFAULT_PROPS = {
|
|
7
7
|
color: "rgba(0, 0, 0, 0)"
|
|
8
8
|
};
|
|
9
|
-
var Rect = class extends
|
|
9
|
+
var Rect = class extends _chunkADH7RZG5js.Base {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(DEFAULT_PROPS, props);
|
|
12
12
|
}
|
|
13
13
|
/** @hidden */
|
|
14
14
|
getProtoInfo(idMap) {
|
|
15
15
|
return {
|
|
16
|
+
namespace: "core",
|
|
16
17
|
component: "rect",
|
|
17
18
|
key: idMap.getId(this),
|
|
18
19
|
...this.props
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseParent,
|
|
3
3
|
EventEmitter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7SZA6JUN.mjs";
|
|
5
5
|
|
|
6
6
|
// src/backend/components/group.ts
|
|
7
|
+
import * as proto from "@arcanejs/protocol/core";
|
|
7
8
|
var GROUP_DEFAULT_STYLE = {
|
|
8
9
|
direction: "horizontal"
|
|
9
10
|
};
|
|
@@ -17,6 +18,7 @@ var GroupHeader = class extends BaseParent {
|
|
|
17
18
|
};
|
|
18
19
|
/** @hidden */
|
|
19
20
|
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))
|
|
@@ -26,7 +28,16 @@ var Group = class extends BaseParent {
|
|
|
26
28
|
/** @hidden */
|
|
27
29
|
events = new EventEmitter();
|
|
28
30
|
constructor(props) {
|
|
29
|
-
super(DEFAULT_PROPS, props
|
|
31
|
+
super(DEFAULT_PROPS, props, {
|
|
32
|
+
onPropsUpdated: (oldProps) => this.events.processPropChanges(
|
|
33
|
+
{
|
|
34
|
+
onTitleChanged: "title-changed"
|
|
35
|
+
},
|
|
36
|
+
oldProps,
|
|
37
|
+
this.props
|
|
38
|
+
)
|
|
39
|
+
});
|
|
40
|
+
this.triggerInitialPropsUpdate();
|
|
30
41
|
}
|
|
31
42
|
addListener = this.events.addListener;
|
|
32
43
|
removeListener = this.events.removeListener;
|
|
@@ -70,17 +81,18 @@ var Group = class extends 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: this.props.title ?? void 0,
|
|
83
|
-
direction: this.props.direction,
|
|
95
|
+
direction: 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 = class extends BaseParent {
|
|
|
92
104
|
};
|
|
93
105
|
/** @hidden */
|
|
94
106
|
handleMessage = (message) => {
|
|
95
|
-
if (message
|
|
107
|
+
if (proto.isCoreComponentMessage(message, "group")) {
|
|
96
108
|
this.events.emit("title-changed", message.title);
|
|
97
109
|
}
|
|
98
110
|
};
|
|
@@ -14,8 +14,23 @@ var Base = class {
|
|
|
14
14
|
...defaultProps,
|
|
15
15
|
...props
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
if (options?.onPropsUpdated) {
|
|
18
|
+
const initialProps = this._props;
|
|
19
|
+
this._onPropsUpdated = {
|
|
20
|
+
listener: options.onPropsUpdated,
|
|
21
|
+
canSendInitialPropsUpdate: () => this._props === initialProps
|
|
22
|
+
};
|
|
23
|
+
}
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Call if
|
|
27
|
+
*/
|
|
28
|
+
triggerInitialPropsUpdate = () => {
|
|
29
|
+
if (!this._onPropsUpdated?.canSendInitialPropsUpdate()) {
|
|
30
|
+
throw new Error("Cannot call triggerInitialPropsUpdate()");
|
|
31
|
+
}
|
|
32
|
+
this._onPropsUpdated.listener(this.defaultProps);
|
|
33
|
+
};
|
|
19
34
|
log = () => {
|
|
20
35
|
return this.parent?.log() || null;
|
|
21
36
|
};
|
|
@@ -26,19 +41,21 @@ var Base = class {
|
|
|
26
41
|
this.setProps(props);
|
|
27
42
|
}
|
|
28
43
|
setProps = (props) => {
|
|
44
|
+
const oldProps = this._props;
|
|
29
45
|
this._props = Object.freeze({
|
|
30
46
|
...this.defaultProps,
|
|
31
47
|
...props
|
|
32
48
|
});
|
|
33
|
-
this._onPropsUpdated?.();
|
|
49
|
+
this._onPropsUpdated?.listener?.(oldProps);
|
|
34
50
|
this.updateTree();
|
|
35
51
|
};
|
|
36
52
|
updateProps = (updates) => {
|
|
53
|
+
const oldProps = this._props;
|
|
37
54
|
this._props = Object.freeze({
|
|
38
55
|
...this._props,
|
|
39
56
|
...updates
|
|
40
57
|
});
|
|
41
|
-
this._onPropsUpdated?.();
|
|
58
|
+
this._onPropsUpdated?.listener?.(oldProps);
|
|
42
59
|
this.updateTree();
|
|
43
60
|
};
|
|
44
61
|
/** @hidden */
|
|
@@ -160,6 +177,20 @@ var EventEmitter = class {
|
|
|
160
177
|
)
|
|
161
178
|
);
|
|
162
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* Process prop changes to update listeners
|
|
182
|
+
*/
|
|
183
|
+
processPropChanges = (mapping, oldProps, newProps) => {
|
|
184
|
+
for (const key of Object.keys(mapping)) {
|
|
185
|
+
const prev = oldProps[key];
|
|
186
|
+
const next = newProps[key];
|
|
187
|
+
if (prev !== next) {
|
|
188
|
+
const eventName = mapping[key];
|
|
189
|
+
prev && this.removeListener(eventName, prev);
|
|
190
|
+
next && this.addListener(eventName, next);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
163
194
|
};
|
|
164
195
|
|
|
165
196
|
export {
|