@opengeni/react 5.1.0-canary.0 → 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.
Files changed (66) hide show
  1. package/dist/artifacts.d.ts +2 -0
  2. package/dist/artifacts.js +1391 -2
  3. package/dist/artifacts.js.map +1 -1
  4. package/dist/chunk-2TKI3WEG.js +73 -0
  5. package/dist/chunk-2TKI3WEG.js.map +1 -0
  6. package/dist/{chunk-M2HNWZYR.js → chunk-IHQII5WO.js} +69 -18
  7. package/dist/chunk-IHQII5WO.js.map +1 -0
  8. package/dist/{chunk-HUMIRRYI.js → chunk-IYCR4343.js} +19 -19
  9. package/dist/{chunk-HUMIRRYI.js.map → chunk-IYCR4343.js.map} +1 -1
  10. package/dist/{chunk-WS6D5BHH.js → chunk-QXJCNVSD.js} +2268 -2217
  11. package/dist/chunk-QXJCNVSD.js.map +1 -0
  12. package/dist/{chunk-BV5A4OTE.js → chunk-T5FRXMC3.js} +21 -2
  13. package/dist/{chunk-BV5A4OTE.js.map → chunk-T5FRXMC3.js.map} +1 -1
  14. package/dist/{chunk-BRFMGY4L.js → chunk-UGMKPUEM.js} +28 -3
  15. package/dist/chunk-UGMKPUEM.js.map +1 -0
  16. package/dist/components/artifacts/inline-html-document.d.ts +2 -0
  17. package/dist/components/artifacts/published-html-artifact-frame.d.ts +2 -0
  18. package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
  19. package/dist/components/markdown.d.ts +13 -1
  20. package/dist/{computer-viewer-7TEZC6Y2.js → computer-viewer-AA4JH2AP.js} +2 -2
  21. package/dist/connect.js +1 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +7 -4
  24. package/dist/index.js.map +1 -1
  25. package/dist/interaction.js +1 -1
  26. package/dist/{platform-activity-row-27LKAWZD.js → platform-activity-row-UW4UVVM4.js} +6 -3
  27. package/dist/platform-activity-row-UW4UVVM4.js.map +1 -0
  28. package/dist/session-ui.js +4 -3
  29. package/dist/session-ui.js.map +1 -1
  30. package/dist/session.js +1 -1
  31. package/dist/sites-ui.d.ts +2 -1
  32. package/dist/sites.js +12 -4
  33. package/dist/sites.js.map +1 -1
  34. package/dist/timeline/activity-rail.d.ts +1 -0
  35. package/dist/timeline/platform-activity-row.d.ts +1 -1
  36. package/dist/timeline/retained-image.d.ts +16 -0
  37. package/dist/timeline/rolling-activity.d.ts +9 -0
  38. package/dist/timeline/shared.d.ts +4 -1
  39. package/dist/timeline/turn-summary.d.ts +4 -1
  40. package/package.json +4 -4
  41. package/src/artifacts.ts +2 -0
  42. package/src/components/artifacts/inline-html-document.ts +24 -0
  43. package/src/components/artifacts/published-html-artifact-frame.tsx +32 -2
  44. package/src/components/artifacts/visualization-assets/base.css +1015 -0
  45. package/src/components/artifacts/visualization-assets/helpers.html +349 -0
  46. package/src/components/artifacts/visualization-assets.gen.ts +3 -0
  47. package/src/components/copy-button.tsx +7 -2
  48. package/src/components/markdown.tsx +111 -34
  49. package/src/components/message-timeline.tsx +48 -3
  50. package/src/hooks/use-computer-session.ts +36 -1
  51. package/src/index.ts +6 -1
  52. package/src/sites-ui.tsx +23 -6
  53. package/src/timeline/activity-rail.tsx +20 -3
  54. package/src/timeline/platform-activity-row.tsx +5 -2
  55. package/src/timeline/retained-image.ts +91 -0
  56. package/src/timeline/rolling-activity.tsx +83 -0
  57. package/src/timeline/shared.tsx +33 -12
  58. package/src/timeline/tool-renderers.tsx +7 -91
  59. package/src/timeline/turn-summary.tsx +21 -15
  60. package/styles/compiled.css +122 -0
  61. package/styles/index.css +49 -0
  62. package/dist/chunk-BRFMGY4L.js.map +0 -1
  63. package/dist/chunk-M2HNWZYR.js.map +0 -1
  64. package/dist/chunk-WS6D5BHH.js.map +0 -1
  65. package/dist/platform-activity-row-27LKAWZD.js.map +0 -1
  66. /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 target = frameTarget ?? focusTarget ?? currentObservation?.target ?? null;
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-BV5A4OTE.js.map
2319
+ //# sourceMappingURL=chunk-T5FRXMC3.js.map