@apple-pie/slice 0.1.6 → 0.1.8

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 (179) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/chunks/{Avatar-YNcGDUzr.js → Avatar-8XLnVICd.js} +6 -4
  3. package/dist/cjs/chunks/{AvatarGroup-Dn5R1XIU.js → AvatarGroup-BhKZvX8M.js} +1 -1
  4. package/dist/cjs/chunks/{Button-Ck4syxwn.js → Button-D8_eyuOA.js} +9 -6
  5. package/dist/cjs/chunks/{ButtonBar-Cx9Xwddh.js → ButtonBar-DwMLfvi8.js} +11 -15
  6. package/dist/cjs/chunks/{Camera-BrLRwcw1.js → Camera-CxHdYGEa.js} +11 -8
  7. package/dist/cjs/chunks/{Card-CYDP4vAN.js → Card-D4YkmNC7.js} +5 -8
  8. package/dist/cjs/chunks/{CheckBox-DYG1fNWy.js → CheckBox-CmTQ6KW1.js} +9 -14
  9. package/dist/cjs/chunks/{Chip-CqOwsrmt.js → Chip-CwMJOnBV.js} +5 -5
  10. package/dist/cjs/chunks/{DivInput-C73sqUF3.js → DivInput-DdZA8S1k.js} +1 -1
  11. package/dist/cjs/chunks/{DocIcons-B5TcBqSH.js → DocIcons-BZI6JMyw.js} +1 -1
  12. package/dist/cjs/chunks/{DrggablePanel-BzvBBhS7.js → DrggablePanel-CkhCXqKv.js} +1 -1
  13. package/dist/cjs/chunks/{DropDown-Bo0bxkFk.js → DropDown-Ce8aU2va.js} +2 -2
  14. package/dist/cjs/chunks/{FileIcon-hYwcre20.js → FileIcon-CZLe2S2l.js} +3 -3
  15. package/dist/cjs/chunks/{FileList-bA8PoGOh.js → FileList-tivoUJSP.js} +11 -4
  16. package/dist/cjs/chunks/{Grouper-BszVihfB.js → Grouper-BbovOSYw.js} +8 -7
  17. package/dist/cjs/chunks/{_types-NyUTfBLR.js → Icon-N0YJuKQf.js} +68 -44
  18. package/dist/cjs/chunks/{IconButton-yWq-C437.js → IconButton-BXotgG2u.js} +9 -6
  19. package/dist/cjs/chunks/{Label-D15cIroT.js → Label-CZvJbATa.js} +16 -11
  20. package/dist/cjs/chunks/{Overlay-DL0EJDyk.js → Overlay-BX6vXX9F.js} +1 -1
  21. package/dist/cjs/chunks/{Pager-TUxcWbmn.js → Pager-Da9AqSFN.js} +1 -1
  22. package/dist/cjs/chunks/{ProgressIndicator-Dvq4eIWW.js → ProgressIndicator-opbbADog.js} +2 -2
  23. package/dist/cjs/chunks/{PromptInput-Hgh6995X.js → PromptInput-tA4fpOTk.js} +1 -1
  24. package/dist/cjs/chunks/{RadioButton-Cu-laBV5.js → RadioButton-B8GIKGm-.js} +9 -10
  25. package/dist/cjs/chunks/{RadioButtonList-COS7jfsC.js → RadioButtonList-3o1IvhdC.js} +11 -5
  26. package/dist/cjs/chunks/{SSEConnection-B_yE8cXz.js → SSEConnection-C-1OzEOp.js} +29 -15
  27. package/dist/cjs/chunks/{Slider-BeXrWjVx.js → Slider-CnXBacf-.js} +65 -36
  28. package/dist/cjs/chunks/{Switch-Xqf0vwul.js → Switch-BiTshVLM.js} +6 -3
  29. package/dist/cjs/chunks/{TabBar-DCRr3l9L.js → TabBar-DZ2y7owf.js} +48 -12
  30. package/dist/cjs/chunks/{TextArea-DM0aHGGt.js → TextArea-DXcMRUfI.js} +1 -1
  31. package/dist/cjs/chunks/{TextField-DQgpDpR1.js → TextField-CkfTNM6_.js} +11 -6
  32. package/dist/cjs/chunks/{Tip-ik8-p4_4.js → Tip-59T3TUN4.js} +1 -1
  33. package/dist/cjs/chunks/{Toast-D-Y1Ytnb.js → Toast-skIBuJ3b.js} +2 -2
  34. package/dist/cjs/chunks/{UploadArea-Y_B35qjZ.js → UploadArea-B8mJRc0a.js} +15 -10
  35. package/dist/cjs/chunks/{WSConnection-DCBuJGmb.js → WSConnection-DrOC8Z0R.js} +32 -23
  36. package/dist/cjs/chunks/_types-BD6txsj1.js +118 -0
  37. package/dist/cjs/chunks/{colors-uej0anrN.js → colors-njquvHkx.js} +1 -1
  38. package/dist/cjs/chunks/debounce-BF4i6uIC.js +18 -0
  39. package/dist/cjs/chunks/{misc-C-M6KKsH.js → misc-BTF7BCZW.js} +21 -12
  40. package/dist/cjs/chunks/{sseStore-CIIeshjm.js → sseStore-1OeJ9TRP.js} +1 -1
  41. package/dist/cjs/components/Avatar/index.js +2 -2
  42. package/dist/cjs/components/AvatarGroup/index.js +2 -2
  43. package/dist/cjs/components/Button/index.js +3 -3
  44. package/dist/cjs/components/ButtonBar/index.js +3 -3
  45. package/dist/cjs/components/Camera/index.js +4 -4
  46. package/dist/cjs/components/Card/index.js +5 -6
  47. package/dist/cjs/components/CheckBox/index.js +6 -7
  48. package/dist/cjs/components/Chip/index.js +2 -2
  49. package/dist/cjs/components/DivInput/index.js +2 -2
  50. package/dist/cjs/components/DocIcon/index.js +1 -1
  51. package/dist/cjs/components/DraggablePanel/index.js +2 -2
  52. package/dist/cjs/components/DropDown/index.js +2 -2
  53. package/dist/cjs/components/FileIcon/index.js +2 -2
  54. package/dist/cjs/components/FileList/index.js +4 -4
  55. package/dist/cjs/components/Grouper/index.js +3 -3
  56. package/dist/cjs/components/Icon/index.js +3 -8
  57. package/dist/cjs/components/IconButton/index.js +3 -3
  58. package/dist/cjs/components/Label/index.js +2 -2
  59. package/dist/cjs/components/Overlay/index.js +1 -1
  60. package/dist/cjs/components/Pager/index.js +2 -2
  61. package/dist/cjs/components/Progress/index.js +3 -3
  62. package/dist/cjs/components/PromptInput/index.js +6 -6
  63. package/dist/cjs/components/RadioButton/index.js +2 -2
  64. package/dist/cjs/components/RadioButtonList/index.js +7 -7
  65. package/dist/cjs/components/Slider/index.js +4 -3
  66. package/dist/cjs/components/Switch/index.js +1 -1
  67. package/dist/cjs/components/TabBar/index.js +3 -3
  68. package/dist/cjs/components/TextArea/index.js +6 -7
  69. package/dist/cjs/components/Textfield/index.js +5 -5
  70. package/dist/cjs/components/Tip/index.js +2 -2
  71. package/dist/cjs/components/Toast/index.js +2 -2
  72. package/dist/cjs/components/UploadArea/index.js +6 -6
  73. package/dist/cjs/hooks/useTrackRenders.js +1 -1
  74. package/dist/cjs/index.js +9 -14
  75. package/dist/cjs/stores/SSE.js +2 -2
  76. package/dist/cjs/stores/WS.js +1 -1
  77. package/dist/cjs/stores.js +2 -2
  78. package/dist/cjs/utils/index.js +4 -3
  79. package/dist/cjs/utils/objects/index.js +1 -1
  80. package/dist/esm/chunks/{Avatar-CDMV6f9w.mjs → Avatar-DGRMsHdO.mjs} +7 -5
  81. package/dist/esm/chunks/{AvatarGroup-BZ18GwhK.mjs → AvatarGroup-C9Ka1e9P.mjs} +1 -1
  82. package/dist/esm/chunks/{Button-DexmN81C.mjs → Button-DAvVj4YV.mjs} +8 -5
  83. package/dist/esm/chunks/{ButtonBar-C-LwBxlY.mjs → ButtonBar-Cw73kooJ.mjs} +11 -15
  84. package/dist/esm/chunks/{Camera-DdUBZi52.mjs → Camera-BrdJGlv6.mjs} +12 -9
  85. package/dist/esm/chunks/{Card-DUfnTA5v.mjs → Card-DGlv1PII.mjs} +4 -7
  86. package/dist/esm/chunks/{CheckBox-Bnd3UAt0.mjs → CheckBox-B7UCZvRv.mjs} +9 -14
  87. package/dist/esm/chunks/{Chip-BJS4oJBL.mjs → Chip-BPF7fBba.mjs} +5 -3
  88. package/dist/esm/chunks/{DivInput-B7BliU1p.mjs → DivInput-Ch9XjfWd.mjs} +1 -1
  89. package/dist/esm/chunks/{DocIcons-BxtcXsWI.mjs → DocIcons-B4xsPrXM.mjs} +1 -1
  90. package/dist/esm/chunks/{DrggablePanel-DvactFf5.mjs → DrggablePanel-Ddi0vPRp.mjs} +1 -1
  91. package/dist/esm/chunks/{DropDown-CbX16ETP.mjs → DropDown-Cvf2d_3u.mjs} +1 -1
  92. package/dist/esm/chunks/{FileIcon-CC_k5dUW.mjs → FileIcon-ePouoJpT.mjs} +3 -3
  93. package/dist/esm/chunks/{FileList-E5uvcN2J.mjs → FileList-BHCGzX_0.mjs} +11 -6
  94. package/dist/esm/chunks/{Grouper-X9OursiT.mjs → Grouper-B_FutfjV.mjs} +6 -5
  95. package/dist/esm/chunks/{_types-C8GP_aSD.mjs → Icon-C92f63Ib.mjs} +69 -46
  96. package/dist/esm/chunks/{IconButton-B5WEf-v5.mjs → IconButton-4O5S9S9G.mjs} +9 -6
  97. package/dist/esm/chunks/{Label-DOvquc82.mjs → Label-7ezP3eHw.mjs} +16 -11
  98. package/dist/esm/chunks/{Overlay-Cw9o1fHb.mjs → Overlay-TOzZXnwF.mjs} +1 -1
  99. package/dist/esm/chunks/{Pager-BX4TMwD_.mjs → Pager-BlLYeA2F.mjs} +1 -1
  100. package/dist/esm/chunks/{ProgressIndicator-DeLwB3Rb.mjs → ProgressIndicator-BVwQNOcV.mjs} +1 -1
  101. package/dist/esm/chunks/{PromptInput-BdMotrXA.mjs → PromptInput-pKwwzyAd.mjs} +2 -2
  102. package/dist/esm/chunks/{RadioButton-D6kP8p0n.mjs → RadioButton-COEnChNW.mjs} +9 -10
  103. package/dist/esm/chunks/{RadioButtonList-guQECpwi.mjs → RadioButtonList-De3rbLQb.mjs} +12 -6
  104. package/dist/esm/chunks/{SSEConnection-Dj9P0SWE.mjs → SSEConnection-DcA3wFsO.mjs} +29 -14
  105. package/dist/esm/chunks/{Slider-ZuSvETfo.mjs → Slider-DL2iuNlh.mjs} +69 -34
  106. package/dist/esm/chunks/{Switch-nWg2Ykea.mjs → Switch-Cv6LABsW.mjs} +6 -3
  107. package/dist/esm/chunks/{TabBar-BYtGaj_A.mjs → TabBar-qiozE5zA.mjs} +49 -13
  108. package/dist/esm/chunks/{TextArea-D88dZrXm.mjs → TextArea-yF2pGeel.mjs} +1 -1
  109. package/dist/esm/chunks/{TextField-DvTB_JoS.mjs → TextField-CgnPj6oK.mjs} +11 -6
  110. package/dist/esm/chunks/{Tip-B-cDOFvV.mjs → Tip-CroDIKO4.mjs} +1 -1
  111. package/dist/esm/chunks/{Toast-BdlopzJ6.mjs → Toast-CM493gMR.mjs} +2 -2
  112. package/dist/esm/chunks/{UploadArea--i-bbRIJ.mjs → UploadArea-BNf1y8Ep.mjs} +18 -13
  113. package/dist/esm/chunks/{WSConnection-DlYSitff.mjs → WSConnection-D9mpsVdc.mjs} +32 -23
  114. package/dist/esm/chunks/_types-C2C2Zwd0.mjs +118 -0
  115. package/dist/esm/chunks/{colors-DR9fLI5X.mjs → colors-FQ0uNQcW.mjs} +2 -2
  116. package/dist/esm/chunks/debounce-Bst1jxMS.mjs +19 -0
  117. package/dist/esm/chunks/{misc-cg9I7drO.mjs → misc-N8KLjOXc.mjs} +22 -12
  118. package/dist/esm/chunks/{sseStore-DdqmnAAf.mjs → sseStore-2JIpEKfz.mjs} +1 -1
  119. package/dist/esm/components/Avatar/index.mjs +2 -2
  120. package/dist/esm/components/AvatarGroup/index.mjs +3 -3
  121. package/dist/esm/components/Button/index.mjs +4 -4
  122. package/dist/esm/components/ButtonBar/index.mjs +4 -4
  123. package/dist/esm/components/Camera/index.mjs +5 -5
  124. package/dist/esm/components/Card/index.mjs +3 -3
  125. package/dist/esm/components/CheckBox/index.mjs +5 -5
  126. package/dist/esm/components/Chip/index.mjs +3 -3
  127. package/dist/esm/components/DivInput/index.mjs +2 -2
  128. package/dist/esm/components/DocIcon/index.mjs +1 -1
  129. package/dist/esm/components/DraggablePanel/index.mjs +2 -2
  130. package/dist/esm/components/DropDown/index.mjs +3 -3
  131. package/dist/esm/components/FileIcon/index.mjs +2 -2
  132. package/dist/esm/components/FileList/index.mjs +5 -5
  133. package/dist/esm/components/Grouper/index.mjs +3 -3
  134. package/dist/esm/components/Icon/index.mjs +4 -2
  135. package/dist/esm/components/IconButton/index.mjs +3 -3
  136. package/dist/esm/components/Label/index.mjs +2 -2
  137. package/dist/esm/components/Overlay/index.mjs +1 -1
  138. package/dist/esm/components/Pager/index.mjs +2 -2
  139. package/dist/esm/components/Progress/index.mjs +3 -3
  140. package/dist/esm/components/PromptInput/index.mjs +7 -7
  141. package/dist/esm/components/RadioButton/index.mjs +3 -3
  142. package/dist/esm/components/RadioButtonList/index.mjs +4 -4
  143. package/dist/esm/components/Slider/index.mjs +4 -2
  144. package/dist/esm/components/Switch/index.mjs +1 -1
  145. package/dist/esm/components/TabBar/index.mjs +4 -4
  146. package/dist/esm/components/TextArea/index.mjs +5 -5
  147. package/dist/esm/components/Textfield/index.mjs +6 -6
  148. package/dist/esm/components/Tip/index.mjs +2 -2
  149. package/dist/esm/components/Toast/index.mjs +3 -3
  150. package/dist/esm/components/UploadArea/index.mjs +6 -6
  151. package/dist/esm/hooks/useTrackRenders.mjs +1 -1
  152. package/dist/esm/index.mjs +38 -34
  153. package/dist/esm/stores/SSE.mjs +2 -2
  154. package/dist/esm/stores/WS.mjs +1 -1
  155. package/dist/esm/stores.mjs +2 -2
  156. package/dist/esm/utils/index.mjs +6 -4
  157. package/dist/esm/utils/objects/index.mjs +2 -2
  158. package/dist/types/components/Button/Button.d.ts +3 -3
  159. package/dist/types/components/Button/_types.d.ts +2 -2
  160. package/dist/types/components/Camera/_types.d.ts +1 -0
  161. package/dist/types/components/Card/_types.d.ts +1 -1
  162. package/dist/types/components/Chip/_types.d.ts +1 -2
  163. package/dist/types/components/Grouper/_types.d.ts +1 -1
  164. package/dist/types/components/Icon/_types.d.ts +116 -83
  165. package/dist/types/components/Icon/index.d.ts +1 -1
  166. package/dist/types/components/IconButton/_types.d.ts +2 -2
  167. package/dist/types/components/Label/_types.d.ts +1 -1
  168. package/dist/types/components/RadioButton/_types.d.ts +2 -1
  169. package/dist/types/components/Switch/_types.d.ts +1 -1
  170. package/dist/types/components/TabBar/_types.d.ts +2 -0
  171. package/dist/types/index.d.ts +1 -1
  172. package/dist/types/utils/functions/colors.d.ts +2 -2
  173. package/dist/types/utils/functions/debounce.d.ts +1 -2
  174. package/dist/types/utils/functions/files.d.ts +7 -1
  175. package/dist/types/utils/functions/misc.d.ts +19 -11
  176. package/dist/types/utils/index.d.ts +3 -2
  177. package/dist/types/utils/objects/SSEConnection/SSEConnection.d.ts +29 -8
  178. package/dist/types/utils/objects/WSConnection/WSConnection.d.ts +32 -20
  179. package/package.json +1 -1
