@xyo-network/xl1-react-client-sdk 1.30.2 → 1.30.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 (23) hide show
  1. package/dist/browser/client/components/connected/ApprovedLakeSelector.d.ts +5 -5
  2. package/dist/browser/client/components/connected/ApprovedLakeSelector.d.ts.map +1 -1
  3. package/dist/browser/client/components/connected/DataLakeGetButton.d.ts +2 -2
  4. package/dist/browser/client/components/connected/DataLakeGetButton.d.ts.map +1 -1
  5. package/dist/browser/client/components/connected/DataLakeOperationsPanel.d.ts +10 -8
  6. package/dist/browser/client/components/connected/DataLakeOperationsPanel.d.ts.map +1 -1
  7. package/dist/browser/client/components/connected/DataLakeRequestAccessPanel.d.ts +19 -0
  8. package/dist/browser/client/components/connected/DataLakeRequestAccessPanel.d.ts.map +1 -0
  9. package/dist/browser/client/components/connected/PermissionsReviewDialog.d.ts +41 -0
  10. package/dist/browser/client/components/connected/PermissionsReviewDialog.d.ts.map +1 -0
  11. package/dist/browser/client/components/connected/RequestPermissionsButton.d.ts +21 -4
  12. package/dist/browser/client/components/connected/RequestPermissionsButton.d.ts.map +1 -1
  13. package/dist/browser/client/components/connected/index.d.ts +2 -0
  14. package/dist/browser/client/components/connected/index.d.ts.map +1 -1
  15. package/dist/browser/client/index.mjs +359 -116
  16. package/dist/browser/client/index.mjs.map +4 -4
  17. package/dist/browser/index.mjs +407 -166
  18. package/dist/browser/index.mjs.map +4 -4
  19. package/dist/browser/shared/components/menu-item/ActiveMenuItem.d.ts.map +1 -1
  20. package/dist/browser/shared/components/stack/DetailsStack.d.ts.map +1 -1
  21. package/dist/browser/shared/index.mjs +23 -25
  22. package/dist/browser/shared/index.mjs.map +3 -3
  23. package/package.json +4 -4
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  export interface ApprovedLakeSelectorProps {
3
- /** Currently selected per-origin lake id, or empty string for no selection. */
4
- selectedId: string;
5
- /** Called with the new selection when the user picks a lake. */
6
- onChange: (id: string) => void;
7
3
  /** Filter to lakes with this capability — `viewer` for read flows, `runner` for write flows. */
8
4
  capability: 'viewer' | 'runner';
9
- timeout?: number;
10
5
  /** Label shown above the dropdown. */
11
6
  label?: string;
7
+ /** Called with the new selection when the user picks a lake. */
8
+ onChange: (id: string) => void;
9
+ /** Currently selected per-origin lake id, or empty string for no selection. */
10
+ selectedId: string;
11
+ timeout?: number;
12
12
  }
13
13
  /**
14
14
  * Fetches `client.dataLakes.list()` from the wallet and renders a dropdown of
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovedLakeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/ApprovedLakeSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAEN,MAAM,OAAO,CAAA;AAId,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,gGAAgG;IAChG,UAAU,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA4GpE,CAAA"}
1
+ {"version":3,"file":"ApprovedLakeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/ApprovedLakeSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAEN,MAAM,OAAO,CAAA;AAId,MAAM,WAAW,yBAAyB;IACxC,gGAAgG;IAChG,UAAU,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC/B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAgHpE,CAAA"}
@@ -2,10 +2,10 @@ import type { StackProps } from '@mui/material';
2
2
  import type { Hash } from '@xylabs/sdk-js';
3
3
  import React from 'react';
4
4
  export interface DataLakeGetButtonProps extends StackProps {
5
- /** Per-origin opaque id from `requestAccess` or `list`. */
6
- id: string;
7
5
  /** Hashes to fetch from the lake bound to `id`. */
8
6
  hashes: Hash[];
7
+ /** Per-origin opaque id from `requestAccess` or `list`. */
8
+ id: string;
9
9
  timeout?: number;
