@swiftbrowser/react 0.28.4 → 0.28.6
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/README.md +32 -1
- package/dist/components/containers.d.ts.map +1 -1
- package/dist/components/controls.d.ts +14 -0
- package/dist/components/controls.d.ts.map +1 -1
- package/dist/components/remoteTree.d.ts +39 -0
- package/dist/components/remoteTree.d.ts.map +1 -1
- package/dist/components/shapes.d.ts +3 -1
- package/dist/components/shapes.d.ts.map +1 -1
- package/dist/components/split.d.ts.map +1 -1
- package/dist/components/stacks.d.ts +16 -0
- package/dist/components/stacks.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +169 -45
- package/dist/index.js.map +1 -1
- package/dist/lazy.d.ts +16 -4
- package/dist/lazy.d.ts.map +1 -1
- package/dist/modifiers.d.ts +2 -0
- package/dist/modifiers.d.ts.map +1 -1
- package/dist/mount.d.ts +1 -1
- package/dist/mount.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -977,7 +977,7 @@ function RegisterDestination({ destination }) {
|
|
|
977
977
|
navigation?.registerDestination(destination);
|
|
978
978
|
return null;
|
|
979
979
|
}
|
|
980
|
-
const SCREEN_PROPS = ["title", "subtitle", "displayMode", "toolbarRole", "navigationBarHidden", "bottomBarHidden", "statusBarHidden"];
|
|
980
|
+
const SCREEN_PROPS = ["title", "subtitle", "displayMode", "toolbarRole", "navigationBarHidden", "bottomBarHidden", "statusBarHidden", "backButtonHidden"];
|
|
981
981
|
function screenPrefs(props, key) {
|
|
982
982
|
const picked = {};
|
|
983
983
|
for (const name of SCREEN_PROPS) if (name in props) picked[name] = props[name];
|
|
@@ -989,11 +989,23 @@ function findStack(node) {
|
|
|
989
989
|
for (const child of node.children) {
|
|
990
990
|
if (child.kind === "sheet" || child.kind === "alert") continue;
|
|
991
991
|
if (child.kind === "navstack") return child;
|
|
992
|
+
if (child.kind === "navsplit") return splitDetailStack(child);
|
|
992
993
|
const found = findStack(child);
|
|
993
994
|
if (found) return found;
|
|
994
995
|
}
|
|
995
996
|
return null;
|
|
996
997
|
}
|
|
998
|
+
function findSplit(node) {
|
|
999
|
+
for (const child of node.children) {
|
|
1000
|
+
if (child.kind === "sheet" || child.kind === "alert" || child.kind === "navstack") continue;
|
|
1001
|
+
if (child.kind === "navsplit") return child;
|
|
1002
|
+
const found = findSplit(child);
|
|
1003
|
+
if (found) return found;
|
|
1004
|
+
}
|
|
1005
|
+
return null;
|
|
1006
|
+
}
|
|
1007
|
+
const splitSidebarStack = (split) => split.children[0]?.kind === "navstack" ? split.children[0] : null;
|
|
1008
|
+
const splitDetailStack = (split) => split.children[1]?.kind === "navstack" ? split.children[1] : null;
|
|
997
1009
|
const screensOf = (stack) => stack ? stack.children.filter((child) => child.kind === "navscreen") : [];
|
|
998
1010
|
function renderNode(root, node, stack, elements) {
|
|
999
1011
|
if (node.kind === "host") return null;
|
|
@@ -1001,6 +1013,7 @@ function renderNode(root, node, stack, elements) {
|
|
|
1001
1013
|
const first = screensOf(stack)[0];
|
|
1002
1014
|
return createElement(Fragment, { key: node.id }, first ? renderScreen(root, first, stack, elements) : null);
|
|
1003
1015
|
}
|
|
1016
|
+
if (node.kind === "navsplit" && stack && splitDetailStack(node) === stack) return createElement(Fragment, { key: node.id }, renderNode(root, stack, stack, elements));
|
|
1004
1017
|
const children = node.children.length ? node.children.map((child) => renderNode(root, child, stack, elements)) : void 0;
|
|
1005
1018
|
const own = elements && Object.prototype.hasOwnProperty.call(elements, node.kind) ? elements[node.kind] : void 0;
|
|
1006
1019
|
if (own) return createElement(Fragment, { key: node.id }, own(node.props, children));
|
|
@@ -1010,8 +1023,9 @@ function renderSheet(root, node, stack, inherited, elements) {
|
|
|
1010
1023
|
const children = node.children.map((child) => renderNode(root, child, stack, elements));
|
|
1011
1024
|
return createElement(Fragment, { key: node.id }, sb(node.kind, node.props, root.handlersFor(node.id), replayStyles(inherited, children)));
|
|
1012
1025
|
}
|
|
1013
|
-
function renderScreen(root, screen, stack, elements) {
|
|
1026
|
+
function renderScreen(root, screen, stack, elements, hostPrefs) {
|
|
1014
1027
|
const out = [screenPrefs(screen.props, "$screen")];
|
|
1028
|
+
if (hostPrefs) out.push(createElement(Fragment, { key: "$host" }, sb(PREF_KIND, hostPrefs, void 0, void 0, "navscreen")));
|
|
1015
1029
|
for (const child of screen.children) {
|
|
1016
1030
|
const drawn = renderNode(root, child, stack, elements);
|
|
1017
1031
|
if (child.kind === "toolbar" || child.kind === "searchfield") out.push(createElement(Fragment, { key: child.id }, sb(HOIST_KIND, void 0, void 0, drawn, "navscreen")));
|
|
@@ -1019,12 +1033,95 @@ function renderScreen(root, screen, stack, elements) {
|
|
|
1019
1033
|
}
|
|
1020
1034
|
return createElement(Fragment, null, ...out);
|
|
1021
1035
|
}
|
|
1022
|
-
function RemoteScreen({ root, id, elements }) {
|
|
1036
|
+
function RemoteScreen({ root, id, elements, hostPrefs }) {
|
|
1023
1037
|
useSyncExternalStore(root.subscribe, root.getVersion, root.getVersion);
|
|
1024
1038
|
const screen = root.node(id);
|
|
1025
1039
|
if (!screen?.parent) return null;
|
|
1026
|
-
return renderScreen(root, screen, findStack(root.root), elements);
|
|
1040
|
+
return renderScreen(root, screen, findStack(root.root), elements, hostPrefs);
|
|
1027
1041
|
}
|
|
1042
|
+
function useScreenValues(root, elements) {
|
|
1043
|
+
const values = useRef(/* @__PURE__ */ new Map());
|
|
1044
|
+
const ours = useRef(/* @__PURE__ */ new WeakSet());
|
|
1045
|
+
const keyOf2 = (screen) => `${screen.id}:${JSON.stringify(screen.props["route"] ?? null)}`;
|
|
1046
|
+
const valueFor = (screen, hostPrefs) => {
|
|
1047
|
+
const key = keyOf2(screen);
|
|
1048
|
+
let value = values.current.get(key);
|
|
1049
|
+
if (!value) {
|
|
1050
|
+
const view = /* @__PURE__ */ jsx(RemoteScreen, { root, id: screen.id, elements, ...hostPrefs ? { hostPrefs } : {} });
|
|
1051
|
+
value = "route" in screen.props ? { view, route: screen.props["route"] } : { view };
|
|
1052
|
+
values.current.set(key, value);
|
|
1053
|
+
ours.current.add(value);
|
|
1054
|
+
}
|
|
1055
|
+
return value;
|
|
1056
|
+
};
|
|
1057
|
+
const isOurs = (value) => typeof value === "object" && value !== null && ours.current.has(value);
|
|
1058
|
+
const forget = (keys) => {
|
|
1059
|
+
for (const key of values.current.keys()) if (!keys.includes(key)) values.current.delete(key);
|
|
1060
|
+
};
|
|
1061
|
+
return { valueFor, keyOf: keyOf2, isOurs, forget };
|
|
1062
|
+
}
|
|
1063
|
+
function useRemoteSidebar(root, path, setPath, options = {}) {
|
|
1064
|
+
const shown = options.shown ?? true;
|
|
1065
|
+
useSyncExternalStore(root ? root.subscribe : noSubscribe, root ? root.getVersion : zero, root ? root.getVersion : zero);
|
|
1066
|
+
const { valueFor, keyOf: keyOf2, isOurs, forget } = useScreenValues(root ?? NO_ROOT, options.elements);
|
|
1067
|
+
const split = root ? findSplit(root.root) : null;
|
|
1068
|
+
const screens = split ? screensOf(splitSidebarStack(split)) : [];
|
|
1069
|
+
const dismissed = useRef(false);
|
|
1070
|
+
const lastKeys = useRef([]);
|
|
1071
|
+
const lastMine = useRef(0);
|
|
1072
|
+
const last = useRef({ root: null, shown: false, generation: void 0 });
|
|
1073
|
+
useLayoutEffect(() => {
|
|
1074
|
+
if (last.current.root !== root || !last.current.shown && shown || last.current.generation !== options.generation) dismissed.current = false;
|
|
1075
|
+
last.current = { root, shown, generation: options.generation };
|
|
1076
|
+
const keys = screens.map(keyOf2);
|
|
1077
|
+
const rootPrefs = options.rootBackButtonHidden ? { backButtonHidden: true } : void 0;
|
|
1078
|
+
const wanted = shown && !dismissed.current ? screens.map((screen, i) => valueFor(screen, i === 0 ? rootPrefs : void 0)) : [];
|
|
1079
|
+
forget(keys);
|
|
1080
|
+
const hosts = path.filter((value) => !isOurs(value));
|
|
1081
|
+
const mine = path.filter(isOurs);
|
|
1082
|
+
const childMoved = keys.length !== lastKeys.current.length || keys.some((key, i) => key !== lastKeys.current[i]);
|
|
1083
|
+
lastKeys.current = keys;
|
|
1084
|
+
const popped = mine.length < lastMine.current;
|
|
1085
|
+
lastMine.current = mine.length;
|
|
1086
|
+
if (root && wanted.length > 0 && !childMoved && popped && mine.length < wanted.length && mine.every((value, i) => value === wanted[i])) {
|
|
1087
|
+
if (mine.length === 0) {
|
|
1088
|
+
dismissed.current = true;
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
root.dispatch({ type: "tap", id: screens[mine.length].id });
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
if (mine.length === wanted.length && mine.every((value, i) => value === wanted[i])) return;
|
|
1095
|
+
lastMine.current = wanted.length;
|
|
1096
|
+
setPath([...hosts, ...wanted]);
|
|
1097
|
+
});
|
|
1098
|
+
return shown && screens.length > 0 && !dismissed.current;
|
|
1099
|
+
}
|
|
1100
|
+
const noSubscribe = () => () => {
|
|
1101
|
+
};
|
|
1102
|
+
const zero = () => 0;
|
|
1103
|
+
const NO_ROOT = {
|
|
1104
|
+
applyOps() {
|
|
1105
|
+
},
|
|
1106
|
+
onEvent() {
|
|
1107
|
+
},
|
|
1108
|
+
onEnvironment() {
|
|
1109
|
+
},
|
|
1110
|
+
dispatch() {
|
|
1111
|
+
},
|
|
1112
|
+
setEnvironment() {
|
|
1113
|
+
},
|
|
1114
|
+
subscribe: noSubscribe,
|
|
1115
|
+
getVersion: zero,
|
|
1116
|
+
root: { id: 0, kind: "root", props: {}, children: [], parent: null },
|
|
1117
|
+
node: () => void 0,
|
|
1118
|
+
rootProps: {},
|
|
1119
|
+
handlersFor: () => ({}),
|
|
1120
|
+
attach() {
|
|
1121
|
+
},
|
|
1122
|
+
dispose() {
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1028
1125
|
function RemoteTree({ root, initialPath, elements }) {
|
|
1029
1126
|
useSyncExternalStore(root.subscribe, root.getVersion, root.getVersion);
|
|
1030
1127
|
const environment = useContext(EnvironmentContext);
|
|
@@ -1041,20 +1138,8 @@ function RemoteTree({ root, initialPath, elements }) {
|
|
|
1041
1138
|
}, [root, environment]);
|
|
1042
1139
|
const stack = navigation ? findStack(root.root) : null;
|
|
1043
1140
|
const pushed = screensOf(stack).slice(1);
|
|
1044
|
-
const
|
|
1045
|
-
const ours = useRef(/* @__PURE__ */ new WeakSet());
|
|
1141
|
+
const { valueFor, keyOf: keyOf2, isOurs, forget } = useScreenValues(root, elements);
|
|
1046
1142
|
const lastPushed = useRef([]);
|
|
1047
|
-
const keyOf2 = (screen) => `${screen.id}:${JSON.stringify(screen.props["route"] ?? null)}`;
|
|
1048
|
-
const valueFor = (screen) => {
|
|
1049
|
-
const key = keyOf2(screen);
|
|
1050
|
-
let value = values.current.get(key);
|
|
1051
|
-
if (!value) {
|
|
1052
|
-
value = "route" in screen.props ? { view: /* @__PURE__ */ jsx(RemoteScreen, { root, id: screen.id, elements }), route: screen.props["route"] } : { view: /* @__PURE__ */ jsx(RemoteScreen, { root, id: screen.id, elements }) };
|
|
1053
|
-
values.current.set(key, value);
|
|
1054
|
-
ours.current.add(value);
|
|
1055
|
-
}
|
|
1056
|
-
return value;
|
|
1057
|
-
};
|
|
1058
1143
|
const restored = useRef(false);
|
|
1059
1144
|
useLayoutEffect(() => {
|
|
1060
1145
|
if (restored.current) return;
|
|
@@ -1066,11 +1151,11 @@ function RemoteTree({ root, initialPath, elements }) {
|
|
|
1066
1151
|
useLayoutEffect(() => {
|
|
1067
1152
|
if (!navigation) return;
|
|
1068
1153
|
const keys = pushed.map(keyOf2);
|
|
1069
|
-
const wanted = pushed.map(valueFor);
|
|
1070
|
-
|
|
1154
|
+
const wanted = pushed.map((screen) => valueFor(screen));
|
|
1155
|
+
forget(keys);
|
|
1071
1156
|
const tail = navigation.path.slice(depth);
|
|
1072
1157
|
let shown = 0;
|
|
1073
|
-
while (shown < tail.length &&
|
|
1158
|
+
while (shown < tail.length && isOurs(tail[shown])) shown += 1;
|
|
1074
1159
|
const childMoved = keys.length !== lastPushed.current.length || keys.some((key, i) => key !== lastPushed.current[i]);
|
|
1075
1160
|
lastPushed.current = keys;
|
|
1076
1161
|
if (!childMoved && shown < wanted.length && tail.slice(0, shown).every((value, i) => value === wanted[i])) {
|
|
@@ -1544,29 +1629,49 @@ function marginedContent(children, margins, axis) {
|
|
|
1544
1629
|
}
|
|
1545
1630
|
const LAZY_BATCH = 12;
|
|
1546
1631
|
const LazyContext = createContext(null);
|
|
1632
|
+
const LazyBatchContext = createContext(LAZY_BATCH);
|
|
1633
|
+
const LAZY_GRID_BATCH = 48;
|
|
1634
|
+
const LazyWindowContext = createContext(false);
|
|
1635
|
+
const LazyStackContext = createContext(false);
|
|
1547
1636
|
function LazyGroup({ rows, start = 0, wrap: wrap2 }) {
|
|
1548
1637
|
const axis = useContext(LazyContext);
|
|
1638
|
+
const batch = useContext(LazyBatchContext);
|
|
1549
1639
|
const request = useContext(ScrollRequestContext);
|
|
1550
|
-
const
|
|
1640
|
+
const windowed = useContext(LazyWindowContext) && useContext(LazyStackContext) && axis !== null;
|
|
1641
|
+
const [count, setCount] = useState(batch);
|
|
1642
|
+
const [front, setFront] = useState({ from: 0, extents: [] });
|
|
1551
1643
|
const target = request && "id" in request ? rows.findIndex((row) => rowMatches(row, request.id)) : -1;
|
|
1552
|
-
const needed = target >= 0 ? Math.ceil((target + 1) /
|
|
1644
|
+
const needed = target >= 0 ? Math.ceil((target + 1) / batch) * batch : 0;
|
|
1553
1645
|
useEffect(() => {
|
|
1554
1646
|
if (needed > count) setCount(needed);
|
|
1555
|
-
|
|
1647
|
+
if (target >= 0 && target < front.from) setFront({ from: Math.floor(target / batch) * batch, extents: front.extents.slice(0, Math.floor(target / batch)) });
|
|
1648
|
+
}, [needed, count, target, front, batch]);
|
|
1556
1649
|
const visible = Math.max(count, needed);
|
|
1557
|
-
const
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
return
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
{
|
|
1565
|
-
)
|
|
1566
|
-
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1650
|
+
const from = windowed ? Math.min(front.from, Math.max(0, visible - batch)) : 0;
|
|
1651
|
+
const shown = axis === null ? rows : rows.slice(from, visible);
|
|
1652
|
+
const built = shown.map((row, index) => wrap2 ? wrap2(row, start + from + index) : row);
|
|
1653
|
+
if (axis === null || !windowed && shown.length >= rows.length) return built;
|
|
1654
|
+
const ask = (event) => {
|
|
1655
|
+
if (event.drop && event.drop > 0) {
|
|
1656
|
+
const drop = Math.min(event.drop, shown.length - batch);
|
|
1657
|
+
if (drop > 0) setFront({ from: from + drop, extents: [...front.extents, ...(event.extents ?? []).slice(0, Math.ceil(drop / batch))] });
|
|
1658
|
+
} else if (event.dropEnd && event.dropEnd > 0) {
|
|
1659
|
+
setCount(Math.max(from + batch, visible - event.dropEnd));
|
|
1660
|
+
} else if (from > 0) {
|
|
1661
|
+
setFront({ from: Math.max(0, from - batch), extents: front.extents.slice(0, -1) });
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
const leading = windowed ? [createElement(LazySpacer, { key: `lazy-lead-${from}`, axis, remaining: from, edge: "leading", extent: front.extents.reduce((a, b) => a + b, 0), built: shown.length, batch, ask })] : [];
|
|
1665
|
+
const trailing = visible < rows.length ? [createElement(LazySpacer, { key: `lazy-${visible}`, axis, remaining: rows.length - visible, ask: () => setCount(visible + batch) })] : [];
|
|
1666
|
+
return [...leading, ...built, ...trailing];
|
|
1667
|
+
}
|
|
1668
|
+
function LazySpacer({
|
|
1669
|
+
axis,
|
|
1670
|
+
remaining,
|
|
1671
|
+
ask,
|
|
1672
|
+
...leading
|
|
1673
|
+
}) {
|
|
1674
|
+
return sb("lazyspacer", { axis, remaining, ...leading }, { lazy: ask });
|
|
1570
1675
|
}
|
|
1571
1676
|
function rowMatches(row, id) {
|
|
1572
1677
|
if (row.key !== null && row.key === String(id)) return true;
|
|
@@ -1596,6 +1701,11 @@ function HStack(props) {
|
|
|
1596
1701
|
if (own.pinnedViews && own.pinnedViews.length > 0) stack["pinned"] = own.pinnedViews;
|
|
1597
1702
|
return applyModifiers(sb("hstack", stack, void 0, pinning(own.pinnedViews, own.children)), modifiers);
|
|
1598
1703
|
}
|
|
1704
|
+
function FlowStack(props) {
|
|
1705
|
+
const { own, modifiers } = splitProps(props);
|
|
1706
|
+
const stack = { spacing: own.spacing ?? null, lineSpacing: own.lineSpacing ?? null, alignment: own.alignment ?? "center" };
|
|
1707
|
+
return applyModifiers(sb("flowstack", stack, void 0, own.children), modifiers);
|
|
1708
|
+
}
|
|
1599
1709
|
function ZStack(props) {
|
|
1600
1710
|
const { own, modifiers } = splitProps(props);
|
|
1601
1711
|
return applyModifiers(sb("zstack", { alignment: own.alignment ?? "center" }, void 0, own.children), modifiers);
|
|
@@ -1777,17 +1887,20 @@ function GridItem(spec = {}) {
|
|
|
1777
1887
|
GridItem.flexible = (options = {}) => GridItem({ size: { flexible: options }, spacing: options.spacing, alignment: options.alignment });
|
|
1778
1888
|
GridItem.fixed = (value, options = {}) => GridItem({ size: { fixed: value }, spacing: options.spacing, alignment: options.alignment });
|
|
1779
1889
|
GridItem.adaptive = (options) => GridItem({ size: { adaptive: options }, spacing: options.spacing, alignment: options.alignment });
|
|
1890
|
+
function lazyCells(axis, children) {
|
|
1891
|
+
return createElement(LazyContext.Provider, { value: axis }, createElement(LazyStackContext.Provider, { value: false }, createElement(LazyBatchContext.Provider, { value: LAZY_GRID_BATCH }, children)));
|
|
1892
|
+
}
|
|
1780
1893
|
function LazyVGrid(props) {
|
|
1781
1894
|
const { own, modifiers } = splitProps(props);
|
|
1782
1895
|
const grid = { columns: own.columns, spacing: own.spacing ?? null, alignment: own.alignment ?? "center" };
|
|
1783
1896
|
if (own.pinnedViews && own.pinnedViews.length > 0) grid["pinned"] = own.pinnedViews;
|
|
1784
|
-
return applyModifiers(sb("lazyvgrid", grid, void 0, pinning(own.pinnedViews, own.children)), modifiers);
|
|
1897
|
+
return applyModifiers(sb("lazyvgrid", grid, void 0, lazyCells("vertical", pinning(own.pinnedViews, own.children))), modifiers);
|
|
1785
1898
|
}
|
|
1786
1899
|
function LazyHGrid(props) {
|
|
1787
1900
|
const { own, modifiers } = splitProps(props);
|
|
1788
1901
|
const grid = { rows: own.rows, spacing: own.spacing ?? null, alignment: own.alignment ?? "center" };
|
|
1789
1902
|
if (own.pinnedViews && own.pinnedViews.length > 0) grid["pinned"] = own.pinnedViews;
|
|
1790
|
-
return applyModifiers(sb("lazyhgrid", grid, void 0, pinning(own.pinnedViews, own.children)), modifiers);
|
|
1903
|
+
return applyModifiers(sb("lazyhgrid", grid, void 0, lazyCells("horizontal", pinning(own.pinnedViews, own.children))), modifiers);
|
|
1791
1904
|
}
|
|
1792
1905
|
function Grid(props) {
|
|
1793
1906
|
const { own, modifiers } = splitProps(props);
|
|
@@ -2117,10 +2230,11 @@ function NavigationSplitView(props) {
|
|
|
2117
2230
|
const sidebarVisible = visibility !== "detailOnly";
|
|
2118
2231
|
const toggle = () => withAnimation(() => setVisibility(sidebarVisible ? "detailOnly" : "all"));
|
|
2119
2232
|
const detail = isValidElement(own.detail) && own.detail.type === NavigationStack ? own.detail : /* @__PURE__ */ jsx(NavigationStack, { children: own.detail });
|
|
2120
|
-
const
|
|
2233
|
+
const hinted = (content) => own.sidebarWidth !== void 0 ? sb("styled", { style: { splitColumnWidth: splitColumnWidthHint(own.sidebarWidth) } }, void 0, content) : content;
|
|
2234
|
+
const sidebar = isValidElement(own.sidebar) && own.sidebar.type === NavigationStack ? hinted(own.sidebar) : /* @__PURE__ */ jsx(NavigationStack, { children: hinted(own.sidebar) });
|
|
2121
2235
|
return applyModifiers(
|
|
2122
2236
|
sb("navsplit", { sidebarVisible }, { tap: toggle, columnwidth: (event) => own.onSidebarWidthChange?.(event.width) }, [
|
|
2123
|
-
/* @__PURE__ */ jsx(SplitColumn, { report, children:
|
|
2237
|
+
/* @__PURE__ */ jsx(SplitColumn, { report, children: sidebar }, "sidebar"),
|
|
2124
2238
|
/* @__PURE__ */ jsx(SplitColumn, { report: null, children: detail }, "detail")
|
|
2125
2239
|
]),
|
|
2126
2240
|
modifiers
|
|
@@ -2848,6 +2962,7 @@ const MODIFIER_KEYS = /* @__PURE__ */ new Set([
|
|
|
2848
2962
|
"toolbarRole",
|
|
2849
2963
|
"toolbarVisibility",
|
|
2850
2964
|
"statusBarHidden",
|
|
2965
|
+
"navigationBarBackButtonHidden",
|
|
2851
2966
|
"toolbar",
|
|
2852
2967
|
"searchable",
|
|
2853
2968
|
"navigationDestination",
|
|
@@ -3303,6 +3418,9 @@ function apply(key, value, node, sides) {
|
|
|
3303
3418
|
case "statusBarHidden":
|
|
3304
3419
|
sides.push(sb(PREF_KIND, { statusBarHidden: Boolean(value) }, void 0, void 0, "navscreen"));
|
|
3305
3420
|
return node;
|
|
3421
|
+
case "navigationBarBackButtonHidden":
|
|
3422
|
+
sides.push(sb(PREF_KIND, { backButtonHidden: Boolean(value) }, void 0, void 0, "navscreen"));
|
|
3423
|
+
return node;
|
|
3306
3424
|
case "toolbar":
|
|
3307
3425
|
sides.push(sb(HOIST_KIND, void 0, void 0, value, "navscreen"));
|
|
3308
3426
|
return node;
|
|
@@ -3666,7 +3784,7 @@ function mount(screen, element, options = {}) {
|
|
|
3666
3784
|
}) : null;
|
|
3667
3785
|
observer?.observe(screen);
|
|
3668
3786
|
const stopScenePhase = typeof document !== "undefined" ? watchScenePhase((scenePhase) => root.setEnvironment({ scenePhase })) : null;
|
|
3669
|
-
root.render(element);
|
|
3787
|
+
root.render(createElement(LazyWindowContext.Provider, { value: true }, element));
|
|
3670
3788
|
const mounted = {
|
|
3671
3789
|
root,
|
|
3672
3790
|
renderer,
|
|
@@ -5988,6 +6106,7 @@ function TextEditor(props) {
|
|
|
5988
6106
|
if (focus) editor["focused"] = focus[0];
|
|
5989
6107
|
if (selection) editor["selection"] = { start: selection[0].start, end: selection[0].end };
|
|
5990
6108
|
if (own.onDeleteBackward) editor["deleteBackward"] = true;
|
|
6109
|
+
if (own.marks && own.marks.length > 0) editor["marks"] = own.marks.map((mark) => ({ start: mark.start, end: mark.end, color: color(mark.color ?? MARK_COLOR) }));
|
|
5991
6110
|
return applyModifiers(
|
|
5992
6111
|
sb("texteditor", editor, {
|
|
5993
6112
|
text: (event) => setText(rich ? AttributedText.replacingCharacters(text, event.value) : event.value),
|
|
@@ -6002,6 +6121,7 @@ function TextEditor(props) {
|
|
|
6002
6121
|
modifiers
|
|
6003
6122
|
);
|
|
6004
6123
|
}
|
|
6124
|
+
const MARK_COLOR = opacity("accent", 0.25);
|
|
6005
6125
|
function buttonDisabled(modifiers) {
|
|
6006
6126
|
return modifiers.some(([key, value]) => key === "disabled" && value === true);
|
|
6007
6127
|
}
|
|
@@ -6060,7 +6180,9 @@ ContainerRelativeShape.shape = { kind: "containerRelative", cornerRadius: null }
|
|
|
6060
6180
|
function Shape(props) {
|
|
6061
6181
|
const { own, modifiers } = splitProps(props);
|
|
6062
6182
|
const [size, setSize] = useState(null);
|
|
6063
|
-
const
|
|
6183
|
+
const sized = useRef(false);
|
|
6184
|
+
const affine = sized.current ? null : affinePath(own.path);
|
|
6185
|
+
if (affine === null) sized.current = true;
|
|
6064
6186
|
const shapeProps = {
|
|
6065
6187
|
shape: "path",
|
|
6066
6188
|
cornerRadius: 0,
|
|
@@ -6670,7 +6792,7 @@ function List(props) {
|
|
|
6670
6792
|
const ownSettings = takeScrollSettings(modifiers);
|
|
6671
6793
|
const edgeEffect = edgeEffectProp(useScrollSettings(ownSettings));
|
|
6672
6794
|
if (edgeEffect) listProps["edgeEffect"] = edgeEffect;
|
|
6673
|
-
const element = /* @__PURE__ */ jsx(LazyContext.Provider, { value: "vertical", children: sb("list", listProps, refresh.handlers, providingScrollSettings(ownSettings, wrapRows(own.children))) });
|
|
6795
|
+
const element = /* @__PURE__ */ jsx(LazyContext.Provider, { value: "vertical", children: /* @__PURE__ */ jsx(LazyStackContext.Provider, { value: false, children: sb("list", listProps, refresh.handlers, providingScrollSettings(ownSettings, wrapRows(own.children))) }) });
|
|
6674
6796
|
return applyModifiers(
|
|
6675
6797
|
selection ? /* @__PURE__ */ jsx(ListSelectionContext.Provider, { value: selection, children: element }) : element,
|
|
6676
6798
|
modifiers
|
|
@@ -7316,10 +7438,10 @@ function ViewThatFits(props) {
|
|
|
7316
7438
|
return applyModifiers(sb("viewthatfits", { axes: own.axes ?? "both" }, void 0, own.children), modifiers);
|
|
7317
7439
|
}
|
|
7318
7440
|
function LazyVStack(props) {
|
|
7319
|
-
return /* @__PURE__ */ jsx(LazyContext.Provider, { value: "vertical", children: /* @__PURE__ */ jsx(VStack, { ...props }) });
|
|
7441
|
+
return /* @__PURE__ */ jsx(LazyContext.Provider, { value: "vertical", children: /* @__PURE__ */ jsx(LazyStackContext.Provider, { value: true, children: /* @__PURE__ */ jsx(VStack, { ...props }) }) });
|
|
7320
7442
|
}
|
|
7321
7443
|
function LazyHStack(props) {
|
|
7322
|
-
return /* @__PURE__ */ jsx(LazyContext.Provider, { value: "horizontal", children: /* @__PURE__ */ jsx(HStack, { ...props }) });
|
|
7444
|
+
return /* @__PURE__ */ jsx(LazyContext.Provider, { value: "horizontal", children: /* @__PURE__ */ jsx(LazyStackContext.Provider, { value: true, children: /* @__PURE__ */ jsx(HStack, { ...props }) }) });
|
|
7323
7445
|
}
|
|
7324
7446
|
function ContentUnavailableView(props) {
|
|
7325
7447
|
const { own, modifiers } = splitProps(props);
|
|
@@ -8200,6 +8322,7 @@ export {
|
|
|
8200
8322
|
Divider,
|
|
8201
8323
|
EditButton,
|
|
8202
8324
|
Ellipse,
|
|
8325
|
+
FlowStack,
|
|
8203
8326
|
Font,
|
|
8204
8327
|
ForEach,
|
|
8205
8328
|
Form,
|
|
@@ -8354,6 +8477,7 @@ export {
|
|
|
8354
8477
|
usePlatform,
|
|
8355
8478
|
useRedacted,
|
|
8356
8479
|
useRefreshable,
|
|
8480
|
+
useRemoteSidebar,
|
|
8357
8481
|
useReportSplitSelection,
|
|
8358
8482
|
useScenePhase,
|
|
8359
8483
|
useSpeechRecognition,
|