@xyo-network/react-payload-raw-info 2.81.9 → 2.82.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/dist/browser/components/Button/RawInfoButton.d.cts +3 -3
- package/dist/browser/components/Button/RawInfoButton.d.cts.map +1 -1
- package/dist/browser/components/Button/RawInfoButton.d.mts +3 -3
- package/dist/browser/components/Button/RawInfoButton.d.mts.map +1 -1
- package/dist/browser/components/Button/RawInfoButton.d.ts +3 -3
- package/dist/browser/components/Button/RawInfoButton.d.ts.map +1 -1
- package/dist/browser/components/Button/RawInfoIconButton.d.cts +4 -4
- package/dist/browser/components/Button/RawInfoIconButton.d.cts.map +1 -1
- package/dist/browser/components/Button/RawInfoIconButton.d.mts +4 -4
- package/dist/browser/components/Button/RawInfoIconButton.d.mts.map +1 -1
- package/dist/browser/components/Button/RawInfoIconButton.d.ts +4 -4
- package/dist/browser/components/Button/RawInfoIconButton.d.ts.map +1 -1
- package/dist/browser/components/Button/index.d.cts +2 -2
- package/dist/browser/components/Button/index.d.cts.map +1 -1
- package/dist/browser/components/Button/index.d.mts +2 -2
- package/dist/browser/components/Button/index.d.mts.map +1 -1
- package/dist/browser/components/Button/index.d.ts +2 -2
- package/dist/browser/components/Button/index.d.ts.map +1 -1
- package/dist/browser/components/Button/lib/index.d.cts +2 -2
- package/dist/browser/components/Button/lib/index.d.mts +2 -2
- package/dist/browser/components/Button/lib/index.d.ts +2 -2
- package/dist/browser/components/Button/lib/presetIconSize.d.cts +1 -1
- package/dist/browser/components/Button/lib/presetIconSize.d.mts +1 -1
- package/dist/browser/components/Button/lib/presetIconSize.d.ts +1 -1
- package/dist/browser/components/img/index.d.cts.map +1 -1
- package/dist/browser/components/img/index.d.mts.map +1 -1
- package/dist/browser/components/img/index.d.ts.map +1 -1
- package/dist/browser/components/index.d.cts +3 -3
- package/dist/browser/components/index.d.mts +3 -3
- package/dist/browser/components/index.d.ts +3 -3
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
- package/dist/browser/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
- package/dist/browser/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
- package/dist/browser/components/shared/Dialog/index.d.cts +2 -2
- package/dist/browser/components/shared/Dialog/index.d.cts.map +1 -1
- package/dist/browser/components/shared/Dialog/index.d.mts +2 -2
- package/dist/browser/components/shared/Dialog/index.d.mts.map +1 -1
- package/dist/browser/components/shared/Dialog/index.d.ts +2 -2
- package/dist/browser/components/shared/Dialog/index.d.ts.map +1 -1
- package/dist/browser/components/shared/JsonViewerEx.d.cts +1 -0
- package/dist/browser/components/shared/JsonViewerEx.d.cts.map +1 -1
- package/dist/browser/components/shared/JsonViewerEx.d.mts +1 -0
- package/dist/browser/components/shared/JsonViewerEx.d.mts.map +1 -1
- package/dist/browser/components/shared/JsonViewerEx.d.ts +1 -0
- package/dist/browser/components/shared/JsonViewerEx.d.ts.map +1 -1
- package/dist/browser/components/shared/index.d.cts +2 -2
- package/dist/browser/components/shared/index.d.cts.map +1 -1
- package/dist/browser/components/shared/index.d.mts +2 -2
- package/dist/browser/components/shared/index.d.mts.map +1 -1
- package/dist/browser/components/shared/index.d.ts +2 -2
- package/dist/browser/components/shared/index.d.ts.map +1 -1
- package/dist/browser/components/styled/index.d.cts +1 -1
- package/dist/browser/components/styled/index.d.cts.map +1 -1
- package/dist/browser/components/styled/index.d.mts +1 -1
- package/dist/browser/components/styled/index.d.mts.map +1 -1
- package/dist/browser/components/styled/index.d.ts +1 -1
- package/dist/browser/components/styled/index.d.ts.map +1 -1
- package/dist/browser/index.cjs +170 -168
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.mts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.mjs +244 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/browser/lib/index.d.cts +1 -1
- package/dist/browser/lib/index.d.mts +1 -1
- package/dist/browser/lib/index.d.ts +1 -1
- package/dist/neutral/components/Button/RawInfoButton.d.cts +3 -3
- package/dist/neutral/components/Button/RawInfoButton.d.cts.map +1 -1
- package/dist/neutral/components/Button/RawInfoButton.d.mts +3 -3
- package/dist/neutral/components/Button/RawInfoButton.d.mts.map +1 -1
- package/dist/neutral/components/Button/RawInfoButton.d.ts +3 -3
- package/dist/neutral/components/Button/RawInfoButton.d.ts.map +1 -1
- package/dist/neutral/components/Button/RawInfoIconButton.d.cts +4 -4
- package/dist/neutral/components/Button/RawInfoIconButton.d.cts.map +1 -1
- package/dist/neutral/components/Button/RawInfoIconButton.d.mts +4 -4
- package/dist/neutral/components/Button/RawInfoIconButton.d.mts.map +1 -1
- package/dist/neutral/components/Button/RawInfoIconButton.d.ts +4 -4
- package/dist/neutral/components/Button/RawInfoIconButton.d.ts.map +1 -1
- package/dist/neutral/components/Button/index.d.cts +2 -2
- package/dist/neutral/components/Button/index.d.cts.map +1 -1
- package/dist/neutral/components/Button/index.d.mts +2 -2
- package/dist/neutral/components/Button/index.d.mts.map +1 -1
- package/dist/neutral/components/Button/index.d.ts +2 -2
- package/dist/neutral/components/Button/index.d.ts.map +1 -1
- package/dist/neutral/components/Button/lib/index.d.cts +2 -2
- package/dist/neutral/components/Button/lib/index.d.mts +2 -2
- package/dist/neutral/components/Button/lib/index.d.ts +2 -2
- package/dist/neutral/components/Button/lib/presetIconSize.d.cts +1 -1
- package/dist/neutral/components/Button/lib/presetIconSize.d.mts +1 -1
- package/dist/neutral/components/Button/lib/presetIconSize.d.ts +1 -1
- package/dist/neutral/components/img/index.d.cts.map +1 -1
- package/dist/neutral/components/img/index.d.mts.map +1 -1
- package/dist/neutral/components/img/index.d.ts.map +1 -1
- package/dist/neutral/components/index.d.cts +3 -3
- package/dist/neutral/components/index.d.mts +3 -3
- package/dist/neutral/components/index.d.ts +3 -3
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
- package/dist/neutral/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
- package/dist/neutral/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
- package/dist/neutral/components/shared/Dialog/index.d.cts +2 -2
- package/dist/neutral/components/shared/Dialog/index.d.cts.map +1 -1
- package/dist/neutral/components/shared/Dialog/index.d.mts +2 -2
- package/dist/neutral/components/shared/Dialog/index.d.mts.map +1 -1
- package/dist/neutral/components/shared/Dialog/index.d.ts +2 -2
- package/dist/neutral/components/shared/Dialog/index.d.ts.map +1 -1
- package/dist/neutral/components/shared/JsonViewerEx.d.cts +1 -0
- package/dist/neutral/components/shared/JsonViewerEx.d.cts.map +1 -1
- package/dist/neutral/components/shared/JsonViewerEx.d.mts +1 -0
- package/dist/neutral/components/shared/JsonViewerEx.d.mts.map +1 -1
- package/dist/neutral/components/shared/JsonViewerEx.d.ts +1 -0
- package/dist/neutral/components/shared/JsonViewerEx.d.ts.map +1 -1
- package/dist/neutral/components/shared/index.d.cts +2 -2
- package/dist/neutral/components/shared/index.d.cts.map +1 -1
- package/dist/neutral/components/shared/index.d.mts +2 -2
- package/dist/neutral/components/shared/index.d.mts.map +1 -1
- package/dist/neutral/components/shared/index.d.ts +2 -2
- package/dist/neutral/components/shared/index.d.ts.map +1 -1
- package/dist/neutral/components/styled/index.d.cts +1 -1
- package/dist/neutral/components/styled/index.d.cts.map +1 -1
- package/dist/neutral/components/styled/index.d.mts +1 -1
- package/dist/neutral/components/styled/index.d.mts.map +1 -1
- package/dist/neutral/components/styled/index.d.ts +1 -1
- package/dist/neutral/components/styled/index.d.ts.map +1 -1
- package/dist/neutral/index.cjs +170 -168
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +1 -1
- package/dist/neutral/index.d.mts +1 -1
- package/dist/neutral/index.d.ts +1 -1
- package/dist/neutral/index.mjs +244 -0
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/neutral/lib/index.d.cts +1 -1
- package/dist/neutral/lib/index.d.mts +1 -1
- package/dist/neutral/lib/index.d.ts +1 -1
- package/dist/node/components/Button/RawInfoButton.d.cts +3 -3
- package/dist/node/components/Button/RawInfoButton.d.cts.map +1 -1
- package/dist/node/components/Button/RawInfoButton.d.mts +3 -3
- package/dist/node/components/Button/RawInfoButton.d.mts.map +1 -1
- package/dist/node/components/Button/RawInfoButton.d.ts +3 -3
- package/dist/node/components/Button/RawInfoButton.d.ts.map +1 -1
- package/dist/node/components/Button/RawInfoIconButton.d.cts +4 -4
- package/dist/node/components/Button/RawInfoIconButton.d.cts.map +1 -1
- package/dist/node/components/Button/RawInfoIconButton.d.mts +4 -4
- package/dist/node/components/Button/RawInfoIconButton.d.mts.map +1 -1
- package/dist/node/components/Button/RawInfoIconButton.d.ts +4 -4
- package/dist/node/components/Button/RawInfoIconButton.d.ts.map +1 -1
- package/dist/node/components/Button/index.d.cts +2 -2
- package/dist/node/components/Button/index.d.cts.map +1 -1
- package/dist/node/components/Button/index.d.mts +2 -2
- package/dist/node/components/Button/index.d.mts.map +1 -1
- package/dist/node/components/Button/index.d.ts +2 -2
- package/dist/node/components/Button/index.d.ts.map +1 -1
- package/dist/node/components/Button/lib/index.d.cts +2 -2
- package/dist/node/components/Button/lib/index.d.mts +2 -2
- package/dist/node/components/Button/lib/index.d.ts +2 -2
- package/dist/node/components/Button/lib/presetIconSize.d.cts +1 -1
- package/dist/node/components/Button/lib/presetIconSize.d.mts +1 -1
- package/dist/node/components/Button/lib/presetIconSize.d.ts +1 -1
- package/dist/node/components/img/index.d.cts.map +1 -1
- package/dist/node/components/img/index.d.mts.map +1 -1
- package/dist/node/components/img/index.d.ts.map +1 -1
- package/dist/node/components/index.d.cts +3 -3
- package/dist/node/components/index.d.mts +3 -3
- package/dist/node/components/index.d.ts +3 -3
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.cts +2 -1
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.cts.map +1 -1
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.mts +2 -1
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.mts.map +1 -1
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.ts +2 -1
- package/dist/node/components/shared/Dialog/JsonViewerCollapse.d.ts.map +1 -1
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.cts +2 -2
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.cts.map +1 -1
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.mts +2 -2
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.mts.map +1 -1
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.ts +2 -2
- package/dist/node/components/shared/Dialog/RawInfoDialog.d.ts.map +1 -1
- package/dist/node/components/shared/Dialog/index.d.cts +2 -2
- package/dist/node/components/shared/Dialog/index.d.cts.map +1 -1
- package/dist/node/components/shared/Dialog/index.d.mts +2 -2
- package/dist/node/components/shared/Dialog/index.d.mts.map +1 -1
- package/dist/node/components/shared/Dialog/index.d.ts +2 -2
- package/dist/node/components/shared/Dialog/index.d.ts.map +1 -1
- package/dist/node/components/shared/JsonViewerEx.d.cts +1 -0
- package/dist/node/components/shared/JsonViewerEx.d.cts.map +1 -1
- package/dist/node/components/shared/JsonViewerEx.d.mts +1 -0
- package/dist/node/components/shared/JsonViewerEx.d.mts.map +1 -1
- package/dist/node/components/shared/JsonViewerEx.d.ts +1 -0
- package/dist/node/components/shared/JsonViewerEx.d.ts.map +1 -1
- package/dist/node/components/shared/index.d.cts +2 -2
- package/dist/node/components/shared/index.d.cts.map +1 -1
- package/dist/node/components/shared/index.d.mts +2 -2
- package/dist/node/components/shared/index.d.mts.map +1 -1
- package/dist/node/components/shared/index.d.ts +2 -2
- package/dist/node/components/shared/index.d.ts.map +1 -1
- package/dist/node/components/styled/index.d.cts +1 -1
- package/dist/node/components/styled/index.d.cts.map +1 -1
- package/dist/node/components/styled/index.d.mts +1 -1
- package/dist/node/components/styled/index.d.mts.map +1 -1
- package/dist/node/components/styled/index.d.ts +1 -1
- package/dist/node/components/styled/index.d.ts.map +1 -1
- package/dist/node/index.cjs +170 -168
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.mjs +244 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/index.d.cts +1 -1
- package/dist/node/lib/index.d.mts +1 -1
- package/dist/node/lib/index.d.ts +1 -1
- package/package.json +16 -16
- package/src/components/Button/RawInfoButton.stories.tsx +3 -3
- package/src/components/Button/RawInfoButton.tsx +17 -15
- package/src/components/Button/RawInfoIconButton.stories.tsx +3 -3
- package/src/components/Button/RawInfoIconButton.tsx +17 -15
- package/src/components/Button/index.ts +2 -2
- package/src/components/Button/lib/index.ts +2 -2
- package/src/components/Button/lib/presetIconSize.ts +1 -1
- package/src/components/img/index.tsx +1 -0
- package/src/components/index.ts +3 -3
- package/src/components/shared/Dialog/JsonViewerCollapse.tsx +24 -19
- package/src/components/shared/Dialog/RawInfoDialog.stories.tsx +3 -3
- package/src/components/shared/Dialog/RawInfoDialog.tsx +3 -3
- package/src/components/shared/Dialog/index.ts +2 -2
- package/src/components/shared/JsonViewerEx.tsx +1 -0
- package/src/components/shared/index.ts +2 -2
- package/src/components/styled/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lib/index.ts +1 -1
- package/dist/browser/index.js +0 -250
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js +0 -250
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js +0 -250
- package/dist/node/index.js.map +0 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/components/Button/RawInfoButton.tsx
|
|
5
|
+
import { toJson } from "@xylabs/object";
|
|
6
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
7
|
+
import React5, { useMemo, useState } from "react";
|
|
8
|
+
|
|
9
|
+
// src/components/img/index.tsx
|
|
10
|
+
import { createSvgIcon } from "@mui/material";
|
|
11
|
+
import React from "react";
|
|
12
|
+
var XyoColorLogo = createSvgIcon(/* @__PURE__ */ React.createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
viewBox: "0 0 256 238"
|
|
15
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
16
|
+
className: "cls-1",
|
|
17
|
+
d: "M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z",
|
|
18
|
+
fill: "#8d8fc6"
|
|
19
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
20
|
+
className: "cls-2",
|
|
21
|
+
d: "M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z",
|
|
22
|
+
fill: "#579fd6"
|
|
23
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
24
|
+
className: "cls-3",
|
|
25
|
+
d: "M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z",
|
|
26
|
+
fill: "#f27046"
|
|
27
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
28
|
+
className: "cls-4",
|
|
29
|
+
d: "M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z",
|
|
30
|
+
fill: "#eb407a"
|
|
31
|
+
})), "XyoColorLogo");
|
|
32
|
+
|
|
33
|
+
// src/components/shared/Dialog/JsonViewerCollapse.tsx
|
|
34
|
+
import { Button, Chip, Collapse, Typography as Typography2 } from "@mui/material";
|
|
35
|
+
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
36
|
+
import { usePromise } from "@xylabs/react-promise";
|
|
37
|
+
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
38
|
+
import { isAnyPayload } from "@xyo-network/payload-model";
|
|
39
|
+
import { useDataState } from "@xyo-network/react-shared";
|
|
40
|
+
import React3 from "react";
|
|
41
|
+
|
|
42
|
+
// src/components/styled/StyledChipLabel.tsx
|
|
43
|
+
import { styled, Typography } from "@mui/material";
|
|
44
|
+
var StyledChipLabel = styled(Typography, {
|
|
45
|
+
name: "StyledChipLabel"
|
|
46
|
+
})(({ theme }) => ({
|
|
47
|
+
display: "block",
|
|
48
|
+
lineHeight: 1,
|
|
49
|
+
overflow: "hidden",
|
|
50
|
+
paddingRight: theme.spacing(0.95),
|
|
51
|
+
textOverflow: "ellipsis",
|
|
52
|
+
whiteSpace: "nowrap"
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
// src/components/shared/JsonViewerEx.tsx
|
|
56
|
+
import { useTheme } from "@mui/material";
|
|
57
|
+
import { JsonViewer } from "@textea/json-viewer";
|
|
58
|
+
import { useColorSchemeEx } from "@xylabs/react-invertible-theme";
|
|
59
|
+
import React2 from "react";
|
|
60
|
+
var JsonViewerEx = /* @__PURE__ */ __name((props) => {
|
|
61
|
+
const theme = useTheme();
|
|
62
|
+
const { darkMode } = useColorSchemeEx();
|
|
63
|
+
return /* @__PURE__ */ React2.createElement(JsonViewer, {
|
|
64
|
+
theme: darkMode ? "dark" : "light",
|
|
65
|
+
collapseStringsAfterLength: 50,
|
|
66
|
+
style: {
|
|
67
|
+
background: darkMode ? theme.palette.background.paper : theme.palette.grey[200],
|
|
68
|
+
borderRadius: theme.shape.borderRadius,
|
|
69
|
+
padding: theme.spacing(2)
|
|
70
|
+
},
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}, "JsonViewerEx");
|
|
74
|
+
|
|
75
|
+
// src/components/shared/Dialog/JsonViewerCollapse.tsx
|
|
76
|
+
var JsonViewerCollapse = /* @__PURE__ */ __name(({ defaultExpandedJson, jsonValue, updateExpandedJson, ...props }) => {
|
|
77
|
+
const [expandedJson, setExpandedJson] = useDataState(defaultExpandedJson);
|
|
78
|
+
const [hash] = usePromise(async () => {
|
|
79
|
+
if (!jsonValue || !isAnyPayload(jsonValue)) return;
|
|
80
|
+
return await PayloadBuilder.dataHash(jsonValue);
|
|
81
|
+
}, [
|
|
82
|
+
jsonValue
|
|
83
|
+
]);
|
|
84
|
+
const actionText = expandedJson ? "Hide JSON" : "Show JSON";
|
|
85
|
+
const handleExpansion = /* @__PURE__ */ __name(() => {
|
|
86
|
+
updateExpandedJson == null ? void 0 : updateExpandedJson(!expandedJson);
|
|
87
|
+
setExpandedJson(!expandedJson);
|
|
88
|
+
}, "handleExpansion");
|
|
89
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, jsonValue ? /* @__PURE__ */ React3.createElement(FlexRow, null, /* @__PURE__ */ React3.createElement(Button, {
|
|
90
|
+
onClick: handleExpansion,
|
|
91
|
+
size: "small",
|
|
92
|
+
variant: "outlined"
|
|
93
|
+
}, actionText)) : null, /* @__PURE__ */ React3.createElement(Collapse, {
|
|
94
|
+
in: expandedJson,
|
|
95
|
+
...props
|
|
96
|
+
}, jsonValue ? /* @__PURE__ */ React3.createElement(FlexCol, {
|
|
97
|
+
alignItems: "stretch",
|
|
98
|
+
gap: 1.5
|
|
99
|
+
}, /* @__PURE__ */ React3.createElement(Typography2, {
|
|
100
|
+
sx: {
|
|
101
|
+
lineHeight: 1
|
|
102
|
+
}
|
|
103
|
+
}, "Payload Hash:"), hash ? /* @__PURE__ */ React3.createElement(Chip, {
|
|
104
|
+
label: /* @__PURE__ */ React3.createElement(StyledChipLabel, null, hash),
|
|
105
|
+
sx: {
|
|
106
|
+
alignSelf: "start"
|
|
107
|
+
}
|
|
108
|
+
}) : null, /* @__PURE__ */ React3.createElement(JsonViewerEx, {
|
|
109
|
+
value: jsonValue
|
|
110
|
+
})) : null));
|
|
111
|
+
}, "JsonViewerCollapse");
|
|
112
|
+
|
|
113
|
+
// src/components/shared/Dialog/RawInfoDialog.tsx
|
|
114
|
+
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
115
|
+
import React4 from "react";
|
|
116
|
+
var RawInfoDialog = /* @__PURE__ */ __name(({ defaultExpandedJson, dialogContent, onCloseCallback, jsonValue: jsonObject, updateExpandedJson, open = false, ...props }) => {
|
|
117
|
+
const onDialogClick = /* @__PURE__ */ __name((event) => {
|
|
118
|
+
event.stopPropagation();
|
|
119
|
+
}, "onDialogClick");
|
|
120
|
+
return (
|
|
121
|
+
// Wrapping in a span so we can catch click events and prevent them from propagating outside the component
|
|
122
|
+
/* @__PURE__ */ React4.createElement("span", {
|
|
123
|
+
onClick: onDialogClick
|
|
124
|
+
}, /* @__PURE__ */ React4.createElement(Dialog, {
|
|
125
|
+
fullWidth: true,
|
|
126
|
+
maxWidth: "lg",
|
|
127
|
+
onClose: /* @__PURE__ */ __name(() => onCloseCallback == null ? void 0 : onCloseCallback(), "onClose"),
|
|
128
|
+
open,
|
|
129
|
+
...props
|
|
130
|
+
}, /* @__PURE__ */ React4.createElement(DialogTitle, null, "Raw Data"), /* @__PURE__ */ React4.createElement(DialogContent, {
|
|
131
|
+
sx: {
|
|
132
|
+
display: "flex",
|
|
133
|
+
flexDirection: "column",
|
|
134
|
+
gap: 2
|
|
135
|
+
}
|
|
136
|
+
}, dialogContent, /* @__PURE__ */ React4.createElement(JsonViewerCollapse, {
|
|
137
|
+
defaultExpandedJson,
|
|
138
|
+
jsonValue: jsonObject,
|
|
139
|
+
updateExpandedJson
|
|
140
|
+
})), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(Button2, {
|
|
141
|
+
variant: "contained",
|
|
142
|
+
onClick: /* @__PURE__ */ __name(() => onCloseCallback == null ? void 0 : onCloseCallback(), "onClick")
|
|
143
|
+
}, "Close"))))
|
|
144
|
+
);
|
|
145
|
+
}, "RawInfoDialog");
|
|
146
|
+
|
|
147
|
+
// src/components/Button/lib/presetIconSize.ts
|
|
148
|
+
var presetIconSizeValue = /* @__PURE__ */ __name((size) => {
|
|
149
|
+
switch (size) {
|
|
150
|
+
case "small": {
|
|
151
|
+
return 16;
|
|
152
|
+
}
|
|
153
|
+
case "medium": {
|
|
154
|
+
return 32;
|
|
155
|
+
}
|
|
156
|
+
case "large": {
|
|
157
|
+
return 48;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, "presetIconSizeValue");
|
|
161
|
+
|
|
162
|
+
// src/components/Button/RawInfoButton.tsx
|
|
163
|
+
var RawInfoButton = /* @__PURE__ */ __name(({ defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 24, onCloseCallback, children, rawValue, presetIconSize, updateExpandedJson, ...props }) => {
|
|
164
|
+
const [open, setOpen] = useState(false);
|
|
165
|
+
const size = presetIconSizeValue(presetIconSize);
|
|
166
|
+
const json = useMemo(() => toJson(rawValue), [
|
|
167
|
+
rawValue
|
|
168
|
+
]);
|
|
169
|
+
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
170
|
+
event.stopPropagation();
|
|
171
|
+
setOpen(true);
|
|
172
|
+
}, "handleClick");
|
|
173
|
+
const onCloseCallBackWrapped = /* @__PURE__ */ __name(() => {
|
|
174
|
+
setOpen(false);
|
|
175
|
+
onCloseCallback == null ? void 0 : onCloseCallback();
|
|
176
|
+
}, "onCloseCallBackWrapped");
|
|
177
|
+
return /* @__PURE__ */ React5.createElement("span", null, /* @__PURE__ */ React5.createElement(ButtonEx, {
|
|
178
|
+
variant: "outlined",
|
|
179
|
+
size: "small",
|
|
180
|
+
startIcon: /* @__PURE__ */ React5.createElement(XyoColorLogo, {
|
|
181
|
+
sx: {
|
|
182
|
+
height: size ?? iconSize,
|
|
183
|
+
width: size ?? iconSize
|
|
184
|
+
}
|
|
185
|
+
}),
|
|
186
|
+
onClick: handleClick,
|
|
187
|
+
disabled: iconOnly ? false : !rawValue,
|
|
188
|
+
...props
|
|
189
|
+
}, children ?? /* @__PURE__ */ React5.createElement("span", null, "Data")), iconOnly ? null : /* @__PURE__ */ React5.createElement(RawInfoDialog, {
|
|
190
|
+
defaultExpandedJson,
|
|
191
|
+
jsonValue: json,
|
|
192
|
+
onCloseCallback: onCloseCallBackWrapped,
|
|
193
|
+
dialogContent,
|
|
194
|
+
open,
|
|
195
|
+
updateExpandedJson
|
|
196
|
+
}));
|
|
197
|
+
}, "RawInfoButton");
|
|
198
|
+
|
|
199
|
+
// src/components/Button/RawInfoIconButton.tsx
|
|
200
|
+
import { IconButton } from "@mui/material";
|
|
201
|
+
import { toJson as toJson2 } from "@xylabs/object";
|
|
202
|
+
import React6, { forwardRef, useMemo as useMemo2, useState as useState2 } from "react";
|
|
203
|
+
var RawInfoIconButton = /* @__PURE__ */ forwardRef(({ defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 32, onCloseCallback, rawValue, presetIconSize, updateExpandedJson, ...props }, ref) => {
|
|
204
|
+
const [open, setOpen] = useState2(false);
|
|
205
|
+
const size = presetIconSizeValue(presetIconSize);
|
|
206
|
+
const json = useMemo2(() => toJson2(rawValue), [
|
|
207
|
+
rawValue
|
|
208
|
+
]);
|
|
209
|
+
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
210
|
+
event.stopPropagation();
|
|
211
|
+
setOpen(true);
|
|
212
|
+
}, "handleClick");
|
|
213
|
+
const onCloseCallBackWrapped = /* @__PURE__ */ __name(() => {
|
|
214
|
+
setOpen(false);
|
|
215
|
+
onCloseCallback == null ? void 0 : onCloseCallback();
|
|
216
|
+
}, "onCloseCallBackWrapped");
|
|
217
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(IconButton, {
|
|
218
|
+
onClick: handleClick,
|
|
219
|
+
ref,
|
|
220
|
+
...props
|
|
221
|
+
}, /* @__PURE__ */ React6.createElement(XyoColorLogo, {
|
|
222
|
+
sx: {
|
|
223
|
+
height: size ?? iconSize,
|
|
224
|
+
width: size ?? iconSize
|
|
225
|
+
}
|
|
226
|
+
})), iconOnly ? null : /* @__PURE__ */ React6.createElement(RawInfoDialog, {
|
|
227
|
+
defaultExpandedJson,
|
|
228
|
+
jsonValue: json,
|
|
229
|
+
onCloseCallback: onCloseCallBackWrapped,
|
|
230
|
+
dialogContent,
|
|
231
|
+
open,
|
|
232
|
+
updateExpandedJson
|
|
233
|
+
}));
|
|
234
|
+
});
|
|
235
|
+
RawInfoIconButton.displayName = "RawInfoIcon";
|
|
236
|
+
export {
|
|
237
|
+
JsonViewerCollapse,
|
|
238
|
+
JsonViewerEx,
|
|
239
|
+
RawInfoButton,
|
|
240
|
+
RawInfoDialog,
|
|
241
|
+
RawInfoIconButton,
|
|
242
|
+
StyledChipLabel
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Button/RawInfoButton.tsx","../../src/components/img/index.tsx","../../src/components/shared/Dialog/JsonViewerCollapse.tsx","../../src/components/styled/StyledChipLabel.tsx","../../src/components/shared/JsonViewerEx.tsx","../../src/components/shared/Dialog/RawInfoDialog.tsx","../../src/components/Button/lib/presetIconSize.ts","../../src/components/Button/RawInfoIconButton.tsx"],"sourcesContent":["import { toJson } from '@xylabs/object'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'\n\nimport { ExpansionProps } from '../../lib/index.ts'\nimport { XyoColorLogo } from '../img/index.tsx'\nimport { RawInfoDialog } from '../shared/index.ts'\nimport { IconSize, presetIconSizeValue } from './lib/index.ts'\n\nexport interface RawInfoButtonProps extends ButtonExProps, ExpansionProps {\n dialogContent?: ReactNode\n iconOnly?: boolean\n iconSize?: number\n onCloseCallback?: () => void\n presetIconSize?: IconSize\n rawValue?: unknown\n}\n\nexport const RawInfoButton: React.FC<RawInfoButtonProps> = ({\n defaultExpandedJson = true,\n dialogContent,\n iconOnly,\n iconSize = 24,\n onCloseCallback,\n children,\n rawValue,\n presetIconSize,\n updateExpandedJson,\n ...props\n}) => {\n const [open, setOpen] = useState(false)\n const size = presetIconSizeValue(presetIconSize)\n const json = useMemo(() => toJson(rawValue), [rawValue])\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n event.stopPropagation()\n setOpen(true)\n }\n\n const onCloseCallBackWrapped = () => {\n setOpen(false)\n onCloseCallback?.()\n }\n\n return (\n <span>\n <ButtonEx\n variant=\"outlined\"\n size=\"small\"\n startIcon={<XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />}\n onClick={handleClick}\n disabled={iconOnly ? false : !rawValue}\n {...props}\n >\n {children ?? <span>Data</span>}\n </ButtonEx>\n {iconOnly\n ? null\n : (\n <RawInfoDialog\n defaultExpandedJson={defaultExpandedJson}\n jsonValue={json}\n onCloseCallback={onCloseCallBackWrapped}\n dialogContent={dialogContent}\n open={open}\n updateExpandedJson={updateExpandedJson}\n />\n )}\n </span>\n )\n}\n","import { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XyoColorLogo = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 238\">\n <path\n className=\"cls-1\"\n d=\"M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z\"\n fill=\"#8d8fc6\"\n />\n <path\n className=\"cls-2\"\n d=\"M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z\"\n fill=\"#579fd6\"\n />\n <path\n className=\"cls-3\"\n d=\"M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z\"\n fill=\"#f27046\"\n />\n <path\n className=\"cls-4\"\n d=\"M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z\"\n fill=\"#eb407a\"\n />\n </svg>,\n 'XyoColorLogo',\n)\n","import { Button, Chip, Collapse, CollapseProps, Typography } from '@mui/material'\nimport { JsonValue } from '@xylabs/object'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { isAnyPayload } from '@xyo-network/payload-model'\nimport { useDataState } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { ExpansionProps } from '../../../lib/index.ts'\nimport { StyledChipLabel } from '../../styled/index.ts'\nimport { JsonViewerEx } from '../JsonViewerEx.tsx'\n\nexport interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps {\n jsonValue?: JsonValue\n}\n\nexport const JsonViewerCollapse: React.FC<RawInfoPayloadCollapse> = ({ defaultExpandedJson, jsonValue, updateExpandedJson, ...props }) => {\n const [expandedJson, setExpandedJson] = useDataState(defaultExpandedJson)\n\n const [hash] = usePromise(async () => {\n if (!jsonValue || !isAnyPayload(jsonValue)) return\n return await PayloadBuilder.dataHash(jsonValue)\n }, [jsonValue])\n\n const actionText = expandedJson ? 'Hide JSON' : 'Show JSON'\n\n const handleExpansion = () => {\n updateExpandedJson?.(!expandedJson)\n setExpandedJson(!expandedJson)\n }\n\n return (\n <>\n {jsonValue\n ? (\n <FlexRow>\n <Button onClick={handleExpansion} size=\"small\" variant=\"outlined\">\n {actionText}\n </Button>\n </FlexRow>\n )\n : null}\n <Collapse in={expandedJson} {...props}>\n {jsonValue\n ? (\n <FlexCol alignItems=\"stretch\" gap={1.5}>\n <Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>\n {hash\n ? <Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />\n : null}\n <JsonViewerEx value={jsonValue} />\n </FlexCol>\n )\n : null}\n </Collapse>\n </>\n )\n}\n","import { styled, Typography } from '@mui/material'\n\nexport const StyledChipLabel = styled(Typography, { name: 'StyledChipLabel' })(({ theme }) => ({\n display: 'block',\n lineHeight: 1,\n overflow: 'hidden',\n paddingRight: theme.spacing(0.95),\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}))\n","import { useTheme } from '@mui/material'\nimport { JsonViewer, JsonViewerProps } from '@textea/json-viewer'\nimport { useColorSchemeEx } from '@xylabs/react-invertible-theme'\nimport React from 'react'\n\nexport type JsonViewerExProps = JsonViewerProps\n\nexport const JsonViewerEx: React.FC<JsonViewerExProps> = (props) => {\n const theme = useTheme()\n const { darkMode } = useColorSchemeEx()\n\n return (\n <JsonViewer\n theme={darkMode ? 'dark' : 'light'}\n collapseStringsAfterLength={50}\n style={{\n background: darkMode ? theme.palette.background.paper : theme.palette.grey[200],\n borderRadius: theme.shape.borderRadius,\n padding: theme.spacing(2),\n }}\n {...props}\n />\n )\n}\n","import { Button, Dialog, DialogActions, DialogContent, DialogProps, DialogTitle } from '@mui/material'\nimport { JsonValue } from '@xylabs/object'\nimport React, { MouseEventHandler, ReactNode } from 'react'\n\nimport { ExpansionProps } from '../../../lib/index.ts'\nimport { JsonViewerCollapse } from './JsonViewerCollapse.tsx'\n\nexport interface RawInfoDialogProps extends DialogProps, ExpansionProps {\n dialogContent?: ReactNode\n jsonValue?: JsonValue\n onCloseCallback?: () => void\n}\n\nexport const RawInfoDialog: React.FC<RawInfoDialogProps> = ({\n defaultExpandedJson,\n dialogContent,\n onCloseCallback,\n jsonValue: jsonObject,\n updateExpandedJson,\n open = false,\n ...props\n}) => {\n const onDialogClick: MouseEventHandler<HTMLSpanElement> = (event) => {\n event.stopPropagation()\n }\n\n return (\n // Wrapping in a span so we can catch click events and prevent them from propagating outside the component\n <span onClick={onDialogClick}>\n <Dialog fullWidth maxWidth=\"lg\" onClose={() => onCloseCallback?.()} open={open} {...props}>\n <DialogTitle>Raw Data</DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n {dialogContent}\n <JsonViewerCollapse defaultExpandedJson={defaultExpandedJson} jsonValue={jsonObject} updateExpandedJson={updateExpandedJson} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => onCloseCallback?.()}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n </span>\n )\n}\n","import { IconSize } from './IconSize.ts'\n\nexport const presetIconSizeValue = (size?: IconSize) => {\n switch (size) {\n case 'small': {\n return 16\n }\n case 'medium': {\n return 32\n }\n case 'large': {\n return 48\n }\n }\n}\n","import { IconButton, IconButtonProps } from '@mui/material'\nimport { toJson } from '@xylabs/object'\nimport React, { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'\n\nimport { ExpansionProps } from '../../lib/index.ts'\nimport { XyoColorLogo } from '../img/index.tsx'\nimport { RawInfoDialog } from '../shared/index.ts'\nimport { IconSize, presetIconSizeValue } from './lib/index.ts'\n\nexport interface RawInfoIconProps extends IconButtonProps, ExpansionProps {\n dialogContent?: ReactNode\n iconOnly?: boolean\n iconSize?: number\n onCloseCallback?: () => void\n presetIconSize?: IconSize\n rawValue?: unknown\n}\n\nexport const RawInfoIconButton = forwardRef<HTMLButtonElement, RawInfoIconProps>(\n (\n { defaultExpandedJson = true, dialogContent, iconOnly, iconSize = 32, onCloseCallback, rawValue, presetIconSize, updateExpandedJson, ...props },\n ref,\n ) => {\n const [open, setOpen] = useState(false)\n const size = presetIconSizeValue(presetIconSize)\n const json = useMemo(() => toJson(rawValue), [rawValue])\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n event.stopPropagation()\n setOpen(true)\n }\n\n const onCloseCallBackWrapped = () => {\n setOpen(false)\n onCloseCallback?.()\n }\n\n return (\n <>\n <IconButton onClick={handleClick} ref={ref} {...props}>\n <XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />\n </IconButton>\n {iconOnly\n ? null\n : (\n <RawInfoDialog\n defaultExpandedJson={defaultExpandedJson}\n jsonValue={json}\n onCloseCallback={onCloseCallBackWrapped}\n dialogContent={dialogContent}\n open={open}\n updateExpandedJson={updateExpandedJson}\n />\n )}\n </>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B;AAK/B,SACE,gBAAAkB,OAAA,cAAAA,OAAA,UAAA,MACE,gBAAAA,OAAA,cAACC,YAAAA;IAAWC,SAASN;IAAaT;IAAW,GAAGD;KAC9C,gBAAAc,OAAA,cAACG,cAAAA;IAAaC,IAAI;MAAEC,QAAQd,QAAQV;MAAUyB,OAAOf,QAAQV;IAAS;OAEvED,WACG,OAEE,gBAAAoB,OAAA,cAACO,eAAAA;IACC7B;IACA8B,WAAWf;IACXX,iBAAiBiB;IACjBpB;IACAS;IACAH;;AAKd,CAAA;AAGFT,kBAAkBiC,cAAc;","names":["toJson","ButtonEx","React","useMemo","useState","createSvgIcon","React","XyoColorLogo","svg","xmlns","viewBox","path","className","d","fill","Button","Chip","Collapse","Typography","FlexCol","FlexRow","usePromise","PayloadBuilder","isAnyPayload","useDataState","React","styled","Typography","StyledChipLabel","name","theme","display","lineHeight","overflow","paddingRight","spacing","textOverflow","whiteSpace","useTheme","JsonViewer","useColorSchemeEx","React","JsonViewerEx","props","theme","useTheme","darkMode","useColorSchemeEx","React","JsonViewer","collapseStringsAfterLength","style","background","palette","paper","grey","borderRadius","shape","padding","spacing","JsonViewerCollapse","defaultExpandedJson","jsonValue","updateExpandedJson","props","expandedJson","setExpandedJson","useDataState","hash","usePromise","isAnyPayload","PayloadBuilder","dataHash","actionText","handleExpansion","React","FlexRow","Button","onClick","size","variant","Collapse","in","FlexCol","alignItems","gap","Typography","sx","lineHeight","Chip","label","StyledChipLabel","alignSelf","JsonViewerEx","value","Button","Dialog","DialogActions","DialogContent","DialogTitle","React","RawInfoDialog","defaultExpandedJson","dialogContent","onCloseCallback","jsonValue","jsonObject","updateExpandedJson","open","props","onDialogClick","event","stopPropagation","React","span","onClick","Dialog","fullWidth","maxWidth","onClose","DialogTitle","DialogContent","sx","display","flexDirection","gap","JsonViewerCollapse","DialogActions","Button","variant","presetIconSizeValue","size","RawInfoButton","defaultExpandedJson","dialogContent","iconOnly","iconSize","onCloseCallback","children","rawValue","presetIconSize","updateExpandedJson","props","open","setOpen","useState","size","presetIconSizeValue","json","useMemo","toJson","handleClick","event","stopPropagation","onCloseCallBackWrapped","React","span","ButtonEx","variant","startIcon","XyoColorLogo","sx","height","width","onClick","disabled","RawInfoDialog","jsonValue","IconButton","toJson","React","forwardRef","useMemo","useState","RawInfoIconButton","forwardRef","defaultExpandedJson","dialogContent","iconOnly","iconSize","onCloseCallback","rawValue","presetIconSize","updateExpandedJson","props","ref","open","setOpen","useState","size","presetIconSizeValue","json","useMemo","toJson","handleClick","event","stopPropagation","onCloseCallBackWrapped","React","IconButton","onClick","XyoColorLogo","sx","height","width","RawInfoDialog","jsonValue","displayName"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ExpansionProps.
|
|
1
|
+
export * from './ExpansionProps.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ExpansionProps.
|
|
1
|
+
export * from './ExpansionProps.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ExpansionProps.
|
|
1
|
+
export * from './ExpansionProps.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@textea/json-viewer": "^3.4.1",
|
|
14
|
-
"@xylabs/object": "^3.6.
|
|
15
|
-
"@xylabs/react-button": "^3.4.
|
|
16
|
-
"@xylabs/react-flexbox": "^3.4.
|
|
17
|
-
"@xylabs/react-invertible-theme": "^3.4.
|
|
18
|
-
"@xylabs/react-promise": "^3.4.
|
|
19
|
-
"@xyo-network/payload-builder": "^2.
|
|
20
|
-
"@xyo-network/payload-model": "^2.
|
|
21
|
-
"@xyo-network/react-shared": "^2.
|
|
14
|
+
"@xylabs/object": "^3.6.12",
|
|
15
|
+
"@xylabs/react-button": "^3.4.2",
|
|
16
|
+
"@xylabs/react-flexbox": "^3.4.2",
|
|
17
|
+
"@xylabs/react-invertible-theme": "^3.4.2",
|
|
18
|
+
"@xylabs/react-promise": "^3.4.2",
|
|
19
|
+
"@xyo-network/payload-builder": "^2.111.3",
|
|
20
|
+
"@xyo-network/payload-model": "^2.111.3",
|
|
21
|
+
"@xyo-network/react-shared": "^2.82.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@storybook/react": "^
|
|
25
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
26
|
-
"@xylabs/tsconfig-react": "^3.
|
|
24
|
+
"@storybook/react": "^8.2.7",
|
|
25
|
+
"@xylabs/ts-scripts-yarn3": "^3.15.16",
|
|
26
|
+
"@xylabs/tsconfig-react": "^3.15.16",
|
|
27
27
|
"typescript": "^5.5.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"node": {
|
|
43
43
|
"import": {
|
|
44
44
|
"types": "./dist/node/index.d.mts",
|
|
45
|
-
"default": "./dist/node/index.
|
|
45
|
+
"default": "./dist/node/index.mjs"
|
|
46
46
|
},
|
|
47
47
|
"require": {
|
|
48
48
|
"types": "./dist/node/index.d.cts",
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
"browser": {
|
|
53
53
|
"import": {
|
|
54
54
|
"types": "./dist/browser/index.d.mts",
|
|
55
|
-
"default": "./dist/browser/index.
|
|
55
|
+
"default": "./dist/browser/index.mjs"
|
|
56
56
|
},
|
|
57
57
|
"require": {
|
|
58
58
|
"types": "./dist/browser/index.d.cts",
|
|
59
59
|
"default": "./dist/browser/index.cjs"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
"default": "./dist/browser/index.
|
|
62
|
+
"default": "./dist/browser/index.mjs"
|
|
63
63
|
},
|
|
64
64
|
"./package.json": "./package.json"
|
|
65
65
|
},
|
|
66
66
|
"main": "dist/browser/index.cjs",
|
|
67
|
-
"module": "dist/browser/index.
|
|
67
|
+
"module": "dist/browser/index.mjs",
|
|
68
68
|
"types": "dist/browser/index.d.ts",
|
|
69
69
|
"homepage": "https://xyo.network",
|
|
70
70
|
"keywords": [
|
|
@@ -86,6 +86,6 @@
|
|
|
86
86
|
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
|
|
87
87
|
},
|
|
88
88
|
"sideEffects": false,
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.82.0",
|
|
90
90
|
"type": "module"
|
|
91
91
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryFn } from '@storybook/react'
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
3
|
import { Payload } from '@xyo-network/payload-model'
|
|
4
|
+
import React from 'react'
|
|
4
5
|
|
|
5
|
-
import { RawInfoButton } from './RawInfoButton.
|
|
6
|
+
import { RawInfoButton } from './RawInfoButton.tsx'
|
|
6
7
|
|
|
7
8
|
type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
|
|
8
9
|
const TestPayload: TestPayload = {
|
|
@@ -11,13 +12,12 @@ const TestPayload: TestPayload = {
|
|
|
11
12
|
type: 'test',
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
// eslint-disable-next-line import/no-default-export
|
|
15
15
|
export default {
|
|
16
16
|
component: RawInfoButton,
|
|
17
17
|
title: 'payload/RawInfoButton',
|
|
18
18
|
} as Meta
|
|
19
19
|
|
|
20
|
-
const Template: StoryFn<typeof RawInfoButton> =
|
|
20
|
+
const Template: StoryFn<typeof RawInfoButton> = args => (
|
|
21
21
|
<FlexCol>
|
|
22
22
|
<RawInfoButton {...args} />
|
|
23
23
|
</FlexCol>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { toJson } from '@xylabs/object'
|
|
2
2
|
import { ButtonEx, ButtonExProps } from '@xylabs/react-button'
|
|
3
|
-
import { MouseEventHandler, ReactNode, useMemo, useState } from 'react'
|
|
3
|
+
import React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'
|
|
4
4
|
|
|
5
|
-
import { ExpansionProps } from '../../lib/index.
|
|
6
|
-
import { XyoColorLogo } from '../img/index.
|
|
7
|
-
import { RawInfoDialog } from '../shared/index.
|
|
8
|
-
import { IconSize, presetIconSizeValue } from './lib/index.
|
|
5
|
+
import { ExpansionProps } from '../../lib/index.ts'
|
|
6
|
+
import { XyoColorLogo } from '../img/index.tsx'
|
|
7
|
+
import { RawInfoDialog } from '../shared/index.ts'
|
|
8
|
+
import { IconSize, presetIconSizeValue } from './lib/index.ts'
|
|
9
9
|
|
|
10
10
|
export interface RawInfoButtonProps extends ButtonExProps, ExpansionProps {
|
|
11
11
|
dialogContent?: ReactNode
|
|
@@ -54,16 +54,18 @@ export const RawInfoButton: React.FC<RawInfoButtonProps> = ({
|
|
|
54
54
|
>
|
|
55
55
|
{children ?? <span>Data</span>}
|
|
56
56
|
</ButtonEx>
|
|
57
|
-
{iconOnly
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
{iconOnly
|
|
58
|
+
? null
|
|
59
|
+
: (
|
|
60
|
+
<RawInfoDialog
|
|
61
|
+
defaultExpandedJson={defaultExpandedJson}
|
|
62
|
+
jsonValue={json}
|
|
63
|
+
onCloseCallback={onCloseCallBackWrapped}
|
|
64
|
+
dialogContent={dialogContent}
|
|
65
|
+
open={open}
|
|
66
|
+
updateExpandedJson={updateExpandedJson}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
67
69
|
</span>
|
|
68
70
|
)
|
|
69
71
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryFn } from '@storybook/react'
|
|
2
2
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
3
|
import { Payload } from '@xyo-network/payload-model'
|
|
4
|
+
import React from 'react'
|
|
4
5
|
|
|
5
|
-
import { RawInfoIconButton } from './RawInfoIconButton.
|
|
6
|
+
import { RawInfoIconButton } from './RawInfoIconButton.tsx'
|
|
6
7
|
|
|
7
8
|
type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
|
|
8
9
|
const TestPayload: TestPayload = {
|
|
@@ -11,13 +12,12 @@ const TestPayload: TestPayload = {
|
|
|
11
12
|
type: 'test',
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
// eslint-disable-next-line import/no-default-export
|
|
15
15
|
export default {
|
|
16
16
|
component: RawInfoIconButton,
|
|
17
17
|
title: 'payload/RawInfoIconButton',
|
|
18
18
|
} as Meta
|
|
19
19
|
|
|
20
|
-
const Template: StoryFn<typeof RawInfoIconButton> =
|
|
20
|
+
const Template: StoryFn<typeof RawInfoIconButton> = args => (
|
|
21
21
|
<FlexCol>
|
|
22
22
|
<RawInfoIconButton {...args} />
|
|
23
23
|
</FlexCol>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IconButton, IconButtonProps } from '@mui/material'
|
|
2
2
|
import { toJson } from '@xylabs/object'
|
|
3
|
-
import { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'
|
|
3
|
+
import React, { forwardRef, MouseEventHandler, ReactNode, useMemo, useState } from 'react'
|
|
4
4
|
|
|
5
|
-
import { ExpansionProps } from '../../lib/index.
|
|
6
|
-
import { XyoColorLogo } from '../img/index.
|
|
7
|
-
import { RawInfoDialog } from '../shared/index.
|
|
8
|
-
import { IconSize, presetIconSizeValue } from './lib/index.
|
|
5
|
+
import { ExpansionProps } from '../../lib/index.ts'
|
|
6
|
+
import { XyoColorLogo } from '../img/index.tsx'
|
|
7
|
+
import { RawInfoDialog } from '../shared/index.ts'
|
|
8
|
+
import { IconSize, presetIconSizeValue } from './lib/index.ts'
|
|
9
9
|
|
|
10
10
|
export interface RawInfoIconProps extends IconButtonProps, ExpansionProps {
|
|
11
11
|
dialogContent?: ReactNode
|
|
@@ -40,16 +40,18 @@ export const RawInfoIconButton = forwardRef<HTMLButtonElement, RawInfoIconProps>
|
|
|
40
40
|
<IconButton onClick={handleClick} ref={ref} {...props}>
|
|
41
41
|
<XyoColorLogo sx={{ height: size ?? iconSize, width: size ?? iconSize }} />
|
|
42
42
|
</IconButton>
|
|
43
|
-
{iconOnly
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
{iconOnly
|
|
44
|
+
? null
|
|
45
|
+
: (
|
|
46
|
+
<RawInfoDialog
|
|
47
|
+
defaultExpandedJson={defaultExpandedJson}
|
|
48
|
+
jsonValue={json}
|
|
49
|
+
onCloseCallback={onCloseCallBackWrapped}
|
|
50
|
+
dialogContent={dialogContent}
|
|
51
|
+
open={open}
|
|
52
|
+
updateExpandedJson={updateExpandedJson}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
53
55
|
</>
|
|
54
56
|
)
|
|
55
57
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './RawInfoButton.
|
|
2
|
-
export * from './RawInfoIconButton.
|
|
1
|
+
export * from './RawInfoButton.tsx'
|
|
2
|
+
export * from './RawInfoIconButton.tsx'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './IconSize.
|
|
2
|
-
export * from './presetIconSize.
|
|
1
|
+
export * from './IconSize.ts'
|
|
2
|
+
export * from './presetIconSize.ts'
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Button/index.
|
|
2
|
-
export * from './shared/index.
|
|
3
|
-
export * from './styled/index.
|
|
1
|
+
export * from './Button/index.ts'
|
|
2
|
+
export * from './shared/index.ts'
|
|
3
|
+
export * from './styled/index.ts'
|
|
@@ -5,10 +5,11 @@ import { usePromise } from '@xylabs/react-promise'
|
|
|
5
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
6
|
import { isAnyPayload } from '@xyo-network/payload-model'
|
|
7
7
|
import { useDataState } from '@xyo-network/react-shared'
|
|
8
|
+
import React from 'react'
|
|
8
9
|
|
|
9
|
-
import { ExpansionProps } from '../../../lib/index.
|
|
10
|
-
import { StyledChipLabel } from '../../styled/index.
|
|
11
|
-
import { JsonViewerEx } from '../JsonViewerEx.
|
|
10
|
+
import { ExpansionProps } from '../../../lib/index.ts'
|
|
11
|
+
import { StyledChipLabel } from '../../styled/index.ts'
|
|
12
|
+
import { JsonViewerEx } from '../JsonViewerEx.tsx'
|
|
12
13
|
|
|
13
14
|
export interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps {
|
|
14
15
|
jsonValue?: JsonValue
|
|
@@ -31,23 +32,27 @@ export const JsonViewerCollapse: React.FC<RawInfoPayloadCollapse> = ({ defaultEx
|
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
34
|
-
{jsonValue
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{jsonValue ?
|
|
43
|
-
<FlexCol alignItems="stretch" gap={1.5}>
|
|
44
|
-
<Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>
|
|
45
|
-
{hash ?
|
|
46
|
-
<Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />
|
|
47
|
-
: null}
|
|
48
|
-
<JsonViewerEx value={jsonValue} />
|
|
49
|
-
</FlexCol>
|
|
35
|
+
{jsonValue
|
|
36
|
+
? (
|
|
37
|
+
<FlexRow>
|
|
38
|
+
<Button onClick={handleExpansion} size="small" variant="outlined">
|
|
39
|
+
{actionText}
|
|
40
|
+
</Button>
|
|
41
|
+
</FlexRow>
|
|
42
|
+
)
|
|
50
43
|
: null}
|
|
44
|
+
<Collapse in={expandedJson} {...props}>
|
|
45
|
+
{jsonValue
|
|
46
|
+
? (
|
|
47
|
+
<FlexCol alignItems="stretch" gap={1.5}>
|
|
48
|
+
<Typography sx={{ lineHeight: 1 }}>Payload Hash:</Typography>
|
|
49
|
+
{hash
|
|
50
|
+
? <Chip label={<StyledChipLabel>{hash}</StyledChipLabel>} sx={{ alignSelf: 'start' }} />
|
|
51
|
+
: null}
|
|
52
|
+
<JsonViewerEx value={jsonValue} />
|
|
53
|
+
</FlexCol>
|
|
54
|
+
)
|
|
55
|
+
: null}
|
|
51
56
|
</Collapse>
|
|
52
57
|
</>
|
|
53
58
|
)
|
|
@@ -2,8 +2,9 @@ import { Meta, StoryFn } from '@storybook/react'
|
|
|
2
2
|
import { toJson } from '@xylabs/object'
|
|
3
3
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
4
4
|
import { Payload } from '@xyo-network/payload-model'
|
|
5
|
+
import React from 'react'
|
|
5
6
|
|
|
6
|
-
import { RawInfoDialog } from './RawInfoDialog.
|
|
7
|
+
import { RawInfoDialog } from './RawInfoDialog.tsx'
|
|
7
8
|
|
|
8
9
|
type TestPayload = Payload<{ id: string; schema: string; type: string }, 'network.xyo.test'>
|
|
9
10
|
const TestPayload: TestPayload = {
|
|
@@ -12,13 +13,12 @@ const TestPayload: TestPayload = {
|
|
|
12
13
|
type: 'test',
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
// eslint-disable-next-line import/no-default-export
|
|
16
16
|
export default {
|
|
17
17
|
component: RawInfoDialog,
|
|
18
18
|
title: 'payload/RawInfoDialog',
|
|
19
19
|
} as Meta
|
|
20
20
|
|
|
21
|
-
const Template: StoryFn<typeof RawInfoDialog> =
|
|
21
|
+
const Template: StoryFn<typeof RawInfoDialog> = args => (
|
|
22
22
|
<FlexCol>
|
|
23
23
|
<RawInfoDialog {...args} />
|
|
24
24
|
</FlexCol>
|