10
10
  }
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DataLakeGetButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeGetButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAG1C,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,MAAM,WAAW,sBAAuB,SAAQ,UAAU;IACxD,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAA;IACV,mDAAmD;IACnD,MAAM,EAAE,IAAI,EAAE,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqF9D,CAAA"}
1
+ {"version":3,"file":"DataLakeGetButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeGetButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAG1C,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,MAAM,WAAW,sBAAuB,SAAQ,UAAU;IACxD,mDAAmD;IACnD,MAAM,EAAE,IAAI,EAAE,CAAA;IACd,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqF9D,CAAA"}
@@ -4,17 +4,19 @@ export interface DataLakeOperationsPanelProps extends StackProps {
4
4
  timeout?: number;
5
5
  }
6
6
  /**
7
- * Combined panel for exercising every page-side data-lake operation against a
8
- * live wallet in a single rendered surface — `list`, `insert`, and `get`
9
- * stacked with their own controls so a manual tester can drive the full flow
10
- * without jumping between Storybook stories. Insert sits above Get so a
11
- * tester can write a payload, copy the returned hash, and read it back in
7
+ * Combined panel for exercising every page-side data-lake operation against
8
+ * a live wallet in a single rendered surface — `requestAccess`, `list`,
9
+ * `insert`, and `get` stacked with their own controls so a manual tester
10
+ * can drive the full flow without jumping between Storybook stories. The
11
+ * sections are ordered for natural flow: request access first, then
12
+ * enumerate the grants, then insert a payload and read it back by hash in
12
13
  * the same scroll. Designed for isolation mode where the args panel isn't
13
14
  * available.
14
15
  *
15
- * Single-purpose: composes the three operation components and labels each
16
- * section. State within each operation (selected lake, hashes, payload JSON)
17
- * is owned by the underlying panel, not by this wrapper.
16
+ * Single-purpose: composes the four operation components and labels each
17
+ * section. State within each operation (capability choice, selected lake,
18
+ * hashes, payload JSON) is owned by the underlying panel, not by this
19
+ * wrapper.
18
20
  */
19
21
  export declare const DataLakeOperationsPanel: React.FC<DataLakeOperationsPanelProps>;
20
22
  //# sourceMappingURL=DataLakeOperationsPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataLakeOperationsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeOperationsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA8B1E,CAAA"}
