@floegence/floe-webapp-core 0.1.13 → 0.1.14
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/dist/context/DeckContext.d.ts +6 -0
- package/dist/context/WidgetStateContext.d.ts +47 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/index.js +178 -173
- package/dist/index10.js +2 -2
- package/dist/index11.js +50 -38
- package/dist/index12.js +1 -1
- package/dist/index13.js +3 -3
- package/dist/index14.js +2 -2
- package/dist/index15.js +2 -2
- package/dist/index16.js +2 -2
- package/dist/index17.js +2 -2
- package/dist/index18.js +2 -2
- package/dist/index19.js +1 -1
- package/dist/index2.js +3 -3
- package/dist/index20.js +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.js +2 -2
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +2 -2
- package/dist/index26.js +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.js +1 -1
- package/dist/index37.js +1 -1
- package/dist/index39.js +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.js +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.js +1 -1
- package/dist/index43.js +1 -1
- package/dist/index44.js +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.js +1 -1
- package/dist/index52.js +2 -2
- package/dist/index53.js +1 -1
- package/dist/index54.js +1 -1
- package/dist/index56.js +92 -79
- package/dist/index57.js +38 -13
- package/dist/index58.js +13 -10
- package/dist/index59.js +10 -16
- package/dist/index6.js +1 -1
- package/dist/index60.js +16 -10
- package/dist/index61.js +10 -8
- package/dist/index62.js +8 -58
- package/dist/index63.js +58 -5
- package/dist/index64.js +5 -3
- package/dist/index65.js +3 -45
- package/dist/index66.js +42 -23
- package/dist/index67.js +24 -30
- package/dist/index68.js +31 -90
- package/dist/index69.js +91 -22
- package/dist/index7.js +1 -1
- package/dist/index70.js +19 -43
- package/dist/index71.js +45 -13
- package/dist/index72.js +14 -35
- package/dist/index73.js +33 -62
- package/dist/index74.js +61 -81
- package/dist/index75.js +84 -14
- package/dist/index76.js +12 -2261
- package/dist/index77.js +2262 -6
- package/dist/index78.js +10 -0
- package/dist/index8.js +2 -2
- package/dist/index9.js +1 -1
- package/package.json +1 -1
package/dist/index56.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { createStore as O, produce as
|
|
1
|
+
import { createSignal as W, createEffect as B } from "solid-js";
|
|
2
|
+
import { createStore as O, produce as c } from "solid-js/store";
|
|
3
3
|
import { createSimpleContext as j } from "./index48.js";
|
|
4
4
|
import { useResolvedFloeConfig as q } from "./index49.js";
|
|
5
5
|
import { useWidgetRegistry as G } from "./index55.js";
|
|
6
|
-
import { hasCollision as I, constrainPosition as H, findFreePosition as J } from "./
|
|
6
|
+
import { hasCollision as I, constrainPosition as H, findFreePosition as J } from "./index70.js";
|
|
7
7
|
function N() {
|
|
8
8
|
const d = Date.now();
|
|
9
9
|
return [{
|
|
@@ -162,85 +162,85 @@ const {
|
|
|
162
162
|
});
|
|
163
163
|
function U() {
|
|
164
164
|
var R;
|
|
165
|
-
const d = q(), f = G(), p = () => d.config.deck.storageKey, l = Q(d.config.deck.presets),
|
|
165
|
+
const d = q(), f = G(), p = () => d.config.deck.storageKey, l = Q(d.config.deck.presets), x = new Set(l.map((i) => i.id)), y = d.persist.load(p(), {}), A = y.layouts ?? [], k = new Map(A.map((i) => [i.id, i])), z = l.map((i) => {
|
|
166
166
|
const t = k.get(i.id);
|
|
167
167
|
return t ? {
|
|
168
168
|
...t,
|
|
169
169
|
isPreset: i.isPreset
|
|
170
170
|
} : i;
|
|
171
|
-
}), E = A.filter((i) => !i.isPreset && !
|
|
171
|
+
}), E = A.filter((i) => !i.isPreset && !x.has(i.id)), m = [...z, ...E], D = new Set(m.map((i) => i.id)), F = y.activeLayoutId && D.has(y.activeLayoutId) ? y.activeLayoutId : d.config.deck.defaultActiveLayoutId && D.has(d.config.deck.defaultActiveLayoutId) ? d.config.deck.defaultActiveLayoutId : ((R = m[0]) == null ? void 0 : R.id) ?? "", b = {
|
|
172
172
|
layouts: m,
|
|
173
173
|
activeLayoutId: F,
|
|
174
174
|
editMode: !1
|
|
175
|
-
}, [
|
|
175
|
+
}, [r, s] = O(b), [P, S] = W(null), [M, v] = W(null);
|
|
176
176
|
B(() => {
|
|
177
177
|
const i = {
|
|
178
|
-
layouts:
|
|
179
|
-
activeLayoutId:
|
|
178
|
+
layouts: r.layouts,
|
|
179
|
+
activeLayoutId: r.activeLayoutId
|
|
180
180
|
};
|
|
181
181
|
d.persist.debouncedSave(p(), i);
|
|
182
182
|
});
|
|
183
|
-
const w = () =>
|
|
183
|
+
const w = () => r.layouts.find((i) => i.id === r.activeLayoutId), g = () => `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
184
184
|
return {
|
|
185
185
|
// Layout management
|
|
186
|
-
layouts: () =>
|
|
187
|
-
activeLayoutId: () =>
|
|
186
|
+
layouts: () => r.layouts,
|
|
187
|
+
activeLayoutId: () => r.activeLayoutId,
|
|
188
188
|
activeLayout: w,
|
|
189
189
|
setActiveLayout: (i) => {
|
|
190
|
-
|
|
190
|
+
r.layouts.some((t) => t.id === i) && s("activeLayoutId", i);
|
|
191
191
|
},
|
|
192
192
|
createLayout: (i, t) => {
|
|
193
|
-
const
|
|
193
|
+
const o = {
|
|
194
194
|
id: g(),
|
|
195
195
|
name: i,
|
|
196
196
|
widgets: t ?? [],
|
|
197
197
|
createdAt: Date.now(),
|
|
198
198
|
updatedAt: Date.now()
|
|
199
199
|
};
|
|
200
|
-
return s(
|
|
201
|
-
|
|
202
|
-
})),
|
|
200
|
+
return s(c((n) => {
|
|
201
|
+
n.layouts.push(o), n.activeLayoutId = o.id;
|
|
202
|
+
})), o;
|
|
203
203
|
},
|
|
204
204
|
duplicateLayout: (i, t) => {
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
const
|
|
205
|
+
const o = r.layouts.find((e) => e.id === i);
|
|
206
|
+
if (!o) return;
|
|
207
|
+
const n = {
|
|
208
208
|
id: g(),
|
|
209
209
|
name: t,
|
|
210
|
-
widgets:
|
|
210
|
+
widgets: o.widgets.map((e) => ({
|
|
211
211
|
...e,
|
|
212
212
|
id: g()
|
|
213
213
|
})),
|
|
214
214
|
createdAt: Date.now(),
|
|
215
215
|
updatedAt: Date.now()
|
|
216
216
|
};
|
|
217
|
-
return s(
|
|
218
|
-
e.layouts.push(
|
|
219
|
-
})),
|
|
217
|
+
return s(c((e) => {
|
|
218
|
+
e.layouts.push(n), e.activeLayoutId = n.id;
|
|
219
|
+
})), n;
|
|
220
220
|
},
|
|
221
221
|
deleteLayout: (i) => {
|
|
222
|
-
const t =
|
|
223
|
-
!t || t.isPreset || s(
|
|
222
|
+
const t = r.layouts.find((o) => o.id === i);
|
|
223
|
+
!t || t.isPreset || s(c((o) => {
|
|
224
224
|
var e;
|
|
225
|
-
const
|
|
226
|
-
|
|
225
|
+
const n = o.layouts.findIndex((a) => a.id === i);
|
|
226
|
+
n !== -1 && (o.layouts.splice(n, 1), o.activeLayoutId === i && (o.activeLayoutId = ((e = o.layouts[0]) == null ? void 0 : e.id) ?? ""));
|
|
227
227
|
}));
|
|
228
228
|
},
|
|
229
229
|
renameLayout: (i, t) => {
|
|
230
|
-
const
|
|
231
|
-
!
|
|
232
|
-
const e =
|
|
230
|
+
const o = r.layouts.find((n) => n.id === i);
|
|
231
|
+
!o || o.isPreset || s(c((n) => {
|
|
232
|
+
const e = n.layouts.find((a) => a.id === i);
|
|
233
233
|
e && (e.name = t, e.updatedAt = Date.now());
|
|
234
234
|
}));
|
|
235
235
|
},
|
|
236
236
|
// Edit mode
|
|
237
|
-
editMode: () =>
|
|
237
|
+
editMode: () => r.editMode,
|
|
238
238
|
setEditMode: (i) => s("editMode", i),
|
|
239
|
-
toggleEditMode: () => s("editMode", !
|
|
239
|
+
toggleEditMode: () => s("editMode", !r.editMode),
|
|
240
240
|
// Widget management
|
|
241
|
-
addWidget: (i, t,
|
|
242
|
-
const
|
|
243
|
-
if (!
|
|
241
|
+
addWidget: (i, t, o) => {
|
|
242
|
+
const n = w();
|
|
243
|
+
if (!n) return;
|
|
244
244
|
const e = f.getWidget(i), a = {
|
|
245
245
|
minColSpan: (e == null ? void 0 : e.minColSpan) ?? 2,
|
|
246
246
|
minRowSpan: (e == null ? void 0 : e.minRowSpan) ?? 2
|
|
@@ -251,69 +251,82 @@ function U() {
|
|
|
251
251
|
...u,
|
|
252
252
|
col: t.col,
|
|
253
253
|
row: t.row
|
|
254
|
-
}, a.minColSpan, a.minRowSpan) : J(
|
|
254
|
+
}, a.minColSpan, a.minRowSpan) : J(n.widgets, u.colSpan, u.rowSpan), h = g(), T = {
|
|
255
255
|
id: h,
|
|
256
256
|
type: i,
|
|
257
257
|
position: K,
|
|
258
|
-
config:
|
|
258
|
+
config: o
|
|
259
259
|
};
|
|
260
|
-
return s(
|
|
260
|
+
return s(c((C) => {
|
|
261
261
|
const L = C.layouts.find(($) => $.id === C.activeLayoutId);
|
|
262
262
|
L && (L.widgets.push(T), L.updatedAt = Date.now());
|
|
263
263
|
})), h;
|
|
264
264
|
},
|
|
265
265
|
removeWidget: (i) => {
|
|
266
|
-
s(
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
270
|
-
|
|
266
|
+
s(c((t) => {
|
|
267
|
+
const o = t.layouts.find((n) => n.id === t.activeLayoutId);
|
|
268
|
+
if (o) {
|
|
269
|
+
const n = o.widgets.findIndex((e) => e.id === i);
|
|
270
|
+
n !== -1 && (o.widgets.splice(n, 1), o.updatedAt = Date.now());
|
|
271
271
|
}
|
|
272
272
|
}));
|
|
273
273
|
},
|
|
274
274
|
updateWidgetPosition: (i, t) => {
|
|
275
|
-
s(
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
const e =
|
|
279
|
-
e && (I(t,
|
|
275
|
+
s(c((o) => {
|
|
276
|
+
const n = o.layouts.find((e) => e.id === o.activeLayoutId);
|
|
277
|
+
if (n) {
|
|
278
|
+
const e = n.widgets.find((a) => a.id === i);
|
|
279
|
+
e && (I(t, n.widgets, i) || (e.position = t, n.updatedAt = Date.now()));
|
|
280
280
|
}
|
|
281
281
|
}));
|
|
282
282
|
},
|
|
283
283
|
updateWidgetConfig: (i, t) => {
|
|
284
|
-
s(
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
const e =
|
|
284
|
+
s(c((o) => {
|
|
285
|
+
const n = o.layouts.find((e) => e.id === o.activeLayoutId);
|
|
286
|
+
if (n) {
|
|
287
|
+
const e = n.widgets.find((a) => a.id === i);
|
|
288
288
|
e && (e.config = {
|
|
289
289
|
...e.config,
|
|
290
290
|
...t
|
|
291
|
-
},
|
|
291
|
+
}, n.updatedAt = Date.now());
|
|
292
292
|
}
|
|
293
293
|
}));
|
|
294
294
|
},
|
|
295
295
|
updateWidgetTitle: (i, t) => {
|
|
296
|
-
s(
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
299
|
-
const e =
|
|
300
|
-
e && (e.title = t,
|
|
296
|
+
s(c((o) => {
|
|
297
|
+
const n = o.layouts.find((e) => e.id === o.activeLayoutId);
|
|
298
|
+
if (n) {
|
|
299
|
+
const e = n.widgets.find((a) => a.id === i);
|
|
300
|
+
e && (e.title = t, n.updatedAt = Date.now());
|
|
301
301
|
}
|
|
302
302
|
}));
|
|
303
303
|
},
|
|
304
304
|
changeWidgetType: (i, t) => {
|
|
305
|
-
s(
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const e =
|
|
309
|
-
e && (e.type = t, e.config = void 0, e.title = void 0,
|
|
305
|
+
s(c((o) => {
|
|
306
|
+
const n = o.layouts.find((e) => e.id === o.activeLayoutId);
|
|
307
|
+
if (n) {
|
|
308
|
+
const e = n.widgets.find((a) => a.id === i);
|
|
309
|
+
e && (e.type = t, e.config = void 0, e.title = void 0, e.state = void 0, n.updatedAt = Date.now());
|
|
310
310
|
}
|
|
311
311
|
}));
|
|
312
312
|
},
|
|
313
|
+
updateWidgetState: (i, t, o) => {
|
|
314
|
+
s(c((n) => {
|
|
315
|
+
const e = n.layouts.find((a) => a.id === n.activeLayoutId);
|
|
316
|
+
if (e) {
|
|
317
|
+
const a = e.widgets.find((u) => u.id === i);
|
|
318
|
+
a && (a.state || (a.state = {}), a.state[t] = o, e.updatedAt = Date.now());
|
|
319
|
+
}
|
|
320
|
+
}));
|
|
321
|
+
},
|
|
322
|
+
getWidgetState: (i) => {
|
|
323
|
+
const t = w(), o = t == null ? void 0 : t.widgets.find((n) => n.id === i);
|
|
324
|
+
return (o == null ? void 0 : o.state) ?? {};
|
|
325
|
+
},
|
|
313
326
|
// Drag state
|
|
314
|
-
dragState:
|
|
315
|
-
startDrag: (i, t,
|
|
316
|
-
const
|
|
327
|
+
dragState: P,
|
|
328
|
+
startDrag: (i, t, o) => {
|
|
329
|
+
const n = w(), e = n == null ? void 0 : n.widgets.find((a) => a.id === i);
|
|
317
330
|
e && S({
|
|
318
331
|
widgetId: i,
|
|
319
332
|
originalPosition: {
|
|
@@ -327,23 +340,23 @@ function U() {
|
|
|
327
340
|
y: 0
|
|
328
341
|
},
|
|
329
342
|
startX: t,
|
|
330
|
-
startY:
|
|
343
|
+
startY: o
|
|
331
344
|
});
|
|
332
345
|
},
|
|
333
346
|
updateDrag: (i, t) => {
|
|
334
|
-
S((
|
|
335
|
-
...
|
|
347
|
+
S((o) => o ? {
|
|
348
|
+
...o,
|
|
336
349
|
currentPosition: i,
|
|
337
350
|
pixelOffset: t
|
|
338
351
|
} : null);
|
|
339
352
|
},
|
|
340
353
|
endDrag: (i) => {
|
|
341
|
-
const t =
|
|
354
|
+
const t = P();
|
|
342
355
|
if (t) {
|
|
343
356
|
if (i) {
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
const e =
|
|
357
|
+
const o = w();
|
|
358
|
+
o && !I(t.currentPosition, o.widgets, t.widgetId) && s(c((n) => {
|
|
359
|
+
const e = n.layouts.find((a) => a.id === n.activeLayoutId);
|
|
347
360
|
if (e) {
|
|
348
361
|
const a = e.widgets.find((u) => u.id === t.widgetId);
|
|
349
362
|
a && (a.position = t.currentPosition, e.updatedAt = Date.now());
|
|
@@ -355,7 +368,7 @@ function U() {
|
|
|
355
368
|
},
|
|
356
369
|
// Resize state
|
|
357
370
|
resizeState: M,
|
|
358
|
-
startResize: (i, t,
|
|
371
|
+
startResize: (i, t, o, n) => {
|
|
359
372
|
const e = w(), a = e == null ? void 0 : e.widgets.find((u) => u.id === i);
|
|
360
373
|
a && v({
|
|
361
374
|
widgetId: i,
|
|
@@ -366,8 +379,8 @@ function U() {
|
|
|
366
379
|
currentPosition: {
|
|
367
380
|
...a.position
|
|
368
381
|
},
|
|
369
|
-
startX:
|
|
370
|
-
startY:
|
|
382
|
+
startX: o,
|
|
383
|
+
startY: n
|
|
371
384
|
});
|
|
372
385
|
},
|
|
373
386
|
updateResize: (i) => {
|
|
@@ -380,9 +393,9 @@ function U() {
|
|
|
380
393
|
const t = M();
|
|
381
394
|
if (t) {
|
|
382
395
|
if (i) {
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
const e =
|
|
396
|
+
const o = w();
|
|
397
|
+
o && !I(t.currentPosition, o.widgets, t.widgetId) && s(c((n) => {
|
|
398
|
+
const e = n.layouts.find((a) => a.id === n.activeLayoutId);
|
|
386
399
|
if (e) {
|
|
387
400
|
const a = e.widgets.find((u) => u.id === t.widgetId);
|
|
388
401
|
a && (a.position = t.currentPosition, e.updatedAt = Date.now());
|
package/dist/index57.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
n(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
|
31
|
+
}];
|
|
32
|
+
}
|
|
33
|
+
function S() {
|
|
34
|
+
return u().widgetId;
|
|
13
35
|
}
|
|
14
36
|
export {
|
|
15
|
-
|
|
37
|
+
f as WidgetStateProvider,
|
|
38
|
+
S as useCurrentWidgetId,
|
|
39
|
+
w as useWidgetState,
|
|
40
|
+
u as useWidgetStateContext
|
|
16
41
|
};
|
package/dist/index58.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
function
|
|
3
|
-
const [o, n] =
|
|
4
|
-
return i(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
15
|
+
h as useMediaQuery
|
|
13
16
|
};
|
package/dist/index59.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
+
s as useDebounce
|
|
19
13
|
};
|
package/dist/index6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 "./
|
|
3
|
+
import { cn as m } from "./index64.js";
|
|
4
4
|
import { useResolvedFloeConfig as b } from "./index49.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) {
|
package/dist/index60.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { onMount as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
18
|
+
b as useResizeObserver
|
|
13
19
|
};
|
package/dist/index61.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { onMount as d, onCleanup as i } from "solid-js";
|
|
2
|
+
import { matchKeybind as r } from "./index67.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
|
-
|
|
12
|
+
a as useKeybind
|
|
11
13
|
};
|
package/dist/index62.js
CHANGED
|
@@ -1,61 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let r = null, c = 0, s = 0, f = 0, g = 0, o = null, l = null, a = null, e = null;
|
|
9
|
-
const h = (t) => {
|
|
10
|
-
if (!t) {
|
|
11
|
-
e == null || e(), e = null;
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
e == null || e(), e = N({ cursor: "grabbing", "user-select": "none" });
|
|
15
|
-
}, w = () => {
|
|
16
|
-
r !== null && (o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null), r = null, l = null, a = null, h(!1), i.endDrag(!0));
|
|
17
|
-
}, E = (t) => {
|
|
18
|
-
const u = t.target;
|
|
19
|
-
if (u.closest('button, input, select, textarea, [role="button"], a')) return;
|
|
20
|
-
const n = u.closest("[data-widget-drag-handle]");
|
|
21
|
-
if (!n || t.pointerType === "mouse" && t.button !== 0) return;
|
|
22
|
-
const d = n.dataset.widgetDragHandle;
|
|
23
|
-
d && (t.preventDefault(), t.stopPropagation(), r = t.pointerId, c = t.clientX, s = t.clientY, f = c, g = s, l = d, a = n, h(!0), i.startDrag(d, c, s), n.setPointerCapture(t.pointerId));
|
|
24
|
-
}, I = (t) => {
|
|
25
|
-
if (!(r !== t.pointerId || !l) && (f = t.clientX, g = t.clientY, o === null)) {
|
|
26
|
-
if (typeof requestAnimationFrame > "u") {
|
|
27
|
-
y();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
o = requestAnimationFrame(() => {
|
|
31
|
-
o = null, r !== null && y();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}, y = () => {
|
|
35
|
-
if (!l) return;
|
|
36
|
-
const t = f - c, u = g - s, m = document.querySelector(".deck-grid");
|
|
37
|
-
if (!m) return;
|
|
38
|
-
const { cols: n, rowHeight: d, gap: L } = k, P = window.getComputedStyle(m), b = parseFloat(P.paddingLeft) || 0, C = parseFloat(P.paddingRight) || 0, W = m.clientWidth - b - C, X = L * (n - 1), v = (W - X) / n;
|
|
39
|
-
if (!Number.isFinite(v) || v <= 0) return;
|
|
40
|
-
const Y = d + L, A = Math.round(t / v), G = Math.round(u / Y), D = i.activeLayout(), F = D == null ? void 0 : D.widgets.find((S) => S.id === l);
|
|
41
|
-
if (!F) return;
|
|
42
|
-
const M = R(F.position, A, G, n);
|
|
43
|
-
i.updateDrag(M, { x: t, y: u });
|
|
44
|
-
}, p = (t) => {
|
|
45
|
-
if (r === t.pointerId) {
|
|
46
|
-
try {
|
|
47
|
-
a == null || a.releasePointerCapture(t.pointerId);
|
|
48
|
-
} catch {
|
|
49
|
-
}
|
|
50
|
-
w();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
q(() => {
|
|
54
|
-
i.editMode() && (typeof document > "u" || (document.addEventListener("pointerdown", E, !0), document.addEventListener("pointermove", I, !0), document.addEventListener("pointerup", p, !0), document.addEventListener("pointercancel", p, !0), x(() => {
|
|
55
|
-
w(), document.removeEventListener("pointerdown", E, !0), document.removeEventListener("pointermove", I, !0), document.removeEventListener("pointerup", p, !0), document.removeEventListener("pointercancel", p, !0);
|
|
56
|
-
})));
|
|
57
|
-
});
|
|
1
|
+
import { createSignal as n, createEffect as a } from "solid-js";
|
|
2
|
+
import { useResolvedFloeConfig as c } from "./index49.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];
|
|
58
8
|
}
|
|
59
9
|
export {
|
|
60
|
-
|
|
10
|
+
u as usePersisted
|
|
61
11
|
};
|
package/dist/index63.js
CHANGED
|
@@ -1,8 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createEffect as q, onCleanup as x } from "solid-js";
|
|
2
|
+
import { useDeck as H } from "./index56.js";
|
|
3
|
+
import { applyDragDelta as R } from "./index71.js";
|
|
4
|
+
import { DECK_GRID_CONFIG as k } from "./index10.js";
|
|
5
|
+
import { lockBodyStyle as N } from "./index68.js";
|
|
6
|
+
function j() {
|
|
7
|
+
const i = H();
|
|
8
|
+
let r = null, c = 0, s = 0, f = 0, g = 0, o = null, l = null, a = null, e = null;
|
|
9
|
+
const h = (t) => {
|
|
10
|
+
if (!t) {
|
|
11
|
+
e == null || e(), e = null;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
e == null || e(), e = N({ cursor: "grabbing", "user-select": "none" });
|
|
15
|
+
}, w = () => {
|
|
16
|
+
r !== null && (o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null), r = null, l = null, a = null, h(!1), i.endDrag(!0));
|
|
17
|
+
}, E = (t) => {
|
|
18
|
+
const u = t.target;
|
|
19
|
+
if (u.closest('button, input, select, textarea, [role="button"], a')) return;
|
|
20
|
+
const n = u.closest("[data-widget-drag-handle]");
|
|
21
|
+
if (!n || t.pointerType === "mouse" && t.button !== 0) return;
|
|
22
|
+
const d = n.dataset.widgetDragHandle;
|
|
23
|
+
d && (t.preventDefault(), t.stopPropagation(), r = t.pointerId, c = t.clientX, s = t.clientY, f = c, g = s, l = d, a = n, h(!0), i.startDrag(d, c, s), n.setPointerCapture(t.pointerId));
|
|
24
|
+
}, I = (t) => {
|
|
25
|
+
if (!(r !== t.pointerId || !l) && (f = t.clientX, g = t.clientY, o === null)) {
|
|
26
|
+
if (typeof requestAnimationFrame > "u") {
|
|
27
|
+
y();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
o = requestAnimationFrame(() => {
|
|
31
|
+
o = null, r !== null && y();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, y = () => {
|
|
35
|
+
if (!l) return;
|
|
36
|
+
const t = f - c, u = g - s, m = document.querySelector(".deck-grid");
|
|
37
|
+
if (!m) return;
|
|
38
|
+
const { cols: n, rowHeight: d, gap: L } = k, P = window.getComputedStyle(m), b = parseFloat(P.paddingLeft) || 0, C = parseFloat(P.paddingRight) || 0, W = m.clientWidth - b - C, X = L * (n - 1), v = (W - X) / n;
|
|
39
|
+
if (!Number.isFinite(v) || v <= 0) return;
|
|
40
|
+
const Y = d + L, A = Math.round(t / v), G = Math.round(u / Y), D = i.activeLayout(), F = D == null ? void 0 : D.widgets.find((S) => S.id === l);
|
|
41
|
+
if (!F) return;
|
|
42
|
+
const M = R(F.position, A, G, n);
|
|
43
|
+
i.updateDrag(M, { x: t, y: u });
|
|
44
|
+
}, p = (t) => {
|
|
45
|
+
if (r === t.pointerId) {
|
|
46
|
+
try {
|
|
47
|
+
a == null || a.releasePointerCapture(t.pointerId);
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
w();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
q(() => {
|
|
54
|
+
i.editMode() && (typeof document > "u" || (document.addEventListener("pointerdown", E, !0), document.addEventListener("pointermove", I, !0), document.addEventListener("pointerup", p, !0), document.addEventListener("pointercancel", p, !0), x(() => {
|
|
55
|
+
w(), document.removeEventListener("pointerdown", E, !0), document.removeEventListener("pointermove", I, !0), document.removeEventListener("pointerup", p, !0), document.removeEventListener("pointercancel", p, !0);
|
|
56
|
+
})));
|
|
57
|
+
});
|
|
5
58
|
}
|
|
6
59
|
export {
|
|
7
|
-
|
|
60
|
+
j as useDeckDrag
|
|
8
61
|
};
|