@floegence/floe-webapp-core 0.1.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 (145) hide show
  1. package/dist/app/FloeApp.d.ts +37 -0
  2. package/dist/app/FloeProvider.d.ts +17 -0
  3. package/dist/app/index.d.ts +2 -0
  4. package/dist/components/deck/DeckCell.d.ts +17 -0
  5. package/dist/components/deck/DeckGrid.d.ts +14 -0
  6. package/dist/components/deck/DeckTopBar.d.ts +9 -0
  7. package/dist/components/deck/DropZonePreview.d.ts +10 -0
  8. package/dist/components/deck/LayoutSelector.d.ts +7 -0
  9. package/dist/components/deck/WidgetFrame.d.ts +14 -0
  10. package/dist/components/deck/WidgetPalette.d.ts +7 -0
  11. package/dist/components/deck/WidgetResizeHandle.d.ts +9 -0
  12. package/dist/components/deck/WidgetTypeSwitcher.d.ts +9 -0
  13. package/dist/components/deck/index.d.ts +9 -0
  14. package/dist/components/icons/index.d.ts +29 -0
  15. package/dist/components/index.d.ts +5 -0
  16. package/dist/components/launchpad/Launchpad.d.ts +15 -0
  17. package/dist/components/launchpad/LaunchpadGrid.d.ts +8 -0
  18. package/dist/components/launchpad/LaunchpadItem.d.ts +18 -0
  19. package/dist/components/launchpad/LaunchpadPagination.d.ts +6 -0
  20. package/dist/components/launchpad/LaunchpadSearch.d.ts +6 -0
  21. package/dist/components/launchpad/index.d.ts +10 -0
  22. package/dist/components/layout/ActivityBar.d.ts +24 -0
  23. package/dist/components/layout/BottomBar.d.ts +27 -0
  24. package/dist/components/layout/MobileTabBar.d.ts +19 -0
  25. package/dist/components/layout/Panel.d.ts +27 -0
  26. package/dist/components/layout/ResizeHandle.d.ts +9 -0
  27. package/dist/components/layout/Shell.d.ts +23 -0
  28. package/dist/components/layout/Sidebar.d.ts +33 -0
  29. package/dist/components/layout/TopBar.d.ts +11 -0
  30. package/dist/components/layout/index.d.ts +9 -0
  31. package/dist/components/loading/LoadingOverlay.d.ts +10 -0
  32. package/dist/components/loading/Skeleton.d.ts +21 -0
  33. package/dist/components/loading/SnakeLoader.d.ts +9 -0
  34. package/dist/components/loading/index.d.ts +3 -0
  35. package/dist/components/ui/Button.d.ts +12 -0
  36. package/dist/components/ui/Card.d.ts +79 -0
  37. package/dist/components/ui/CommandPalette.d.ts +4 -0
  38. package/dist/components/ui/Dialog.d.ts +29 -0
  39. package/dist/components/ui/Dropdown.d.ts +35 -0
  40. package/dist/components/ui/FloatingWindow.d.ts +45 -0
  41. package/dist/components/ui/Input.d.ts +16 -0
  42. package/dist/components/ui/Tooltip.d.ts +12 -0
  43. package/dist/components/ui/index.d.ts +8 -0
  44. package/dist/context/CommandContext.d.ts +30 -0
  45. package/dist/context/ComponentRegistry.d.ts +90 -0
  46. package/dist/context/DeckContext.d.ts +88 -0
  47. package/dist/context/FloeConfigContext.d.ts +133 -0
  48. package/dist/context/LayoutContext.d.ts +20 -0
  49. package/dist/context/NotificationContext.d.ts +32 -0
  50. package/dist/context/ThemeContext.d.ts +12 -0
  51. package/dist/context/WidgetRegistry.d.ts +37 -0
  52. package/dist/context/createSimpleContext.d.ts +15 -0
  53. package/dist/context/index.d.ts +9 -0
  54. package/dist/hooks/index.d.ts +6 -0
  55. package/dist/hooks/useDebounce.d.ts +5 -0
  56. package/dist/hooks/useDeckDrag.d.ts +6 -0
  57. package/dist/hooks/useKeybind.d.ts +4 -0
  58. package/dist/hooks/useMediaQuery.d.ts +5 -0
  59. package/dist/hooks/usePersisted.d.ts +5 -0
  60. package/dist/hooks/useResizeObserver.d.ts +9 -0
  61. package/dist/index.d.ts +7 -0
  62. package/dist/index.js +226 -0
  63. package/dist/index10.js +92 -0
  64. package/dist/index11.js +101 -0
  65. package/dist/index12.js +113 -0
  66. package/dist/index13.js +82 -0
  67. package/dist/index14.js +123 -0
  68. package/dist/index15.js +106 -0
  69. package/dist/index16.js +131 -0
  70. package/dist/index17.js +152 -0
  71. package/dist/index18.js +41 -0
  72. package/dist/index19.js +61 -0
  73. package/dist/index2.js +215 -0
  74. package/dist/index20.js +79 -0
  75. package/dist/index21.js +162 -0
  76. package/dist/index22.js +293 -0
  77. package/dist/index23.js +136 -0
  78. package/dist/index24.js +45 -0
  79. package/dist/index25.js +146 -0
  80. package/dist/index26.js +258 -0
  81. package/dist/index27.js +92 -0
  82. package/dist/index28.js +42 -0
  83. package/dist/index29.js +71 -0
  84. package/dist/index3.js +94 -0
  85. package/dist/index30.js +280 -0
  86. package/dist/index31.js +154 -0
  87. package/dist/index32.js +31 -0
  88. package/dist/index33.js +50 -0
  89. package/dist/index34.js +15 -0
  90. package/dist/index35.js +32 -0
  91. package/dist/index36.js +51 -0
  92. package/dist/index37.js +41 -0
  93. package/dist/index38.js +28 -0
  94. package/dist/index39.js +176 -0
  95. package/dist/index4.js +55 -0
  96. package/dist/index40.js +43 -0
  97. package/dist/index41.js +69 -0
  98. package/dist/index42.js +99 -0
  99. package/dist/index43.js +120 -0
  100. package/dist/index44.js +141 -0
  101. package/dist/index45.js +42 -0
  102. package/dist/index46.js +386 -0
  103. package/dist/index47.js +16 -0
  104. package/dist/index48.js +13 -0
  105. package/dist/index49.js +19 -0
  106. package/dist/index5.js +48 -0
  107. package/dist/index50.js +13 -0
  108. package/dist/index51.js +11 -0
  109. package/dist/index52.js +59 -0
  110. package/dist/index53.js +8 -0
  111. package/dist/index54.js +6 -0
  112. package/dist/index55.js +48 -0
  113. package/dist/index56.js +29 -0
  114. package/dist/index57.js +35 -0
  115. package/dist/index58.js +94 -0
  116. package/dist/index59.js +25 -0
  117. package/dist/index6.js +73 -0
  118. package/dist/index60.js +49 -0
  119. package/dist/index61.js +17 -0
  120. package/dist/index62.js +38 -0
  121. package/dist/index63.js +67 -0
  122. package/dist/index64.js +87 -0
  123. package/dist/index65.js +17 -0
  124. package/dist/index66.js +2266 -0
  125. package/dist/index7.js +112 -0
  126. package/dist/index8.js +66 -0
  127. package/dist/index9.js +33 -0
  128. package/dist/styles/build.d.ts +1 -0
  129. package/dist/styles/themes/index.d.ts +9 -0
  130. package/dist/styles.css +1 -0
  131. package/dist/styles.js +1 -0
  132. package/dist/utils/animations.d.ts +222 -0
  133. package/dist/utils/bodyStyleLock.d.ts +9 -0
  134. package/dist/utils/cn.d.ts +5 -0
  135. package/dist/utils/defer.d.ts +5 -0
  136. package/dist/utils/gridCollision.d.ts +31 -0
  137. package/dist/utils/gridLayout.d.ts +38 -0
  138. package/dist/utils/index.d.ts +8 -0
  139. package/dist/utils/keybind.d.ts +22 -0
  140. package/dist/utils/persist.d.ts +17 -0
  141. package/dist/widgets/MetricsWidget.d.ts +5 -0
  142. package/dist/widgets/SidebarWidget.d.ts +11 -0
  143. package/dist/widgets/TerminalWidget.d.ts +5 -0
  144. package/dist/widgets/index.d.ts +3 -0
  145. package/package.json +40 -0
