@xyo-network/react-embed 7.5.8 → 7.5.11

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