@opengeni/react 6.1.0-canary.2 → 6.1.0-canary.4

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 (48) hide show
  1. package/README.md +5 -0
  2. package/dist/{browser-viewer-NTD6UIPR.js → browser-viewer-LGH4IP47.js} +3 -3
  3. package/dist/chunk-AWEBVNVX.js +1398 -0
  4. package/dist/chunk-AWEBVNVX.js.map +1 -0
  5. package/dist/{chunk-NYESIADM.js → chunk-B7TTSUEW.js} +3 -1
  6. package/dist/chunk-B7TTSUEW.js.map +1 -0
  7. package/dist/{chunk-UWVY3OXF.js → chunk-BC7BFCMN.js} +277 -455
  8. package/dist/chunk-BC7BFCMN.js.map +1 -0
  9. package/dist/chunk-BRM6FVZA.js +302 -0
  10. package/dist/chunk-BRM6FVZA.js.map +1 -0
  11. package/dist/{chunk-KZ4QDBGM.js → chunk-GHSSI2BK.js} +925 -1265
  12. package/dist/chunk-GHSSI2BK.js.map +1 -0
  13. package/dist/{chunk-NLTS7JHI.js → chunk-JPHDWKZE.js} +5 -5
  14. package/dist/{chunk-L5VJYZIW.js → chunk-O53CQZ6T.js} +7 -7
  15. package/dist/{chunk-24M4YBCL.js → chunk-PNAVEK2U.js} +4 -4
  16. package/dist/components/preview-loading.d.ts +2 -0
  17. package/dist/composer.js +4 -4
  18. package/dist/connect-setup.d.ts +2 -0
  19. package/dist/connect.js +19 -8
  20. package/dist/connect.js.map +1 -1
  21. package/dist/index.js +27 -27
  22. package/dist/interaction.js +2 -2
  23. package/dist/machines.js +2 -2
  24. package/dist/plugin-discovery.d.ts +2 -0
  25. package/dist/realtime.js +20 -20
  26. package/dist/realtime.js.map +1 -1
  27. package/dist/session-ui.js +7 -7
  28. package/dist/session.js +3 -3
  29. package/package.json +3 -3
  30. package/src/components/markdown.tsx +13 -21
  31. package/src/components/preview-loading.tsx +154 -0
  32. package/src/connect-setup.tsx +17 -5
  33. package/src/hooks/use-composer.ts +6 -0
  34. package/src/plugin-discovery.tsx +10 -6
  35. package/src/realtime/realtime-control.tsx +6 -8
  36. package/styles/compiled.css +48 -8
  37. package/styles/index.css +45 -0
  38. package/dist/chunk-G5JFM6ZE.js +0 -911
  39. package/dist/chunk-G5JFM6ZE.js.map +0 -1
  40. package/dist/chunk-HQV2I5HV.js +0 -124
  41. package/dist/chunk-HQV2I5HV.js.map +0 -1
  42. package/dist/chunk-KZ4QDBGM.js.map +0 -1
  43. package/dist/chunk-NYESIADM.js.map +0 -1
  44. package/dist/chunk-UWVY3OXF.js.map +0 -1
  45. /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-LGH4IP47.js.map} +0 -0
  46. /package/dist/{chunk-NLTS7JHI.js.map → chunk-JPHDWKZE.js.map} +0 -0
  47. /package/dist/{chunk-L5VJYZIW.js.map → chunk-O53CQZ6T.js.map} +0 -0
  48. /package/dist/{chunk-24M4YBCL.js.map → chunk-PNAVEK2U.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import {
2
- formatBytes,
3
- formatRelativeTime
4
- } from "./chunk-PLYRL5ER.js";
5
1
  import {
6
2
  useMutationRunner,
7
3
  usePageLiveActivity
8
4
  } from "./chunk-KZ73RL76.js";
5
+ import {
6
+ formatBytes,
7
+ formatRelativeTime
8
+ } from "./chunk-PLYRL5ER.js";
9
9
  import {
10
10
  useOpenGeni
11
11
  } from "./chunk-NEXLLTP4.js";
@@ -2442,4 +2442,4 @@ export {
2442
2442
  EnrollmentDeviceFlow,
2443
2443
  EnrollmentConsent
2444
2444
  };
2445
- //# sourceMappingURL=chunk-NLTS7JHI.js.map
2445
+ //# sourceMappingURL=chunk-JPHDWKZE.js.map
@@ -1,9 +1,3 @@
1
- import {
2
- CREDIT_EXHAUSTION_MESSAGE,
3
- isCreditExhaustion,
4
- presentFailure,
5
- tryParseJson
6
- } from "./chunk-PLYRL5ER.js";
7
1
  import {
8
2
  useDebouncedCallback,
9
3
  useMutationRunner,
@@ -11,6 +5,12 @@ import {
11
5
  usePolledValue,
12
6
  useSessionEventTrigger
13
7
  } from "./chunk-KZ73RL76.js";
8
+ import {
9
+ CREDIT_EXHAUSTION_MESSAGE,
10
+ isCreditExhaustion,
11
+ presentFailure,
12
+ tryParseJson
13
+ } from "./chunk-PLYRL5ER.js";
14
14
  import {
15
15
  useEmbeddedHumanInputSession,
16
16
  useEmbeddedSession,
@@ -3786,4 +3786,4 @@ export {
3786
3786
  isHumanInputEvent,
3787
3787
  useHumanInputRequests
3788
3788
  };
3789
- //# sourceMappingURL=chunk-L5VJYZIW.js.map
3789
+ //# sourceMappingURL=chunk-O53CQZ6T.js.map
@@ -18,12 +18,12 @@ import {
18
18
  import {
19
19
  copyTextToClipboard
20
20
  } from "./chunk-JVYQRRC4.js";
21
- import {
22
- formatBytes
23
- } from "./chunk-PLYRL5ER.js";
24
21
  import {
25
22
  usePageLiveActivity
26
23
  } from "./chunk-KZ73RL76.js";
24
+ import {
25
+ formatBytes
26
+ } from "./chunk-PLYRL5ER.js";
27
27
  import {
28
28
  useEmbeddedBrowserInteraction
29
29
  } from "./chunk-NEXLLTP4.js";
@@ -3904,4 +3904,4 @@ export {
3904
3904
  useSiteAuthConnections,
3905
3905
  BrowserViewer
3906
3906
  };
3907
- //# sourceMappingURL=chunk-24M4YBCL.js.map
3907
+ //# sourceMappingURL=chunk-PNAVEK2U.js.map
@@ -0,0 +1,2 @@
1
+ /** Private loading surface: never receives or executes the unfinished fence. */
2
+ export declare function PreviewLoading(): import("react").JSX.Element;
package/dist/composer.js CHANGED
@@ -40,8 +40,8 @@ import {
40
40
  useChatComposer,
41
41
  useChatComposerController,
42
42
  useVoiceInput
43
- } from "./chunk-UWVY3OXF.js";
44
- import "./chunk-HQV2I5HV.js";
43
+ } from "./chunk-BC7BFCMN.js";
44
+ import "./chunk-BRM6FVZA.js";
45
45
  import {
46
46
  BillingClassMark,
47
47
  ModelPolicyPicker,
@@ -51,9 +51,9 @@ import {
51
51
  defaultModelPolicyPickerMessages
52
52
  } from "./chunk-IP4BUBKH.js";
53
53
  import "./chunk-VZTQ73XT.js";
54
- import "./chunk-NYESIADM.js";
55
- import "./chunk-PLYRL5ER.js";
54
+ import "./chunk-B7TTSUEW.js";
56
55
  import "./chunk-KZ73RL76.js";
56
+ import "./chunk-PLYRL5ER.js";
57
57
  import "./chunk-NEXLLTP4.js";
58
58
  import "./chunk-5GAL23FF.js";
59
59
  import "./chunk-22KP6LR5.js";
@@ -3,6 +3,8 @@ export type ConnectSetupProps = {
3
3
  controller: ConnectController;
4
4
  /** Called synchronously in the click handler so a host can open a popup. */
5
5
  onAuthorize: (attempt: ConnectAttempt) => void | Promise<unknown>;
6
+ /** Called synchronously on Continue; hosts can reserve a popup before advancing. */
7
+ onSelectAccount?: (accountId: string) => void | Promise<unknown>;
6
8
  /** Host pagination must retain selections across pages and submit the final set. */
7
9
  onBrowseResources?: (attempt: ConnectAttempt) => void | Promise<unknown>;
8
10
  className?: string;
package/dist/connect.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import "./chunk-IWIDV7SB.js";
2
2
  import {
3
3
  Markdown
4
- } from "./chunk-G5JFM6ZE.js";
4
+ } from "./chunk-AWEBVNVX.js";
5
5
  import {
6
6
  copyTextToClipboard
7
7
  } from "./chunk-JVYQRRC4.js";
8
- import "./chunk-HQV2I5HV.js";
8
+ import "./chunk-BRM6FVZA.js";
9
9
  import "./chunk-VZTQ73XT.js";
10
+ import "./chunk-PLYRL5ER.js";
10
11
  import "./chunk-22KP6LR5.js";
11
12
 
12
13
  // src/connect.ts
@@ -288,11 +289,13 @@ function ScopedSetup({
288
289
  controller,
289
290
  onAuthorize,
290
291
  onBrowseResources,
292
+ onSelectAccount,
291
293
  className,
292
294
  authorizeLabel = "Authorize connection"
293
295
  }) {
294
296
  const view = useConnect(controller);
295
297
  const [localError, setLocalError] = useState2(false);
298
+ const [navigating, setNavigating] = useState2(false);
296
299
  const invoke = (operation) => {
297
300
  setLocalError(false);
298
301
  try {
@@ -318,7 +321,7 @@ function ScopedSetup({
318
321
  event.preventDefault();
319
322
  const form = event.currentTarget;
320
323
  const data = new FormData(form);
321
- if (view.busy) return;
324
+ if (view.busy || navigating) return;
322
325
  const key = crypto.randomUUID();
323
326
  if (action.type === "credentials") {
324
327
  const values = Object.fromEntries(
@@ -329,7 +332,15 @@ function ScopedSetup({
329
332
  } else if (action.type === "select_account") {
330
333
  const accountId = String(data.get("account") ?? "");
331
334
  if (action.accounts.some((account) => account.id === accountId && account.status !== "disabled"))
332
- invoke(() => view.advance({ type: "account", accountId }, key));
335
+ invoke(async () => {
336
+ if (!onSelectAccount) return view.advance({ type: "account", accountId }, key);
337
+ setNavigating(true);
338
+ try {
339
+ await onSelectAccount(accountId);
340
+ } finally {
341
+ setNavigating(false);
342
+ }
343
+ });
333
344
  } else if (action.type === "select_resources") {
334
345
  if (action.cursor) return;
335
346
  const resourceIds = data.getAll("resource").map(String);
@@ -354,7 +365,7 @@ function ScopedSetup({
354
365
  {
355
366
  className: ["og-connect-setup", className].filter(Boolean).join(" "),
356
367
  "aria-label": "Connection setup",
357
- "aria-busy": view.busy,
368
+ "aria-busy": view.busy || navigating,
358
369
  children: [
359
370
  /* @__PURE__ */ jsxs3("div", { className: "og-connect-setup-summary", children: [
360
371
  /* @__PURE__ */ jsx3("p", { className: "og-connect-setup-scope", children: attempt.ownership === "personal" ? "Personal connection" : "Workspace connection" }),
@@ -366,7 +377,7 @@ function ScopedSetup({
366
377
  attempt.account.label
367
378
  ] }),
368
379
  (localError || view.error || attempt.error) && /* @__PURE__ */ jsx3("p", { role: "alert", children: attempt.error?.code === "source_changed" ? "The integration source changed. Review the new operations before installing." : "Connection setup could not continue. Refresh its status before trying again." }),
369
- !terminal && /* @__PURE__ */ jsx3("form", { onSubmit: submit, autoComplete: "off", children: /* @__PURE__ */ jsxs3("fieldset", { disabled: view.busy, children: [
380
+ !terminal && /* @__PURE__ */ jsx3("form", { onSubmit: submit, autoComplete: "off", children: /* @__PURE__ */ jsxs3("fieldset", { disabled: view.busy || navigating, children: [
370
381
  ["credentials", "select_account", "select_resources", "preview"].includes(
371
382
  action.type
372
383
  ) ? /* @__PURE__ */ jsx3("legend", { children: "Connection details" }) : null,
@@ -461,7 +472,7 @@ function ScopedSetup({
461
472
  type: "button",
462
473
  className: "og-connect-setup-primary",
463
474
  onClick: () => invoke(() => onAuthorize(structuredClone(attempt))),
464
- children: authorizeLabel
475
+ children: navigating ? "Waiting for authorization\u2026" : authorizeLabel
465
476
  }
466
477
  ),
467
478
  action.type === "wait" && /* @__PURE__ */ jsxs3(Fragment, { children: [
@@ -1317,7 +1328,7 @@ import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-r
1317
1328
  var discoveryCache2 = createDiscoveryCache();
1318
1329
  var EMPTY_INSTALLED_IDS = /* @__PURE__ */ new Set();
1319
1330
  function PluginDiscovery(props) {
1320
- const [provider, setProvider] = useState9("");
1331
+ const [provider, setProvider] = useState9(props.defaultProvider ?? "");
1321
1332
  return /* @__PURE__ */ jsxs13(
1322
1333
  "section",
1323
1334
  {