@@ -0,0 +1,141 @@
1
+ import { createSignal as C } from "solid-js";
2
+ import { createSimpleContext as w } from "./index38.js";
3
+ import { useResolvedFloeConfig as b } from "./index39.js";
4
+ import { useTheme as v } from "./index40.js";
5
+ import { useLayout as M } from "./index41.js";
6
+ import { useCommand as S } from "./index42.js";
7
+ import { useNotification as x } from "./index43.js";
8
+ import { deferNonBlocking as A } from "./index54.js";
9
+ function R(s) {
10
+ const r = `[${s}]`;
11
+ return {
12
+ debug: (...o) => console.debug(r, ...o),
13
+ info: (...o) => console.info(r, ...o),
14
+ warn: (...o) => console.warn(r, ...o),
15
+ error: (...o) => console.error(r, ...o)
16
+ };
17
+ }
18
+ function B(s, r) {
19
+ const o = `component:${r}:`;
20
+ return {
21
+ get: (a, u) => s.load(o + a, u),
22
+ set: (a, u) => s.debouncedSave(o + a, u),
23
+ remove: (a) => A(() => s.remove(o + a))
24
+ };
25
+ }
26
+ function J() {
27
+ const s = v(), r = M(), o = S(), a = x(), u = b();
28
+ return (g, f) => ({
29
+ protocol: f == null ? void 0 : f.protocol,
30
+ theme: s,
31
+ layout: r,
32
+ commands: o,
33
+ notifications: a,
34
+ storage: B(u.persist, g),
35
+ logger: R(g)
36
+ });
37
+ }
38
+ const h = w({
39
+ name: "ComponentRegistry",
40
+ init: k
41
+ }), K = h.Provider;
42
+ function O() {
43
+ return h.use();
44
+ }
45
+ function k() {
46
+ const [s, r] = C(/* @__PURE__ */ new Map()), [o, a] = C(/* @__PURE__ */ new Set()), u = /* @__PURE__ */ new Map(), g = (t) => {
47
+ r((e) => new Map(e).set(t.id, t));
48
+ }, f = (t) => {
49
+ r((e) => {
50
+ const n = new Map(e);
51
+ return t.forEach((c) => n.set(c.id, c)), n;
52
+ });
53
+ }, y = async (t, e) => {
54
+ var p, l;
55
+ const n = s().get(t);
56
+ if (!n || o().has(t)) return;
57
+ const c = [];
58
+ try {
59
+ if ((p = n.commands) != null && p.length) {
60
+ const m = n.commands.map((i) => ({
61
+ id: i.id,
62
+ title: i.title,
63
+ description: i.description,
64
+ icon: i.icon,
65
+ keybind: i.keybind,
66
+ category: i.category,
67
+ execute: () => i.execute(e)
68
+ }));
69
+ c.push(e.commands.registerAll(m));
70
+ }
71
+ await ((l = n.onMount) == null ? void 0 : l.call(n, e)), c.length && u.set(t, () => c.forEach((m) => m())), a((m) => {
72
+ const i = new Set(m);
73
+ return i.add(t), i;
74
+ });
75
+ } catch (m) {
76
+ throw c.forEach((i) => i()), m;
77
+ }
78
+ }, d = async (t) => {
79
+ var n, c;
80
+ const e = s().get(t);
81
+ if (e && o().has(t))
82
+ try {
83
+ await ((n = e.onUnmount) == null ? void 0 : n.call(e));
84
+ } finally {
85
+ (c = u.get(t)) == null || c(), u.delete(t), a((p) => {
86
+ const l = new Set(p);
87
+ return l.delete(t), l;
88
+ });
89
+ }
90
+ };
91
+ return {
92
+ register: g,
93
+ registerAll: f,
94
+ unregister: async (t) => {
95
+ await d(t), r((e) => {
96
+ const n = new Map(e);
97
+ return n.delete(t), n;
98
+ });
99
+ },
100
+ mount: y,
101
+ unmount: d,
102
+ mountAll: async (t) => {
103
+ for (const e of s().keys())
104
+ await y(e, t(e));
105
+ },
106
+ unmountAll: async () => {
107
+ for (const t of o())
108
+ await d(t);
109
+ },
110
+ components: s,
111
+ mountedComponents: o,
112
+ sidebarItems: () => {
113
+ const t = [];
114
+ for (const e of s().values())
115
+ e.sidebar && t.push({
116
+ ...e,
117
+ order: e.sidebar.order ?? 100
118
+ });
119
+ return t.sort((e, n) => e.order - n.order);
120
+ },
121
+ allCommands: () => {
122
+ const t = [];
123
+ for (const e of s().values())
124
+ e.commands && t.push(...e.commands);
125
+ return t;
126
+ },
127
+ statusBarItems: () => {
128
+ const t = [];
129
+ for (const e of s().values())
130
+ e.statusBar && t.push(...e.statusBar);
131
+ return t;
132
+ },
133
+ getComponent: (t) => s().get(t)
134
+ };
135
+ }
136
+ export {
137
+ K as ComponentRegistryProvider,
138
+ k as createComponentRegistry,
139
+ J as useComponentContextFactory,
140
+ O as useComponentRegistry
141
+ };
@@ -0,0 +1,42 @@
1
+ import { createSignal as n } from "solid-js";
2
+ import { createSimpleContext as o } from "./index38.js";
3
+ const {
4
+ Provider: f,
5
+ use: m
6
+ } = o({
7
+ name: "WidgetRegistry",
8
+ init: c
9
+ });
10
+ function c() {
11
+ const [s, i] = n(/* @__PURE__ */ new Map());
12
+ return {
13
+ register: (e) => {
14
+ i((t) => new Map(t).set(e.type, e));
15
+ },
16
+ registerAll: (e) => {
17
+ i((t) => {
18
+ const r = new Map(t);
19
+ return e.forEach((g) => r.set(g.type, g)), r;
20
+ });
21
+ },
22
+ unregister: (e) => {
23
+ i((t) => {
24
+ const r = new Map(t);
25
+ return r.delete(e), r;
26
+ });
27
+ },
28
+ widgets: s,
29
+ getWidget: (e) => s().get(e),
30
+ getWidgetsByCategory: (e) => {
31
+ const t = [];
32
+ for (const r of s().values())
33
+ r.category === e && t.push(r);
34
+ return t;
35
+ }
36
+ };
37
+ }
38
+ export {
39
+ f as WidgetRegistryProvider,
40
+ c as createWidgetRegistry,
41
+ m as useWidgetRegistry
42
+ };
@@ -0,0 +1,386 @@
1
+ import { createSignal as I, createEffect as T } from "solid-js";
2
+ import { createStore as E, produce as r } from "solid-js/store";
3
+ import { createSimpleContext as h } from "./index38.js";
4
+ import { useResolvedFloeConfig as W } from "./index39.js";
5
+ import { hasCollision as g, constrainPosition as F, findFreePosition as k } from "./index59.js";
6
+ const z = [{
7
+ id: "preset-default",
8
+ name: "Default",
9
+ isPreset: !0,
10
+ widgets: [{
11
+ id: "w1",
12
+ type: "metrics",
13
+ position: {
14
+ col: 0,
15
+ row: 0,
16
+ colSpan: 12,
17
+ rowSpan: 6
18
+ }
19
+ }, {
20
+ id: "w2",
21
+ type: "terminal",
22
+ position: {
23
+ col: 12,
24
+ row: 0,
25
+ colSpan: 12,
26
+ rowSpan: 6
27
+ }
28
+ }, {
29
+ id: "w3",
30
+ type: "metrics",
31
+ position: {
32
+ col: 0,
33
+ row: 6,
34
+ colSpan: 24,
35
+ rowSpan: 6
36
+ }
37
+ }],
38
+ createdAt: Date.now(),
39
+ updatedAt: Date.now()
40
+ }, {
41
+ id: "preset-focus",
42
+ name: "Focus",
43
+ isPreset: !0,
44
+ widgets: [{
45
+ id: "w1",
46
+ type: "terminal",
47
+ position: {
48
+ col: 0,
49
+ row: 0,
50
+ colSpan: 24,
51
+ rowSpan: 12
52
+ }
53
+ }],
54
+ createdAt: Date.now(),
55
+ updatedAt: Date.now()
56
+ }, {
57
+ id: "preset-monitoring",
58
+ name: "Monitoring",
59
+ isPreset: !0,
60
+ widgets: [{
61
+ id: "w1",
62
+ type: "metrics",
63
+ position: {
64
+ col: 0,
65
+ row: 0,
66
+ colSpan: 12,
67
+ rowSpan: 6
68
+ }
69
+ }, {
70
+ id: "w2",
71
+ type: "metrics",
72
+ position: {
73
+ col: 12,
74
+ row: 0,
75
+ colSpan: 12,
76
+ rowSpan: 6
77
+ }
78
+ }, {
79
+ id: "w3",
80
+ type: "metrics",
81
+ position: {
82
+ col: 0,
83
+ row: 6,
84
+ colSpan: 12,
85
+ rowSpan: 6
86
+ }
87
+ }, {
88
+ id: "w4",
89
+ type: "metrics",
90
+ position: {
91
+ col: 12,
92
+ row: 6,
93
+ colSpan: 12,
94
+ rowSpan: 6
95
+ }
96
+ }],
97
+ createdAt: Date.now(),
98
+ updatedAt: Date.now()
99
+ }, {
100
+ id: "preset-development",
101
+ name: "Development",
102
+ isPreset: !0,
103
+ widgets: [{
104
+ id: "w1",
105
+ type: "terminal",
106
+ position: {
107
+ col: 0,
108
+ row: 0,
109
+ colSpan: 12,
110
+ rowSpan: 6
111
+ }
112
+ }, {
113
+ id: "w2",
114
+ type: "terminal",
115
+ position: {
116
+ col: 12,
117
+ row: 0,
118
+ colSpan: 12,
119
+ rowSpan: 6
120
+ }
121
+ }, {
122
+ id: "w3",
123
+ type: "metrics",
124
+ position: {
125
+ col: 0,
126
+ row: 6,
127
+ colSpan: 24,
128
+ rowSpan: 6
129
+ }
130
+ }],
131
+ createdAt: Date.now(),
132
+ updatedAt: Date.now()
133
+ }], U = {
134
+ activeLayoutId: "preset-default"
135
+ }, P = {
136
+ metrics: {
137
+ minColSpan: 6,
138
+ minRowSpan: 4
139
+ },
140
+ terminal: {
141
+ minColSpan: 8,
142
+ minRowSpan: 4
143
+ }
144
+ }, {
145
+ Provider: q,
146
+ use: B
147
+ } = h({
148
+ name: "Deck",
149
+ init: _
150
+ });
151
+ function _() {
152
+ const w = W(), S = () => w.config.deck.storageKey, m = w.persist.load(S(), {}), M = (m.layouts ?? []).filter((o) => !o.isPreset), R = {
153
+ layouts: [...z, ...M],
154
+ activeLayoutId: m.activeLayoutId ?? U.activeLayoutId,
155
+ editMode: !1
156
+ }, [s, d] = E(R), [v, p] = I(null), [D, f] = I(null);
157
+ T(() => {
158
+ const o = {
159
+ layouts: s.layouts,
160
+ activeLayoutId: s.activeLayoutId
161
+ };
162
+ w.persist.debouncedSave(S(), o);
163
+ });
164
+ const u = () => s.layouts.find((o) => o.id === s.activeLayoutId), l = () => `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
165
+ return {
166
+ // Layout management
167
+ layouts: () => s.layouts,
168
+ activeLayoutId: () => s.activeLayoutId,
169
+ activeLayout: u,
170
+ setActiveLayout: (o) => {
171
+ s.layouts.some((t) => t.id === o) && d("activeLayoutId", o);
172
+ },
173
+ createLayout: (o, t) => {
174
+ const a = {
175
+ id: l(),
176
+ name: o,
177
+ widgets: t ?? [],
178
+ createdAt: Date.now(),
179
+ updatedAt: Date.now()
180
+ };
181
+ return d(r((i) => {
182
+ i.layouts.push(a), i.activeLayoutId = a.id;
183
+ })), a;
184
+ },
185
+ duplicateLayout: (o, t) => {
186
+ const a = s.layouts.find((e) => e.id === o);
187
+ if (!a) return;
188
+ const i = {
189
+ id: l(),
190
+ name: t,
191
+ widgets: a.widgets.map((e) => ({
192
+ ...e,
193
+ id: l()
194
+ })),
195
+ createdAt: Date.now(),
196
+ updatedAt: Date.now()
197
+ };
198
+ return d(r((e) => {
199
+ e.layouts.push(i), e.activeLayoutId = i.id;
200
+ })), i;
201
+ },
202
+ deleteLayout: (o) => {
203
+ const t = s.layouts.find((a) => a.id === o);
204
+ !t || t.isPreset || d(r((a) => {
205
+ const i = a.layouts.findIndex((e) => e.id === o);
206
+ i !== -1 && (a.layouts.splice(i, 1), a.activeLayoutId === o && (a.activeLayoutId = "preset-default"));
207
+ }));
208
+ },
209
+ renameLayout: (o, t) => {
210
+ const a = s.layouts.find((i) => i.id === o);
211
+ !a || a.isPreset || d(r((i) => {
212
+ const e = i.layouts.find((n) => n.id === o);
213
+ e && (e.name = t, e.updatedAt = Date.now());
214
+ }));
215
+ },
216
+ // Edit mode
217
+ editMode: () => s.editMode,
218
+ setEditMode: (o) => d("editMode", o),
219
+ toggleEditMode: () => d("editMode", !s.editMode),
220
+ // Widget management
221
+ addWidget: (o, t, a) => {
222
+ const i = u();
223
+ if (!i) return;
224
+ const e = P[o] ?? {
225
+ minColSpan: 2,
226
+ minRowSpan: 2
227
+ }, n = {
228
+ colSpan: (t == null ? void 0 : t.colSpan) ?? Math.max(e.minColSpan, 4),
229
+ rowSpan: (t == null ? void 0 : t.rowSpan) ?? Math.max(e.minRowSpan, 3)
230
+ }, c = (t == null ? void 0 : t.col) !== void 0 && (t == null ? void 0 : t.row) !== void 0 ? F({
231
+ ...n,
232
+ col: t.col,
233
+ row: t.row
234
+ }, e.minColSpan, e.minRowSpan) : k(i.widgets, n.colSpan, n.rowSpan), L = l(), C = {
235
+ id: L,
236
+ type: o,
237
+ position: c,
238
+ config: a
239
+ };
240
+ return d(r((A) => {
241
+ const y = A.layouts.find((x) => x.id === A.activeLayoutId);
242
+ y && (y.widgets.push(C), y.updatedAt = Date.now());
243
+ })), L;
244
+ },
245
+ removeWidget: (o) => {
246
+ d(r((t) => {
247
+ const a = t.layouts.find((i) => i.id === t.activeLayoutId);
248
+ if (a) {
249
+ const i = a.widgets.findIndex((e) => e.id === o);
250
+ i !== -1 && (a.widgets.splice(i, 1), a.updatedAt = Date.now());
251
+ }
252
+ }));
253
+ },
254
+ updateWidgetPosition: (o, t) => {
255
+ d(r((a) => {
256
+ const i = a.layouts.find((e) => e.id === a.activeLayoutId);
257
+ if (i) {
258
+ const e = i.widgets.find((n) => n.id === o);
259
+ e && (g(t, i.widgets, o) || (e.position = t, i.updatedAt = Date.now()));
260
+ }
261
+ }));
262
+ },
263
+ updateWidgetConfig: (o, t) => {
264
+ d(r((a) => {
265
+ const i = a.layouts.find((e) => e.id === a.activeLayoutId);
266
+ if (i) {
267
+ const e = i.widgets.find((n) => n.id === o);
268
+ e && (e.config = {
269
+ ...e.config,
270
+ ...t
271
+ }, i.updatedAt = Date.now());
272
+ }
273
+ }));
274
+ },
275
+ updateWidgetTitle: (o, t) => {
276
+ d(r((a) => {
277
+ const i = a.layouts.find((e) => e.id === a.activeLayoutId);
278
+ if (i) {
279
+ const e = i.widgets.find((n) => n.id === o);
280
+ e && (e.title = t, i.updatedAt = Date.now());
281
+ }
282
+ }));
283
+ },
284
+ changeWidgetType: (o, t) => {
285
+ d(r((a) => {
286
+ const i = a.layouts.find((e) => e.id === a.activeLayoutId);
287
+ if (i) {
288
+ const e = i.widgets.find((n) => n.id === o);
289
+ e && (e.type = t, e.config = void 0, e.title = void 0, i.updatedAt = Date.now());
290
+ }
291
+ }));
292
+ },
293
+ // Drag state
294
+ dragState: v,
295
+ startDrag: (o, t, a) => {
296
+ const i = u(), e = i == null ? void 0 : i.widgets.find((n) => n.id === o);
297
+ e && p({
298
+ widgetId: o,
299
+ originalPosition: {
300
+ ...e.position
301
+ },
302
+ currentPosition: {
303
+ ...e.position
304
+ },
305
+ pixelOffset: {
306
+ x: 0,
307
+ y: 0
308
+ },
309
+ startX: t,
310
+ startY: a
311
+ });
312
+ },
313
+ updateDrag: (o, t) => {
314
+ p((a) => a ? {
315
+ ...a,
316
+ currentPosition: o,
317
+ pixelOffset: t
318
+ } : null);
319
+ },
320
+ endDrag: (o) => {
321
+ const t = v();
322
+ if (t) {
323
+ if (o) {
324
+ const a = u();
325
+ a && !g(t.currentPosition, a.widgets, t.widgetId) && d(r((i) => {
326
+ const e = i.layouts.find((n) => n.id === i.activeLayoutId);
327
+ if (e) {
328
+ const n = e.widgets.find((c) => c.id === t.widgetId);
329
+ n && (n.position = t.currentPosition, e.updatedAt = Date.now());
330
+ }
331
+ }));
332
+ }
333
+ p(null);
334
+ }
335
+ },
336
+ // Resize state
337
+ resizeState: D,
338
+ startResize: (o, t, a, i) => {
339
+ const e = u(), n = e == null ? void 0 : e.widgets.find((c) => c.id === o);
340
+ n && f({
341
+ widgetId: o,
342
+ edge: t,
343
+ originalPosition: {
344
+ ...n.position
345
+ },
346
+ currentPosition: {
347
+ ...n.position
348
+ },
349
+ startX: a,
350
+ startY: i
351
+ });
352
+ },
353
+ updateResize: (o) => {
354
+ f((t) => t ? {
355
+ ...t,
356
+ currentPosition: o
357
+ } : null);
358
+ },
359
+ endResize: (o) => {
360
+ const t = D();
361
+ if (t) {
362
+ if (o) {
363
+ const a = u();
364
+ a && !g(t.currentPosition, a.widgets, t.widgetId) && d(r((i) => {
365
+ const e = i.layouts.find((n) => n.id === i.activeLayoutId);
366
+ if (e) {
367
+ const n = e.widgets.find((c) => c.id === t.widgetId);
368
+ n && (n.position = t.currentPosition, e.updatedAt = Date.now());
369
+ }
370
+ }));
371
+ }
372
+ f(null);
373
+ }
374
+ },
375
+ // Utilities
376
+ getWidgetMinConstraints: (o) => P[o] ?? {
377
+ minColSpan: 2,
378
+ minRowSpan: 2
379
+ }
380
+ };
381
+ }
382
+ export {
383
+ q as DeckProvider,
384
+ _ as createDeckService,
385
+ B as useDeck
386
+ };
@@ -0,0 +1,16 @@
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;
13
+ }
14
+ export {
15
+ h as useMediaQuery
16
+ };
@@ -0,0 +1,13 @@
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;
10
+ }
11
+ export {
12
+ s as useDebounce
13
+ };
@@ -0,0 +1,19 @@
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;
16
+ }
17
+ export {
18
+ b as useResizeObserver
19
+ };
package/dist/index5.js ADDED
@@ -0,0 +1,48 @@
1
+ import { delegateEvents as $, template as i, insert as t, createComponent as a, effect as k, className as g } from "solid-js/web";
2
+ import { Show as h } from "solid-js";
3
+ import { cn as x } from "./index53.js";
4
+ import { useCommand as y } from "./index42.js";
5
+ import { Search as _ } from "./index30.js";
6
+ import { useResolvedFloeConfig as w } from "./index39.js";
7
+ var C = /* @__PURE__ */ i('<span class="font-medium text-xs hidden sm:inline">'), S = /* @__PURE__ */ i('<kbd class="hidden md:inline text-[10px] px-1 py-0.5 rounded bg-background/80 border border-border/50 font-mono shrink-0">'), B = /* @__PURE__ */ i('<header><div class="h-10 flex items-center gap-3 px-3"><div class="flex items-center gap-2 flex-shrink-0"></div><button type=button><span class="flex-1 text-left hidden sm:inline truncate"></span></button><div class="flex items-center gap-1">'), E = /* @__PURE__ */ i('<div class="w-6 h-6 rounded bg-primary flex items-center justify-center text-primary-foreground text-xs font-bold">F');
8
+ function R(n) {
9
+ const c = y(), l = w(), o = () => l.config.commands.palette.enabled;
10
+ return (() => {
11
+ var s = B(), p = s.firstChild, d = p.firstChild, r = d.nextSibling, m = r.firstChild, v = r.nextSibling;
12
+ return t(d, () => n.logo || E(), null), t(d, a(h, {
13
+ get when() {
14
+ return n.title;
15
+ },
16
+ get children() {
17
+ var e = C();
18
+ return t(e, () => n.title), e;
19
+ }
20
+ }), null), r.$$click = () => o() && c.open(), t(r, a(_, {
21
+ class: "w-3.5 h-3.5 shrink-0"
22
+ }), m), t(m, () => l.config.strings.topBar.searchPlaceholder), t(r, a(h, {
23
+ get when() {
24
+ return o();
25
+ },
26
+ get children() {
27
+ var e = S();
28
+ return t(e, () => c.getKeybindDisplay(l.config.commands.palette.keybind)), e;
29
+ }
30
+ }), null), t(v, () => n.actions), k((e) => {
31
+ var f = x(
32
+ // Safe-area padding must not be applied on a fixed-height element (border-box),
33
+ // otherwise the content gets squeezed on iOS notch devices.
34
+ "shrink-0 bg-background border-b border-border safe-top safe-left safe-right",
35
+ n.class
36
+ ), u = !o(), b = x("flex-1 max-w-sm flex items-center gap-2 h-7 px-2.5", o() ? "cursor-pointer" : "cursor-not-allowed", "text-xs text-muted-foreground", "bg-muted/40 hover:bg-muted/70 rounded", "border border-transparent hover:border-border/50", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", !o() && "opacity-60 hover:bg-muted/40");
37
+ return f !== e.e && g(s, e.e = f), u !== e.t && (r.disabled = e.t = u), b !== e.a && g(r, e.a = b), e;
38
+ }, {
39
+ e: void 0,
40
+ t: void 0,
41
+ a: void 0
42
+ }), s;
43
+ })();
44
+ }
45
+ $(["click"]);
46
+ export {
47
+ R as TopBar
48
+ };
@@ -0,0 +1,13 @@
1
+ import { onMount as d, onCleanup as i } from "solid-js";
2
+ import { matchKeybind as r } from "./index56.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
+ });
10
+ }
11
+ export {
12
+ a as useKeybind
13
+ };
@@ -0,0 +1,11 @@
1
+ import { createSignal as n, createEffect as a } from "solid-js";
2
+ import { useResolvedFloeConfig as c } from "./index39.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];
8
+ }
9
+ export {
10
+ u as usePersisted
11
+ };