@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.
Files changed (56) hide show
  1. package/dist/backend/components/base.d.mts +69 -2
  2. package/dist/backend/components/base.d.ts +69 -2
  3. package/dist/backend/components/base.mjs +2 -1
  4. package/dist/backend/components/button.d.mts +5 -4
  5. package/dist/backend/components/button.d.ts +5 -4
  6. package/dist/backend/components/button.mjs +3 -2
  7. package/dist/backend/components/group.d.mts +9 -8
  8. package/dist/backend/components/group.d.ts +9 -8
  9. package/dist/backend/components/group.js +4 -7
  10. package/dist/backend/components/group.mjs +3 -2
  11. package/dist/backend/components/label.d.mts +5 -3
  12. package/dist/backend/components/label.d.ts +5 -3
  13. package/dist/backend/components/label.mjs +3 -2
  14. package/dist/backend/components/rect.d.mts +4 -3
  15. package/dist/backend/components/rect.d.ts +4 -3
  16. package/dist/backend/components/rect.mjs +3 -2
  17. package/dist/backend/components/slider-button.d.mts +5 -4
  18. package/dist/backend/components/slider-button.d.ts +5 -4
  19. package/dist/backend/components/slider-button.mjs +3 -2
  20. package/dist/backend/components/switch.d.mts +5 -4
  21. package/dist/backend/components/switch.d.ts +5 -4
  22. package/dist/backend/components/switch.mjs +3 -2
  23. package/dist/backend/components/tabs.d.mts +5 -4
  24. package/dist/backend/components/tabs.d.ts +5 -4
  25. package/dist/backend/components/tabs.mjs +3 -2
  26. package/dist/backend/components/text-input.d.mts +5 -4
  27. package/dist/backend/components/text-input.d.ts +5 -4
  28. package/dist/backend/components/text-input.mjs +3 -2
  29. package/dist/backend/components/timeline.d.mts +6 -5
  30. package/dist/backend/components/timeline.d.ts +6 -5
  31. package/dist/backend/components/timeline.mjs +3 -2
  32. package/dist/backend/util/index.d.mts +7 -0
  33. package/dist/backend/util/index.d.ts +7 -0
  34. package/dist/backend/util/index.js +43 -0
  35. package/dist/backend/util/index.mjs +7 -0
  36. package/dist/{chunk-S5DQIYC2.mjs → chunk-3O4P67DM.mjs} +3 -6
  37. package/dist/{chunk-37VNFO5S.mjs → chunk-APCR3ITH.mjs} +1 -1
  38. package/dist/{chunk-P6X5GIDT.mjs → chunk-HNEUZVCX.mjs} +1 -1
  39. package/dist/{chunk-6LL3X7ZZ.mjs → chunk-IXTM35YM.mjs} +1 -1
  40. package/dist/{chunk-HVFTRNLQ.mjs → chunk-JW4GXS54.mjs} +1 -1
  41. package/dist/chunk-RGHJEMWG.mjs +17 -0
  42. package/dist/{chunk-DBW4OPGN.mjs → chunk-SOC4TF3J.mjs} +1 -1
  43. package/dist/{chunk-DP3QFYSS.mjs → chunk-TAZH4BBH.mjs} +1 -1
  44. package/dist/{chunk-3ZBM7Q4A.mjs → chunk-TQ27Y7F4.mjs} +1 -1
  45. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  46. package/dist/{chunk-HF77PS7J.mjs → chunk-ZCHM3JJJ.mjs} +0 -8
  47. package/dist/{chunk-GQZA5K4M.mjs → chunk-ZU5H6SVA.mjs} +1 -1
  48. package/dist/frontend.js +1345 -398
  49. package/dist/frontend.js.map +4 -4
  50. package/dist/index.d.mts +4 -2
  51. package/dist/index.d.ts +4 -2
  52. package/dist/index.js +2 -5
  53. package/dist/index.mjs +14 -24
  54. package/package.json +11 -3
  55. package/dist/base-BJAPu0O1.d.mts +0 -234
  56. package/dist/base-BJAPu0O1.d.ts +0 -234
