@nil-/xit 0.2.8 → 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.
package/assets/index.js CHANGED
@@ -5,8 +5,8 @@ var kt = (s) => {
5
5
  var ae = (s, t, e) => t in s ? ne(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
6
  var n = (s, t, e) => ae(s, typeof t != "symbol" ? t + "" : t, e), It = (s, t, e) => t.has(s) || kt("Cannot " + e);
7
7
  var u = (s, t, e) => (It(s, t, "read from private field"), e ? e.call(s) : t.get(s)), W = (s, t, e) => t.has(s) ? kt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), w = (s, t, e, i) => (It(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), wt = (s, t, e) => (It(s, t, "access private method"), e);
8
- import { w as et, g as At } from "./svelte/store.js";
9
- const mt = 2500;
8
+ import { w as et, g as Nt } from "./svelte/store.js";
9
+ const mt = 1e4;
10
10
  var _t, Ft, v, rt, ot, lt, x, g;
11
11
  class ft {
12
12
  constructor(t) {
@@ -100,7 +100,7 @@ function oe(s) {
100
100
  }
101
101
  );
102
102
  }
103
- const vt = 2, L = 4, E = 4, f = 4, H = new Int32Array(2), yt = new Float32Array(H.buffer), Nt = new Float64Array(H.buffer), bt = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
103
+ const vt = 2, L = 4, E = 4, f = 4, H = new Int32Array(2), yt = new Float32Array(H.buffer), At = new Float64Array(H.buffer), bt = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
104
104
  var Vt;
105
105
  (function(s) {
106
106
  s[s.UTF8_BYTES = 1] = "UTF8_BYTES", s[s.UTF16_STRING = 2] = "UTF16_STRING";
@@ -173,7 +173,7 @@ class P {
173
173
  return H[0] = this.readInt32(t), yt[0];
174
174
  }
175
175
  readFloat64(t) {
176
- return H[bt ? 0 : 1] = this.readInt32(t), H[bt ? 1 : 0] = this.readInt32(t + 4), Nt[0];
176
+ return H[bt ? 0 : 1] = this.readInt32(t), H[bt ? 1 : 0] = this.readInt32(t + 4), At[0];
177
177
  }
178
178
  writeInt8(t, e) {
179
179
  this.bytes_[t] = e;
@@ -203,7 +203,7 @@ class P {
203
203
  yt[0] = e, this.writeInt32(t, H[0]);
204
204
  }
205
205
  writeFloat64(t, e) {
206
- Nt[0] = e, this.writeInt32(t, H[bt ? 0 : 1]), this.writeInt32(t + 4, H[bt ? 1 : 0]);
206
+ At[0] = e, this.writeInt32(t, H[bt ? 0 : 1]), this.writeInt32(t + 4, H[bt ? 1 : 0]);
207
207
  }
208
208
  /**
209
209
  * Return the file identifier. Behavior is undefined for FlatBuffers whose
@@ -312,7 +312,7 @@ class P {
312
312
  return i;
313
313
  }
314
314
  }
315
- class k {
315
+ class y {
316
316
  /**
317
317
  * Create a FlatBufferBuilder.
318
318
  */
@@ -363,7 +363,7 @@ class k {
363
363
  const i = ~(this.bb.capacity() - this.space + e) + 1 & t - 1;
364
364
  for (; this.space < i + t + e; ) {
365
365
  const a = this.bb.capacity();
366
- this.bb = k.growByteBuffer(this.bb), this.space += this.bb.capacity() - a;
366
+ this.bb = y.growByteBuffer(this.bb), this.space += this.bb.capacity() - a;
367
367
  }
368
368
  this.pad(i);
369
369
  }
@@ -675,7 +675,7 @@ class k {
675
675
  return e(this, t.length), this.createObjectOffsetList(t.slice().reverse()), this.endVector();
676
676
  }
677
677
  }
678
- class A {
678
+ class N {
679
679
  constructor() {
680
680
  n(this, "bb", null);
681
681
  n(this, "bb_pos", 0);
@@ -684,10 +684,10 @@ class A {
684
684
  return this.bb_pos = t, this.bb = e, this;
685
685
  }
686
686
  static getRootAsFileInfo(t, e) {
687
- return (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
687
+ return (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
688
688
  }
689
689
  static getSizePrefixedRootAsFileInfo(t, e) {
690
- return t.setPosition(t.position() + f), (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
690
+ return t.setPosition(t.position() + f), (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
691
691
  }
692
692
  target(t) {
693
693
  const e = this.bb.__offset(this.bb_pos, 4);
@@ -728,27 +728,27 @@ class A {
728
728
  return t.requiredField(e, 4), t.requiredField(e, 6), e;
729
729
  }
730
730
  static createFileInfo(t, e, i) {
731
- return A.startFileInfo(t), A.addTarget(t, e), A.addMetadata(t, i), A.endFileInfo(t);
731
+ return N.startFileInfo(t), N.addTarget(t, e), N.addMetadata(t, i), N.endFileInfo(t);
732
732
  }
733
733
  unpack() {
734
- return new Bt(this.target(), this.bb.createScalarList(this.metadata.bind(this), this.metadataLength()));
734
+ return new Ct(this.target(), this.bb.createScalarList(this.metadata.bind(this), this.metadataLength()));
735
735
  }
736
736
  unpackTo(t) {
737
737
  t.target = this.target(), t.metadata = this.bb.createScalarList(this.metadata.bind(this), this.metadataLength());
738
738
  }
739
739
  }
740
- class Bt {
740
+ class Ct {
741
741
  constructor(t = null, e = []) {
742
742
  n(this, "target");
743
743
  n(this, "metadata");
744
744
  this.target = t, this.metadata = e;
745
745
  }
746
746
  pack(t) {
747
- const e = this.target !== null ? t.createString(this.target) : 0, i = A.createMetadataVector(t, this.metadata);
748
- return A.createFileInfo(t, e, i);
747
+ const e = this.target !== null ? t.createString(this.target) : 0, i = N.createMetadataVector(t, this.metadata);
748
+ return N.createFileInfo(t, e, i);
749
749
  }
750
750
  }
751
- class N {
751
+ class R {
752
752
  constructor() {
753
753
  n(this, "bb", null);
754
754
  n(this, "bb_pos", 0);
@@ -757,39 +757,46 @@ class N {
757
757
  return this.bb_pos = t, this.bb = e, this;
758
758
  }
759
759
  static getRootAsFrameCache(t, e) {
760
- return (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
760
+ return (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
761
761
  }
762
762
  static getSizePrefixedRootAsFrameCache(t, e) {
763
- return t.setPosition(t.position() + f), (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
763
+ return t.setPosition(t.position() + f), (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
764
764
  }
765
765
  id(t) {
766
766
  const e = this.bb.__offset(this.bb_pos, 4);
767
767
  return e ? this.bb.__string(this.bb_pos + e, t) : null;
768
768
  }
769
- content(t) {
769
+ target(t) {
770
770
  const e = this.bb.__offset(this.bb_pos, 6);
771
771
  return e ? this.bb.__string(this.bb_pos + e, t) : null;
772
772
  }
773
+ content(t) {
774
+ const e = this.bb.__offset(this.bb_pos, 8);
775
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
776
+ }
773
777
  files(t, e) {
774
- const i = this.bb.__offset(this.bb_pos, 8);
775
- return i ? (e || new A()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
778
+ const i = this.bb.__offset(this.bb_pos, 10);
779
+ return i ? (e || new N()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
776
780
  }
777
781
  filesLength() {
778
- const t = this.bb.__offset(this.bb_pos, 8);
782
+ const t = this.bb.__offset(this.bb_pos, 10);
779
783
  return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
780
784
  }
781
785
  static startFrameCache(t) {
782
- t.startObject(3);
786
+ t.startObject(4);
783
787
  }
784
788
  static addId(t, e) {
785
789
  t.addFieldOffset(0, e, 0);
786
790
  }
787
- static addContent(t, e) {
791
+ static addTarget(t, e) {
788
792
  t.addFieldOffset(1, e, 0);
789
793
  }
790
- static addFiles(t, e) {
794
+ static addContent(t, e) {
791
795
  t.addFieldOffset(2, e, 0);
792
796
  }
797
+ static addFiles(t, e) {
798
+ t.addFieldOffset(3, e, 0);
799
+ }
793
800
  static createFilesVector(t, e) {
794
801
  t.startVector(4, e.length, 4);
795
802
  for (let i = e.length - 1; i >= 0; i--)
@@ -801,33 +808,34 @@ class N {
801
808
  }
802
809
  static endFrameCache(t) {
803
810
  const e = t.endObject();
804
- return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
811
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), t.requiredField(e, 10), e;
805
812
  }
806
- static createFrameCache(t, e, i, a) {
807
- return N.startFrameCache(t), N.addId(t, e), N.addContent(t, i), N.addFiles(t, a), N.endFrameCache(t);
813
+ static createFrameCache(t, e, i, a, r) {
814
+ return R.startFrameCache(t), R.addId(t, e), R.addTarget(t, i), R.addContent(t, a), R.addFiles(t, r), R.endFrameCache(t);
808
815
  }
809
816
  unpack() {
810
- return new Ct(this.id(), this.content(), this.bb.createObjList(this.files.bind(this), this.filesLength()));
817
+ return new Bt(this.id(), this.target(), this.content(), this.bb.createObjList(this.files.bind(this), this.filesLength()));
811
818
  }
812
819
  unpackTo(t) {
813
- t.id = this.id(), t.content = this.content(), t.files = this.bb.createObjList(this.files.bind(this), this.filesLength());
820
+ t.id = this.id(), t.target = this.target(), t.content = this.content(), t.files = this.bb.createObjList(this.files.bind(this), this.filesLength());
814
821
  }
815
822
  }
816
- class Ct {
817
- constructor(t = null, e = null, i = []) {
823
+ class Bt {
824
+ constructor(t = null, e = null, i = null, a = []) {
818
825
  n(this, "id");
826
+ n(this, "target");
819
827
  n(this, "content");
820
828
  n(this, "files");
821
- this.id = t, this.content = e, this.files = i;
829
+ this.id = t, this.target = e, this.content = i, this.files = a;
822
830
  }
823
831
  pack(t) {
824
- const e = this.id !== null ? t.createString(this.id) : 0, i = this.content !== null ? t.createString(this.content) : 0, a = N.createFilesVector(t, t.createObjectOffsetList(this.files));
825
- return N.createFrameCache(t, e, i, a);
832
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.target !== null ? t.createString(this.target) : 0, a = this.content !== null ? t.createString(this.content) : 0, r = R.createFilesVector(t, t.createObjectOffsetList(this.files));
833
+ return R.createFrameCache(t, e, i, a, r);
826
834
  }
827
835
  }
828
836
  var _;
829
837
  (function(s) {
830
- s[s.Client_Unique_FrameInfo_Request = 0] = "Client_Unique_FrameInfo_Request", s[s.Client_Tagged_FrameInfo_Request = 1] = "Client_Tagged_FrameInfo_Request", s[s.Server_Unique_FrameInfo_File_Response = 2] = "Server_Unique_FrameInfo_File_Response", s[s.Server_Tagged_FrameInfo_File_Response = 3] = "Server_Tagged_FrameInfo_File_Response", s[s.Server_Unique_FrameInfo_Content_Response = 4] = "Server_Unique_FrameInfo_Content_Response", s[s.Server_Tagged_FrameInfo_Content_Response = 5] = "Server_Tagged_FrameInfo_Content_Response", s[s.Client_File_Request = 6] = "Client_File_Request", s[s.Server_File_Response = 7] = "Server_File_Response", s[s.Client_Unique_FrameCache = 8] = "Client_Unique_FrameCache", s[s.Client_Tagged_FrameCache = 9] = "Client_Tagged_FrameCache", s[s.Client_Unique_Frame_Loaded = 10] = "Client_Unique_Frame_Loaded", s[s.Client_Tagged_Frame_Loaded = 11] = "Client_Tagged_Frame_Loaded", s[s.Client_Unique_Frame_Subscribe = 12] = "Client_Unique_Frame_Subscribe", s[s.Client_Tagged_Frame_Subscribe = 13] = "Client_Tagged_Frame_Subscribe", s[s.Client_Unique_Frame_Unsubscribe = 14] = "Client_Unique_Frame_Unsubscribe", s[s.Client_Tagged_Frame_Unsubscribe = 15] = "Client_Tagged_Frame_Unsubscribe", s[s.Client_Unique_Value_Request = 16] = "Client_Unique_Value_Request", s[s.Client_Tagged_Value_Request = 17] = "Client_Tagged_Value_Request", s[s.Server_Unique_Value_Response = 18] = "Server_Unique_Value_Response", s[s.Server_Tagged_Value_Response = 19] = "Server_Tagged_Value_Response", s[s.Unique_Value_Update = 20] = "Unique_Value_Update", s[s.Tagged_Value_Update = 21] = "Tagged_Value_Update", s[s.Client_Unique_Signal_Request = 22] = "Client_Unique_Signal_Request", s[s.Client_Tagged_Signal_Request = 23] = "Client_Tagged_Signal_Request", s[s.Server_Unique_Signal_Response = 24] = "Server_Unique_Signal_Response", s[s.Server_Tagged_Signal_Response = 25] = "Server_Tagged_Signal_Response", s[s.Client_Unique_Signal_Notify = 26] = "Client_Unique_Signal_Notify", s[s.Client_Tagged_Signal_Notify = 27] = "Client_Tagged_Signal_Notify";
838
+ s[s.Client_Unique_FrameInfo_Request = 0] = "Client_Unique_FrameInfo_Request", s[s.Client_Tagged_FrameInfo_Request = 1] = "Client_Tagged_FrameInfo_Request", s[s.Server_Unique_FrameInfo_File_Response = 2] = "Server_Unique_FrameInfo_File_Response", s[s.Server_Tagged_FrameInfo_File_Response = 3] = "Server_Tagged_FrameInfo_File_Response", s[s.Server_Unique_FrameInfo_Content_Response = 4] = "Server_Unique_FrameInfo_Content_Response", s[s.Server_Tagged_FrameInfo_Content_Response = 5] = "Server_Tagged_FrameInfo_Content_Response", s[s.Client_File_Request = 6] = "Client_File_Request", s[s.Server_File_Response = 7] = "Server_File_Response", s[s.Client_File_Alias_Request = 8] = "Client_File_Alias_Request", s[s.Server_File_Alias_Response = 9] = "Server_File_Alias_Response", s[s.Client_Unique_FrameCache = 10] = "Client_Unique_FrameCache", s[s.Client_Tagged_FrameCache = 11] = "Client_Tagged_FrameCache", s[s.Client_Unique_Frame_Loaded = 12] = "Client_Unique_Frame_Loaded", s[s.Client_Tagged_Frame_Loaded = 13] = "Client_Tagged_Frame_Loaded", s[s.Client_Unique_Frame_Subscribe = 14] = "Client_Unique_Frame_Subscribe", s[s.Client_Tagged_Frame_Subscribe = 15] = "Client_Tagged_Frame_Subscribe", s[s.Client_Unique_Frame_Unsubscribe = 16] = "Client_Unique_Frame_Unsubscribe", s[s.Client_Tagged_Frame_Unsubscribe = 17] = "Client_Tagged_Frame_Unsubscribe", s[s.Client_Unique_Value_Request = 18] = "Client_Unique_Value_Request", s[s.Client_Tagged_Value_Request = 19] = "Client_Tagged_Value_Request", s[s.Server_Unique_Value_Response = 20] = "Server_Unique_Value_Response", s[s.Server_Tagged_Value_Response = 21] = "Server_Tagged_Value_Response", s[s.Unique_Value_Update = 22] = "Unique_Value_Update", s[s.Tagged_Value_Update = 23] = "Tagged_Value_Update", s[s.Client_Unique_Signal_Request = 24] = "Client_Unique_Signal_Request", s[s.Client_Tagged_Signal_Request = 25] = "Client_Tagged_Signal_Request", s[s.Server_Unique_Signal_Response = 26] = "Server_Unique_Signal_Response", s[s.Server_Tagged_Signal_Response = 27] = "Server_Tagged_Signal_Response", s[s.Client_Unique_Signal_Notify = 28] = "Client_Unique_Signal_Notify", s[s.Client_Tagged_Signal_Notify = 29] = "Client_Tagged_Signal_Notify";
831
839
  })(_ || (_ = {}));
832
840
  var q;
833
841
  (function(s) {
@@ -1617,7 +1625,7 @@ class Ht {
1617
1625
  return S.createValue(t, e, this.valueType, i);
1618
1626
  }
1619
1627
  }
1620
- class R {
1628
+ class k {
1621
1629
  constructor() {
1622
1630
  n(this, "bb", null);
1623
1631
  n(this, "bb_pos", 0);
@@ -1626,10 +1634,10 @@ class R {
1626
1634
  return this.bb_pos = t, this.bb = e, this;
1627
1635
  }
1628
1636
  static getRootAsTaggedValueResponse(t, e) {
1629
- return (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
1637
+ return (e || new k()).__init(t.readInt32(t.position()) + t.position(), t);
1630
1638
  }
1631
1639
  static getSizePrefixedRootAsTaggedValueResponse(t, e) {
1632
- return t.setPosition(t.position() + f), (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
1640
+ return t.setPosition(t.position() + f), (e || new k()).__init(t.readInt32(t.position()) + t.position(), t);
1633
1641
  }
1634
1642
  id(t) {
1635
1643
  const e = this.bb.__offset(this.bb_pos, 4);
@@ -1673,7 +1681,7 @@ class R {
1673
1681
  return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
1674
1682
  }
1675
1683
  static createTaggedValueResponse(t, e, i, a) {
1676
- return R.startTaggedValueResponse(t), R.addId(t, e), R.addTag(t, i), R.addValues(t, a), R.endTaggedValueResponse(t);
1684
+ return k.startTaggedValueResponse(t), k.addId(t, e), k.addTag(t, i), k.addValues(t, a), k.endTaggedValueResponse(t);
1677
1685
  }
1678
1686
  unpack() {
1679
1687
  return new ue(this.id(), this.tag(), this.bb.createObjList(this.values.bind(this), this.valuesLength()));
@@ -1690,8 +1698,8 @@ class ue {
1690
1698
  this.id = t, this.tag = e, this.values = i;
1691
1699
  }
1692
1700
  pack(t) {
1693
- const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = R.createValuesVector(t, t.createObjectOffsetList(this.values));
1694
- return R.createTaggedValueResponse(t, e, i, a);
1701
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = k.createValuesVector(t, t.createObjectOffsetList(this.values));
1702
+ return k.createTaggedValueResponse(t, e, i, a);
1695
1703
  }
1696
1704
  }
1697
1705
  class D {
@@ -1835,13 +1843,13 @@ class it {
1835
1843
  return it.startUniqueFrameSubscribe(t), it.addId(t, e), it.endUniqueFrameSubscribe(t);
1836
1844
  }
1837
1845
  unpack() {
1838
- return new Tt(this.id());
1846
+ return new Rt(this.id());
1839
1847
  }
1840
1848
  unpackTo(t) {
1841
1849
  t.id = this.id();
1842
1850
  }
1843
1851
  }
1844
- class Tt {
1852
+ class Rt {
1845
1853
  constructor(t = null) {
1846
1854
  n(this, "id");
1847
1855
  this.id = t;
@@ -1851,7 +1859,7 @@ class Tt {
1851
1859
  return it.createUniqueFrameSubscribe(t, e);
1852
1860
  }
1853
1861
  }
1854
- class y {
1862
+ class A {
1855
1863
  constructor() {
1856
1864
  n(this, "bb", null);
1857
1865
  n(this, "bb_pos", 0);
@@ -1860,10 +1868,10 @@ class y {
1860
1868
  return this.bb_pos = t, this.bb = e, this;
1861
1869
  }
1862
1870
  static getRootAsUniqueSignalNotify(t, e) {
1863
- return (e || new y()).__init(t.readInt32(t.position()) + t.position(), t);
1871
+ return (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
1864
1872
  }
1865
1873
  static getSizePrefixedRootAsUniqueSignalNotify(t, e) {
1866
- return t.setPosition(t.position() + f), (e || new y()).__init(t.readInt32(t.position()) + t.position(), t);
1874
+ return t.setPosition(t.position() + f), (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
1867
1875
  }
1868
1876
  frameId(t) {
1869
1877
  const e = this.bb.__offset(this.bb_pos, 4);
@@ -1901,7 +1909,7 @@ class y {
1901
1909
  return t.requiredField(e, 4), t.requiredField(e, 6), e;
1902
1910
  }
1903
1911
  static createUniqueSignalNotify(t, e, i, a, r) {
1904
- return y.startUniqueSignalNotify(t), y.addFrameId(t, e), y.addSignalId(t, i), y.addValueType(t, a), y.addValue(t, r), y.endUniqueSignalNotify(t);
1912
+ return A.startUniqueSignalNotify(t), A.addFrameId(t, e), A.addSignalId(t, i), A.addValueType(t, a), A.addValue(t, r), A.endUniqueSignalNotify(t);
1905
1913
  }
1906
1914
  unpack() {
1907
1915
  return new Zt(this.frameId(), this.signalId(), this.valueType(), (() => {
@@ -1926,7 +1934,7 @@ class Zt {
1926
1934
  }
1927
1935
  pack(t) {
1928
1936
  const e = this.frameId !== null ? t.createString(this.frameId) : 0, i = this.signalId !== null ? t.createString(this.signalId) : 0, a = t.createObjectOffset(this.value);
1929
- return y.createUniqueSignalNotify(t, e, i, this.valueType, a);
1937
+ return A.createUniqueSignalNotify(t, e, i, this.valueType, a);
1930
1938
  }
1931
1939
  }
1932
1940
  class nt {
@@ -1977,7 +1985,7 @@ class Xt {
1977
1985
  return nt.createUniqueSignalRequest(t, e);
1978
1986
  }
1979
1987
  }
1980
- class B {
1988
+ class C {
1981
1989
  constructor() {
1982
1990
  n(this, "bb", null);
1983
1991
  n(this, "bb_pos", 0);
@@ -1986,10 +1994,10 @@ class B {
1986
1994
  return this.bb_pos = t, this.bb = e, this;
1987
1995
  }
1988
1996
  static getRootAsUniqueSignalResponse(t, e) {
1989
- return (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
1997
+ return (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
1990
1998
  }
1991
1999
  static getSizePrefixedRootAsUniqueSignalResponse(t, e) {
1992
- return t.setPosition(t.position() + f), (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
2000
+ return t.setPosition(t.position() + f), (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
1993
2001
  }
1994
2002
  id(t) {
1995
2003
  const e = this.bb.__offset(this.bb_pos, 4);
@@ -2026,7 +2034,7 @@ class B {
2026
2034
  return t.requiredField(e, 4), t.requiredField(e, 6), e;
2027
2035
  }
2028
2036
  static createUniqueSignalResponse(t, e, i) {
2029
- return B.startUniqueSignalResponse(t), B.addId(t, e), B.addSignals(t, i), B.endUniqueSignalResponse(t);
2037
+ return C.startUniqueSignalResponse(t), C.addId(t, e), C.addSignals(t, i), C.endUniqueSignalResponse(t);
2030
2038
  }
2031
2039
  unpack() {
2032
2040
  return new he(this.id(), this.bb.createObjList(this.signals.bind(this), this.signalsLength()));
@@ -2042,8 +2050,8 @@ class he {
2042
2050
  this.id = t, this.signals = e;
2043
2051
  }
2044
2052
  pack(t) {
2045
- const e = this.id !== null ? t.createString(this.id) : 0, i = B.createSignalsVector(t, t.createObjectOffsetList(this.signals));
2046
- return B.createUniqueSignalResponse(t, e, i);
2053
+ const e = this.id !== null ? t.createString(this.id) : 0, i = C.createSignalsVector(t, t.createObjectOffsetList(this.signals));
2054
+ return C.createUniqueSignalResponse(t, e, i);
2047
2055
  }
2048
2056
  }
2049
2057
  class at {
@@ -2094,7 +2102,7 @@ class $t {
2094
2102
  return at.createUniqueValueRequest(t, e);
2095
2103
  }
2096
2104
  }
2097
- class C {
2105
+ class B {
2098
2106
  constructor() {
2099
2107
  n(this, "bb", null);
2100
2108
  n(this, "bb_pos", 0);
@@ -2103,10 +2111,10 @@ class C {
2103
2111
  return this.bb_pos = t, this.bb = e, this;
2104
2112
  }
2105
2113
  static getRootAsUniqueValueResponse(t, e) {
2106
- return (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
2114
+ return (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
2107
2115
  }
2108
2116
  static getSizePrefixedRootAsUniqueValueResponse(t, e) {
2109
- return t.setPosition(t.position() + f), (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
2117
+ return t.setPosition(t.position() + f), (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
2110
2118
  }
2111
2119
  id(t) {
2112
2120
  const e = this.bb.__offset(this.bb_pos, 4);
@@ -2143,7 +2151,7 @@ class C {
2143
2151
  return t.requiredField(e, 4), t.requiredField(e, 6), e;
2144
2152
  }
2145
2153
  static createUniqueValueResponse(t, e, i) {
2146
- return C.startUniqueValueResponse(t), C.addId(t, e), C.addValues(t, i), C.endUniqueValueResponse(t);
2154
+ return B.startUniqueValueResponse(t), B.addId(t, e), B.addValues(t, i), B.endUniqueValueResponse(t);
2147
2155
  }
2148
2156
  unpack() {
2149
2157
  return new de(this.id(), this.bb.createObjList(this.values.bind(this), this.valuesLength()));
@@ -2159,8 +2167,8 @@ class de {
2159
2167
  this.id = t, this.values = e;
2160
2168
  }
2161
2169
  pack(t) {
2162
- const e = this.id !== null ? t.createString(this.id) : 0, i = C.createValuesVector(t, t.createObjectOffsetList(this.values));
2163
- return C.createUniqueValueResponse(t, e, i);
2170
+ const e = this.id !== null ? t.createString(this.id) : 0, i = B.createValuesVector(t, t.createObjectOffsetList(this.values));
2171
+ return B.createUniqueValueResponse(t, e, i);
2164
2172
  }
2165
2173
  }
2166
2174
  class tt {
@@ -2227,10 +2235,11 @@ const _e = async (s) => new Promise((t, e) => {
2227
2235
  }), i.addEventListener("message", async (a) => {
2228
2236
  if (a.data.ok) {
2229
2237
  if (a.data.files) {
2230
- const r = new k(), o = new Ct(
2238
+ const r = new y(), o = new Bt(
2231
2239
  s.id,
2240
+ a.data.target,
2232
2241
  a.data.code,
2233
- a.data.files.map((h) => new Bt(h.target, h.metadata))
2242
+ a.data.files.map((h) => new Ct(h.target, h.metadata))
2234
2243
  );
2235
2244
  r.finish(o.pack(r)), St(
2236
2245
  s.host,
@@ -2277,12 +2286,12 @@ const _e = async (s) => new Promise((t, e) => {
2277
2286
  e,
2278
2287
  t != null ? _.Client_Tagged_Value_Request : _.Client_Unique_Value_Request,
2279
2288
  (() => {
2280
- const c = new k(), d = t != null ? new Wt(s, t) : new $t(s);
2289
+ const c = new y(), d = t != null ? new Wt(s, t) : new $t(s);
2281
2290
  return c.finish(d.pack(c)), c.asUint8Array();
2282
2291
  })(),
2283
2292
  t != null ? (c, d) => {
2284
2293
  if (c === _.Server_Tagged_Value_Response) {
2285
- const b = R.getRootAsTaggedValueResponse(
2294
+ const b = k.getRootAsTaggedValueResponse(
2286
2295
  new P(d)
2287
2296
  );
2288
2297
  if (b.id() === s && t === b.tag())
@@ -2290,7 +2299,7 @@ const _e = async (s) => new Promise((t, e) => {
2290
2299
  }
2291
2300
  } : (c, d) => {
2292
2301
  if (c === _.Server_Unique_Value_Response) {
2293
- const b = C.getRootAsUniqueValueResponse(
2302
+ const b = B.getRootAsUniqueValueResponse(
2294
2303
  new P(d)
2295
2304
  );
2296
2305
  if (b.id() === s)
@@ -2311,7 +2320,7 @@ const _e = async (s) => new Promise((t, e) => {
2311
2320
  O.subscribe((V) => {
2312
2321
  if (V == null || o)
2313
2322
  return;
2314
- const m = new k(), p = t != null ? new Yt(s, t) : new Jt(s);
2323
+ const m = new y(), p = t != null ? new Yt(s, t) : new Jt(s);
2315
2324
  p.value = new Ht(
2316
2325
  b,
2317
2326
  F,
@@ -2334,14 +2343,14 @@ const _e = async (s) => new Promise((t, e) => {
2334
2343
  if (p === l.ValueBuffer) {
2335
2344
  const G = new Uint8Array(
2336
2345
  m.unpack().value.value.value
2337
- ), Rt = At(I);
2346
+ ), Tt = Nt(I);
2338
2347
  let gt = !0;
2339
- if (G.length != Rt.length)
2348
+ if (G.length != Tt.length)
2340
2349
  gt = !1;
2341
2350
  else {
2342
2351
  const ie = G.length;
2343
2352
  for (let pt = 0; pt < ie; pt++)
2344
- if (G[pt] !== Rt[pt]) {
2353
+ if (G[pt] !== Tt[pt]) {
2345
2354
  gt = !1;
2346
2355
  break;
2347
2356
  }
@@ -2363,7 +2372,7 @@ const _e = async (s) => new Promise((t, e) => {
2363
2372
  e,
2364
2373
  t != null ? _.Client_Tagged_Signal_Request : _.Client_Unique_Signal_Request,
2365
2374
  (() => {
2366
- const h = new k(), c = t != null ? new Gt(s, t) : new Xt(s);
2375
+ const h = new y(), c = t != null ? new Gt(s, t) : new Xt(s);
2367
2376
  return h.finish(c.pack(h)), h.asUint8Array();
2368
2377
  })(),
2369
2378
  (h, c) => {
@@ -2371,7 +2380,7 @@ const _e = async (s) => new Promise((t, e) => {
2371
2380
  if (h === _.Server_Tagged_Signal_Response)
2372
2381
  return T.getRootAsTaggedSignalResponse(new P(c));
2373
2382
  } else if (h === _.Server_Unique_Signal_Response)
2374
- return B.getRootAsUniqueSignalResponse(new P(c));
2383
+ return C.getRootAsUniqueSignalResponse(new P(c));
2375
2384
  }
2376
2385
  ), r = [
2377
2386
  /* @__PURE__ */ new Map(),
@@ -2384,7 +2393,7 @@ const _e = async (s) => new Promise((t, e) => {
2384
2393
  for (let h = 0; h < o; ++h) {
2385
2394
  const c = a.signals(h), { id: d, type: b } = { id: c.id(), type: c.type() };
2386
2395
  r[b].set(d, (F) => {
2387
- const O = new k(), V = b, m = Kt(V, F), p = t != null ? new Dt(s, t, d, V, m) : new Zt(s, d, V, m);
2396
+ const O = new y(), V = b, m = Kt(V, F), p = t != null ? new Dt(s, t, d, V, m) : new Zt(s, d, V, m);
2388
2397
  O.finish(p.pack(O));
2389
2398
  const I = t != null ? _.Client_Tagged_Signal_Notify : _.Client_Unique_Signal_Notify;
2390
2399
  i.publish(dt([ht(I), O.asUint8Array()]));
@@ -2400,7 +2409,7 @@ const _e = async (s) => new Promise((t, e) => {
2400
2409
  json: (t, e, i) => {
2401
2410
  const a = s[l.ValueBuffer].get(t);
2402
2411
  if (a != null) {
2403
- let r = At(a), o = i.decode(r);
2412
+ let r = Nt(a), o = i.decode(r);
2404
2413
  return {
2405
2414
  set: (h) => {
2406
2415
  o = h, r = i.encode(o), a.set(r);
@@ -2450,12 +2459,12 @@ const _e = async (s) => new Promise((t, e) => {
2450
2459
  p
2451
2460
  ), { action: O } = await d(F);
2452
2461
  o.on_connect(() => {
2453
- const p = new k(), I = e != null ? new qt(t, e) : new Tt(t);
2462
+ const p = new y(), I = e != null ? new qt(t, e) : new Rt(t);
2454
2463
  p.finish(I.pack(p));
2455
2464
  const G = e != null ? _.Client_Tagged_Frame_Subscribe : _.Client_Unique_Frame_Subscribe;
2456
2465
  o.publish(dt([ht(G), p.asUint8Array()]));
2457
2466
  }), o.start();
2458
- const V = new k(), m = e != null ? new Ot(t, e) : new Ut(t);
2467
+ const V = new y(), m = e != null ? new Ot(t, e) : new Ut(t);
2459
2468
  return V.finish(m.pack(V)), St(
2460
2469
  s,
2461
2470
  e != null ? _.Client_Tagged_Frame_Loaded : _.Client_Unique_Frame_Loaded,
@@ -2465,12 +2474,12 @@ const _e = async (s) => new Promise((t, e) => {
2465
2474
  I.set("nil.xit", {
2466
2475
  values: te(h),
2467
2476
  signals: ee(c),
2468
- frame_ui: a,
2469
- frame: r,
2470
2477
  resub: () => o.start(),
2471
2478
  unsub: () => o.stop(),
2472
2479
  id: t,
2473
- tag: e
2480
+ tag: e,
2481
+ load_frame_ui: a,
2482
+ load_frame_data: r
2474
2483
  });
2475
2484
  const { destroy: G } = O(p, I);
2476
2485
  return {
@@ -2489,12 +2498,12 @@ const _e = async (s) => new Promise((t, e) => {
2489
2498
  Mt({ id: t, tag: e ?? null, host: s, service: i })
2490
2499
  ]);
2491
2500
  i.on_connect(() => {
2492
- const d = new k(), b = e != null ? new qt(t, e) : new Tt(t);
2501
+ const d = new y(), b = e != null ? new qt(t, e) : new Rt(t);
2493
2502
  d.finish(b.pack(d));
2494
2503
  const F = e != null ? _.Client_Tagged_Frame_Subscribe : _.Client_Unique_Frame_Subscribe;
2495
2504
  i.publish(dt([ht(F), d.asUint8Array()]));
2496
2505
  }), i.start();
2497
- const o = new k(), h = e != null ? new Ot(t, e) : new Ut(t);
2506
+ const o = new y(), h = e != null ? new Ot(t, e) : new Ut(t);
2498
2507
  o.finish(h.pack(o));
2499
2508
  const c = e != null ? _.Client_Tagged_Frame_Loaded : _.Client_Unique_Frame_Loaded;
2500
2509
  return St(s, c, o.asUint8Array()), {
package/index.d.ts CHANGED
@@ -36,12 +36,12 @@ export type Frame = {
36
36
  export type Context = {
37
37
  values: Values;
38
38
  signals: Signals;
39
- frame_ui: (f: string, tag?: string) => Promise<Action<HTMLElement>>;
40
- frame: (f: string, tag?: string) => Promise<Frame>;
41
39
  resub: () => void;
42
40
  unsub: () => void;
43
41
  id: string;
44
42
  tag: string | null;
43
+ load_frame_ui: (f: string, tag?: string) => Promise<Action<HTMLElement>>;
44
+ load_frame_data: (f: string, tag?: string) => Promise<Frame>;
45
45
  };
46
46
  export declare const json_string: {
47
47
  encode: (o: any) => Uint8Array<ArrayBufferLike>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nil-/xit",
3
- "version": "0.2.8",
3
+ "version": "0.4.0",
4
4
  "peerDependencies": {
5
5
  "svelte": "^5.7.1"
6
6
  },
package/test/Frame.svelte CHANGED
@@ -5,9 +5,9 @@ let {
5
5
  selected = -1,
6
6
  load
7
7
  } = $props();
8
- let { signals, values, frame, frame_ui } = xit();
8
+ let { signals, values, load_frame_data, load_frame_ui } = xit();
9
9
  const frame_info = async (tag, decoder2) => {
10
- const { values: values2, unsub } = await frame("frame_info", tag);
10
+ const { values: values2, unsub } = await load_frame_data("frame_info", tag);
11
11
  const load2 = async (key) => {
12
12
  const v = values2.json(key, [], {
13
13
  decode: decoder2,
@@ -22,9 +22,13 @@ const frame_info = async (tag, decoder2) => {
22
22
  return;
23
23
  }
24
24
  if (mark === "T") {
25
- return frame_ui(frame_id, tag);
25
+ return load_frame_ui(frame_id, tag).then((f) => {
26
+ return { name: frame_id, action: f };
27
+ });
26
28
  } else if (mark === "U") {
27
- return frame_ui(frame_id);
29
+ return load_frame_ui(frame_id).then((f) => {
30
+ return { name: frame_id, action: f };
31
+ });
28
32
  }
29
33
  }).filter((v2) => v2 != null)
30
34
  );
@@ -38,21 +42,17 @@ const tags = values.json("tags", [], {
38
42
  encode: () => new Uint8Array()
39
43
  });
40
44
  const finalize = signals.string("finalize");
41
- let a_inputs = $state(null);
42
- let a_outputs = $state(null);
43
- let title = $state("");
44
- const update = (v) => {
45
- a_inputs = null;
46
- a_outputs = null;
45
+ let a_inputs = $state([]);
46
+ let a_outputs = $state([]);
47
+ let title = $derived(selected > $tags.length ? "" : $tags[selected]);
48
+ const update = async (v) => {
49
+ a_inputs = [];
50
+ a_outputs = [];
47
51
  const t = $tags;
48
52
  if (0 <= v && v < t.length) {
49
- frame_info(t[v], decoder).then(({ inputs, outputs }) => {
50
- a_inputs = inputs;
51
- a_outputs = outputs;
52
- });
53
- title = t[selected];
54
- } else {
55
- title = "";
53
+ const { inputs, outputs } = await frame_info(t[v], decoder);
54
+ a_inputs = inputs;
55
+ a_outputs = outputs;
56
56
  }
57
57
  };
58
58
  $effect(() => {
@@ -75,4 +75,4 @@ $effect(() => {
75
75
  }}
76
76
  />
77
77
 
78
- {@render load($tags.sort(), { inputs: a_inputs, outputs: a_outputs })}
78
+ {@render load({ tags: $tags.sort(), inputs: a_inputs, outputs: a_outputs })}
@@ -1,13 +1,17 @@
1
1
  import type { Snippet } from "svelte";
2
2
  import type { CoDec, Action } from "../index";
3
+ type ActionItem = {
4
+ name: string;
5
+ action: Action<HTMLElement>;
6
+ };
3
7
  type $$ComponentProps = {
4
8
  decoder: CoDec<any>["decode"];
5
9
  selected?: number;
6
10
  load: Snippet<[
7
- string[],
8
11
  {
9
- inputs: Action<HTMLElement>[] | null;
10
- outputs: Action<HTMLElement>[] | null;
12
+ tags: string[];
13
+ inputs: ActionItem[];
14
+ outputs: ActionItem[];
11
15
  }
12
16
  ]>;
13
17
  };