@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,9 @@
1
+ import { type Accessor } from 'solid-js';
2
+ export interface Size {
3
+ width: number;
4
+ height: number;
5
+ }
6
+ /**
7
+ * Track element dimensions
8
+ */
9
+ export declare function useResizeObserver(element: Accessor<HTMLElement | null | undefined>): Accessor<Size | null>;
@@ -0,0 +1,7 @@
1
+ export * from './components';
2
+ export * from './app';
3
+ export * from './context';
4
+ export * from './hooks';
5
+ export * from './utils';
6
+ export * from './styles/themes';
7
+ export * from './widgets';
package/dist/index.js ADDED
@@ -0,0 +1,226 @@
1
+ import { Shell as o } from "./index2.js";
2
+ import { ActivityBar as i } from "./index3.js";
3
+ import { Sidebar as n, SidebarItem as m, SidebarSection as p } from "./index4.js";
4
+ import { TopBar as f } from "./index5.js";
5
+ import { BottomBar as x, BottomBarItem as s, StatusIndicator as c } from "./index6.js";
6
+ import { MobileTabBar as C } from "./index7.js";
7
+ import { ResizeHandle as S } from "./index8.js";
8
+ import { Panel as y, PanelContent as v, PanelHeader as D } from "./index9.js";
9
+ import { DECK_GRID_CONFIG as P, DeckGrid as b } from "./index10.js";
10
+ import { DeckCell as I } from "./index11.js";
11
+ import { WidgetFrame as R } from "./index12.js";
12
+ import { WidgetResizeHandle as B } from "./index13.js";
13
+ import { WidgetPalette as G } from "./index14.js";
14
+ import { WidgetTypeSwitcher as w } from "./index15.js";
15
+ import { LayoutSelector as A } from "./index16.js";
16
+ import { DeckTopBar as K } from "./index17.js";
17
+ import { DropZonePreview as H } from "./index18.js";
18
+ import { Button as E } from "./index19.js";
19
+ import { Input as Q, Textarea as U } from "./index20.js";
20
+ import { ConfirmDialog as Z, Dialog as j } from "./index21.js";
21
+ import { FloatingWindow as J } from "./index22.js";
22
+ import { Dropdown as $, Select as ee } from "./index23.js";
23
+ import { Tooltip as oe } from "./index24.js";
24
+ import { CommandPalette as ie } from "./index25.js";
25
+ import { AnimatedBorderCard as ne, Card as me, CardContent as pe, CardDescription as de, CardFooter as fe, CardHeader as le, CardTitle as xe, Interactive3DCard as se, MorphCard as ce, NeonCard as ge } from "./index26.js";
26
+ import { SnakeLoader as ue } from "./index27.js";
27
+ import { LoadingOverlay as he } from "./index28.js";
28
+ import { Skeleton as ve, SkeletonCard as De, SkeletonList as Te, SkeletonText as Pe } from "./index29.js";
29
+ import { ArrowRightLeft as Fe, Bell as Ie, Check as Le, ChevronDown as Re, ChevronRight as ke, Copy as Be, Files as We, GitBranch as Ge, Grid as Ne, Grid3x3 as we, GripVertical as ze, LayoutDashboard as Ae, Loader2 as Me, Maximize as Ke, Minus as Oe, Moon as He, Pencil as _e, Plus as Ee, Restore as Ve, Search as Qe, Settings as Ue, Sun as Xe, Terminal as Ze, Trash as je, X as qe } from "./index30.js";
30
+ import { Launchpad as Ye } from "./index31.js";
31
+ import { LaunchpadItem as er } from "./index32.js";
32
+ import { LaunchpadGrid as or } from "./index33.js";
33
+ import { LaunchpadSearch as ir } from "./index34.js";
34
+ import { LaunchpadPagination as nr } from "./index35.js";
35
+ import { FloeProvider as pr } from "./index36.js";
36
+ import { FloeApp as fr } from "./index37.js";
37
+ import { createSimpleContext as xr } from "./index38.js";
38
+ import { DEFAULT_FLOE_CONFIG as cr, FloeConfigProvider as gr, useFloeConfig as Cr, useResolvedFloeConfig as ur } from "./index39.js";
39
+ import { ThemeProvider as hr, createThemeService as yr, useTheme as vr } from "./index40.js";
40
+ import { LayoutProvider as Tr, createLayoutService as Pr, useLayout as br } from "./index41.js";
41
+ import { CommandProvider as Ir, createCommandService as Lr, useCommand as Rr } from "./index42.js";
42
+ import { NotificationContainer as Br, NotificationProvider as Wr, createNotificationService as Gr, useNotification as Nr } from "./index43.js";
43
+ import { ComponentRegistryProvider as zr, createComponentRegistry as Ar, useComponentContextFactory as Mr, useComponentRegistry as Kr } from "./index44.js";
44
+ import { WidgetRegistryProvider as Hr, createWidgetRegistry as _r, useWidgetRegistry as Er } from "./index45.js";
45
+ import { DeckProvider as Qr, createDeckService as Ur, useDeck as Xr } from "./index46.js";
46
+ import { useMediaQuery as jr } from "./index47.js";
47
+ import { useDebounce as Jr } from "./index48.js";
48
+ import { useResizeObserver as $r } from "./index49.js";
49
+ import { useKeybind as ro } from "./index50.js";
50
+ import { usePersisted as to } from "./index51.js";
51
+ import { useDeckDrag as ao } from "./index52.js";
52
+ import { cn as mo } from "./index53.js";
53
+ import { deferNonBlocking as fo } from "./index54.js";
54
+ import { clearAll as xo, debouncedSave as so, load as co, remove as go, save as Co } from "./index55.js";
55
+ import { formatKeybind as So, matchKeybind as ho, parseKeybind as yo } from "./index56.js";
56
+ import { lockBodyStyle as Do } from "./index57.js";
57
+ import { duration as Po, easing as bo, fadeIn as Fo, listContainer as Io, listItem as Lo, panelResize as Ro, popIn as ko, scaleIn as Bo, sidebarVariants as Wo, slideInFromBottom as Go, slideInFromLeft as No, slideInFromRight as wo, slideInFromTop as zo, springConfig as Ao } from "./index58.js";
58
+ import { checkCollision as Ko, constrainPosition as Oo, findFreePosition as Ho, hasCollision as _o } from "./index59.js";
59
+ import { applyDragDelta as Vo, applyResizeDelta as Qo, getGridCellSize as Uo, pixelDeltaToGridDelta as Xo, positionToGridArea as Zo, snapToGrid as jo } from "./index60.js";
60
+ import { applyTheme as Jo, builtInThemes as Yo, getSystemTheme as $o } from "./index61.js";
61
+ import { FilesSidebarWidget as rt, SearchSidebarWidget as ot, SettingsSidebarWidget as tt, ShowcaseSidebarWidget as it, SidebarWidget as at } from "./index62.js";
62
+ import { MetricsWidget as mt } from "./index63.js";
63
+ import { TerminalWidget as dt } from "./index64.js";
64
+ export {
65
+ i as ActivityBar,
66
+ ne as AnimatedBorderCard,
67
+ Fe as ArrowRightLeft,
68
+ Ie as Bell,
69
+ x as BottomBar,
70
+ s as BottomBarItem,
71
+ E as Button,
72
+ me as Card,
73
+ pe as CardContent,
74
+ de as CardDescription,
75
+ fe as CardFooter,
76
+ le as CardHeader,
77
+ xe as CardTitle,
78
+ Le as Check,
79
+ Re as ChevronDown,
80
+ ke as ChevronRight,
81
+ ie as CommandPalette,
82
+ Ir as CommandProvider,
83
+ zr as ComponentRegistryProvider,
84
+ Z as ConfirmDialog,
85
+ Be as Copy,
86
+ P as DECK_GRID_CONFIG,
87
+ cr as DEFAULT_FLOE_CONFIG,
88
+ I as DeckCell,
89
+ b as DeckGrid,
90
+ Qr as DeckProvider,
91
+ K as DeckTopBar,
92
+ j as Dialog,
93
+ H as DropZonePreview,
94
+ $ as Dropdown,
95
+ We as Files,
96
+ rt as FilesSidebarWidget,
97
+ J as FloatingWindow,
98
+ fr as FloeApp,
99
+ gr as FloeConfigProvider,
100
+ pr as FloeProvider,
101
+ Ge as GitBranch,
102
+ Ne as Grid,
103
+ we as Grid3x3,
104
+ ze as GripVertical,
105
+ Q as Input,
106
+ se as Interactive3DCard,
107
+ Ye as Launchpad,
108
+ or as LaunchpadGrid,
109
+ er as LaunchpadItem,
110
+ nr as LaunchpadPagination,
111
+ ir as LaunchpadSearch,
112
+ Ae as LayoutDashboard,
113
+ Tr as LayoutProvider,
114
+ A as LayoutSelector,
115
+ Me as Loader2,
116
+ he as LoadingOverlay,
117
+ Ke as Maximize,
118
+ mt as MetricsWidget,
119
+ Oe as Minus,
120
+ C as MobileTabBar,
121
+ He as Moon,
122
+ ce as MorphCard,
123
+ ge as NeonCard,
124
+ Br as NotificationContainer,
125
+ Wr as NotificationProvider,
126
+ y as Panel,
127
+ v as PanelContent,
128
+ D as PanelHeader,
129
+ _e as Pencil,
130
+ Ee as Plus,
131
+ S as ResizeHandle,
132
+ Ve as Restore,
133
+ Qe as Search,
134
+ ot as SearchSidebarWidget,
135
+ ee as Select,
136
+ Ue as Settings,
137
+ tt as SettingsSidebarWidget,
138
+ o as Shell,
139
+ it as ShowcaseSidebarWidget,
140
+ n as Sidebar,
141
+ m as SidebarItem,
142
+ p as SidebarSection,
143
+ at as SidebarWidget,
144
+ ve as Skeleton,
145
+ De as SkeletonCard,
146
+ Te as SkeletonList,
147
+ Pe as SkeletonText,
148
+ ue as SnakeLoader,
149
+ c as StatusIndicator,
150
+ Xe as Sun,
151
+ Ze as Terminal,
152
+ dt as TerminalWidget,
153
+ U as Textarea,
154
+ hr as ThemeProvider,
155
+ oe as Tooltip,
156
+ f as TopBar,
157
+ je as Trash,
158
+ R as WidgetFrame,
159
+ G as WidgetPalette,
160
+ Hr as WidgetRegistryProvider,
161
+ B as WidgetResizeHandle,
162
+ w as WidgetTypeSwitcher,
163
+ qe as X,
164
+ Vo as applyDragDelta,
165
+ Qo as applyResizeDelta,
166
+ Jo as applyTheme,
167
+ Yo as builtInThemes,
168
+ Ko as checkCollision,
169
+ xo as clearAll,
170
+ mo as cn,
171
+ Oo as constrainPosition,
172
+ Lr as createCommandService,
173
+ Ar as createComponentRegistry,
174
+ Ur as createDeckService,
175
+ Pr as createLayoutService,
176
+ Gr as createNotificationService,
177
+ xr as createSimpleContext,
178
+ yr as createThemeService,
179
+ _r as createWidgetRegistry,
180
+ so as debouncedSave,
181
+ fo as deferNonBlocking,
182
+ Po as duration,
183
+ bo as easing,
184
+ Fo as fadeIn,
185
+ Ho as findFreePosition,
186
+ So as formatKeybind,
187
+ Uo as getGridCellSize,
188
+ $o as getSystemTheme,
189
+ _o as hasCollision,
190
+ Io as listContainer,
191
+ Lo as listItem,
192
+ co as load,
193
+ Do as lockBodyStyle,
194
+ ho as matchKeybind,
195
+ Ro as panelResize,
196
+ yo as parseKeybind,
197
+ Xo as pixelDeltaToGridDelta,
198
+ ko as popIn,
199
+ Zo as positionToGridArea,
200
+ go as remove,
201
+ Co as save,
202
+ Bo as scaleIn,
203
+ Wo as sidebarVariants,
204
+ Go as slideInFromBottom,
205
+ No as slideInFromLeft,
206
+ wo as slideInFromRight,
207
+ zo as slideInFromTop,
208
+ jo as snapToGrid,
209
+ Ao as springConfig,
210
+ Rr as useCommand,
211
+ Mr as useComponentContextFactory,
212
+ Kr as useComponentRegistry,
213
+ Jr as useDebounce,
214
+ Xr as useDeck,
215
+ ao as useDeckDrag,
216
+ Cr as useFloeConfig,
217
+ ro as useKeybind,
218
+ br as useLayout,
219
+ jr as useMediaQuery,
220
+ Nr as useNotification,
221
+ to as usePersisted,
222
+ $r as useResizeObserver,
223
+ ur as useResolvedFloeConfig,
224
+ vr as useTheme,
225
+ Er as useWidgetRegistry
226
+ };
@@ -0,0 +1,92 @@
1
+ import { template as f, insert as d, createComponent as o, effect as D, className as I, setStyleProperty as k } from "solid-js/web";
2
+ import { createMemo as i, Show as m, For as S } from "solid-js";
3
+ import { cn as y } from "./index53.js";
4
+ import { useDeck as z } from "./index46.js";
5
+ import { DeckCell as G } from "./index11.js";
6
+ import { DropZonePreview as O } from "./index18.js";
7
+ var R = /* @__PURE__ */ f('<div class="absolute inset-1 pointer-events-none z-0 rounded"style="background-image:linear-gradient(to right, color-mix(in srgb, var(--border) 15%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--border) 15%, transparent) 1px, transparent 1px) ;background-size:calc((100% - 4px) / 24) 44px;background-position:0 0">'), C = /* @__PURE__ */ f('<div data-grid-cols=24 data-row-height=40 data-gap=4 style="grid-template-columns:repeat(24, 1fr);grid-auto-rows:40px;gap:4px">');
8
+ const P = 24, h = 40, x = 4;
9
+ function N(g) {
10
+ const n = z(), u = () => {
11
+ var e;
12
+ return ((e = n.activeLayout()) == null ? void 0 : e.widgets) ?? [];
13
+ }, s = () => n.dragState(), p = () => n.resizeState(), v = i(() => {
14
+ const e = u();
15
+ return e.length === 0 ? 12 : Math.max(12, ...e.map((t) => t.position.row + t.position.rowSpan));
16
+ });
17
+ return (() => {
18
+ var e = C();
19
+ return d(e, o(m, {
20
+ get when() {
21
+ return n.editMode();
22
+ },
23
+ get children() {
24
+ return R();
25
+ }
26
+ }), null), d(e, o(m, {
27
+ get when() {
28
+ return s();
29
+ },
30
+ children: (t) => o(O, {
31
+ get position() {
32
+ return t().currentPosition;
33
+ }
34
+ })
35
+ }), null), d(e, o(S, {
36
+ get each() {
37
+ return u();
38
+ },
39
+ children: (t) => {
40
+ const a = i(() => {
41
+ const r = s();
42
+ if (r && r.widgetId === t.id)
43
+ return t.position;
44
+ const l = p();
45
+ return l && l.widgetId === t.id ? l.currentPosition : t.position;
46
+ }), c = i(() => {
47
+ const r = s();
48
+ return (r == null ? void 0 : r.widgetId) === t.id;
49
+ }), w = i(() => {
50
+ const r = p();
51
+ return (r == null ? void 0 : r.widgetId) === t.id;
52
+ }), b = i(() => {
53
+ const r = s();
54
+ return r && r.widgetId === t.id ? r.pixelOffset : {
55
+ x: 0,
56
+ y: 0
57
+ };
58
+ });
59
+ return o(G, {
60
+ widget: t,
61
+ get position() {
62
+ return a();
63
+ },
64
+ get isDragging() {
65
+ return c();
66
+ },
67
+ get isResizing() {
68
+ return w();
69
+ },
70
+ get pixelOffset() {
71
+ return b();
72
+ }
73
+ });
74
+ }
75
+ }), null), d(e, () => g.children, null), D((t) => {
76
+ var a = y("deck-grid relative w-full h-full overflow-auto", "grid p-1", n.editMode() && "bg-muted/20", g.class), c = `${v() * (h + x)}px`;
77
+ return a !== t.e && I(e, t.e = a), c !== t.t && k(e, "min-height", t.t = c), t;
78
+ }, {
79
+ e: void 0,
80
+ t: void 0
81
+ }), e;
82
+ })();
83
+ }
84
+ const $ = {
85
+ cols: P,
86
+ rowHeight: h,
87
+ gap: x
88
+ };
89
+ export {
90
+ $ as DECK_GRID_CONFIG,
91
+ N as DeckGrid
92
+ };
@@ -0,0 +1,101 @@
1
+ import { template as y, insert as a, createComponent as d, Dynamic as z, effect as f, className as v, style as R, setAttribute as W } from "solid-js/web";
2
+ import { createMemo as o, Show as k } from "solid-js";
3
+ import { cn as w } from "./index53.js";
4
+ import { useDeck as C } from "./index46.js";
5
+ import { useWidgetRegistry as $ } from "./index45.js";
6
+ import { positionToGridArea as M } from "./index60.js";
7
+ import { WidgetFrame as A } from "./index12.js";
8
+ var h = /* @__PURE__ */ y("<div>"), _ = /* @__PURE__ */ y('<div class="h-full flex items-center justify-center text-muted-foreground text-xs"><span>Widget: ');
9
+ function N(e) {
10
+ const n = C(), g = $(), i = () => n.editMode(), s = () => e.widget.type, l = o(() => g.getWidget(s())), D = o(() => M(e.position)), c = () => {
11
+ const r = l();
12
+ return r == null ? void 0 : r.component;
13
+ }, x = o(() => {
14
+ if (!e.isDragging || !e.pixelOffset) return {};
15
+ const {
16
+ x: r,
17
+ y: t
18
+ } = e.pixelOffset;
19
+ return r === 0 && t === 0 ? {} : {
20
+ transform: `translate(${r}px, ${t}px)`
21
+ };
22
+ });
23
+ return (() => {
24
+ var r = h();
25
+ return a(r, d(A, {
26
+ get widget() {
27
+ return e.widget;
28
+ },
29
+ get widgetDef() {
30
+ return l();
31
+ },
32
+ get isDragging() {
33
+ return e.isDragging;
34
+ },
35
+ get isResizing() {
36
+ return e.isResizing;
37
+ },
38
+ get children() {
39
+ var t = h();
40
+ return a(t, d(k, {
41
+ get when() {
42
+ return c();
43
+ },
44
+ get fallback() {
45
+ return d(O, {
46
+ get type() {
47
+ return s();
48
+ }
49
+ });
50
+ },
51
+ get children() {
52
+ return d(z, {
53
+ get component() {
54
+ return c();
55
+ },
56
+ get widgetId() {
57
+ return e.widget.id;
58
+ },
59
+ get config() {
60
+ return e.widget.config;
61
+ },
62
+ get isEditMode() {
63
+ return i();
64
+ }
65
+ });
66
+ }
67
+ })), f(() => v(t, w("h-full", i() && "pointer-events-none"))), t;
68
+ }
69
+ })), f((t) => {
70
+ var u = w(
71
+ "deck-cell relative rounded-md overflow-hidden",
72
+ "bg-card border border-border",
73
+ // Smooth transition when not dragging (for snap-back animation)
74
+ !e.isDragging && "transition-transform duration-200 ease-out",
75
+ e.isDragging && "shadow-xl z-50 ring-2 ring-primary scale-[1.02]",
76
+ e.isResizing && "shadow-lg z-50 ring-2 ring-primary",
77
+ i() && !e.isDragging && !e.isResizing && "hover:ring-1 hover:ring-primary/50",
78
+ // Edit mode: disable selection and show grab cursor
79
+ i() && "select-none cursor-grab",
80
+ e.isDragging && "cursor-grabbing"
81
+ ), b = {
82
+ "grid-area": D(),
83
+ ...x()
84
+ }, m = i() ? e.widget.id : void 0;
85
+ return u !== t.e && v(r, t.e = u), t.t = R(r, b, t.t), m !== t.a && W(r, "data-widget-drag-handle", t.a = m), t;
86
+ }, {
87
+ e: void 0,
88
+ t: void 0,
89
+ a: void 0
90
+ }), r;
91
+ })();
92
+ }
93
+ function O(e) {
94
+ return (() => {
95
+ var n = _(), g = n.firstChild;
96
+ return g.firstChild, a(g, () => e.type, null), n;
97
+ })();
98
+ }
99
+ export {
100
+ N as DeckCell
101
+ };
@@ -0,0 +1,113 @@
1
+ import { delegateEvents as h, template as c, insert as i, createComponent as e, effect as v, className as x } from "solid-js/web";
2
+ import { Show as l } from "solid-js";
3
+ import { cn as $ } from "./index53.js";
4
+ import { useDeck as _ } from "./index46.js";
5
+ import { GripVertical as b, X as k } from "./index30.js";
6
+ import { WidgetResizeHandle as d } from "./index13.js";
7
+ import { WidgetTypeSwitcher as C } from "./index15.js";
8
+ var D = /* @__PURE__ */ c("<div class=text-muted-foreground/50>"), W = /* @__PURE__ */ c('<button class="p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors cursor-pointer pointer-events-auto"title="Remove widget">'), y = /* @__PURE__ */ c('<div class="h-full flex flex-col"><div><span class="flex-1 text-xs font-medium text-foreground truncate"></span></div><div class="flex-1 min-h-0 overflow-auto">');
9
+ function H(t) {
10
+ const w = _(), o = () => w.editMode(), m = () => {
11
+ var n;
12
+ return t.widget.title ?? ((n = t.widgetDef) == null ? void 0 : n.name) ?? t.widget.type;
13
+ }, a = (n) => {
14
+ n.stopPropagation(), n.preventDefault(), w.removeWidget(t.widget.id);
15
+ };
16
+ return (() => {
17
+ var n = y(), g = n.firstChild, u = g.firstChild, s = g.nextSibling;
18
+ return i(g, e(l, {
19
+ get when() {
20
+ return o();
21
+ },
22
+ get children() {
23
+ var r = D();
24
+ return i(r, e(b, {
25
+ class: "w-3.5 h-3.5"
26
+ })), r;
27
+ }
28
+ }), u), i(g, e(l, {
29
+ get when() {
30
+ var r;
31
+ return (r = t.widgetDef) == null ? void 0 : r.icon;
32
+ },
33
+ children: (r) => {
34
+ const f = r();
35
+ return e(f, {
36
+ class: "w-3.5 h-3.5 text-muted-foreground"
37
+ });
38
+ }
39
+ }), u), i(u, m), i(g, e(l, {
40
+ get when() {
41
+ return o();
42
+ },
43
+ get children() {
44
+ return e(C, {
45
+ get widget() {
46
+ return t.widget;
47
+ }
48
+ });
49
+ }
50
+ }), null), i(g, e(l, {
51
+ get when() {
52
+ return o();
53
+ },
54
+ get children() {
55
+ var r = W();
56
+ return r.$$click = a, i(r, e(k, {
57
+ class: "w-3.5 h-3.5"
58
+ })), r;
59
+ }
60
+ }), null), i(s, () => t.children), i(n, e(l, {
61
+ get when() {
62
+ return o();
63
+ },
64
+ get children() {
65
+ return [e(d, {
66
+ get widget() {
67
+ return t.widget;
68
+ },
69
+ edge: "e"
70
+ }), e(d, {
71
+ get widget() {
72
+ return t.widget;
73
+ },
74
+ edge: "s"
75
+ }), e(d, {
76
+ get widget() {
77
+ return t.widget;
78
+ },
79
+ edge: "se"
80
+ }), e(d, {
81
+ get widget() {
82
+ return t.widget;
83
+ },
84
+ edge: "w"
85
+ }), e(d, {
86
+ get widget() {
87
+ return t.widget;
88
+ },
89
+ edge: "n"
90
+ }), e(d, {
91
+ get widget() {
92
+ return t.widget;
93
+ },
94
+ edge: "sw"
95
+ }), e(d, {
96
+ get widget() {
97
+ return t.widget;
98
+ },
99
+ edge: "ne"
100
+ }), e(d, {
101
+ get widget() {
102
+ return t.widget;
103
+ },
104
+ edge: "nw"
105
+ })];
106
+ }
107
+ }), null), v(() => x(g, $("widget-header flex items-center gap-1 px-2 py-1.5 border-b border-border bg-muted/30", "select-none"))), n;
108
+ })();
109
+ }
110
+ h(["click"]);
111
+ export {
112
+ H as WidgetFrame
113
+ };
@@ -0,0 +1,82 @@
1
+ import { delegateEvents as G, template as Y, effect as F, className as X, use as M } from "solid-js/web";
2
+ import { createSignal as W, onCleanup as q } from "solid-js";
3
+ import { cn as H } from "./index53.js";
4
+ import { useDeck as O } from "./index46.js";
5
+ import { applyResizeDelta as L } from "./index60.js";
6
+ import { DECK_GRID_CONFIG as N } from "./index10.js";
7
+ import { lockBodyStyle as T } from "./index57.js";
8
+ var U = /* @__PURE__ */ Y("<div style=touch-action:none>");
9
+ const k = {
10
+ n: "top-0 left-2 right-2 h-2 cursor-ns-resize",
11
+ s: "bottom-0 left-2 right-2 h-2 cursor-ns-resize",
12
+ e: "right-0 top-2 bottom-2 w-2 cursor-ew-resize",
13
+ w: "left-0 top-2 bottom-2 w-2 cursor-ew-resize",
14
+ ne: "top-0 right-0 w-4 h-4 cursor-nesw-resize",
15
+ nw: "top-0 left-0 w-4 h-4 cursor-nwse-resize",
16
+ se: "bottom-0 right-0 w-4 h-4 cursor-nwse-resize",
17
+ sw: "bottom-0 left-0 w-4 h-4 cursor-nesw-resize"
18
+ }, x = {
19
+ n: "ns-resize",
20
+ s: "ns-resize",
21
+ e: "ew-resize",
22
+ w: "ew-resize",
23
+ ne: "nesw-resize",
24
+ nw: "nwse-resize",
25
+ se: "nwse-resize",
26
+ sw: "nesw-resize"
27
+ };
28
+ function ee(r) {
29
+ const i = O(), [s, f] = W(!1);
30
+ let t, l = null, c = 0, a = 0, d = 0, p = 0, o = null, n = null;
31
+ const g = (e) => {
32
+ if (!e) {
33
+ n == null || n(), n = null;
34
+ return;
35
+ }
36
+ n == null || n(), n = T({
37
+ cursor: x[r.edge],
38
+ "user-select": "none"
39
+ });
40
+ }, z = () => {
41
+ s() && (o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null), f(!1), l = null, g(!1), i.endResize(!0));
42
+ }, C = (e) => {
43
+ e.pointerType === "mouse" && e.button !== 0 || (e.preventDefault(), e.stopPropagation(), l = e.pointerId, c = e.clientX, a = e.clientY, d = c, p = a, f(!0), g(!0), i.startResize(r.widget.id, r.edge, c, a), t == null || t.setPointerCapture(e.pointerId));
44
+ }, D = (e) => {
45
+ if (!(!s() || l !== e.pointerId) && (d = e.clientX, p = e.clientY, o === null)) {
46
+ if (typeof requestAnimationFrame > "u") {
47
+ h();
48
+ return;
49
+ }
50
+ o = requestAnimationFrame(() => {
51
+ o = null, s() && h();
52
+ });
53
+ }
54
+ }, h = () => {
55
+ const e = d - c, u = p - a, y = document.querySelector(".deck-grid");
56
+ if (!y) return;
57
+ const I = y.getBoundingClientRect(), {
58
+ cols: m,
59
+ rowHeight: S,
60
+ gap: w
61
+ } = N, E = w * (m - 1), P = (I.width - E - w * 2) / m, R = S + w, $ = Math.round(e / P), _ = Math.round(u / R), b = i.getWidgetMinConstraints(r.widget.type), A = L(r.widget.position, r.edge, $, _, b.minColSpan, b.minRowSpan, m);
62
+ i.updateResize(A);
63
+ }, v = (e) => {
64
+ if (l === e.pointerId) {
65
+ try {
66
+ t == null || t.releasePointerCapture(e.pointerId);
67
+ } catch {
68
+ }
69
+ z();
70
+ }
71
+ };
72
+ return q(() => z()), (() => {
73
+ var e = U();
74
+ e.addEventListener("pointercancel", v), e.$$pointerup = v, e.$$pointermove = D, e.$$pointerdown = C;
75
+ var u = t;
76
+ return typeof u == "function" ? M(u, e) : t = e, F(() => X(e, H("absolute z-30", k[r.edge], "hover:bg-primary/30 transition-colors", s() && "bg-primary/50"))), e;
77
+ })();
78
+ }
79
+ G(["pointerdown", "pointermove", "pointerup"]);
80
+ export {
81
+ ee as WidgetResizeHandle
82
+ };