@floegence/floe-webapp-core 0.86.69 → 0.86.71
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/layout/SplitWorkspace.d.ts +21 -0
- package/dist/components/layout/SplitWorkspace.js +182 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/splitWorkspaceModel.d.ts +38 -0
- package/dist/components/layout/splitWorkspaceModel.js +96 -0
- package/dist/components/ui/Dropdown.d.ts +7 -0
- package/dist/components/ui/Dropdown.js +156 -145
- package/dist/components/ui/FloatingWindow.js +1 -1
- package/dist/components/ui/Select.accessibility.test.d.ts +1 -0
- package/dist/components/ui/Tabs.js +161 -161
- package/dist/full.js +468 -455
- package/dist/layout.js +45 -32
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from 'solid-js';
|
|
2
|
+
import { type SplitWorkspaceLayout } from './splitWorkspaceModel';
|
|
3
|
+
export interface SplitWorkspaceProps {
|
|
4
|
+
layout: SplitWorkspaceLayout | null;
|
|
5
|
+
/** Stable item keys, including retained items currently absent from the layout. */
|
|
6
|
+
itemIds: readonly string[];
|
|
7
|
+
activeId: string | null;
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
maximizedId?: string | null;
|
|
10
|
+
showHeaders?: boolean;
|
|
11
|
+
class?: string;
|
|
12
|
+
resizeLabel: string;
|
|
13
|
+
onLayoutChange: (layout: SplitWorkspaceLayout | null) => void;
|
|
14
|
+
onActivate: (id: string) => void;
|
|
15
|
+
renderItem: (id: string, visible: Accessor<boolean>) => JSX.Element;
|
|
16
|
+
renderHeader?: (id: string) => JSX.Element;
|
|
17
|
+
externalDragType?: string;
|
|
18
|
+
resolveExternalDrag?: (event: DragEvent) => string | null;
|
|
19
|
+
}
|
|
20
|
+
/** A flat keyed surface keeps expensive content mounted across tree edits. */
|
|
21
|
+
export declare function SplitWorkspace(props: SplitWorkspaceProps): JSX.Element;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { use as B, insert as b, createComponent as E, setAttribute as v, effect as D, memo as $, setStyleProperty as d, className as p, template as L, delegateEvents as _ } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as ee, createSignal as F, createMemo as te, onCleanup as U, For as N, Show as Y } from "solid-js";
|
|
3
|
+
import { startPointerSession as ae } from "../ui/pointerSession.js";
|
|
4
|
+
import { startHotInteraction as V } from "../../utils/hotInteraction.js";
|
|
5
|
+
import { measureSplitWorkspace as re, resizeSplitWorkspace as S, dockSplitWorkspaceItem as oe } from "./splitWorkspaceModel.js";
|
|
6
|
+
var ie = /* @__PURE__ */ L("<div data-floe-split-workspace style=position:relative;height:100%;min-height:0;overflow:hidden>"), ne = /* @__PURE__ */ L('<div class="flex h-8 shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2">'), le = /* @__PURE__ */ L('<div class="pointer-events-none absolute z-30 rounded border-2 border-primary bg-primary/15">'), se = /* @__PURE__ */ L("<section style=position:absolute;flex-direction:column;overflow:hidden><div style=flex:1;min-height:0;position:relative;overflow:hidden>"), de = /* @__PURE__ */ L('<div role=separator tabindex=0 aria-valuemin=15 aria-valuemax=85 class="absolute z-20 bg-border hover:bg-primary/50 focus-visible:bg-primary focus-visible:outline-none"style=touch-action:none>');
|
|
7
|
+
function he(i) {
|
|
8
|
+
let I, H, x, w, T = null;
|
|
9
|
+
const j = ee();
|
|
10
|
+
let G = 0;
|
|
11
|
+
const [J, W] = F(null), [f, P] = F(null), z = te(() => re(J() ?? i.layout)), A = () => i.compact ? i.activeId : i.maximizedId, K = (a) => A() ? A() === a : z().panes.has(a), M = "application/x-floe-split-workspace", C = () => {
|
|
12
|
+
T = null, P(null), x?.(), x = void 0;
|
|
13
|
+
}, R = () => {
|
|
14
|
+
H?.stop({
|
|
15
|
+
commit: !1
|
|
16
|
+
}), H = void 0;
|
|
17
|
+
}, X = (a) => {
|
|
18
|
+
a.key === "Escape" && (R(), C());
|
|
19
|
+
}, O = (a, s) => {
|
|
20
|
+
if (a.button !== 0 || !i.layout) return;
|
|
21
|
+
a.preventDefault(), a.stopPropagation(), R();
|
|
22
|
+
const r = i.layout, n = I.getBoundingClientRect(), l = s.axis === "x" ? n.width * s.width / 100 : n.height * s.height / 100;
|
|
23
|
+
if (l <= 0) return;
|
|
24
|
+
const e = s.axis === "x" ? a.clientX : a.clientY;
|
|
25
|
+
let c = s.ratio;
|
|
26
|
+
x = V({
|
|
27
|
+
kind: "resize",
|
|
28
|
+
cursor: s.axis === "x" ? "col-resize" : "row-resize"
|
|
29
|
+
});
|
|
30
|
+
const t = (o, u) => {
|
|
31
|
+
c = Math.max(0.15, Math.min(0.85, s.ratio + ((s.axis === "x" ? o : u) - e) / l));
|
|
32
|
+
};
|
|
33
|
+
document.addEventListener("keydown", X, !0), H = ae({
|
|
34
|
+
pointerEvent: a,
|
|
35
|
+
captureEl: a.currentTarget,
|
|
36
|
+
onMove: (o) => {
|
|
37
|
+
t(o.clientX, o.clientY), w === void 0 && (w = requestAnimationFrame(() => {
|
|
38
|
+
w = void 0, W(S(r, s.id, c));
|
|
39
|
+
}));
|
|
40
|
+
},
|
|
41
|
+
onEnd: (o) => {
|
|
42
|
+
w !== void 0 && cancelAnimationFrame(w), w = void 0, o.event && t(o.event.clientX, o.event.clientY), W(null), x?.(), x = void 0, document.removeEventListener("keydown", X, !0), o.commit && i.layout === r && i.onLayoutChange(S(r, s.id, c));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
U(() => {
|
|
47
|
+
R(), C(), document.removeEventListener("keydown", X, !0);
|
|
48
|
+
});
|
|
49
|
+
const q = (a) => !!(T || a.dataTransfer?.types.includes(M) || i.externalDragType && a.dataTransfer?.types.includes(i.externalDragType)), Q = (a, s) => {
|
|
50
|
+
if (i.compact || !q(a)) return;
|
|
51
|
+
a.preventDefault(), a.stopPropagation(), a.dataTransfer && (a.dataTransfer.dropEffect = "move");
|
|
52
|
+
const r = a.currentTarget.getBoundingClientRect(), n = (a.clientX - r.left) / r.width, l = (a.clientY - r.top) / r.height, e = [["left", n], ["right", 1 - n], ["top", l], ["bottom", 1 - l]];
|
|
53
|
+
e.sort((c, t) => c[1] - t[1]), P({
|
|
54
|
+
id: s,
|
|
55
|
+
edge: e[0][1] < 0.25 ? e[0][0] : "center"
|
|
56
|
+
});
|
|
57
|
+
}, Z = (a, s) => {
|
|
58
|
+
if (!q(a) || !f()) return;
|
|
59
|
+
a.preventDefault(), a.stopPropagation();
|
|
60
|
+
const r = T || a.dataTransfer?.getData(M) || i.resolveExternalDrag?.(a);
|
|
61
|
+
r && i.itemIds.includes(r) && (i.onLayoutChange(oe(i.layout, r, s, f().edge, "split-" + j + "-" + ++G)), i.onActivate(r)), C();
|
|
62
|
+
};
|
|
63
|
+
return (() => {
|
|
64
|
+
var a = ie();
|
|
65
|
+
a.addEventListener("dragend", C), a.addEventListener("dragleave", (r) => {
|
|
66
|
+
I.contains(r.relatedTarget) || P(null);
|
|
67
|
+
});
|
|
68
|
+
var s = I;
|
|
69
|
+
return typeof s == "function" ? B(s, a) : I = a, b(a, E(N, {
|
|
70
|
+
get each() {
|
|
71
|
+
return i.itemIds;
|
|
72
|
+
},
|
|
73
|
+
children: (r) => {
|
|
74
|
+
const n = () => K(r), l = () => A() ? {
|
|
75
|
+
x: 0,
|
|
76
|
+
y: 0,
|
|
77
|
+
width: 100,
|
|
78
|
+
height: 100
|
|
79
|
+
} : z().panes.get(r);
|
|
80
|
+
return (() => {
|
|
81
|
+
var e = se(), c = e.firstChild;
|
|
82
|
+
return e.addEventListener("drop", (t) => Z(t, r)), e.addEventListener("dragover", (t) => Q(t, r)), e.$$focusin = () => {
|
|
83
|
+
n() && i.activeId !== r && i.onActivate(r);
|
|
84
|
+
}, B((t) => {
|
|
85
|
+
const o = () => {
|
|
86
|
+
n() && i.activeId !== r && i.onActivate(r);
|
|
87
|
+
};
|
|
88
|
+
t.addEventListener("pointerdown", o, !0), U(() => t.removeEventListener("pointerdown", o, !0));
|
|
89
|
+
}, e), v(e, "data-floe-split-pane", r), b(e, E(Y, {
|
|
90
|
+
get when() {
|
|
91
|
+
return $(() => !!i.showHeaders)() && i.renderHeader;
|
|
92
|
+
},
|
|
93
|
+
get children() {
|
|
94
|
+
var t = ne();
|
|
95
|
+
return t.addEventListener("dragstart", (o) => {
|
|
96
|
+
if (o.target.closest("button, input, select")) {
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
T = r, o.dataTransfer?.setData(M, r), o.dataTransfer && (o.dataTransfer.effectAllowed = "move"), x = V({
|
|
101
|
+
kind: "drag",
|
|
102
|
+
cursor: "grabbing"
|
|
103
|
+
});
|
|
104
|
+
}), v(t, "data-floe-split-header", r), b(t, () => i.renderHeader?.(r)), D(() => v(t, "draggable", !i.compact)), t;
|
|
105
|
+
}
|
|
106
|
+
}), c), b(c, () => i.renderItem(r, n)), b(e, E(Y, {
|
|
107
|
+
get when() {
|
|
108
|
+
return f()?.id === r;
|
|
109
|
+
},
|
|
110
|
+
get children() {
|
|
111
|
+
var t = le();
|
|
112
|
+
return D((o) => {
|
|
113
|
+
var u = f().edge, g = f().edge === "right" ? "50%" : "0", h = f().edge === "left" ? "50%" : "0", m = f().edge === "bottom" ? "50%" : "0", y = f().edge === "top" ? "50%" : "0";
|
|
114
|
+
return u !== o.e && v(t, "data-floe-split-drop", o.e = u), g !== o.t && d(t, "left", o.t = g), h !== o.a && d(t, "right", o.a = h), m !== o.o && d(t, "top", o.o = m), y !== o.i && d(t, "bottom", o.i = y), o;
|
|
115
|
+
}, {
|
|
116
|
+
e: void 0,
|
|
117
|
+
t: void 0,
|
|
118
|
+
a: void 0,
|
|
119
|
+
o: void 0,
|
|
120
|
+
i: void 0
|
|
121
|
+
}), t;
|
|
122
|
+
}
|
|
123
|
+
}), null), D((t) => {
|
|
124
|
+
var o = i.activeId === r ? "true" : "false", u = !n(), g = n() ? "flex" : "none", h = (l()?.x ?? 0) + "%", m = (l()?.y ?? 0) + "%", y = (l()?.width ?? 100) + "%", k = (l()?.height ?? 100) + "%";
|
|
125
|
+
return o !== t.e && v(e, "data-active", t.e = o), u !== t.t && (e.hidden = t.t = u), g !== t.a && d(e, "display", t.a = g), h !== t.o && d(e, "left", t.o = h), m !== t.i && d(e, "top", t.i = m), y !== t.n && d(e, "width", t.n = y), k !== t.s && d(e, "height", t.s = k), t;
|
|
126
|
+
}, {
|
|
127
|
+
e: void 0,
|
|
128
|
+
t: void 0,
|
|
129
|
+
a: void 0,
|
|
130
|
+
o: void 0,
|
|
131
|
+
i: void 0,
|
|
132
|
+
n: void 0,
|
|
133
|
+
s: void 0
|
|
134
|
+
}), e;
|
|
135
|
+
})();
|
|
136
|
+
}
|
|
137
|
+
}), null), b(a, E(Y, {
|
|
138
|
+
get when() {
|
|
139
|
+
return !A();
|
|
140
|
+
},
|
|
141
|
+
get children() {
|
|
142
|
+
return E(N, {
|
|
143
|
+
get each() {
|
|
144
|
+
return z().dividers.map((r) => r.id);
|
|
145
|
+
},
|
|
146
|
+
children: (r) => {
|
|
147
|
+
const n = () => z().dividers.find((l) => l.id === r);
|
|
148
|
+
return (() => {
|
|
149
|
+
var l = de();
|
|
150
|
+
return l.$$keydown = (e) => {
|
|
151
|
+
const c = n().axis === "x" ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"];
|
|
152
|
+
if (!i.layout || ![...c, "Home", "End", "Enter"].includes(e.key)) return;
|
|
153
|
+
e.preventDefault(), e.stopPropagation();
|
|
154
|
+
const t = e.key === "Home" ? 0.15 : e.key === "End" ? 0.85 : e.key === "Enter" ? 0.5 : n().ratio + (e.key === c[0] ? -0.05 : 0.05);
|
|
155
|
+
i.onLayoutChange(S(i.layout, r, t));
|
|
156
|
+
}, l.$$dblclick = () => {
|
|
157
|
+
i.layout && i.onLayoutChange(S(i.layout, r, 0.5));
|
|
158
|
+
}, l.$$pointerdown = (e) => O(e, n()), v(l, "data-floe-split-divider", r), D((e) => {
|
|
159
|
+
var c = i.resizeLabel, t = n().axis === "x" ? "vertical" : "horizontal", o = Math.round(n().ratio * 100), u = n().axis === "x" ? "col-resize" : "row-resize", g = n().x + (n().axis === "x" ? n().width * n().ratio : 0) + "%", h = n().y + (n().axis === "y" ? n().height * n().ratio : 0) + "%", m = n().axis === "x" ? "4px" : n().width + "%", y = n().axis === "y" ? "4px" : n().height + "%", k = n().axis === "x" ? "translateX(-2px)" : "translateY(-2px)";
|
|
160
|
+
return c !== e.e && v(l, "aria-label", e.e = c), t !== e.t && v(l, "aria-orientation", e.t = t), o !== e.a && v(l, "aria-valuenow", e.a = o), u !== e.o && d(l, "cursor", e.o = u), g !== e.i && d(l, "left", e.i = g), h !== e.n && d(l, "top", e.n = h), m !== e.s && d(l, "width", e.s = m), y !== e.h && d(l, "height", e.h = y), k !== e.r && d(l, "transform", e.r = k), e;
|
|
161
|
+
}, {
|
|
162
|
+
e: void 0,
|
|
163
|
+
t: void 0,
|
|
164
|
+
a: void 0,
|
|
165
|
+
o: void 0,
|
|
166
|
+
i: void 0,
|
|
167
|
+
n: void 0,
|
|
168
|
+
s: void 0,
|
|
169
|
+
h: void 0,
|
|
170
|
+
r: void 0
|
|
171
|
+
}), l;
|
|
172
|
+
})();
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}), null), D(() => p(a, i.class)), a;
|
|
177
|
+
})();
|
|
178
|
+
}
|
|
179
|
+
_(["focusin", "pointerdown", "dblclick", "keydown"]);
|
|
180
|
+
export {
|
|
181
|
+
he as SplitWorkspace
|
|
182
|
+
};
|
|
@@ -15,3 +15,5 @@ export { DisplayModeSwitcher, sanitizeDisplayMode, type DisplayMode, type Displa
|
|
|
15
15
|
export { DisplayModePageShell, type DisplayModePageShellProps } from './DisplayModePageShell';
|
|
16
16
|
export { ThemeToggle, type ThemeToggleProps } from './ThemeToggle';
|
|
17
17
|
export { AppViewport, type AppViewportProps } from './AppViewport';
|
|
18
|
+
export * from './splitWorkspaceModel';
|
|
19
|
+
export * from './SplitWorkspace';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Serializable placement. Hosts retain item lifetime, authorization and persistence. */
|
|
2
|
+
export type SplitWorkspaceLayout = Readonly<{
|
|
3
|
+
type: 'pane';
|
|
4
|
+
id: string;
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
type: 'split';
|
|
7
|
+
id: string;
|
|
8
|
+
axis: 'x' | 'y';
|
|
9
|
+
ratio: number;
|
|
10
|
+
first: SplitWorkspaceLayout;
|
|
11
|
+
second: SplitWorkspaceLayout;
|
|
12
|
+
}>;
|
|
13
|
+
export type SplitWorkspaceEdge = 'left' | 'right' | 'top' | 'bottom';
|
|
14
|
+
export type SplitWorkspacePreset = 'single' | 'columns' | 'rows' | 'three-columns' | 'main-left' | 'grid';
|
|
15
|
+
export interface SplitWorkspaceRect {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SplitWorkspaceDivider extends SplitWorkspaceRect {
|
|
22
|
+
id: string;
|
|
23
|
+
axis: 'x' | 'y';
|
|
24
|
+
ratio: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const splitWorkspacePane: (id: string) => SplitWorkspaceLayout;
|
|
27
|
+
export declare function splitWorkspaceItems(layout: SplitWorkspaceLayout | null): string[];
|
|
28
|
+
export declare function isSplitWorkspaceLayout(value: unknown): value is SplitWorkspaceLayout;
|
|
29
|
+
export declare function mapSplitWorkspace(layout: SplitWorkspaceLayout, id: string, update: (node: SplitWorkspaceLayout) => SplitWorkspaceLayout): SplitWorkspaceLayout;
|
|
30
|
+
export declare function removeSplitWorkspaceItem(layout: SplitWorkspaceLayout | null, id: string): SplitWorkspaceLayout | null;
|
|
31
|
+
export declare function reconcileSplitWorkspace(layout: SplitWorkspaceLayout | null, availableIds: readonly string[]): SplitWorkspaceLayout | null;
|
|
32
|
+
export declare function resizeSplitWorkspace(layout: SplitWorkspaceLayout, id: string, ratio: number): SplitWorkspaceLayout;
|
|
33
|
+
export declare function dockSplitWorkspaceItem(layout: SplitWorkspaceLayout | null, sourceId: string, targetId: string, edge: SplitWorkspaceEdge | 'center', splitId: string): SplitWorkspaceLayout | null;
|
|
34
|
+
export declare function presetSplitWorkspace(preset: SplitWorkspacePreset, itemIds: readonly string[], id: () => string): SplitWorkspaceLayout | null;
|
|
35
|
+
export declare function measureSplitWorkspace(layout: SplitWorkspaceLayout | null): {
|
|
36
|
+
panes: Map<string, SplitWorkspaceRect>;
|
|
37
|
+
dividers: SplitWorkspaceDivider[];
|
|
38
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const o = (i) => ({ type: "pane", id: i });
|
|
2
|
+
function x(i) {
|
|
3
|
+
return i ? i.type === "pane" ? [i.id] : [...x(i.first), ...x(i.second)] : [];
|
|
4
|
+
}
|
|
5
|
+
function u(i) {
|
|
6
|
+
const s = /* @__PURE__ */ new Set();
|
|
7
|
+
let n = 0;
|
|
8
|
+
const r = (t, c) => {
|
|
9
|
+
if (!t || typeof t != "object" || c > 32 || ++n > 127) return !1;
|
|
10
|
+
const e = t;
|
|
11
|
+
return typeof e.id != "string" || !e.id.trim() || s.has(e.id) ? !1 : (s.add(e.id), e.type === "pane" ? !0 : e.type === "split" && (e.axis === "x" || e.axis === "y") && typeof e.ratio == "number" && Number.isFinite(e.ratio) && e.ratio >= 0.15 && e.ratio <= 0.85 && r(e.first, c + 1) && r(e.second, c + 1));
|
|
12
|
+
};
|
|
13
|
+
return r(i, 0);
|
|
14
|
+
}
|
|
15
|
+
function a(i, s, n) {
|
|
16
|
+
if (i.id === s) return n(i);
|
|
17
|
+
if (i.type === "pane") return i;
|
|
18
|
+
const r = a(i.first, s, n), t = a(i.second, s, n);
|
|
19
|
+
return r === i.first && t === i.second ? i : { ...i, first: r, second: t };
|
|
20
|
+
}
|
|
21
|
+
function m(i, s) {
|
|
22
|
+
if (!i || i.id === s) return null;
|
|
23
|
+
if (i.type === "pane") return i;
|
|
24
|
+
const n = m(i.first, s), r = m(i.second, s);
|
|
25
|
+
return n ? r ? n === i.first && r === i.second ? i : { ...i, first: n, second: r } : n : r;
|
|
26
|
+
}
|
|
27
|
+
function k(i, s) {
|
|
28
|
+
const n = new Set(s);
|
|
29
|
+
return x(i).reduce(
|
|
30
|
+
(r, t) => n.has(t) ? r : m(r, t),
|
|
31
|
+
i
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function w(i, s, n) {
|
|
35
|
+
return Number.isFinite(n) ? a(
|
|
36
|
+
i,
|
|
37
|
+
s,
|
|
38
|
+
(r) => r.type === "split" ? { ...r, ratio: Math.max(0.15, Math.min(0.85, n)) } : r
|
|
39
|
+
) : i;
|
|
40
|
+
}
|
|
41
|
+
function S(i, s, n, r, t) {
|
|
42
|
+
if (!i || s === n || !x(i).includes(n))
|
|
43
|
+
return i;
|
|
44
|
+
const c = x(i).includes(s);
|
|
45
|
+
if (r === "center") {
|
|
46
|
+
const p = (f) => f.type === "pane" ? f.id === n ? o(s) : c && f.id === s ? o(n) : f : { ...f, first: p(f.first), second: p(f.second) };
|
|
47
|
+
return p(i);
|
|
48
|
+
}
|
|
49
|
+
const e = m(i, s);
|
|
50
|
+
return e ? a(e, n, (p) => ({
|
|
51
|
+
type: "split",
|
|
52
|
+
id: t,
|
|
53
|
+
axis: r === "left" || r === "right" ? "x" : "y",
|
|
54
|
+
ratio: 0.5,
|
|
55
|
+
first: r === "left" || r === "top" ? o(s) : p,
|
|
56
|
+
second: r === "left" || r === "top" ? p : o(s)
|
|
57
|
+
})) : i;
|
|
58
|
+
}
|
|
59
|
+
function W(i, s, n) {
|
|
60
|
+
const r = i === "single" ? 1 : i === "grid" ? 4 : i === "columns" || i === "rows" ? 2 : 3, t = [...new Set(s)].slice(0, r).map(o), c = (e, p, f, h = 0.5) => ({ type: "split", id: n(), axis: e, ratio: h, first: p, second: f });
|
|
61
|
+
return t.length ? t.length === 1 ? t[0] : t.length === 2 ? c(i === "rows" ? "y" : "x", t[0], t[1]) : i === "grid" && t.length === 4 ? c("x", c("y", t[0], t[2]), c("y", t[1], t[3])) : c(
|
|
62
|
+
"x",
|
|
63
|
+
t[0],
|
|
64
|
+
c(i === "three-columns" ? "x" : "y", t[1], t[2]),
|
|
65
|
+
i === "three-columns" ? 1 / 3 : 0.5
|
|
66
|
+
) : null;
|
|
67
|
+
}
|
|
68
|
+
function l(i) {
|
|
69
|
+
const s = /* @__PURE__ */ new Map(), n = [], r = (t, c) => {
|
|
70
|
+
if (t.type === "pane") {
|
|
71
|
+
s.set(t.id, c);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
n.push({ ...c, id: t.id, axis: t.axis, ratio: t.ratio });
|
|
75
|
+
const { x: e, y: p, width: f, height: h } = c;
|
|
76
|
+
t.axis === "x" ? (r(t.first, { x: e, y: p, width: f * t.ratio, height: h }), r(t.second, { x: e + f * t.ratio, y: p, width: f * (1 - t.ratio), height: h })) : (r(t.first, { x: e, y: p, width: f, height: h * t.ratio }), r(t.second, {
|
|
77
|
+
x: e,
|
|
78
|
+
y: p + h * t.ratio,
|
|
79
|
+
width: f,
|
|
80
|
+
height: h * (1 - t.ratio)
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
return i && r(i, { x: 0, y: 0, width: 100, height: 100 }), { panes: s, dividers: n };
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
S as dockSplitWorkspaceItem,
|
|
87
|
+
u as isSplitWorkspaceLayout,
|
|
88
|
+
a as mapSplitWorkspace,
|
|
89
|
+
l as measureSplitWorkspace,
|
|
90
|
+
W as presetSplitWorkspace,
|
|
91
|
+
k as reconcileSplitWorkspace,
|
|
92
|
+
m as removeSplitWorkspaceItem,
|
|
93
|
+
w as resizeSplitWorkspace,
|
|
94
|
+
x as splitWorkspaceItems,
|
|
95
|
+
o as splitWorkspacePane
|
|
96
|
+
};
|
|
@@ -18,6 +18,8 @@ export interface DropdownProps {
|
|
|
18
18
|
trigger: JSX.Element;
|
|
19
19
|
triggerClass?: string;
|
|
20
20
|
triggerAriaLabel?: string;
|
|
21
|
+
triggerAriaLabelledBy?: string;
|
|
22
|
+
triggerAriaDescribedBy?: string;
|
|
21
23
|
/** Treat the existing trigger boundary as a field (used by Select). */
|
|
22
24
|
triggerInputSurface?: boolean;
|
|
23
25
|
items: DropdownItem[] | Accessor<DropdownItem[]>;
|
|
@@ -44,6 +46,11 @@ export declare function Dropdown(props: DropdownProps): JSX.Element;
|
|
|
44
46
|
* Simple select dropdown
|
|
45
47
|
*/
|
|
46
48
|
export interface SelectProps {
|
|
49
|
+
/** Localized field name, independent of the currently selected value. */
|
|
50
|
+
ariaLabel?: string;
|
|
51
|
+
/** Prefer a visible field label when one is available. */
|
|
52
|
+
ariaLabelledBy?: string;
|
|
53
|
+
ariaDescribedBy?: string;
|
|
47
54
|
value: string;
|
|
48
55
|
onChange: (value: string) => void;
|
|
49
56
|
options: {
|