@opengeni/react 0.48.0 → 0.57.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 +138 -2
- package/dist/artifacts-document.d.ts +3 -0
- package/dist/artifacts-document.js +17 -0
- package/dist/artifacts-document.js.map +1 -0
- package/dist/artifacts-presentation.d.ts +3 -0
- package/dist/artifacts-presentation.js +17 -0
- package/dist/artifacts-presentation.js.map +1 -0
- package/dist/artifacts-spreadsheet.d.ts +3 -0
- package/dist/artifacts-spreadsheet.js +17 -0
- package/dist/artifacts-spreadsheet.js.map +1 -0
- package/dist/artifacts.d.ts +2 -0
- package/dist/artifacts.js +199 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/{chunk-NJ7M2B6Z.js → chunk-5UQPNLIO.js} +16 -8
- package/dist/{chunk-NJ7M2B6Z.js.map → chunk-5UQPNLIO.js.map} +1 -1
- package/dist/{chunk-LHLYWG5R.js → chunk-6KLX2RH5.js} +461 -38
- package/dist/chunk-6KLX2RH5.js.map +1 -0
- package/dist/chunk-7WCLAEFV.js +2828 -0
- package/dist/chunk-7WCLAEFV.js.map +1 -0
- package/dist/{chunk-I4MPFDRP.js → chunk-B6WPZSTT.js} +104 -104
- package/dist/{chunk-I4MPFDRP.js.map → chunk-B6WPZSTT.js.map} +1 -1
- package/dist/{chunk-EKZH6IDG.js → chunk-C5ZPSSS5.js} +111 -1
- package/dist/chunk-C5ZPSSS5.js.map +1 -0
- package/dist/{chunk-OL6QVXGF.js → chunk-HA46CYQK.js} +152 -8
- package/dist/chunk-HA46CYQK.js.map +1 -0
- package/dist/chunk-HUIKIDM5.js +2148 -0
- package/dist/chunk-HUIKIDM5.js.map +1 -0
- package/dist/{chunk-FWXGSNXT.js → chunk-IGC6A2ZI.js} +585 -34
- package/dist/chunk-IGC6A2ZI.js.map +1 -0
- package/dist/chunk-JVYQRRC4.js +53 -0
- package/dist/chunk-JVYQRRC4.js.map +1 -0
- package/dist/chunk-KCGXPP5V.js +157 -0
- package/dist/chunk-KCGXPP5V.js.map +1 -0
- package/dist/chunk-LLOLUHVG.js +5937 -0
- package/dist/chunk-LLOLUHVG.js.map +1 -0
- package/dist/{chunk-WYA65Y3F.js → chunk-MKPIAGVL.js} +13 -3
- package/dist/chunk-MKPIAGVL.js.map +1 -0
- package/dist/chunk-PEI6RANI.js +3234 -0
- package/dist/chunk-PEI6RANI.js.map +1 -0
- package/dist/chunk-R3AZOAB5.js +933 -0
- package/dist/chunk-R3AZOAB5.js.map +1 -0
- package/dist/{chunk-O4VXOBGF.js → chunk-WSK7G5LE.js} +70 -2
- package/dist/chunk-WSK7G5LE.js.map +1 -0
- package/dist/{chunk-23EJ676W.js → chunk-XBZWOM2K.js} +9 -4
- package/dist/chunk-XBZWOM2K.js.map +1 -0
- package/dist/{chunk-XCNTXWBB.js → chunk-Y7OEDUJ5.js} +856 -338
- package/dist/chunk-Y7OEDUJ5.js.map +1 -0
- package/dist/client.d.ts +10 -2
- package/dist/clipboard.d.ts +1 -0
- package/dist/clipboard.js +7 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/commands/index.d.ts +3 -3
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/types.d.ts +1 -1
- package/dist/components/approval-surface.d.ts +2 -2
- package/dist/components/artifacts/artifact-surface.d.ts +18 -0
- package/dist/components/artifacts/document-editor.d.ts +172 -0
- package/dist/components/artifacts/editable-artifact-ui.d.ts +13 -0
- package/dist/components/artifacts/editable-artifact-workbench.d.ts +49 -0
- package/dist/components/artifacts/editable-document.d.ts +24 -0
- package/dist/components/artifacts/editable-presentation.d.ts +24 -0
- package/dist/components/artifacts/editable-spreadsheet.d.ts +32 -0
- package/dist/components/artifacts/index.d.ts +9 -0
- package/dist/components/artifacts/presentation-editor.d.ts +297 -0
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +14 -0
- package/dist/components/artifacts/spreadsheet-canvas.d.ts +120 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +113 -0
- package/dist/components/browser-input.d.ts +7 -0
- package/dist/components/browser-viewer.d.ts +30 -0
- package/dist/components/chat-composer.d.ts +8 -8
- package/dist/components/code-editor.d.ts +25 -3
- package/dist/components/command-palette.d.ts +2 -2
- package/dist/components/composer-transcription-control.d.ts +2 -2
- package/dist/components/composer.d.ts +17 -17
- package/dist/components/computer-viewer.d.ts +24 -0
- package/dist/components/copy-button.d.ts +2 -2
- package/dist/components/desktop-viewer.d.ts +50 -22
- package/dist/components/diff-view.d.ts +1 -1
- package/dist/components/enrollment-consent.d.ts +1 -1
- package/dist/components/enrollment-device-flow.d.ts +1 -1
- package/dist/components/file-browser.d.ts +2 -2
- package/dist/components/fleet-tile.d.ts +1 -1
- package/dist/components/generated-video-player.d.ts +10 -0
- package/dist/components/human-input-form.d.ts +1 -1
- package/dist/components/human-input-surface.d.ts +2 -2
- package/dist/components/interaction-intervention-banner.d.ts +11 -0
- package/dist/components/interactive-workbench-viewers.d.ts +2 -0
- package/dist/components/machine-card.d.ts +2 -2
- package/dist/components/machine-dock-bar.d.ts +3 -3
- package/dist/components/machine-health-pill.d.ts +2 -2
- package/dist/components/machine-input-display.d.ts +1 -1
- package/dist/components/machine-metrics.d.ts +2 -2
- package/dist/components/machine-status-pill.d.ts +4 -4
- package/dist/components/machines/health.d.ts +1 -1
- package/dist/components/machines/machine-detail.d.ts +3 -3
- package/dist/components/machines/metric-history-chart.d.ts +1 -1
- package/dist/components/machines/metric-sparkline.d.ts +2 -2
- package/dist/components/machines/series.d.ts +2 -2
- package/dist/components/machines-dashboard.d.ts +2 -2
- package/dist/components/markdown.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +12 -5
- package/dist/components/model-picker.d.ts +2 -2
- package/dist/components/model-policy-picker.d.ts +7 -7
- package/dist/components/pierre-diff.d.ts +1 -1
- package/dist/components/pierre-file.d.ts +1 -1
- package/dist/components/queue-draft-policy.d.ts +1 -1
- package/dist/components/queue-surface-implementation.d.ts +3 -3
- package/dist/components/queue-surface-state.d.ts +4 -4
- package/dist/components/queue-surface.d.ts +5 -5
- package/dist/components/sandbox-files.d.ts +3 -3
- package/dist/components/sandbox-terminal.d.ts +24 -4
- package/dist/components/sandbox-workspace.d.ts +28 -9
- package/dist/components/session-chrome.d.ts +4 -4
- package/dist/components/session-status.d.ts +2 -2
- package/dist/components/timeline-annotation-selection.d.ts +9 -0
- package/dist/components/timeline-annotations-dialog.d.ts +16 -0
- package/dist/components/timeline-annotations.d.ts +13 -0
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/components/user-message-body.d.ts +2 -2
- package/dist/components/workbench-changes.d.ts +2 -2
- package/dist/components/workspace-dock.d.ts +1 -1
- package/dist/composer.d.ts +11 -11
- package/dist/composer.js +7 -7
- package/dist/hooks/internal.d.ts +1 -1
- package/dist/hooks/use-attached-browsers.d.ts +21 -0
- package/dist/hooks/use-auth-runs.d.ts +32 -0
- package/dist/hooks/use-available-models.d.ts +2 -2
- package/dist/hooks/use-billing-usage.d.ts +1 -1
- package/dist/hooks/use-browser-downloads.d.ts +25 -0
- package/dist/hooks/use-browser-frame-stream.d.ts +28 -0
- package/dist/hooks/use-browser-identities.d.ts +30 -0
- package/dist/hooks/use-browser-session.d.ts +29 -0
- package/dist/hooks/use-browser-sessions.d.ts +32 -0
- package/dist/hooks/use-channels.d.ts +26 -0
- package/dist/hooks/use-codex-accounts.d.ts +2 -2
- package/dist/hooks/use-composer.d.ts +36 -9
- package/dist/hooks/use-computer-frame-stream.d.ts +24 -0
- package/dist/hooks/use-computer-session.d.ts +29 -0
- package/dist/hooks/use-computer-sessions.d.ts +28 -0
- package/dist/hooks/use-desktop-stream.d.ts +5 -1
- package/dist/hooks/use-environments.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +1 -1
- package/dist/hooks/use-goal.d.ts +2 -2
- package/dist/hooks/use-human-input.d.ts +2 -2
- package/dist/hooks/use-interaction-interventions.d.ts +27 -0
- package/dist/hooks/use-interaction-invalidation.d.ts +19 -0
- package/dist/hooks/use-last-started-turn-policy.d.ts +2 -2
- package/dist/hooks/use-machine-chip.d.ts +2 -2
- package/dist/hooks/use-machines.d.ts +4 -4
- package/dist/hooks/use-network-routes.d.ts +25 -0
- package/dist/hooks/use-packs.d.ts +7 -2
- package/dist/hooks/use-rigs.d.ts +1 -1
- package/dist/hooks/use-sandbox-files.d.ts +6 -4
- package/dist/hooks/use-sandbox-git.d.ts +6 -5
- package/dist/hooks/use-sandbox-terminal.d.ts +1 -1
- package/dist/hooks/use-scheduled-tasks.d.ts +1 -1
- package/dist/hooks/use-session-capabilities.d.ts +5 -4
- package/dist/hooks/use-session-control.d.ts +1 -1
- package/dist/hooks/use-session-events.d.ts +2 -2
- package/dist/hooks/use-session-lineage.d.ts +1 -1
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session.d.ts +2 -2
- package/dist/hooks/use-site-auth-connections.d.ts +25 -0
- package/dist/hooks/use-slash-commands.d.ts +1 -1
- package/dist/hooks/use-supergrok-accounts.d.ts +26 -0
- package/dist/hooks/use-terminal-stream.d.ts +11 -2
- package/dist/hooks/use-turn-queue.d.ts +2 -2
- package/dist/hooks/use-video-artifact-playback.d.ts +9 -0
- package/dist/hooks/use-voice-input.d.ts +1 -1
- package/dist/hooks/use-workspace-capture.d.ts +1 -1
- package/dist/hooks/use-workspace-edit.d.ts +1 -1
- package/dist/hooks/use-workspace-sessions.d.ts +1 -1
- package/dist/hooks/use-workspaces.d.ts +1 -1
- package/dist/index.d.ts +162 -155
- package/dist/index.js +1822 -1703
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +33 -0
- package/dist/interaction.js +550 -0
- package/dist/interaction.js.map +1 -0
- package/dist/interactive-workbench-viewers-TOHBXJEE.js +15 -0
- package/dist/interactive-workbench-viewers-TOHBXJEE.js.map +1 -0
- package/dist/lib/host-platform.d.ts +5 -0
- package/dist/lib/relay-wire.d.ts +24 -1
- package/dist/lib/sandbox-liveness.d.ts +9 -0
- package/dist/lib/terminal-capability.d.ts +5 -0
- package/dist/lib/xterm-theme.d.ts +1 -1
- package/dist/machines.d.ts +30 -30
- package/dist/machines.js +2 -2
- package/dist/model-policy.d.ts +1 -1
- package/dist/model-policy.js +1 -1
- package/dist/provider.d.ts +6 -5
- package/dist/{queue-surface-implementation-U5JFG7HT.js → queue-surface-implementation-2KVJTYXH.js} +100 -48
- package/dist/queue-surface-implementation-2KVJTYXH.js.map +1 -0
- package/dist/realtime/dropdown-menu.d.ts +8 -8
- package/dist/realtime/realtime-control.d.ts +8 -8
- package/dist/realtime.d.ts +4 -4
- package/dist/realtime.js +38 -11
- package/dist/realtime.js.map +1 -1
- package/dist/session-context.d.ts +28 -2
- package/dist/session-ui.d.ts +14 -14
- package/dist/session-ui.js +5 -4
- package/dist/session.d.ts +28 -28
- package/dist/session.js +10 -10
- package/dist/timeline/activity-rail.d.ts +5 -3
- package/dist/timeline/disclosure-context.d.ts +1 -1
- package/dist/timeline/fleet-decision-projection.d.ts +1 -1
- package/dist/timeline/fleet-decision-row.d.ts +3 -3
- package/dist/timeline/index.d.ts +19 -19
- package/dist/timeline/parsers.d.ts +4 -1
- package/dist/timeline/projection.d.ts +3 -3
- package/dist/timeline/registry.d.ts +8 -2
- package/dist/timeline/screenshot-lightbox.d.ts +2 -2
- package/dist/timeline/shared.d.ts +21 -10
- package/dist/timeline/tool-diff.d.ts +2 -2
- package/dist/timeline/tool-renderers.d.ts +1 -1
- package/dist/timeline/turn-summary.d.ts +3 -3
- package/dist/timeline/types.d.ts +44 -3
- package/dist/timeline-annotation-selection-3L7LHGG2.js +187 -0
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +1 -0
- package/dist/timeline-annotations-dialog-U7EVLR75.js +196 -0
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +1 -0
- package/package.json +36 -7
- package/src/artifacts-document.ts +31 -0
- package/src/artifacts-presentation.ts +36 -0
- package/src/artifacts-spreadsheet.ts +21 -0
- package/src/artifacts.ts +89 -0
- package/src/client.ts +157 -1
- package/src/clipboard.ts +2 -0
- package/src/components/artifacts/artifact-surface.tsx +93 -0
- package/src/components/artifacts/document-editor.tsx +2255 -0
- package/src/components/artifacts/editable-artifact-ui.tsx +89 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +203 -0
- package/src/components/artifacts/editable-document.tsx +657 -0
- package/src/components/artifacts/editable-presentation.tsx +1020 -0
- package/src/components/artifacts/editable-spreadsheet.tsx +733 -0
- package/src/components/artifacts/index.ts +104 -0
- package/src/components/artifacts/presentation-editor.tsx +3148 -0
- package/src/components/artifacts/published-html-artifact-frame.tsx +38 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +799 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +2129 -0
- package/src/components/browser-input.ts +65 -0
- package/src/components/browser-viewer.tsx +2702 -0
- package/src/components/chat-composer.tsx +13 -0
- package/src/components/code-editor.tsx +89 -30
- package/src/components/composer-transcription-control.tsx +10 -6
- package/src/components/computer-viewer.tsx +1636 -0
- package/src/components/desktop-viewer.tsx +215 -74
- package/src/components/generated-video-player.tsx +89 -0
- package/src/components/interaction-intervention-banner.tsx +99 -0
- package/src/components/interactive-workbench-viewers.ts +2 -0
- package/src/components/machine-input-display.ts +3 -0
- package/src/components/machines/machine-detail.tsx +1 -1
- package/src/components/message-timeline.tsx +289 -32
- package/src/components/model-policy-picker.tsx +15 -0
- package/src/components/queue-surface-implementation.tsx +116 -60
- package/src/components/sandbox-files.tsx +2 -2
- package/src/components/sandbox-terminal.tsx +128 -46
- package/src/components/sandbox-workspace.tsx +256 -90
- package/src/components/session-chrome.tsx +53 -13
- package/src/components/timeline-annotation-selection.tsx +221 -0
- package/src/components/timeline-annotations-dialog.tsx +213 -0
- package/src/components/timeline-annotations.tsx +84 -0
- package/src/components/workbench-changes.tsx +188 -31
- package/src/components/workspace-dock.tsx +59 -5
- package/src/hooks/use-attached-browsers.ts +154 -0
- package/src/hooks/use-auth-runs.ts +278 -0
- package/src/hooks/use-browser-downloads.ts +218 -0
- package/src/hooks/use-browser-frame-stream.ts +425 -0
- package/src/hooks/use-browser-identities.ts +266 -0
- package/src/hooks/use-browser-session.ts +543 -0
- package/src/hooks/use-browser-sessions.ts +286 -0
- package/src/hooks/use-channels.ts +99 -0
- package/src/hooks/use-composer.ts +769 -24
- package/src/hooks/use-computer-frame-stream.ts +434 -0
- package/src/hooks/use-computer-session.ts +462 -0
- package/src/hooks/use-computer-sessions.ts +251 -0
- package/src/hooks/use-desktop-stream.ts +39 -7
- package/src/hooks/use-interaction-interventions.ts +242 -0
- package/src/hooks/use-interaction-invalidation.ts +66 -0
- package/src/hooks/use-machine-chip.ts +15 -3
- package/src/hooks/use-machines.ts +33 -3
- package/src/hooks/use-network-routes.ts +214 -0
- package/src/hooks/use-packs.ts +51 -0
- package/src/hooks/use-sandbox-files.ts +98 -55
- package/src/hooks/use-sandbox-git.ts +93 -38
- package/src/hooks/use-sandbox-terminal.ts +3 -2
- package/src/hooks/use-session-capabilities.ts +59 -46
- package/src/hooks/use-site-auth-connections.ts +226 -0
- package/src/hooks/use-supergrok-accounts.ts +81 -0
- package/src/hooks/use-terminal-stream.ts +359 -47
- package/src/hooks/use-video-artifact-playback.ts +28 -0
- package/src/hooks/use-workspace-edit.ts +2 -1
- package/src/index.ts +18 -0
- package/src/interaction.ts +101 -0
- package/src/lib/host-platform.ts +10 -0
- package/src/lib/relay-wire.ts +47 -4
- package/src/lib/sandbox-liveness.ts +11 -0
- package/src/lib/terminal-capability.ts +10 -0
- package/src/model-policy.ts +19 -4
- package/src/provider.tsx +133 -1
- package/src/realtime/realtime-control.tsx +34 -6
- package/src/session-context.ts +156 -1
- package/src/timeline/activity-rail.tsx +25 -3
- package/src/timeline/index.ts +3 -0
- package/src/timeline/parsers.ts +14 -1
- package/src/timeline/projection.ts +269 -14
- package/src/timeline/registry.ts +13 -1
- package/src/timeline/screenshot-lightbox.tsx +19 -9
- package/src/timeline/shared.tsx +56 -8
- package/src/timeline/tool-renderers.tsx +303 -50
- package/src/timeline/types.ts +57 -3
- package/styles/compiled.css +312 -21
- package/styles/index.css +15 -0
- package/styles/responsive.css +13 -1
- package/dist/chunk-23EJ676W.js.map +0 -1
- package/dist/chunk-EKZH6IDG.js.map +0 -1
- package/dist/chunk-FWXGSNXT.js.map +0 -1
- package/dist/chunk-LHLYWG5R.js.map +0 -1
- package/dist/chunk-O4VXOBGF.js.map +0 -1
- package/dist/chunk-OL6QVXGF.js.map +0 -1
- package/dist/chunk-WYA65Y3F.js.map +0 -1
- package/dist/chunk-XCNTXWBB.js.map +0 -1
- package/dist/fleet-decision-projection-SLNZMS42.js +0 -241
- package/dist/fleet-decision-projection-SLNZMS42.js.map +0 -1
- package/dist/queue-surface-implementation-U5JFG7HT.js.map +0 -1
package/README.md
CHANGED
|
@@ -24,6 +24,90 @@ ancestor. Components are styled with Tailwind v4 utilities mapped onto the
|
|
|
24
24
|
tokens, Radix primitives for behavior, and Motion for state-communicating
|
|
25
25
|
animation. Override the tokens to rebrand everything.
|
|
26
26
|
|
|
27
|
+
## Editable Office artifacts
|
|
28
|
+
|
|
29
|
+
The optional artifact workbench is isolated from the ordinary session and
|
|
30
|
+
realtime entries. The default browser composition owns one verified WASM
|
|
31
|
+
Worker, durable IndexedDB state, authenticated live sync, teardown, and the
|
|
32
|
+
matching editor for the artifact modality:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import workerUrl from "@opengeni/sdk/editable-artifacts/worker?worker&url";
|
|
36
|
+
import { BrowserEditableArtifactWorkbench } from "@opengeni/react/artifacts";
|
|
37
|
+
import { editableArtifactKernelRuntime } from "@opengeni/artifact-kernel-wasm-spreadsheet";
|
|
38
|
+
|
|
39
|
+
<BrowserEditableArtifactWorkbench
|
|
40
|
+
options={{
|
|
41
|
+
baseUrl: "https://api.example.com",
|
|
42
|
+
workspaceId,
|
|
43
|
+
artifact,
|
|
44
|
+
replicaId,
|
|
45
|
+
storageAuthority,
|
|
46
|
+
runtime: {
|
|
47
|
+
workerUrl,
|
|
48
|
+
...editableArtifactKernelRuntime,
|
|
49
|
+
applicationOrigin: window.location.origin,
|
|
50
|
+
},
|
|
51
|
+
transport: { credentials: "include" },
|
|
52
|
+
}}
|
|
53
|
+
spreadsheet={{ title: artifact.title }}
|
|
54
|
+
/>;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`storageAuthority` is the host's authenticated deployment/account/workspace/
|
|
58
|
+
principal partition and authorization epoch; it must rotate when that authority
|
|
59
|
+
or any static transport credential changes. `replicaId` is a persisted random
|
|
60
|
+
64-bit writer id. Cookie auth works through `credentials`; self-hosted browser
|
|
61
|
+
consoles may pass static deployment-bound `transport.headers`. Browser API keys
|
|
62
|
+
and custom fetch/WebSocket functions stay on the lower-level
|
|
63
|
+
`EditableArtifactWorkbenchHost`, whose host supplies its own SDK session factory
|
|
64
|
+
and complete `sessionKey`.
|
|
65
|
+
|
|
66
|
+
Hosts that already own an `EditableArtifactSession` can render one modality
|
|
67
|
+
directly. No snapshot or artifact-tool model crosses onto the React thread:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { EditableSpreadsheetArtifactSurface } from "@opengeni/react/artifacts/spreadsheet";
|
|
71
|
+
import { EditableDocumentArtifactSurface } from "@opengeni/react/artifacts/document";
|
|
72
|
+
import { EditablePresentationArtifactSurface } from "@opengeni/react/artifacts/presentation";
|
|
73
|
+
|
|
74
|
+
<EditableSpreadsheetArtifactSurface session={spreadsheetSession} title="Report" />;
|
|
75
|
+
<EditableDocumentArtifactSurface session={documentSession} title="Brief" />;
|
|
76
|
+
<EditablePresentationArtifactSurface session={presentationSession} title="Launch deck" />;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The durable document surface composes bounded summary, body, section, and
|
|
80
|
+
review queries at one native revision. Text edits become UTF-16-correct minimal
|
|
81
|
+
`paragraph.edit` commands; formatting becomes `paragraph.format`. Empty
|
|
82
|
+
documents use the SDK's native-namespace structural allocator to create their
|
|
83
|
+
first durable paragraph without inventing React-side identity rules.
|
|
84
|
+
|
|
85
|
+
The durable presentation surface composes the bounded slide catalog and
|
|
86
|
+
per-slide editor ABI. It keeps master/layout inheritance and node hierarchy in
|
|
87
|
+
the projection, renders inherited nodes read-only in slide mode, and maps
|
|
88
|
+
movement, resizing, and rich-text changes to canonical node commands. Geometry
|
|
89
|
+
uses the Office EMU-to-CSS-pixel scale; unchanged command fields retain their
|
|
90
|
+
exact canonical values. Slide and text-box insertion/deletion likewise use
|
|
91
|
+
canonical SDK/session commands; optimistic UI never mutates a shadow deck.
|
|
92
|
+
|
|
93
|
+
Run `OPENGENI_REACT_DEMO_API_TARGET=http://127.0.0.1:8000 bun run demo`, then
|
|
94
|
+
open `http://localhost:3100/editable-artifacts.html?workspaceId=<id>`. This is a
|
|
95
|
+
live public-SDK reference consumer for all three modalities; it has no in-memory
|
|
96
|
+
or permissive fallback.
|
|
97
|
+
|
|
98
|
+
`DocumentProjectionEditor`, `PresentationProjectionEditor`, and
|
|
99
|
+
`SpreadsheetProjectionGrid` expose the same host-owned projection/async-command
|
|
100
|
+
boundary without requiring the OpenGeni sync session. Pending, failure, retry,
|
|
101
|
+
read-only, focus, and reconciliation behavior stays inside the components.
|
|
102
|
+
|
|
103
|
+
Projection editors use browser-safe structural views and do not load
|
|
104
|
+
`@opengeni/artifact-tool`, its codecs, or native bindings. Local authoring tools
|
|
105
|
+
can optionally supply the reference models from `@opengeni/artifact-tool/reference`
|
|
106
|
+
to the compatible `DocumentEditor`,
|
|
107
|
+
`PresentationEditor`, or `SpreadsheetGrid` adapters. Those convenience adapters
|
|
108
|
+
deliberately mutate the supplied public authoring model.
|
|
109
|
+
`@opengeni/react/artifacts` remains the all-modality barrel.
|
|
110
|
+
|
|
27
111
|
## Install & styles
|
|
28
112
|
|
|
29
113
|
Hosts that render their own UI should import the session-only surface:
|
|
@@ -297,6 +381,49 @@ loading, realtime-first creation, Codex Live, Gateway models, mute, recovery,
|
|
|
297
381
|
delegation/context timeline updates, structured questions, and stop/restart
|
|
298
382
|
through published package APIs only.
|
|
299
383
|
|
|
384
|
+
## Browser and computer surfaces (`@opengeni/react/interaction`)
|
|
385
|
+
|
|
386
|
+
The interaction subpath renders the same browser-native and semantic computer
|
|
387
|
+
surfaces used by the OpenGeni web app. It consumes only the public SDK client:
|
|
388
|
+
workspace discovery, peer switching, tabs/windows, live frames, human input,
|
|
389
|
+
identity versions, interventions, diagnostics, reconnect, and lifecycle state do
|
|
390
|
+
not require app-private controller glue.
|
|
391
|
+
|
|
392
|
+
```tsx
|
|
393
|
+
import { OpenGeniProvider } from "@opengeni/react";
|
|
394
|
+
import { BrowserViewer, ComputerViewer } from "@opengeni/react/interaction";
|
|
395
|
+
|
|
396
|
+
<OpenGeniProvider client={client} workspaceId={workspaceId}>
|
|
397
|
+
<BrowserViewer
|
|
398
|
+
sessionId={sessionId}
|
|
399
|
+
onOpenComputer={(computerSessionId) => setSelectedComputer(computerSessionId)}
|
|
400
|
+
/>
|
|
401
|
+
{selectedComputer ? (
|
|
402
|
+
<ComputerViewer
|
|
403
|
+
sessionId={sessionId}
|
|
404
|
+
requestedComputerSessionId={selectedComputer}
|
|
405
|
+
requestedComputerRequestId={selectedComputer}
|
|
406
|
+
/>
|
|
407
|
+
) : null}
|
|
408
|
+
</OpenGeniProvider>;
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
`BrowserViewer` follows the current agent until the human pins another workspace
|
|
412
|
+
browser. A headed managed browser can receive `createLinkedComputer`; the
|
|
413
|
+
returned ComputerSession must be the exact placement/window the browser uses.
|
|
414
|
+
`onOpenComputer` then changes the host layout to that resource—it must not open a
|
|
415
|
+
lookalike desktop. Closing either viewer never ends its durable resource.
|
|
416
|
+
|
|
417
|
+
The provider opens one shared workspace interaction-revision stream and every
|
|
418
|
+
catalog refreshes only when its revision advances; hidden or disconnected pages
|
|
419
|
+
fall back to bounded polling and reconcile from the retained cursor. Hosts that
|
|
420
|
+
do not use `OpenGeniProvider` may pass the same structural `client` and
|
|
421
|
+
`workspaceId` directly.
|
|
422
|
+
|
|
423
|
+
Run `bun run demo` and open `browser.html` or `computer.html`. Their `mode=mock`
|
|
424
|
+
paths are deterministic; `mode=live&workspaceId=…&sessionId=…` uses the
|
|
425
|
+
same-origin `/demo-api` proxy and the exact published SDK/React entrypoints.
|
|
426
|
+
|
|
300
427
|
## Composer customization (`@opengeni/react/composer`)
|
|
301
428
|
|
|
302
429
|
Use `ChatComposer` for the standard layout and its `controlsStart`, `header`,
|
|
@@ -447,6 +574,11 @@ so consumers can render attachment chips. `groupTimeline` clusters consecutive
|
|
|
447
574
|
activity for collapsed display. Use them directly if you want custom rendering
|
|
448
575
|
with the same semantics.
|
|
449
576
|
|
|
577
|
+
Failed worker items may also carry `failure: { code, message }`. The projection
|
|
578
|
+
accepts only the bounded structured orchestration envelope retained in MCP
|
|
579
|
+
output; it does not reinterpret arbitrary legacy error strings. `ActivityRail`
|
|
580
|
+
renders the code and message directly beneath the failed worker row.
|
|
581
|
+
|
|
450
582
|
### Compatibility
|
|
451
583
|
|
|
452
584
|
The projection is a tolerant reader over `SessionEvent.payload` because the wire
|
|
@@ -466,7 +598,10 @@ intentional changes should regenerate those snapshots and review the diff.
|
|
|
466
598
|
- `MessageTimeline` — the session timeline with stick-to-bottom scrolling, a
|
|
467
599
|
"jump to latest" affordance, streaming caret, collapsible activity clusters,
|
|
468
600
|
and worker cards (wire `onOpenSession` to drill into a worker). Pass
|
|
469
|
-
`renderMessageText` to plug a markdown renderer.
|
|
601
|
+
`renderMessageText` to plug a markdown renderer. Pass
|
|
602
|
+
`loadRetainedArtifact` to render permanent generated-image receipts; a loader
|
|
603
|
+
may return verified bytes or a short-lived signed URL. The stock web app uses
|
|
604
|
+
the URL path to avoid copying multi-megabyte images into JavaScript memory.
|
|
470
605
|
- `UserMessageBody` — the shared lossless rendered-height disclosure for
|
|
471
606
|
already-sent user text. Use it inside a custom `renderMessageText` user branch
|
|
472
607
|
so attachments and voice identity remain outside the clipped Markdown region.
|
|
@@ -527,7 +662,8 @@ capability document so every surface degrades to a reason instead of crashing.
|
|
|
527
662
|
- `useSessionCapabilities(sessionId, { attachDesktop?, attachTerminal?, attachFiles? })`
|
|
528
663
|
— negotiates the per-session capability doc, tracks lease liveness
|
|
529
664
|
(`cold`/`warming`/`warm`), and acquires the viewer holder(s) that keep the box
|
|
530
|
-
warm.
|
|
665
|
+
warm. Opening `DesktopViewer` engages the desktop immediately and records any
|
|
666
|
+
required un-redacted/shared acknowledgment automatically before attaching.
|
|
531
667
|
- `useSandboxFiles` / `useSandboxGit` — the Pierre file tree + git status/diff
|
|
532
668
|
feeds. Initial and refresh reads use the SDK's batched file-frontier and
|
|
533
669
|
multi-repository Git queries behind one sandbox lease; `fs.changed` /
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Document-only artifact surface. Import from `@opengeni/react/artifacts/document`. */
|
|
2
|
+
export { EditableDocumentArtifactSurface, type EditableDocumentArtifactSurfaceProps, } from "./components/artifacts/editable-document.js";
|
|
3
|
+
export { DocumentArtifactSurface, DocumentEditor, DocumentProjectionArtifactSurface, DocumentProjectionEditor, type DocumentArtifactSurfaceProps, type DocumentCommit, type DocumentCommitHandler, type DocumentEditorProps, type DocumentEditorProjection, type DocumentLayoutMode, type DocumentProjectionArtifactSurfaceProps, type DocumentProjectionBlock, type DocumentProjectionChange, type DocumentProjectionComment, type DocumentProjectionEditorProps, type DocumentProjectionPageBreak, type DocumentProjectionPageGeometry, type DocumentProjectionParagraph, type DocumentProjectionParagraphStyle, type DocumentProjectionSection, type DocumentProjectionTable, type DocumentProjectionTextRun, type DocumentProjectionTextStyle, type DocumentSelection, } from "./components/artifacts/document-editor.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DocumentArtifactSurface,
|
|
3
|
+
DocumentEditor,
|
|
4
|
+
DocumentProjectionArtifactSurface,
|
|
5
|
+
DocumentProjectionEditor,
|
|
6
|
+
EditableDocumentArtifactSurface
|
|
7
|
+
} from "./chunk-HUIKIDM5.js";
|
|
8
|
+
import "./chunk-KCGXPP5V.js";
|
|
9
|
+
import "./chunk-22KP6LR5.js";
|
|
10
|
+
export {
|
|
11
|
+
DocumentArtifactSurface,
|
|
12
|
+
DocumentEditor,
|
|
13
|
+
DocumentProjectionArtifactSurface,
|
|
14
|
+
DocumentProjectionEditor,
|
|
15
|
+
EditableDocumentArtifactSurface
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=artifacts-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Presentation-only artifact surface. Import from `@opengeni/react/artifacts/presentation`. */
|
|
2
|
+
export { EditablePresentationArtifactSurface, type EditablePresentationArtifactSurfaceProps, } from "./components/artifacts/editable-presentation.js";
|
|
3
|
+
export { PresentationArtifactSurface, PresentationEditor, PresentationProjectionArtifactSurface, PresentationProjectionEditor, type PresentationArtifactSurfaceProps, type PresentationCommit, type PresentationCommitHandler, type PresentationEditorProps, type PresentationEditorProjection, type PresentationProjectionArtifactSurfaceProps, type PresentationProjectionChart, type PresentationProjectionChartSeries, type PresentationProjectionConnector, type PresentationProjectionEditorProps, type PresentationProjectionElementMetadata, type PresentationProjectionElement, type PresentationProjectionFill, type PresentationProjectionGroup, type PresentationProjectionImage, type PresentationProjectionLine, type PresentationProjectionPosition, type PresentationProjectionRichText, type PresentationProjectionShape, type PresentationProjectionTable, type PresentationProjectionTableCell, type PresentationProjectionTextParagraph, type PresentationProjectionTextRun, type PresentationProjectionTextStyle, type PresentationSlideProjection, } from "./components/artifacts/presentation-editor.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditablePresentationArtifactSurface,
|
|
3
|
+
PresentationArtifactSurface,
|
|
4
|
+
PresentationEditor,
|
|
5
|
+
PresentationProjectionArtifactSurface,
|
|
6
|
+
PresentationProjectionEditor
|
|
7
|
+
} from "./chunk-PEI6RANI.js";
|
|
8
|
+
import "./chunk-KCGXPP5V.js";
|
|
9
|
+
import "./chunk-22KP6LR5.js";
|
|
10
|
+
export {
|
|
11
|
+
EditablePresentationArtifactSurface,
|
|
12
|
+
PresentationArtifactSurface,
|
|
13
|
+
PresentationEditor,
|
|
14
|
+
PresentationProjectionArtifactSurface,
|
|
15
|
+
PresentationProjectionEditor
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=artifacts-presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Spreadsheet-only artifact surface. Import from `@opengeni/react/artifacts/spreadsheet`. */
|
|
2
|
+
export { SpreadsheetArtifactSurface, SpreadsheetGrid, SpreadsheetProjectionGrid, type SpreadsheetArtifactSurfaceProps, type SpreadsheetCommit, type SpreadsheetRangeCommit, type SpreadsheetGridProps, type SpreadsheetGridProjection, type SpreadsheetProjectionCell, type SpreadsheetProjectionGridProps, type SpreadsheetSelection, type SpreadsheetViewport, } from "./components/artifacts/spreadsheet-grid.js";
|
|
3
|
+
export { EditableSpreadsheetArtifactSurface, EditableSpreadsheetGrid, type EditableSpreadsheetArtifactSurfaceProps, type EditableSpreadsheetGridProps, } from "./components/artifacts/editable-spreadsheet.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditableSpreadsheetArtifactSurface,
|
|
3
|
+
EditableSpreadsheetGrid,
|
|
4
|
+
SpreadsheetArtifactSurface,
|
|
5
|
+
SpreadsheetGrid,
|
|
6
|
+
SpreadsheetProjectionGrid
|
|
7
|
+
} from "./chunk-7WCLAEFV.js";
|
|
8
|
+
import "./chunk-KCGXPP5V.js";
|
|
9
|
+
import "./chunk-22KP6LR5.js";
|
|
10
|
+
export {
|
|
11
|
+
EditableSpreadsheetArtifactSurface,
|
|
12
|
+
EditableSpreadsheetGrid,
|
|
13
|
+
SpreadsheetArtifactSurface,
|
|
14
|
+
SpreadsheetGrid,
|
|
15
|
+
SpreadsheetProjectionGrid
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=artifacts-spreadsheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Public artifact surfaces. Import from `@opengeni/react/artifacts`. */
|
|
2
|
+
export { ArtifactSurface, DocumentArtifactSurface, DocumentEditor, DocumentProjectionArtifactSurface, DocumentProjectionEditor, BrowserEditableArtifactWorkbench, EditableDocumentArtifactSurface, EditableArtifactWorkbench, EditableArtifactWorkbenchHost, EditablePresentationArtifactSurface, EditableSpreadsheetArtifactSurface, EditableSpreadsheetGrid, PresentationArtifactSurface, PresentationEditor, PresentationProjectionArtifactSurface, PresentationProjectionEditor, PublishedHtmlArtifactFrame, PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX, SpreadsheetArtifactSurface, SpreadsheetGrid, SpreadsheetProjectionGrid, type ArtifactModality, type ArtifactSurfaceProps, type DocumentArtifactSurfaceProps, type DocumentCommit, type DocumentCommitHandler, type DocumentEditorProps, type DocumentEditorProjection, type DocumentLayoutMode, type DocumentProjectionArtifactSurfaceProps, type DocumentProjectionBlock, type DocumentProjectionChange, type DocumentProjectionComment, type DocumentProjectionEditorProps, type DocumentProjectionPageBreak, type DocumentProjectionPageGeometry, type DocumentProjectionParagraph, type DocumentProjectionParagraphStyle, type DocumentProjectionSection, type DocumentProjectionTable, type DocumentProjectionTextRun, type DocumentProjectionTextStyle, type DocumentSelection, type BrowserEditableArtifactWorkbenchOptions, type BrowserEditableArtifactWorkbenchProps, type EditableDocumentArtifactSurfaceProps, type EditableArtifactWorkbenchHostProps, type EditableArtifactWorkbenchProps, type EditablePresentationArtifactSurfaceProps, type EditableSpreadsheetArtifactSurfaceProps, type EditableSpreadsheetGridProps, type PresentationArtifactSurfaceProps, type PresentationCommit, type PresentationCommitHandler, type PresentationEditorProps, type PresentationEditorProjection, type PresentationProjectionArtifactSurfaceProps, type PresentationProjectionChart, type PresentationProjectionChartSeries, type PresentationProjectionConnector, type PresentationProjectionEditorProps, type PublishedHtmlArtifactFrameProps, type PresentationProjectionElementMetadata, type PresentationProjectionElement, type PresentationProjectionFill, type PresentationProjectionGroup, type PresentationProjectionImage, type PresentationProjectionLine, type PresentationProjectionPosition, type PresentationProjectionRichText, type PresentationProjectionShape, type PresentationProjectionTable, type PresentationProjectionTableCell, type PresentationProjectionTextParagraph, type PresentationProjectionTextRun, type PresentationProjectionTextStyle, type PresentationSlideProjection, type SpreadsheetArtifactSurfaceProps, type SpreadsheetCommit, type SpreadsheetRangeCommit, type SpreadsheetGridProps, type SpreadsheetGridProjection, type SpreadsheetProjectionCell, type SpreadsheetProjectionGridProps, type SpreadsheetSelection, type SpreadsheetViewport, } from "./components/artifacts/index.js";
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditablePresentationArtifactSurface,
|
|
3
|
+
PresentationArtifactSurface,
|
|
4
|
+
PresentationEditor,
|
|
5
|
+
PresentationProjectionArtifactSurface,
|
|
6
|
+
PresentationProjectionEditor
|
|
7
|
+
} from "./chunk-PEI6RANI.js";
|
|
8
|
+
import {
|
|
9
|
+
EditableSpreadsheetArtifactSurface,
|
|
10
|
+
EditableSpreadsheetGrid,
|
|
11
|
+
SpreadsheetArtifactSurface,
|
|
12
|
+
SpreadsheetGrid,
|
|
13
|
+
SpreadsheetProjectionGrid
|
|
14
|
+
} from "./chunk-7WCLAEFV.js";
|
|
15
|
+
import {
|
|
16
|
+
DocumentArtifactSurface,
|
|
17
|
+
DocumentEditor,
|
|
18
|
+
DocumentProjectionArtifactSurface,
|
|
19
|
+
DocumentProjectionEditor,
|
|
20
|
+
EditableDocumentArtifactSurface
|
|
21
|
+
} from "./chunk-HUIKIDM5.js";
|
|
22
|
+
import {
|
|
23
|
+
ArtifactSurface,
|
|
24
|
+
EditableArtifactMessage
|
|
25
|
+
} from "./chunk-KCGXPP5V.js";
|
|
26
|
+
import "./chunk-22KP6LR5.js";
|
|
27
|
+
|
|
28
|
+
// src/components/artifacts/published-html-artifact-frame.tsx
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
30
|
+
var PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX = [
|
|
31
|
+
"allow-downloads",
|
|
32
|
+
"allow-forms",
|
|
33
|
+
"allow-modals",
|
|
34
|
+
"allow-orientation-lock",
|
|
35
|
+
"allow-pointer-lock",
|
|
36
|
+
"allow-popups",
|
|
37
|
+
"allow-popups-to-escape-sandbox",
|
|
38
|
+
"allow-presentation",
|
|
39
|
+
"allow-scripts"
|
|
40
|
+
].join(" ");
|
|
41
|
+
function PublishedHtmlArtifactFrame(props) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"iframe",
|
|
44
|
+
{
|
|
45
|
+
title: props.title,
|
|
46
|
+
sandbox: PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX,
|
|
47
|
+
referrerPolicy: "no-referrer",
|
|
48
|
+
srcDoc: props.html,
|
|
49
|
+
className: props.className,
|
|
50
|
+
style: props.style
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/components/artifacts/editable-artifact-workbench.tsx
|
|
56
|
+
import {
|
|
57
|
+
createBrowserEditableArtifactSession
|
|
58
|
+
} from "@opengeni/sdk/editable-artifacts";
|
|
59
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
60
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
61
|
+
function EditableArtifactWorkbench({
|
|
62
|
+
session,
|
|
63
|
+
document,
|
|
64
|
+
spreadsheet,
|
|
65
|
+
presentation
|
|
66
|
+
}) {
|
|
67
|
+
switch (session.modality) {
|
|
68
|
+
case "document":
|
|
69
|
+
return /* @__PURE__ */ jsx2(
|
|
70
|
+
EditableDocumentArtifactSurface,
|
|
71
|
+
{
|
|
72
|
+
...document,
|
|
73
|
+
session,
|
|
74
|
+
title: document?.title ?? "Document"
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
case "spreadsheet":
|
|
78
|
+
return /* @__PURE__ */ jsx2(EditableSpreadsheetArtifactSurface, { ...spreadsheet, session });
|
|
79
|
+
case "presentation":
|
|
80
|
+
return /* @__PURE__ */ jsx2(EditablePresentationArtifactSurface, { ...presentation, session });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function EditableArtifactWorkbenchHost({
|
|
84
|
+
sessionKey,
|
|
85
|
+
createSession,
|
|
86
|
+
document,
|
|
87
|
+
spreadsheet,
|
|
88
|
+
presentation
|
|
89
|
+
}) {
|
|
90
|
+
const createSessionRef = useRef(createSession);
|
|
91
|
+
const [retryEpoch, setRetryEpoch] = useState(0);
|
|
92
|
+
const [state, setState] = useState({ key: null, session: null, error: null });
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
createSessionRef.current = createSession;
|
|
95
|
+
}, [createSession]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
let owned = null;
|
|
98
|
+
setState({ key: sessionKey, session: null, error: null });
|
|
99
|
+
try {
|
|
100
|
+
owned = createSessionRef.current();
|
|
101
|
+
setState({ key: sessionKey, session: owned, error: null });
|
|
102
|
+
} catch (cause) {
|
|
103
|
+
setState({
|
|
104
|
+
key: sessionKey,
|
|
105
|
+
session: null,
|
|
106
|
+
error: cause instanceof Error ? cause : new Error("Could not create artifact session")
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return () => {
|
|
110
|
+
const closing = owned;
|
|
111
|
+
owned = null;
|
|
112
|
+
if (closing) void closing.close().catch(() => void 0);
|
|
113
|
+
};
|
|
114
|
+
}, [retryEpoch, sessionKey]);
|
|
115
|
+
const retry = useCallback(() => setRetryEpoch((value) => value + 1), []);
|
|
116
|
+
const currentError = state.key === sessionKey ? state.error : null;
|
|
117
|
+
if (state.key === sessionKey && state.session) {
|
|
118
|
+
return /* @__PURE__ */ jsx2(
|
|
119
|
+
EditableArtifactWorkbench,
|
|
120
|
+
{
|
|
121
|
+
session: state.session,
|
|
122
|
+
...document ? { document } : {},
|
|
123
|
+
...spreadsheet ? { spreadsheet } : {},
|
|
124
|
+
...presentation ? { presentation } : {}
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ jsx2(
|
|
129
|
+
EditableArtifactMessage,
|
|
130
|
+
{
|
|
131
|
+
title: currentError ? "Could not open this artifact" : "Opening artifact",
|
|
132
|
+
detail: currentError?.message ?? "Starting the secure editing session\u2026",
|
|
133
|
+
retry: currentError ? retry : void 0
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function BrowserEditableArtifactWorkbench({
|
|
138
|
+
options,
|
|
139
|
+
document,
|
|
140
|
+
spreadsheet,
|
|
141
|
+
presentation
|
|
142
|
+
}) {
|
|
143
|
+
const sessionKey = browserSessionKey(options);
|
|
144
|
+
const createSession = useCallback(() => createBrowserEditableArtifactSession(options), [options]);
|
|
145
|
+
return /* @__PURE__ */ jsx2(
|
|
146
|
+
EditableArtifactWorkbenchHost,
|
|
147
|
+
{
|
|
148
|
+
sessionKey,
|
|
149
|
+
createSession,
|
|
150
|
+
...document ? { document } : {},
|
|
151
|
+
...spreadsheet ? { spreadsheet } : {},
|
|
152
|
+
...presentation ? { presentation } : {}
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function browserSessionKey(options) {
|
|
157
|
+
const transport = options.transport ? {
|
|
158
|
+
...options.transport,
|
|
159
|
+
// Credentials must not be copied into React lifecycle keys. The
|
|
160
|
+
// authorization epoch is the explicit credential/grant rotation fence.
|
|
161
|
+
headers: options.transport.headers ? Object.keys(options.transport.headers).sort() : void 0
|
|
162
|
+
} : null;
|
|
163
|
+
return JSON.stringify(
|
|
164
|
+
{
|
|
165
|
+
baseUrl: options.baseUrl,
|
|
166
|
+
workspaceId: options.workspaceId,
|
|
167
|
+
artifact: { id: options.artifact.id, modality: options.artifact.modality },
|
|
168
|
+
storageAuthority: options.storageAuthority,
|
|
169
|
+
runtime: options.runtime,
|
|
170
|
+
replicaId: options.replicaId ?? null,
|
|
171
|
+
transport
|
|
172
|
+
},
|
|
173
|
+
(_key, value) => value instanceof URL ? value.href : value
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
ArtifactSurface,
|
|
178
|
+
BrowserEditableArtifactWorkbench,
|
|
179
|
+
DocumentArtifactSurface,
|
|
180
|
+
DocumentEditor,
|
|
181
|
+
DocumentProjectionArtifactSurface,
|
|
182
|
+
DocumentProjectionEditor,
|
|
183
|
+
EditableArtifactWorkbench,
|
|
184
|
+
EditableArtifactWorkbenchHost,
|
|
185
|
+
EditableDocumentArtifactSurface,
|
|
186
|
+
EditablePresentationArtifactSurface,
|
|
187
|
+
EditableSpreadsheetArtifactSurface,
|
|
188
|
+
EditableSpreadsheetGrid,
|
|
189
|
+
PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX,
|
|
190
|
+
PresentationArtifactSurface,
|
|
191
|
+
PresentationEditor,
|
|
192
|
+
PresentationProjectionArtifactSurface,
|
|
193
|
+
PresentationProjectionEditor,
|
|
194
|
+
PublishedHtmlArtifactFrame,
|
|
195
|
+
SpreadsheetArtifactSurface,
|
|
196
|
+
SpreadsheetGrid,
|
|
197
|
+
SpreadsheetProjectionGrid
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/artifacts/published-html-artifact-frame.tsx","../src/components/artifacts/editable-artifact-workbench.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport const PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX = [\n \"allow-downloads\",\n \"allow-forms\",\n \"allow-modals\",\n \"allow-orientation-lock\",\n \"allow-pointer-lock\",\n \"allow-popups\",\n \"allow-popups-to-escape-sandbox\",\n \"allow-presentation\",\n \"allow-scripts\",\n].join(\" \");\n\nexport type PublishedHtmlArtifactFrameProps = {\n html: string;\n title: string;\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * Render exact published HTML in an opaque-origin iframe. Artifact scripts,\n * external resources, forms, popups, and downloads work without granting\n * parent-origin authority, shared cookies/storage, or top-level navigation.\n */\nexport function PublishedHtmlArtifactFrame(props: PublishedHtmlArtifactFrameProps) {\n return (\n <iframe\n title={props.title}\n sandbox={PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX}\n referrerPolicy=\"no-referrer\"\n srcDoc={props.html}\n className={props.className}\n style={props.style}\n />\n );\n}\n","import {\n createBrowserEditableArtifactSession,\n type CreateBrowserEditableArtifactSessionOptions,\n type EditableArtifactBrowserRuntime,\n type EditableArtifactSession,\n} from \"@opengeni/sdk/editable-artifacts\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { EditableArtifactMessage } from \"./editable-artifact-ui\";\nimport {\n EditableDocumentArtifactSurface,\n type EditableDocumentArtifactSurfaceProps,\n} from \"./editable-document\";\nimport {\n EditablePresentationArtifactSurface,\n type EditablePresentationArtifactSurfaceProps,\n} from \"./editable-presentation\";\nimport {\n EditableSpreadsheetArtifactSurface,\n type EditableSpreadsheetArtifactSurfaceProps,\n} from \"./editable-spreadsheet\";\n\nexport type EditableArtifactWorkbenchProps = Readonly<{\n session: EditableArtifactSession;\n document?: Omit<EditableDocumentArtifactSurfaceProps, \"session\">;\n spreadsheet?: Omit<EditableSpreadsheetArtifactSurfaceProps, \"session\">;\n presentation?: Omit<EditablePresentationArtifactSurfaceProps, \"session\">;\n}>;\n\nexport type EditableArtifactWorkbenchHostProps = Omit<EditableArtifactWorkbenchProps, \"session\"> &\n Readonly<{\n /**\n * Complete identity of the browser session authority. Change this when the\n * artifact, deployment, principal, or authorization epoch changes.\n */\n sessionKey: string;\n /** Called for the active keyed lifecycle and again only after replacement or retry. */\n createSession: () => EditableArtifactSession;\n }>;\n\ntype DefaultBrowserArtifactTransport = Omit<\n NonNullable<CreateBrowserEditableArtifactSessionOptions[\"transport\"]>,\n \"apiKey\" | \"fetch\" | \"headers\" | \"webSocketFactory\"\n> &\n Readonly<{\n /** Static deployment auth headers; rotate authorizationEpoch when they change. */\n headers?: Readonly<Record<string, string>>;\n }>;\n\nexport type BrowserEditableArtifactWorkbenchOptions = Omit<\n CreateBrowserEditableArtifactSessionOptions,\n \"runtime\" | \"storage\" | \"transport\"\n> &\n Readonly<{\n /** Default module Worker only; custom Worker hosts use EditableArtifactWorkbenchHost. */\n runtime: Omit<EditableArtifactBrowserRuntime, \"workerFactory\">;\n /** Default fetch/WebSocket only; static deployment auth headers are supported. */\n transport?: DefaultBrowserArtifactTransport;\n }>;\n\nexport type BrowserEditableArtifactWorkbenchProps = Omit<\n EditableArtifactWorkbenchProps,\n \"session\"\n> &\n Readonly<{ options: BrowserEditableArtifactWorkbenchOptions }>;\n\n/**\n * One modality-neutral SDK workbench. Embedding hosts keep one route/component;\n * each artifact still renders through its complete first-party editor surface.\n */\nexport function EditableArtifactWorkbench({\n session,\n document,\n spreadsheet,\n presentation,\n}: EditableArtifactWorkbenchProps) {\n switch (session.modality) {\n case \"document\":\n return (\n <EditableDocumentArtifactSurface\n {...document}\n session={session}\n title={document?.title ?? \"Document\"}\n />\n );\n case \"spreadsheet\":\n return <EditableSpreadsheetArtifactSurface {...spreadsheet} session={session} />;\n case \"presentation\":\n return <EditablePresentationArtifactSurface {...presentation} session={session} />;\n }\n}\n\n/**\n * Route/embed composition that owns exactly one SDK session. The host supplies\n * the authenticated SDK factory; React guarantees replacement and teardown.\n */\nexport function EditableArtifactWorkbenchHost({\n sessionKey,\n createSession,\n document,\n spreadsheet,\n presentation,\n}: EditableArtifactWorkbenchHostProps) {\n const createSessionRef = useRef(createSession);\n const [retryEpoch, setRetryEpoch] = useState(0);\n const [state, setState] = useState<\n | Readonly<{ key: string; session: EditableArtifactSession; error: null }>\n | Readonly<{ key: string | null; session: null; error: Error | null }>\n >({ key: null, session: null, error: null });\n\n useEffect(() => {\n createSessionRef.current = createSession;\n }, [createSession]);\n\n useEffect(() => {\n let owned: EditableArtifactSession | null = null;\n setState({ key: sessionKey, session: null, error: null });\n try {\n owned = createSessionRef.current();\n setState({ key: sessionKey, session: owned, error: null });\n } catch (cause) {\n setState({\n key: sessionKey,\n session: null,\n error: cause instanceof Error ? cause : new Error(\"Could not create artifact session\"),\n });\n }\n return () => {\n const closing = owned;\n owned = null;\n if (closing) void closing.close().catch(() => undefined);\n };\n }, [retryEpoch, sessionKey]);\n\n const retry = useCallback(() => setRetryEpoch((value) => value + 1), []);\n const currentError = state.key === sessionKey ? state.error : null;\n if (state.key === sessionKey && state.session) {\n return (\n <EditableArtifactWorkbench\n session={state.session}\n {...(document ? { document } : {})}\n {...(spreadsheet ? { spreadsheet } : {})}\n {...(presentation ? { presentation } : {})}\n />\n );\n }\n return (\n <EditableArtifactMessage\n title={currentError ? \"Could not open this artifact\" : \"Opening artifact\"}\n detail={currentError?.message ?? \"Starting the secure editing session…\"}\n retry={currentError ? retry : undefined}\n />\n );\n}\n\n/**\n * Complete default-browser composition for embedders: verified WASM Worker,\n * durable IndexedDB state, authenticated live sync, teardown, and the matching\n * first-party editor. Advanced/custom transports compose the lower-level host.\n */\nexport function BrowserEditableArtifactWorkbench({\n options,\n document,\n spreadsheet,\n presentation,\n}: BrowserEditableArtifactWorkbenchProps) {\n const sessionKey = browserSessionKey(options);\n const createSession = useCallback(() => createBrowserEditableArtifactSession(options), [options]);\n return (\n <EditableArtifactWorkbenchHost\n sessionKey={sessionKey}\n createSession={createSession}\n {...(document ? { document } : {})}\n {...(spreadsheet ? { spreadsheet } : {})}\n {...(presentation ? { presentation } : {})}\n />\n );\n}\n\nfunction browserSessionKey(options: BrowserEditableArtifactWorkbenchOptions): string {\n const transport = options.transport\n ? {\n ...options.transport,\n // Credentials must not be copied into React lifecycle keys. The\n // authorization epoch is the explicit credential/grant rotation fence.\n headers: options.transport.headers\n ? Object.keys(options.transport.headers).sort()\n : undefined,\n }\n : null;\n return JSON.stringify(\n {\n baseUrl: options.baseUrl,\n workspaceId: options.workspaceId,\n artifact: { id: options.artifact.id, modality: options.artifact.modality },\n storageAuthority: options.storageAuthority,\n runtime: options.runtime,\n replicaId: options.replicaId ?? null,\n transport,\n },\n (_key, value: unknown) => (value instanceof URL ? value.href : value),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BI;AA1BG,IAAM,yCAAyC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAcH,SAAS,2BAA2B,OAAwC;AACjF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,MAAM;AAAA,MACb,SAAS;AAAA,MACT,gBAAe;AAAA,MACf,QAAQ,MAAM;AAAA,MACd,WAAW,MAAM;AAAA,MACjB,OAAO,MAAM;AAAA;AAAA,EACf;AAEJ;;;ACrCA;AAAA,EACE;AAAA,OAIK;AACP,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAyEjD,gBAAAA,YAAA;AATD,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,UAAQ,QAAQ,UAAU;AAAA,IACxB,KAAK;AACH,aACE,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,OAAO,UAAU,SAAS;AAAA;AAAA,MAC5B;AAAA,IAEJ,KAAK;AACH,aAAO,gBAAAA,KAAC,sCAAoC,GAAG,aAAa,SAAkB;AAAA,IAChF,KAAK;AACH,aAAO,gBAAAA,KAAC,uCAAqC,GAAG,cAAc,SAAkB;AAAA,EACpF;AACF;AAMO,SAAS,8BAA8B;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,QAAM,mBAAmB,OAAO,aAAa;AAC7C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,CAAC;AAC9C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAGxB,EAAE,KAAK,MAAM,SAAS,MAAM,OAAO,KAAK,CAAC;AAE3C,YAAU,MAAM;AACd,qBAAiB,UAAU;AAAA,EAC7B,GAAG,CAAC,aAAa,CAAC;AAElB,YAAU,MAAM;AACd,QAAI,QAAwC;AAC5C,aAAS,EAAE,KAAK,YAAY,SAAS,MAAM,OAAO,KAAK,CAAC;AACxD,QAAI;AACF,cAAQ,iBAAiB,QAAQ;AACjC,eAAS,EAAE,KAAK,YAAY,SAAS,OAAO,OAAO,KAAK,CAAC;AAAA,IAC3D,SAAS,OAAO;AACd,eAAS;AAAA,QACP,KAAK;AAAA,QACL,SAAS;AAAA,QACT,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,mCAAmC;AAAA,MACvF,CAAC;AAAA,IACH;AACA,WAAO,MAAM;AACX,YAAM,UAAU;AAChB,cAAQ;AACR,UAAI,QAAS,MAAK,QAAQ,MAAM,EAAE,MAAM,MAAM,MAAS;AAAA,IACzD;AAAA,EACF,GAAG,CAAC,YAAY,UAAU,CAAC;AAE3B,QAAM,QAAQ,YAAY,MAAM,cAAc,CAAC,UAAU,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvE,QAAM,eAAe,MAAM,QAAQ,aAAa,MAAM,QAAQ;AAC9D,MAAI,MAAM,QAAQ,cAAc,MAAM,SAAS;AAC7C,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,MAAM;AAAA,QACd,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAA,QAC/B,GAAI,cAAc,EAAE,YAAY,IAAI,CAAC;AAAA,QACrC,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;AAAA;AAAA,IAC1C;AAAA,EAEJ;AACA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,eAAe,iCAAiC;AAAA,MACvD,QAAQ,cAAc,WAAW;AAAA,MACjC,OAAO,eAAe,QAAQ;AAAA;AAAA,EAChC;AAEJ;AAOO,SAAS,iCAAiC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0C;AACxC,QAAM,aAAa,kBAAkB,OAAO;AAC5C,QAAM,gBAAgB,YAAY,MAAM,qCAAqC,OAAO,GAAG,CAAC,OAAO,CAAC;AAChG,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACC,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAA,MAC/B,GAAI,cAAc,EAAE,YAAY,IAAI,CAAC;AAAA,MACrC,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;AAAA;AAAA,EAC1C;AAEJ;AAEA,SAAS,kBAAkB,SAA0D;AACnF,QAAM,YAAY,QAAQ,YACtB;AAAA,IACE,GAAG,QAAQ;AAAA;AAAA;AAAA,IAGX,SAAS,QAAQ,UAAU,UACvB,OAAO,KAAK,QAAQ,UAAU,OAAO,EAAE,KAAK,IAC5C;AAAA,EACN,IACA;AACJ,SAAO,KAAK;AAAA,IACV;AAAA,MACE,SAAS,QAAQ;AAAA,MACjB,aAAa,QAAQ;AAAA,MACrB,UAAU,EAAE,IAAI,QAAQ,SAAS,IAAI,UAAU,QAAQ,SAAS,SAAS;AAAA,MACzE,kBAAkB,QAAQ;AAAA,MAC1B,SAAS,QAAQ;AAAA,MACjB,WAAW,QAAQ,aAAa;AAAA,MAChC;AAAA,IACF;AAAA,IACA,CAAC,MAAM,UAAoB,iBAAiB,MAAM,MAAM,OAAO;AAAA,EACjE;AACF;","names":["jsx"]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldSteerOnKey,
|
|
3
3
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IGC6A2ZI.js";
|
|
5
5
|
import {
|
|
6
6
|
groupPickerRowsByBillingClass
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XBZWOM2K.js";
|
|
8
8
|
import {
|
|
9
9
|
Tooltip,
|
|
10
10
|
TooltipContent,
|
|
11
11
|
TooltipProvider,
|
|
12
12
|
TooltipTrigger
|
|
13
13
|
} from "./chunk-FK6VG4LL.js";
|
|
14
|
+
import {
|
|
15
|
+
ComposerResponsiveContext
|
|
16
|
+
} from "./chunk-VZTQ73XT.js";
|
|
14
17
|
import {
|
|
15
18
|
composerSubmissionErrorMessage,
|
|
16
19
|
formatBytes,
|
|
17
20
|
formatRelativeTime
|
|
18
21
|
} from "./chunk-LAKLF4PA.js";
|
|
19
|
-
import {
|
|
20
|
-
ComposerResponsiveContext
|
|
21
|
-
} from "./chunk-VZTQ73XT.js";
|
|
22
22
|
import {
|
|
23
23
|
cn
|
|
24
24
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -4165,6 +4165,7 @@ function ComposerTranscriptionControl({
|
|
|
4165
4165
|
});
|
|
4166
4166
|
const { status } = transcription;
|
|
4167
4167
|
const retrying = status === "retrying";
|
|
4168
|
+
const capturing = status === "requesting-permission" || status === "recording";
|
|
4168
4169
|
const cancelTranscription = transcription.cancel;
|
|
4169
4170
|
useEffect4(() => {
|
|
4170
4171
|
if (!suppressed) return;
|
|
@@ -4172,7 +4173,7 @@ function ComposerTranscriptionControl({
|
|
|
4172
4173
|
cancelTranscription();
|
|
4173
4174
|
}
|
|
4174
4175
|
}, [cancelTranscription, status, suppressed]);
|
|
4175
|
-
const active =
|
|
4176
|
+
const active = capturing || status === "saving" || status === "transcribing";
|
|
4176
4177
|
const recoverable = transcription.hasRecoverableRecording && (retrying || status === "recovered" || status === "transcript-ready" || status === "error");
|
|
4177
4178
|
const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
|
|
4178
4179
|
const unavailableMessage = composer.disabled ? messages.unavailableDisabled : !capability?.available || !workspaceEnabled ? messages.unavailable : !transcription.available ? messages.errorStorageUnavailable : null;
|
|
@@ -4193,8 +4194,15 @@ function ComposerTranscriptionControl({
|
|
|
4193
4194
|
animate: { opacity: 1, width: "auto" },
|
|
4194
4195
|
exit: { opacity: 0, width: 0 },
|
|
4195
4196
|
transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
|
|
4196
|
-
className: cn(
|
|
4197
|
+
className: cn(
|
|
4198
|
+
"inline-flex min-w-0 overflow-hidden",
|
|
4199
|
+
// Mobile capture mode reserves the footer for this control. Keep the
|
|
4200
|
+
// shell itself from shrinking and clipping its trailing actions.
|
|
4201
|
+
capturing && "shrink-0",
|
|
4202
|
+
className
|
|
4203
|
+
),
|
|
4197
4204
|
"data-transcription-status": status,
|
|
4205
|
+
"data-transcription-capturing": capturing ? "" : void 0,
|
|
4198
4206
|
children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
4199
4207
|
/* @__PURE__ */ jsx4(AnimatePresence3, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs4(
|
|
4200
4208
|
motion3.span,
|
|
@@ -4523,4 +4531,4 @@ export {
|
|
|
4523
4531
|
Status,
|
|
4524
4532
|
ComposerTranscriptionControl
|
|
4525
4533
|
};
|
|
4526
|
-
//# sourceMappingURL=chunk-
|
|
4534
|
+
//# sourceMappingURL=chunk-5UQPNLIO.js.map
|