@floegence/floe-webapp-core 0.36.7 → 0.36.9

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 (46) hide show
  1. package/dist/components/deck/DeckCell.d.ts +0 -5
  2. package/dist/components/deck/DeckCell.js +34 -45
  3. package/dist/components/deck/DeckGrid.d.ts +2 -16
  4. package/dist/components/deck/DeckGrid.js +83 -105
  5. package/dist/components/deck/WidgetResizeHandle.d.ts +3 -1
  6. package/dist/components/deck/WidgetResizeHandle.js +46 -80
  7. package/dist/components/deck/deckGridMetrics.d.ts +26 -0
  8. package/dist/components/deck/deckGridMetrics.js +32 -0
  9. package/dist/components/deck/deckPointerSession.d.ts +52 -0
  10. package/dist/components/deck/deckPointerSession.js +113 -0
  11. package/dist/components/editor/CodeEditor.d.ts +2 -0
  12. package/dist/components/editor/CodeEditor.js +24 -24
  13. package/dist/components/editor/index.d.ts +1 -0
  14. package/dist/components/editor/monacoStandaloneRuntime.d.ts +15 -3
  15. package/dist/components/editor/monacoStandaloneRuntime.js +45 -17
  16. package/dist/components/ui/InfiniteCanvas.d.ts +2 -0
  17. package/dist/components/ui/InfiniteCanvas.js +85 -84
  18. package/dist/components/ui/index.d.ts +1 -1
  19. package/dist/components/ui/localInteractionSurface.d.ts +19 -0
  20. package/dist/components/ui/localInteractionSurface.js +38 -23
  21. package/dist/components/workbench/WorkbenchCanvas.d.ts +4 -0
  22. package/dist/components/workbench/WorkbenchCanvas.js +176 -11
  23. package/dist/components/workbench/WorkbenchSurface.js +9 -6
  24. package/dist/components/workbench/WorkbenchWidget.d.ts +4 -1
  25. package/dist/components/workbench/WorkbenchWidget.js +153 -120
  26. package/dist/components/workbench/index.d.ts +1 -1
  27. package/dist/components/workbench/types.d.ts +19 -0
  28. package/dist/components/workbench/useWorkbenchModel.d.ts +4 -0
  29. package/dist/components/workbench/useWorkbenchModel.js +33 -32
  30. package/dist/components/workbench/workbenchHelpers.d.ts +14 -1
  31. package/dist/components/workbench/workbenchHelpers.js +117 -90
  32. package/dist/context/DeckContext.d.ts +1 -9
  33. package/dist/context/DeckContext.js +163 -168
  34. package/dist/deck.js +22 -21
  35. package/dist/editor.js +5 -2
  36. package/dist/full.js +528 -523
  37. package/dist/hooks/useDeckDrag.d.ts +4 -3
  38. package/dist/hooks/useDeckDrag.js +39 -72
  39. package/dist/index.js +54 -53
  40. package/dist/styles.css +1 -1
  41. package/dist/ui.js +97 -94
  42. package/dist/utils/gridCollision.d.ts +1 -0
  43. package/dist/utils/gridCollision.js +21 -17
  44. package/dist/workbench.css +16 -0
  45. package/dist/workbench.js +17 -14
  46. package/package.json +1 -1
package/dist/ui.js CHANGED
@@ -1,108 +1,111 @@
1
1
  import { AffixInput as e, Input as t, NumberInput as a, Textarea as i } from "./components/ui/Input.js";
