@floegence/floe-webapp-core 0.36.3 → 0.36.4
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/components/ui/index.d.ts +1 -1
- package/dist/components/ui/localInteractionSurface.d.ts +8 -0
- package/dist/components/ui/localInteractionSurface.js +28 -15
- package/dist/components/workbench/WorkbenchCanvas.d.ts +0 -1
- package/dist/components/workbench/WorkbenchCanvas.js +6 -9
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +0 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +60 -61
- package/dist/components/workbench/WorkbenchSurface.js +6 -9
- package/dist/components/workbench/WorkbenchWidget.d.ts +2 -2
- package/dist/components/workbench/WorkbenchWidget.js +144 -130
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/workbenchHelpers.d.ts +5 -0
- package/dist/components/workbench/workbenchHelpers.js +85 -72
- package/dist/full.js +467 -464
- package/dist/styles.css +1 -1
- package/dist/ui.js +91 -88
- package/dist/workbench.css +1 -0
- package/dist/workbench.js +12 -11
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectPro
|
|
|
7
7
|
export { Tooltip, type TooltipProps } from './Tooltip';
|
|
8
8
|
export { CommandPalette } from './CommandPalette';
|
|
9
9
|
export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
|
|
10
|
-
export { LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, } from './localInteractionSurface';
|
|
10
|
+
export { LOCAL_INTERACTION_SURFACE_ATTR, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR, WORKBENCH_WIDGET_SHELL_ATTR, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR, isLocalInteractionSurfaceTarget, resolveSurfaceInteractionTargetRole, resolveWorkbenchWidgetEventOwnership, type SurfaceInteractionRoutingOptions, type SurfaceInteractionTargetRole, type WorkbenchWidgetEventOwnership, type WorkbenchWidgetEventOwnershipOptions, } from './localInteractionSurface';
|
|
11
11
|
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Interactive3DCard, AnimatedBorderCard, NeonCard, MorphCard, type CardProps, type CardVariant, type CardHeaderProps, type CardTitleProps, type CardDescriptionProps, type CardContentProps, type CardFooterProps, type Interactive3DCardProps, type AnimatedBorderCardProps, type NeonCardProps, type MorphCardProps, } from './Card';
|
|
12
12
|
export { Tabs, TabPanel, type TabsProps, type TabPanelProps, type TabItem, type TabsFeatures, type TabsSlotClassNames, type TabsIndicatorMode, type TabsIndicatorColorToken, } from './Tabs';
|
|
13
13
|
export { DirectoryPicker, type DirectoryPickerProps } from './DirectoryPicker';
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export declare const LOCAL_INTERACTION_SURFACE_ATTR = "data-floe-local-interaction-surface";
|
|
2
2
|
export declare const DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR = "[data-floe-local-interaction-surface=\"true\"]";
|
|
3
|
+
export declare const WORKBENCH_WIDGET_SHELL_ATTR = "data-floe-workbench-widget-shell";
|
|
4
|
+
export declare const DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR = "[data-floe-workbench-widget-shell=\"true\"]";
|
|
3
5
|
export type SurfaceInteractionTargetRole = 'canvas' | 'local_surface' | 'pan_surface';
|
|
6
|
+
export type WorkbenchWidgetEventOwnership = 'outside_widget' | 'widget_local' | 'widget_shell';
|
|
4
7
|
export interface SurfaceInteractionRoutingOptions {
|
|
5
8
|
target: EventTarget | null;
|
|
6
9
|
interactiveSelector: string;
|
|
7
10
|
panSurfaceSelector: string;
|
|
8
11
|
localInteractionSurfaceSelector?: string;
|
|
9
12
|
}
|
|
13
|
+
export interface WorkbenchWidgetEventOwnershipOptions extends SurfaceInteractionRoutingOptions {
|
|
14
|
+
widgetRoot: Element | EventTarget | null;
|
|
15
|
+
shellSelector?: string;
|
|
16
|
+
}
|
|
10
17
|
export declare function resolveSurfaceInteractionTargetRole(options: SurfaceInteractionRoutingOptions): SurfaceInteractionTargetRole;
|
|
11
18
|
export declare function isLocalInteractionSurfaceTarget(options: SurfaceInteractionRoutingOptions): boolean;
|
|
19
|
+
export declare function resolveWorkbenchWidgetEventOwnership(options: WorkbenchWidgetEventOwnershipOptions): WorkbenchWidgetEventOwnership;
|
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
import { isTypingElement as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { isTypingElement as i } from "../../utils/dom.js";
|
|
2
|
+
const s = "data-floe-local-interaction-surface", u = `[${s}="true"]`, f = "data-floe-workbench-widget-shell", E = `[${f}="true"]`;
|
|
3
|
+
function o(e) {
|
|
4
|
+
return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
|
|
5
|
+
}
|
|
6
|
+
function a(e) {
|
|
4
7
|
const {
|
|
5
|
-
target:
|
|
6
|
-
interactiveSelector:
|
|
7
|
-
panSurfaceSelector:
|
|
8
|
-
localInteractionSurfaceSelector:
|
|
9
|
-
} =
|
|
10
|
-
return
|
|
8
|
+
target: l,
|
|
9
|
+
interactiveSelector: c,
|
|
10
|
+
panSurfaceSelector: n,
|
|
11
|
+
localInteractionSurfaceSelector: t = u
|
|
12
|
+
} = e, r = l instanceof Element ? l : null;
|
|
13
|
+
return r ? r.closest(n) !== null ? "pan_surface" : i(r) || r.closest(c) !== null || r.closest(t) !== null ? "local_surface" : "canvas" : "canvas";
|
|
14
|
+
}
|
|
15
|
+
function d(e) {
|
|
16
|
+
return a(e) !== "canvas";
|
|
11
17
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
18
|
+
function T(e) {
|
|
19
|
+
const {
|
|
20
|
+
widgetRoot: l,
|
|
21
|
+
shellSelector: c = E
|
|
22
|
+
} = e, n = o(l), t = o(e.target);
|
|
23
|
+
return !n || !t || !n.contains(t) ? "outside_widget" : a(e) !== "canvas" ? "widget_local" : t === n || t.closest(c) !== null ? "widget_shell" : "widget_local";
|
|
14
24
|
}
|
|
15
25
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
u as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
|
|
27
|
+
E as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
|
|
28
|
+
s as LOCAL_INTERACTION_SURFACE_ATTR,
|
|
29
|
+
f as WORKBENCH_WIDGET_SHELL_ATTR,
|
|
30
|
+
d as isLocalInteractionSurfaceTarget,
|
|
31
|
+
a as resolveSurfaceInteractionTargetRole,
|
|
32
|
+
T as resolveWorkbenchWidgetEventOwnership
|
|
20
33
|
};
|
|
@@ -6,7 +6,6 @@ export interface WorkbenchCanvasProps {
|
|
|
6
6
|
viewport: WorkbenchViewport;
|
|
7
7
|
selectedWidgetId: string | null;
|
|
8
8
|
optimisticFrontWidgetId: string | null;
|
|
9
|
-
topZIndex: number;
|
|
10
9
|
locked: boolean;
|
|
11
10
|
filters: Record<WorkbenchWidgetType, boolean>;
|
|
12
11
|
setCanvasFrameRef: (el: HTMLDivElement | undefined) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { use as r, insert as o, createComponent as i, effect as a, template as g } from "solid-js/web";
|
|
2
2
|
import { WorkbenchCanvasField as c } from "./WorkbenchCanvasField.js";
|
|
3
|
-
import { InfiniteCanvas as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
3
|
+
import { InfiniteCanvas as m } from "../ui/InfiniteCanvas.js";
|
|
4
|
+
var u = /* @__PURE__ */ g("<div class=workbench-canvas>");
|
|
5
|
+
function v(e) {
|
|
6
6
|
return (() => {
|
|
7
|
-
var t =
|
|
8
|
-
return typeof n == "function" ? r(n, t) : e.setCanvasFrameRef = t, o(t, i(
|
|
7
|
+
var t = u(), n = e.setCanvasFrameRef;
|
|
8
|
+
return typeof n == "function" ? r(n, t) : e.setCanvasFrameRef = t, o(t, i(m, {
|
|
9
9
|
ariaLabel: "Workbench canvas",
|
|
10
10
|
class: "workbench-canvas__infinite",
|
|
11
11
|
get viewport() {
|
|
@@ -34,9 +34,6 @@ function C(e) {
|
|
|
34
34
|
get optimisticFrontWidgetId() {
|
|
35
35
|
return e.optimisticFrontWidgetId;
|
|
36
36
|
},
|
|
37
|
-
get topZIndex() {
|
|
38
|
-
return e.topZIndex;
|
|
39
|
-
},
|
|
40
37
|
get viewportScale() {
|
|
41
38
|
return e.viewport.scale;
|
|
42
39
|
},
|
|
@@ -73,5 +70,5 @@ function C(e) {
|
|
|
73
70
|
})();
|
|
74
71
|
}
|
|
75
72
|
export {
|
|
76
|
-
|
|
73
|
+
v as WorkbenchCanvas
|
|
77
74
|
};
|
|
@@ -4,7 +4,6 @@ export interface WorkbenchCanvasFieldProps {
|
|
|
4
4
|
widgets: readonly WorkbenchWidgetItem[];
|
|
5
5
|
selectedWidgetId: string | null;
|
|
6
6
|
optimisticFrontWidgetId: string | null;
|
|
7
|
-
topZIndex: number;
|
|
8
7
|
viewportScale: number;
|
|
9
8
|
locked: boolean;
|
|
10
9
|
filters: Record<WorkbenchWidgetType, boolean>;
|
|
@@ -1,145 +1,144 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { insert as u, createComponent as g, template as m } from "solid-js/web";
|
|
2
|
+
import { createMemo as i, For as c } from "solid-js";
|
|
3
|
+
import { createWorkbenchRenderLayerMap as a } from "./workbenchHelpers.js";
|
|
4
|
+
import { getWidgetEntry as l } from "./widgets/widgetRegistry.js";
|
|
5
|
+
import { WorkbenchWidget as w } from "./WorkbenchWidget.js";
|
|
6
|
+
var f = /* @__PURE__ */ m("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true>");
|
|
7
|
+
function W(e) {
|
|
8
|
+
const t = i((r) => {
|
|
9
|
+
const n = e.widgetById().get(e.widgetId);
|
|
10
10
|
if (n) return n;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (r) return r;
|
|
12
|
+
throw new Error(`Workbench widget ${e.widgetId} is missing from the render map.`);
|
|
13
|
+
}), d = i(() => l(t().type, e.widgetDefinitions));
|
|
14
|
+
return g(w, {
|
|
14
15
|
get definition() {
|
|
15
16
|
return d();
|
|
16
17
|
},
|
|
17
18
|
get widgetId() {
|
|
18
|
-
return
|
|
19
|
+
return e.widgetId;
|
|
19
20
|
},
|
|
20
21
|
get widgetTitle() {
|
|
21
|
-
return
|
|
22
|
+
return t().title;
|
|
22
23
|
},
|
|
23
24
|
get widgetType() {
|
|
24
|
-
return
|
|
25
|
+
return t().type;
|
|
25
26
|
},
|
|
26
27
|
get x() {
|
|
27
|
-
return
|
|
28
|
+
return t().x;
|
|
28
29
|
},
|
|
29
30
|
get y() {
|
|
30
|
-
return
|
|
31
|
+
return t().y;
|
|
31
32
|
},
|
|
32
33
|
get width() {
|
|
33
|
-
return
|
|
34
|
+
return t().width;
|
|
34
35
|
},
|
|
35
36
|
get height() {
|
|
36
|
-
return
|
|
37
|
+
return t().height;
|
|
37
38
|
},
|
|
38
|
-
get
|
|
39
|
-
return e().
|
|
39
|
+
get renderLayer() {
|
|
40
|
+
return e.renderLayers().byWidgetId.get(e.widgetId) ?? 1;
|
|
40
41
|
},
|
|
41
|
-
itemSnapshot:
|
|
42
|
+
itemSnapshot: t,
|
|
42
43
|
get selected() {
|
|
43
|
-
return
|
|
44
|
+
return e.selectedWidgetId === e.widgetId;
|
|
44
45
|
},
|
|
45
46
|
get optimisticFront() {
|
|
46
|
-
return
|
|
47
|
+
return e.optimisticFrontWidgetId === e.widgetId;
|
|
47
48
|
},
|
|
48
|
-
get
|
|
49
|
-
return
|
|
49
|
+
get topRenderLayer() {
|
|
50
|
+
return e.renderLayers().topRenderLayer;
|
|
50
51
|
},
|
|
51
52
|
get viewportScale() {
|
|
52
|
-
return
|
|
53
|
+
return e.viewportScale;
|
|
53
54
|
},
|
|
54
55
|
get locked() {
|
|
55
|
-
return
|
|
56
|
+
return e.locked;
|
|
56
57
|
},
|
|
57
58
|
get filtered() {
|
|
58
|
-
return !
|
|
59
|
+
return !e.filters[t().type];
|
|
59
60
|
},
|
|
60
61
|
get onSelect() {
|
|
61
|
-
return
|
|
62
|
+
return e.onSelectWidget;
|
|
62
63
|
},
|
|
63
64
|
get onContextMenu() {
|
|
64
|
-
return
|
|
65
|
+
return e.onWidgetContextMenu;
|
|
65
66
|
},
|
|
66
67
|
get onStartOptimisticFront() {
|
|
67
|
-
return
|
|
68
|
+
return e.onStartOptimisticFront;
|
|
68
69
|
},
|
|
69
70
|
get onCommitFront() {
|
|
70
|
-
return
|
|
71
|
+
return e.onCommitFront;
|
|
71
72
|
},
|
|
72
73
|
get onCommitMove() {
|
|
73
|
-
return
|
|
74
|
+
return e.onCommitMove;
|
|
74
75
|
},
|
|
75
76
|
get onCommitResize() {
|
|
76
|
-
return
|
|
77
|
+
return e.onCommitResize;
|
|
77
78
|
},
|
|
78
79
|
get onRequestDelete() {
|
|
79
|
-
return
|
|
80
|
+
return e.onRequestDelete;
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
84
|
+
function v(e) {
|
|
85
|
+
const t = i(() => e.widgets.map((n) => n.id)), d = i(() => new Map(e.widgets.map((n) => [n.id, n]))), r = i(() => a(e.widgets));
|
|
85
86
|
return (() => {
|
|
86
|
-
var n =
|
|
87
|
-
return n.firstChild,
|
|
87
|
+
var n = f();
|
|
88
|
+
return n.firstChild, u(n, g(c, {
|
|
88
89
|
get each() {
|
|
89
|
-
return
|
|
90
|
+
return t();
|
|
90
91
|
},
|
|
91
|
-
children: (
|
|
92
|
-
widgetId:
|
|
92
|
+
children: (o) => g(W, {
|
|
93
|
+
widgetId: o,
|
|
93
94
|
get widgetDefinitions() {
|
|
94
|
-
return
|
|
95
|
+
return e.widgetDefinitions;
|
|
95
96
|
},
|
|
96
97
|
get widgets() {
|
|
97
|
-
return
|
|
98
|
+
return e.widgets;
|
|
98
99
|
},
|
|
99
100
|
widgetById: d,
|
|
101
|
+
renderLayers: r,
|
|
100
102
|
get selectedWidgetId() {
|
|
101
|
-
return
|
|
103
|
+
return e.selectedWidgetId;
|
|
102
104
|
},
|
|
103
105
|
get optimisticFrontWidgetId() {
|
|
104
|
-
return
|
|
105
|
-
},
|
|
106
|
-
get topZIndex() {
|
|
107
|
-
return t.topZIndex;
|
|
106
|
+
return e.optimisticFrontWidgetId;
|
|
108
107
|
},
|
|
109
108
|
get viewportScale() {
|
|
110
|
-
return
|
|
109
|
+
return e.viewportScale;
|
|
111
110
|
},
|
|
112
111
|
get locked() {
|
|
113
|
-
return
|
|
112
|
+
return e.locked;
|
|
114
113
|
},
|
|
115
114
|
get filters() {
|
|
116
|
-
return
|
|
115
|
+
return e.filters;
|
|
117
116
|
},
|
|
118
117
|
get onSelectWidget() {
|
|
119
|
-
return
|
|
118
|
+
return e.onSelectWidget;
|
|
120
119
|
},
|
|
121
120
|
get onWidgetContextMenu() {
|
|
122
|
-
return
|
|
121
|
+
return e.onWidgetContextMenu;
|
|
123
122
|
},
|
|
124
123
|
get onStartOptimisticFront() {
|
|
125
|
-
return
|
|
124
|
+
return e.onStartOptimisticFront;
|
|
126
125
|
},
|
|
127
126
|
get onCommitFront() {
|
|
128
|
-
return
|
|
127
|
+
return e.onCommitFront;
|
|
129
128
|
},
|
|
130
129
|
get onCommitMove() {
|
|
131
|
-
return
|
|
130
|
+
return e.onCommitMove;
|
|
132
131
|
},
|
|
133
132
|
get onCommitResize() {
|
|
134
|
-
return
|
|
133
|
+
return e.onCommitResize;
|
|
135
134
|
},
|
|
136
135
|
get onRequestDelete() {
|
|
137
|
-
return
|
|
136
|
+
return e.onRequestDelete;
|
|
138
137
|
}
|
|
139
138
|
})
|
|
140
139
|
}), null), n;
|
|
141
140
|
})();
|
|
142
141
|
}
|
|
143
142
|
export {
|
|
144
|
-
|
|
143
|
+
v as WorkbenchCanvasField
|
|
145
144
|
};
|
|
@@ -2,14 +2,14 @@ import { insert as c, createComponent as a, Portal as k, addEventListener as s,
|
|
|
2
2
|
import { createEffect as d, onCleanup as g, Show as W } from "solid-js";
|
|
3
3
|
import { isTypingElement as A } from "../../utils/dom.js";
|
|
4
4
|
import { WorkbenchCanvas as y } from "./WorkbenchCanvas.js";
|
|
5
|
-
import { WorkbenchContextMenu as
|
|
6
|
-
import { WorkbenchFilterBar as
|
|
5
|
+
import { WorkbenchContextMenu as D } from "./WorkbenchContextMenu.js";
|
|
6
|
+
import { WorkbenchFilterBar as x } from "./WorkbenchFilterBar.js";
|
|
7
7
|
import { WorkbenchHud as M } from "./WorkbenchHud.js";
|
|
8
8
|
import { WorkbenchLockButton as S } from "./WorkbenchLockButton.js";
|
|
9
9
|
import { useWorkbenchModel as F } from "./useWorkbenchModel.js";
|
|
10
10
|
var L = /* @__PURE__ */ m("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), R = /* @__PURE__ */ m("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
|
|
11
11
|
const E = "F1";
|
|
12
|
-
function
|
|
12
|
+
function U(i) {
|
|
13
13
|
const e = F({
|
|
14
14
|
state: () => i.state(),
|
|
15
15
|
setState: (t) => i.setState(t),
|
|
@@ -91,9 +91,6 @@ function K(i) {
|
|
|
91
91
|
get optimisticFrontWidgetId() {
|
|
92
92
|
return e.optimisticFrontWidgetId();
|
|
93
93
|
},
|
|
94
|
-
get topZIndex() {
|
|
95
|
-
return e.topZIndex();
|
|
96
|
-
},
|
|
97
94
|
get locked() {
|
|
98
95
|
return e.locked();
|
|
99
96
|
},
|
|
@@ -140,7 +137,7 @@ function K(i) {
|
|
|
140
137
|
get shortcutLabel() {
|
|
141
138
|
return u() ?? void 0;
|
|
142
139
|
}
|
|
143
|
-
}), null), c(t, a(
|
|
140
|
+
}), null), c(t, a(x, {
|
|
144
141
|
get widgetDefinitions() {
|
|
145
142
|
return e.widgetDefinitions();
|
|
146
143
|
},
|
|
@@ -177,7 +174,7 @@ function K(i) {
|
|
|
177
174
|
return [(() => {
|
|
178
175
|
var n = L();
|
|
179
176
|
return s(n, "contextmenu", e.contextMenu.retarget, !0), s(n, "click", e.contextMenu.close, !0), n;
|
|
180
|
-
})(), a(
|
|
177
|
+
})(), a(D, {
|
|
181
178
|
get x() {
|
|
182
179
|
return e.contextMenu.position()?.left ?? 0;
|
|
183
180
|
},
|
|
@@ -196,5 +193,5 @@ function K(i) {
|
|
|
196
193
|
}
|
|
197
194
|
C(["click", "contextmenu"]);
|
|
198
195
|
export {
|
|
199
|
-
|
|
196
|
+
U as WorkbenchSurface
|
|
200
197
|
};
|
|
@@ -9,11 +9,11 @@ export interface WorkbenchWidgetProps {
|
|
|
9
9
|
y: number;
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
|
-
|
|
12
|
+
renderLayer: number;
|
|
13
13
|
itemSnapshot: () => WorkbenchWidgetItem;
|
|
14
14
|
selected: boolean;
|
|
15
15
|
optimisticFront: boolean;
|
|
16
|
-
|
|
16
|
+
topRenderLayer: number;
|
|
17
17
|
viewportScale: number;
|
|
18
18
|
locked: boolean;
|
|
19
19
|
filtered: boolean;
|