@xyo-network/react-embed 10.0.4 → 10.0.6
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/index.d.ts +1 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +2 -685
- package/dist/browser/index.mjs.map +4 -4
- package/package.json +98 -81
- package/dist/browser/components/EmbedPlugin.d.ts +0 -5
- package/dist/browser/components/EmbedPlugin.d.ts.map +0 -1
- package/dist/browser/components/EmbedResolver.d.ts +0 -4
- package/dist/browser/components/EmbedResolver.d.ts.map +0 -1
- package/dist/browser/components/controls/EmbedFormControl.d.ts +0 -10
- package/dist/browser/components/controls/EmbedFormControl.d.ts.map +0 -1
- package/dist/browser/components/controls/ListModeSelect.d.ts +0 -6
- package/dist/browser/components/controls/ListModeSelect.d.ts.map +0 -1
- package/dist/browser/components/controls/RenderSelect.d.ts +0 -4
- package/dist/browser/components/controls/RenderSelect.d.ts.map +0 -1
- package/dist/browser/components/controls/index.d.ts +0 -4
- package/dist/browser/components/controls/index.d.ts.map +0 -1
- package/dist/browser/components/embed-card/EmbedCardResolver.d.ts +0 -5
- package/dist/browser/components/embed-card/EmbedCardResolver.d.ts.map +0 -1
- package/dist/browser/components/embed-card/EmbedPluginCard.d.ts +0 -11
- package/dist/browser/components/embed-card/EmbedPluginCard.d.ts.map +0 -1
- package/dist/browser/components/embed-card/card/BusyCard.d.ts +0 -12
- package/dist/browser/components/embed-card/card/BusyCard.d.ts.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts +0 -4
- package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts +0 -4
- package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts.map +0 -1
- package/dist/browser/components/embed-card/card/index.d.ts +0 -4
- package/dist/browser/components/embed-card/card/index.d.ts.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts +0 -10
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts +0 -14
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts.map +0 -1
- package/dist/browser/components/embed-card/error-handling/index.d.ts +0 -3
- package/dist/browser/components/embed-card/error-handling/index.d.ts.map +0 -1
- package/dist/browser/components/embed-card/index.d.ts +0 -3
- package/dist/browser/components/embed-card/index.d.ts.map +0 -1
- package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts +0 -4
- package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts.map +0 -1
- package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts +0 -4
- package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts.map +0 -1
- package/dist/browser/components/embed-card/menu/index.d.ts +0 -2
- package/dist/browser/components/embed-card/menu/index.d.ts.map +0 -1
- package/dist/browser/components/index.d.ts +0 -3
- package/dist/browser/components/index.d.ts.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePayload.d.ts +0 -5
- package/dist/browser/components/validation-alerts/ValidatePayload.d.ts.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts +0 -5
- package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts.map +0 -1
- package/dist/browser/components/validation-alerts/index.d.ts +0 -3
- package/dist/browser/components/validation-alerts/index.d.ts.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Context.d.ts +0 -17
- package/dist/browser/contexts/EmbedPluginContext/Context.d.ts.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts +0 -7
- package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/State.d.ts +0 -34
- package/dist/browser/contexts/EmbedPluginContext/State.d.ts.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/index.d.ts +0 -5
- package/dist/browser/contexts/EmbedPluginContext/index.d.ts.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/use.d.ts +0 -7
- package/dist/browser/contexts/EmbedPluginContext/use.d.ts.map +0 -1
- package/dist/browser/contexts/PluginPropsContext/Provider.d.ts +0 -8
- package/dist/browser/contexts/PluginPropsContext/Provider.d.ts.map +0 -1
- package/dist/browser/contexts/PluginPropsContext/context.d.ts +0 -8
- package/dist/browser/contexts/PluginPropsContext/context.d.ts.map +0 -1
- package/dist/browser/contexts/PluginPropsContext/index.d.ts +0 -5
- package/dist/browser/contexts/PluginPropsContext/index.d.ts.map +0 -1
- package/dist/browser/contexts/PluginPropsContext/state.d.ts +0 -7
- package/dist/browser/contexts/PluginPropsContext/state.d.ts.map +0 -1
- package/dist/browser/contexts/PluginPropsContext/use.d.ts +0 -4
- package/dist/browser/contexts/PluginPropsContext/use.d.ts.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts +0 -20
- package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts +0 -8
- package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/State.d.ts +0 -8
- package/dist/browser/contexts/RefreshPayloadContext/State.d.ts.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/index.d.ts +0 -4
- package/dist/browser/contexts/RefreshPayloadContext/index.d.ts.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/use.d.ts +0 -8
- package/dist/browser/contexts/RefreshPayloadContext/use.d.ts.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts +0 -32
- package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts +0 -6
- package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/State.d.ts +0 -13
- package/dist/browser/contexts/ResolvePayloadContext/State.d.ts.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/index.d.ts +0 -5
- package/dist/browser/contexts/ResolvePayloadContext/index.d.ts.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/use.d.ts +0 -12
- package/dist/browser/contexts/ResolvePayloadContext/use.d.ts.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts +0 -20
- package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts +0 -7
- package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/State.d.ts +0 -7
- package/dist/browser/contexts/ValidatePayloadContext/State.d.ts.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/index.d.ts +0 -4
- package/dist/browser/contexts/ValidatePayloadContext/index.d.ts.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/use.d.ts +0 -8
- package/dist/browser/contexts/ValidatePayloadContext/use.d.ts.map +0 -1
- package/dist/browser/contexts/index.d.ts +0 -6
- package/dist/browser/contexts/index.d.ts.map +0 -1
- package/dist/browser/types/EmbedPluginProps.d.ts +0 -10
- package/dist/browser/types/EmbedPluginProps.d.ts.map +0 -1
- package/dist/browser/types/index.d.ts +0 -2
- package/dist/browser/types/index.d.ts.map +0 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,8BAA8B,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1,686 +1,3 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
BusyCircularProgress,
|
|
5
|
-
BusyLinearProgress
|
|
6
|
-
} from "@ariestools/sdk-react/shared";
|
|
7
|
-
import { Card } from "@mui/material";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var BusyCard = ({
|
|
10
|
-
busy,
|
|
11
|
-
busyMinimum = 500,
|
|
12
|
-
busyVariant = "circular",
|
|
13
|
-
busyVariantProps,
|
|
14
|
-
children,
|
|
15
|
-
...props
|
|
16
|
-
}) => {
|
|
17
|
-
const internalBusy = useBusyTiming(busy, busyMinimum);
|
|
18
|
-
return /* @__PURE__ */ jsxs(Card, { ...props, children: [
|
|
19
|
-
children,
|
|
20
|
-
busyVariant === "circular" && internalBusy ? /* @__PURE__ */ jsx(BusyCircularProgress, { ...busyVariantProps }) : null,
|
|
21
|
-
busyVariant === "linear" && internalBusy ? /* @__PURE__ */ jsx(BusyLinearProgress, { ...busyVariantProps }) : null
|
|
22
|
-
] });
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// src/components/embed-card/card/EmbedCardHeader.tsx
|
|
26
|
-
import { isDefined as isDefined3 } from "@ariestools/sdk";
|
|
27
|
-
import { FlexRow } from "@ariestools/sdk-react/flexbox";
|
|
28
|
-
import { Refresh as RefreshIcon } from "@mui/icons-material";
|
|
29
|
-
import {
|
|
30
|
-
Avatar,
|
|
31
|
-
CardHeader,
|
|
32
|
-
Chip as Chip2
|
|
33
|
-
} from "@mui/material";
|
|
34
|
-
import { useState as useState6 } from "react";
|
|
35
|
-
|
|
36
|
-
// src/contexts/EmbedPluginContext/Context.ts
|
|
37
|
-
import { createContextEx } from "@ariestools/sdk-react/shared";
|
|
38
|
-
var EmbedPluginContext = createContextEx();
|
|
39
|
-
|
|
40
|
-
// src/contexts/EmbedPluginContext/Provider.tsx
|
|
41
|
-
import { useResetState } from "@ariestools/sdk-react/hooks";
|
|
42
|
-
import { useMemo } from "react";
|
|
43
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
44
|
-
var EmbedPluginProvider = ({
|
|
45
|
-
children,
|
|
46
|
-
refreshTitle,
|
|
47
|
-
timestampLabel,
|
|
48
|
-
hideElementsConfig,
|
|
49
|
-
plugins,
|
|
50
|
-
embedPluginConfig
|
|
51
|
-
}) => {
|
|
52
|
-
const [activePlugin, setActivePlugin] = useResetState(plugins ? plugins[0] : void 0);
|
|
53
|
-
const value = useMemo(() => ({
|
|
54
|
-
activePlugin,
|
|
55
|
-
embedPluginConfig,
|
|
56
|
-
hideElementsConfig,
|
|
57
|
-
provided: true,
|
|
58
|
-
refreshTitle,
|
|
59
|
-
setActivePlugin,
|
|
60
|
-
timestampLabel
|
|
61
|
-
}), [activePlugin, embedPluginConfig, hideElementsConfig, refreshTitle, setActivePlugin, timestampLabel]);
|
|
62
|
-
return /* @__PURE__ */ jsx2(
|
|
63
|
-
EmbedPluginContext,
|
|
64
|
-
{
|
|
65
|
-
value,
|
|
66
|
-
children
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// src/contexts/EmbedPluginContext/use.ts
|
|
72
|
-
import { useContextEx } from "@ariestools/sdk-react/shared";
|
|
73
|
-
var useEmbedPluginState = () => useContextEx(EmbedPluginContext, "EmbedPlugin", true);
|
|
74
|
-
|
|
75
|
-
// src/contexts/PluginPropsContext/context.ts
|
|
76
|
-
import { createContextEx as createContextEx2 } from "@ariestools/sdk-react/shared";
|
|
77
|
-
var PluginPropsContext = createContextEx2();
|
|
78
|
-
|
|
79
|
-
// src/contexts/PluginPropsContext/Provider.tsx
|
|
80
|
-
import {
|
|
81
|
-
useEffect,
|
|
82
|
-
useMemo as useMemo2,
|
|
83
|
-
useState
|
|
84
|
-
} from "react";
|
|
85
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
86
|
-
var PluginPropsProvider = ({ children, pluginProps: pluginPropsProp }) => {
|
|
87
|
-
const [pluginProps, setPluginProps] = useState(pluginPropsProp);
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
setPluginProps(pluginPropsProp);
|
|
90
|
-
}, [pluginPropsProp]);
|
|
91
|
-
const value = useMemo2(() => ({
|
|
92
|
-
pluginProps,
|
|
93
|
-
provided: true
|
|
94
|
-
}), [pluginProps]);
|
|
95
|
-
return /* @__PURE__ */ jsx3(PluginPropsContext, { value, children });
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/contexts/PluginPropsContext/use.ts
|
|
99
|
-
import { useContextEx as useContextEx2 } from "@ariestools/sdk-react/shared";
|
|
100
|
-
var usePluginProps = (required = false) => useContextEx2(PluginPropsContext, "PluginProps", required);
|
|
101
|
-
|
|
102
|
-
// src/contexts/RefreshPayloadContext/Provider.tsx
|
|
103
|
-
import { useMemo as useMemo3, useState as useState2 } from "react";
|
|
104
|
-
|
|
105
|
-
// src/contexts/RefreshPayloadContext/Context.ts
|
|
106
|
-
import { createContextEx as createContextEx3 } from "@ariestools/sdk-react/shared";
|
|
107
|
-
var RefreshPayloadContext = createContextEx3();
|
|
108
|
-
|
|
109
|
-
// src/contexts/RefreshPayloadContext/Provider.tsx
|
|
110
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
111
|
-
var RefreshPayloadProvider = ({
|
|
112
|
-
children,
|
|
113
|
-
onRefresh,
|
|
114
|
-
refreshPayload
|
|
115
|
-
}) => {
|
|
116
|
-
const [localRefreshPayload, setLocalRefreshPayload] = useState2(refreshPayload);
|
|
117
|
-
const value = useMemo3(() => ({
|
|
118
|
-
onRefresh,
|
|
119
|
-
provided: true,
|
|
120
|
-
refreshPayload: localRefreshPayload,
|
|
121
|
-
setRefreshPayload: setLocalRefreshPayload
|
|
122
|
-
}), [onRefresh, localRefreshPayload]);
|
|
123
|
-
return /* @__PURE__ */ jsx4(RefreshPayloadContext, { value, children });
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// src/contexts/RefreshPayloadContext/use.ts
|
|
127
|
-
import { useContextEx as useContextEx3 } from "@ariestools/sdk-react/shared";
|
|
128
|
-
var useRefreshPayload = () => useContextEx3(RefreshPayloadContext, "RefreshPayload", true);
|
|
129
|
-
|
|
130
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
|
131
|
-
import { createContextEx as createContextEx4 } from "@ariestools/sdk-react/shared";
|
|
132
|
-
var ResolvePayloadContext = createContextEx4();
|
|
133
|
-
|
|
134
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
|
135
|
-
import { delay, isDefined } from "@ariestools/sdk";
|
|
136
|
-
import { useAsyncEffect } from "@ariestools/sdk-react/async-effect";
|
|
137
|
-
import { Huri, ModuleErrorSchema } from "@xyo-network/sdk";
|
|
138
|
-
import {
|
|
139
|
-
useCallback,
|
|
140
|
-
useEffect as useEffect2,
|
|
141
|
-
useMemo as useMemo4,
|
|
142
|
-
useState as useState3
|
|
143
|
-
} from "react";
|
|
144
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
145
|
-
var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
|
146
|
-
const [payload, setPayload] = useState3();
|
|
147
|
-
const [huri, setHuri] = useState3();
|
|
148
|
-
const {
|
|
149
|
-
refreshPayload,
|
|
150
|
-
setRefreshPayload,
|
|
151
|
-
onRefresh
|
|
152
|
-
} = useRefreshPayload();
|
|
153
|
-
useEffect2(() => {
|
|
154
|
-
if (typeof huriPayload === "string") {
|
|
155
|
-
setHuri(huriPayload);
|
|
156
|
-
} else if (typeof huriPayload === "object") {
|
|
157
|
-
setPayload(huriPayload);
|
|
158
|
-
setRefreshPayload?.(true);
|
|
159
|
-
}
|
|
160
|
-
}, [huriPayload]);
|
|
161
|
-
const [notFound, setNotFound] = useState3();
|
|
162
|
-
const [huriError, setHuriError] = useState3();
|
|
163
|
-
useAsyncEffect(
|
|
164
|
-
async (mounted) => {
|
|
165
|
-
if (isDefined(huri) && !refreshPayload) {
|
|
166
|
-
try {
|
|
167
|
-
const huriInstance = new Huri(huri);
|
|
168
|
-
const result = await huriInstance.fetch();
|
|
169
|
-
await delay(500);
|
|
170
|
-
if (mounted()) {
|
|
171
|
-
setNotFound(result === null);
|
|
172
|
-
setPayload(result);
|
|
173
|
-
setRefreshPayload?.(true);
|
|
174
|
-
}
|
|
175
|
-
} catch (e) {
|
|
176
|
-
const error = e;
|
|
177
|
-
setHuriError({
|
|
178
|
-
message: error.message,
|
|
179
|
-
schema: ModuleErrorSchema,
|
|
180
|
-
$sources: []
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
[huri, payload, refreshPayload, setRefreshPayload]
|
|
186
|
-
);
|
|
187
|
-
const refreshHuri = useCallback(() => {
|
|
188
|
-
onRefresh?.();
|
|
189
|
-
if (isDefined(huri)) {
|
|
190
|
-
setRefreshPayload?.(false);
|
|
191
|
-
}
|
|
192
|
-
}, [onRefresh, huri, setRefreshPayload]);
|
|
193
|
-
const value = useMemo4(() => ({
|
|
194
|
-
huri,
|
|
195
|
-
huriError,
|
|
196
|
-
notFound,
|
|
197
|
-
payload,
|
|
198
|
-
provided: true,
|
|
199
|
-
refreshHuri,
|
|
200
|
-
setPayload
|
|
201
|
-
}), [huri, huriError, notFound, payload, refreshHuri, setPayload]);
|
|
202
|
-
return /* @__PURE__ */ jsx5(ResolvePayloadContext, { value, children });
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
// src/contexts/ResolvePayloadContext/use.ts
|
|
206
|
-
import { useContextEx as useContextEx4 } from "@ariestools/sdk-react/shared";
|
|
207
|
-
var useResolvePayload = () => useContextEx4(ResolvePayloadContext, "ResolvePayload", true);
|
|
208
|
-
|
|
209
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
|
210
|
-
import { useAsyncEffect as useAsyncEffect2 } from "@ariestools/sdk-react/async-effect";
|
|
211
|
-
import { Chip } from "@mui/material";
|
|
212
|
-
import { SchemaCache } from "@xyo-network/sdk";
|
|
213
|
-
import { useMemo as useMemo5, useState as useState4 } from "react";
|
|
214
|
-
|
|
215
|
-
// src/contexts/ValidatePayloadContext/Context.ts
|
|
216
|
-
import { createContextEx as createContextEx5 } from "@ariestools/sdk-react/shared";
|
|
217
|
-
var ValidatePayloadContext = createContextEx5();
|
|
218
|
-
|
|
219
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
|
220
|
-
import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
|
|
221
|
-
var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
|
222
|
-
const { payload } = useResolvePayload();
|
|
223
|
-
const [initialized, setInitialized] = useState4(false);
|
|
224
|
-
const [valid, _setValid] = useState4();
|
|
225
|
-
useAsyncEffect2(
|
|
226
|
-
async () => {
|
|
227
|
-
if (payload && enabled) {
|
|
228
|
-
await SchemaCache.instance.get(payload.schema);
|
|
229
|
-
const possibleKnownSchema = payload.schema;
|
|
230
|
-
if (SchemaCache.instance.validators[possibleKnownSchema]) {
|
|
231
|
-
const _validator = SchemaCache.instance.validators[possibleKnownSchema];
|
|
232
|
-
}
|
|
233
|
-
setInitialized(true);
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
[payload, enabled]
|
|
237
|
-
);
|
|
238
|
-
const value = useMemo5(() => ({
|
|
239
|
-
enabled,
|
|
240
|
-
provided: true,
|
|
241
|
-
schema: payload?.schema,
|
|
242
|
-
validPayload: valid
|
|
243
|
-
}), [enabled, payload?.schema, valid]);
|
|
244
|
-
return /* @__PURE__ */ jsx6(ValidatePayloadContext, { value, children: enabled ? /* @__PURE__ */ jsx6(Fragment, { children: initialized ? children : /* @__PURE__ */ jsx6(Chip, { label: "Validating Payload..." }) }) : children });
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
// src/contexts/ValidatePayloadContext/use.ts
|
|
248
|
-
import { useContextEx as useContextEx5 } from "@ariestools/sdk-react/shared";
|
|
249
|
-
var useValidatePayload = () => useContextEx5(ValidatePayloadContext, "ValidateSchema", true);
|
|
250
|
-
|
|
251
|
-
// src/components/embed-card/menu/EmbedMenu.tsx
|
|
252
|
-
import { MoreVert as MoreVertIcon } from "@mui/icons-material";
|
|
253
|
-
import { IconButton, Menu } from "@mui/material";
|
|
254
|
-
import { useState as useState5 } from "react";
|
|
255
|
-
|
|
256
|
-
// src/components/embed-card/menu/JsonMenuItem.tsx
|
|
257
|
-
import { isDefined as isDefined2 } from "@ariestools/sdk";
|
|
258
|
-
import { OpenInNew as OpenInNewIcon } from "@mui/icons-material";
|
|
259
|
-
import {
|
|
260
|
-
ListItemIcon,
|
|
261
|
-
ListItemText,
|
|
262
|
-
MenuItem
|
|
263
|
-
} from "@mui/material";
|
|
264
|
-
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
265
|
-
var JsonMenuItem = (props) => {
|
|
266
|
-
const { huri } = useResolvePayload();
|
|
267
|
-
return /* @__PURE__ */ jsx7(Fragment2, { children: isDefined2(huri) ? /* @__PURE__ */ jsxs2(MenuItem, { title: "Source Payload JSON", onClick: () => window.open(huri, "_blank"), ...props, children: [
|
|
268
|
-
/* @__PURE__ */ jsx7(ListItemText, { sx: { mr: 1 }, children: "JSON" }),
|
|
269
|
-
/* @__PURE__ */ jsx7(ListItemIcon, { sx: { justifyContent: "end" }, children: /* @__PURE__ */ jsx7(OpenInNewIcon, { sx: { fontSize: "small" } }) })
|
|
270
|
-
] }) : null });
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
// src/components/embed-card/menu/EmbedMenu.tsx
|
|
274
|
-
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
275
|
-
var EmbedMenu = (props) => {
|
|
276
|
-
const [anchorEl, setAnchorEl] = useState5(null);
|
|
277
|
-
const open = Boolean(anchorEl);
|
|
278
|
-
const handleClick = (event) => {
|
|
279
|
-
setAnchorEl(event.currentTarget);
|
|
280
|
-
};
|
|
281
|
-
const handleClose = () => {
|
|
282
|
-
setAnchorEl(null);
|
|
283
|
-
};
|
|
284
|
-
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
285
|
-
/* @__PURE__ */ jsx8(IconButton, { onClick: handleClick, ...props, children: /* @__PURE__ */ jsx8(MoreVertIcon, {}) }),
|
|
286
|
-
/* @__PURE__ */ jsx8(
|
|
287
|
-
Menu,
|
|
288
|
-
{
|
|
289
|
-
anchorEl,
|
|
290
|
-
open,
|
|
291
|
-
onClose: handleClose,
|
|
292
|
-
slotProps: {
|
|
293
|
-
paper: { variant: "elevation" },
|
|
294
|
-
list: { dense: true }
|
|
295
|
-
},
|
|
296
|
-
children: /* @__PURE__ */ jsx8(JsonMenuItem, {})
|
|
297
|
-
}
|
|
298
|
-
)
|
|
299
|
-
] });
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
// src/components/embed-card/card/EmbedCardHeader.tsx
|
|
303
|
-
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
304
|
-
var EmbedCardHeader = () => {
|
|
305
|
-
const { refreshHuri, huri } = useResolvePayload();
|
|
306
|
-
const {
|
|
307
|
-
activePlugin,
|
|
308
|
-
timestampLabel,
|
|
309
|
-
hideElementsConfig
|
|
310
|
-
} = useEmbedPluginState();
|
|
311
|
-
const {
|
|
312
|
-
hideAvatar,
|
|
313
|
-
hideTitle,
|
|
314
|
-
hideRefreshButton,
|
|
315
|
-
hideTimestamp,
|
|
316
|
-
hideCardActions
|
|
317
|
-
} = hideElementsConfig ?? {};
|
|
318
|
-
const [timestamp] = useState6(() => Date.now());
|
|
319
|
-
return /* @__PURE__ */ jsx9(
|
|
320
|
-
CardHeader,
|
|
321
|
-
{
|
|
322
|
-
sx: { flexWrap: "wrap", rowGap: 1 },
|
|
323
|
-
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) }),
|
|
324
|
-
action: /* @__PURE__ */ jsxs4(
|
|
325
|
-
FlexRow,
|
|
326
|
-
{
|
|
327
|
-
sx: {
|
|
328
|
-
flexWrap: "wrap",
|
|
329
|
-
columnGap: 0.5
|
|
330
|
-
},
|
|
331
|
-
children: [
|
|
332
|
-
isDefined3(timestamp) && !Number.isNaN(timestamp) ? hideTimestamp && hideRefreshButton ? "" : /* @__PURE__ */ jsx9(
|
|
333
|
-
Chip2,
|
|
334
|
-
{
|
|
335
|
-
avatar: hideRefreshButton ? /* @__PURE__ */ jsx9(Fragment4, {}) : /* @__PURE__ */ jsx9(RefreshIcon, {}),
|
|
336
|
-
clickable: hideRefreshButton ? false : true,
|
|
337
|
-
onClick: refreshHuri,
|
|
338
|
-
label: hideTimestamp ? "" : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`
|
|
339
|
-
}
|
|
340
|
-
) : null,
|
|
341
|
-
hideCardActions || huri === void 0 ? null : /* @__PURE__ */ jsx9(EmbedMenu, {})
|
|
342
|
-
]
|
|
343
|
-
}
|
|
344
|
-
),
|
|
345
|
-
title: hideTitle ? "" : activePlugin?.name
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
// src/components/embed-card/card/EmbedPluginCard.tsx
|
|
351
|
-
import { isTruthy } from "@ariestools/sdk";
|
|
352
|
-
import { FlexGrowRow } from "@ariestools/sdk-react/flexbox";
|
|
353
|
-
import { CardContent } from "@mui/material";
|
|
354
|
-
import { useListMode as useListMode2 } from "@xyo-network/react-shared";
|
|
355
|
-
|
|
356
|
-
// src/components/controls/EmbedFormControl.tsx
|
|
357
|
-
import { FormControl, InputLabel } from "@mui/material";
|
|
358
|
-
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
359
|
-
var EmbedFormControl = ({
|
|
360
|
-
formId,
|
|
361
|
-
formLabel,
|
|
362
|
-
children,
|
|
363
|
-
...props
|
|
364
|
-
}) => {
|
|
365
|
-
return /* @__PURE__ */ jsxs5(FormControl, { ...props, children: [
|
|
366
|
-
/* @__PURE__ */ jsx10(InputLabel, { id: formId, children: formLabel }),
|
|
367
|
-
children
|
|
368
|
-
] });
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
// src/components/controls/ListModeSelect.tsx
|
|
372
|
-
import { SelectEx } from "@ariestools/sdk-react/select";
|
|
373
|
-
import { MenuItem as MenuItem2 } from "@mui/material";
|
|
374
|
-
import { useListMode } from "@xyo-network/react-shared";
|
|
375
|
-
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
376
|
-
var listModeSelectId = "listmode-select-id";
|
|
377
|
-
var listModeSelectLabel = "List Mode";
|
|
378
|
-
var ListModeSelect = (props) => {
|
|
379
|
-
const { listMode, setListMode } = useListMode();
|
|
380
|
-
return /* @__PURE__ */ jsxs6(
|
|
381
|
-
SelectEx,
|
|
382
|
-
{
|
|
383
|
-
value: listMode ?? "default",
|
|
384
|
-
onChange: (event) => {
|
|
385
|
-
setListMode?.(event.target.value);
|
|
386
|
-
},
|
|
387
|
-
...props,
|
|
388
|
-
children: [
|
|
389
|
-
/* @__PURE__ */ jsx11(MenuItem2, { value: "default", children: "Default" }, "default"),
|
|
390
|
-
/* @__PURE__ */ jsx11(MenuItem2, { value: "table", children: "Table" }, "table"),
|
|
391
|
-
/* @__PURE__ */ jsx11(MenuItem2, { value: "grid", children: "Grid" }, "grid")
|
|
392
|
-
]
|
|
393
|
-
}
|
|
394
|
-
);
|
|
395
|
-
};
|
|
396
|
-
var ListModeSelectFormControl = (props) => {
|
|
397
|
-
return /* @__PURE__ */ jsx11(EmbedFormControl, { formId: listModeSelectId, formLabel: listModeSelectLabel, children: /* @__PURE__ */ jsx11(ListModeSelect, { size: "small", label: listModeSelectLabel, labelId: listModeSelectId, ...props }) });
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
// src/components/controls/RenderSelect.tsx
|
|
401
|
-
import { SelectEx as SelectEx2 } from "@ariestools/sdk-react/select";
|
|
402
|
-
import { MenuItem as MenuItem3 } from "@mui/material";
|
|
403
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
404
|
-
var renderSelectId = "render-select-id";
|
|
405
|
-
var renderSelectLabel = "Renderer";
|
|
406
|
-
var EmbedRenderSelect = (props) => {
|
|
407
|
-
const {
|
|
408
|
-
activePlugin,
|
|
409
|
-
setActivePlugin,
|
|
410
|
-
plugins
|
|
411
|
-
} = useEmbedPluginState();
|
|
412
|
-
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)) }) });
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
// src/components/embed-card/card/EmbedPluginCard.tsx
|
|
416
|
-
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
417
|
-
var EmbedPluginCard = ({ ...props }) => {
|
|
418
|
-
const { payload } = useResolvePayload();
|
|
419
|
-
const {
|
|
420
|
-
activePlugin: ActivePlugin,
|
|
421
|
-
plugins,
|
|
422
|
-
hideElementsConfig
|
|
423
|
-
} = useEmbedPluginState();
|
|
424
|
-
const { listMode } = useListMode2();
|
|
425
|
-
const { pluginProps } = usePluginProps();
|
|
426
|
-
const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false;
|
|
427
|
-
return /* @__PURE__ */ jsxs7(BusyCard, { ...props, children: [
|
|
428
|
-
hideElementsConfig?.hideCardHeader ? null : /* @__PURE__ */ jsx13(EmbedCardHeader, {}),
|
|
429
|
-
plugins && plugins.length > 0 || supportsListMode ? /* @__PURE__ */ jsxs7(
|
|
430
|
-
FlexGrowRow,
|
|
431
|
-
{
|
|
432
|
-
sx: {
|
|
433
|
-
columnGap: 2,
|
|
434
|
-
rowGap: 2,
|
|
435
|
-
flexWrap: "wrap",
|
|
436
|
-
pb: 1
|
|
437
|
-
},
|
|
438
|
-
children: [
|
|
439
|
-
plugins && plugins.length > 1 ? /* @__PURE__ */ jsx13(EmbedRenderSelect, {}) : null,
|
|
440
|
-
supportsListMode ? /* @__PURE__ */ jsx13(ListModeSelectFormControl, {}) : null
|
|
441
|
-
]
|
|
442
|
-
}
|
|
443
|
-
) : null,
|
|
444
|
-
/* @__PURE__ */ jsx13(CardContent, { sx: { height: "100%" }, children: ActivePlugin ? /* @__PURE__ */ jsx13(ActivePlugin.components.box.detailsBox, { payload, ...pluginProps, ...supportsListMode && { listMode } }) : null })
|
|
445
|
-
] });
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
// src/components/embed-card/EmbedPluginCard.tsx
|
|
449
|
-
import { useTheme } from "@mui/material";
|
|
450
|
-
|
|
451
|
-
// src/components/EmbedPlugin.tsx
|
|
452
|
-
import { ErrorBoundary } from "@ariestools/sdk-react/error";
|
|
453
|
-
import { ListModeProvider } from "@xyo-network/react-shared";
|
|
454
|
-
|
|
455
|
-
// src/components/EmbedResolver.tsx
|
|
456
|
-
import { LoadResult } from "@xyo-network/react-shared";
|
|
457
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
458
|
-
var EmbedResolver = ({ children }) => {
|
|
459
|
-
const {
|
|
460
|
-
payload,
|
|
461
|
-
notFound,
|
|
462
|
-
huriError
|
|
463
|
-
} = useResolvePayload();
|
|
464
|
-
return /* @__PURE__ */ jsx14(LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// src/components/validation-alerts/ValidatePayload.tsx
|
|
468
|
-
import { Alert } from "@mui/material";
|
|
469
|
-
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
470
|
-
var ValidatePayloadAlert = ({ children, ...props }) => {
|
|
471
|
-
const {
|
|
472
|
-
validPayload,
|
|
473
|
-
enabled,
|
|
474
|
-
schema
|
|
475
|
-
} = useValidatePayload();
|
|
476
|
-
if (enabled && validPayload === false) {
|
|
477
|
-
return /* @__PURE__ */ jsxs8(Alert, { severity: "error", title: "Invalid Payload!", ...props, children: [
|
|
478
|
-
"Payload schema claimed to be",
|
|
479
|
-
" ",
|
|
480
|
-
schema,
|
|
481
|
-
" ",
|
|
482
|
-
"but failed to validate."
|
|
483
|
-
] });
|
|
484
|
-
}
|
|
485
|
-
return /* @__PURE__ */ jsx15(Fragment5, { children });
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
// src/components/validation-alerts/ValidatePlugins.tsx
|
|
489
|
-
import { Alert as Alert2, AlertTitle } from "@mui/material";
|
|
490
|
-
import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
491
|
-
var ValidatePluginsAlert = ({ children, ...props }) => {
|
|
492
|
-
const { payload } = useResolvePayload();
|
|
493
|
-
const { plugins } = useEmbedPluginState();
|
|
494
|
-
if (payload && plugins?.length === 0) {
|
|
495
|
-
return /* @__PURE__ */ jsxs9(Alert2, { severity: "warning", ...props, children: [
|
|
496
|
-
/* @__PURE__ */ jsx16(AlertTitle, { children: "Missing plugins!" }),
|
|
497
|
-
"Payload found but no plugins were present."
|
|
498
|
-
] });
|
|
499
|
-
}
|
|
500
|
-
return /* @__PURE__ */ jsx16(Fragment6, { children });
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
// src/components/EmbedPlugin.tsx
|
|
504
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
505
|
-
var EmbedPluginInner = ({
|
|
506
|
-
validateSchema,
|
|
507
|
-
plugins,
|
|
508
|
-
huriPayload,
|
|
509
|
-
refreshTitle = "",
|
|
510
|
-
timestampLabel = "Data From",
|
|
511
|
-
hideElementsConfig,
|
|
512
|
-
embedPluginConfig,
|
|
513
|
-
onRefresh,
|
|
514
|
-
children
|
|
515
|
-
}) => {
|
|
516
|
-
return /* @__PURE__ */ jsx17(ErrorBoundary, { children: /* @__PURE__ */ jsx17(
|
|
517
|
-
EmbedPluginProvider,
|
|
518
|
-
{
|
|
519
|
-
refreshTitle,
|
|
520
|
-
timestampLabel,
|
|
521
|
-
hideElementsConfig,
|
|
522
|
-
plugins,
|
|
523
|
-
embedPluginConfig,
|
|
524
|
-
children: /* @__PURE__ */ jsx17(WithResolvers, { onRefresh, huriPayload, children: /* @__PURE__ */ jsx17(WithValidators, { validateSchema, children: /* @__PURE__ */ jsx17(ListModeProvider, { defaultListMode: embedPluginConfig?.listMode, children }) }) })
|
|
525
|
-
}
|
|
526
|
-
) });
|
|
527
|
-
};
|
|
528
|
-
var WithResolvers = ({
|
|
529
|
-
children,
|
|
530
|
-
onRefresh,
|
|
531
|
-
huriPayload
|
|
532
|
-
}) => {
|
|
533
|
-
return /* @__PURE__ */ jsx17(RefreshPayloadProvider, { onRefresh, children: /* @__PURE__ */ jsx17(ResolvePayloadProvider, { huriPayload, children: /* @__PURE__ */ jsx17(EmbedResolver, { children }) }) });
|
|
534
|
-
};
|
|
535
|
-
var WithValidators = ({ children, validateSchema }) => {
|
|
536
|
-
return /* @__PURE__ */ jsx17(ValidatePayloadProvider, { enabled: validateSchema, children: /* @__PURE__ */ jsx17(ValidatePluginsAlert, { children: /* @__PURE__ */ jsx17(ValidatePayloadAlert, { children }) }) });
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
// src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx
|
|
540
|
-
import { ErrorAlert, ErrorRender } from "@ariestools/sdk-react/error";
|
|
541
|
-
|
|
542
|
-
// src/components/embed-card/error-handling/EmbedErrorCard.tsx
|
|
543
|
-
import { isDefined as isDefined4 } from "@ariestools/sdk";
|
|
544
|
-
import {
|
|
545
|
-
Alert as Alert3,
|
|
546
|
-
AlertTitle as AlertTitle2,
|
|
547
|
-
Card as Card2,
|
|
548
|
-
CardContent as CardContent2,
|
|
549
|
-
Typography
|
|
550
|
-
} from "@mui/material";
|
|
551
|
-
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
552
|
-
var EmbedErrorCard = (props) => {
|
|
553
|
-
const {
|
|
554
|
-
alertProps,
|
|
555
|
-
error,
|
|
556
|
-
scope,
|
|
557
|
-
hideErrorDetails = true,
|
|
558
|
-
children,
|
|
559
|
-
...cardProps
|
|
560
|
-
} = props;
|
|
561
|
-
const errorProps = {
|
|
562
|
-
alertProps,
|
|
563
|
-
error,
|
|
564
|
-
hideErrorDetails,
|
|
565
|
-
scope
|
|
566
|
-
};
|
|
567
|
-
return /* @__PURE__ */ jsx18(Card2, { ...cardProps, children: /* @__PURE__ */ jsx18(CardContent2, { children: children ?? /* @__PURE__ */ jsx18(DefaultErrorAlert, { ...errorProps }) }) });
|
|
568
|
-
};
|
|
569
|
-
var DefaultErrorAlert = ({
|
|
570
|
-
alertProps,
|
|
571
|
-
scope,
|
|
572
|
-
hideErrorDetails,
|
|
573
|
-
error
|
|
574
|
-
}) => {
|
|
575
|
-
return /* @__PURE__ */ jsxs10(Alert3, { severity: "error", ...alertProps, children: [
|
|
576
|
-
/* @__PURE__ */ jsx18(AlertTitle2, { children: "Whoops! Something went wrong" }),
|
|
577
|
-
isDefined4(scope) ? /* @__PURE__ */ jsxs10(Typography, { variant: "caption", children: [
|
|
578
|
-
"Scope:",
|
|
579
|
-
scope
|
|
580
|
-
] }) : null,
|
|
581
|
-
!hideErrorDetails && error ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
582
|
-
/* @__PURE__ */ jsx18(Typography, { variant: "caption", children: "Error: " }),
|
|
583
|
-
/* @__PURE__ */ jsx18(Typography, { variant: "caption", children: error?.message })
|
|
584
|
-
] }) : /* @__PURE__ */ jsx18(
|
|
585
|
-
Typography,
|
|
586
|
-
{
|
|
587
|
-
variant: "caption",
|
|
588
|
-
sx: { fontSize: "small" },
|
|
589
|
-
children: "Error Loading Plugin"
|
|
590
|
-
}
|
|
591
|
-
)
|
|
592
|
-
] });
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
// src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx
|
|
596
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
597
|
-
var EmbedCardApiErrorRenderer = ({
|
|
598
|
-
xyoError,
|
|
599
|
-
children,
|
|
600
|
-
...props
|
|
601
|
-
}) => {
|
|
602
|
-
return /* @__PURE__ */ jsx19(ErrorRender, { error: xyoError, noReAuth: true, noErrorDisplay: true, customError: /* @__PURE__ */ jsx19(CustomApiErrorCard, { xyoError, ...props }), children });
|
|
603
|
-
};
|
|
604
|
-
var CustomApiErrorCard = ({ xyoError, ...props }) => {
|
|
605
|
-
return /* @__PURE__ */ jsx19(EmbedErrorCard, { ...props, children: /* @__PURE__ */ jsx19(ErrorAlert, { error: xyoError }) });
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
// src/components/embed-card/EmbedPluginCard.tsx
|
|
609
|
-
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
610
|
-
var ApiEmbedPluginCard = ({ children, ...props }) => {
|
|
611
|
-
const {
|
|
612
|
-
validateSchema,
|
|
613
|
-
plugins = [],
|
|
614
|
-
huriPayload,
|
|
615
|
-
refreshTitle = "",
|
|
616
|
-
timestampLabel = "Data From",
|
|
617
|
-
hideElementsConfig,
|
|
618
|
-
embedPluginConfig,
|
|
619
|
-
onRefresh,
|
|
620
|
-
...busyCardProps
|
|
621
|
-
} = props;
|
|
622
|
-
return /* @__PURE__ */ jsxs11(
|
|
623
|
-
EmbedPluginInner,
|
|
624
|
-
{
|
|
625
|
-
...{
|
|
626
|
-
embedPluginConfig,
|
|
627
|
-
hideElementsConfig,
|
|
628
|
-
huriPayload,
|
|
629
|
-
onRefresh,
|
|
630
|
-
plugins,
|
|
631
|
-
refreshTitle,
|
|
632
|
-
timestampLabel,
|
|
633
|
-
validateSchema
|
|
634
|
-
},
|
|
635
|
-
children: [
|
|
636
|
-
/* @__PURE__ */ jsx20(EmbedPluginCardInner, { ...busyCardProps }),
|
|
637
|
-
children
|
|
638
|
-
]
|
|
639
|
-
}
|
|
640
|
-
);
|
|
641
|
-
};
|
|
642
|
-
var EmbedPluginCardInner = (props) => {
|
|
643
|
-
const { payload, huriError } = useResolvePayload();
|
|
644
|
-
const { refreshPayload } = useRefreshPayload();
|
|
645
|
-
const theme = useTheme();
|
|
646
|
-
return /* @__PURE__ */ jsx20(EmbedCardApiErrorRenderer, { xyoError: huriError, children: /* @__PURE__ */ jsx20(
|
|
647
|
-
EmbedPluginCard,
|
|
648
|
-
{
|
|
649
|
-
elevation: 3,
|
|
650
|
-
variant: "elevation",
|
|
651
|
-
busy: Boolean(!refreshPayload && payload),
|
|
652
|
-
busyVariantProps: {
|
|
653
|
-
style: {
|
|
654
|
-
alignItems: "start",
|
|
655
|
-
paddingTop: theme.spacing(2),
|
|
656
|
-
zIndex: 2
|
|
657
|
-
}
|
|
658
|
-
},
|
|
659
|
-
sx: { position: "relative" },
|
|
660
|
-
...props
|
|
661
|
-
}
|
|
662
|
-
) });
|
|
663
|
-
};
|
|
664
|
-
export {
|
|
665
|
-
ApiEmbedPluginCard,
|
|
666
|
-
BusyCard,
|
|
667
|
-
EmbedCardHeader,
|
|
668
|
-
EmbedPluginCard as EmbedPlugin,
|
|
669
|
-
EmbedPluginCard,
|
|
670
|
-
EmbedPluginCardInner,
|
|
671
|
-
EmbedPluginContext,
|
|
672
|
-
EmbedPluginInner,
|
|
673
|
-
EmbedPluginProvider,
|
|
674
|
-
PluginPropsContext,
|
|
675
|
-
PluginPropsProvider,
|
|
676
|
-
RefreshPayloadProvider,
|
|
677
|
-
ResolvePayloadContext,
|
|
678
|
-
ResolvePayloadProvider,
|
|
679
|
-
ValidatePayloadProvider,
|
|
680
|
-
useEmbedPluginState,
|
|
681
|
-
usePluginProps,
|
|
682
|
-
useRefreshPayload,
|
|
683
|
-
useResolvePayload,
|
|
684
|
-
useValidatePayload
|
|
685
|
-
};
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@xyo-network/react-sdk/embed";
|
|
686
3
|
//# sourceMappingURL=index.mjs.map
|