2
- import { AnimatedBorderCard as n, Card as p, CardContent as f, CardDescription as C, CardFooter as c, CardHeader as x, CardTitle as d, Interactive3DCard as l, MorphCard as s, NeonCard as T } from "./components/ui/Card.js";
3
- import { AreaChart as F, DataBarChart as E, DataPieChart as L, LineChart as S, MonitoringChart as u } from "./components/ui/Charts.js";
4
- import { Button as D } from "./components/ui/Button.js";
5
- import { Checkbox as h, CheckboxGroup as k, CheckboxList as A } from "./components/ui/Checkbox.js";
6
- import { CircularProgress as B, LinearProgress as b, SegmentedProgress as P, StepsProgress as O } from "./components/ui/Progress.js";
7
- import { CommandPalette as N } from "./components/ui/CommandPalette.js";
8
- import { ConfirmDialog as H, Dialog as w } from "./components/ui/Dialog.js";
9
- import { DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR as M, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR as U, LOCAL_INTERACTION_SURFACE_ATTR as y, WORKBENCH_WIDGET_SHELL_ATTR as K, isLocalInteractionSurfaceTarget as z, resolveSurfaceInteractionTargetRole as Q, resolveWorkbenchWidgetEventOwnership as j } from "./components/ui/localInteractionSurface.js";
10
- import { DirectoryInput as J } from "./components/ui/DirectoryInput.js";
11
- import { DirectoryPicker as X } from "./components/ui/DirectoryPicker.js";
12
- import { Dropdown as Z, Select as $ } from "./components/ui/Dropdown.js";
13
- import { ErrorBlock as or, HighlightBlock as er, InfoBlock as tr, NoteBlock as ar, SuccessBlock as ir, TipBlock as mr, WarningBlock as nr } from "./components/ui/HighlightBlock.js";
14
- import { FileSavePicker as fr } from "./components/ui/FileSavePicker.js";
15
- import { FloatingWindow as cr } from "./components/ui/FloatingWindow.js";
16
- import { Form as dr, FormActions as lr, FormControl as sr, FormDescription as Tr, FormDivider as gr, FormField as Fr, FormLabel as Er, FormMessage as Lr, FormRow as Sr, FormSection as ur, useFormSubmitting as Ir } from "./components/ui/Form.js";
17
- import { InfiniteCanvas as Rr } from "./components/ui/InfiniteCanvas.js";
18
- import { MobileKeyboard as kr } from "./components/ui/MobileKeyboard.js";
19
- import { Pagination as _r } from "./components/ui/Pagination.js";
20
- import { ProcessingIndicator as br } from "./components/ui/ProcessingIndicator.js";
21
- import { QuoteBlock as Or } from "./components/ui/QuoteBlock.js";
22
- import { RadioGroup as Nr, RadioList as vr, RadioOption as Hr } from "./components/ui/Radio.js";
23
- import { SegmentedControl as Gr } from "./components/ui/SegmentedControl.js";
24
- import { Stepper as Ur, Wizard as yr, useWizard as Kr } from "./components/ui/Stepper.js";
25
- import { Switch as Qr } from "./components/ui/Switch.js";
26
- import { TabPanel as qr, Tabs as Jr } from "./components/ui/Tabs.js";
27
- import { Tag as Xr } from "./components/ui/Tag.js";
28
- import { Tooltip as Zr } from "./components/ui/Tooltip.js";
2
+ import { AnimatedBorderCard as m, Card as p, CardContent as C, CardDescription as f, CardFooter as c, CardHeader as x, CardTitle as T, Interactive3DCard as l, MorphCard as s, NeonCard as E } from "./components/ui/Card.js";
3
+ import { AreaChart as g, DataBarChart as A, DataPieChart as L, LineChart as S, MonitoringChart as _ } from "./components/ui/Charts.js";
4
+ import { Button as I } from "./components/ui/Button.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as u, DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR as D, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR as h, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR as k, LOCAL_INTERACTION_SURFACE_ATTR as B, WORKBENCH_WIDGET_SHELL_ATTR as N, isLocalInteractionSurfaceTarget as W, resolveSurfaceInteractionTargetRole as b, resolveSurfaceWheelRouting as O, resolveWorkbenchWidgetEventOwnership as P } from "./components/ui/localInteractionSurface.js";
6
+ import { Checkbox as H, CheckboxGroup as w, CheckboxList as U } from "./components/ui/Checkbox.js";
7
+ import { CircularProgress as M, LinearProgress as V, SegmentedProgress as y, StepsProgress as K } from "./components/ui/Progress.js";
8
+ import { CommandPalette as Q } from "./components/ui/CommandPalette.js";
9
+ import { ConfirmDialog as q, Dialog as J } from "./components/ui/Dialog.js";
10
+ import { DirectoryInput as Y } from "./components/ui/DirectoryInput.js";
11
+ import { DirectoryPicker as $ } from "./components/ui/DirectoryPicker.js";
12
+ import { Dropdown as or, Select as er } from "./components/ui/Dropdown.js";
13
+ import { ErrorBlock as ar, HighlightBlock as ir, InfoBlock as nr, NoteBlock as mr, SuccessBlock as pr, TipBlock as Cr, WarningBlock as fr } from "./components/ui/HighlightBlock.js";
14
+ import { FileSavePicker as xr } from "./components/ui/FileSavePicker.js";
15
+ import { FloatingWindow as lr } from "./components/ui/FloatingWindow.js";
16
+ import { Form as Er, FormActions as dr, FormControl as gr, FormDescription as Ar, FormDivider as Lr, FormField as Sr, FormLabel as _r, FormMessage as Fr, FormRow as Ir, FormSection as Rr, useFormSubmitting as ur } from "./components/ui/Form.js";
17
+ import { InfiniteCanvas as hr } from "./components/ui/InfiniteCanvas.js";
18
+ import { MobileKeyboard as Br } from "./components/ui/MobileKeyboard.js";
19
+ import { Pagination as Wr } from "./components/ui/Pagination.js";
20
+ import { ProcessingIndicator as Or } from "./components/ui/ProcessingIndicator.js";
21
+ import { QuoteBlock as vr } from "./components/ui/QuoteBlock.js";
22
+ import { RadioGroup as wr, RadioList as Ur, RadioOption as Gr } from "./components/ui/Radio.js";
23
+ import { SegmentedControl as Vr } from "./components/ui/SegmentedControl.js";
24
+ import { Stepper as Kr, Wizard as zr, useWizard as Qr } from "./components/ui/Stepper.js";
25
+ import { Switch as qr } from "./components/ui/Switch.js";
26
+ import { TabPanel as Xr, Tabs as Yr } from "./components/ui/Tabs.js";
27
+ import { Tag as $r } from "./components/ui/Tag.js";
28
+ import { Tooltip as oo } from "./components/ui/Tooltip.js";
29
29
  export {
30
30
  e as AffixInput,
31
- n as AnimatedBorderCard,
32
- F as AreaChart,
33
- D as Button,
31
+ m as AnimatedBorderCard,
32
+ g as AreaChart,
33
+ I as Button,
34
+ u as CANVAS_WHEEL_INTERACTIVE_ATTR,
34
35
  p as Card,
35
- f as CardContent,
36
- C as CardDescription,
36
+ C as CardContent,
37
+ f as CardDescription,
37
38
  c as CardFooter,
38
39
  x as CardHeader,
39
- d as CardTitle,
40
- h as Checkbox,
41
- k as CheckboxGroup,
42
- A as CheckboxList,
43
- B as CircularProgress,
44
- N as CommandPalette,
45
- H as ConfirmDialog,
46
- M as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
47
- U as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
48
- E as DataBarChart,
40
+ T as CardTitle,
41
+ H as Checkbox,
42
+ w as CheckboxGroup,
43
+ U as CheckboxList,
44
+ M as CircularProgress,
45
+ Q as CommandPalette,
46
+ q as ConfirmDialog,
47
+ D as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
48
+ h as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
49
+ k as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
50
+ A as DataBarChart,
49
51
  L as DataPieChart,
50
- w as Dialog,
51
- J as DirectoryInput,
52
- X as DirectoryPicker,
53
- Z as Dropdown,
54
- or as ErrorBlock,
55
- fr as FileSavePicker,
56
- cr as FloatingWindow,
57
- dr as Form,
58
- lr as FormActions,
59
- sr as FormControl,
60
- Tr as FormDescription,
61
- gr as FormDivider,
62
- Fr as FormField,
63
- Er as FormLabel,
64
- Lr as FormMessage,
65
- Sr as FormRow,
66
- ur as FormSection,
67
- er as HighlightBlock,
68
- Rr as InfiniteCanvas,
69
- tr as InfoBlock,
52
+ J as Dialog,
53
+ Y as DirectoryInput,
54
+ $ as DirectoryPicker,
55
+ or as Dropdown,
56
+ ar as ErrorBlock,
57
+ xr as FileSavePicker,
58
+ lr as FloatingWindow,
59
+ Er as Form,
60
+ dr as FormActions,
61
+ gr as FormControl,
62
+ Ar as FormDescription,
63
+ Lr as FormDivider,
64
+ Sr as FormField,
65
+ _r as FormLabel,
66
+ Fr as FormMessage,
67
+ Ir as FormRow,
68
+ Rr as FormSection,
69
+ ir as HighlightBlock,
70
+ hr as InfiniteCanvas,
71
+ nr as InfoBlock,
70
72
  t as Input,
71
73
  l as Interactive3DCard,
72
- y as LOCAL_INTERACTION_SURFACE_ATTR,
74
+ B as LOCAL_INTERACTION_SURFACE_ATTR,
73
75
  S as LineChart,
74
- b as LinearProgress,
75
- kr as MobileKeyboard,
76
- u as MonitoringChart,
76
+ V as LinearProgress,
77
+ Br as MobileKeyboard,
78
+ _ as MonitoringChart,
77
79
  s as MorphCard,
78
- T as NeonCard,
79
- ar as NoteBlock,
80
+ E as NeonCard,
81
+ mr as NoteBlock,
80
82
  a as NumberInput,
81
- _r as Pagination,
82
- br as ProcessingIndicator,
83
- Or as QuoteBlock,
84
- Nr as RadioGroup,
85
- vr as RadioList,
86
- Hr as RadioOption,
87
- Gr as SegmentedControl,
88
- P as SegmentedProgress,
89
- $ as Select,
90
- Ur as Stepper,
91
- O as StepsProgress,
92
- ir as SuccessBlock,
93
- Qr as Switch,
94
- qr as TabPanel,
95
- Jr as Tabs,
96
- Xr as Tag,
83
+ Wr as Pagination,
84
+ Or as ProcessingIndicator,
85
+ vr as QuoteBlock,
86
+ wr as RadioGroup,
87
+ Ur as RadioList,
88
+ Gr as RadioOption,
89
+ Vr as SegmentedControl,
90
+ y as SegmentedProgress,
91
+ er as Select,
92
+ Kr as Stepper,
93
+ K as StepsProgress,
94
+ pr as SuccessBlock,
95
+ qr as Switch,
96
+ Xr as TabPanel,
97
+ Yr as Tabs,
98
+ $r as Tag,
97
99
  i as Textarea,
98
- mr as TipBlock,
99
- Zr as Tooltip,
100
- K as WORKBENCH_WIDGET_SHELL_ATTR,
101
- nr as WarningBlock,
102
- yr as Wizard,
103
- z as isLocalInteractionSurfaceTarget,
104
- Q as resolveSurfaceInteractionTargetRole,
105
- j as resolveWorkbenchWidgetEventOwnership,
106
- Ir as useFormSubmitting,
107
- Kr as useWizard
100
+ Cr as TipBlock,
101
+ oo as Tooltip,
102
+ N as WORKBENCH_WIDGET_SHELL_ATTR,
103
+ fr as WarningBlock,
104
+ zr as Wizard,
105
+ W as isLocalInteractionSurfaceTarget,
106
+ b as resolveSurfaceInteractionTargetRole,
107
+ O as resolveSurfaceWheelRouting,
108
+ P as resolveWorkbenchWidgetEventOwnership,
109
+ ur as useFormSubmitting,
110
+ Qr as useWizard
108
111
  };
