@floegence/floe-webapp-core 0.36.45 → 0.36.48
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/workbench/WorkbenchCanvas.d.ts +2 -1
- package/dist/components/workbench/WorkbenchCanvas.js +108 -88
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +2 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +40 -34
- package/dist/components/workbench/WorkbenchOverlay.d.ts +1 -1
- package/dist/components/workbench/WorkbenchOverlay.js +9 -6
- package/dist/components/workbench/WorkbenchSurface.d.ts +2 -1
- package/dist/components/workbench/WorkbenchSurface.js +6 -5
- package/dist/components/workbench/WorkbenchWidget.d.ts +2 -1
- package/dist/components/workbench/WorkbenchWidget.js +175 -168
- package/dist/components/workbench/types.d.ts +8 -0
- package/dist/components/workbench/useWorkbenchModel.d.ts +2 -1
- package/dist/components/workbench/useWorkbenchModel.js +325 -312
- package/dist/components/workbench/workbenchMotion.d.ts +3 -0
- package/dist/components/workbench/workbenchMotion.js +60 -0
- package/dist/styles.css +1 -1
- package/dist/workbench.css +25 -0
- package/package.json +1 -1
|
@@ -4,13 +4,13 @@ import { Motion as i } from "../../node_modules/.pnpm/solid-motionone@1.0.4_soli
|
|
|
4
4
|
import { easing as h, duration as c } from "../../utils/animations.js";
|
|
5
5
|
import { useOverlayMask as b } from "../../hooks/useOverlayMask.js";
|
|
6
6
|
import { X as v } from "../icons/index.js";
|
|
7
|
-
import { WorkbenchSurface as
|
|
8
|
-
var k = /* @__PURE__ */ s('<header class=workbench-overlay__header data-floe-canvas-interactive=true><div class=workbench-overlay__header-brand><div class=workbench-overlay__header-title>Workbench</div></div><div class=workbench-overlay__header-actions><button type=button class=workbench-overlay__close aria-label="Close workbench overlay"data-floe-overlay-close=true>'),
|
|
7
|
+
import { WorkbenchSurface as g } from "./WorkbenchSurface.js";
|
|
8
|
+
var k = /* @__PURE__ */ s('<header class=workbench-overlay__header data-floe-canvas-interactive=true><div class=workbench-overlay__header-brand><div class=workbench-overlay__header-title>Workbench</div></div><div class=workbench-overlay__header-actions><button type=button class=workbench-overlay__close aria-label="Close workbench overlay"data-floe-overlay-close=true>'), m = /* @__PURE__ */ s("<div class=workbench-overlay__body>");
|
|
9
9
|
const u = '[data-floe-workbench-boundary="true"]';
|
|
10
10
|
function _(e) {
|
|
11
11
|
return typeof Element < "u" && e instanceof Element ? !!e.closest(u) : typeof Node < "u" && e instanceof Node ? !!e.parentElement?.closest(u) : !1;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function R(e) {
|
|
14
14
|
let o;
|
|
15
15
|
return b({
|
|
16
16
|
open: () => e.open,
|
|
@@ -80,8 +80,8 @@ function x(e) {
|
|
|
80
80
|
class: "w-4 h-4"
|
|
81
81
|
})), t;
|
|
82
82
|
})(), (() => {
|
|
83
|
-
var t =
|
|
84
|
-
return l(t, r(
|
|
83
|
+
var t = m();
|
|
84
|
+
return l(t, r(g, {
|
|
85
85
|
class: "workbench-surface--in-overlay",
|
|
86
86
|
get state() {
|
|
87
87
|
return e.state;
|
|
@@ -104,6 +104,9 @@ function x(e) {
|
|
|
104
104
|
get textAnnotationDefaults() {
|
|
105
105
|
return e.textAnnotationDefaults;
|
|
106
106
|
},
|
|
107
|
+
get backgroundLayerDefaults() {
|
|
108
|
+
return e.backgroundLayerDefaults;
|
|
109
|
+
},
|
|
107
110
|
get interactionAdapter() {
|
|
108
111
|
return e.interactionAdapter;
|
|
109
112
|
},
|
|
@@ -133,5 +136,5 @@ function x(e) {
|
|
|
133
136
|
}
|
|
134
137
|
y(["click"]);
|
|
135
138
|
export {
|
|
136
|
-
|
|
139
|
+
R as WorkbenchOverlay
|
|
137
140
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type WorkbenchContextMenuItem } from './WorkbenchContextMenu';
|
|
2
|
-
import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
2
|
+
import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerDefaults, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
3
3
|
export interface WorkbenchCreateAtOptions {
|
|
4
4
|
worldX?: number;
|
|
5
5
|
worldY?: number;
|
|
@@ -60,6 +60,7 @@ export interface WorkbenchSurfaceProps {
|
|
|
60
60
|
widgetDefinitions?: readonly WorkbenchWidgetDefinition[];
|
|
61
61
|
launcherWidgetTypes?: readonly WorkbenchWidgetType[];
|
|
62
62
|
textAnnotationDefaults?: WorkbenchTextAnnotationDefaults;
|
|
63
|
+
backgroundLayerDefaults?: WorkbenchBackgroundLayerDefaults;
|
|
63
64
|
interactionAdapter?: WorkbenchInteractionAdapter;
|
|
64
65
|
resolveContextMenuItems?: WorkbenchContextMenuItemsResolver;
|
|
65
66
|
onApiReady?: (api: WorkbenchSurfaceApi | null) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { use as X, spread as q, mergeProps as Y, insert as w, createComponent as s, Portal as z, addEventListener as V, template as D, delegateEvents as P } from "solid-js/web";
|
|
2
|
-
import { createSignal as
|
|
2
|
+
import { createSignal as L, createMemo as f, untrack as p, createEffect as v, onCleanup as y, Show as H } from "solid-js";
|
|
3
3
|
import { clientToCanvasWorld as $ } from "../ui/canvasGeometry.js";
|
|
4
4
|
import { WorkbenchCanvas as U } from "./WorkbenchCanvas.js";
|
|
5
5
|
import { WorkbenchContextMenu as K } from "./WorkbenchContextMenu.js";
|
|
@@ -12,7 +12,7 @@ import { useWorkbenchModel as nt } from "./useWorkbenchModel.js";
|
|
|
12
12
|
import { resolveWorkbenchInteractionAdapter as ot } from "./workbenchInteractionAdapter.js";
|
|
13
13
|
var rt = /* @__PURE__ */ D("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), it = /* @__PURE__ */ D("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
|
|
14
14
|
const at = "F1";
|
|
15
|
-
function
|
|
15
|
+
function B(i) {
|
|
16
16
|
if (i)
|
|
17
17
|
try {
|
|
18
18
|
i.focus({
|
|
@@ -28,9 +28,10 @@ function At(i) {
|
|
|
28
28
|
setState: (t) => i.setState(t),
|
|
29
29
|
widgetDefinitions: () => i.widgetDefinitions,
|
|
30
30
|
textAnnotationDefaults: () => i.textAnnotationDefaults,
|
|
31
|
+
backgroundLayerDefaults: () => i.backgroundLayerDefaults,
|
|
31
32
|
onClose: () => {
|
|
32
33
|
}
|
|
33
|
-
}), [u, T] =
|
|
34
|
+
}), [u, T] = L(null), d = f(() => ot(i.interactionAdapter)), [A, l] = L(p(() => d().createInitialInputOwner())), C = f(() => {
|
|
34
35
|
const t = i.launcherWidgetTypes;
|
|
35
36
|
return !t || t.length <= 0 ? null : new Set(t);
|
|
36
37
|
}), N = f(() => {
|
|
@@ -81,11 +82,11 @@ function At(i) {
|
|
|
81
82
|
if (!o || typeof document > "u") return;
|
|
82
83
|
const r = document.activeElement;
|
|
83
84
|
if (!(r instanceof HTMLElement) || !o.contains(r)) {
|
|
84
|
-
|
|
85
|
+
B(o);
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
87
88
|
const a = n.findWidgetRoot(r);
|
|
88
|
-
|
|
89
|
+
B(o), a && document.activeElement === r && r.isConnected && r.blur();
|
|
89
90
|
});
|
|
90
91
|
}, k = () => {
|
|
91
92
|
const t = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = e.viewport(), o = t?.getBoundingClientRect(), r = o?.width ?? 0, a = o?.height ?? 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Accessor, type JSX } from 'solid-js';
|
|
2
2
|
import { type ResolvedWorkbenchInteractionAdapter } from './workbenchInteractionAdapter';
|
|
3
|
-
import type { WorkbenchViewport, WorkbenchInteractionAdapter, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetRenderMode, WorkbenchWidgetType } from './types';
|
|
3
|
+
import type { WorkbenchViewport, WorkbenchInteractionAdapter, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetMotionIntent, WorkbenchWidgetRenderMode, WorkbenchWidgetType } from './types';
|
|
4
4
|
export interface WorkbenchWidgetProps {
|
|
5
5
|
definition: WorkbenchWidgetDefinition;
|
|
6
6
|
widgetId: string;
|
|
@@ -14,6 +14,7 @@ export interface WorkbenchWidgetProps {
|
|
|
14
14
|
itemSnapshot: () => WorkbenchWidgetItem;
|
|
15
15
|
selected: boolean;
|
|
16
16
|
optimisticFront: boolean;
|
|
17
|
+
motion?: WorkbenchWidgetMotionIntent | null;
|
|
17
18
|
topRenderLayer: number;
|
|
18
19
|
viewportScale: number;
|
|
19
20
|
locked: boolean;
|