@opengeni/react 5.0.5-canary.3 → 5.2.0-canary.0
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 +13 -1
- package/dist/artifacts.d.ts +2 -0
- package/dist/artifacts.js +1391 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/chunk-2TKI3WEG.js +73 -0
- package/dist/chunk-2TKI3WEG.js.map +1 -0
- package/dist/{chunk-V3WX3TQG.js → chunk-45XEUVTK.js} +2 -2
- package/dist/{chunk-M2HNWZYR.js → chunk-IHQII5WO.js} +69 -18
- package/dist/chunk-IHQII5WO.js.map +1 -0
- package/dist/{chunk-HUMIRRYI.js → chunk-IYCR4343.js} +19 -19
- package/dist/{chunk-HUMIRRYI.js.map → chunk-IYCR4343.js.map} +1 -1
- package/dist/{chunk-6J56T3MG.js → chunk-NYESIADM.js} +14 -5
- package/dist/chunk-NYESIADM.js.map +1 -0
- package/dist/{chunk-7S2KWUJD.js → chunk-QXJCNVSD.js} +2283 -2215
- package/dist/chunk-QXJCNVSD.js.map +1 -0
- package/dist/{chunk-BV5A4OTE.js → chunk-T5FRXMC3.js} +21 -2
- package/dist/{chunk-BV5A4OTE.js.map → chunk-T5FRXMC3.js.map} +1 -1
- package/dist/{chunk-BRFMGY4L.js → chunk-UGMKPUEM.js} +28 -3
- package/dist/chunk-UGMKPUEM.js.map +1 -0
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +2 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/markdown.d.ts +13 -1
- package/dist/components/message-timeline.d.ts +4 -1
- package/dist/components/session-conversation.d.ts +3 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/composer.js +2 -2
- package/dist/{computer-viewer-7TEZC6Y2.js → computer-viewer-AA4JH2AP.js} +2 -2
- package/dist/connect.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +1 -1
- package/dist/{platform-activity-row-27LKAWZD.js → platform-activity-row-UW4UVVM4.js} +6 -3
- package/dist/platform-activity-row-UW4UVVM4.js.map +1 -0
- package/dist/session-ui.d.ts +1 -1
- package/dist/session-ui.js +6 -5
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +2 -2
- package/dist/sites-ui.d.ts +2 -1
- package/dist/sites.js +12 -4
- package/dist/sites.js.map +1 -1
- package/dist/timeline/activity-rail.d.ts +1 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -1
- package/dist/timeline/retained-image.d.ts +16 -0
- package/dist/timeline/rolling-activity.d.ts +9 -0
- package/dist/timeline/shared.d.ts +4 -1
- package/dist/timeline/turn-summary.d.ts +4 -1
- package/package.json +4 -4
- package/src/artifacts.ts +2 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/published-html-artifact-frame.tsx +32 -2
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/copy-button.tsx +7 -2
- package/src/components/markdown.tsx +111 -34
- package/src/components/message-timeline.tsx +61 -4
- package/src/components/session-conversation.tsx +5 -0
- package/src/components/user-message-body.tsx +20 -2
- package/src/hooks/use-composer.ts +15 -2
- package/src/hooks/use-computer-session.ts +36 -1
- package/src/index.ts +10 -2
- package/src/session-ui.ts +4 -1
- package/src/sites-ui.tsx +23 -6
- package/src/timeline/activity-rail.tsx +20 -3
- package/src/timeline/platform-activity-row.tsx +5 -2
- package/src/timeline/retained-image.ts +91 -0
- package/src/timeline/rolling-activity.tsx +83 -0
- package/src/timeline/shared.tsx +33 -12
- package/src/timeline/tool-renderers.tsx +7 -91
- package/src/timeline/turn-summary.tsx +21 -15
- package/styles/compiled.css +122 -0
- package/styles/index.css +49 -0
- package/dist/chunk-6J56T3MG.js.map +0 -1
- package/dist/chunk-7S2KWUJD.js.map +0 -1
- package/dist/chunk-BRFMGY4L.js.map +0 -1
- package/dist/chunk-M2HNWZYR.js.map +0 -1
- package/dist/platform-activity-row-27LKAWZD.js.map +0 -1
- /package/dist/{chunk-V3WX3TQG.js.map → chunk-45XEUVTK.js.map} +0 -0
- /package/dist/{computer-viewer-7TEZC6Y2.js.map → computer-viewer-AA4JH2AP.js.map} +0 -0
|
@@ -454,6 +454,22 @@ function useComputerSession(options) {
|
|
|
454
454
|
if (!mountedRef.current || requestRef.current.id !== id) return;
|
|
455
455
|
const targets = sortComputerTargets(targetResponse.targets);
|
|
456
456
|
const selected = chooseTarget(targets, selectedTargetIdRef.current, session.platform);
|
|
457
|
+
const previous = observationRef.current.observation;
|
|
458
|
+
const retainedObservation = selected && previous?.target.id === selected.id && previous.target.controllerGeneration === selected.controllerGeneration && previous.target.targetGeneration === selected.targetGeneration ? previous : null;
|
|
459
|
+
selectedTargetIdRef.current = selected?.id ?? null;
|
|
460
|
+
targetsRef.current = { computerSessionId, targets };
|
|
461
|
+
observationRef.current = { computerSessionId, observation: retainedObservation };
|
|
462
|
+
setState(
|
|
463
|
+
(current) => current.computerSessionId === computerSessionId ? {
|
|
464
|
+
...current,
|
|
465
|
+
session,
|
|
466
|
+
targets,
|
|
467
|
+
selectedTargetId: selected?.id ?? null,
|
|
468
|
+
observation: retainedObservation,
|
|
469
|
+
loading: false,
|
|
470
|
+
error: null
|
|
471
|
+
} : current
|
|
472
|
+
);
|
|
457
473
|
const observation = selected ? await client.observeComputerTarget(workspaceId, computerSessionId, selected.id, {
|
|
458
474
|
signal: controller.signal
|
|
459
475
|
}) : null;
|
|
@@ -602,7 +618,10 @@ function useComputerSession(options) {
|
|
|
602
618
|
const currentObservation = observationRef.current.computerSessionId === computerSessionId ? observationRef.current.observation : null;
|
|
603
619
|
const focusTarget = action.type === "focus" ? targetsRef.current.targets.find((candidate) => candidate.id === action.targetId) ?? null : null;
|
|
604
620
|
const frameTarget = frame ? targetsRef.current.targets.find((candidate) => candidate.id === frame.targetId) ?? (currentObservation?.target.id === frame.targetId ? currentObservation.target : null) : null;
|
|
605
|
-
const
|
|
621
|
+
const inputTarget = (action.type === "keyboard" || action.type === "clipboard") && targetsRef.current.computerSessionId === computerSessionId ? targetsRef.current.targets.find(
|
|
622
|
+
(candidate) => candidate.id === selectedTargetIdRef.current
|
|
623
|
+
) : null;
|
|
624
|
+
const target = frameTarget ?? focusTarget ?? currentObservation?.target ?? inputTarget ?? null;
|
|
606
625
|
if (!target) throw new Error("The desktop target is not ready for input.");
|
|
607
626
|
if (frame && frame.targetId !== selectedTargetIdRef.current) {
|
|
608
627
|
throw new Error("The displayed desktop frame is no longer selected.");
|
|
@@ -2297,4 +2316,4 @@ export {
|
|
|
2297
2316
|
ComputerViewer,
|
|
2298
2317
|
computerKey
|
|
2299
2318
|
};
|
|
2300
|
-
//# sourceMappingURL=chunk-
|
|
2319
|
+
//# sourceMappingURL=chunk-T5FRXMC3.js.map
|