@opengeni/react 6.1.0 → 7.0.0-canary.35625901699001
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 +83 -2
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +1 -1
- package/dist/artifacts-presentation.js +1 -1
- package/dist/artifacts-spreadsheet.js +1 -1
- package/dist/artifacts.js +3 -3
- package/dist/{browser-viewer-NTD6UIPR.js → browser-viewer-LGH4IP47.js} +3 -3
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/{chunk-NOSYBS2D.js → chunk-2VHARTBL.js} +2 -1
- package/dist/{chunk-VRBL3F5E.js → chunk-5GAL23FF.js} +10 -2
- package/dist/{chunk-VRBL3F5E.js.map → chunk-5GAL23FF.js.map} +1 -1
- package/dist/chunk-5UONOQ3Y.js +635 -0
- package/dist/chunk-5UONOQ3Y.js.map +1 -0
- package/dist/{chunk-NYESIADM.js → chunk-AKOMC3VO.js} +3 -3
- package/dist/chunk-AKOMC3VO.js.map +1 -0
- package/dist/chunk-BRM6FVZA.js +302 -0
- package/dist/chunk-BRM6FVZA.js.map +1 -0
- package/dist/{chunk-KANFU34B.js → chunk-DBPVUGQT.js} +11 -2
- package/dist/chunk-DBPVUGQT.js.map +1 -0
- package/dist/chunk-FHIGTPME.js +1589 -0
- package/dist/chunk-FHIGTPME.js.map +1 -0
- package/dist/{chunk-5M6VTFJ5.js → chunk-GBPCZH3Y.js} +2 -2
- package/dist/{chunk-YBM6CQRU.js → chunk-GEN54DU5.js} +4 -4
- package/dist/{chunk-UMECRJRV.js → chunk-HJ5VJ4JB.js} +21 -12
- package/dist/chunk-HJ5VJ4JB.js.map +1 -0
- package/dist/{chunk-R4KRSFGA.js → chunk-IP4BUBKH.js} +3 -3
- package/dist/{chunk-NLTS7JHI.js → chunk-JPHDWKZE.js} +5 -5
- package/dist/{chunk-TDSEILUH.js → chunk-MI6ALLLD.js} +1297 -1535
- package/dist/chunk-MI6ALLLD.js.map +1 -0
- package/dist/{chunk-ICA6R6TW.js → chunk-OWHPKAOV.js} +28 -20
- package/dist/chunk-OWHPKAOV.js.map +1 -0
- package/dist/{chunk-24M4YBCL.js → chunk-PNAVEK2U.js} +4 -4
- package/dist/{chunk-L2NBTKRX.js → chunk-TXCBE32L.js} +203 -19
- package/dist/chunk-TXCBE32L.js.map +1 -0
- package/dist/{chunk-45XEUVTK.js → chunk-UXE5SSNN.js} +293 -463
- package/dist/chunk-UXE5SSNN.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-VR4Z73EU.js} +203 -9
- package/dist/chunk-VR4Z73EU.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-XMXRI5JK.js} +65 -18
- package/dist/chunk-XMXRI5JK.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/chat-composer.d.ts +13 -3
- package/dist/components/markdown.d.ts +6 -3
- package/dist/components/message-timeline.d.ts +7 -2
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/session-capability-frame.d.ts +24 -0
- package/dist/components/session-chrome.d.ts +1 -2
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +3 -0
- package/dist/components/session-mcp-capability-card.d.ts +22 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/composer.js +7 -7
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +5 -0
- package/dist/connect-chooser.d.ts +6 -0
- package/dist/connect-panel.d.ts +9 -2
- package/dist/connect-setup.d.ts +5 -1
- package/dist/connect.d.ts +5 -21
- package/dist/connect.js +1268 -584
- package/dist/connect.js.map +1 -1
- package/dist/connection-catalog.d.ts +6 -1
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +1 -0
- package/dist/connection-logo.d.ts +5 -2
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/hooks/use-codex-accounts.d.ts +11 -5
- package/dist/hooks/use-connect.d.ts +22 -0
- package/dist/hooks/use-session-events.d.ts +5 -0
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-workspace-sessions.d.ts +2 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +771 -793
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/machines.js +2 -2
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/{model-policy-picker-menu-3R336DP2.js → model-policy-picker-menu-RVOQ4ZZG.js} +4 -4
- package/dist/model-policy.d.ts +6 -2
- package/dist/model-policy.js +1 -1
- package/dist/{platform-activity-row-DUE2W74J.js → platform-activity-row-HLOH7FW4.js} +9 -4
- package/dist/platform-activity-row-HLOH7FW4.js.map +1 -0
- package/dist/plugin-discovery.d.ts +6 -0
- package/dist/{queue-surface-implementation-LK3S4BIW.js → queue-surface-implementation-3RIFK2BS.js} +4 -4
- package/dist/realtime.js +22 -22
- package/dist/realtime.js.map +1 -1
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +12 -0
- package/dist/session-ui.d.ts +2 -0
- package/dist/session-ui.js +14 -12
- package/dist/session.d.ts +1 -0
- package/dist/session.js +6 -4
- package/dist/skill-discovery.d.ts +11 -0
- package/dist/timeline/compaction-copy.d.ts +10 -0
- package/dist/timeline/projection.d.ts +3 -1
- package/dist/timeline/tool-display-name.d.ts +2 -1
- package/dist/timeline/turn-summary.d.ts +2 -2
- package/dist/timeline/types.d.ts +24 -2
- package/dist/{timeline-annotation-markers-DRSTLEM6.js → timeline-annotation-markers-OY6OWR3V.js} +2 -2
- package/dist/{timeline-annotation-selection-IHLUGVND.js → timeline-annotation-selection-BOXA2TIN.js} +2 -2
- package/dist/{timeline-annotations-dialog-6Q53N5FG.js → timeline-annotations-dialog-RGY3MHL3.js} +3 -3
- package/package.json +3 -3
- package/src/approvals.ts +8 -1
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +94 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +0 -9
- package/src/components/approval-surface.tsx +12 -2
- package/src/components/artifacts/document-editor.tsx +63 -6
- package/src/components/artifacts/presentation-editor.tsx +214 -9
- package/src/components/artifacts/spreadsheet-canvas.ts +3 -8
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +10 -11
- package/src/components/chat-composer.tsx +26 -3
- package/src/components/composer.tsx +10 -4
- package/src/components/human-input-form.tsx +12 -2
- package/src/components/markdown.tsx +133 -9
- package/src/components/message-timeline.tsx +104 -36
- package/src/components/model-picker.tsx +11 -3
- package/src/components/model-policy-picker-menu.tsx +10 -3
- package/src/components/preview-loading.tsx +154 -0
- package/src/components/sandbox-workspace.tsx +20 -36
- package/src/components/session-capability-frame.tsx +163 -0
- package/src/components/session-chrome.tsx +46 -77
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +97 -0
- package/src/components/session-conversation.tsx +10 -5
- package/src/components/session-mcp-capability-card.tsx +532 -0
- package/src/components/session-status.tsx +2 -2
- package/src/components/timeline-anchor.tsx +9 -8
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/user-message-body.tsx +7 -0
- package/src/connect-account-identity.tsx +34 -0
- package/src/connect-accounts.tsx +114 -52
- package/src/connect-chooser.tsx +171 -39
- package/src/connect-panel.tsx +73 -9
- package/src/connect-setup.tsx +72 -25
- package/src/connect.ts +13 -22
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +61 -39
- package/src/connection-discovery.tsx +235 -0
- package/src/connection-installed.tsx +2 -0
- package/src/connection-logo.tsx +18 -10
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/conversation-timeline.ts +1 -0
- package/src/discovery-cache.ts +42 -0
- package/src/hooks/use-codex-accounts.ts +33 -14
- package/src/hooks/use-composer.ts +4 -5
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-session-events.ts +114 -1
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-workspace-sessions.ts +10 -0
- package/src/index.ts +22 -2
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-policy.ts +21 -0
- package/src/plugin-details.tsx +8 -5
- package/src/plugin-discovery.tsx +92 -72
- package/src/realtime/realtime-control.tsx +6 -8
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +83 -0
- package/src/session-ui.ts +2 -0
- package/src/session.ts +1 -0
- package/src/skill-discovery.tsx +101 -56
- package/src/timeline/compaction-copy.ts +40 -0
- package/src/timeline/platform-activity-row.tsx +8 -3
- package/src/timeline/projection.ts +78 -2
- package/src/timeline/rolling-activity.tsx +4 -2
- package/src/timeline/shared.tsx +6 -1
- package/src/timeline/startup-timings.tsx +1 -1
- package/src/timeline/tool-display-name.ts +8 -6
- package/src/timeline/tool-renderers.tsx +5 -3
- package/src/timeline/turn-summary.tsx +17 -3
- package/src/timeline/types.ts +24 -2
- package/styles/compiled.css +325 -27
- package/styles/connect.css +90 -15
- package/styles/index.css +46 -0
- package/styles/session-capability.css +42 -0
- package/dist/chunk-45XEUVTK.js.map +0 -1
- package/dist/chunk-HQV2I5HV.js +0 -124
- package/dist/chunk-HQV2I5HV.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-IHQII5WO.js +0 -886
- package/dist/chunk-IHQII5WO.js.map +0 -1
- package/dist/chunk-KANFU34B.js.map +0 -1
- package/dist/chunk-L2NBTKRX.js.map +0 -1
- package/dist/chunk-NYESIADM.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-TDSEILUH.js.map +0 -1
- package/dist/chunk-UMECRJRV.js.map +0 -1
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/platform-activity-row-DUE2W74J.js.map +0 -1
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-LGH4IP47.js.map} +0 -0
- /package/dist/{chunk-NOSYBS2D.js.map → chunk-2VHARTBL.js.map} +0 -0
- /package/dist/{chunk-5M6VTFJ5.js.map → chunk-GBPCZH3Y.js.map} +0 -0
- /package/dist/{chunk-YBM6CQRU.js.map → chunk-GEN54DU5.js.map} +0 -0
- /package/dist/{chunk-R4KRSFGA.js.map → chunk-IP4BUBKH.js.map} +0 -0
- /package/dist/{chunk-NLTS7JHI.js.map → chunk-JPHDWKZE.js.map} +0 -0
- /package/dist/{chunk-24M4YBCL.js.map → chunk-PNAVEK2U.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-3R336DP2.js.map → model-policy-picker-menu-RVOQ4ZZG.js.map} +0 -0
- /package/dist/{queue-surface-implementation-LK3S4BIW.js.map → queue-surface-implementation-3RIFK2BS.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-DRSTLEM6.js.map → timeline-annotation-markers-OY6OWR3V.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-IHLUGVND.js.map → timeline-annotation-selection-BOXA2TIN.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-6Q53N5FG.js.map → timeline-annotations-dialog-RGY3MHL3.js.map} +0 -0
|
@@ -37,6 +37,9 @@ var MAX_ZOOM = 4;
|
|
|
37
37
|
var RAIL_ITEM_HEIGHT = 116;
|
|
38
38
|
var RAIL_OVERSCAN = 3;
|
|
39
39
|
var DEFAULT_RAIL_HEIGHT = 640;
|
|
40
|
+
var MOBILE_RAIL_ITEM_HEIGHT = 44;
|
|
41
|
+
var MOBILE_RAIL_OVERSCAN = 3;
|
|
42
|
+
var DEFAULT_MOBILE_LIST_HEIGHT = 264;
|
|
40
43
|
var DEFAULT_VIEWPORT = { width: 960, height: 640 };
|
|
41
44
|
var SPATIAL_TILE = 256;
|
|
42
45
|
var MAX_SPATIAL_BUCKETS_PER_OBJECT = 1024;
|
|
@@ -87,6 +90,14 @@ function PresentationProjectionEditor({
|
|
|
87
90
|
}
|
|
88
91
|
);
|
|
89
92
|
}
|
|
93
|
+
function nextSlideIndexFromKey(key, activeIndex, length) {
|
|
94
|
+
if (length === 0) return null;
|
|
95
|
+
if (key === "ArrowDown") return Math.min(length - 1, activeIndex + 1);
|
|
96
|
+
if (key === "ArrowUp") return Math.max(0, activeIndex - 1);
|
|
97
|
+
if (key === "Home") return 0;
|
|
98
|
+
if (key === "End") return length - 1;
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
90
101
|
function PresentationEditorCore({
|
|
91
102
|
presentation,
|
|
92
103
|
revision,
|
|
@@ -125,6 +136,11 @@ function PresentationEditorCore({
|
|
|
125
136
|
scrollTop: 0,
|
|
126
137
|
height: DEFAULT_RAIL_HEIGHT
|
|
127
138
|
});
|
|
139
|
+
const [mobileSelectorOpen, setMobileSelectorOpen] = useState(false);
|
|
140
|
+
const [mobileRail, setMobileRail] = useState({
|
|
141
|
+
scrollTop: 0,
|
|
142
|
+
height: DEFAULT_MOBILE_LIST_HEIGHT
|
|
143
|
+
});
|
|
128
144
|
const [viewport, setViewport] = useState({
|
|
129
145
|
scrollLeft: 0,
|
|
130
146
|
scrollTop: 0,
|
|
@@ -137,6 +153,9 @@ function PresentationEditorCore({
|
|
|
137
153
|
const [textDraft, setTextDraft] = useState("");
|
|
138
154
|
const [paintEpoch, setPaintEpoch] = useState(0);
|
|
139
155
|
const railRef = useRef(null);
|
|
156
|
+
const mobileSelectorTriggerRef = useRef(null);
|
|
157
|
+
const mobileSelectorPanelRef = useRef(null);
|
|
158
|
+
const mobileRailRef = useRef(null);
|
|
140
159
|
const viewportRef = useRef(null);
|
|
141
160
|
const stageRef = useRef(null);
|
|
142
161
|
const canvasRef = useRef(null);
|
|
@@ -150,6 +169,7 @@ function PresentationEditorCore({
|
|
|
150
169
|
const commandVersionsRef = useRef(/* @__PURE__ */ new Map());
|
|
151
170
|
const pendingSlideIdRef = useRef(null);
|
|
152
171
|
const pendingObjectIdRef = useRef(null);
|
|
172
|
+
const mobileRailScrollOnOpenRef = useRef(0);
|
|
153
173
|
const domId = useId().replaceAll(":", "");
|
|
154
174
|
const selectionProxyId = `${domId}-presentation-selection`;
|
|
155
175
|
const instructionsId = `${domId}-presentation-instructions`;
|
|
@@ -208,6 +228,44 @@ function PresentationEditorCore({
|
|
|
208
228
|
observer.observe(element);
|
|
209
229
|
return () => observer.disconnect();
|
|
210
230
|
}, []);
|
|
231
|
+
useLayoutEffect(() => {
|
|
232
|
+
if (!mobileSelectorOpen) return;
|
|
233
|
+
const element = mobileRailRef.current;
|
|
234
|
+
if (!element) return;
|
|
235
|
+
element.scrollTop = mobileRailScrollOnOpenRef.current;
|
|
236
|
+
element.focus();
|
|
237
|
+
const measure = () => setMobileRail((current) => ({
|
|
238
|
+
scrollTop: element.scrollTop,
|
|
239
|
+
height: element.clientHeight || current.height
|
|
240
|
+
}));
|
|
241
|
+
measure();
|
|
242
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
243
|
+
const observer = new ResizeObserver(measure);
|
|
244
|
+
observer.observe(element);
|
|
245
|
+
return () => observer.disconnect();
|
|
246
|
+
}, [mobileSelectorOpen]);
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
if (!mobileSelectorOpen) return;
|
|
249
|
+
const onPointerDown = (event) => {
|
|
250
|
+
const target = event.target;
|
|
251
|
+
if (!(target instanceof Node)) return;
|
|
252
|
+
if (mobileSelectorTriggerRef.current?.contains(target)) return;
|
|
253
|
+
if (mobileSelectorPanelRef.current?.contains(target)) return;
|
|
254
|
+
setMobileSelectorOpen(false);
|
|
255
|
+
};
|
|
256
|
+
const onKeyDown = (event) => {
|
|
257
|
+
if (event.key !== "Escape") return;
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
setMobileSelectorOpen(false);
|
|
260
|
+
mobileSelectorTriggerRef.current?.focus();
|
|
261
|
+
};
|
|
262
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
263
|
+
document.addEventListener("keydown", onKeyDown);
|
|
264
|
+
return () => {
|
|
265
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
266
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
267
|
+
};
|
|
268
|
+
}, [mobileSelectorOpen]);
|
|
211
269
|
useLayoutEffect(() => {
|
|
212
270
|
const element = viewportRef.current;
|
|
213
271
|
if (!element) return;
|
|
@@ -623,6 +681,32 @@ function PresentationEditorCore({
|
|
|
623
681
|
},
|
|
624
682
|
[activeIndex, activeSlide, selectSlide, slides]
|
|
625
683
|
);
|
|
684
|
+
const toggleMobileSlideSelector = useCallback(() => {
|
|
685
|
+
setMobileSelectorOpen((open) => {
|
|
686
|
+
if (open) return false;
|
|
687
|
+
const index = Math.max(0, activeIndex);
|
|
688
|
+
const height = DEFAULT_MOBILE_LIST_HEIGHT;
|
|
689
|
+
const maxScroll = Math.max(0, slides.length * MOBILE_RAIL_ITEM_HEIGHT - height);
|
|
690
|
+
const scrollTop = Math.max(
|
|
691
|
+
0,
|
|
692
|
+
Math.min(
|
|
693
|
+
maxScroll,
|
|
694
|
+
index * MOBILE_RAIL_ITEM_HEIGHT - height / 2 + MOBILE_RAIL_ITEM_HEIGHT / 2
|
|
695
|
+
)
|
|
696
|
+
);
|
|
697
|
+
mobileRailScrollOnOpenRef.current = scrollTop;
|
|
698
|
+
setMobileRail({ scrollTop, height });
|
|
699
|
+
return true;
|
|
700
|
+
});
|
|
701
|
+
}, [activeIndex, slides.length]);
|
|
702
|
+
const chooseMobileSlide = useCallback(
|
|
703
|
+
(slide, index) => {
|
|
704
|
+
if (slide !== activeSlide) selectSlide(slide, index);
|
|
705
|
+
setMobileSelectorOpen(false);
|
|
706
|
+
mobileSelectorTriggerRef.current?.focus();
|
|
707
|
+
},
|
|
708
|
+
[activeSlide, selectSlide]
|
|
709
|
+
);
|
|
626
710
|
const handleCanvasKeyDown = useCallback(
|
|
627
711
|
(event) => {
|
|
628
712
|
if (event.metaKey || event.ctrlKey) {
|
|
@@ -784,6 +868,15 @@ function PresentationEditorCore({
|
|
|
784
868
|
slides.length,
|
|
785
869
|
Math.ceil((rail.scrollTop + rail.height) / RAIL_ITEM_HEIGHT) + RAIL_OVERSCAN
|
|
786
870
|
);
|
|
871
|
+
const mobileRailStart = Math.max(
|
|
872
|
+
0,
|
|
873
|
+
Math.floor(mobileRail.scrollTop / MOBILE_RAIL_ITEM_HEIGHT) - MOBILE_RAIL_OVERSCAN
|
|
874
|
+
);
|
|
875
|
+
const mobileRailEnd = Math.min(
|
|
876
|
+
slides.length,
|
|
877
|
+
Math.ceil((mobileRail.scrollTop + mobileRail.height) / MOBILE_RAIL_ITEM_HEIGHT) + MOBILE_RAIL_OVERSCAN
|
|
878
|
+
);
|
|
879
|
+
const slideCountLabel = activeIndex >= 0 ? `${activeIndex + 1} / ${slides.length}` : `0 / ${slides.length}`;
|
|
787
880
|
const stageWidth = presentation.slideSize.width * zoom;
|
|
788
881
|
const stageHeight = presentation.slideSize.height * zoom;
|
|
789
882
|
return /* @__PURE__ */ jsxs(
|
|
@@ -815,7 +908,23 @@ function PresentationEditorCore({
|
|
|
815
908
|
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
816
909
|
}
|
|
817
910
|
),
|
|
818
|
-
/* @__PURE__ */ jsx(
|
|
911
|
+
/* @__PURE__ */ jsx(
|
|
912
|
+
"button",
|
|
913
|
+
{
|
|
914
|
+
ref: mobileSelectorTriggerRef,
|
|
915
|
+
type: "button",
|
|
916
|
+
"aria-label": "Choose slide",
|
|
917
|
+
"aria-haspopup": "listbox",
|
|
918
|
+
"aria-expanded": mobileSelectorOpen,
|
|
919
|
+
"aria-controls": mobileSelectorOpen ? `${domId}-mobile-slides` : void 0,
|
|
920
|
+
disabled: slides.length === 0,
|
|
921
|
+
"data-og-mobile-slide-selector": true,
|
|
922
|
+
onClick: toggleMobileSlideSelector,
|
|
923
|
+
className: "inline-flex min-h-11 min-w-16 shrink-0 items-center justify-center rounded-og-sm px-2 text-og-xs tabular-nums text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 sm:hidden",
|
|
924
|
+
children: /* @__PURE__ */ jsx("span", { children: slideCountLabel })
|
|
925
|
+
}
|
|
926
|
+
),
|
|
927
|
+
/* @__PURE__ */ jsx("span", { className: "hidden min-w-16 shrink-0 text-center text-og-xs tabular-nums text-og-fg-muted sm:inline", children: slideCountLabel }),
|
|
819
928
|
/* @__PURE__ */ jsx(
|
|
820
929
|
"button",
|
|
821
930
|
{
|
|
@@ -920,7 +1029,7 @@ function PresentationEditorCore({
|
|
|
920
1029
|
}
|
|
921
1030
|
),
|
|
922
1031
|
/* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: commandFailure?.message ?? (pendingCommands > 0 ? "Saving presentation changes" : "") }),
|
|
923
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-1", children: [
|
|
1032
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 min-w-0 flex-1", children: [
|
|
924
1033
|
/* @__PURE__ */ jsx(
|
|
925
1034
|
"div",
|
|
926
1035
|
{
|
|
@@ -943,12 +1052,7 @@ function PresentationEditorCore({
|
|
|
943
1052
|
}));
|
|
944
1053
|
},
|
|
945
1054
|
onKeyDown: (event) => {
|
|
946
|
-
|
|
947
|
-
let nextIndex = null;
|
|
948
|
-
if (event.key === "ArrowDown") nextIndex = Math.min(slides.length - 1, activeIndex + 1);
|
|
949
|
-
else if (event.key === "ArrowUp") nextIndex = Math.max(0, activeIndex - 1);
|
|
950
|
-
else if (event.key === "Home") nextIndex = 0;
|
|
951
|
-
else if (event.key === "End") nextIndex = slides.length - 1;
|
|
1055
|
+
const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
|
|
952
1056
|
if (nextIndex === null) return;
|
|
953
1057
|
event.preventDefault();
|
|
954
1058
|
const next = slides[nextIndex];
|
|
@@ -1001,6 +1105,96 @@ function PresentationEditorCore({
|
|
|
1001
1105
|
}) })
|
|
1002
1106
|
}
|
|
1003
1107
|
),
|
|
1108
|
+
mobileSelectorOpen ? /* @__PURE__ */ jsx(
|
|
1109
|
+
"div",
|
|
1110
|
+
{
|
|
1111
|
+
ref: mobileSelectorPanelRef,
|
|
1112
|
+
className: "absolute left-2 top-2 z-40 max-w-56 overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 shadow-og-md sm:hidden",
|
|
1113
|
+
style: { width: "calc(100% - 1rem)" },
|
|
1114
|
+
children: /* @__PURE__ */ jsx(
|
|
1115
|
+
"div",
|
|
1116
|
+
{
|
|
1117
|
+
ref: mobileRailRef,
|
|
1118
|
+
id: `${domId}-mobile-slides`,
|
|
1119
|
+
role: "listbox",
|
|
1120
|
+
tabIndex: 0,
|
|
1121
|
+
"aria-label": "Slides",
|
|
1122
|
+
"aria-orientation": "vertical",
|
|
1123
|
+
"aria-activedescendant": activeSlide && activeIndex >= mobileRailStart && activeIndex < mobileRailEnd ? `${domId}-mobile-slide-${safeDomId(activeSlide.id)}` : void 0,
|
|
1124
|
+
className: "max-h-72 overflow-y-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
|
|
1125
|
+
"data-og-mobile-slide-list": true,
|
|
1126
|
+
"data-og-window-start": mobileRailStart,
|
|
1127
|
+
"data-og-window-end": mobileRailEnd,
|
|
1128
|
+
onScroll: (event) => {
|
|
1129
|
+
const scrollTop = event.currentTarget.scrollTop;
|
|
1130
|
+
const height = event.currentTarget.clientHeight;
|
|
1131
|
+
setMobileRail((current) => ({
|
|
1132
|
+
scrollTop,
|
|
1133
|
+
height: height || current.height
|
|
1134
|
+
}));
|
|
1135
|
+
},
|
|
1136
|
+
onKeyDown: (event) => {
|
|
1137
|
+
if (event.key === "Escape") {
|
|
1138
|
+
event.preventDefault();
|
|
1139
|
+
setMobileSelectorOpen(false);
|
|
1140
|
+
mobileSelectorTriggerRef.current?.focus();
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
|
|
1144
|
+
if (nextIndex === null) return;
|
|
1145
|
+
event.preventDefault();
|
|
1146
|
+
const next = slides[nextIndex];
|
|
1147
|
+
if (!next) return;
|
|
1148
|
+
if (next !== activeSlide) selectSlide(next, nextIndex);
|
|
1149
|
+
const list = event.currentTarget;
|
|
1150
|
+
const top = nextIndex * MOBILE_RAIL_ITEM_HEIGHT;
|
|
1151
|
+
const bottom = top + MOBILE_RAIL_ITEM_HEIGHT;
|
|
1152
|
+
if (top < list.scrollTop) list.scrollTop = top;
|
|
1153
|
+
else if (bottom > list.scrollTop + list.clientHeight) {
|
|
1154
|
+
list.scrollTop = bottom - list.clientHeight;
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
children: /* @__PURE__ */ jsx(
|
|
1158
|
+
"div",
|
|
1159
|
+
{
|
|
1160
|
+
className: "relative w-full",
|
|
1161
|
+
style: { height: slides.length * MOBILE_RAIL_ITEM_HEIGHT },
|
|
1162
|
+
children: slides.slice(mobileRailStart, mobileRailEnd).map((slide, offset) => {
|
|
1163
|
+
const index = mobileRailStart + offset;
|
|
1164
|
+
const active = slide === activeSlide;
|
|
1165
|
+
return /* @__PURE__ */ jsxs(
|
|
1166
|
+
"button",
|
|
1167
|
+
{
|
|
1168
|
+
id: `${domId}-mobile-slide-${safeDomId(slide.id)}`,
|
|
1169
|
+
type: "button",
|
|
1170
|
+
role: "option",
|
|
1171
|
+
tabIndex: -1,
|
|
1172
|
+
"aria-selected": active,
|
|
1173
|
+
"aria-label": `Slide ${index + 1}${slide.title ? `: ${slide.title}` : ""}`,
|
|
1174
|
+
onClick: () => chooseMobileSlide(slide, index),
|
|
1175
|
+
className: cn(
|
|
1176
|
+
"absolute left-0 flex min-h-11 w-full items-center gap-2 px-2 text-left",
|
|
1177
|
+
active ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3/70"
|
|
1178
|
+
),
|
|
1179
|
+
style: {
|
|
1180
|
+
top: index * MOBILE_RAIL_ITEM_HEIGHT,
|
|
1181
|
+
height: MOBILE_RAIL_ITEM_HEIGHT
|
|
1182
|
+
},
|
|
1183
|
+
"data-og-mobile-slide-index": index,
|
|
1184
|
+
children: [
|
|
1185
|
+
/* @__PURE__ */ jsx("span", { className: "w-7 shrink-0 text-right text-og-xs tabular-nums text-og-fg-subtle", children: index + 1 }),
|
|
1186
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-og-sm", children: slide.title || `Slide ${index + 1}` })
|
|
1187
|
+
]
|
|
1188
|
+
},
|
|
1189
|
+
slide.id
|
|
1190
|
+
);
|
|
1191
|
+
})
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
}
|
|
1195
|
+
)
|
|
1196
|
+
}
|
|
1197
|
+
) : null,
|
|
1004
1198
|
/* @__PURE__ */ jsxs(
|
|
1005
1199
|
"div",
|
|
1006
1200
|
{
|
|
@@ -3231,4 +3425,4 @@ export {
|
|
|
3231
3425
|
PresentationProjectionArtifactSurface,
|
|
3232
3426
|
EditablePresentationArtifactSurface
|
|
3233
3427
|
};
|
|
3234
|
-
//# sourceMappingURL=chunk-
|
|
3428
|
+
//# sourceMappingURL=chunk-VR4Z73EU.js.map
|