@@ -7,6 +7,7 @@ export interface GridPosition {
7
7
  colSpan: number;
8
8
  rowSpan: number;
9
9
  }
10
+ export declare function sameGridPosition(a: GridPosition, b: GridPosition): boolean;
10
11
  /**
11
12
  * Check if two grid positions overlap using AABB collision detection
12
13
  */
@@ -1,30 +1,34 @@
1
- function e(o, n) {
1
+ function s(o, n) {
2
+ return o.col === n.col && o.row === n.row && o.colSpan === n.colSpan && o.rowSpan === n.rowSpan;
3
+ }
4
+ function w(o, n) {
2
5
  return !(o.col + o.colSpan <= n.col || o.col >= n.col + n.colSpan || o.row + o.rowSpan <= n.row || o.row >= n.row + n.rowSpan);
3
6
  }
4
- function f(o, n, c) {
5
- return n.some((i) => c && i.id === c ? !1 : e(o, i.position));
7
+ function e(o, n, c) {
8
+ return n.some((i) => c && i.id === c ? !1 : w(o, i.position));
6
9
  }
7
- function s(o, n, c, i = 24) {
10
+ function f(o, n, c, i = 24) {
8
11
  for (let r = 0; r < 100; r++)
9
12
  for (let t = 0; t <= i - n; t++) {
10
- const l = { col: t, row: r, colSpan: n, rowSpan: c };
11
- if (!f(l, o))
12
- return l;
13
+ const a = { col: t, row: r, colSpan: n, rowSpan: c };
14
+ if (!e(a, o))
15
+ return a;
13
16
  }
14
- let a = 0;
17
+ let l = 0;
15
18
  for (const r of o) {
16
19
  const t = r.position.row + r.position.rowSpan;
17
- t > a && (a = t);
20
+ t > l && (l = t);
18
21
  }
19
- return { col: 0, row: a, colSpan: n, rowSpan: c };
22
+ return { col: 0, row: l, colSpan: n, rowSpan: c };
20
23
  }
21
- function w(o, n = 4, c = 4, i = 24) {
22
- const a = Math.max(0, Math.min(i - 1, o.col)), r = Math.max(0, o.row), t = Math.max(n, Math.min(i - a, o.colSpan)), l = Math.max(c, o.rowSpan);
23
- return { col: a, row: r, colSpan: t, rowSpan: l };
24
+ function u(o, n = 4, c = 4, i = 24) {
25
+ const l = Math.max(0, Math.min(i - 1, o.col)), r = Math.max(0, o.row), t = Math.max(n, Math.min(i - l, o.colSpan)), a = Math.max(c, o.rowSpan);
26
+ return { col: l, row: r, colSpan: t, rowSpan: a };
24
27
  }
25
28
  export {
26
- e as checkCollision,
27
- w as constrainPosition,
28
- s as findFreePosition,
29
- f as hasCollision
29
+ w as checkCollision,
30
+ u as constrainPosition,
31
+ f as findFreePosition,
32
+ e as hasCollision,
33
+ s as sameGridPosition
30
34
  };
@@ -151,6 +151,14 @@
151
151
  height: 2600px;
152
152
  }
153
153
 
154
+ .workbench-canvas__projected-layer {
155
+ position: absolute;
156
+ inset: 0;
157
+ pointer-events: none;
158
+ overflow: hidden;
159
+ z-index: 3;
160
+ }
161
+
154
162
  .workbench-canvas__grid {
155
163
  position: absolute;
156
164
  inset: 0;
@@ -201,6 +209,14 @@
201
209
  border-color 180ms ease;
202
210
  }
203
211
 
212
+ .workbench-canvas__projected-layer > .workbench-widget {
213
+ pointer-events: auto;
214
+ }
215
+
216
+ .workbench-widget.is-projected-surface {
217
+ zoom: var(--floe-workbench-projected-scale, 1);
218
+ }
219
+
204
220
  .workbench-widget.is-dragging {
205
221
  transition: none;
206
222
  }
package/dist/workbench.js CHANGED
@@ -1,24 +1,27 @@
1
1
  import { DEFAULT_WORKBENCH_VIEWPORT as o, WORKBENCH_WIDGET_TYPES as t } from "./components/workbench/types.js";
2
- import { WIDGET_REGISTRY as n, createWorkbenchFilterState as c, getWidgetEntry as a, isValidWorkbenchWidgetType as b, resolveWorkbenchWidgetDefinitions as h } from "./components/workbench/widgets/widgetRegistry.js";
2
+ import { WIDGET_REGISTRY as W, createWorkbenchFilterState as n, getWidgetEntry as a, isValidWorkbenchWidgetType as b, resolveWorkbenchWidgetDefinitions as h } from "./components/workbench/widgets/widgetRegistry.js";
3
3
  import { WorkbenchContextMenu as k } from "./components/workbench/WorkbenchContextMenu.js";
4
- import { WorkbenchOverlay as p } from "./components/workbench/WorkbenchOverlay.js";
5
- import { WorkbenchSurface as x } from "./components/workbench/WorkbenchSurface.js";
6
- import { createDefaultWorkbenchState as m, createWorkbenchId as T, createWorkbenchRenderLayerMap as l, sanitizeWorkbenchState as R } from "./components/workbench/workbenchHelpers.js";
7
- import { useWorkbenchModel as s } from "./components/workbench/useWorkbenchModel.js";
4
+ import { WorkbenchOverlay as f } from "./components/workbench/WorkbenchOverlay.js";
5
+ import { WorkbenchSurface as E } from "./components/workbench/WorkbenchSurface.js";
6
+ import { createDefaultWorkbenchState as R, createWorkbenchId as l, createWorkbenchProjectedRect as m, createWorkbenchRenderLayerMap as s, createWorkbenchWidgetSurfaceMetrics as S, resolveWorkbenchWidgetRenderMode as T, sanitizeWorkbenchState as g } from "./components/workbench/workbenchHelpers.js";
7
+ import { useWorkbenchModel as D } from "./components/workbench/useWorkbenchModel.js";
8
8
  export {
9
9
  o as DEFAULT_WORKBENCH_VIEWPORT,
10
- n as WIDGET_REGISTRY,
10
+ W as WIDGET_REGISTRY,
11
11
  t as WORKBENCH_WIDGET_TYPES,
12
12
  k as WorkbenchContextMenu,
13
- p as WorkbenchOverlay,
14
- x as WorkbenchSurface,
15
- m as createDefaultWorkbenchState,
16
- c as createWorkbenchFilterState,
17
- T as createWorkbenchId,
18
- l as createWorkbenchRenderLayerMap,
13
+ f as WorkbenchOverlay,
14
+ E as WorkbenchSurface,
15
+ R as createDefaultWorkbenchState,
16
+ n as createWorkbenchFilterState,
17
+ l as createWorkbenchId,
18
+ m as createWorkbenchProjectedRect,
19
+ s as createWorkbenchRenderLayerMap,
20
+ S as createWorkbenchWidgetSurfaceMetrics,
19
21
  a as getWidgetEntry,
20
22
  b as isValidWorkbenchWidgetType,
21
23
  h as resolveWorkbenchWidgetDefinitions,
22
- R as sanitizeWorkbenchState,
23
- s as useWorkbenchModel
24
+ T as resolveWorkbenchWidgetRenderMode,
25
+ g as sanitizeWorkbenchState,
26
+ D as useWorkbenchModel
24
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.36.7",
3
+ "version": "0.36.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",