@floegence/floe-webapp-core 0.4.0 → 0.6.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.
Files changed (87) hide show
  1. package/dist/components/ui/Dialog.d.ts +3 -0
  2. package/dist/components/ui/DirectoryPicker.d.ts +31 -0
  3. package/dist/components/ui/index.d.ts +1 -0
  4. package/dist/index.js +193 -191
  5. package/dist/index10.js +2 -2
  6. package/dist/index11.js +4 -4
  7. package/dist/index12.js +5 -5
  8. package/dist/index13.js +3 -3
  9. package/dist/index14.js +4 -4
  10. package/dist/index15.js +5 -5
  11. package/dist/index16.js +5 -5
  12. package/dist/index17.js +4 -4
  13. package/dist/index18.js +6 -6
  14. package/dist/index19.js +2 -2
  15. package/dist/index2.js +6 -6
  16. package/dist/index20.js +2 -2
  17. package/dist/index21.js +1 -1
  18. package/dist/index22.js +8 -5
  19. package/dist/index23.js +3 -3
  20. package/dist/index24.js +3 -3
  21. package/dist/index25.js +1 -1
  22. package/dist/index26.js +5 -5
  23. package/dist/index27.js +1 -1
  24. package/dist/index28.js +3 -3
  25. package/dist/index29.js +362 -81
  26. package/dist/index3.js +2 -2
  27. package/dist/index30.js +87 -37
  28. package/dist/index31.js +37 -66
  29. package/dist/index32.js +69 -278
  30. package/dist/index33.js +278 -152
  31. package/dist/index34.js +147 -24
  32. package/dist/index35.js +26 -45
  33. package/dist/index36.js +45 -10
  34. package/dist/index37.js +10 -27
  35. package/dist/index38.js +27 -159
  36. package/dist/index39.js +156 -228
  37. package/dist/index4.js +1 -1
  38. package/dist/index40.js +228 -125
  39. package/dist/index41.js +110 -176
  40. package/dist/index42.js +149 -122
  41. package/dist/index43.js +161 -183
  42. package/dist/index44.js +185 -145
  43. package/dist/index45.js +143 -114
  44. package/dist/index46.js +119 -47
  45. package/dist/index47.js +50 -48
  46. package/dist/index48.js +40 -30
  47. package/dist/index49.js +33 -44
  48. package/dist/index5.js +4 -4
  49. package/dist/index50.js +49 -25
  50. package/dist/index51.js +21 -169
  51. package/dist/index52.js +169 -36
  52. package/dist/index53.js +38 -64
  53. package/dist/index54.js +63 -93
  54. package/dist/index55.js +86 -111
  55. package/dist/index56.js +114 -131
  56. package/dist/index57.js +131 -32
  57. package/dist/index58.js +29 -425
  58. package/dist/index59.js +433 -36
  59. package/dist/index6.js +2 -2
  60. package/dist/index60.js +31 -12
  61. package/dist/index61.js +19 -13
  62. package/dist/index62.js +13 -10
  63. package/dist/index63.js +10 -16
  64. package/dist/index64.js +16 -10
  65. package/dist/index65.js +10 -8
  66. package/dist/index66.js +8 -61
  67. package/dist/index67.js +61 -5
  68. package/dist/index68.js +5 -11
  69. package/dist/index69.js +10 -25
  70. package/dist/index7.js +2 -2
  71. package/dist/index70.js +24 -30
  72. package/dist/index71.js +31 -90
  73. package/dist/index72.js +90 -26
  74. package/dist/index73.js +24 -43
  75. package/dist/index74.js +45 -13
  76. package/dist/index75.js +14 -35
  77. package/dist/index76.js +33 -62
  78. package/dist/index77.js +61 -81
  79. package/dist/index78.js +84 -14
  80. package/dist/index79.js +12 -2261
  81. package/dist/index8.js +2 -2
  82. package/dist/index80.js +2262 -6
  83. package/dist/index81.js +7 -39
  84. package/dist/index82.js +42 -0
  85. package/dist/index9.js +1 -1
  86. package/dist/styles.css +1 -1
  87. package/package.json +1 -1
