@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
@@ -876,51 +876,34 @@ var DataLakeListButton = ({ timeout, ...props }) => {
876
876
  // src/client/components/connected/DataLakeOperationsPanel.tsx
877
877
  import {
878
878
  Divider,
879
- Stack as Stack9,
880
- Typography as Typography9
879
+ Stack as Stack11,
880
+ Typography as Typography10
881
881
  } from "@mui/material";
882
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
883
- var DataLakeOperationsPanel = ({ timeout, ...props }) => {
884
- return /* @__PURE__ */ jsxs9(
885
- Stack9,
886
- {
887
- ...props,
888
- sx: {
889
- gap: 3,
890
- alignItems: "stretch",
891
- ...props.sx
892
- },
893
- children: [
894
- /* @__PURE__ */ jsxs9(Stack9, { sx: { gap: 1 }, children: [
895
- /* @__PURE__ */ jsx9(Typography9, { variant: "subtitle2", children: "List approved lakes" }),
896
- /* @__PURE__ */ jsx9(DataLakeListButton, { timeout })
897
- ] }),
898
- /* @__PURE__ */ jsx9(Divider, {}),
899
- /* @__PURE__ */ jsxs9(Stack9, { sx: { gap: 1 }, children: [
900
- /* @__PURE__ */ jsx9(Typography9, { variant: "subtitle2", children: "Insert payloads" }),
901
- /* @__PURE__ */ jsx9(DataLakeInsertPanel, { timeout })
902
- ] }),
903
- /* @__PURE__ */ jsx9(Divider, {}),
904
- /* @__PURE__ */ jsxs9(Stack9, { sx: { gap: 1 }, children: [
905
- /* @__PURE__ */ jsx9(Typography9, { variant: "subtitle2", children: "Get payloads by hash" }),
906
- /* @__PURE__ */ jsx9(DataLakeGetPanel, { timeout })
907
- ] })
908
- ]
909
- }
910
- );
911
- };
882
+
883
+ // src/client/components/connected/DataLakeRequestAccessPanel.tsx
884
+ import {
885
+ Checkbox,
886
+ FormControl as FormControl2,
887
+ FormControlLabel,
888
+ InputLabel as InputLabel2,
889
+ MenuItem as MenuItem2,
890
+ Select as Select2,
891
+ Stack as Stack10
892
+ } from "@mui/material";
893
+ import { asSchema } from "@xyo-network/sdk-js";
894
+ import { useMemo as useMemo3, useState as useState10 } from "react";
912
895
 
913
896
  // src/client/components/connected/DataLakeRequestAccessButton.tsx
914
897
  import {
915
898
  Alert as Alert7,
916
- Stack as Stack10,
917
- Typography as Typography10
899
+ Stack as Stack9,
900
+ Typography as Typography9
918
901
  } from "@mui/material";
919
902
  import { ButtonEx as ButtonEx6 } from "@xylabs/react-button";
920
903
  import { ErrorRender as ErrorRender6 } from "@xylabs/react-error";
921
904
  import { isDefined as isDefined8, isDefinedNotNull as isDefinedNotNull6 } from "@xylabs/sdk-js";
922
905
  import { useState as useState9 } from "react";
923
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
906
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
924
907
  var DataLakeRequestAccessButton = ({
925
908
  options,
926
909
  timeout,
@@ -951,8 +934,8 @@ var DataLakeRequestAccessButton = ({
951
934
  setRequesting(false);
952
935
  }
953
936
  };
954
- return /* @__PURE__ */ jsxs10(
955
- Stack10,
937
+ return /* @__PURE__ */ jsxs9(
938
+ Stack9,
956
939
  {
957
940
  ...props,
958
941
  sx: {
@@ -961,9 +944,9 @@ var DataLakeRequestAccessButton = ({
961
944
  ...props.sx
962
945
  },
963
946
  children: [
964
- timedout ? /* @__PURE__ */ jsx10(Alert7, { severity: "warning", children: "Wallet not detected." }) : null,
965
- isDefinedNotNull6(client) && !supported ? /* @__PURE__ */ jsx10(Alert7, { severity: "warning", children: "This wallet does not expose `xyo.client.dataLakes`." }) : null,
966
- /* @__PURE__ */ jsx10(
947
+ timedout ? /* @__PURE__ */ jsx9(Alert7, { severity: "warning", children: "Wallet not detected." }) : null,
948
+ isDefinedNotNull6(client) && !supported ? /* @__PURE__ */ jsx9(Alert7, { severity: "warning", children: "This wallet does not expose `xyo.client.dataLakes`." }) : null,
949
+ /* @__PURE__ */ jsx9(
967
950
  ButtonEx6,
968
951
  {
969
952
  variant: "contained",
@@ -974,32 +957,273 @@ var DataLakeRequestAccessButton = ({
974
957
  children: "Request data lake access"
975
958
  }
976
959
  ),
977
- isDefined8(granted) ? /* @__PURE__ */ jsxs10(Stack10, { sx: { gap: 0.5 }, children: [
978
- /* @__PURE__ */ jsx10(Typography10, { variant: "subtitle2", children: "Granted:" }),
979
- /* @__PURE__ */ jsxs10(Typography10, { variant: "body2", sx: { fontFamily: "monospace", wordBreak: "break-all" }, children: [
960
+ isDefined8(granted) ? /* @__PURE__ */ jsxs9(Stack9, { sx: { gap: 0.5 }, children: [
961
+ /* @__PURE__ */ jsx9(Typography9, { variant: "subtitle2", children: "Granted:" }),
962
+ /* @__PURE__ */ jsxs9(Typography9, { variant: "body2", sx: { fontFamily: "monospace", wordBreak: "break-all" }, children: [
980
963
  "id:",
981
964
  " ",
982
965
  granted.id
983
966
  ] }),
984
- /* @__PURE__ */ jsx10(Typography10, { variant: "body2", sx: { color: "text.secondary" }, children: "If you picked multiple lakes, call `list()` to enumerate all granted ids." })
967
+ /* @__PURE__ */ jsx9(Typography9, { variant: "body2", sx: { color: "text.secondary" }, children: "If you picked multiple lakes, call `list()` to enumerate all granted ids." })
985
968
  ] }) : null,
986
- /* @__PURE__ */ jsx10(ErrorRender6, { error: clientError ?? requestError, scope: "DataLakeRequestAccessButton" })
969
+ /* @__PURE__ */ jsx9(ErrorRender6, { error: clientError ?? requestError, scope: "DataLakeRequestAccessButton" })
987
970
  ]
988
971
  }
989
972
  );
990
973
  };
991
974
 
992
- // src/client/components/connected/RequestPermissionsButton.tsx
975
+ // src/client/components/connected/DataLakeRequestAccessPanel.tsx
976
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
977
+ var observationSchema = asSchema("network.xyo.observation.v2", true);
978
+ var locationSchema = asSchema("network.xyo.location", true);
979
+ var DataLakeRequestAccessPanel = ({ timeout, ...props }) => {
980
+ const [capability, setCapability] = useState10("read+write");
981
+ const [includeSchemas, setIncludeSchemas] = useState10(true);
982
+ const supportsSchemasFilter = capability !== "viewer";
983
+ const options = useMemo3(() => {
984
+ const cap = capability === "read+write" ? { read: true, write: true } : capability;
985
+ if (supportsSchemasFilter && includeSchemas) {
986
+ return { capability: cap, schemas: [observationSchema, locationSchema] };
987
+ }
988
+ return { capability: cap };
989
+ }, [capability, includeSchemas, supportsSchemasFilter]);
990
+ return /* @__PURE__ */ jsxs10(
991
+ Stack10,
992
+ {
993
+ ...props,
994
+ sx: {
995
+ gap: 2,
996
+ alignItems: "stretch",
997
+ ...props.sx
998
+ },
999
+ children: [
1000
+ /* @__PURE__ */ jsxs10(FormControl2, { size: "small", fullWidth: true, children: [
1001
+ /* @__PURE__ */ jsx10(InputLabel2, { children: "Capability" }),
1002
+ /* @__PURE__ */ jsxs10(
1003
+ Select2,
1004
+ {
1005
+ value: capability,
1006
+ label: "Capability",
1007
+ onChange: (event) => setCapability(event.target.value),
1008
+ children: [
1009
+ /* @__PURE__ */ jsx10(MenuItem2, { value: "viewer", children: "Read only (viewer)" }),
1010
+ /* @__PURE__ */ jsx10(MenuItem2, { value: "runner", children: "Write only (runner)" }),
1011
+ /* @__PURE__ */ jsx10(MenuItem2, { value: "read+write", children: "Read + Write" })
1012
+ ]
1013
+ }
1014
+ )
1015
+ ] }),
1016
+ /* @__PURE__ */ jsx10(
1017
+ FormControlLabel,
1018
+ {
1019
+ control: /* @__PURE__ */ jsx10(
1020
+ Checkbox,
1021
+ {
1022
+ checked: supportsSchemasFilter && includeSchemas,
1023
+ disabled: !supportsSchemasFilter,
1024
+ onChange: (event) => setIncludeSchemas(event.target.checked),
1025
+ size: "small"
1026
+ }
1027
+ ),
1028
+ label: "Include schemas filter (observation + location)"
1029
+ }
1030
+ ),
1031
+ /* @__PURE__ */ jsx10(DataLakeRequestAccessButton, { options, timeout })
1032
+ ]
1033
+ }
1034
+ );
1035
+ };
1036
+
1037
+ // src/client/components/connected/DataLakeOperationsPanel.tsx
1038
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1039
+ var DataLakeOperationsPanel = ({ timeout, ...props }) => {
1040
+ return /* @__PURE__ */ jsxs11(
1041
+ Stack11,
1042
+ {
1043
+ ...props,
1044
+ sx: {
1045
+ gap: 3,
1046
+ alignItems: "stretch",
1047
+ ...props.sx
1048
+ },
1049
+ children: [
1050
+ /* @__PURE__ */ jsxs11(Stack11, { sx: { gap: 1 }, children: [
1051
+ /* @__PURE__ */ jsx11(Typography10, { variant: "subtitle2", children: "Request data lake access" }),
1052
+ /* @__PURE__ */ jsx11(DataLakeRequestAccessPanel, { timeout })
1053
+ ] }),
1054
+ /* @__PURE__ */ jsx11(Divider, {}),
1055
+ /* @__PURE__ */ jsxs11(Stack11, { sx: { gap: 1 }, children: [
1056
+ /* @__PURE__ */ jsx11(Typography10, { variant: "subtitle2", children: "List approved lakes" }),
1057
+ /* @__PURE__ */ jsx11(DataLakeListButton, { timeout })
1058
+ ] }),
1059
+ /* @__PURE__ */ jsx11(Divider, {}),
1060
+ /* @__PURE__ */ jsxs11(Stack11, { sx: { gap: 1 }, children: [
1061
+ /* @__PURE__ */ jsx11(Typography10, { variant: "subtitle2", children: "Insert payloads" }),
1062
+ /* @__PURE__ */ jsx11(DataLakeInsertPanel, { timeout })
1063
+ ] }),
1064
+ /* @__PURE__ */ jsx11(Divider, {}),
1065
+ /* @__PURE__ */ jsxs11(Stack11, { sx: { gap: 1 }, children: [
1066
+ /* @__PURE__ */ jsx11(Typography10, { variant: "subtitle2", children: "Get payloads by hash" }),
1067
+ /* @__PURE__ */ jsx11(DataLakeGetPanel, { timeout })
1068
+ ] })
1069
+ ]
1070
+ }
1071
+ );
1072
+ };
1073
+
1074
+ // src/client/components/connected/PermissionsReviewDialog.tsx
993
1075
  import {
994
1076
  Alert as Alert8,
995
- Stack as Stack11,
1077
+ Box,
1078
+ Chip,
1079
+ Dialog,
1080
+ DialogActions,
1081
+ DialogContent,
1082
+ DialogTitle,
1083
+ Divider as Divider2,
1084
+ Stack as Stack12,
996
1085
  Typography as Typography11
997
1086
  } from "@mui/material";
998
1087
  import { ButtonEx as ButtonEx7 } from "@xylabs/react-button";
999
1088
  import { ErrorRender as ErrorRender7 } from "@xylabs/react-error";
1000
- import { isDefined as isDefined9, isDefinedNotNull as isDefinedNotNull7 } from "@xylabs/sdk-js";
1001
- import { useState as useState10 } from "react";
1002
- import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
1089
+ import { isDefined as isDefined9 } from "@xylabs/sdk-js";
1090
+ import React10 from "react";
1091
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1092
+ var renderCaveatValue = (caveat) => {
1093
+ if (caveat.type === "restrictReturnedAccounts" && Array.isArray(caveat.value)) {
1094
+ if (caveat.value.length === 0) {
1095
+ return /* @__PURE__ */ jsx12(Typography11, { variant: "caption", sx: { color: "text.secondary" }, children: "(no address restriction \u2014 every selected account is returned)" });
1096
+ }
1097
+ return /* @__PURE__ */ jsx12(Stack12, { direction: "row", sx: { flexWrap: "wrap", gap: 0.5 }, children: caveat.value.map((address) => /* @__PURE__ */ jsx12(
1098
+ Chip,
1099
+ {
1100
+ label: String(address),
1101
+ size: "small",
1102
+ sx: { fontFamily: "monospace" }
1103
+ },
1104
+ String(address)
1105
+ )) });
1106
+ }
1107
+ if (caveat.type === "dataLakeAccess" && typeof caveat.value === "object" && caveat.value !== null) {
1108
+ const value = caveat.value;
1109
+ return /* @__PURE__ */ jsxs12(Stack12, { sx: { gap: 0.5 }, children: [
1110
+ isDefined9(value.perOriginId) ? /* @__PURE__ */ jsxs12(Stack12, { direction: "row", sx: { alignItems: "center", gap: 1 }, children: [
1111
+ /* @__PURE__ */ jsx12(Typography11, { variant: "caption", sx: { color: "text.secondary" }, children: "id:" }),
1112
+ /* @__PURE__ */ jsx12(Typography11, { variant: "body2", sx: { fontFamily: "monospace", wordBreak: "break-all" }, children: value.perOriginId })
1113
+ ] }) : null,
1114
+ isDefined9(value.narrowedSchemas) && value.narrowedSchemas.length > 0 ? /* @__PURE__ */ jsxs12(
1115
+ Stack12,
1116
+ {
1117
+ direction: "row",
1118
+ sx: {
1119
+ alignItems: "center",
1120
+ flexWrap: "wrap",
1121
+ gap: 0.5
1122
+ },
1123
+ children: [
1124
+ /* @__PURE__ */ jsx12(Typography11, { variant: "caption", sx: { color: "text.secondary" }, children: "schemas:" }),
1125
+ value.narrowedSchemas.map((schema) => /* @__PURE__ */ jsx12(
1126
+ Chip,
1127
+ {
1128
+ label: schema,
1129
+ size: "small",
1130
+ variant: "outlined"
1131
+ },
1132
+ schema
1133
+ ))
1134
+ ]
1135
+ }
1136
+ ) : null
1137
+ ] });
1138
+ }
1139
+ return /* @__PURE__ */ jsx12(
1140
+ Typography11,
1141
+ {
1142
+ component: "pre",
1143
+ variant: "body2",
1144
+ sx: {
1145
+ fontFamily: "monospace",
1146
+ m: 0,
1147
+ whiteSpace: "pre-wrap",
1148
+ wordBreak: "break-all"
1149
+ },
1150
+ children: JSON.stringify(caveat.value, null, 2)
1151
+ }
1152
+ );
1153
+ };
1154
+ var renderPermission = (permission) => {
1155
+ const caveats = permission.caveats ?? [];
1156
+ return /* @__PURE__ */ jsxs12(Stack12, { sx: { gap: 1 }, children: [
1157
+ /* @__PURE__ */ jsxs12(
1158
+ Stack12,
1159
+ {
1160
+ direction: "row",
1161
+ sx: {
1162
+ alignItems: "center",
1163
+ flexWrap: "wrap",
1164
+ gap: 1
1165
+ },
1166
+ children: [
1167
+ /* @__PURE__ */ jsx12(Typography11, { variant: "subtitle2", sx: { fontFamily: "monospace" }, children: permission.parentCapability }),
1168
+ isDefined9(permission.date) ? /* @__PURE__ */ jsxs12(Typography11, { variant: "caption", sx: { color: "text.secondary" }, children: [
1169
+ "granted",
1170
+ " ",
1171
+ new Date(permission.date).toLocaleString()
1172
+ ] }) : null
1173
+ ]
1174
+ }
1175
+ ),
1176
+ caveats.length === 0 ? /* @__PURE__ */ jsx12(Typography11, { variant: "caption", sx: { color: "text.secondary" }, children: "(no caveats)" }) : /* @__PURE__ */ jsx12(Stack12, { sx: { gap: 1, pl: 1 }, children: caveats.map((caveat) => /* @__PURE__ */ jsxs12(Stack12, { sx: { gap: 0.5 }, children: [
1177
+ /* @__PURE__ */ jsx12(Chip, { label: caveat.type, size: "small", sx: { alignSelf: "flex-start" } }),
1178
+ /* @__PURE__ */ jsx12(Box, { sx: { pl: 1 }, children: renderCaveatValue(caveat) })
1179
+ ] }, caveat.type)) })
1180
+ ] });
1181
+ };
1182
+ var PermissionsReviewDialog = ({
1183
+ granted,
1184
+ onClose,
1185
+ onReRequest,
1186
+ open,
1187
+ requesting,
1188
+ error
1189
+ }) => {
1190
+ return /* @__PURE__ */ jsxs12(Dialog, { open, onClose, fullWidth: true, maxWidth: "sm", children: [
1191
+ /* @__PURE__ */ jsx12(DialogTitle, { children: "Granted permissions" }),
1192
+ /* @__PURE__ */ jsx12(DialogContent, { dividers: true, children: /* @__PURE__ */ jsxs12(Stack12, { sx: { gap: 2 }, children: [
1193
+ granted.length === 0 ? /* @__PURE__ */ jsx12(Alert8, { severity: "info", children: "No permissions are currently granted to this origin." }) : granted.map((permission, index) => /* @__PURE__ */ jsxs12(React10.Fragment, { children: [
1194
+ index > 0 ? /* @__PURE__ */ jsx12(Divider2, {}) : null,
1195
+ renderPermission(permission)
1196
+ ] }, permission.parentCapability)),
1197
+ /* @__PURE__ */ jsx12(ErrorRender7, { error, scope: "PermissionsReviewDialog" })
1198
+ ] }) }),
1199
+ /* @__PURE__ */ jsxs12(DialogActions, { children: [
1200
+ /* @__PURE__ */ jsx12(ButtonEx7, { variant: "text", size: "small", onClick: onClose, children: "Close" }),
1201
+ /* @__PURE__ */ jsx12(
1202
+ ButtonEx7,
1203
+ {
1204
+ variant: "contained",
1205
+ size: "small",
1206
+ disabled: requesting,
1207
+ busy: requesting,
1208
+ onClick: onReRequest,
1209
+ children: "Re-request permissions"
1210
+ }
1211
+ )
1212
+ ] })
1213
+ ] });
1214
+ };
1215
+
1216
+ // src/client/components/connected/RequestPermissionsButton.tsx
1217
+ import { Alert as Alert9, Stack as Stack13 } from "@mui/material";
1218
+ import { ButtonEx as ButtonEx8 } from "@xylabs/react-button";
1219
+ import { ErrorRender as ErrorRender8 } from "@xylabs/react-error";
1220
+ import { isDefined as isDefined10, isDefinedNotNull as isDefinedNotNull7 } from "@xylabs/sdk-js";
1221
+ import {
1222
+ useCallback as useCallback3,
1223
+ useEffect as useEffect4,
1224
+ useState as useState11
1225
+ } from "react";
1226
+ import { Fragment, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1003
1227
  var RequestPermissionsButton = ({
1004
1228
  permissions,
1005
1229
  timeout,
@@ -1011,25 +1235,51 @@ var RequestPermissionsButton = ({
1011
1235
  isLoading,
1012
1236
  timedout
1013
1237
  } = useClientFromWallet(timeout);
1014
- const [acks, setAcks] = useState10();
1015
- const [requestError, setRequestError] = useState10();
1016
- const [requesting, setRequesting] = useState10(false);
1017
- const handleClick = async () => {
1018
- if (!isDefinedNotNull7(client)) return;
1238
+ const [granted, setGranted] = useState11();
1239
+ const [fetchError, setFetchError] = useState11();
1240
+ const [requestError, setRequestError] = useState11();
1241
+ const [requesting, setRequesting] = useState11(false);
1242
+ const [dialogOpen, setDialogOpen] = useState11(false);
1243
+ const permissionsApi = client?.permissions;
1244
+ const refreshGranted = useCallback3(async () => {
1245
+ if (!isDefinedNotNull7(permissionsApi)) return;
1246
+ setFetchError(void 0);
1247
+ try {
1248
+ const result = await permissionsApi.getPermissions();
1249
+ setGranted(result ?? []);
1250
+ } catch (e) {
1251
+ setGranted([]);
1252
+ setFetchError(e);
1253
+ }
1254
+ }, [permissionsApi]);
1255
+ useEffect4(() => {
1256
+ if (isDefinedNotNull7(permissionsApi) && granted === void 0) {
1257
+ void refreshGranted();
1258
+ }
1259
+ }, [permissionsApi, granted, refreshGranted]);
1260
+ const requestPermissions = useCallback3(async () => {
1261
+ if (!isDefinedNotNull7(permissionsApi)) return;
1019
1262
  setRequestError(void 0);
1020
- setAcks(void 0);
1021
1263
  setRequesting(true);
1022
1264
  try {
1023
- const result = await client.permissions.requestPermissions(permissions);
1024
- setAcks(result);
1265
+ await permissionsApi.requestPermissions(permissions);
1266
+ void refreshGranted();
1025
1267
  } catch (e) {
1026
1268
  setRequestError(e);
1027
1269
  } finally {
1028
1270
  setRequesting(false);
1029
1271
  }
1272
+ }, [permissionsApi, permissions, refreshGranted]);
1273
+ const hasGranted = isDefined10(granted) && granted.length > 0;
1274
+ const handleClick = () => {
1275
+ if (hasGranted) {
1276
+ setDialogOpen(true);
1277
+ return;
1278
+ }
1279
+ void requestPermissions();
1030
1280
  };
1031
- return /* @__PURE__ */ jsxs11(
1032
- Stack11,
1281
+ return /* @__PURE__ */ jsxs13(
1282
+ Stack13,
1033
1283
  {
1034
1284
  ...props,
1035
1285
  sx: {
@@ -1038,46 +1288,37 @@ var RequestPermissionsButton = ({
1038
1288
  ...props.sx
1039
1289
  },
1040
1290
  children: [
1041
- timedout ? /* @__PURE__ */ jsx11(Alert8, { severity: "warning", children: "Wallet not detected." }) : null,
1042
- /* @__PURE__ */ jsxs11(
1043
- ButtonEx7,
1291
+ timedout ? /* @__PURE__ */ jsx13(Alert9, { severity: "warning", children: "Wallet not detected." }) : null,
1292
+ /* @__PURE__ */ jsx13(
1293
+ ButtonEx8,
1044
1294
  {
1045
1295
  variant: "contained",
1046
1296
  size: "small",
1047
- disabled: !isDefinedNotNull7(client) || requesting,
1297
+ disabled: !isDefinedNotNull7(permissionsApi) || requesting,
1048
1298
  busy: isLoading || requesting,
1049
- onClick: () => void handleClick(),
1050
- children: [
1299
+ onClick: handleClick,
1300
+ children: hasGranted ? "Review permissions" : /* @__PURE__ */ jsxs13(Fragment, { children: [
1051
1301
  "Request",
1052
1302
  " ",
1053
1303
  permissions.length,
1054
1304
  " ",
1055
1305
  "permission",
1056
1306
  permissions.length === 1 ? "" : "s"
1057
- ]
1307
+ ] })
1058
1308
  }
1059
1309
  ),
1060
- isDefined9(acks) ? /* @__PURE__ */ jsxs11(Stack11, { sx: { gap: 0.5 }, children: [
1061
- /* @__PURE__ */ jsx11(Typography11, { variant: "subtitle2", children: "Granted:" }),
1062
- acks.map((ack) => /* @__PURE__ */ jsx11(
1063
- Typography11,
1064
- {
1065
- variant: "body2",
1066
- sx: { fontFamily: "monospace" },
1067
- children: ack.parentCapability
1068
- },
1069
- `${ack.parentCapability}`
1070
- )),
1071
- acks.length === 0 ? /* @__PURE__ */ jsx11(
1072
- Typography11,
1073
- {
1074
- variant: "body2",
1075
- sx: { color: "text.secondary" },
1076
- children: "(empty \u2014 wallet returned no acks)"
1077
- }
1078
- ) : null
1079
- ] }) : null,
1080
- /* @__PURE__ */ jsx11(ErrorRender7, { error: clientError ?? requestError, scope: "RequestPermissionsButton" })
1310
+ /* @__PURE__ */ jsx13(ErrorRender8, { error: clientError ?? fetchError ?? requestError, scope: "RequestPermissionsButton" }),
1311
+ /* @__PURE__ */ jsx13(
1312
+ PermissionsReviewDialog,
1313
+ {
1314
+ open: dialogOpen,
1315
+ onClose: () => setDialogOpen(false),
1316
+ granted: granted ?? [],
1317
+ onReRequest: () => void requestPermissions(),
1318
+ requesting,
1319
+ error: requestError
1320
+ }
1321
+ )
1081
1322
  ]
1082
1323
  }
1083
1324
  );
@@ -1095,14 +1336,14 @@ var InPageGatewaysContext = createContextEx2();
1095
1336
  import { DefaultNetworks as DefaultNetworks2 } from "@xyo-network/xl1-sdk";
1096
1337
  import {
1097
1338
  startTransition,
1098
- useCallback as useCallback3,
1099
- useEffect as useEffect4,
1100
- useMemo as useMemo3,
1101
- useState as useState11
1339
+ useCallback as useCallback4,
1340
+ useEffect as useEffect5,
1341
+ useMemo as useMemo4,
1342
+ useState as useState12
1102
1343
  } from "react";
1103
1344
 
1104
1345
  // src/client/context/in-page/lib/buildGateway.ts
1105
- import { assertEx as assertEx2, isDefined as isDefined10 } from "@xylabs/sdk-js";
1346
+ import { assertEx as assertEx2, isDefined as isDefined11 } from "@xylabs/sdk-js";
1106
1347
  import {
1107
1348
  basicRemoteRunnerLocator,
1108
1349
  basicRemoteViewerLocator,
@@ -1118,17 +1359,17 @@ var buildGateway = async (gatewayName, signerTransport) => {
1118
1359
  url: `${resolvedNetwork.url}/rpc`
1119
1360
  }
1120
1361
  };
1121
- const locator = isDefined10(signerTransport) ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport) : await basicRemoteViewerLocator(gatewayName, remoteConfig);
1362
+ const locator = isDefined11(signerTransport) ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport) : await basicRemoteViewerLocator(gatewayName, remoteConfig);
1122
1363
  return await locator.getInstance(XyoGatewayMoniker);
1123
1364
  };
1124
1365
 
1125
1366
  // src/client/context/in-page/Provider.tsx
1126
- import { jsx as jsx12 } from "react/jsx-runtime";
1367
+ import { jsx as jsx14 } from "react/jsx-runtime";
1127
1368
  var InPageGatewaysProvider = ({ signerTransport, children }) => {
1128
- const [gateways, setGateways] = useState11({});
1129
- const [errors, setErrors] = useState11({});
1130
- const [previousSignerTransport, setPreviousSignerTransport] = useState11(signerTransport);
1131
- const clearAll = useCallback3(() => {
1369
+ const [gateways, setGateways] = useState12({});
1370
+ const [errors, setErrors] = useState12({});
1371
+ const [previousSignerTransport, setPreviousSignerTransport] = useState12(signerTransport);
1372
+ const clearAll = useCallback4(() => {
1132
1373
  setGateways({});
1133
1374
  setErrors({});
1134
1375
  }, []);
@@ -1136,7 +1377,7 @@ var InPageGatewaysProvider = ({ signerTransport, children }) => {
1136
1377
  clearAll();
1137
1378
  setPreviousSignerTransport(signerTransport);
1138
1379
  }
1139
- useEffect4(() => {
1380
+ useEffect5(() => {
1140
1381
  let cancelled = false;
1141
1382
  const buildAll = async () => {
1142
1383
  const results = await Promise.allSettled(
@@ -1166,7 +1407,7 @@ var InPageGatewaysProvider = ({ signerTransport, children }) => {
1166
1407
  cancelled = true;
1167
1408
  };
1168
1409
  }, [signerTransport]);
1169
- const value = useMemo3(() => {
1410
+ const value = useMemo4(() => {
1170
1411
  const value2 = {
1171
1412
  clearAll,
1172
1413
  errors,
@@ -1175,7 +1416,7 @@ var InPageGatewaysProvider = ({ signerTransport, children }) => {
1175
1416
  };
1176
1417
  return value2;
1177
1418
  }, [clearAll, errors, gateways]);
1178
- return /* @__PURE__ */ jsx12(InPageGatewaysContext, { value, children });
1419
+ return /* @__PURE__ */ jsx14(InPageGatewaysContext, { value, children });
1179
1420
  };
1180
1421
 
1181
1422
  // src/client/context/in-page/useProvidedInPageGateways.ts
@@ -1183,10 +1424,10 @@ import { useContextEx } from "@xylabs/react-shared";
1183
1424
  var useProvidedInPageGateways = (required = true) => useContextEx(InPageGatewaysContext, "InPageGateways", required);
1184
1425
 
1185
1426
  // src/client/context/providers/GatewayProvider.tsx
1186
- import { ErrorRender as ErrorRender8 } from "@xylabs/react-error";
1427
+ import { ErrorRender as ErrorRender9 } from "@xylabs/react-error";
1187
1428
  import { isDefinedNotNull as isDefinedNotNull8, isNull as isNull2 } from "@xylabs/sdk-js";
1188
- import { useMemo as useMemo4 } from "react";
1189
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1429
+ import { useMemo as useMemo5 } from "react";
1430
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1190
1431
  var GatewayProvider = ({ gatewayName, children }) => {
1191
1432
  const {
1192
1433
  gateway: gatewayFromWallet,
@@ -1199,7 +1440,7 @@ var GatewayProvider = ({ gatewayName, children }) => {
1199
1440
  } = useProvidedInPageGateways(true);
1200
1441
  const gatewayFromConfig = gatewayName ? allGateways[gatewayName] : void 0;
1201
1442
  const gatewayFromConfigError = gatewayName ? allGatewayErrors[gatewayName] : void 0;
1202
- const { defaultGateway, gateways } = useMemo4(() => {
1443
+ const { defaultGateway, gateways } = useMemo5(() => {
1203
1444
  if (isNull2(gatewayFromWallet)) {
1204
1445
  return {
1205
1446
  defaultGateway: gatewayFromConfig,
@@ -1225,7 +1466,7 @@ var GatewayProvider = ({ gatewayName, children }) => {
1225
1466
  }
1226
1467
  };
1227
1468
  }, [gatewayFromConfig, gatewayFromWallet]);
1228
- const value = useMemo4(() => {
1469
+ const value = useMemo5(() => {
1229
1470
  const value2 = {
1230
1471
  defaultGateway,
1231
1472
  error: gatewayFromWalletError ?? gatewayFromConfigError,
@@ -1241,22 +1482,22 @@ var GatewayProvider = ({ gatewayName, children }) => {
1241
1482
  gateways,
1242
1483
  clearAll
1243
1484
  ]);
1244
- return /* @__PURE__ */ jsxs12(GatewayContext, { value, children: [
1245
- /* @__PURE__ */ jsx13(ErrorRender8, { error: gatewayFromConfigError }),
1485
+ return /* @__PURE__ */ jsxs14(GatewayContext, { value, children: [
1486
+ /* @__PURE__ */ jsx15(ErrorRender9, { error: gatewayFromConfigError }),
1246
1487
  children
1247
1488
  ] });
1248
1489
  };
1249
1490
 
1250
1491
  // src/client/context/providers/WalletGatewayProvider.tsx
1251
- import { ErrorRender as ErrorRender9 } from "@xylabs/react-error";
1252
- import { useMemo as useMemo5 } from "react";
1253
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1492
+ import { ErrorRender as ErrorRender10 } from "@xylabs/react-error";
1493
+ import { useMemo as useMemo6 } from "react";
1494
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1254
1495
  var WalletGatewayProvider = ({ gatewayName, children }) => {
1255
1496
  const {
1256
1497
  gateway: gatewayFromWallet,
1257
1498
  error: gatewayFromWalletError
1258
1499
  } = useGatewayFromWallet(gatewayName);
1259
- const { defaultGateway, gateways } = useMemo5(() => {
1500
+ const { defaultGateway, gateways } = useMemo6(() => {
1260
1501
  return {
1261
1502
  defaultGateway: gatewayFromWallet,
1262
1503
  gateways: {
@@ -1265,7 +1506,7 @@ var WalletGatewayProvider = ({ gatewayName, children }) => {
1265
1506
  }
1266
1507
  };
1267
1508
  }, [gatewayFromWallet]);
1268
- const value = useMemo5(() => {
1509
+ const value = useMemo6(() => {
1269
1510
  const value2 = {
1270
1511
  defaultGateway,
1271
1512
  error: gatewayFromWalletError,
@@ -1278,8 +1519,8 @@ var WalletGatewayProvider = ({ gatewayName, children }) => {
1278
1519
  gatewayFromWalletError,
1279
1520
  gateways
1280
1521
  ]);
1281
- return /* @__PURE__ */ jsxs13(GatewayContext, { value, children: [
1282
- /* @__PURE__ */ jsx14(ErrorRender9, { error: gatewayFromWalletError }),
1522
+ return /* @__PURE__ */ jsxs15(GatewayContext, { value, children: [
1523
+ /* @__PURE__ */ jsx16(ErrorRender10, { error: gatewayFromWalletError }),
1283
1524
  children
1284
1525
  ] });
1285
1526
  };
@@ -1298,12 +1539,8 @@ var isUninitializedXyoGlobal = (obj) => {
1298
1539
  };
1299
1540
 
1300
1541
  // src/shared/components/menu-item/ActiveMenuItem.tsx
1301
- import {
1302
- MenuItem as MenuItem2,
1303
- styled,
1304
- useTheme
1305
- } from "@mui/material";
1306
- import { jsx as jsx15 } from "react/jsx-runtime";
1542
+ import { MenuItem as MenuItem3, useTheme } from "@mui/material";
1543
+ import { jsx as jsx17 } from "react/jsx-runtime";
1307
1544
  var ActiveMenuItem = ({
1308
1545
  active,
1309
1546
  children,
@@ -1311,11 +1548,17 @@ var ActiveMenuItem = ({
1311
1548
  ...props
1312
1549
  }) => {
1313
1550
  const theme = useTheme();
1314
- return /* @__PURE__ */ jsx15(
1315
- StyledMenuItem,
1551
+ return /* @__PURE__ */ jsx17(
1552
+ MenuItem3,
1316
1553
  {
1317
1554
  disableRipple: true,
1318
1555
  sx: {
1556
+ "display": "flex-inline",
1557
+ "flexDirection": "row",
1558
+ "gap": 1,
1559
+ "padding": 0,
1560
+ "paddingLeft": 1,
1561
+ "marginBottom": 1,
1319
1562
  // left border color and background color for active state
1320
1563
  "borderLeft": `5px solid ${active ? theme.vars.palette.secondary.light : "transparent"}`,
1321
1564
  "backgroundColor": active ? theme.vars.palette.secondary.dark : "transparent",
@@ -1334,26 +1577,17 @@ var ActiveMenuItem = ({
1334
1577
  }
1335
1578
  );
1336
1579
  };
1337
- var StyledMenuItem = styled(MenuItem2, { name: "StyledMenuItem" })(({ theme }) => ({
1338
- display: "flex-inline",
1339
- flexDirection: "row",
1340
- gap: theme.spacing(1),
1341
- padding: 0,
1342
- paddingLeft: theme.spacing(1),
1343
- marginBottom: theme.spacing(1)
1344
- }));
1345
1580
 
1346
1581
  // src/shared/components/stack/DetailsStack.tsx
1347
1582
  import {
1348
- Stack as Stack12,
1349
- styled as styled2,
1583
+ Stack as Stack14,
1350
1584
  Tooltip as Tooltip2,
1351
1585
  Typography as Typography12,
1352
1586
  useTheme as useTheme2
1353
1587
  } from "@mui/material";
1354
- import { isDefined as isDefined11 } from "@xylabs/sdk-js";
1355
- import { useMemo as useMemo6 } from "react";
1356
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1588
+ import { isDefined as isDefined12 } from "@xylabs/sdk-js";
1589
+ import { useMemo as useMemo7 } from "react";
1590
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
1357
1591
  var isComponentType = (value) => typeof value === "function" || typeof value === "object" && value !== null && ("$$typeof" in value || "render" in value);
1358
1592
  var DetailsStack = ({
1359
1593
  IconComponent,
@@ -1363,9 +1597,9 @@ var DetailsStack = ({
1363
1597
  ...props
1364
1598
  }) => {
1365
1599
  const theme = useTheme2();
1366
- const hasTooltip = isDefined11(tooltipTitle);
1367
- const resolvedIconComponent = useMemo6(() => {
1368
- return isComponentType(IconComponent) ? /* @__PURE__ */ jsx16(
1600
+ const hasTooltip = isDefined12(tooltipTitle);
1601
+ const resolvedIconComponent = useMemo7(() => {
1602
+ return isComponentType(IconComponent) ? /* @__PURE__ */ jsx18(
1369
1603
  IconComponent,
1370
1604
  {
1371
1605
  style: {
@@ -1377,8 +1611,8 @@ var DetailsStack = ({
1377
1611
  }
1378
1612
  ) : IconComponent ?? null;
1379
1613
  }, [IconComponent, theme]);
1380
- return /* @__PURE__ */ jsxs14(
1381
- Stack12,
1614
+ return /* @__PURE__ */ jsxs16(
1615
+ Stack14,
1382
1616
  {
1383
1617
  direction: "column",
1384
1618
  ...props,
@@ -1389,30 +1623,35 @@ var DetailsStack = ({
1389
1623
  ...props.sx
1390
1624
  },
1391
1625
  children: [
1392
- /* @__PURE__ */ jsxs14(SectionHeadingTypography, { children: [
1393
- heading,
1394
- hasTooltip ? /* @__PURE__ */ jsx16(Tooltip2, { title: tooltipTitle, children: /* @__PURE__ */ jsx16("span", { children: resolvedIconComponent }) }) : resolvedIconComponent
1395
- ] }),
1626
+ /* @__PURE__ */ jsxs16(
1627
+ Typography12,
1628
+ {
1629
+ sx: {
1630
+ display: "flex",
1631
+ fontFamily: "monospace",
1632
+ lineHeight: 1,
1633
+ marginBottom: 1.5
1634
+ },
1635
+ children: [
1636
+ heading,
1637
+ hasTooltip ? /* @__PURE__ */ jsx18(Tooltip2, { title: tooltipTitle, children: /* @__PURE__ */ jsx18("span", { children: resolvedIconComponent }) }) : resolvedIconComponent
1638
+ ]
1639
+ }
1640
+ ),
1396
1641
  children
1397
1642
  ]
1398
1643
  }
1399
1644
  );
1400
1645
  };
1401
- var SectionHeadingTypography = styled2(Typography12, { name: "SectionHeadingTypography" })(({ theme }) => ({
1402
- display: "flex",
1403
- fontFamily: "monospace",
1404
- lineHeight: 1,
1405
- marginBottom: theme.spacing(1.5)
1406
- }));
1407
1646
 
1408
1647
  // src/shared/components/stack/LabelValueStack.tsx
1409
1648
  import {
1410
- Stack as Stack13,
1649
+ Stack as Stack15,
1411
1650
  Typography as Typography13,
1412
1651
  useTheme as useTheme3
1413
1652
  } from "@mui/material";
1414
1653
  import { ellipsize, isAddress } from "@xylabs/sdk-js";
1415
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
1654
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
1416
1655
  var LabelValueStack = ({
1417
1656
  labels,
1418
1657
  values,
@@ -1425,8 +1664,8 @@ var LabelValueStack = ({
1425
1664
  }
1426
1665
  return value;
1427
1666
  };
1428
- return /* @__PURE__ */ jsxs15(
1429
- Stack13,
1667
+ return /* @__PURE__ */ jsxs17(
1668
+ Stack15,
1430
1669
  {
1431
1670
  ...props,
1432
1671
  sx: {
@@ -1435,7 +1674,7 @@ var LabelValueStack = ({
1435
1674
  ...props.sx
1436
1675
  },
1437
1676
  children: [
1438
- /* @__PURE__ */ jsx17(Stack13, { children: labels.map((label) => /* @__PURE__ */ jsxs15(
1677
+ /* @__PURE__ */ jsx19(Stack15, { children: labels.map((label) => /* @__PURE__ */ jsxs17(
1439
1678
  Typography13,
1440
1679
  {
1441
1680
  variant: "body2",
@@ -1451,14 +1690,14 @@ var LabelValueStack = ({
1451
1690
  },
1452
1691
  label
1453
1692
  )) }),
1454
- /* @__PURE__ */ jsx17(
1455
- Stack13,
1693
+ /* @__PURE__ */ jsx19(
1694
+ Stack15,
1456
1695
  {
1457
1696
  sx: {
1458
1697
  alignItems: "end",
1459
1698
  flexGrow: 1
1460
1699
  },
1461
- children: values.map((value, index) => /* @__PURE__ */ jsx17(
1700
+ children: values.map((value, index) => /* @__PURE__ */ jsx19(
1462
1701
  Typography13,
1463
1702
  {
1464
1703
  title: value,
@@ -1482,15 +1721,15 @@ var LabelValueStack = ({
1482
1721
  };
1483
1722
 
1484
1723
  // src/shared/decorators/IframeWalletWarningDecorator.tsx
1485
- import { Alert as Alert9, Stack as Stack14 } from "@mui/material";
1486
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
1724
+ import { Alert as Alert10, Stack as Stack16 } from "@mui/material";
1725
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
1487
1726
  var inIframe = globalThis.self !== window.top;
1488
1727
  var IframeWalletWarningDecorator = (Story, args) => {
1489
1728
  const hasXyoGlobal = isXyoGlobal(globalThis.xyo);
1490
- return /* @__PURE__ */ jsxs16(Stack14, { sx: { gap: 2 }, children: [
1491
- inIframe ? /* @__PURE__ */ jsx18(Alert9, { severity: "warning", children: "This story is running in an iframe. Please run it in a standalone browser window to test the wallet extension." }) : null,
1492
- hasXyoGlobal ? null : /* @__PURE__ */ jsx18(Alert9, { severity: "warning", children: "No wallet extension found. Please install the Xyo Wallet Chrome Extension." }),
1493
- /* @__PURE__ */ jsx18(Story, { ...args })
1729
+ return /* @__PURE__ */ jsxs18(Stack16, { sx: { gap: 2 }, children: [
1730
+ inIframe ? /* @__PURE__ */ jsx20(Alert10, { severity: "warning", children: "This story is running in an iframe. Please run it in a standalone browser window to test the wallet extension." }) : null,
1731
+ hasXyoGlobal ? null : /* @__PURE__ */ jsx20(Alert10, { severity: "warning", children: "No wallet extension found. Please install the Xyo Wallet Chrome Extension." }),
1732
+ /* @__PURE__ */ jsx20(Story, { ...args })
1494
1733
  ] });
1495
1734
  };
1496
1735
  export {
@@ -1505,6 +1744,7 @@ export {
1505
1744
  DataLakeListButton,
1506
1745
  DataLakeOperationsPanel,
1507
1746
  DataLakeRequestAccessButton,
1747
+ DataLakeRequestAccessPanel,
1508
1748
  DetailsStack,
1509
1749
  GatewayContext,
1510
1750
  GatewayProvider,
@@ -1512,6 +1752,7 @@ export {
1512
1752
  InPageGatewaysContext,
1513
1753
  InPageGatewaysProvider,
1514
1754
  LabelValueStack,
1755
+ PermissionsReviewDialog,
1515
1756
  RequestPermissionsButton,
1516
1757
  WalletGatewayProvider,
1517
1758
  findCaveat,