@@ -1,5 +1,6 @@
1
- import { e as Base, L as Listenable, I as IDMap, g as Component, d as ClientComponentMessage } from '../../base-BJAPu0O1.js';
2
- import '@arcanejs/diff';
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,7 +1,8 @@
1
1
  import {
2
2
  TextInput
3
- } from "../../chunk-6LL3X7ZZ.mjs";
4
- import "../../chunk-HF77PS7J.mjs";
3
+ } from "../../chunk-IXTM35YM.mjs";
4
+ import "../../chunk-ZCHM3JJJ.mjs";
5
+ import "../../chunk-Y6FXYEAI.mjs";
5
6
  export {
6
7
  TextInput
7
8
  };
@@ -1,17 +1,18 @@
1
- import { e as Base, I as IDMap, g as Component, j as TimelineState, k as TimelineComponent } from '../../base-BJAPu0O1.mjs';
2
- import '@arcanejs/diff';
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 { e as Base, I as IDMap, g as Component, j as TimelineState, k as TimelineComponent } from '../../base-BJAPu0O1.js';
2
- import '@arcanejs/diff';
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 };
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  Timeline
3
- } from "../../chunk-DBW4OPGN.mjs";
4
- import "../../chunk-HF77PS7J.mjs";
3
+ } from "../../chunk-SOC4TF3J.mjs";
4
+ import "../../chunk-ZCHM3JJJ.mjs";
5
+ import "../../chunk-Y6FXYEAI.mjs";
5
6
  export {
6
7
  Timeline
7
8
  };
@@ -0,0 +1,7 @@
1
+ declare class IDMap {
2
+ private readonly idMap;
3
+ private nextId;
4
+ getId(object: object): number;
5
+ }
6
+
7
+ export { IDMap };
@@ -0,0 +1,7 @@
1
+ declare class IDMap {
2
+ private readonly idMap;
3
+ private nextId;
4
+ getId(object: object): number;
5
+ }
6
+
7
+ export { IDMap };
@@ -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
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ IDMap
3
+ } from "../../chunk-RGHJEMWG.mjs";
4
+ import "../../chunk-Y6FXYEAI.mjs";
5
+ export {
6
+ IDMap
7
+ };
@@ -1,19 +1,16 @@
1
1
  import {
2
2
  BaseParent,
3
3
  EventEmitter
4
- } from "./chunk-HF77PS7J.mjs";
4
+ } from "./chunk-ZCHM3JJJ.mjs";
5
5
 
6
- // src/shared/styles.ts
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 = () => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Base,
3
3
  EventEmitter
4
- } from "./chunk-HF77PS7J.mjs";
4
+ } from "./chunk-ZCHM3JJJ.mjs";
5
5
 
6
6
  // src/backend/components/switch.ts
7
7
  var DEFAULT_PROPS = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Base
3
- } from "./chunk-HF77PS7J.mjs";
3
+ } from "./chunk-ZCHM3JJJ.mjs";
4
4
 
5
5
  // src/backend/components/label.ts
6
6
  var Label = class extends Base {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Base,
3
3
  EventEmitter
4
- } from "./chunk-HF77PS7J.mjs";
4
+ } from "./chunk-ZCHM3JJJ.mjs";
5
5
 
6
6
  // src/backend/components/text-input.ts
7
7
  var DEFAULT_PROPS = {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Base,
3
3
  EventEmitter
4
- } from "./chunk-HF77PS7J.mjs";
4
+ } from "./chunk-ZCHM3JJJ.mjs";
5
5
 
6
6
  // src/backend/components/slider-button.ts
7
7
  var DEFAULT_PROPS = {
@@ -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
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Base
3
- } from "./chunk-HF77PS7J.mjs";
3
+ } from "./chunk-ZCHM3JJJ.mjs";
4
4
 
5
5
  // src/backend/components/timeline.ts
6
6
  var DEFAULT_PROPS = {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Base,
3
3
  EventEmitter
4
- } from "./chunk-HF77PS7J.mjs";
4
+ } from "./chunk-ZCHM3JJJ.mjs";
5
5
 
6
6
  // src/backend/components/button.ts
7
7
  var DEFAULT_PROPS = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BaseParent
3
- } from "./chunk-HF77PS7J.mjs";
3
+ } from "./chunk-ZCHM3JJJ.mjs";
4
4
 
5
5
  // src/backend/components/tabs.ts
6
6
  var Tab = class extends BaseParent {
@@ -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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Base
3
- } from "./chunk-HF77PS7J.mjs";
3
+ } from "./chunk-ZCHM3JJJ.mjs";
4
4
 
5
5
  // src/backend/components/rect.ts
6
6
  var DEFAULT_PROPS = {