@floegence/floe-webapp-core 0.55.2 → 0.56.2
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/SurfaceAnchoredLayer.d.ts +8 -0
- package/dist/components/ui/SurfaceAnchoredLayer.js +64 -52
- package/dist/components/workbench/WorkbenchCanvas.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvas.js +139 -133
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +82 -76
- package/dist/components/workbench/WorkbenchCompositionToolbar.d.ts +22 -0
- package/dist/components/workbench/WorkbenchCompositionToolbar.js +261 -0
- package/dist/components/workbench/WorkbenchLayerObjects.d.ts +3 -1
- package/dist/components/workbench/WorkbenchLayerObjects.js +1020 -854
- package/dist/components/workbench/WorkbenchSurface.js +439 -437
- package/dist/components/workbench/types.d.ts +3 -1
- package/dist/components/workbench/useWorkbenchModel.d.ts +16 -1
- package/dist/components/workbench/useWorkbenchModel.js +302 -282
- package/dist/components/workbench/workbenchCompositionMessages.d.ts +37 -4
- package/dist/components/workbench/workbenchCompositionMessages.js +42 -12
- package/dist/components/workbench/workbenchHelpers.js +25 -21
- package/dist/components/workbench/workbenchInteractionAdapter.js +39 -39
- package/dist/components/workbench/workbenchOptions.d.ts +35 -5
- package/dist/components/workbench/workbenchOptions.js +29 -13
- package/dist/styles.css +1 -1
- package/dist/workbench-composition.css +911 -0
- package/dist/workbench.css +18 -536
- package/package.json +1 -1
|
@@ -1,5 +1,32 @@
|
|
|
1
|
+
import type { WorkbenchSelection } from './types';
|
|
1
2
|
import { type Accessor } from 'solid-js';
|
|
2
3
|
export declare const workbenchCompositionMessages: {
|
|
4
|
+
readonly stickyTitle: "Sticky note title";
|
|
5
|
+
readonly edit: "Edit text";
|
|
6
|
+
readonly duplicate: "Duplicate";
|
|
7
|
+
readonly treatment: "Treatment";
|
|
8
|
+
readonly treatmentHint: "Preview in the current color";
|
|
9
|
+
readonly tintDescription: "Color across the whole note";
|
|
10
|
+
readonly tabDescription: "A quiet card with a color stripe";
|
|
11
|
+
readonly ruledDescription: "Paper lines for longer thoughts";
|
|
12
|
+
readonly solidDescription: "A color field to define a space";
|
|
13
|
+
readonly frameDescription: "A clear boundary with an open center";
|
|
14
|
+
readonly hatchedDescription: "A subtle texture for a distinct purpose";
|
|
15
|
+
readonly dottedDescription: "A field of evenly spaced dots";
|
|
16
|
+
readonly gridDescription: "A grid for arranging content";
|
|
17
|
+
readonly glassDescription: "A soft wash of color";
|
|
18
|
+
readonly typography: "Typography";
|
|
19
|
+
readonly title: "Title";
|
|
20
|
+
readonly heading: "Heading";
|
|
21
|
+
readonly body: "Body";
|
|
22
|
+
readonly caption: "Caption";
|
|
23
|
+
readonly left: "Left";
|
|
24
|
+
readonly center: "Center";
|
|
25
|
+
readonly right: "Right";
|
|
26
|
+
readonly more: "More options";
|
|
27
|
+
readonly opacity: "Opacity";
|
|
28
|
+
readonly textPlaceholder: "Write something…";
|
|
29
|
+
readonly regionPlaceholder: "Name this region…";
|
|
3
30
|
readonly dragSticky: "Drag sticky note";
|
|
4
31
|
readonly stickyBody: "Sticky note body";
|
|
5
32
|
readonly copySticky: "Copy sticky note content";
|
|
@@ -15,6 +42,7 @@ export declare const workbenchCompositionMessages: {
|
|
|
15
42
|
readonly addName: "Add name";
|
|
16
43
|
readonly clearName: "Clear name";
|
|
17
44
|
readonly moveText: "Move text";
|
|
45
|
+
readonly moveRegion: "Move region";
|
|
18
46
|
readonly chooseFont: "Choose bold font";
|
|
19
47
|
readonly boldFont: "Bold font";
|
|
20
48
|
readonly useFont: "Use {value} bold font";
|
|
@@ -35,12 +63,12 @@ export declare const workbenchCompositionMessages: {
|
|
|
35
63
|
readonly useRegionMaterial: "Use region material {value}";
|
|
36
64
|
readonly deleteRegion: "Delete background region";
|
|
37
65
|
readonly resizeRegion: "Resize background region";
|
|
38
|
-
readonly tint: "
|
|
39
|
-
readonly tab: "
|
|
40
|
-
readonly ruled: "
|
|
66
|
+
readonly tint: "Soft fill";
|
|
67
|
+
readonly tab: "Side stripe";
|
|
68
|
+
readonly ruled: "Lined paper";
|
|
41
69
|
readonly solid: "Color field";
|
|
42
70
|
readonly frame: "Outline";
|
|
43
|
-
readonly hatched: "
|
|
71
|
+
readonly hatched: "Fine hatch";
|
|
44
72
|
readonly dotted: "Dotted";
|
|
45
73
|
readonly grid: "Grid";
|
|
46
74
|
readonly glass: "Wash";
|
|
@@ -50,6 +78,7 @@ export declare const workbenchCompositionMessages: {
|
|
|
50
78
|
readonly coral: "Coral";
|
|
51
79
|
readonly rose: "Rose";
|
|
52
80
|
readonly graphite: "Graphite";
|
|
81
|
+
readonly system: "System";
|
|
53
82
|
readonly serif: "Serif";
|
|
54
83
|
readonly sans: "Sans";
|
|
55
84
|
readonly round: "Round";
|
|
@@ -60,3 +89,7 @@ export type WorkbenchCompositionMessageKey = keyof typeof workbenchCompositionMe
|
|
|
60
89
|
export type WorkbenchCompositionMessages = Record<WorkbenchCompositionMessageKey, string>;
|
|
61
90
|
export declare const WorkbenchCompositionMessagesContext: import("solid-js").Context<Accessor<Partial<WorkbenchCompositionMessages> | undefined> | undefined>;
|
|
62
91
|
export declare function useWorkbenchCompositionText(): (key: WorkbenchCompositionMessageKey, value?: string) => string;
|
|
92
|
+
/** The model remains the owner of object creation and selection. */
|
|
93
|
+
export declare const WorkbenchCompositionActionsContext: import("solid-js").Context<{
|
|
94
|
+
duplicate: (selection: WorkbenchSelection) => void;
|
|
95
|
+
} | undefined>;
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const
|
|
1
|
+
import { createContext as t, useContext as n } from "solid-js";
|
|
2
|
+
const r = {
|
|
3
|
+
stickyTitle: "Sticky note title",
|
|
4
|
+
edit: "Edit text",
|
|
5
|
+
duplicate: "Duplicate",
|
|
6
|
+
treatment: "Treatment",
|
|
7
|
+
treatmentHint: "Preview in the current color",
|
|
8
|
+
tintDescription: "Color across the whole note",
|
|
9
|
+
tabDescription: "A quiet card with a color stripe",
|
|
10
|
+
ruledDescription: "Paper lines for longer thoughts",
|
|
11
|
+
solidDescription: "A color field to define a space",
|
|
12
|
+
frameDescription: "A clear boundary with an open center",
|
|
13
|
+
hatchedDescription: "A subtle texture for a distinct purpose",
|
|
14
|
+
dottedDescription: "A field of evenly spaced dots",
|
|
15
|
+
gridDescription: "A grid for arranging content",
|
|
16
|
+
glassDescription: "A soft wash of color",
|
|
17
|
+
typography: "Typography",
|
|
18
|
+
title: "Title",
|
|
19
|
+
heading: "Heading",
|
|
20
|
+
body: "Body",
|
|
21
|
+
caption: "Caption",
|
|
22
|
+
left: "Left",
|
|
23
|
+
center: "Center",
|
|
24
|
+
right: "Right",
|
|
25
|
+
more: "More options",
|
|
26
|
+
opacity: "Opacity",
|
|
27
|
+
textPlaceholder: "Write something…",
|
|
28
|
+
regionPlaceholder: "Name this region…",
|
|
3
29
|
dragSticky: "Drag sticky note",
|
|
4
30
|
stickyBody: "Sticky note body",
|
|
5
31
|
copySticky: "Copy sticky note content",
|
|
@@ -15,6 +41,7 @@ const a = {
|
|
|
15
41
|
addName: "Add name",
|
|
16
42
|
clearName: "Clear name",
|
|
17
43
|
moveText: "Move text",
|
|
44
|
+
moveRegion: "Move region",
|
|
18
45
|
chooseFont: "Choose bold font",
|
|
19
46
|
boldFont: "Bold font",
|
|
20
47
|
useFont: "Use {value} bold font",
|
|
@@ -35,12 +62,12 @@ const a = {
|
|
|
35
62
|
useRegionMaterial: "Use region material {value}",
|
|
36
63
|
deleteRegion: "Delete background region",
|
|
37
64
|
resizeRegion: "Resize background region",
|
|
38
|
-
tint: "
|
|
39
|
-
tab: "
|
|
40
|
-
ruled: "
|
|
65
|
+
tint: "Soft fill",
|
|
66
|
+
tab: "Side stripe",
|
|
67
|
+
ruled: "Lined paper",
|
|
41
68
|
solid: "Color field",
|
|
42
69
|
frame: "Outline",
|
|
43
|
-
hatched: "
|
|
70
|
+
hatched: "Fine hatch",
|
|
44
71
|
dotted: "Dotted",
|
|
45
72
|
grid: "Grid",
|
|
46
73
|
glass: "Wash",
|
|
@@ -50,18 +77,21 @@ const a = {
|
|
|
50
77
|
coral: "Coral",
|
|
51
78
|
rose: "Rose",
|
|
52
79
|
graphite: "Graphite",
|
|
80
|
+
system: "System",
|
|
53
81
|
serif: "Serif",
|
|
54
82
|
sans: "Sans",
|
|
55
83
|
round: "Round",
|
|
56
84
|
mono: "Mono",
|
|
57
85
|
condensed: "Condensed"
|
|
58
|
-
}, s =
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return (e,
|
|
86
|
+
}, s = t();
|
|
87
|
+
function c() {
|
|
88
|
+
const o = n(s);
|
|
89
|
+
return (e, i = "") => (o?.()?.[e] ?? r[e]).replace("{value}", i);
|
|
62
90
|
}
|
|
91
|
+
const l = t();
|
|
63
92
|
export {
|
|
93
|
+
l as WorkbenchCompositionActionsContext,
|
|
64
94
|
s as WorkbenchCompositionMessagesContext,
|
|
65
|
-
|
|
66
|
-
|
|
95
|
+
c as useWorkbenchCompositionText,
|
|
96
|
+
r as workbenchCompositionMessages
|
|
67
97
|
};
|
|
@@ -114,6 +114,7 @@ function re(e) {
|
|
|
114
114
|
return {
|
|
115
115
|
id: W(e.id, "sticky"),
|
|
116
116
|
kind: "sticky_note",
|
|
117
|
+
...typeof e.title == "string" ? { title: e.title } : {},
|
|
117
118
|
body: typeof e.body == "string" ? e.body : "",
|
|
118
119
|
material: e.material === "tab" || e.material === "ruled" ? e.material : "tint",
|
|
119
120
|
color: ie(e.color),
|
|
@@ -144,7 +145,10 @@ function de(e) {
|
|
|
144
145
|
text: typeof e.text == "string" ? e.text : "",
|
|
145
146
|
font_family: n.fontFamily,
|
|
146
147
|
font_size: Math.max(8, Math.min(160, Math.round(d(e.font_size, 28)))),
|
|
147
|
-
font_weight:
|
|
148
|
+
font_weight: Math.max(
|
|
149
|
+
100,
|
|
150
|
+
Math.min(900, Math.round(d(e.font_weight, n.fontWeight)))
|
|
151
|
+
),
|
|
148
152
|
color: w(
|
|
149
153
|
e.color,
|
|
150
154
|
V,
|
|
@@ -172,7 +176,7 @@ function he(e) {
|
|
|
172
176
|
E
|
|
173
177
|
);
|
|
174
178
|
}
|
|
175
|
-
function
|
|
179
|
+
function le(e) {
|
|
176
180
|
if (!y(e)) return null;
|
|
177
181
|
const t = Date.now();
|
|
178
182
|
return {
|
|
@@ -194,18 +198,18 @@ function ue(e) {
|
|
|
194
198
|
updated_at_unix_ms: Math.max(0, Math.trunc(d(e.updated_at_unix_ms, t)))
|
|
195
199
|
};
|
|
196
200
|
}
|
|
197
|
-
function
|
|
201
|
+
function ue(e) {
|
|
198
202
|
if (!Array.isArray(e)) return [];
|
|
199
203
|
const t = /* @__PURE__ */ new Set();
|
|
200
|
-
return e.map((n) =>
|
|
204
|
+
return e.map((n) => le(n)).filter((n) => !n || t.has(n.id) ? !1 : (t.add(n.id), !0));
|
|
201
205
|
}
|
|
202
206
|
function _e(e, t, n, r, i, a) {
|
|
203
207
|
if (y(e)) {
|
|
204
208
|
const c = f(e.kind), s = f(e.id);
|
|
205
|
-
if (c === "widget" && t.some((
|
|
206
|
-
if (c === "sticky_note" && n.some((
|
|
207
|
-
if (c === "annotation" && r.some((
|
|
208
|
-
if (c === "background_layer" && i.some((
|
|
209
|
+
if (c === "widget" && t.some((l) => l.id === s)) return { kind: c, id: s };
|
|
210
|
+
if (c === "sticky_note" && n.some((l) => l.id === s)) return { kind: c, id: s };
|
|
211
|
+
if (c === "annotation" && r.some((l) => l.id === s)) return { kind: c, id: s };
|
|
212
|
+
if (c === "background_layer" && i.some((l) => l.id === s))
|
|
209
213
|
return { kind: c, id: s };
|
|
210
214
|
}
|
|
211
215
|
return a ? { kind: "widget", id: a } : null;
|
|
@@ -229,11 +233,11 @@ function Re(e, t = {}) {
|
|
|
229
233
|
z_index: Number.isFinite(o.z_index) && o.z_index >= 0 ? o.z_index : 1,
|
|
230
234
|
created_at_unix_ms: Number.isFinite(o.created_at_unix_ms) ? o.created_at_unix_ms : Date.now()
|
|
231
235
|
};
|
|
232
|
-
}), c = typeof i.selectedWidgetId == "string" && a.some((o) => o.id === i.selectedWidgetId) ? i.selectedWidgetId : null, s = oe(i.stickyNotes),
|
|
236
|
+
}), c = typeof i.selectedWidgetId == "string" && a.some((o) => o.id === i.selectedWidgetId) ? i.selectedWidgetId : null, s = oe(i.stickyNotes), l = se(i.annotations), x = ue(i.backgroundLayers), h = te(i.mode), u = v(i.viewport, h);
|
|
233
237
|
return {
|
|
234
238
|
version: 1,
|
|
235
239
|
widgets: a,
|
|
236
|
-
viewport:
|
|
240
|
+
viewport: u,
|
|
237
241
|
locked: typeof i.locked == "boolean" ? i.locked : !1,
|
|
238
242
|
filters: ee(i.filters, n),
|
|
239
243
|
selectedWidgetId: c,
|
|
@@ -244,12 +248,12 @@ function Re(e, t = {}) {
|
|
|
244
248
|
i.selectedObject,
|
|
245
249
|
a,
|
|
246
250
|
s,
|
|
247
|
-
|
|
251
|
+
l,
|
|
248
252
|
x,
|
|
249
253
|
c
|
|
250
254
|
),
|
|
251
255
|
stickyNotes: s,
|
|
252
|
-
annotations:
|
|
256
|
+
annotations: l,
|
|
253
257
|
backgroundLayers: x
|
|
254
258
|
};
|
|
255
259
|
}
|
|
@@ -434,10 +438,10 @@ function Fe(e, t, n, r) {
|
|
|
434
438
|
const a = i.find((h) => h.id === t);
|
|
435
439
|
if (!a) return i[0] ?? null;
|
|
436
440
|
const c = a.x + a.width / 2, s = a.y + a.height / 2;
|
|
437
|
-
let
|
|
441
|
+
let l = null, x = 1 / 0;
|
|
438
442
|
for (const h of i) {
|
|
439
443
|
if (h.id === t) continue;
|
|
440
|
-
const
|
|
444
|
+
const u = h.x + h.width / 2 - c, o = h.y + h.height / 2 - s;
|
|
441
445
|
let _ = !1;
|
|
442
446
|
switch (n) {
|
|
443
447
|
case "up":
|
|
@@ -447,20 +451,20 @@ function Fe(e, t, n, r) {
|
|
|
447
451
|
_ = o > 10;
|
|
448
452
|
break;
|
|
449
453
|
case "left":
|
|
450
|
-
_ =
|
|
454
|
+
_ = u < -10;
|
|
451
455
|
break;
|
|
452
456
|
case "right":
|
|
453
|
-
_ =
|
|
457
|
+
_ = u > 10;
|
|
454
458
|
break;
|
|
455
459
|
}
|
|
456
460
|
if (!_) continue;
|
|
457
|
-
const B = Math.sqrt(
|
|
458
|
-
Math.abs(n === "up" || n === "down" ?
|
|
459
|
-
Math.abs(n === "up" || n === "down" ? o :
|
|
461
|
+
const B = Math.sqrt(u * u + o * o), D = Math.atan2(
|
|
462
|
+
Math.abs(n === "up" || n === "down" ? u : o),
|
|
463
|
+
Math.abs(n === "up" || n === "down" ? o : u)
|
|
460
464
|
), M = B * (1 + D * 1.5);
|
|
461
|
-
M < x && (x = M,
|
|
465
|
+
M < x && (x = M, l = h);
|
|
462
466
|
}
|
|
463
|
-
return
|
|
467
|
+
return l;
|
|
464
468
|
}
|
|
465
469
|
function b(e, t = k, n = g) {
|
|
466
470
|
return Math.max(t, Math.min(n, e));
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import { isTypingElement as
|
|
2
|
-
import { DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { isTypingElement as W } from "../../utils/dom.js";
|
|
2
|
+
import { DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR as w, DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR as v, resolveWorkbenchWidgetEventOwnership as _, DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR as T, resolveSurfaceInteractionTargetRole as A, resolveSurfaceWheelRouting as m } from "../ui/localInteractionSurface.js";
|
|
3
|
+
const h = "data-floe-workbench-surface-root", a = "data-floe-workbench-widget-root", s = "data-floe-workbench-widget-id", O = "data-floe-dialog-surface-host";
|
|
4
|
+
function E(e) {
|
|
5
5
|
return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
|
|
6
6
|
}
|
|
7
7
|
function S(e, n = s) {
|
|
8
8
|
const r = (e?.getAttribute(n) ?? "").trim();
|
|
9
9
|
return r.length > 0 ? r : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const o =
|
|
11
|
+
function k(e, n = a) {
|
|
12
|
+
const o = E(e);
|
|
13
13
|
if (!o) return null;
|
|
14
14
|
const r = o.closest(`[${n}="true"]`);
|
|
15
15
|
return r instanceof HTMLElement ? r : null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function b(e) {
|
|
18
18
|
const {
|
|
19
19
|
root: n,
|
|
20
20
|
widgetId: o,
|
|
21
21
|
widgetRootAttr: r = a,
|
|
22
|
-
readWidgetId:
|
|
22
|
+
readWidgetId: l = (i) => S(i, s)
|
|
23
23
|
} = e;
|
|
24
24
|
if (!n || typeof n.querySelectorAll != "function") return null;
|
|
25
|
-
const
|
|
26
|
-
for (const i of
|
|
27
|
-
if (i instanceof HTMLElement &&
|
|
25
|
+
const d = n.querySelectorAll(`[${r}="true"]`);
|
|
26
|
+
for (const i of d)
|
|
27
|
+
if (i instanceof HTMLElement && l(i) === o)
|
|
28
28
|
return i;
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const n =
|
|
31
|
+
function C(e) {
|
|
32
|
+
const n = b(e);
|
|
33
33
|
return n ? (n.focus({ preventScroll: !0 }), !0) : !1;
|
|
34
34
|
}
|
|
35
35
|
function g(e) {
|
|
36
36
|
return { kind: "canvas", reason: e };
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function L(e, n) {
|
|
39
39
|
return { kind: "widget", widgetId: e, reason: n };
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function p(e) {
|
|
42
42
|
const n = e.findWidgetRoot(e.target);
|
|
43
43
|
if (n) {
|
|
44
44
|
const r = e.readWidgetId(n);
|
|
45
45
|
return r !== null && r === e.selectedWidgetId ? { kind: "local_surface", reason: "selected_widget" } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
|
|
46
46
|
}
|
|
47
|
-
const o =
|
|
47
|
+
const o = m({
|
|
48
48
|
target: e.target,
|
|
49
49
|
disablePanZoom: e.disablePanZoom,
|
|
50
50
|
wheelInteractiveSelector: e.wheelInteractiveSelector
|
|
51
51
|
});
|
|
52
52
|
return o.kind === "canvas_zoom" ? o : o.kind === "local_surface" ? { kind: "local_surface", reason: o.reason } : { kind: "ignore", reason: o.reason };
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const n = e?.surfaceRootAttr ??
|
|
54
|
+
function N(e) {
|
|
55
|
+
const n = e?.surfaceRootAttr ?? h, o = e?.widgetRootAttr ?? a, r = e?.widgetIdAttr ?? s, l = e?.dialogSurfaceHostAttr ?? O, d = e?.interactiveSelector ?? '[data-floe-canvas-interactive="true"]', i = e?.panSurfaceSelector ?? '[data-floe-canvas-pan-surface="true"]', I = e?.wheelInteractiveSelector ?? w, u = e?.readWidgetId ?? ((t) => S(t, r)), f = e?.findWidgetRoot ?? ((t) => k(t, o)), R = e?.focusWidgetElement ?? ((t, c) => C({
|
|
56
56
|
root: t,
|
|
57
|
-
widgetId:
|
|
57
|
+
widgetId: c,
|
|
58
58
|
widgetRootAttr: o,
|
|
59
|
-
readWidgetId:
|
|
59
|
+
readWidgetId: u
|
|
60
60
|
}));
|
|
61
61
|
return {
|
|
62
62
|
...e,
|
|
63
63
|
surfaceRootAttr: n,
|
|
64
64
|
widgetRootAttr: o,
|
|
65
65
|
widgetIdAttr: r,
|
|
66
|
-
dialogSurfaceHostAttr:
|
|
67
|
-
interactiveSelector:
|
|
66
|
+
dialogSurfaceHostAttr: l,
|
|
67
|
+
interactiveSelector: d,
|
|
68
68
|
panSurfaceSelector: i,
|
|
69
|
-
wheelInteractiveSelector:
|
|
69
|
+
wheelInteractiveSelector: I,
|
|
70
70
|
createInitialInputOwner: e?.createInitialInputOwner ?? (() => g("initial")),
|
|
71
71
|
createCanvasInputOwner: e?.createCanvasInputOwner ?? g,
|
|
72
|
-
createWidgetInputOwner: e?.createWidgetInputOwner ??
|
|
73
|
-
readWidgetId:
|
|
72
|
+
createWidgetInputOwner: e?.createWidgetInputOwner ?? L,
|
|
73
|
+
readWidgetId: u,
|
|
74
74
|
findWidgetRoot: f,
|
|
75
|
-
focusWidgetElement:
|
|
76
|
-
resolveSurfaceTargetRole: e?.resolveSurfaceTargetRole ?? ((t) =>
|
|
75
|
+
focusWidgetElement: R,
|
|
76
|
+
resolveSurfaceTargetRole: e?.resolveSurfaceTargetRole ?? ((t) => A({
|
|
77
77
|
target: t.target,
|
|
78
78
|
interactiveSelector: t.interactiveSelector,
|
|
79
79
|
panSurfaceSelector: t.panSurfaceSelector
|
|
80
80
|
})),
|
|
81
|
-
resolveWidgetEventOwnership: e?.resolveWidgetEventOwnership ?? ((t) =>
|
|
81
|
+
resolveWidgetEventOwnership: e?.resolveWidgetEventOwnership ?? ((t) => _({
|
|
82
82
|
target: t.target,
|
|
83
83
|
widgetRoot: t.widgetRoot,
|
|
84
84
|
interactiveSelector: t.interactiveSelector,
|
|
85
85
|
panSurfaceSelector: t.panSurfaceSelector,
|
|
86
|
-
shellSelector:
|
|
86
|
+
shellSelector: T
|
|
87
87
|
})),
|
|
88
|
-
resolveWheelRouting: e?.resolveWheelRouting ?? ((t) =>
|
|
88
|
+
resolveWheelRouting: e?.resolveWheelRouting ?? ((t) => p({
|
|
89
89
|
target: t.target,
|
|
90
90
|
disablePanZoom: t.disablePanZoom,
|
|
91
91
|
selectedWidgetId: t.selectedWidgetId,
|
|
92
92
|
wheelInteractiveSelector: t.wheelInteractiveSelector,
|
|
93
93
|
findWidgetRoot: f,
|
|
94
|
-
readWidgetId:
|
|
94
|
+
readWidgetId: u
|
|
95
95
|
})),
|
|
96
96
|
shouldBypassGlobalHotkeys: e?.shouldBypassGlobalHotkeys ?? ((t) => {
|
|
97
|
-
const
|
|
98
|
-
return
|
|
97
|
+
const c = E(t.target);
|
|
98
|
+
return W(c) || !!c?.closest(v);
|
|
99
99
|
})
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
O as DEFAULT_WORKBENCH_DIALOG_SURFACE_HOST_ATTR,
|
|
104
|
+
h as DEFAULT_WORKBENCH_SURFACE_ROOT_ATTR,
|
|
105
105
|
s as DEFAULT_WORKBENCH_WIDGET_ID_ATTR,
|
|
106
106
|
a as DEFAULT_WORKBENCH_WIDGET_ROOT_ATTR,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
b as findWorkbenchWidgetElement,
|
|
108
|
+
k as findWorkbenchWidgetRoot,
|
|
109
|
+
C as focusWorkbenchWidgetElement,
|
|
110
110
|
S as readWorkbenchWidgetId,
|
|
111
|
-
|
|
111
|
+
N as resolveWorkbenchInteractionAdapter
|
|
112
112
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare const WORKBENCH_TEXT_COLOR_OPTIONS: readonly ["#6b7280", "#64748b", "#71717a", "#78716c", "#7770a0", "#8a6b6b"];
|
|
2
2
|
export declare const WORKBENCH_DEFAULT_TEXT_COLOR: "#6b7280";
|
|
3
3
|
export declare const WORKBENCH_TEXT_FONT_OPTIONS: readonly [{
|
|
4
|
+
readonly id: "system";
|
|
5
|
+
readonly label: "System";
|
|
6
|
+
readonly fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", sans-serif";
|
|
7
|
+
readonly fontWeight: 560;
|
|
8
|
+
}, {
|
|
4
9
|
readonly id: "serif";
|
|
5
10
|
readonly label: "Serif";
|
|
6
11
|
readonly fontFamily: "ui-serif, Georgia, serif";
|
|
@@ -28,14 +33,39 @@ export declare const WORKBENCH_TEXT_FONT_OPTIONS: readonly [{
|
|
|
28
33
|
}];
|
|
29
34
|
export type WorkbenchTextFontOption = (typeof WORKBENCH_TEXT_FONT_OPTIONS)[number];
|
|
30
35
|
export declare const WORKBENCH_DEFAULT_TEXT_FONT: {
|
|
31
|
-
readonly id: "
|
|
32
|
-
readonly label: "
|
|
33
|
-
readonly fontFamily: "
|
|
34
|
-
readonly fontWeight:
|
|
36
|
+
readonly id: "system";
|
|
37
|
+
readonly label: "System";
|
|
38
|
+
readonly fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", sans-serif";
|
|
39
|
+
readonly fontWeight: 560;
|
|
35
40
|
};
|
|
36
41
|
export declare const WORKBENCH_TEXT_EMOJI_OPTIONS: readonly ["✨", "✅", "⚠️", "🔥", "💡", "🚀", "🎯", "📌", "🧭", "🧪", "🛠️", "📝", "👀", "🔎", "💬", "❓", "❗", "⭐", "❤️", "🔒", "🔗", "📎", "📅", "⏱️", "📊", "📈", "🏁", "🔖", "🧩", "⚙️", "🚧", "🧯", "📦", "🎉"];
|
|
37
42
|
export declare function resolveWorkbenchTextFontOption(fontFamily: unknown): WorkbenchTextFontOption;
|
|
38
|
-
export declare const
|
|
43
|
+
export declare const WORKBENCH_REGION_COLOR_OPTIONS: readonly [{
|
|
44
|
+
readonly color: "amber";
|
|
45
|
+
readonly fill: "#a79d8e";
|
|
46
|
+
readonly hue: 82;
|
|
47
|
+
}, {
|
|
48
|
+
readonly color: "sage";
|
|
49
|
+
readonly fill: "#9da8a1";
|
|
50
|
+
readonly hue: 145;
|
|
51
|
+
}, {
|
|
52
|
+
readonly color: "azure";
|
|
53
|
+
readonly fill: "#8fa1aa";
|
|
54
|
+
readonly hue: 245;
|
|
55
|
+
}, {
|
|
56
|
+
readonly color: "coral";
|
|
57
|
+
readonly fill: "#a78f86";
|
|
58
|
+
readonly hue: 42;
|
|
59
|
+
}, {
|
|
60
|
+
readonly color: "rose";
|
|
61
|
+
readonly fill: "#b58fa2";
|
|
62
|
+
readonly hue: 350;
|
|
63
|
+
}, {
|
|
64
|
+
readonly color: "graphite";
|
|
65
|
+
readonly fill: "#999999";
|
|
66
|
+
readonly hue: 255;
|
|
67
|
+
}];
|
|
68
|
+
export declare const WORKBENCH_REGION_FILL_OPTIONS: readonly ["#9da8a1", "#a79d8e", "#8fa1aa", "#a78f86", "#9ca184", "#9993a7", "#b58fa2", "#999999"];
|
|
39
69
|
export declare const WORKBENCH_DEFAULT_REGION_FILL: "#9da8a1";
|
|
40
70
|
export declare const WORKBENCH_BACKGROUND_MATERIALS: readonly ["solid", "frame", "hatched", "dotted", "grid", "glass"];
|
|
41
71
|
export declare const WORKBENCH_DEFAULT_BACKGROUND_MATERIAL = "solid";
|
|
@@ -5,7 +5,13 @@ const s = [
|
|
|
5
5
|
"#78716c",
|
|
6
6
|
"#7770a0",
|
|
7
7
|
"#8a6b6b"
|
|
8
|
-
],
|
|
8
|
+
], t = s[0], o = [
|
|
9
|
+
{
|
|
10
|
+
id: "system",
|
|
11
|
+
label: "System",
|
|
12
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif',
|
|
13
|
+
fontWeight: 560
|
|
14
|
+
},
|
|
9
15
|
{
|
|
10
16
|
id: "serif",
|
|
11
17
|
label: "Serif",
|
|
@@ -72,18 +78,27 @@ const s = [
|
|
|
72
78
|
"📦",
|
|
73
79
|
"🎉"
|
|
74
80
|
];
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
return o.find((
|
|
81
|
+
function O(e) {
|
|
82
|
+
const a = String(e ?? "").trim();
|
|
83
|
+
return o.find((n) => n.fontFamily === a) ?? i;
|
|
78
84
|
}
|
|
79
|
-
const
|
|
85
|
+
const f = [
|
|
86
|
+
{ color: "amber", fill: "#a79d8e", hue: 82 },
|
|
87
|
+
{ color: "sage", fill: "#9da8a1", hue: 145 },
|
|
88
|
+
{ color: "azure", fill: "#8fa1aa", hue: 245 },
|
|
89
|
+
{ color: "coral", fill: "#a78f86", hue: 42 },
|
|
90
|
+
{ color: "rose", fill: "#b58fa2", hue: 350 },
|
|
91
|
+
{ color: "graphite", fill: "#999999", hue: 255 }
|
|
92
|
+
], l = [
|
|
80
93
|
"#9da8a1",
|
|
81
94
|
"#a79d8e",
|
|
82
95
|
"#8fa1aa",
|
|
83
96
|
"#a78f86",
|
|
84
97
|
"#9ca184",
|
|
85
|
-
"#9993a7"
|
|
86
|
-
|
|
98
|
+
"#9993a7",
|
|
99
|
+
"#b58fa2",
|
|
100
|
+
"#999999"
|
|
101
|
+
], _ = l[0], c = [
|
|
87
102
|
"solid",
|
|
88
103
|
"frame",
|
|
89
104
|
"hatched",
|
|
@@ -97,18 +112,19 @@ const t = [
|
|
|
97
112
|
"coral",
|
|
98
113
|
"rose",
|
|
99
114
|
"graphite"
|
|
100
|
-
],
|
|
115
|
+
], T = "amber";
|
|
101
116
|
export {
|
|
102
|
-
|
|
117
|
+
c as WORKBENCH_BACKGROUND_MATERIALS,
|
|
103
118
|
d as WORKBENCH_DEFAULT_BACKGROUND_MATERIAL,
|
|
104
119
|
_ as WORKBENCH_DEFAULT_REGION_FILL,
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
T as WORKBENCH_DEFAULT_STICKY_NOTE_COLOR,
|
|
121
|
+
t as WORKBENCH_DEFAULT_TEXT_COLOR,
|
|
107
122
|
i as WORKBENCH_DEFAULT_TEXT_FONT,
|
|
108
|
-
|
|
123
|
+
f as WORKBENCH_REGION_COLOR_OPTIONS,
|
|
124
|
+
l as WORKBENCH_REGION_FILL_OPTIONS,
|
|
109
125
|
E as WORKBENCH_STICKY_NOTE_COLORS,
|
|
110
126
|
s as WORKBENCH_TEXT_COLOR_OPTIONS,
|
|
111
127
|
r as WORKBENCH_TEXT_EMOJI_OPTIONS,
|
|
112
128
|
o as WORKBENCH_TEXT_FONT_OPTIONS,
|
|
113
|
-
|
|
129
|
+
O as resolveWorkbenchTextFontOption
|
|
114
130
|
};
|