package/dist/index59.js CHANGED
@@ -1,41 +1,438 @@
1
- import { createComponent as c } from "solid-js/web";
2
- import { createContext as g, untrack as s, useContext as a } from "solid-js";
3
- const d = g();
4
- function f(t) {
5
- const e = {
6
- widgetId: s(() => t.widgetId),
7
- get: (n) => t.state()[n],
8
- set: (n, i) => t.onStateChange(n, i),
9
- getAll: () => t.state()
10
- };
11
- return c(d.Provider, {
12
- value: e,
13
- get children() {
14
- return t.children;
15
- }
16
- });
17
- }
18
- function u() {
19
- const t = a(d);
20
- if (!t)
21
- throw new Error("useWidgetStateContext must be used within a WidgetStateProvider");
22
- return t;
23
- }
24
- function w(t, o) {
25
- const e = u();
26
- return [() => {
27
- const r = e.get(t);
28
- return r !== void 0 ? r : o;
29
- }, (r) => {
30
- e.set(t, r);
1
+ import { createSignal as x, createEffect as B } from "solid-js";
2
+ import { createStore as q, produce as c } from "solid-js/store";
3
+ import { createSimpleContext as G } from "./index51.js";
4
+ import { useResolvedFloeConfig as H } from "./index52.js";
5
+ import { useWidgetRegistry as J } from "./index58.js";
6
+ import { hasCollision as A, constrainPosition as N, findFreePosition as Q } from "./index73.js";
7
+ function U() {
8
+ const d = Date.now();
9
+ return [{
10
+ id: "preset-default",
11
+ name: "Default",
12
+ isPreset: !0,
13
+ widgets: [{
14
+ id: "w1",
15
+ type: "metrics",
16
+ position: {
17
+ col: 0,
18
+ row: 0,
19
+ colSpan: 12,
20
+ rowSpan: 6
21
+ }
22
+ }, {
23
+ id: "w2",
24
+ type: "terminal",
25
+ position: {
26
+ col: 12,
27
+ row: 0,
28
+ colSpan: 12,
29
+ rowSpan: 6
30
+ }
31
+ }, {
32
+ id: "w3",
33
+ type: "metrics",
34
+ position: {
35
+ col: 0,
36
+ row: 6,
37
+ colSpan: 24,
38
+ rowSpan: 6
39
+ }
40
+ }],
41
+ createdAt: d,
42
+ updatedAt: d
43
+ }, {
44
+ id: "preset-focus",
45
+ name: "Focus",
46
+ isPreset: !0,
47
+ widgets: [{
48
+ id: "w1",
49
+ type: "terminal",
50
+ position: {
51
+ col: 0,
52
+ row: 0,
53
+ colSpan: 24,
54
+ rowSpan: 12
55
+ }
56
+ }],
57
+ createdAt: d,
58
+ updatedAt: d
59
+ }, {
60
+ id: "preset-monitoring",
61
+ name: "Monitoring",
62
+ isPreset: !0,
63
+ widgets: [{
64
+ id: "w1",
65
+ type: "metrics",
66
+ position: {
67
+ col: 0,
68
+ row: 0,
69
+ colSpan: 12,
70
+ rowSpan: 6
71
+ }
72
+ }, {
73
+ id: "w2",
74
+ type: "metrics",
75
+ position: {
76
+ col: 12,
77
+ row: 0,
78
+ colSpan: 12,
79
+ rowSpan: 6
80
+ }
81
+ }, {
82
+ id: "w3",
83
+ type: "metrics",
84
+ position: {
85
+ col: 0,
86
+ row: 6,
87
+ colSpan: 12,
88
+ rowSpan: 6
89
+ }
90
+ }, {
91
+ id: "w4",
92
+ type: "metrics",
93
+ position: {
94
+ col: 12,
95
+ row: 6,
96
+ colSpan: 12,
97
+ rowSpan: 6
98
+ }
99
+ }],
100
+ createdAt: d,
101
+ updatedAt: d
102
+ }, {
103
+ id: "preset-development",
104
+ name: "Development",
105
+ isPreset: !0,
106
+ widgets: [{
107
+ id: "w1",
108
+ type: "terminal",
109
+ position: {
110
+ col: 0,
111
+ row: 0,
112
+ colSpan: 12,
113
+ rowSpan: 6
114
+ }
115
+ }, {
116
+ id: "w2",
117
+ type: "terminal",
118
+ position: {
119
+ col: 12,
120
+ row: 0,
121
+ colSpan: 12,
122
+ rowSpan: 6
123
+ }
124
+ }, {
125
+ id: "w3",
126
+ type: "metrics",
127
+ position: {
128
+ col: 0,
129
+ row: 6,
130
+ colSpan: 24,
131
+ rowSpan: 6
132
+ }
133
+ }],
134
+ createdAt: d,
135
+ updatedAt: d
31
136
  }];
32
137
  }
33
- function S() {
34
- return u().widgetId;
138
+ function V(d) {
139
+ if (!d || d.length === 0) return U();
140
+ const w = Date.now();
141
+ return d.map((p) => ({
142
+ id: p.id,
143
+ name: p.name,
144
+ isPreset: p.isPreset ?? !0,
145
+ widgets: p.widgets.map((l) => ({
146
+ id: l.id,
147
+ type: l.type,
148
+ position: l.position,
149
+ config: l.config,
150
+ title: l.title
151
+ })),
152
+ createdAt: w,
153
+ updatedAt: w
154
+ }));
155
+ }
156
+ const {
157
+ Provider: ot,
158
+ use: nt
159
+ } = G({
160
+ name: "Deck",
161
+ init: X
162
+ });
163
+ function X() {
164
+ var h;
165
+ const d = H(), w = J(), p = () => d.config.deck.storageKey, l = V(d.config.deck.presets), z = new Set(l.map((t) => t.id)), y = d.persist.load(p(), {}), D = y.layouts ?? [], b = new Map(D.map((t) => [t.id, t])), E = l.map((t) => {
166
+ const e = b.get(t.id);
167
+ return e ? {
168
+ ...e,
169
+ isPreset: t.isPreset
170
+ } : t;
171
+ }), F = D.filter((t) => !t.isPreset && !z.has(t.id)), S = [...E, ...F], P = new Set(S.map((t) => t.id)), T = y.activeLayoutId && P.has(y.activeLayoutId) ? y.activeLayoutId : d.config.deck.defaultActiveLayoutId && P.has(d.config.deck.defaultActiveLayoutId) ? d.config.deck.defaultActiveLayoutId : ((h = S[0]) == null ? void 0 : h.id) ?? "", j = {
172
+ layouts: S,
173
+ activeLayoutId: T,
174
+ editMode: !1
175
+ }, [r, s] = q(j), [C, v] = x(null), [M, L] = x(null), R = (t) => t;
176
+ B(() => {
177
+ R(r.layouts.length);
178
+ for (const e of r.layouts) R(e.updatedAt);
179
+ const t = {
180
+ layouts: r.layouts,
181
+ activeLayoutId: r.activeLayoutId
182
+ };
183
+ d.persist.debouncedSave(p(), t);
184
+ });
185
+ const f = () => r.layouts.find((t) => t.id === r.activeLayoutId), g = () => `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, m = (t) => {
186
+ if (typeof structuredClone == "function") return structuredClone(t);
187
+ if (t === null || typeof t != "object") return t;
188
+ if (t instanceof Date) return new Date(t.getTime());
189
+ if (Array.isArray(t)) return t.map((o) => m(o));
190
+ const e = {};
191
+ for (const [o, n] of Object.entries(t))
192
+ e[o] = m(n);
193
+ return e;
194
+ };
195
+ return {
196
+ // Layout management
197
+ layouts: () => r.layouts,
198
+ activeLayoutId: () => r.activeLayoutId,
199
+ activeLayout: f,
200
+ setActiveLayout: (t) => {
201
+ r.layouts.some((e) => e.id === t) && s("activeLayoutId", t);
202
+ },
203
+ createLayout: (t, e) => {
204
+ const o = {
205
+ id: g(),
206
+ name: t,
207
+ widgets: e ?? [],
208
+ createdAt: Date.now(),
209
+ updatedAt: Date.now()
210
+ };
211
+ return s(c((n) => {
212
+ n.layouts.push(o), n.activeLayoutId = o.id;
213
+ })), o;
214
+ },
215
+ duplicateLayout: (t, e) => {
216
+ const o = r.layouts.find((i) => i.id === t);
217
+ if (!o) return;
218
+ const n = {
219
+ id: g(),
220
+ name: e,
221
+ widgets: o.widgets.map((i) => ({
222
+ ...i,
223
+ id: g(),
224
+ position: {
225
+ ...i.position
226
+ },
227
+ config: i.config ? m(i.config) : void 0,
228
+ state: i.state ? m(i.state) : void 0
229
+ })),
230
+ createdAt: Date.now(),
231
+ updatedAt: Date.now()
232
+ };
233
+ return s(c((i) => {
234
+ i.layouts.push(n), i.activeLayoutId = n.id;
235
+ })), n;
236
+ },
237
+ deleteLayout: (t) => {
238
+ const e = r.layouts.find((o) => o.id === t);
239
+ !e || e.isPreset || s(c((o) => {
240
+ var i;
241
+ const n = o.layouts.findIndex((a) => a.id === t);
242
+ n !== -1 && (o.layouts.splice(n, 1), o.activeLayoutId === t && (o.activeLayoutId = ((i = o.layouts[0]) == null ? void 0 : i.id) ?? ""));
243
+ }));
244
+ },
245
+ renameLayout: (t, e) => {
246
+ const o = r.layouts.find((n) => n.id === t);
247
+ !o || o.isPreset || s(c((n) => {
248
+ const i = n.layouts.find((a) => a.id === t);
249
+ i && (i.name = e, i.updatedAt = Date.now());
250
+ }));
251
+ },
252
+ // Edit mode
253
+ editMode: () => r.editMode,
254
+ setEditMode: (t) => s("editMode", t),
255
+ toggleEditMode: () => s("editMode", !r.editMode),
256
+ // Widget management
257
+ addWidget: (t, e, o) => {
258
+ const n = f();
259
+ if (!n) return;
260
+ const i = w.getWidget(t), a = {
261
+ minColSpan: (i == null ? void 0 : i.minColSpan) ?? 2,
262
+ minRowSpan: (i == null ? void 0 : i.minRowSpan) ?? 2
263
+ }, u = {
264
+ colSpan: (e == null ? void 0 : e.colSpan) ?? (i == null ? void 0 : i.defaultColSpan) ?? Math.max(a.minColSpan, 4),
265
+ rowSpan: (e == null ? void 0 : e.rowSpan) ?? (i == null ? void 0 : i.defaultRowSpan) ?? Math.max(a.minRowSpan, 3)
266
+ }, K = (e == null ? void 0 : e.col) !== void 0 && (e == null ? void 0 : e.row) !== void 0 ? N({
267
+ ...u,
268
+ col: e.col,
269
+ row: e.row
270
+ }, a.minColSpan, a.minRowSpan) : Q(n.widgets, u.colSpan, u.rowSpan), W = g(), O = {
271
+ id: W,
272
+ type: t,
273
+ position: K,
274
+ config: o
275
+ };
276
+ return s(c((k) => {
277
+ const I = k.layouts.find(($) => $.id === k.activeLayoutId);
278
+ I && (I.widgets.push(O), I.updatedAt = Date.now());
279
+ })), W;
280
+ },
281
+ removeWidget: (t) => {
282
+ s(c((e) => {
283
+ const o = e.layouts.find((n) => n.id === e.activeLayoutId);
284
+ if (o) {
285
+ const n = o.widgets.findIndex((i) => i.id === t);
286
+ n !== -1 && (o.widgets.splice(n, 1), o.updatedAt = Date.now());
287
+ }
288
+ }));
289
+ },
290
+ updateWidgetPosition: (t, e) => {
291
+ s(c((o) => {
292
+ const n = o.layouts.find((i) => i.id === o.activeLayoutId);
293
+ if (n) {
294
+ const i = n.widgets.find((a) => a.id === t);
295
+ i && (A(e, n.widgets, t) || (i.position = e, n.updatedAt = Date.now()));
296
+ }
297
+ }));
298
+ },
299
+ updateWidgetConfig: (t, e) => {
300
+ s(c((o) => {
301
+ const n = o.layouts.find((i) => i.id === o.activeLayoutId);
302
+ if (n) {
303
+ const i = n.widgets.find((a) => a.id === t);
304
+ i && (i.config = {
305
+ ...i.config,
306
+ ...e
307
+ }, n.updatedAt = Date.now());
308
+ }
309
+ }));
310
+ },
311
+ updateWidgetTitle: (t, e) => {
312
+ s(c((o) => {
313
+ const n = o.layouts.find((i) => i.id === o.activeLayoutId);
314
+ if (n) {
315
+ const i = n.widgets.find((a) => a.id === t);
316
+ i && (i.title = e, n.updatedAt = Date.now());
317
+ }
318
+ }));
319
+ },
320
+ changeWidgetType: (t, e) => {
321
+ s(c((o) => {
322
+ const n = o.layouts.find((i) => i.id === o.activeLayoutId);
323
+ if (n) {
324
+ const i = n.widgets.find((a) => a.id === t);
325
+ i && (i.type = e, i.config = void 0, i.title = void 0, i.state = void 0, n.updatedAt = Date.now());
326
+ }
327
+ }));
328
+ },
329
+ updateWidgetState: (t, e, o) => {
330
+ s(c((n) => {
331
+ const i = n.layouts.find((a) => a.id === n.activeLayoutId);
332
+ if (i) {
333
+ const a = i.widgets.find((u) => u.id === t);
334
+ a && (a.state || (a.state = {}), a.state[e] = o, i.updatedAt = Date.now());
335
+ }
336
+ }));
337
+ },
338
+ getWidgetState: (t) => {
339
+ const e = f(), o = e == null ? void 0 : e.widgets.find((n) => n.id === t);
340
+ return (o == null ? void 0 : o.state) ?? {};
341
+ },
342
+ // Drag state
343
+ dragState: C,
344
+ startDrag: (t, e, o) => {
345
+ const n = f(), i = n == null ? void 0 : n.widgets.find((a) => a.id === t);
346
+ i && v({
347
+ widgetId: t,
348
+ originalPosition: {
349
+ ...i.position
350
+ },
351
+ currentPosition: {
352
+ ...i.position
353
+ },
354
+ pixelOffset: {
355
+ x: 0,
356
+ y: 0
357
+ },
358
+ startX: e,
359
+ startY: o
360
+ });
361
+ },
362
+ updateDrag: (t, e) => {
363
+ v((o) => o ? {
364
+ ...o,
365
+ currentPosition: t,
366
+ pixelOffset: e
367
+ } : null);
368
+ },
369
+ endDrag: (t) => {
370
+ const e = C();
371
+ if (e) {
372
+ if (t) {
373
+ const o = f();
374
+ o && !A(e.currentPosition, o.widgets, e.widgetId) && s(c((n) => {
375
+ const i = n.layouts.find((a) => a.id === n.activeLayoutId);
376
+ if (i) {
377
+ const a = i.widgets.find((u) => u.id === e.widgetId);
378
+ a && (a.position = e.currentPosition, i.updatedAt = Date.now());
379
+ }
380
+ }));
381
+ }
382
+ v(null);
383
+ }
384
+ },
385
+ // Resize state
386
+ resizeState: M,
387
+ startResize: (t, e, o, n) => {
388
+ const i = f(), a = i == null ? void 0 : i.widgets.find((u) => u.id === t);
389
+ a && L({
390
+ widgetId: t,
391
+ edge: e,
392
+ originalPosition: {
393
+ ...a.position
394
+ },
395
+ currentPosition: {
396
+ ...a.position
397
+ },
398
+ startX: o,
399
+ startY: n
400
+ });
401
+ },
402
+ updateResize: (t) => {
403
+ L((e) => e ? {
404
+ ...e,
405
+ currentPosition: t
406
+ } : null);
407
+ },
408
+ endResize: (t) => {
409
+ const e = M();
410
+ if (e) {
411
+ if (t) {
412
+ const o = f();
413
+ o && !A(e.currentPosition, o.widgets, e.widgetId) && s(c((n) => {
414
+ const i = n.layouts.find((a) => a.id === n.activeLayoutId);
415
+ if (i) {
416
+ const a = i.widgets.find((u) => u.id === e.widgetId);
417
+ a && (a.position = e.currentPosition, i.updatedAt = Date.now());
418
+ }
419
+ }));
420
+ }
421
+ L(null);
422
+ }
423
+ },
424
+ // Utilities
425
+ getWidgetMinConstraints: (t) => {
426
+ const e = w.getWidget(t);
427
+ return {
428
+ minColSpan: (e == null ? void 0 : e.minColSpan) ?? 2,
429
+ minRowSpan: (e == null ? void 0 : e.minRowSpan) ?? 2
430
+ };
431
+ }
432
+ };
35
433
  }
36
434
  export {
37
- f as WidgetStateProvider,
38
- S as useCurrentWidgetId,
39
- w as useWidgetState,
40
- u as useWidgetStateContext
435
+ ot as DeckProvider,
436
+ X as createDeckService,
437
+ nt as useDeck
41
438
  };
package/dist/index6.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { delegateEvents as f, template as i, insert as l, effect as u, className as a, createComponent as c } from "solid-js/web";
2
2
  import { Show as s } from "solid-js";
3
- import { cn as m } from "./index67.js";
4
- import { useResolvedFloeConfig as b } from "./index51.js";
3
+ import { cn as m } from "./index68.js";
4
+ import { useResolvedFloeConfig as b } from "./index52.js";
5
5
  var h = /* @__PURE__ */ i("<footer>"), g = /* @__PURE__ */ i('<span class="w-2.5 h-2.5">'), $ = /* @__PURE__ */ i("<button type=button>"), d = /* @__PURE__ */ i("<span>");
6
6
  function C(e) {
7
7
  return (() => {
package/dist/index60.js CHANGED
@@ -1,22 +1,41 @@
1
- import { createComponent as i } from "solid-js/web";
2
- import { createContext as n, untrack as r, useContext as c } from "solid-js";
3
- const e = n();
4
- function v(t) {
5
- const o = r(() => t.value);
6
- return i(e.Provider, {
7
- value: o,
1
+ import { createComponent as c } from "solid-js/web";
2
+ import { createContext as g, untrack as s, useContext as a } from "solid-js";
3
+ const d = g();
4
+ function f(t) {
5
+ const e = {
6
+ widgetId: s(() => t.widgetId),
7
+ get: (n) => t.state()[n],
8
+ set: (n, i) => t.onStateChange(n, i),
9
+ getAll: () => t.state()
10
+ };
11
+ return c(d.Provider, {
12
+ value: e,
8
13
  get children() {
9
14
  return t.children;
10
15
  }
11
16
  });
12
17
  }
13
- function w() {
14
- const t = c(e);
18
+ function u() {
19
+ const t = a(d);
15
20
  if (!t)
16
- throw new Error("ViewActivationContext not found. Wrap your view with <ViewActivationProvider />.");
21
+ throw new Error("useWidgetStateContext must be used within a WidgetStateProvider");
17
22
  return t;
18
23
  }
24
+ function w(t, o) {
25
+ const e = u();
26
+ return [() => {
27
+ const r = e.get(t);
28
+ return r !== void 0 ? r : o;
29
+ }, (r) => {
30
+ e.set(t, r);
31
+ }];
32
+ }
33
+ function S() {
34
+ return u().widgetId;
35
+ }
19
36
  export {
20
- v as ViewActivationProvider,
21
- w as useViewActivation
37
+ f as WidgetStateProvider,
38
+ S as useCurrentWidgetId,
39
+ w as useWidgetState,
40
+ u as useWidgetStateContext
22
41
  };
package/dist/index61.js CHANGED
@@ -1,16 +1,22 @@
1
- import { createSignal as c, onMount as i, onCleanup as s } from "solid-js";
2
- function h(a) {
3
- const [o, n] = c(!1);
4
- return i(() => {
5
- if (typeof window > "u") return;
6
- const e = window.matchMedia(a);
7
- n(e.matches);
8
- const t = (r) => {
9
- n(r.matches);
10
- };
11
- e.addEventListener("change", t), s(() => e.removeEventListener("change", t));
12
- }), o;
1
+ import { createComponent as i } from "solid-js/web";
2
+ import { createContext as n, untrack as r, useContext as c } from "solid-js";
3
+ const e = n();
4
+ function v(t) {
5
+ const o = r(() => t.value);
6
+ return i(e.Provider, {
7
+ value: o,
8
+ get children() {
9
+ return t.children;
10
+ }
11
+ });
12
+ }
13
+ function w() {
14
+ const t = c(e);
15
+ if (!t)
16
+ throw new Error("ViewActivationContext not found. Wrap your view with <ViewActivationProvider />.");
17
+ return t;
13
18
  }
14
19
  export {
15
- h as useMediaQuery
20
+ v as ViewActivationProvider,
21
+ w as useViewActivation
16
22
  };
package/dist/index62.js CHANGED
@@ -1,13 +1,16 @@
1
- import { createSignal as r, createEffect as i, on as a } from "solid-js";
2
- function s(e, t) {
3
- const [o, n] = r(e());
4
- return i(
5
- a(e, (u) => {
6
- const c = setTimeout(() => n(() => u), t);
7
- return () => clearTimeout(c);
8
- })
9
- ), o;
1
+ import { createSignal as c, onMount as i, onCleanup as s } from "solid-js";
2
+ function h(a) {
3
+ const [o, n] = c(!1);
4
+ return i(() => {
5
+ if (typeof window > "u") return;
6
+ const e = window.matchMedia(a);
7
+ n(e.matches);
8
+ const t = (r) => {
9
+ n(r.matches);
10
+ };
11
+ e.addEventListener("change", t), s(() => e.removeEventListener("change", t));
12
+ }), o;
10
13
  }
11
14
  export {
12
- s as useDebounce
15
+ h as useMediaQuery
13
16
  };
package/dist/index63.js CHANGED
@@ -1,19 +1,13 @@
1
- import { createSignal as c, onMount as u, onCleanup as h } from "solid-js";
2
- function b(o) {
3
- const [r, i] = c(null);
4
- return u(() => {
5
- const t = o();
6
- if (!t) return;
7
- const n = new ResizeObserver((s) => {
8
- const e = s[0];
9
- e && i({
10
- width: e.contentRect.width,
11
- height: e.contentRect.height
12
- });
13
- });
14
- n.observe(t), h(() => n.disconnect());
15
- }), r;
1
+ import { createSignal as r, createEffect as i, on as a } from "solid-js";
2
+ function s(e, t) {
3
+ const [o, n] = r(e());
4
+ return i(
5
+ a(e, (u) => {
6
+ const c = setTimeout(() => n(() => u), t);
7
+ return () => clearTimeout(c);
8
+ })
9
+ ), o;
16
10
  }
17
11
  export {
18
- b as useResizeObserver
12
+ s as useDebounce
19
13
  };
package/dist/index64.js CHANGED
@@ -1,13 +1,19 @@
1
- import { onMount as d, onCleanup as i } from "solid-js";
2
- import { matchKeybind as r } from "./index69.js";
3
- function a(o, t) {
4
- d(() => {
5
- const n = (e) => {
6
- r(e, o) && (e.preventDefault(), t());
7
- };
8
- window.addEventListener("keydown", n), i(() => window.removeEventListener("keydown", n));
9
- });
1
+ import { createSignal as c, onMount as u, onCleanup as h } from "solid-js";
2
+ function b(o) {
3
+ const [r, i] = c(null);
4
+ return u(() => {
5
+ const t = o();
6
+ if (!t) return;
7
+ const n = new ResizeObserver((s) => {
8
+ const e = s[0];
9
+ e && i({
10
+ width: e.contentRect.width,
11
+ height: e.contentRect.height
12
+ });
13
+ });
14
+ n.observe(t), h(() => n.disconnect());
15
+ }), r;
10
16
  }
11
17
  export {
12
- a as useKeybind
18
+ b as useResizeObserver
13
19
  };
package/dist/index65.js CHANGED
@@ -1,11 +1,13 @@
1
- import { createSignal as n, createEffect as a } from "solid-js";
2
- import { useResolvedFloeConfig as c } from "./index51.js";
3
- function u(e, s) {
4
- const t = c(), r = t.persist.load(e, s), [o, i] = n(r);
5
- return a(() => {
6
- t.persist.debouncedSave(e, o());
7
- }), [o, i];
1
+ import { onMount as d, onCleanup as i } from "solid-js";
2
+ import { matchKeybind as r } from "./index70.js";
3
+ function a(o, t) {
4
+ d(() => {
5
+ const n = (e) => {
6
+ r(e, o) && (e.preventDefault(), t());
7
+ };
8
+ window.addEventListener("keydown", n), i(() => window.removeEventListener("keydown", n));
9
+ });
8
10
  }
9
11
  export {
10
- u as usePersisted
12
+ a as useKeybind
11
13
  };