@xyo-network/react-embed 7.3.8 → 7.3.9
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/embed-card/card/EmbedCardHeader.d.ts.map +1 -1
- package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts.map +1 -1
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts.map +1 -1
- package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts.map +1 -1
- package/dist/browser/contexts/PluginPropsContext/Provider.d.ts +8 -0
- package/dist/browser/contexts/PluginPropsContext/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/PluginPropsContext/context.d.ts +8 -0
- package/dist/browser/contexts/PluginPropsContext/context.d.ts.map +1 -0
- package/dist/browser/contexts/PluginPropsContext/index.d.ts +5 -0
- package/dist/browser/contexts/PluginPropsContext/index.d.ts.map +1 -0
- package/dist/browser/contexts/PluginPropsContext/state.d.ts +7 -0
- package/dist/browser/contexts/PluginPropsContext/state.d.ts.map +1 -0
- package/dist/browser/contexts/PluginPropsContext/use.d.ts +4 -0
- package/dist/browser/contexts/PluginPropsContext/use.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts.map +1 -1
- package/dist/browser/contexts/index.d.ts +1 -0
- package/dist/browser/contexts/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +125 -89
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +6 -5
- package/src/components/embed-card/card/EmbedCardHeader.tsx +2 -1
- package/src/components/embed-card/card/EmbedPluginCard.tsx +7 -3
- package/src/components/embed-card/error-handling/EmbedErrorCard.tsx +2 -1
- package/src/components/embed-card/menu/JsonMenuItem.tsx +2 -1
- package/src/contexts/PluginPropsContext/Provider.tsx +32 -0
- package/src/contexts/PluginPropsContext/context.ts +5 -0
- package/src/contexts/PluginPropsContext/index.ts +4 -0
- package/src/contexts/PluginPropsContext/state.ts +9 -0
- package/src/contexts/PluginPropsContext/use.ts +5 -0
- package/src/contexts/RefreshPayloadContext/Provider.tsx +2 -2
- package/src/contexts/ResolvePayloadContext/Provider.tsx +3 -2
- package/src/contexts/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedCardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAS,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"EmbedCardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAS,MAAM,eAAe,CAAA;AAM3D,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4CrD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedPluginCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedPluginCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmbedPluginCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedPluginCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAInD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgCnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedErrorCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedErrorCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"EmbedErrorCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedErrorCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,UAAU,uBAAuB;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,mBAAoB,SAAQ,uBAAuB,EAAE,SAAS;CAAG;AAE3E,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAY3E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonMenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/menu/JsonMenuItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"JsonMenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/menu/JsonMenuItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAKlD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiBhD,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { PluginProps } from './state.ts';
|
|
4
|
+
export interface PluginPropsProviderProps extends PropsWithChildren {
|
|
5
|
+
pluginProps: PluginProps;
|
|
6
|
+
}
|
|
7
|
+
export declare const PluginPropsProvider: React.FC<PluginPropsProviderProps>;
|
|
8
|
+
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/PluginPropsContext/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAA;AAE/D,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAmBlE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PluginPropsContext: import("react").Context<(import("./state.ts").PluginPropsStateFields & {
|
|
2
|
+
provided: true;
|
|
3
|
+
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<import("./state.ts").PluginPropsStateFields>, never> & {
|
|
4
|
+
provided: false;
|
|
5
|
+
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<import("./state.ts").PluginPropsStateFields>, never> & {
|
|
6
|
+
provided: false;
|
|
7
|
+
})>;
|
|
8
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/PluginPropsContext/context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;GAAsC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/PluginPropsContext/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ContextExState } from '@xylabs/react-shared';
|
|
2
|
+
export type PluginProps = React.PropsWithChildren;
|
|
3
|
+
export interface PluginPropsStateFields {
|
|
4
|
+
pluginProps: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type PluginPropsState = ContextExState<PluginPropsStateFields>;
|
|
7
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/contexts/PluginPropsContext/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAA;AAEjD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const usePluginProps: (required?: boolean) => Omit<import("./state.ts").PluginPropsStateFields & {
|
|
2
|
+
provided: true;
|
|
3
|
+
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<import("./state.ts").PluginPropsState>, "provided">;
|
|
4
|
+
//# sourceMappingURL=use.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/PluginPropsContext/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,GAAI,kBAAgB;;kIAA8D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ResolvePayloadContext/Provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ResolvePayloadContext/Provider.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;AAE/E,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CA4D3F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
Chip as Chip2
|
|
31
31
|
} from "@mui/material";
|
|
32
32
|
import { FlexRow } from "@xylabs/react-flexbox";
|
|
33
|
+
import { isDefined as isDefined3 } from "@xylabs/typeof";
|
|
33
34
|
|
|
34
35
|
// src/contexts/EmbedPluginContext/Context.ts
|
|
35
36
|
import { createContextEx } from "@xylabs/react-shared";
|
|
@@ -68,31 +69,58 @@ var EmbedPluginProvider = ({
|
|
|
68
69
|
import { useContextEx } from "@xylabs/react-shared";
|
|
69
70
|
var useEmbedPluginState = () => useContextEx(EmbedPluginContext, "EmbedPlugin", true);
|
|
70
71
|
|
|
72
|
+
// src/contexts/PluginPropsContext/context.ts
|
|
73
|
+
import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
|
|
74
|
+
var PluginPropsContext = createContextEx2();
|
|
75
|
+
|
|
76
|
+
// src/contexts/PluginPropsContext/Provider.tsx
|
|
77
|
+
import {
|
|
78
|
+
useEffect,
|
|
79
|
+
useMemo,
|
|
80
|
+
useState
|
|
81
|
+
} from "react";
|
|
82
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
83
|
+
var PluginPropsProvider = ({ children, pluginProps: pluginPropsProp }) => {
|
|
84
|
+
const [pluginProps, setPluginProps] = useState(pluginPropsProp);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
setPluginProps(pluginPropsProp);
|
|
87
|
+
}, [pluginPropsProp]);
|
|
88
|
+
const value = useMemo(() => ({
|
|
89
|
+
pluginProps,
|
|
90
|
+
provided: true
|
|
91
|
+
}), [pluginProps]);
|
|
92
|
+
return /* @__PURE__ */ jsx3(PluginPropsContext, { value, children });
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/contexts/PluginPropsContext/use.ts
|
|
96
|
+
import { useContextEx as useContextEx2 } from "@xylabs/react-shared";
|
|
97
|
+
var usePluginProps = (required = false) => useContextEx2(PluginPropsContext, "PluginProps", required);
|
|
98
|
+
|
|
71
99
|
// src/contexts/RefreshPayloadContext/Provider.tsx
|
|
72
|
-
import { useState } from "react";
|
|
100
|
+
import { useState as useState2 } from "react";
|
|
73
101
|
|
|
74
102
|
// src/contexts/RefreshPayloadContext/Context.ts
|
|
75
|
-
import { createContextEx as
|
|
76
|
-
var RefreshPayloadContext =
|
|
103
|
+
import { createContextEx as createContextEx3 } from "@xylabs/react-shared";
|
|
104
|
+
var RefreshPayloadContext = createContextEx3();
|
|
77
105
|
|
|
78
106
|
// src/contexts/RefreshPayloadContext/Provider.tsx
|
|
79
|
-
import { jsx as
|
|
107
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
80
108
|
var RefreshPayloadProvider = ({
|
|
81
109
|
children,
|
|
82
110
|
onRefresh,
|
|
83
111
|
refreshPayload
|
|
84
112
|
}) => {
|
|
85
|
-
const [localRefreshPayload,
|
|
113
|
+
const [localRefreshPayload, setLocalRefreshPayload] = useState2(refreshPayload);
|
|
86
114
|
return (
|
|
87
115
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
88
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ jsx4(
|
|
89
117
|
RefreshPayloadContext,
|
|
90
118
|
{
|
|
91
119
|
value: {
|
|
92
120
|
onRefresh,
|
|
93
121
|
provided: true,
|
|
94
122
|
refreshPayload: localRefreshPayload,
|
|
95
|
-
setRefreshPayload
|
|
123
|
+
setRefreshPayload: setLocalRefreshPayload
|
|
96
124
|
},
|
|
97
125
|
children
|
|
98
126
|
}
|
|
@@ -101,40 +129,41 @@ var RefreshPayloadProvider = ({
|
|
|
101
129
|
};
|
|
102
130
|
|
|
103
131
|
// src/contexts/RefreshPayloadContext/use.ts
|
|
104
|
-
import { useContextEx as
|
|
105
|
-
var useRefreshPayload = () =>
|
|
132
|
+
import { useContextEx as useContextEx3 } from "@xylabs/react-shared";
|
|
133
|
+
var useRefreshPayload = () => useContextEx3(RefreshPayloadContext, "RefreshPayload", true);
|
|
106
134
|
|
|
107
135
|
// src/contexts/ResolvePayloadContext/Context.ts
|
|
108
|
-
import { createContextEx as
|
|
109
|
-
var ResolvePayloadContext =
|
|
136
|
+
import { createContextEx as createContextEx4 } from "@xylabs/react-shared";
|
|
137
|
+
var ResolvePayloadContext = createContextEx4();
|
|
110
138
|
|
|
111
139
|
// src/contexts/ResolvePayloadContext/Provider.tsx
|
|
112
140
|
import { delay } from "@xylabs/delay";
|
|
113
141
|
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
142
|
+
import { isDefined } from "@xylabs/typeof";
|
|
114
143
|
import { Huri } from "@xyo-network/huri";
|
|
115
144
|
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
|
116
|
-
import { useEffect, useState as
|
|
117
|
-
import { jsx as
|
|
145
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
146
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
118
147
|
var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
|
119
|
-
const [payload, setPayload] =
|
|
120
|
-
const [huri, setHuri] =
|
|
148
|
+
const [payload, setPayload] = useState3();
|
|
149
|
+
const [huri, setHuri] = useState3();
|
|
121
150
|
const {
|
|
122
151
|
refreshPayload,
|
|
123
152
|
setRefreshPayload,
|
|
124
153
|
onRefresh
|
|
125
154
|
} = useRefreshPayload();
|
|
126
|
-
|
|
155
|
+
useEffect2(() => {
|
|
127
156
|
typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
|
|
128
157
|
if (typeof huriPayload === "object") {
|
|
129
158
|
setPayload(huriPayload);
|
|
130
159
|
setRefreshPayload?.(true);
|
|
131
160
|
}
|
|
132
161
|
}, [huriPayload, setRefreshPayload]);
|
|
133
|
-
const [notFound, setNotFound] =
|
|
134
|
-
const [huriError, setHuriError] =
|
|
162
|
+
const [notFound, setNotFound] = useState3();
|
|
163
|
+
const [huriError, setHuriError] = useState3();
|
|
135
164
|
useAsyncEffect(
|
|
136
165
|
async (mounted) => {
|
|
137
|
-
if (huri && !refreshPayload) {
|
|
166
|
+
if (isDefined(huri) && !refreshPayload) {
|
|
138
167
|
try {
|
|
139
168
|
const huriInstance = new Huri(huri);
|
|
140
169
|
const result = await huriInstance.fetch();
|
|
@@ -158,13 +187,13 @@ var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
|
|
158
187
|
);
|
|
159
188
|
const refreshHuri = () => {
|
|
160
189
|
onRefresh?.();
|
|
161
|
-
if (huri) {
|
|
190
|
+
if (isDefined(huri)) {
|
|
162
191
|
setRefreshPayload?.(false);
|
|
163
192
|
}
|
|
164
193
|
};
|
|
165
194
|
return (
|
|
166
195
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
167
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ jsx5(
|
|
168
197
|
ResolvePayloadContext,
|
|
169
198
|
{
|
|
170
199
|
value: {
|
|
@@ -183,25 +212,25 @@ var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
|
|
183
212
|
};
|
|
184
213
|
|
|
185
214
|
// src/contexts/ResolvePayloadContext/use.ts
|
|
186
|
-
import { useContextEx as
|
|
187
|
-
var useResolvePayload = () =>
|
|
215
|
+
import { useContextEx as useContextEx4 } from "@xylabs/react-shared";
|
|
216
|
+
var useResolvePayload = () => useContextEx4(ResolvePayloadContext, "ResolvePayload", true);
|
|
188
217
|
|
|
189
218
|
// src/contexts/ValidatePayloadContext/Provider.tsx
|
|
190
219
|
import { Chip } from "@mui/material";
|
|
191
220
|
import { useAsyncEffect as useAsyncEffect2 } from "@xylabs/react-async-effect";
|
|
192
221
|
import { SchemaCache } from "@xyo-network/schema-cache";
|
|
193
|
-
import { useState as
|
|
222
|
+
import { useState as useState4 } from "react";
|
|
194
223
|
|
|
195
224
|
// src/contexts/ValidatePayloadContext/Context.ts
|
|
196
|
-
import { createContextEx as
|
|
197
|
-
var ValidatePayloadContext =
|
|
225
|
+
import { createContextEx as createContextEx5 } from "@xylabs/react-shared";
|
|
226
|
+
var ValidatePayloadContext = createContextEx5();
|
|
198
227
|
|
|
199
228
|
// src/contexts/ValidatePayloadContext/Provider.tsx
|
|
200
|
-
import { Fragment, jsx as
|
|
229
|
+
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
201
230
|
var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
|
202
231
|
const { payload } = useResolvePayload();
|
|
203
|
-
const [initialized, setInitialized] =
|
|
204
|
-
const [valid, setValid] =
|
|
232
|
+
const [initialized, setInitialized] = useState4(false);
|
|
233
|
+
const [valid, setValid] = useState4();
|
|
205
234
|
useAsyncEffect2(
|
|
206
235
|
async () => {
|
|
207
236
|
if (payload && enabled) {
|
|
@@ -218,7 +247,7 @@ var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
|
|
218
247
|
);
|
|
219
248
|
return (
|
|
220
249
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
221
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx6(
|
|
222
251
|
ValidatePayloadContext,
|
|
223
252
|
{
|
|
224
253
|
value: {
|
|
@@ -227,20 +256,20 @@ var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
|
|
227
256
|
schema: payload?.schema,
|
|
228
257
|
validPayload: valid
|
|
229
258
|
},
|
|
230
|
-
children: enabled ? /* @__PURE__ */
|
|
259
|
+
children: enabled ? /* @__PURE__ */ jsx6(Fragment, { children: initialized ? children : /* @__PURE__ */ jsx6(Chip, { label: "Validating Payload..." }) }) : children
|
|
231
260
|
}
|
|
232
261
|
)
|
|
233
262
|
);
|
|
234
263
|
};
|
|
235
264
|
|
|
236
265
|
// src/contexts/ValidatePayloadContext/use.ts
|
|
237
|
-
import { useContextEx as
|
|
238
|
-
var useValidatePayload = () =>
|
|
266
|
+
import { useContextEx as useContextEx5 } from "@xylabs/react-shared";
|
|
267
|
+
var useValidatePayload = () => useContextEx5(ValidatePayloadContext, "ValidateSchema", true);
|
|
239
268
|
|
|
240
269
|
// src/components/embed-card/menu/EmbedMenu.tsx
|
|
241
270
|
import { MoreVert as MoreVertIcon } from "@mui/icons-material";
|
|
242
271
|
import { IconButton, Menu } from "@mui/material";
|
|
243
|
-
import { useState as
|
|
272
|
+
import { useState as useState5 } from "react";
|
|
244
273
|
|
|
245
274
|
// src/components/embed-card/menu/JsonMenuItem.tsx
|
|
246
275
|
import { OpenInNew as OpenInNewIcon } from "@mui/icons-material";
|
|
@@ -249,19 +278,20 @@ import {
|
|
|
249
278
|
ListItemText,
|
|
250
279
|
MenuItem
|
|
251
280
|
} from "@mui/material";
|
|
252
|
-
import {
|
|
281
|
+
import { isDefined as isDefined2 } from "@xylabs/typeof";
|
|
282
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
283
|
var JsonMenuItem = (props) => {
|
|
254
284
|
const { huri } = useResolvePayload();
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ jsx7(Fragment2, { children: isDefined2(huri) ? /* @__PURE__ */ jsxs2(MenuItem, { title: "Source Payload JSON", onClick: () => window.open(huri, "_blank"), ...props, children: [
|
|
286
|
+
/* @__PURE__ */ jsx7(ListItemText, { sx: { mr: 1 }, children: "JSON" }),
|
|
287
|
+
/* @__PURE__ */ jsx7(ListItemIcon, { sx: { justifyContent: "end" }, children: /* @__PURE__ */ jsx7(OpenInNewIcon, { fontSize: "small" }) })
|
|
258
288
|
] }) : null });
|
|
259
289
|
};
|
|
260
290
|
|
|
261
291
|
// src/components/embed-card/menu/EmbedMenu.tsx
|
|
262
|
-
import { Fragment as Fragment3, jsx as
|
|
292
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
263
293
|
var EmbedMenu = (props) => {
|
|
264
|
-
const [anchorEl, setAnchorEl] =
|
|
294
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
265
295
|
const open = Boolean(anchorEl);
|
|
266
296
|
const handleClick = (event) => {
|
|
267
297
|
setAnchorEl(event.currentTarget);
|
|
@@ -270,8 +300,8 @@ var EmbedMenu = (props) => {
|
|
|
270
300
|
setAnchorEl(null);
|
|
271
301
|
};
|
|
272
302
|
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ jsx8(IconButton, { onClick: handleClick, ...props, children: /* @__PURE__ */ jsx8(MoreVertIcon, {}) }),
|
|
304
|
+
/* @__PURE__ */ jsx8(
|
|
275
305
|
Menu,
|
|
276
306
|
{
|
|
277
307
|
anchorEl,
|
|
@@ -281,14 +311,14 @@ var EmbedMenu = (props) => {
|
|
|
281
311
|
paper: { variant: "elevation" },
|
|
282
312
|
list: { dense: true }
|
|
283
313
|
},
|
|
284
|
-
children: /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ jsx8(JsonMenuItem, {})
|
|
285
315
|
}
|
|
286
316
|
)
|
|
287
317
|
] });
|
|
288
318
|
};
|
|
289
319
|
|
|
290
320
|
// src/components/embed-card/card/EmbedCardHeader.tsx
|
|
291
|
-
import { Fragment as Fragment4, jsx as
|
|
321
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
292
322
|
var EmbedCardHeader = () => {
|
|
293
323
|
const { refreshHuri, huri } = useResolvePayload();
|
|
294
324
|
const {
|
|
@@ -304,22 +334,22 @@ var EmbedCardHeader = () => {
|
|
|
304
334
|
hideCardActions
|
|
305
335
|
} = hideElementsConfig ?? {};
|
|
306
336
|
const timestamp = Date.now();
|
|
307
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ jsx9(
|
|
308
338
|
CardHeader,
|
|
309
339
|
{
|
|
310
340
|
sx: { flexWrap: "wrap", rowGap: 1 },
|
|
311
|
-
avatar: hideAvatar ? /* @__PURE__ */
|
|
341
|
+
avatar: hideAvatar ? /* @__PURE__ */ jsx9(Fragment4, {}) : /* @__PURE__ */ jsx9(Avatar, { sx: { bgcolor: (theme) => theme.vars.palette.primary.main }, "aria-label": activePlugin?.name, children: activePlugin?.name?.charAt(0) }),
|
|
312
342
|
action: /* @__PURE__ */ jsxs4(FlexRow, { flexWrap: "wrap", columnGap: 0.5, children: [
|
|
313
|
-
timestamp ? hideTimestamp && hideRefreshButton ? "" : /* @__PURE__ */
|
|
343
|
+
isDefined3(timestamp) && !Number.isNaN(timestamp) ? hideTimestamp && hideRefreshButton ? "" : /* @__PURE__ */ jsx9(
|
|
314
344
|
Chip2,
|
|
315
345
|
{
|
|
316
|
-
avatar: hideRefreshButton ? /* @__PURE__ */
|
|
346
|
+
avatar: hideRefreshButton ? /* @__PURE__ */ jsx9(Fragment4, {}) : /* @__PURE__ */ jsx9(RefreshIcon, {}),
|
|
317
347
|
clickable: hideRefreshButton ? false : true,
|
|
318
348
|
onClick: refreshHuri,
|
|
319
349
|
label: hideTimestamp ? "" : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`
|
|
320
350
|
}
|
|
321
351
|
) : null,
|
|
322
|
-
hideCardActions || huri === void 0 ? null : /* @__PURE__ */
|
|
352
|
+
hideCardActions || huri === void 0 ? null : /* @__PURE__ */ jsx9(EmbedMenu, {})
|
|
323
353
|
] }),
|
|
324
354
|
title: hideTitle ? "" : activePlugin?.name
|
|
325
355
|
}
|
|
@@ -329,11 +359,12 @@ var EmbedCardHeader = () => {
|
|
|
329
359
|
// src/components/embed-card/card/EmbedPluginCard.tsx
|
|
330
360
|
import { CardContent } from "@mui/material";
|
|
331
361
|
import { FlexGrowRow } from "@xylabs/react-flexbox";
|
|
362
|
+
import { isTruthy } from "@xylabs/typeof";
|
|
332
363
|
import { useListMode as useListMode2 } from "@xyo-network/react-shared";
|
|
333
364
|
|
|
334
365
|
// src/components/controls/EmbedFormControl.tsx
|
|
335
366
|
import { FormControl, InputLabel } from "@mui/material";
|
|
336
|
-
import { jsx as
|
|
367
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
337
368
|
var EmbedFormControl = ({
|
|
338
369
|
formId,
|
|
339
370
|
formLabel,
|
|
@@ -341,7 +372,7 @@ var EmbedFormControl = ({
|
|
|
341
372
|
...props
|
|
342
373
|
}) => {
|
|
343
374
|
return /* @__PURE__ */ jsxs5(FormControl, { ...props, children: [
|
|
344
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ jsx10(InputLabel, { id: formId, children: formLabel }),
|
|
345
376
|
children
|
|
346
377
|
] });
|
|
347
378
|
};
|
|
@@ -350,7 +381,7 @@ var EmbedFormControl = ({
|
|
|
350
381
|
import { MenuItem as MenuItem2 } from "@mui/material";
|
|
351
382
|
import { SelectEx } from "@xylabs/react-select";
|
|
352
383
|
import { useListMode } from "@xyo-network/react-shared";
|
|
353
|
-
import { jsx as
|
|
384
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
354
385
|
var listModeSelectId = "listmode-select-id";
|
|
355
386
|
var listModeSelectLabel = "List Mode";
|
|
356
387
|
var ListModeSelect = (props) => {
|
|
@@ -364,21 +395,21 @@ var ListModeSelect = (props) => {
|
|
|
364
395
|
},
|
|
365
396
|
...props,
|
|
366
397
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ jsx11(MenuItem2, { value: "default", children: "Default" }, "default"),
|
|
399
|
+
/* @__PURE__ */ jsx11(MenuItem2, { value: "table", children: "Table" }, "table"),
|
|
400
|
+
/* @__PURE__ */ jsx11(MenuItem2, { value: "grid", children: "Grid" }, "grid")
|
|
370
401
|
]
|
|
371
402
|
}
|
|
372
403
|
);
|
|
373
404
|
};
|
|
374
405
|
var ListModeSelectFormControl = (props) => {
|
|
375
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ jsx11(EmbedFormControl, { formId: listModeSelectId, formLabel: listModeSelectLabel, children: /* @__PURE__ */ jsx11(ListModeSelect, { size: "small", label: listModeSelectLabel, labelId: listModeSelectId, ...props }) });
|
|
376
407
|
};
|
|
377
408
|
|
|
378
409
|
// src/components/controls/RenderSelect.tsx
|
|
379
410
|
import { MenuItem as MenuItem3 } from "@mui/material";
|
|
380
411
|
import { SelectEx as SelectEx2 } from "@xylabs/react-select";
|
|
381
|
-
import { jsx as
|
|
412
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
382
413
|
var renderSelectId = "render-select-id";
|
|
383
414
|
var renderSelectLabel = "Renderer";
|
|
384
415
|
var EmbedRenderSelect = (props) => {
|
|
@@ -387,11 +418,11 @@ var EmbedRenderSelect = (props) => {
|
|
|
387
418
|
setActivePlugin,
|
|
388
419
|
plugins
|
|
389
420
|
} = useEmbedPluginState();
|
|
390
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ jsx12(EmbedFormControl, { formId: renderSelectId, formLabel: renderSelectLabel, children: /* @__PURE__ */ jsx12(SelectEx2, { size: "small", value: activePlugin?.name, ...props, children: plugins?.map((plugin) => /* @__PURE__ */ jsx12(MenuItem3, { value: plugin.name, onClick: () => setActivePlugin?.(plugin), children: plugin.name }, plugin.name)) }) });
|
|
391
422
|
};
|
|
392
423
|
|
|
393
424
|
// src/components/embed-card/card/EmbedPluginCard.tsx
|
|
394
|
-
import { jsx as
|
|
425
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
395
426
|
var EmbedPluginCard = ({ ...props }) => {
|
|
396
427
|
const { payload } = useResolvePayload();
|
|
397
428
|
const {
|
|
@@ -400,14 +431,15 @@ var EmbedPluginCard = ({ ...props }) => {
|
|
|
400
431
|
hideElementsConfig
|
|
401
432
|
} = useEmbedPluginState();
|
|
402
433
|
const { listMode } = useListMode2();
|
|
403
|
-
const
|
|
434
|
+
const { pluginProps } = usePluginProps();
|
|
435
|
+
const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false;
|
|
404
436
|
return /* @__PURE__ */ jsxs7(BusyCard, { ...props, children: [
|
|
405
|
-
hideElementsConfig?.hideCardHeader ? null : /* @__PURE__ */
|
|
437
|
+
hideElementsConfig?.hideCardHeader ? null : /* @__PURE__ */ jsx13(EmbedCardHeader, {}),
|
|
406
438
|
plugins && plugins.length > 0 || supportsListMode ? /* @__PURE__ */ jsxs7(FlexGrowRow, { columnGap: 2, rowGap: 2, flexWrap: "wrap", pb: 1, children: [
|
|
407
|
-
plugins && plugins.length > 1 ? /* @__PURE__ */
|
|
408
|
-
supportsListMode ? /* @__PURE__ */
|
|
439
|
+
plugins && plugins.length > 1 ? /* @__PURE__ */ jsx13(EmbedRenderSelect, {}) : null,
|
|
440
|
+
supportsListMode ? /* @__PURE__ */ jsx13(ListModeSelectFormControl, {}) : null
|
|
409
441
|
] }) : null,
|
|
410
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ jsx13(CardContent, { sx: { height: "100%" }, children: ActivePlugin ? /* @__PURE__ */ jsx13(ActivePlugin.components.box.detailsBox, { payload, ...pluginProps, ...supportsListMode && { listMode } }) : null })
|
|
411
443
|
] });
|
|
412
444
|
};
|
|
413
445
|
|
|
@@ -420,19 +452,19 @@ import { ListModeProvider } from "@xyo-network/react-shared";
|
|
|
420
452
|
|
|
421
453
|
// src/components/EmbedResolver.tsx
|
|
422
454
|
import { LoadResult } from "@xyo-network/react-shared";
|
|
423
|
-
import { jsx as
|
|
455
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
424
456
|
var EmbedResolver = ({ children }) => {
|
|
425
457
|
const {
|
|
426
458
|
payload,
|
|
427
459
|
notFound,
|
|
428
460
|
huriError
|
|
429
461
|
} = useResolvePayload();
|
|
430
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsx14(LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
|
|
431
463
|
};
|
|
432
464
|
|
|
433
465
|
// src/components/validation-alerts/ValidatePayload.tsx
|
|
434
466
|
import { Alert } from "@mui/material";
|
|
435
|
-
import { Fragment as Fragment5, jsx as
|
|
467
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
436
468
|
var ValidatePayloadAlert = ({ children, ...props }) => {
|
|
437
469
|
const {
|
|
438
470
|
validPayload,
|
|
@@ -448,26 +480,26 @@ var ValidatePayloadAlert = ({ children, ...props }) => {
|
|
|
448
480
|
"but failed to validate."
|
|
449
481
|
] });
|
|
450
482
|
}
|
|
451
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ jsx15(Fragment5, { children });
|
|
452
484
|
};
|
|
453
485
|
|
|
454
486
|
// src/components/validation-alerts/ValidatePlugins.tsx
|
|
455
487
|
import { Alert as Alert2, AlertTitle } from "@mui/material";
|
|
456
|
-
import { Fragment as Fragment6, jsx as
|
|
488
|
+
import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
457
489
|
var ValidatePluginsAlert = ({ children, ...props }) => {
|
|
458
490
|
const { payload } = useResolvePayload();
|
|
459
491
|
const { plugins } = useEmbedPluginState();
|
|
460
492
|
if (payload && plugins?.length === 0) {
|
|
461
493
|
return /* @__PURE__ */ jsxs9(Alert2, { severity: "warning", ...props, children: [
|
|
462
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ jsx16(AlertTitle, { children: "Missing plugins!" }),
|
|
463
495
|
"Payload found but no plugins were present."
|
|
464
496
|
] });
|
|
465
497
|
}
|
|
466
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx16(Fragment6, { children });
|
|
467
499
|
};
|
|
468
500
|
|
|
469
501
|
// src/components/EmbedPlugin.tsx
|
|
470
|
-
import { jsx as
|
|
502
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
471
503
|
var EmbedPluginInner = ({
|
|
472
504
|
validateSchema,
|
|
473
505
|
plugins,
|
|
@@ -479,7 +511,7 @@ var EmbedPluginInner = ({
|
|
|
479
511
|
onRefresh,
|
|
480
512
|
children
|
|
481
513
|
}) => {
|
|
482
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsx17(ErrorBoundary, { children: /* @__PURE__ */ jsx17(
|
|
483
515
|
EmbedPluginProvider,
|
|
484
516
|
{
|
|
485
517
|
refreshTitle,
|
|
@@ -487,7 +519,7 @@ var EmbedPluginInner = ({
|
|
|
487
519
|
hideElementsConfig,
|
|
488
520
|
plugins,
|
|
489
521
|
embedPluginConfig,
|
|
490
|
-
children: /* @__PURE__ */
|
|
522
|
+
children: /* @__PURE__ */ jsx17(WithResolvers, { onRefresh, huriPayload, children: /* @__PURE__ */ jsx17(WithValidators, { validateSchema, children: /* @__PURE__ */ jsx17(ListModeProvider, { defaultListMode: embedPluginConfig?.listMode, children }) }) })
|
|
491
523
|
}
|
|
492
524
|
) });
|
|
493
525
|
};
|
|
@@ -496,10 +528,10 @@ var WithResolvers = ({
|
|
|
496
528
|
onRefresh,
|
|
497
529
|
huriPayload
|
|
498
530
|
}) => {
|
|
499
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ jsx17(RefreshPayloadProvider, { onRefresh, children: /* @__PURE__ */ jsx17(ResolvePayloadProvider, { huriPayload, children: /* @__PURE__ */ jsx17(EmbedResolver, { children }) }) });
|
|
500
532
|
};
|
|
501
533
|
var WithValidators = ({ children, validateSchema }) => {
|
|
502
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ jsx17(ValidatePayloadProvider, { enabled: validateSchema, children: /* @__PURE__ */ jsx17(ValidatePluginsAlert, { children: /* @__PURE__ */ jsx17(ValidatePayloadAlert, { children }) }) });
|
|
503
535
|
};
|
|
504
536
|
|
|
505
537
|
// src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx
|
|
@@ -513,7 +545,8 @@ import {
|
|
|
513
545
|
CardContent as CardContent2,
|
|
514
546
|
Typography
|
|
515
547
|
} from "@mui/material";
|
|
516
|
-
import {
|
|
548
|
+
import { isDefined as isDefined4 } from "@xylabs/typeof";
|
|
549
|
+
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
517
550
|
var EmbedErrorCard = (props) => {
|
|
518
551
|
const {
|
|
519
552
|
alertProps,
|
|
@@ -529,7 +562,7 @@ var EmbedErrorCard = (props) => {
|
|
|
529
562
|
hideErrorDetails,
|
|
530
563
|
scope
|
|
531
564
|
};
|
|
532
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ jsx18(Card2, { ...cardProps, children: /* @__PURE__ */ jsx18(CardContent2, { children: children ?? /* @__PURE__ */ jsx18(DefaultErrorAlert, { ...errorProps }) }) });
|
|
533
566
|
};
|
|
534
567
|
var DefaultErrorAlert = ({
|
|
535
568
|
alertProps,
|
|
@@ -538,33 +571,33 @@ var DefaultErrorAlert = ({
|
|
|
538
571
|
error
|
|
539
572
|
}) => {
|
|
540
573
|
return /* @__PURE__ */ jsxs10(Alert3, { severity: "error", ...alertProps, children: [
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
scope ? /* @__PURE__ */ jsxs10(Typography, { variant: "caption", children: [
|
|
574
|
+
/* @__PURE__ */ jsx18(AlertTitle2, { children: "Whoops! Something went wrong" }),
|
|
575
|
+
isDefined4(scope) ? /* @__PURE__ */ jsxs10(Typography, { variant: "caption", children: [
|
|
543
576
|
"Scope:",
|
|
544
577
|
scope
|
|
545
578
|
] }) : null,
|
|
546
579
|
!hideErrorDetails && error ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
] }) : /* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ jsx18(Typography, { variant: "caption", children: "Error: " }),
|
|
581
|
+
/* @__PURE__ */ jsx18(Typography, { variant: "caption", children: error?.message })
|
|
582
|
+
] }) : /* @__PURE__ */ jsx18(Typography, { variant: "caption", fontSize: "small", children: "Error Loading Plugin" })
|
|
550
583
|
] });
|
|
551
584
|
};
|
|
552
585
|
|
|
553
586
|
// src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx
|
|
554
|
-
import { jsx as
|
|
587
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
555
588
|
var EmbedCardApiErrorRenderer = ({
|
|
556
589
|
xyoError,
|
|
557
590
|
children,
|
|
558
591
|
...props
|
|
559
592
|
}) => {
|
|
560
|
-
return /* @__PURE__ */
|
|
593
|
+
return /* @__PURE__ */ jsx19(ErrorRender, { error: xyoError, noReAuth: true, noErrorDisplay: true, customError: /* @__PURE__ */ jsx19(CustomApiErrorCard, { xyoError, ...props }), children });
|
|
561
594
|
};
|
|
562
595
|
var CustomApiErrorCard = ({ xyoError, ...props }) => {
|
|
563
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ jsx19(EmbedErrorCard, { ...props, children: /* @__PURE__ */ jsx19(ErrorAlert, { error: xyoError }) });
|
|
564
597
|
};
|
|
565
598
|
|
|
566
599
|
// src/components/embed-card/EmbedPluginCard.tsx
|
|
567
|
-
import { jsx as
|
|
600
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
568
601
|
var ApiEmbedPluginCard = ({ children, ...props }) => {
|
|
569
602
|
const {
|
|
570
603
|
validateSchema,
|
|
@@ -591,7 +624,7 @@ var ApiEmbedPluginCard = ({ children, ...props }) => {
|
|
|
591
624
|
validateSchema
|
|
592
625
|
},
|
|
593
626
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ jsx20(EmbedPluginCardInner, { ...busyCardProps }),
|
|
595
628
|
children
|
|
596
629
|
]
|
|
597
630
|
}
|
|
@@ -601,7 +634,7 @@ var EmbedPluginCardInner = (props) => {
|
|
|
601
634
|
const { payload, huriError } = useResolvePayload();
|
|
602
635
|
const { refreshPayload } = useRefreshPayload();
|
|
603
636
|
const theme = useTheme();
|
|
604
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ jsx20(EmbedCardApiErrorRenderer, { xyoError: huriError, children: /* @__PURE__ */ jsx20(
|
|
605
638
|
EmbedPluginCard,
|
|
606
639
|
{
|
|
607
640
|
elevation: 3,
|
|
@@ -629,11 +662,14 @@ export {
|
|
|
629
662
|
EmbedPluginContext,
|
|
630
663
|
EmbedPluginInner,
|
|
631
664
|
EmbedPluginProvider,
|
|
665
|
+
PluginPropsContext,
|
|
666
|
+
PluginPropsProvider,
|
|
632
667
|
RefreshPayloadProvider,
|
|
633
668
|
ResolvePayloadContext,
|
|
634
669
|
ResolvePayloadProvider,
|
|
635
670
|
ValidatePayloadProvider,
|
|
636
671
|
useEmbedPluginState,
|
|
672
|
+
usePluginProps,
|
|
637
673
|
useRefreshPayload,
|
|
638
674
|
useResolvePayload,
|
|
639
675
|
useValidatePayload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/embed-card/card/BusyCard.tsx","../../src/components/embed-card/card/EmbedCardHeader.tsx","../../src/contexts/EmbedPluginContext/Context.ts","../../src/contexts/EmbedPluginContext/Provider.tsx","../../src/contexts/EmbedPluginContext/use.ts","../../src/contexts/RefreshPayloadContext/Provider.tsx","../../src/contexts/RefreshPayloadContext/Context.ts","../../src/contexts/RefreshPayloadContext/use.ts","../../src/contexts/ResolvePayloadContext/Context.ts","../../src/contexts/ResolvePayloadContext/Provider.tsx","../../src/contexts/ResolvePayloadContext/use.ts","../../src/contexts/ValidatePayloadContext/Provider.tsx","../../src/contexts/ValidatePayloadContext/Context.ts","../../src/contexts/ValidatePayloadContext/use.ts","../../src/components/embed-card/menu/EmbedMenu.tsx","../../src/components/embed-card/menu/JsonMenuItem.tsx","../../src/components/embed-card/card/EmbedPluginCard.tsx","../../src/components/controls/EmbedFormControl.tsx","../../src/components/controls/ListModeSelect.tsx","../../src/components/controls/RenderSelect.tsx","../../src/components/embed-card/EmbedPluginCard.tsx","../../src/components/EmbedPlugin.tsx","../../src/components/EmbedResolver.tsx","../../src/components/validation-alerts/ValidatePayload.tsx","../../src/components/validation-alerts/ValidatePlugins.tsx","../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx","../../src/components/embed-card/error-handling/EmbedErrorCard.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useBusyTiming } from '@xylabs/react-flexbox'\nimport type {\n BusyCircularProgressProps,\n BusyLinearProgressProps,\n BusyVariant,\n} from '@xylabs/react-shared'\nimport {\n BusyCircularProgress,\n BusyLinearProgress,\n} from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nexport interface BusyCardProps extends CardProps {\n busy?: boolean\n busyMinimum?: number\n busyVariant?: BusyVariant\n busyVariantProps?: BusyCircularProgressProps | BusyLinearProgressProps\n}\n\nexport const BusyCard: React.FC<PropsWithChildren<BusyCardProps>> = ({\n busy,\n busyMinimum = 500,\n busyVariant = 'circular',\n busyVariantProps,\n children,\n ...props\n}) => {\n const internalBusy = useBusyTiming(busy, busyMinimum)\n return (\n <Card {...props}>\n {children}\n {busyVariant === 'circular' && internalBusy\n ? <BusyCircularProgress {...(busyVariantProps as BusyCircularProgressProps)} />\n : null}\n {busyVariant === 'linear' && internalBusy\n ? <BusyLinearProgress {...(busyVariantProps as BusyLinearProgressProps)} />\n : null}\n </Card>\n )\n}\n","import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps, Theme } from '@mui/material'\nimport {\n Avatar, CardHeader, Chip,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'\nimport { EmbedMenu } from '../menu/index.ts'\n\nexport const EmbedCardHeader: React.FC<CardHeaderProps> = () => {\n const { refreshHuri, huri } = useResolvePayload()\n const {\n activePlugin, timestampLabel, hideElementsConfig,\n } = useEmbedPluginState()\n const {\n hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions,\n } = hideElementsConfig ?? {}\n // this is temporary so that we can add the ability to get a timestamp via diviner later\n const timestamp = Date.now()\n return (\n <CardHeader\n sx={{ flexWrap: 'wrap', rowGap: 1 }}\n avatar={\n hideAvatar\n ? <></>\n : (\n <Avatar sx={{ bgcolor: (theme: Theme) => theme.vars.palette.primary.main }} aria-label={activePlugin?.name}>\n {activePlugin?.name?.charAt(0)}\n </Avatar>\n )\n }\n action={(\n <FlexRow flexWrap=\"wrap\" columnGap={0.5}>\n {timestamp\n ? hideTimestamp && hideRefreshButton\n ? ''\n : (\n <Chip\n avatar={hideRefreshButton ? <></> : <RefreshIcon />}\n clickable={hideRefreshButton ? false : true}\n onClick={refreshHuri}\n label={hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`}\n />\n )\n\n : null}\n {/* Huri case is valid as long as the only menu item is JSON */}\n {hideCardActions || huri === undefined ? null : <EmbedMenu />}\n </FlexRow>\n )}\n title={hideTitle ? '' : activePlugin?.name}\n />\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { EmbedPluginState } from './State.ts'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedPluginContext } from './Context.ts'\nimport type { EmbedPluginBase } from './State.ts'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<PropsWithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useResetState(plugins ? plugins[0] : undefined)\n\n return (\n <EmbedPluginContext\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n value={{\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }}\n >\n {children}\n </EmbedPluginContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { EmbedPluginContext } from './Context.ts'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n","import type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<PropsWithChildren<RefreshPayloadProps>> = ({\n children, onRefresh, refreshPayload,\n}) => {\n const [localRefreshPayload, setRefreshPayload] = useState(refreshPayload)\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <RefreshPayloadContext value={{\n onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload,\n }}\n >\n {children}\n </RefreshPayloadContext>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { RefreshPayloadState } from './State.ts'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ResolvePayloadState } from './State.ts'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","/* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */\nimport { delay } from '@xylabs/delay'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { Huri } from '@xyo-network/huri'\nimport type {\n ModuleError, Payload, WithSources,\n} from '@xyo-network/payload-model'\nimport { ModuleErrorSchema } from '@xyo-network/payload-model'\nimport type { PropsWithChildren } from 'react'\nimport React, { useEffect, useState } from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext/index.ts'\nimport { ResolvePayloadContext } from './Context.ts'\nimport type { ResolvePayloadState } from './State.ts'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const {\n refreshPayload, setRefreshPayload, onRefresh,\n } = useRefreshPayload()\n\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n typeof huriPayload === 'string' ? setHuri(huriPayload) : undefined\n if (typeof huriPayload === 'object') {\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n }, [huriPayload, setRefreshPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<WithSources<ModuleError>>()\n\n useAsyncEffect(\n async (mounted) => {\n if (huri && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\n const result = await huriInstance.fetch()\n // ensure the busy state can stay for a moment to avoid flashing too quickly\n await delay(500)\n\n if (mounted()) {\n setNotFound(result === null)\n setPayload(result)\n setRefreshPayload?.(true)\n }\n } catch (e) {\n const error = e as Error\n setHuriError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = () => {\n onRefresh?.()\n if (huri) {\n setRefreshPayload?.(false)\n }\n }\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <ResolvePayloadContext value={{\n huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload,\n }}\n >\n {children}\n </ResolvePayloadContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { ResolvePayloadContext } from './Context.ts'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { SchemaNameToValidatorMap } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext/index.ts'\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport interface ValidatePayloadProviderProps {\n // Opt-in flag to validate payloads for the plugin(s)\n enabled?: boolean\n}\n\nexport const ValidatePayloadProvider: React.FC<PropsWithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n const [valid, setValid] = useState<boolean>()\n\n useAsyncEffect(\n async () => {\n if (payload && enabled) {\n await SchemaCache.instance.get(payload.schema)\n\n const possibleKnownSchema = payload.schema as keyof SchemaNameToValidatorMap\n\n if (SchemaCache.instance.validators[possibleKnownSchema]) {\n const validator = SchemaCache.instance.validators[possibleKnownSchema]\n setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <ValidatePayloadContext value={{\n enabled, provided: true, schema: payload?.schema, validPayload: valid,\n }}\n >\n {enabled\n ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</>\n : children}\n </ValidatePayloadContext>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ValidatePayloadState } from './State.ts'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n","import { MoreVert as MoreVertIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport { IconButton, Menu } from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { JsonMenuItem } from './JsonMenuItem.tsx'\n\nexport const EmbedMenu: React.FC<IconButtonProps> = (props) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = Boolean(anchorEl)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return (\n <>\n <IconButton onClick={handleClick} {...props}>\n <MoreVertIcon />\n </IconButton>\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n slotProps={{\n paper: { variant: 'elevation' },\n list: { dense: true },\n }}\n >\n <JsonMenuItem />\n </Menu>\n </>\n )\n}\n","import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'\nimport type { MenuItemProps } from '@mui/material'\nimport {\n ListItemIcon, ListItemText, MenuItem,\n} from '@mui/material'\nimport React from 'react'\n\nimport { useResolvePayload } from '../../../contexts/index.ts'\n\nexport const JsonMenuItem: React.FC<MenuItemProps> = (props) => {\n const { huri } = useResolvePayload()\n\n return (\n <>\n {huri\n ? (\n <MenuItem title=\"Source Payload JSON\" onClick={() => window.open(huri, '_blank')} {...props}>\n <ListItemText sx={{ mr: 1 }}>JSON</ListItemText>\n <ListItemIcon sx={{ justifyContent: 'end' }}>\n <OpenInNewIcon fontSize=\"small\" />\n </ListItemIcon>\n </MenuItem>\n )\n : null}\n </>\n )\n}\n","import { CardContent } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'\nimport { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'\nimport type { BusyCardProps } from './BusyCard.tsx'\nimport { BusyCard } from './BusyCard.tsx'\nimport { EmbedCardHeader } from './EmbedCardHeader.tsx'\n\nexport const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {\n const { payload } = useResolvePayload()\n const {\n activePlugin: ActivePlugin, plugins, hideElementsConfig,\n } = useEmbedPluginState()\n const { listMode } = useListMode()\n const supportsListMode = ActivePlugin?.components?.box?.listModes?.length ?? 0 > 1\n\n return (\n <BusyCard {...props}>\n {hideElementsConfig?.hideCardHeader ? null : <EmbedCardHeader />}\n {/* Only show the row if the children are present */}\n {(plugins && plugins.length > 0) || supportsListMode\n ? (\n <FlexGrowRow columnGap={2} rowGap={2} flexWrap=\"wrap\" pb={1}>\n {plugins && plugins.length > 1\n ? <EmbedRenderSelect />\n : null}\n {supportsListMode\n ? <ListModeSelectFormControl />\n : null}\n </FlexGrowRow>\n )\n : null}\n <CardContent sx={{ height: '100%' }}>\n {ActivePlugin\n ? <ActivePlugin.components.box.detailsBox payload={payload} {...(supportsListMode && { listMode })} />\n : null}\n </CardContent>\n </BusyCard>\n )\n}\n","import type { FormControlProps } from '@mui/material'\nimport { FormControl, InputLabel } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedFormControlProps extends FormControlProps {\n formId?: string\n formLabel?: string\n}\n\nexport const EmbedFormControl: React.FC<PropsWithChildren<EmbedFormControlProps>> = ({\n formId, formLabel, children, ...props\n}) => {\n return (\n <FormControl {...props}>\n <InputLabel id={formId}>{formLabel}</InputLabel>\n {children}\n </FormControl>\n )\n}\n","import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { ListMode } from '@xyo-network/react-shared'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst listModeSelectId = 'listmode-select-id'\nconst listModeSelectLabel = 'List Mode'\n\nexport const ListModeSelect: React.FC<SelectExProps<ListMode>> = (props) => {\n const { listMode, setListMode } = useListMode()\n\n return (\n <SelectEx<ListMode>\n value={(listMode ?? 'default') as ListMode}\n onChange={(event) => {\n setListMode?.(event.target.value as ListMode)\n }}\n {...props}\n >\n <MenuItem key=\"default\" value=\"default\">\n Default\n </MenuItem>\n <MenuItem key=\"table\" value=\"table\">\n Table\n </MenuItem>\n <MenuItem key=\"grid\" value=\"grid\">\n Grid\n </MenuItem>\n </SelectEx>\n )\n}\n\nexport const ListModeSelectFormControl: React.FC<SelectExProps<ListMode>> = (props) => {\n return (\n <EmbedFormControl formId={listModeSelectId} formLabel={listModeSelectLabel}>\n <ListModeSelect size=\"small\" label={listModeSelectLabel} labelId={listModeSelectId} {...props} />\n </EmbedFormControl>\n )\n}\n","import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useEmbedPluginState } from '../../contexts/index.ts'\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst renderSelectId = 'render-select-id'\nconst renderSelectLabel = 'Renderer'\n\nexport const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {\n const {\n activePlugin, setActivePlugin, plugins,\n } = useEmbedPluginState()\n return (\n <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>\n <SelectEx size=\"small\" value={activePlugin?.name} {...props}>\n {plugins?.map(plugin => (\n <MenuItem value={plugin.name} key={plugin.name} onClick={() => setActivePlugin?.(plugin)}>\n {plugin.name}\n </MenuItem>\n ))}\n </SelectEx>\n </EmbedFormControl>\n )\n}\n","import { useTheme } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'\nimport type { EmbedPluginProps } from '../../types/index.ts'\nimport { EmbedPluginInner } from '../EmbedPlugin.tsx'\nimport type { BusyCardProps } from './card/index.ts'\nimport { EmbedPluginCard } from './card/index.ts'\nimport { EmbedCardApiErrorRenderer } from './error-handling/index.ts'\n\nexport interface EmbedPluginCardProps extends PropsWithChildren, EmbedPluginProps, BusyCardProps {}\n\nexport const ApiEmbedPluginCard: React.FC<EmbedPluginCardProps> = ({ children, ...props }) => {\n const {\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n ...busyCardProps\n } = props\n\n return (\n <EmbedPluginInner\n {...{\n embedPluginConfig,\n hideElementsConfig,\n huriPayload,\n onRefresh,\n plugins,\n refreshTitle,\n timestampLabel,\n validateSchema,\n }}\n >\n <EmbedPluginCardInner {...busyCardProps} />\n {children}\n </EmbedPluginInner>\n )\n}\n\nexport const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {\n const { payload, huriError } = useResolvePayload()\n const { refreshPayload } = useRefreshPayload()\n const theme = useTheme()\n\n return (\n <EmbedCardApiErrorRenderer xyoError={huriError}>\n <EmbedPluginCard\n elevation={3}\n variant=\"elevation\"\n busy={Boolean(!refreshPayload && payload)}\n busyVariantProps={{\n style: {\n alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,\n },\n }}\n sx={{ position: 'relative' }}\n {...props}\n />\n </EmbedCardApiErrorRenderer>\n )\n}\n\n/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */\n\nexport { EmbedPluginCard as EmbedPlugin } from './card/index.ts'\n","import { ErrorBoundary } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { ListModeProvider } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport {\n EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,\n} from '../contexts/index.ts'\nimport type { EmbedPluginProps } from '../types/index.ts'\nimport { EmbedResolver } from './EmbedResolver.tsx'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts/index.ts'\n\nexport const EmbedPluginInner: React.FC<PropsWithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins,\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<PropsWithChildren<WithResolversProps>> = ({\n children, onRefresh, huriPayload,\n}) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<PropsWithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n","import { LoadResult } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useResolvePayload } from '../contexts/index.ts'\n\nexport const EmbedResolver: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n payload, notFound, huriError,\n } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n","import type { AlertProps } from '@mui/material'\nimport { Alert } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useValidatePayload } from '../../contexts/index.ts'\n\nexport const ValidatePayloadAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const {\n validPayload, enabled, schema,\n } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be\n {' '}\n {schema}\n {' '}\n but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import type { AlertProps } from '@mui/material'\nimport { Alert, AlertTitle } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts/index.ts'\n\nexport const ValidatePluginsAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>\n Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import type { CardProps } from '@mui/material'\nimport { ErrorAlert, ErrorRender } from '@xylabs/react-error'\nimport type { ModuleError } from '@xyo-network/payload-model'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedErrorCard } from './EmbedErrorCard.tsx'\n\ninterface EmbedCardApiErrorRendererProps extends CardProps {\n xyoError?: ModuleError\n}\n\nexport const EmbedCardApiErrorRenderer: React.FC<PropsWithChildren<EmbedCardApiErrorRendererProps>> = ({\n xyoError, children, ...props\n}) => {\n return (\n <ErrorRender error={xyoError} noReAuth noErrorDisplay customError={<CustomApiErrorCard xyoError={xyoError} {...props} />}>\n {children}\n </ErrorRender>\n )\n}\n\nconst CustomApiErrorCard: React.FC<EmbedCardApiErrorRendererProps> = ({ xyoError, ...props }) => {\n return (\n <EmbedErrorCard {...props}>\n <ErrorAlert error={xyoError} />\n </EmbedErrorCard>\n )\n}\n","import type { AlertProps, CardProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Card, CardContent, Typography,\n} from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedErrorCardBaseProps {\n alertProps?: AlertProps\n error?: Error\n hideErrorDetails?: boolean\n scope?: string\n}\n\ninterface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}\n\nexport const EmbedErrorCard: React.FC<PropsWithChildren<EmbedErrorCardProps>> = (props) => {\n const {\n alertProps, error, scope, hideErrorDetails = true, children, ...cardProps\n } = props\n const errorProps = {\n alertProps, error, hideErrorDetails, scope,\n }\n return (\n <Card {...cardProps}>\n <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>\n </Card>\n )\n}\n\nconst DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({\n alertProps, scope, hideErrorDetails, error,\n}) => {\n return (\n <Alert severity=\"error\" {...alertProps}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {scope\n ? (\n <Typography variant=\"caption\">\n Scope:\n {scope}\n </Typography>\n )\n : null}\n {!hideErrorDetails && error\n ? (\n <>\n <Typography variant=\"caption\">Error: </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n </>\n )\n : (\n <Typography variant=\"caption\" fontSize=\"small\">\n Error Loading Plugin\n </Typography>\n )}\n </Alert>\n )\n}\n"],"mappings":";AACA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAM9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAqBH,SAGM,KAHN;AAVG,IAAM,WAAuD,CAAC;AAAA,EACnE;AAAA,EACA,cAAc;AAAA,EACd,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,cAAc,MAAM,WAAW;AACpD,SACE,qBAAC,QAAM,GAAG,OACP;AAAA;AAAA,IACA,gBAAgB,cAAc,eAC3B,oBAAC,wBAAsB,GAAI,kBAAgD,IAC3E;AAAA,IACH,gBAAgB,YAAY,eACzB,oBAAC,sBAAoB,GAAI,kBAA8C,IACvE;AAAA,KACN;AAEJ;;;AC1CA,SAAS,WAAW,mBAAmB;AAEvC;AAAA,EACE;AAAA,EAAQ;AAAA,EAAY,QAAAA;AAAA,OACf;AACP,SAAS,eAAe;;;ACLxB,SAAS,uBAAuB;AAIzB,IAAM,qBAAqB,gBAAkC;;;ACJpE,SAAS,qBAAqB;AAqB1B,gBAAAC,YAAA;AAXG,IAAM,sBAA6E,CAAC;AAAA,EACzF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,cAAc,eAAe,IAAI,cAAc,UAAU,QAAQ,CAAC,IAAI,MAAS;AAEtF,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MAEC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAA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ACH;AAEJ;AAEO,IAAM,uBAAgD,CAAC,UAAU;AACtE,QAAM,EAAE,SAAS,UAAU,IAAI,kBAAkB;AACjD,QAAM,EAAE,eAAe,IAAI,kBAAkB;AAC7C,QAAM,QAAQ,SAAS;AAEvB,SACE,gBAAAA,MAAC,6BAA0B,UAAU,WACnC,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,SAAQ;AAAA,MACR,MAAM,QAAQ,CAAC,kBAAkB,OAAO;AAAA,MACxC,kBAAkB;AAAA,QAChB,OAAO;AAAA,UACL,YAAY;AAAA,UAAS,YAAY,MAAM,QAAQ,CAAC;AAAA,UAAG,QAAQ;AAAA,QAC7D;AAAA,MACF;AAAA,MACA,IAAI,EAAE,UAAU,WAAW;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;","names":["Chip","jsx","createContextEx","jsx","useContextEx","useContextEx","createContextEx","useState","jsx","useState","useContextEx","useContextEx","useAsyncEffect","useState","createContextEx","jsx","useState","useAsyncEffect","useContextEx","useContextEx","useState","Fragment","jsx","jsxs","Fragment","jsx","jsxs","useState","Fragment","jsx","jsxs","Chip","useListMode","jsx","jsxs","MenuItem","jsx","jsxs","MenuItem","MenuItem","SelectEx","jsx","SelectEx","MenuItem","jsx","jsxs","useListMode","jsx","Fragment","jsx","jsxs","Alert","Fragment","jsx","jsxs","Alert","jsx","Alert","AlertTitle","Card","CardContent","Fragment","jsx","jsxs","jsx","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/embed-card/card/BusyCard.tsx","../../src/components/embed-card/card/EmbedCardHeader.tsx","../../src/contexts/EmbedPluginContext/Context.ts","../../src/contexts/EmbedPluginContext/Provider.tsx","../../src/contexts/EmbedPluginContext/use.ts","../../src/contexts/PluginPropsContext/context.ts","../../src/contexts/PluginPropsContext/Provider.tsx","../../src/contexts/PluginPropsContext/use.ts","../../src/contexts/RefreshPayloadContext/Provider.tsx","../../src/contexts/RefreshPayloadContext/Context.ts","../../src/contexts/RefreshPayloadContext/use.ts","../../src/contexts/ResolvePayloadContext/Context.ts","../../src/contexts/ResolvePayloadContext/Provider.tsx","../../src/contexts/ResolvePayloadContext/use.ts","../../src/contexts/ValidatePayloadContext/Provider.tsx","../../src/contexts/ValidatePayloadContext/Context.ts","../../src/contexts/ValidatePayloadContext/use.ts","../../src/components/embed-card/menu/EmbedMenu.tsx","../../src/components/embed-card/menu/JsonMenuItem.tsx","../../src/components/embed-card/card/EmbedPluginCard.tsx","../../src/components/controls/EmbedFormControl.tsx","../../src/components/controls/ListModeSelect.tsx","../../src/components/controls/RenderSelect.tsx","../../src/components/embed-card/EmbedPluginCard.tsx","../../src/components/EmbedPlugin.tsx","../../src/components/EmbedResolver.tsx","../../src/components/validation-alerts/ValidatePayload.tsx","../../src/components/validation-alerts/ValidatePlugins.tsx","../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx","../../src/components/embed-card/error-handling/EmbedErrorCard.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useBusyTiming } from '@xylabs/react-flexbox'\nimport type {\n BusyCircularProgressProps,\n BusyLinearProgressProps,\n BusyVariant,\n} from '@xylabs/react-shared'\nimport {\n BusyCircularProgress,\n BusyLinearProgress,\n} from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nexport interface BusyCardProps extends CardProps {\n busy?: boolean\n busyMinimum?: number\n busyVariant?: BusyVariant\n busyVariantProps?: BusyCircularProgressProps | BusyLinearProgressProps\n}\n\nexport const BusyCard: React.FC<PropsWithChildren<BusyCardProps>> = ({\n busy,\n busyMinimum = 500,\n busyVariant = 'circular',\n busyVariantProps,\n children,\n ...props\n}) => {\n const internalBusy = useBusyTiming(busy, busyMinimum)\n return (\n <Card {...props}>\n {children}\n {busyVariant === 'circular' && internalBusy\n ? <BusyCircularProgress {...(busyVariantProps as BusyCircularProgressProps)} />\n : null}\n {busyVariant === 'linear' && internalBusy\n ? <BusyLinearProgress {...(busyVariantProps as BusyLinearProgressProps)} />\n : null}\n </Card>\n )\n}\n","import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps, Theme } from '@mui/material'\nimport {\n Avatar, CardHeader, Chip,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { isDefined } from '@xylabs/typeof'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'\nimport { EmbedMenu } from '../menu/index.ts'\n\nexport const EmbedCardHeader: React.FC<CardHeaderProps> = () => {\n const { refreshHuri, huri } = useResolvePayload()\n const {\n activePlugin, timestampLabel, hideElementsConfig,\n } = useEmbedPluginState()\n const {\n hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions,\n } = hideElementsConfig ?? {}\n // this is temporary so that we can add the ability to get a timestamp via diviner later\n const timestamp = Date.now()\n return (\n <CardHeader\n sx={{ flexWrap: 'wrap', rowGap: 1 }}\n avatar={\n hideAvatar\n ? <></>\n : (\n <Avatar sx={{ bgcolor: (theme: Theme) => theme.vars.palette.primary.main }} aria-label={activePlugin?.name}>\n {activePlugin?.name?.charAt(0)}\n </Avatar>\n )\n }\n action={(\n <FlexRow flexWrap=\"wrap\" columnGap={0.5}>\n {isDefined(timestamp) && !Number.isNaN(timestamp)\n ? hideTimestamp && hideRefreshButton\n ? ''\n : (\n <Chip\n avatar={hideRefreshButton ? <></> : <RefreshIcon />}\n clickable={hideRefreshButton ? false : true}\n onClick={refreshHuri}\n label={hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`}\n />\n )\n\n : null}\n {/* Huri case is valid as long as the only menu item is JSON */}\n {hideCardActions || huri === undefined ? null : <EmbedMenu />}\n </FlexRow>\n )}\n title={hideTitle ? '' : activePlugin?.name}\n />\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { EmbedPluginState } from './State.ts'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedPluginContext } from './Context.ts'\nimport type { EmbedPluginBase } from './State.ts'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<PropsWithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useResetState(plugins ? plugins[0] : undefined)\n\n return (\n <EmbedPluginContext\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n value={{\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }}\n >\n {children}\n </EmbedPluginContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { EmbedPluginContext } from './Context.ts'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PluginPropsState } from './state.ts'\n\nexport const PluginPropsContext = createContextEx<PluginPropsState>()\n","import type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { PluginPropsContext } from './context.ts'\nimport type { PluginProps, PluginPropsState } from './state.ts'\n\nexport interface PluginPropsProviderProps extends PropsWithChildren {\n pluginProps: PluginProps\n}\n\nexport const PluginPropsProvider: React.FC<PluginPropsProviderProps> = ({ children, pluginProps: pluginPropsProp }) => {\n const [pluginProps, setPluginProps] = useState<PluginProps>(pluginPropsProp)\n\n useEffect(() => {\n // needs to be in useEffect since we are in a provider\n // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect\n setPluginProps(pluginPropsProp)\n }, [pluginPropsProp])\n\n const value: PluginPropsState = useMemo(() => ({\n pluginProps,\n provided: true,\n }), [pluginProps])\n\n return (\n <PluginPropsContext value={value}>\n {children}\n </PluginPropsContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { PluginPropsContext } from './context.ts'\n\nexport const usePluginProps = (required = false) => useContextEx(PluginPropsContext, 'PluginProps', required)\n","import type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<PropsWithChildren<RefreshPayloadProps>> = ({\n children, onRefresh, refreshPayload,\n}) => {\n const [localRefreshPayload, setLocalRefreshPayload] = useState(refreshPayload)\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <RefreshPayloadContext value={{\n onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload: setLocalRefreshPayload,\n }}\n >\n {children}\n </RefreshPayloadContext>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { RefreshPayloadState } from './State.ts'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ResolvePayloadState } from './State.ts'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","/* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */\nimport { delay } from '@xylabs/delay'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { isDefined } from '@xylabs/typeof'\nimport { Huri } from '@xyo-network/huri'\nimport type {\n ModuleError, Payload, WithSources,\n} from '@xyo-network/payload-model'\nimport { ModuleErrorSchema } from '@xyo-network/payload-model'\nimport type { PropsWithChildren } from 'react'\nimport React, { useEffect, useState } from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext/index.ts'\nimport { ResolvePayloadContext } from './Context.ts'\nimport type { ResolvePayloadState } from './State.ts'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const {\n refreshPayload, setRefreshPayload, onRefresh,\n } = useRefreshPayload()\n\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n typeof huriPayload === 'string' ? setHuri(huriPayload) : undefined\n if (typeof huriPayload === 'object') {\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n }, [huriPayload, setRefreshPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<WithSources<ModuleError>>()\n\n useAsyncEffect(\n async (mounted) => {\n if (isDefined(huri) && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\n const result = await huriInstance.fetch()\n // ensure the busy state can stay for a moment to avoid flashing too quickly\n await delay(500)\n\n if (mounted()) {\n setNotFound(result === null)\n setPayload(result)\n setRefreshPayload?.(true)\n }\n } catch (e) {\n const error = e as Error\n setHuriError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = () => {\n onRefresh?.()\n if (isDefined(huri)) {\n setRefreshPayload?.(false)\n }\n }\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <ResolvePayloadContext value={{\n huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload,\n }}\n >\n {children}\n </ResolvePayloadContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { ResolvePayloadContext } from './Context.ts'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { SchemaNameToValidatorMap } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { PropsWithChildren } from 'react'\nimport React, { useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext/index.ts'\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport interface ValidatePayloadProviderProps {\n // Opt-in flag to validate payloads for the plugin(s)\n enabled?: boolean\n}\n\nexport const ValidatePayloadProvider: React.FC<PropsWithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n const [valid, setValid] = useState<boolean>()\n\n useAsyncEffect(\n async () => {\n if (payload && enabled) {\n await SchemaCache.instance.get(payload.schema)\n\n const possibleKnownSchema = payload.schema as keyof SchemaNameToValidatorMap\n\n if (SchemaCache.instance.validators[possibleKnownSchema]) {\n const validator = SchemaCache.instance.validators[possibleKnownSchema]\n setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <ValidatePayloadContext value={{\n enabled, provided: true, schema: payload?.schema, validPayload: valid,\n }}\n >\n {enabled\n ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</>\n : children}\n </ValidatePayloadContext>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ValidatePayloadState } from './State.ts'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n","import { MoreVert as MoreVertIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport { IconButton, Menu } from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { JsonMenuItem } from './JsonMenuItem.tsx'\n\nexport const EmbedMenu: React.FC<IconButtonProps> = (props) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = Boolean(anchorEl)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return (\n <>\n <IconButton onClick={handleClick} {...props}>\n <MoreVertIcon />\n </IconButton>\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n slotProps={{\n paper: { variant: 'elevation' },\n list: { dense: true },\n }}\n >\n <JsonMenuItem />\n </Menu>\n </>\n )\n}\n","import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'\nimport type { MenuItemProps } from '@mui/material'\nimport {\n ListItemIcon, ListItemText, MenuItem,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport React from 'react'\n\nimport { useResolvePayload } from '../../../contexts/index.ts'\n\nexport const JsonMenuItem: React.FC<MenuItemProps> = (props) => {\n const { huri } = useResolvePayload()\n\n return (\n <>\n {isDefined(huri)\n ? (\n <MenuItem title=\"Source Payload JSON\" onClick={() => window.open(huri, '_blank')} {...props}>\n <ListItemText sx={{ mr: 1 }}>JSON</ListItemText>\n <ListItemIcon sx={{ justifyContent: 'end' }}>\n <OpenInNewIcon fontSize=\"small\" />\n </ListItemIcon>\n </MenuItem>\n )\n : null}\n </>\n )\n}\n","import { CardContent } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { isTruthy } from '@xylabs/typeof'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport {\n useEmbedPluginState, usePluginProps, useResolvePayload,\n} from '../../../contexts/index.ts'\nimport { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'\nimport type { BusyCardProps } from './BusyCard.tsx'\nimport { BusyCard } from './BusyCard.tsx'\nimport { EmbedCardHeader } from './EmbedCardHeader.tsx'\n\nexport const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {\n const { payload } = useResolvePayload()\n const {\n activePlugin: ActivePlugin, plugins, hideElementsConfig,\n } = useEmbedPluginState()\n const { listMode } = useListMode()\n const { pluginProps } = usePluginProps()\n const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false\n\n return (\n <BusyCard {...props}>\n {hideElementsConfig?.hideCardHeader ? null : <EmbedCardHeader />}\n {/* Only show the row if the children are present */}\n {(plugins && plugins.length > 0) || supportsListMode\n ? (\n <FlexGrowRow columnGap={2} rowGap={2} flexWrap=\"wrap\" pb={1}>\n {plugins && plugins.length > 1\n ? <EmbedRenderSelect />\n : null}\n {supportsListMode\n ? <ListModeSelectFormControl />\n : null}\n </FlexGrowRow>\n )\n : null}\n <CardContent sx={{ height: '100%' }}>\n {ActivePlugin\n ? <ActivePlugin.components.box.detailsBox payload={payload} {...pluginProps} {...(supportsListMode && { listMode })} />\n : null}\n </CardContent>\n </BusyCard>\n )\n}\n","import type { FormControlProps } from '@mui/material'\nimport { FormControl, InputLabel } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedFormControlProps extends FormControlProps {\n formId?: string\n formLabel?: string\n}\n\nexport const EmbedFormControl: React.FC<PropsWithChildren<EmbedFormControlProps>> = ({\n formId, formLabel, children, ...props\n}) => {\n return (\n <FormControl {...props}>\n <InputLabel id={formId}>{formLabel}</InputLabel>\n {children}\n </FormControl>\n )\n}\n","import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { ListMode } from '@xyo-network/react-shared'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst listModeSelectId = 'listmode-select-id'\nconst listModeSelectLabel = 'List Mode'\n\nexport const ListModeSelect: React.FC<SelectExProps<ListMode>> = (props) => {\n const { listMode, setListMode } = useListMode()\n\n return (\n <SelectEx<ListMode>\n value={(listMode ?? 'default') as ListMode}\n onChange={(event) => {\n setListMode?.(event.target.value as ListMode)\n }}\n {...props}\n >\n <MenuItem key=\"default\" value=\"default\">\n Default\n </MenuItem>\n <MenuItem key=\"table\" value=\"table\">\n Table\n </MenuItem>\n <MenuItem key=\"grid\" value=\"grid\">\n Grid\n </MenuItem>\n </SelectEx>\n )\n}\n\nexport const ListModeSelectFormControl: React.FC<SelectExProps<ListMode>> = (props) => {\n return (\n <EmbedFormControl formId={listModeSelectId} formLabel={listModeSelectLabel}>\n <ListModeSelect size=\"small\" label={listModeSelectLabel} labelId={listModeSelectId} {...props} />\n </EmbedFormControl>\n )\n}\n","import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useEmbedPluginState } from '../../contexts/index.ts'\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst renderSelectId = 'render-select-id'\nconst renderSelectLabel = 'Renderer'\n\nexport const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {\n const {\n activePlugin, setActivePlugin, plugins,\n } = useEmbedPluginState()\n return (\n <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>\n <SelectEx size=\"small\" value={activePlugin?.name} {...props}>\n {plugins?.map(plugin => (\n <MenuItem value={plugin.name} key={plugin.name} onClick={() => setActivePlugin?.(plugin)}>\n {plugin.name}\n </MenuItem>\n ))}\n </SelectEx>\n </EmbedFormControl>\n )\n}\n","import { useTheme } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'\nimport type { EmbedPluginProps } from '../../types/index.ts'\nimport { EmbedPluginInner } from '../EmbedPlugin.tsx'\nimport type { BusyCardProps } from './card/index.ts'\nimport { EmbedPluginCard } from './card/index.ts'\nimport { EmbedCardApiErrorRenderer } from './error-handling/index.ts'\n\nexport interface EmbedPluginCardProps extends PropsWithChildren, EmbedPluginProps, BusyCardProps {}\n\nexport const ApiEmbedPluginCard: React.FC<EmbedPluginCardProps> = ({ children, ...props }) => {\n const {\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n ...busyCardProps\n } = props\n\n return (\n <EmbedPluginInner\n {...{\n embedPluginConfig,\n hideElementsConfig,\n huriPayload,\n onRefresh,\n plugins,\n refreshTitle,\n timestampLabel,\n validateSchema,\n }}\n >\n <EmbedPluginCardInner {...busyCardProps} />\n {children}\n </EmbedPluginInner>\n )\n}\n\nexport const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {\n const { payload, huriError } = useResolvePayload()\n const { refreshPayload } = useRefreshPayload()\n const theme = useTheme()\n\n return (\n <EmbedCardApiErrorRenderer xyoError={huriError}>\n <EmbedPluginCard\n elevation={3}\n variant=\"elevation\"\n busy={Boolean(!refreshPayload && payload)}\n busyVariantProps={{\n style: {\n alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,\n },\n }}\n sx={{ position: 'relative' }}\n {...props}\n />\n </EmbedCardApiErrorRenderer>\n )\n}\n\n/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */\n\nexport { EmbedPluginCard as EmbedPlugin } from './card/index.ts'\n","import { ErrorBoundary } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { ListModeProvider } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport {\n EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,\n} from '../contexts/index.ts'\nimport type { EmbedPluginProps } from '../types/index.ts'\nimport { EmbedResolver } from './EmbedResolver.tsx'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts/index.ts'\n\nexport const EmbedPluginInner: React.FC<PropsWithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins,\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<PropsWithChildren<WithResolversProps>> = ({\n children, onRefresh, huriPayload,\n}) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<PropsWithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n","import { LoadResult } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useResolvePayload } from '../contexts/index.ts'\n\nexport const EmbedResolver: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n payload, notFound, huriError,\n } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n","import type { AlertProps } from '@mui/material'\nimport { Alert } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useValidatePayload } from '../../contexts/index.ts'\n\nexport const ValidatePayloadAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const {\n validPayload, enabled, schema,\n } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be\n {' '}\n {schema}\n {' '}\n but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import type { AlertProps } from '@mui/material'\nimport { Alert, AlertTitle } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts/index.ts'\n\nexport const ValidatePluginsAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>\n Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import type { CardProps } from '@mui/material'\nimport { ErrorAlert, ErrorRender } from '@xylabs/react-error'\nimport type { ModuleError } from '@xyo-network/payload-model'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedErrorCard } from './EmbedErrorCard.tsx'\n\ninterface EmbedCardApiErrorRendererProps extends CardProps {\n xyoError?: ModuleError\n}\n\nexport const EmbedCardApiErrorRenderer: React.FC<PropsWithChildren<EmbedCardApiErrorRendererProps>> = ({\n xyoError, children, ...props\n}) => {\n return (\n <ErrorRender error={xyoError} noReAuth noErrorDisplay customError={<CustomApiErrorCard xyoError={xyoError} {...props} />}>\n {children}\n </ErrorRender>\n )\n}\n\nconst CustomApiErrorCard: React.FC<EmbedCardApiErrorRendererProps> = ({ xyoError, ...props }) => {\n return (\n <EmbedErrorCard {...props}>\n <ErrorAlert error={xyoError} />\n </EmbedErrorCard>\n )\n}\n","import type { AlertProps, CardProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Card, CardContent, Typography,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedErrorCardBaseProps {\n alertProps?: AlertProps\n error?: Error\n hideErrorDetails?: boolean\n scope?: string\n}\n\ninterface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}\n\nexport const EmbedErrorCard: React.FC<PropsWithChildren<EmbedErrorCardProps>> = (props) => {\n const {\n alertProps, error, scope, hideErrorDetails = true, children, ...cardProps\n } = props\n const errorProps = {\n alertProps, error, hideErrorDetails, scope,\n }\n return (\n <Card {...cardProps}>\n <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>\n </Card>\n )\n}\n\nconst DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({\n alertProps, scope, hideErrorDetails, error,\n}) => {\n return (\n <Alert severity=\"error\" {...alertProps}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {isDefined(scope)\n ? (\n <Typography variant=\"caption\">\n Scope:\n {scope}\n </Typography>\n )\n : null}\n {!hideErrorDetails && error\n ? (\n <>\n <Typography variant=\"caption\">Error: </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n </>\n )\n : (\n <Typography variant=\"caption\" fontSize=\"small\">\n Error Loading Plugin\n </Typography>\n )}\n </Alert>\n )\n}\n"],"mappings":";AACA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAM9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAqBH,SAGM,KAHN;AAVG,IAAM,WAAuD,CAAC;AAAA,EACnE;AAAA,EACA,cAAc;AAAA,EACd,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,cAAc,MAAM,WAAW;AACpD,SACE,qBAAC,QAAM,GAAG,OACP;AAAA;AAAA,IACA,gBAAgB,cAAc,eAC3B,oBAAC,wBAAsB,GAAI,kBAAgD,IAC3E;AAAA,IACH,gBAAgB,YAAY,eACzB,oBAAC,sBAAoB,GAAI,kBAA8C,IACvE;AAA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;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,wBAAAD,MAAC,wBAAsB,GAAG,eAAe;AAAA,QACxC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEO,IAAM,uBAAgD,CAAC,UAAU;AACtE,QAAM,EAAE,SAAS,UAAU,IAAI,kBAAkB;AACjD,QAAM,EAAE,eAAe,IAAI,kBAAkB;AAC7C,QAAM,QAAQ,SAAS;AAEvB,SACE,gBAAAA,MAAC,6BAA0B,UAAU,WACnC,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,SAAQ;AAAA,MACR,MAAM,QAAQ,CAAC,kBAAkB,OAAO;AAAA,MACxC,kBAAkB;AAAA,QAChB,OAAO;AAAA,UACL,YAAY;AAAA,UAAS,YAAY,MAAM,QAAQ,CAAC;AAAA,UAAG,QAAQ;AAAA,QAC7D;AAAA,MACF;AAAA,MACA,IAAI,EAAE,UAAU,WAAW;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;","names":["Chip","isDefined","jsx","createContextEx","jsx","useContextEx","useContextEx","useState","createContextEx","jsx","useState","useContextEx","useContextEx","createContextEx","useEffect","useState","jsx","useState","useEffect","useContextEx","useContextEx","useAsyncEffect","useState","createContextEx","jsx","useState","useAsyncEffect","useContextEx","useContextEx","useState","isDefined","Fragment","jsx","jsxs","isDefined","Fragment","jsx","jsxs","useState","Fragment","jsx","jsxs","isDefined","Chip","useListMode","jsx","jsxs","MenuItem","jsx","jsxs","MenuItem","MenuItem","SelectEx","jsx","SelectEx","MenuItem","jsx","jsxs","useListMode","jsx","Fragment","jsx","jsxs","Alert","Fragment","jsx","jsxs","Alert","jsx","Alert","AlertTitle","Card","CardContent","isDefined","Fragment","jsx","jsxs","jsx","jsx","jsxs"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-embed",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.9",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -50,10 +50,11 @@
|
|
|
50
50
|
"@xylabs/react-hooks": "~7.1.8",
|
|
51
51
|
"@xylabs/react-select": "~7.1.8",
|
|
52
52
|
"@xylabs/react-shared": "~7.1.8",
|
|
53
|
+
"@xylabs/typeof": "~5.0.18",
|
|
53
54
|
"@xyo-network/huri": "~5.1.15",
|
|
54
55
|
"@xyo-network/payload-model": "~5.1.15",
|
|
55
|
-
"@xyo-network/react-payload-plugin": "^7.3.
|
|
56
|
-
"@xyo-network/react-shared": "^7.3.
|
|
56
|
+
"@xyo-network/react-payload-plugin": "^7.3.9",
|
|
57
|
+
"@xyo-network/react-shared": "^7.3.9",
|
|
57
58
|
"@xyo-network/schema-cache": "~5.1.15"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
@@ -67,8 +68,8 @@
|
|
|
67
68
|
"@xylabs/tsconfig": "~7.1.8",
|
|
68
69
|
"@xylabs/tsconfig-dom": "~7.1.8",
|
|
69
70
|
"@xylabs/tsconfig-react": "~7.1.8",
|
|
70
|
-
"@xyo-network/react-aggregate-price-plugin": "^7.3.
|
|
71
|
-
"@xyo-network/react-crypto-market-uniswap-plugin": "^7.3.
|
|
71
|
+
"@xyo-network/react-aggregate-price-plugin": "^7.3.9",
|
|
72
|
+
"@xyo-network/react-crypto-market-uniswap-plugin": "^7.3.9",
|
|
72
73
|
"luxon": "^3.7.2",
|
|
73
74
|
"react": "~19.2.0",
|
|
74
75
|
"react-dom": "~19.2.0",
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Avatar, CardHeader, Chip,
|
|
5
5
|
} from '@mui/material'
|
|
6
6
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
7
|
+
import { isDefined } from '@xylabs/typeof'
|
|
7
8
|
import React from 'react'
|
|
8
9
|
|
|
9
10
|
import { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'
|
|
@@ -33,7 +34,7 @@ export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
|
|
|
33
34
|
}
|
|
34
35
|
action={(
|
|
35
36
|
<FlexRow flexWrap="wrap" columnGap={0.5}>
|
|
36
|
-
{timestamp
|
|
37
|
+
{isDefined(timestamp) && !Number.isNaN(timestamp)
|
|
37
38
|
? hideTimestamp && hideRefreshButton
|
|
38
39
|
? ''
|
|
39
40
|
: (
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { CardContent } from '@mui/material'
|
|
2
2
|
import { FlexGrowRow } from '@xylabs/react-flexbox'
|
|
3
|
+
import { isTruthy } from '@xylabs/typeof'
|
|
3
4
|
import { useListMode } from '@xyo-network/react-shared'
|
|
4
5
|
import React from 'react'
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
useEmbedPluginState, usePluginProps, useResolvePayload,
|
|
9
|
+
} from '../../../contexts/index.ts'
|
|
7
10
|
import { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'
|
|
8
11
|
import type { BusyCardProps } from './BusyCard.tsx'
|
|
9
12
|
import { BusyCard } from './BusyCard.tsx'
|
|
@@ -15,7 +18,8 @@ export const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {
|
|
|
15
18
|
activePlugin: ActivePlugin, plugins, hideElementsConfig,
|
|
16
19
|
} = useEmbedPluginState()
|
|
17
20
|
const { listMode } = useListMode()
|
|
18
|
-
const
|
|
21
|
+
const { pluginProps } = usePluginProps()
|
|
22
|
+
const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false
|
|
19
23
|
|
|
20
24
|
return (
|
|
21
25
|
<BusyCard {...props}>
|
|
@@ -35,7 +39,7 @@ export const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {
|
|
|
35
39
|
: null}
|
|
36
40
|
<CardContent sx={{ height: '100%' }}>
|
|
37
41
|
{ActivePlugin
|
|
38
|
-
? <ActivePlugin.components.box.detailsBox payload={payload} {...(supportsListMode && { listMode })} />
|
|
42
|
+
? <ActivePlugin.components.box.detailsBox payload={payload} {...pluginProps} {...(supportsListMode && { listMode })} />
|
|
39
43
|
: null}
|
|
40
44
|
</CardContent>
|
|
41
45
|
</BusyCard>
|
|
@@ -2,6 +2,7 @@ import type { AlertProps, CardProps } from '@mui/material'
|
|
|
2
2
|
import {
|
|
3
3
|
Alert, AlertTitle, Card, CardContent, Typography,
|
|
4
4
|
} from '@mui/material'
|
|
5
|
+
import { isDefined } from '@xylabs/typeof'
|
|
5
6
|
import type { PropsWithChildren } from 'react'
|
|
6
7
|
import React from 'react'
|
|
7
8
|
|
|
@@ -34,7 +35,7 @@ const DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({
|
|
|
34
35
|
return (
|
|
35
36
|
<Alert severity="error" {...alertProps}>
|
|
36
37
|
<AlertTitle>Whoops! Something went wrong</AlertTitle>
|
|
37
|
-
{scope
|
|
38
|
+
{isDefined(scope)
|
|
38
39
|
? (
|
|
39
40
|
<Typography variant="caption">
|
|
40
41
|
Scope:
|
|
@@ -3,6 +3,7 @@ import type { MenuItemProps } from '@mui/material'
|
|
|
3
3
|
import {
|
|
4
4
|
ListItemIcon, ListItemText, MenuItem,
|
|
5
5
|
} from '@mui/material'
|
|
6
|
+
import { isDefined } from '@xylabs/typeof'
|
|
6
7
|
import React from 'react'
|
|
7
8
|
|
|
8
9
|
import { useResolvePayload } from '../../../contexts/index.ts'
|
|
@@ -12,7 +13,7 @@ export const JsonMenuItem: React.FC<MenuItemProps> = (props) => {
|
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
15
|
<>
|
|
15
|
-
{huri
|
|
16
|
+
{isDefined(huri)
|
|
16
17
|
? (
|
|
17
18
|
<MenuItem title="Source Payload JSON" onClick={() => window.open(huri, '_blank')} {...props}>
|
|
18
19
|
<ListItemText sx={{ mr: 1 }}>JSON</ListItemText>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react'
|
|
2
|
+
import React, {
|
|
3
|
+
useEffect, useMemo, useState,
|
|
4
|
+
} from 'react'
|
|
5
|
+
|
|
6
|
+
import { PluginPropsContext } from './context.ts'
|
|
7
|
+
import type { PluginProps, PluginPropsState } from './state.ts'
|
|
8
|
+
|
|
9
|
+
export interface PluginPropsProviderProps extends PropsWithChildren {
|
|
10
|
+
pluginProps: PluginProps
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const PluginPropsProvider: React.FC<PluginPropsProviderProps> = ({ children, pluginProps: pluginPropsProp }) => {
|
|
14
|
+
const [pluginProps, setPluginProps] = useState<PluginProps>(pluginPropsProp)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// needs to be in useEffect since we are in a provider
|
|
18
|
+
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
19
|
+
setPluginProps(pluginPropsProp)
|
|
20
|
+
}, [pluginPropsProp])
|
|
21
|
+
|
|
22
|
+
const value: PluginPropsState = useMemo(() => ({
|
|
23
|
+
pluginProps,
|
|
24
|
+
provided: true,
|
|
25
|
+
}), [pluginProps])
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<PluginPropsContext value={value}>
|
|
29
|
+
{children}
|
|
30
|
+
</PluginPropsContext>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContextExState } from '@xylabs/react-shared'
|
|
2
|
+
|
|
3
|
+
export type PluginProps = React.PropsWithChildren
|
|
4
|
+
|
|
5
|
+
export interface PluginPropsStateFields {
|
|
6
|
+
pluginProps: Record<string, unknown>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type PluginPropsState = ContextExState<PluginPropsStateFields>
|
|
@@ -11,12 +11,12 @@ export interface RefreshPayloadProps {
|
|
|
11
11
|
export const RefreshPayloadProvider: React.FC<PropsWithChildren<RefreshPayloadProps>> = ({
|
|
12
12
|
children, onRefresh, refreshPayload,
|
|
13
13
|
}) => {
|
|
14
|
-
const [localRefreshPayload,
|
|
14
|
+
const [localRefreshPayload, setLocalRefreshPayload] = useState(refreshPayload)
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
|
18
18
|
<RefreshPayloadContext value={{
|
|
19
|
-
onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload,
|
|
19
|
+
onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload: setLocalRefreshPayload,
|
|
20
20
|
}}
|
|
21
21
|
>
|
|
22
22
|
{children}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */
|
|
2
2
|
import { delay } from '@xylabs/delay'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
|
+
import { isDefined } from '@xylabs/typeof'
|
|
4
5
|
import { Huri } from '@xyo-network/huri'
|
|
5
6
|
import type {
|
|
6
7
|
ModuleError, Payload, WithSources,
|
|
@@ -36,7 +37,7 @@ export const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadPr
|
|
|
36
37
|
|
|
37
38
|
useAsyncEffect(
|
|
38
39
|
async (mounted) => {
|
|
39
|
-
if (huri && !refreshPayload) {
|
|
40
|
+
if (isDefined(huri) && !refreshPayload) {
|
|
40
41
|
try {
|
|
41
42
|
const huriInstance = new Huri(huri)
|
|
42
43
|
const result = await huriInstance.fetch()
|
|
@@ -61,7 +62,7 @@ export const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadPr
|
|
|
61
62
|
|
|
62
63
|
const refreshHuri = () => {
|
|
63
64
|
onRefresh?.()
|
|
64
|
-
if (huri) {
|
|
65
|
+
if (isDefined(huri)) {
|
|
65
66
|
setRefreshPayload?.(false)
|
|
66
67
|
}
|
|
67
68
|
}
|
package/src/contexts/index.ts
CHANGED