1
+ {"version":3,"file":"DataLakeOperationsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeOperationsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAqC1E,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { StackProps } from '@mui/material';
2
+ import React from 'react';
3
+ export interface DataLakeRequestAccessPanelProps extends StackProps {
4
+ timeout?: number;
5
+ }
6
+ /**
7
+ * Self-contained RequestAccess flow — picks a capability shape
8
+ * (`viewer`, `runner`, or combined `read + write`) and optionally attaches
9
+ * a schemas filter, then drives `client.dataLakes.requestAccess(options)`
10
+ * through {@link DataLakeRequestAccessButton}. Designed for Storybook's
11
+ * isolation mode where the args panel isn't available, so a manual tester
12
+ * can sweep the four canonical request shapes from one rendered surface.
13
+ *
14
+ * Schemas filter only applies to the write path: `get` is hash-based and
15
+ * the wallet rejects a schemas filter on `viewer` grants. The checkbox
16
+ * auto-disables when the capability has no write component.
17
+ */
18
+ export declare const DataLakeRequestAccessPanel: React.FC<DataLakeRequestAccessPanelProps>;
19
+ //# sourceMappingURL=DataLakeRequestAccessPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataLakeRequestAccessPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeRequestAccessPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,eAAe,CAAA;AAMlE,OAAO,KAA4B,MAAM,OAAO,CAAA;AAShD,MAAM,WAAW,+BAAgC,SAAQ,UAAU;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAkDhF,CAAA"}
@@ -0,0 +1,41 @@
1
+ import type { InvokerPermission } from '@xyo-network/xl1-protocol-lib';
2
+ import React from 'react';
3
+ export interface PermissionsReviewDialogProps {
4
+ /** The error (if any) from the most recent re-request attempt. */
5
+ error?: Error;
6
+ /** Permissions already granted to this origin (from `client.permissions.getPermissions()`). */
7
+ granted: InvokerPermission[];
8
+ /** Close the dialog without taking any action. */
9
+ onClose: () => void;
10
+ /**
11
+ * Re-run `client.permissions.requestPermissions(...)` against the same
12
+ * batch the parent `RequestPermissionsButton` was configured with. The
13
+ * dialog doesn't try to compute what's "new" vs "already granted" —
14
+ * the wallet's request handler is the source of truth for that, and any
15
+ * inferred diff here would drift out of sync with caveat-merge rules
16
+ * upstream (e.g. data-lake's append-on-merge). Sending the original
17
+ * batch and letting the wallet decide keeps the behavior consistent.
18
+ */
19
+ onReRequest: () => void;
20
+ open: boolean;
21
+ /** True while the re-request call is in flight. */
22
+ requesting: boolean;
23
+ }
24
+ /**
25
+ * Read-only review of an origin's currently granted permissions, with a
26
+ * single "Re-request permissions" action that re-runs the parent's original
27
+ * `requestPermissions(...)` batch verbatim.
28
+ *
29
+ * Deliberately does **not** compute an "additional" diff. The wallet's
30
+ * request handler owns the merge rules (e.g. data-lake caveats append while
31
+ * `restrictReturnedAccounts` unions), and any client-side diff would drift
32
+ * out of sync the moment those rules change. Sending the original batch is
33
+ * also what the user expects: "I want to ask for the same thing again."
34
+ *
35
+ * The dialog is intentionally permissive about caveat shape: it special-cases
36
+ * the two caveats with structured payloads (`restrictReturnedAccounts`,
37
+ * `dataLakeAccess`) and falls through to a pretty-printed JSON dump for
38
+ * anything else, so newly-added caveat types render without code changes.
39
+ */
40
+ export declare const PermissionsReviewDialog: React.FC<PermissionsReviewDialogProps>;
41
+ //# sourceMappingURL=PermissionsReviewDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermissionsReviewDialog.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/PermissionsReviewDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,4BAA4B;IAC3C,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,+FAA+F;IAC/F,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,kDAAkD;IAClD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;;;;;;OAQG;IACH,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,mDAAmD;IACnD,UAAU,EAAE,OAAO,CAAA;CACpB;AAkID;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAmC1E,CAAA"}
@@ -6,10 +6,27 @@ export interface RequestPermissionsButtonProps extends StackProps {
6
6
  timeout?: number;
7
7
  }
8
8
  /**
9
- * Calls `client.permissions.requestPermissions(...)` with a batch of
10
- * `PermissionRequest` entries and renders the resulting `RequestedPermission[]`
11
- * acks (or any error). Designed for the Storybook real-wallet story so the
12
- * full popup-consent round-trip can be exercised against the live extension.
9
+ * Two-mode entry point for `client.permissions`:
10
+ *
11
+ * - If the origin has no permissions on file (fresh load, or just revoked),
12
+ * the button reads "Request permissions" and calls
13
+ * `client.permissions.requestPermissions(permissions)` on click, opening
14
+ * the wallet's consent popup.
15
+ * - If permissions already exist for this origin, the button flips to
16
+ * "Review permissions" and opens a read-only dialog enumerating each
17
+ * grant. The dialog also surfaces a "Re-request permissions" action
18
+ * that re-runs the same `permissions` batch verbatim — letting the
19
+ * wallet's request handler decide what merges with the existing grants
20
+ * (data-lake caveats append, account caveats union, etc.) instead of
21
+ * trying to compute a client-side diff that would drift out of sync.
22
+ *
23
+ * Successful requests don't render any inline ack list — the review dialog
24
+ * (reached via the button's "Review permissions" mode) is the single
25
+ * source of truth for what the origin has been granted.
26
+ *
27
+ * The initial existing-permissions fetch happens on mount via
28
+ * `client.permissions.getPermissions()`, then refreshes after every successful
29
+ * `requestPermissions` round-trip so the dialog reflects the new state.
13
30
  */
14
31
  export declare const RequestPermissionsButton: React.FC<RequestPermissionsButtonProps>;
15
32
  //# sourceMappingURL=RequestPermissionsButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestPermissionsButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/RequestPermissionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO/C,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,+BAA+B,CAAA;AAC3F,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAiF5E,CAAA"}
1
+ {"version":3,"file":"RequestPermissionsButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/RequestPermissionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/C,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,KAEN,MAAM,OAAO,CAAA;AAKd,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA+G5E,CAAA"}
@@ -8,5 +8,7 @@ export * from './DataLakeInsertPanel.tsx';
8
8
  export * from './DataLakeListButton.tsx';
9
9
  export * from './DataLakeOperationsPanel.tsx';
10
10
  export * from './DataLakeRequestAccessButton.tsx';
11
+ export * from './DataLakeRequestAccessPanel.tsx';
12
+ export * from './PermissionsReviewDialog.tsx';
11
13
  export * from './RequestPermissionsButton.tsx';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA"}