@arcanejs/toolkit 0.1.1 → 0.2.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.
- package/dist/backend/components/base.d.mts +69 -2
- package/dist/backend/components/base.d.ts +69 -2
- package/dist/backend/components/base.mjs +2 -1
- package/dist/backend/components/button.d.mts +5 -4
- package/dist/backend/components/button.d.ts +5 -4
- package/dist/backend/components/button.mjs +3 -2
- package/dist/backend/components/group.d.mts +9 -8
- package/dist/backend/components/group.d.ts +9 -8
- package/dist/backend/components/group.js +4 -7
- package/dist/backend/components/group.mjs +3 -2
- package/dist/backend/components/label.d.mts +5 -3
- package/dist/backend/components/label.d.ts +5 -3
- package/dist/backend/components/label.mjs +3 -2
- package/dist/backend/components/rect.d.mts +4 -3
- package/dist/backend/components/rect.d.ts +4 -3
- package/dist/backend/components/rect.mjs +3 -2
- package/dist/backend/components/slider-button.d.mts +5 -4
- package/dist/backend/components/slider-button.d.ts +5 -4
- package/dist/backend/components/slider-button.mjs +3 -2
- package/dist/backend/components/switch.d.mts +5 -4
- package/dist/backend/components/switch.d.ts +5 -4
- package/dist/backend/components/switch.mjs +3 -2
- package/dist/backend/components/tabs.d.mts +5 -4
- package/dist/backend/components/tabs.d.ts +5 -4
- package/dist/backend/components/tabs.mjs +3 -2
- package/dist/backend/components/text-input.d.mts +5 -4
- package/dist/backend/components/text-input.d.ts +5 -4
- package/dist/backend/components/text-input.mjs +3 -2
- package/dist/backend/components/timeline.d.mts +6 -5
- package/dist/backend/components/timeline.d.ts +6 -5
- package/dist/backend/components/timeline.mjs +3 -2
- package/dist/backend/util/index.d.mts +7 -0
- package/dist/backend/util/index.d.ts +7 -0
- package/dist/backend/util/index.js +43 -0
- package/dist/backend/util/index.mjs +7 -0
- package/dist/{chunk-S5DQIYC2.mjs → chunk-3O4P67DM.mjs} +3 -6
- package/dist/{chunk-37VNFO5S.mjs → chunk-APCR3ITH.mjs} +1 -1
- package/dist/{chunk-P6X5GIDT.mjs → chunk-HNEUZVCX.mjs} +1 -1
- package/dist/{chunk-6LL3X7ZZ.mjs → chunk-IXTM35YM.mjs} +1 -1
- package/dist/{chunk-HVFTRNLQ.mjs → chunk-JW4GXS54.mjs} +1 -1
- package/dist/chunk-RGHJEMWG.mjs +17 -0
- package/dist/{chunk-DBW4OPGN.mjs → chunk-SOC4TF3J.mjs} +1 -1
- package/dist/{chunk-DP3QFYSS.mjs → chunk-TAZH4BBH.mjs} +1 -1
- package/dist/{chunk-3ZBM7Q4A.mjs → chunk-TQ27Y7F4.mjs} +1 -1
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/{chunk-HF77PS7J.mjs → chunk-ZCHM3JJJ.mjs} +0 -8
- package/dist/{chunk-GQZA5K4M.mjs → chunk-ZU5H6SVA.mjs} +1 -1
- package/dist/frontend.js +1345 -398
- package/dist/frontend.js.map +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -5
- package/dist/index.mjs +14 -24
- package/package.json +11 -3
- package/dist/base-BJAPu0O1.d.mts +0 -234
- package/dist/base-BJAPu0O1.d.ts +0 -234
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base, Listenable } from './base.js';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (value: string) => void | Promise<void>;
|
|
@@ -15,9 +16,9 @@ declare class TextInput extends Base<InternalProps> implements Listenable<Events
|
|
|
15
16
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
16
17
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
17
18
|
/** @hidden */
|
|
18
|
-
getProtoInfo: (idMap: IDMap) => Component;
|
|
19
|
+
getProtoInfo: (idMap: IDMap) => proto.Component;
|
|
19
20
|
/** @hidden */
|
|
20
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
21
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
21
22
|
getValue: () => string | null;
|
|
22
23
|
getValidatedValue: <T>(validator: (text: string) => T) => null | T;
|
|
23
24
|
setValue: (value: string) => void;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type InternalProps = {
|
|
5
|
-
state: TimelineState;
|
|
6
|
+
state: proto.TimelineState;
|
|
6
7
|
title: string | null;
|
|
7
8
|
subtitles: string[] | null;
|
|
8
|
-
source: TimelineComponent['source'] | null;
|
|
9
|
+
source: proto.TimelineComponent['source'] | null;
|
|
9
10
|
};
|
|
10
11
|
type Props = Partial<InternalProps>;
|
|
11
12
|
declare class Timeline extends Base<InternalProps> {
|
|
12
13
|
constructor(props?: Props);
|
|
13
14
|
/** @hidden */
|
|
14
|
-
getProtoInfo: (idMap: IDMap) => Component;
|
|
15
|
+
getProtoInfo: (idMap: IDMap) => proto.Component;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export { type Props, Timeline };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base } from './base.js';
|
|
3
4
|
|
|
4
5
|
type InternalProps = {
|
|
5
|
-
state: TimelineState;
|
|
6
|
+
state: proto.TimelineState;
|
|
6
7
|
title: string | null;
|
|
7
8
|
subtitles: string[] | null;
|
|
8
|
-
source: TimelineComponent['source'] | null;
|
|
9
|
+
source: proto.TimelineComponent['source'] | null;
|
|
9
10
|
};
|
|
10
11
|
type Props = Partial<InternalProps>;
|
|
11
12
|
declare class Timeline extends Base<InternalProps> {
|
|
12
13
|
constructor(props?: Props);
|
|
13
14
|
/** @hidden */
|
|
14
|
-
getProtoInfo: (idMap: IDMap) => Component;
|
|
15
|
+
getProtoInfo: (idMap: IDMap) => proto.Component;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export { type Props, Timeline };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/backend/util/index.ts
|
|
21
|
+
var util_exports = {};
|
|
22
|
+
__export(util_exports, {
|
|
23
|
+
IDMap: () => IDMap
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(util_exports);
|
|
26
|
+
|
|
27
|
+
// src/backend/util/id-map.ts
|
|
28
|
+
var IDMap = class {
|
|
29
|
+
idMap = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
nextId = 0;
|
|
31
|
+
getId(object) {
|
|
32
|
+
let i = this.idMap.get(object);
|
|
33
|
+
if (i === void 0) {
|
|
34
|
+
i = this.nextId++;
|
|
35
|
+
this.idMap.set(object, i);
|
|
36
|
+
}
|
|
37
|
+
return i;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
IDMap
|
|
43
|
+
});
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseParent,
|
|
3
3
|
EventEmitter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZCHM3JJJ.mjs";
|
|
5
5
|
|
|
6
|
-
// src/
|
|
6
|
+
// src/backend/components/group.ts
|
|
7
7
|
var GROUP_DEFAULT_STYLE = {
|
|
8
8
|
direction: "horizontal"
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
// src/backend/components/group.ts
|
|
12
10
|
var DEFAULT_PROPS = {
|
|
13
11
|
...GROUP_DEFAULT_STYLE,
|
|
14
12
|
title: null,
|
|
15
|
-
labels: null
|
|
16
|
-
headerComponents: null
|
|
13
|
+
labels: null
|
|
17
14
|
};
|
|
18
15
|
var GroupHeader = class extends BaseParent {
|
|
19
16
|
validateChildren = () => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/backend/util/id-map.ts
|
|
2
|
+
var IDMap = class {
|
|
3
|
+
idMap = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
nextId = 0;
|
|
5
|
+
getId(object) {
|
|
6
|
+
let i = this.idMap.get(object);
|
|
7
|
+
if (i === void 0) {
|
|
8
|
+
i = this.nextId++;
|
|
9
|
+
this.idMap.set(object, i);
|
|
10
|
+
}
|
|
11
|
+
return i;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
IDMap
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__require
|
|
10
|
+
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/backend/components/base.ts
|
|
9
2
|
var Base = class {
|
|
10
3
|
/** @hidden */
|
|
@@ -164,7 +157,6 @@ var EventEmitter = class {
|
|
|
164
157
|
};
|
|
165
158
|
|
|
166
159
|
export {
|
|
167
|
-
__require,
|
|
168
160
|
Base,
|
|
169
161
|
BaseParent,
|
|
170
162
|
EventEmitter
|