@@ -1,19 +1,28 @@
1
1
  import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
2
2
 
3
- class WSConnection {
3
+ /**
4
+ * Manage a WebSocket connection with optional unified events, retries, and keep-alive pings.
5
+ */ class WSConnection {
6
+ /**
7
+ * Report whether the underlying socket is currently open.
8
+ */
4
9
  get connected() {
5
10
  var _a;
6
11
  return (null === (_a = this.socket) || void 0 === _a ? void 0 : _a.readyState) === WebSocket.OPEN;
7
12
  }
8
- get connection() {
13
+ /**
14
+ * Expose the underlying WebSocket instance.
15
+ */ get connection() {
9
16
  return this.socket;
10
17
  }
11
- constructor(options) {
18
+ /**
19
+ * Initialize the socket connection and configure its runtime options.
20
+ */ constructor(options) {
12
21
  var _a, _b, _c, _d, _e, _f, _g, _h;
13
22
  if (this.socket = null, this.keepAliveTimer = null, this.reconnectIntervalTimer = null,
14
23
  this.reconnectAttemptsCount = 0, this.manuallyClosed = !1,
15
24
  /**
16
- * Open handler
25
+ * Initialize connection state after the socket opens.
17
26
  */
18
27
  this.onOpen = event => __awaiter(this, void 0, void 0, function*() {
19
28
  var _a;
@@ -43,7 +52,7 @@ class WSConnection {
43
52
  this.keepAlive && this.setKeepAlive();
44
53
  }),
45
54
  /**
46
- * Message handler
55
+ * Parse and emit each incoming socket message.
47
56
  */
48
57
  this.onMessage = event => {
49
58
  const data = this.parseEventData(event.data);
@@ -54,7 +63,7 @@ class WSConnection {
54
63
  }));
55
64
  },
56
65
  /**
57
- * Close handler with the reconnection logic as needed
66
+ * Clean up the socket and trigger reconnect logic after unexpected closes.
58
67
  */
59
68
  this.onClose = event => {
60
69
  var _a;
@@ -64,7 +73,7 @@ class WSConnection {
64
73
  }), this.closeSocket(event), this.shouldReconnect(event) && this.reconnect();
65
74
  },
66
75
  /**
67
- * Error handler
76
+ * Normalize socket errors before forwarding them to consumers.
68
77
  */
69
78
  this.onError = event => {
70
79
  const error = event instanceof ErrorEvent ? event : new ErrorEvent("websocket error", {
@@ -83,34 +92,34 @@ class WSConnection {
83
92
  this.connect();
84
93
  }
85
94
  /**
86
- * Gracefully handle sending messages
95
+ * Send a string or JSON-serializable payload through the socket.
87
96
  */ send(message) {
88
97
  var _a;
89
98
  const data = "string" == typeof message ? message : JSON.stringify(message);
90
99
  null === (_a = this.socket) || void 0 === _a || _a.send(data);
91
100
  }
92
101
  /**
93
- * Gracefully expose socket close
102
+ * Close the socket intentionally and stop any reconnect attempts.
94
103
  */ close(closeEvent) {
95
104
  this.manuallyClosed = !0, this.clearReconnectTimer(), this.reconnectAttemptsCount = 0,
96
105
  this.closeSocket(closeEvent);
97
106
  }
98
107
  /**
99
- * Emit the parsed message content for standard mode
108
+ * Emit parsed message data when standard callback mode is enabled.
100
109
  */ emitParsedMessage(data) {
101
110
  if (this.unifiedMessages) return;
102
111
  const callback = this.onMessageCallback;
103
112
  null == callback || callback(data);
104
113
  }
105
114
  /**
106
- * Emit a unified message if the unified flag is on
115
+ * Emit a unified event object when unified callback mode is enabled.
107
116
  */ emitUnifiedMessage(message) {
108
117
  if (!this.unifiedMessages) return;
109
118
  const callback = this.onMessageCallback;
110
119
  null == callback || callback(message);
111
120
  }
112
121
  /**
113
- * Emit error
122
+ * Forward an error event through both direct and unified callbacks.
114
123
  */ emitErrorEvent(error) {
115
124
  var _a;
116
125
  null === (_a = this.onErrorCallback) || void 0 === _a || _a.call(this, error), this.emitUnifiedMessage({
@@ -119,7 +128,7 @@ class WSConnection {
119
128
  });
120
129
  }
121
130
  /**
122
- * Safe JSON parse message content
131
+ * Parse incoming message data, falling back to raw socket payloads when needed.
123
132
  */ parseEventData(rawData) {
124
133
  if (rawData instanceof Blob || rawData instanceof ArrayBuffer || "string" == typeof rawData) {
125
134
  if ("string" != typeof rawData) return rawData;
@@ -134,13 +143,13 @@ class WSConnection {
134
143
  }));
135
144
  }
136
145
  /**
137
- * Attach socket listeners
146
+ * Attach the connection lifecycle listeners to the current socket.
138
147
  */ attachEventListeners() {
139
148
  this.socket && (this.socket.addEventListener("open", this.onOpen), this.socket.addEventListener("message", this.onMessage),
140
149
  this.socket.addEventListener("close", this.onClose), this.socket.addEventListener("error", this.onError));
141
150
  }
142
151
  /**
143
- * set keep alive pings
152
+ * Start periodic ping messages to keep the socket active.
144
153
  */ setKeepAlive() {
145
154
  this.socket && this.keepAlive && (this.keepAliveTimer && clearInterval(this.keepAliveTimer),
146
155
  this.keepAliveTimer = setInterval(() => {
@@ -149,30 +158,30 @@ class WSConnection {
149
158
  }, this.keepAliveInterval));
150
159
  }
151
160
  /**
152
- * Clear keep alive pings
161
+ * Stop the active keep-alive timer if one is running.
153
162
  */ clearKeepAliveTimer() {
154
163
  this.keepAliveTimer && (clearInterval(this.keepAliveTimer), this.keepAliveTimer = null);
155
164
  }
156
165
  /**
157
- * Clear reconnect timer
166
+ * Stop the active reconnect timer if one is running.
158
167
  */ clearReconnectTimer() {
159
168
  this.reconnectIntervalTimer && (clearTimeout(this.reconnectIntervalTimer), this.reconnectIntervalTimer = null);
160
169
  }
161
170
  /**
162
- * detach all event listeners
171
+ * Detach all lifecycle listeners from the current socket.
163
172
  */ detachEventListeners() {
164
173
  this.socket && (this.socket.removeEventListener("open", this.onOpen), this.socket.removeEventListener("message", this.onMessage),
165
174
  this.socket.removeEventListener("close", this.onClose), this.socket.removeEventListener("error", this.onError));
166
175
  }
167
176
  /**
168
- * Connect the socket
177
+ * Open a new socket connection when one is not already active.
169
178
  */ connect() {
170
179
  var _a, _b;
171
180
  (null === (_a = this.socket) || void 0 === _a ? void 0 : _a.readyState) !== WebSocket.OPEN && (null === (_b = this.socket) || void 0 === _b ? void 0 : _b.readyState) !== WebSocket.CONNECTING && (this.socket = new WebSocket(this.url),
172
181
  this.attachEventListeners());
173
182
  }
174
183
  /**
175
- * Reconnect logic
184
+ * Schedule the next reconnect attempt when reconnects are allowed.
176
185
  */ reconnect() {
177
186
  if (!this.autoReconnect || this.manuallyClosed) return;
178
187
  if (this.reconnectIntervalTimer) return;
@@ -185,18 +194,18 @@ class WSConnection {
185
194
  }, delay);
186
195
  }
187
196
  /**
188
- * Calculate reconnect delay with fall off
197
+ * Calculate the reconnect delay, optionally using exponential backoff.
189
198
  */ getReconnectDelay(attempt) {
190
199
  return this.reconnectFalloff ? this.reconnectInterval * Math.pow(2, attempt - 1) : this.reconnectInterval;
191
200
  }
192
201
  /**
193
- * Determine if should reconnect based on the close event and props
202
+ * Decide whether a close event should trigger a reconnect attempt.
194
203
  */ shouldReconnect(event) {
195
204
  var _a, _b;
196
205
  return (null === (_a = this.socket) || void 0 === _a ? void 0 : _a.readyState) !== WebSocket.CONNECTING && (null === (_b = this.socket) || void 0 === _b ? void 0 : _b.readyState) !== WebSocket.OPEN && (this.autoReconnect && !this.manuallyClosed && !event.wasClean);
197
206
  }
198
207
  /**
199
- * Internal close socket - does not reset retry logic
208
+ * Close the current socket instance and release its timers and listeners.
200
209
  */ closeSocket(closeEvent) {
201
210
  this.socket && (this.clearKeepAliveTimer(), this.detachEventListeners(), this.socket.readyState !== WebSocket.CLOSED && this.socket.readyState !== WebSocket.CLOSING && this.socket.close(closeEvent.code || 1e3, closeEvent.reason || "Clean shutdown"),
202
211
  this.socket = null, this.keepAliveTimer = null);
@@ -0,0 +1,118 @@
1
+ const SliceIcons = {
2
+ arrows: {
3
+ arrowLeft: "arrow left",
4
+ arrowRight: "arrow right",
5
+ arrowUp: "arrow up",
6
+ arrowDown: "arrow down",
7
+ chevronDown: "chevron down",
8
+ chevronUp: "chevron up",
9
+ navigateRight: "navigate right",
10
+ navigateLeft: "navigate left",
11
+ share: "share"
12
+ },
13
+ selection: {
14
+ check: "check",
15
+ checkCircle: "check circle",
16
+ checkbox: "checkbox",
17
+ checkboxChecked: "checkbox checked",
18
+ checkboxPartial: "checkbox partial",
19
+ circle: "circle",
20
+ circleFill: "circle fill",
21
+ plus: "plus",
22
+ plusCircle: "plus circle"
23
+ },
24
+ Messaging: {
25
+ chat: "chat",
26
+ mail: "mail",
27
+ notification: "notification",
28
+ inbox: "inbox",
29
+ like: "like",
30
+ unlike: "unlike"
31
+ },
32
+ media: {
33
+ camera: "camera",
34
+ focus: "focus",
35
+ mic: "mic",
36
+ micMuted: "mic muted",
37
+ video: "video",
38
+ videoOff: "video off",
39
+ download: "download",
40
+ upload: "upload"
41
+ },
42
+ files: {
43
+ document: "document",
44
+ documentEditor: "document editor",
45
+ textDocument: "text document"
46
+ },
47
+ people: {
48
+ people: "people",
49
+ person: "person"
50
+ },
51
+ business: {
52
+ briefcase: "briefcase",
53
+ dollar: "dollar",
54
+ invoice: "invoice",
55
+ payment: "payment",
56
+ wallet: "wallet"
57
+ },
58
+ charts: {
59
+ barChart: "bar chart",
60
+ chart: "chart",
61
+ chartArrow: "chart arrow"
62
+ },
63
+ status: {
64
+ alert: "alert",
65
+ exclamation: "exclamation",
66
+ help: "help",
67
+ info: "info",
68
+ issue: "issue",
69
+ lightBulb: "light bulb",
70
+ target: "target",
71
+ openCircle: "open circle"
72
+ },
73
+ brands: {
74
+ apple: "apple",
75
+ google: "google",
76
+ googleMono: "google mono",
77
+ linkedin: "linkedin"
78
+ },
79
+ edit: {
80
+ edit: "edit",
81
+ trashBin: "trash bin",
82
+ copy: "copy",
83
+ filter: "filter",
84
+ highlight: "highlight",
85
+ undo: "undo",
86
+ concise: "concise",
87
+ expanded: "expanded",
88
+ moderate: "moderate",
89
+ recent: "recent"
90
+ },
91
+ typography: {
92
+ fontLarger: "font larger",
93
+ fontSmaller: "font smaller",
94
+ characterBeam: "character beam"
95
+ },
96
+ ai: {
97
+ sparkle: "sparkle",
98
+ wand: "wand"
99
+ },
100
+ ui: {
101
+ attach: "attach",
102
+ blank: "blank",
103
+ book: "book",
104
+ globeLocation: "globe location",
105
+ heart: "heart",
106
+ stop: "stop",
107
+ search: "search",
108
+ settings: "settings",
109
+ view: "view",
110
+ refresh: "refresh",
111
+ home: "home",
112
+ menu: "menu",
113
+ more: "more",
114
+ x: "x"
115
+ }
116
+ };
117
+
118
+ export { SliceIcons as S };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Create a tint value from a hex color
2
+ * Lighten or darken a hex color by mixing it toward white or black.
3
3
  */
4
4
  const tintFromColor = (hex, percent) => {
5
5
  const normalizedHex = hex.trim().replace("#", "");
@@ -26,5 +26,5 @@ const tintFromColor = (hex, percent) => {
26
26
  };
27
27
 
28
28
  /**
29
- * Adds the desired opacity level to a hex or RGB color string
29
+ * Convert a hex or RGB color into an RGBA string with the requested opacity.
30
30
  */ export { addOpacity as a, tintFromColor as t };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Delay a function call until activity stops, with cancel and flush helpers.
3
+ */
4
+ function debounce(func, delay) {
5
+ let timeoutId = null, lastArgs = null;
6
+ const debounced = function(...args) {
7
+ lastArgs = args, null !== timeoutId && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
8
+ func.apply(this, null != lastArgs ? lastArgs : []), timeoutId = null, lastArgs = null;
9
+ }, delay);
10
+ };
11
+ return debounced.cancel = () => {
12
+ null !== timeoutId && (clearTimeout(timeoutId), timeoutId = null, lastArgs = null);
13
+ }, debounced.flush = function() {
14
+ null !== timeoutId && null !== lastArgs && (clearTimeout(timeoutId), func.apply(this, lastArgs),
15
+ timeoutId = null, lastArgs = null);
16
+ }, debounced;
17
+ }
18
+
19
+ export { debounce as d };
@@ -1,7 +1,7 @@
1
1
  import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
2
2
 
3
3
  /**
4
- * Clean up string with html
4
+ * Remove scripts, invisible characters, and optional HTML tags from a string.
5
5
  */ function cleanString(input, removeInvisible = !0, removeHtml = !0) {
6
6
  let clean = input;
7
7
  if (clean = clean.replaceAll(/\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""),
@@ -17,13 +17,16 @@ import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
17
17
  }
18
18
 
19
19
  /**
20
- * Debug component rendering
21
- * Code removed when built / deployed
20
+ * Log mount, unmount, and prop-change reasons for debug render tracking.
22
21
  */ function debug(previous, updated, name = "component") {
23
22
  if ("test" === process.env.NODE_ENV) return;
24
23
  const props = previous.current.props, mount = previous.current.mount, unmount = previous.current.unmount;
25
24
  if (mount) ; else if (unmount) ; else {
26
- (function(props, updated) {
25
+ (
26
+ /**
27
+ * Build a readable list of prop changes between two prop snapshots.
28
+ */
29
+ function(props, updated) {
27
30
  const reasons = [];
28
31
  for (const key of Object.keys(updated)) if (updated[key] !== props[key]) try {
29
32
  const propName = `${key}:`, prev = JSON.stringify(props[key]), valueChanged = `${prev} > ${JSON.stringify(updated[key])}`;
@@ -35,7 +38,7 @@ import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
35
38
  }
36
39
  }
37
40
  /**
38
- * Utility to accessibility - mimics click event with designated keys event
41
+ * Convert a hex color into an RGB string literal.
39
42
  */)(props, updated);
40
43
  }
41
44
  return {
@@ -45,12 +48,19 @@ import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
45
48
  };
46
49
  }
47
50
 
48
- function accessibleKeyDown(e, clickFunction, keys) {
51
+ const hexToRgb = hex => {
52
+ if (!hex) return;
53
+ return `"rgb(${Number.parseInt(hex.slice(1, 3), 16)}, ${Number.parseInt(hex.slice(3, 5), 16)}, ${Number.parseInt(hex.slice(5, 7), 16)})"`;
54
+ };
55
+
56
+ /**
57
+ * Trigger a click-like callback when one of the configured keys is pressed.
58
+ */ function accessibleKeyDown(e, clickFunction, keys) {
49
59
  [ "Enter", " " ].includes(e.key) && (e.preventDefault(), clickFunction());
50
60
  }
51
61
 
52
62
  /**
53
- * Get the pointer position from a DOM touch or mouse event
63
+ * Read the horizontal pointer position from a mouse or touch event.
54
64
  */ function pointerPosition(e) {
55
65
  if (e.type.startsWith("touch")) {
56
66
  return e.touches[0].clientX;
@@ -59,20 +69,20 @@ function accessibleKeyDown(e, clickFunction, keys) {
59
69
  }
60
70
 
61
71
  /**
62
- * Filter and trim class name array
72
+ * Remove empty class names and join the remainder into one class string.
63
73
  */ function filterClasses(classNames) {
64
74
  return classNames.filter(item => "" !== item).join(" ").trim();
65
75
  }
66
76
 
67
77
  /**
68
- * Takes a style string or number and returns a valid CSS style string
78
+ * Normalize a style value or fallback into a CSS-ready string.
69
79
  */ function setStyle(value, defaultVal = void 0) {
70
80
  const useValue = null != value ? value : defaultVal;
71
81
  return useValue ? "string" == typeof useValue ? useValue : `${useValue}px` : "unset";
72
82
  }
73
83
 
74
84
  /**
75
- * Copy to clipboard
85
+ * Copy text to the clipboard using a temporary hidden textarea.
76
86
  */ const copyToClipboard = rawContent => __awaiter(void 0, void 0, void 0, function*() {
77
87
  try {
78
88
  const textArea = document.createElement("textarea");
@@ -85,9 +95,9 @@ function accessibleKeyDown(e, clickFunction, keys) {
85
95
  });
86
96
 
87
97
  /**
88
- * Get normalized percent value from number or string
98
+ * Convert numeric or string percentage input into a normalized number.
89
99
  */ function normalizedPercent(value) {
90
100
  return "number" == typeof value ? value : value.endsWith("%") ? Number.parseFloat(value) : Number.parseFloat(value) / 100;
91
101
  }
92
102
 
93
- export { accessibleKeyDown as a, cleanString as b, copyToClipboard as c, debug as d, filterClasses as f, normalizedPercent as n, pointerPosition as p, setStyle as s };
103
+ export { accessibleKeyDown as a, cleanString as b, copyToClipboard as c, debug as d, filterClasses as f, hexToRgb as h, normalizedPercent as n, pointerPosition as p, setStyle as s };
@@ -2,7 +2,7 @@ import { create } from "zustand";
2
2
 
3
3
  import "./tslib.es6-c-7TIv71.mjs";
4
4
 
5
- import { S as SSEConnection } from "./SSEConnection-Dj9P0SWE.mjs";
5
+ import { S as SSEConnection } from "./SSEConnection-DcA3wFsO.mjs";
6
6
 
7
7
  const useSSEStore = create((set, get) => ({
8
8
  connections: [],
@@ -1,4 +1,4 @@
1
- export { A as Avatar } from "../../chunks/Avatar-CDMV6f9w.mjs";
1
+ export { A as Avatar } from "../../chunks/Avatar-DGRMsHdO.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -6,6 +6,6 @@ import "react/jsx-runtime";
6
6
 
7
7
  import "react";
8
8
 
9
- import "../../chunks/misc-cg9I7drO.mjs";
9
+ import "../../chunks/misc-N8KLjOXc.mjs";
10
10
 
11
11
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { A as AvatarGroup } from "../../chunks/AvatarGroup-BZ18GwhK.mjs";
1
+ export { A as AvatarGroup } from "../../chunks/AvatarGroup-C9Ka1e9P.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -6,8 +6,8 @@ import "react/jsx-runtime";
6
6
 
7
7
  import "react";
8
8
 
9
- import "../../chunks/Avatar-CDMV6f9w.mjs";
9
+ import "../../chunks/Avatar-DGRMsHdO.mjs";
10
10
 
11
- import "../../chunks/misc-cg9I7drO.mjs";
11
+ import "../../chunks/misc-N8KLjOXc.mjs";
12
12
 
13
13
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { B as Button } from "../../chunks/Button-DexmN81C.mjs";
1
+ export { B as Button } from "../../chunks/Button-DAvVj4YV.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -14,7 +14,7 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
14
14
 
15
15
  import "../../chunks/Dot-CLGwQu-i.mjs";
16
16
 
17
- import "../../chunks/_types-C8GP_aSD.mjs";
17
+ import "../../chunks/Icon-C92f63Ib.mjs";
18
18
 
19
19
  import "../../hooks/useTheme.mjs";
20
20
 
@@ -34,8 +34,8 @@ import "../../hooks/useObserveTheme.mjs";
34
34
 
35
35
  import "../../hooks/useWindow.mjs";
36
36
 
37
- import "../../chunks/misc-cg9I7drO.mjs";
37
+ import "../../chunks/misc-N8KLjOXc.mjs";
38
38
 
39
- import "../../chunks/ProgressIndicator-DeLwB3Rb.mjs";
39
+ import "../../chunks/ProgressIndicator-BVwQNOcV.mjs";
40
40
 
41
41
  import "../../chunks/sharedTypes-tn9-uJvb.mjs";
@@ -1,4 +1,4 @@
1
- export { B as ButtonBar } from "../../chunks/ButtonBar-C-LwBxlY.mjs";
1
+ export { B as ButtonBar } from "../../chunks/ButtonBar-Cw73kooJ.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -24,7 +24,7 @@ import "../../hooks/useObserveTheme.mjs";
24
24
 
25
25
  import "../../hooks/useWindow.mjs";
26
26
 
27
- import "../../chunks/IconButton-B5WEf-v5.mjs";
27
+ import "../../chunks/IconButton-4O5S9S9G.mjs";
28
28
 
29
29
  import "motion/react";
30
30
 
@@ -34,8 +34,8 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
34
34
 
35
35
  import "../../chunks/Dot-CLGwQu-i.mjs";
36
36
 
37
- import "../../chunks/_types-C8GP_aSD.mjs";
37
+ import "../../chunks/Icon-C92f63Ib.mjs";
38
38
 
39
- import "../../chunks/misc-cg9I7drO.mjs";
39
+ import "../../chunks/misc-N8KLjOXc.mjs";
40
40
 
41
41
  import "../../chunks/sharedTypes-tn9-uJvb.mjs";
@@ -1,4 +1,4 @@
1
- export { C as Camera } from "../../chunks/Camera-DdUBZi52.mjs";
1
+ export { C as Camera } from "../../chunks/Camera-BrdJGlv6.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -24,12 +24,12 @@ import "../../hooks/useObserveTheme.mjs";
24
24
 
25
25
  import "../../hooks/useWindow.mjs";
26
26
 
27
- import "../../chunks/misc-cg9I7drO.mjs";
27
+ import "../../chunks/misc-N8KLjOXc.mjs";
28
28
 
29
- import "../../chunks/colors-DR9fLI5X.mjs";
29
+ import "../../chunks/colors-FQ0uNQcW.mjs";
30
30
 
31
- import "../../chunks/Avatar-CDMV6f9w.mjs";
31
+ import "../../chunks/Avatar-DGRMsHdO.mjs";
32
32
 
33
33
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
34
34
 
35
- import "../../chunks/_types-C8GP_aSD.mjs";
35
+ import "../../chunks/Icon-C92f63Ib.mjs";
@@ -1,4 +1,4 @@
1
- export { C as Card } from "../../chunks/Card-DUfnTA5v.mjs";
1
+ export { C as Card } from "../../chunks/Card-DGlv1PII.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -6,7 +6,7 @@ import "react/jsx-runtime";
6
6
 
7
7
  import "react";
8
8
 
9
- import "../../chunks/_types-C8GP_aSD.mjs";
9
+ import "../../chunks/Icon-C92f63Ib.mjs";
10
10
 
11
11
  import "../../hooks/useTheme.mjs";
12
12
 
@@ -26,6 +26,6 @@ import "../../hooks/useObserveTheme.mjs";
26
26
 
27
27
  import "../../hooks/useWindow.mjs";
28
28
 
29
- import "../../chunks/misc-cg9I7drO.mjs";
29
+ import "../../chunks/misc-N8KLjOXc.mjs";
30
30
 
31
31
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { C as CheckBox } from "../../chunks/CheckBox-Bnd3UAt0.mjs";
1
+ export { C as CheckBox } from "../../chunks/CheckBox-B7UCZvRv.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -8,6 +8,10 @@ import "motion/react";
8
8
 
9
9
  import "react";
10
10
 
11
+ import "../../chunks/misc-N8KLjOXc.mjs";
12
+
13
+ import "../../chunks/Icon-C92f63Ib.mjs";
14
+
11
15
  import "../../hooks/useTheme.mjs";
12
16
 
13
17
  import "../../theme/themes.mjs";
@@ -26,8 +30,4 @@ import "../../hooks/useObserveTheme.mjs";
26
30
 
27
31
  import "../../hooks/useWindow.mjs";
28
32
 
29
- import "../../chunks/_types-C8GP_aSD.mjs";
30
-
31
- import "../../chunks/misc-cg9I7drO.mjs";
32
-
33
33
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { C as Chip } from "../../chunks/Chip-BJS4oJBL.mjs";
1
+ export { C as Chip } from "../../chunks/Chip-BPF7fBba.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -24,9 +24,9 @@ import "../../hooks/useObserveTheme.mjs";
24
24
 
25
25
  import "../../hooks/useWindow.mjs";
26
26
 
27
- import "../../chunks/_types-C8GP_aSD.mjs";
27
+ import "../../chunks/misc-N8KLjOXc.mjs";
28
28
 
29
- import "../../chunks/misc-cg9I7drO.mjs";
29
+ import "../../chunks/Icon-C92f63Ib.mjs";
30
30
 
31
31
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
32
32
 
@@ -1,4 +1,4 @@
1
- export { D as DivInput } from "../../chunks/DivInput-B7BliU1p.mjs";
1
+ export { D as DivInput } from "../../chunks/DivInput-Ch9XjfWd.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -8,6 +8,6 @@ import "motion/react";
8
8
 
9
9
  import "react";
10
10
 
11
- import "../../chunks/misc-cg9I7drO.mjs";
11
+ import "../../chunks/misc-N8KLjOXc.mjs";
12
12
 
13
13
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { D as DocIcons } from "../../chunks/DocIcons-BxtcXsWI.mjs";
1
+ export { D as DocIcons } from "../../chunks/DocIcons-B4xsPrXM.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -1,4 +1,4 @@
1
- export { D as DraggablePanel } from "../../chunks/DrggablePanel-DvactFf5.mjs";
1
+ export { D as DraggablePanel } from "../../chunks/DrggablePanel-Ddi0vPRp.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -26,6 +26,6 @@ import "../../hooks/useWindow.mjs";
26
26
 
27
27
  import "../../hooks/useObserveResize.mjs";
28
28
 
29
- import "../../chunks/misc-cg9I7drO.mjs";
29
+ import "../../chunks/misc-N8KLjOXc.mjs";
30
30
 
31
31
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";