@xyo-network/react-embed 2.53.0 → 2.54.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/components/{XyoEmbedPlugin.js → EmbedPlugin.js} +5 -5
- package/dist/cjs/components/EmbedPlugin.js.map +1 -0
- package/dist/cjs/components/controls/RenderSelect.js +1 -1
- package/dist/cjs/components/controls/RenderSelect.js.map +1 -1
- package/dist/cjs/components/embed-card/{XyoEmbedPluginCard.js → EmbedPluginCard.js} +11 -11
- package/dist/cjs/components/embed-card/EmbedPluginCard.js.map +1 -0
- package/dist/cjs/components/embed-card/card/EmbedCardHeader.js +1 -1
- package/dist/cjs/components/embed-card/card/EmbedCardHeader.js.map +1 -1
- package/dist/cjs/components/embed-card/card/EmbedPluginCard.js +1 -1
- package/dist/cjs/components/embed-card/card/EmbedPluginCard.js.map +1 -1
- package/dist/cjs/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +2 -2
- package/dist/cjs/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +1 -1
- package/dist/cjs/components/embed-card/index.js +1 -1
- package/dist/cjs/components/embed-card/index.js.map +1 -1
- package/dist/cjs/components/embed-plugin-stories/storyShared.js +2 -2
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/validation-alerts/ValidatePlugins.js +1 -1
- package/dist/cjs/components/validation-alerts/ValidatePlugins.js.map +1 -1
- package/dist/cjs/contexts/EmbedPluginContext/Context.js +6 -0
- package/dist/cjs/contexts/EmbedPluginContext/Context.js.map +1 -0
- package/dist/cjs/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/Provider.js +4 -4
- package/dist/cjs/contexts/EmbedPluginContext/Provider.js.map +1 -0
- package/dist/cjs/contexts/EmbedPluginContext/State.js.map +1 -0
- package/dist/cjs/contexts/EmbedPluginContext/index.js.map +1 -0
- package/dist/cjs/contexts/EmbedPluginContext/use.js +8 -0
- package/dist/cjs/contexts/EmbedPluginContext/use.js.map +1 -0
- package/dist/cjs/contexts/index.js +1 -1
- package/dist/cjs/contexts/index.js.map +1 -1
- package/dist/cjs/types/{XyoEmbedPluginProps.js → EmbedPluginProps.js} +1 -1
- package/dist/cjs/types/EmbedPluginProps.js.map +1 -0
- package/dist/cjs/types/index.js +1 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/docs.json +1695 -1695
- package/dist/esm/components/EmbedPlugin.js +15 -0
- package/dist/esm/components/EmbedPlugin.js.map +1 -0
- package/dist/esm/components/controls/RenderSelect.js +2 -2
- package/dist/esm/components/controls/RenderSelect.js.map +1 -1
- package/dist/esm/components/embed-card/{XyoEmbedPluginCard.js → EmbedPluginCard.js} +8 -8
- package/dist/esm/components/embed-card/EmbedPluginCard.js.map +1 -0
- package/dist/esm/components/embed-card/card/EmbedCardHeader.js +2 -2
- package/dist/esm/components/embed-card/card/EmbedCardHeader.js.map +1 -1
- package/dist/esm/components/embed-card/card/EmbedPluginCard.js +2 -2
- package/dist/esm/components/embed-card/card/EmbedPluginCard.js.map +1 -1
- package/dist/esm/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +3 -3
- package/dist/esm/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +1 -1
- package/dist/esm/components/embed-card/index.js +1 -1
- package/dist/esm/components/embed-card/index.js.map +1 -1
- package/dist/esm/components/embed-plugin-stories/storyShared.js +3 -3
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/validation-alerts/ValidatePlugins.js +2 -2
- package/dist/esm/components/validation-alerts/ValidatePlugins.js.map +1 -1
- package/dist/esm/contexts/EmbedPluginContext/Context.js +3 -0
- package/dist/esm/contexts/EmbedPluginContext/Context.js.map +1 -0
- package/dist/esm/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/Provider.js +3 -3
- package/dist/esm/contexts/EmbedPluginContext/Provider.js.map +1 -0
- package/dist/esm/contexts/EmbedPluginContext/State.js.map +1 -0
- package/dist/esm/contexts/EmbedPluginContext/index.js.map +1 -0
- package/dist/esm/contexts/EmbedPluginContext/use.js +4 -0
- package/dist/esm/contexts/EmbedPluginContext/use.js.map +1 -0
- package/dist/esm/contexts/index.js +1 -1
- package/dist/esm/contexts/index.js.map +1 -1
- package/dist/esm/types/EmbedPluginProps.js +2 -0
- package/dist/esm/types/EmbedPluginProps.js.map +1 -0
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/types/components/EmbedPlugin.d.ts +5 -0
- package/dist/types/components/EmbedPlugin.d.ts.map +1 -0
- package/dist/types/components/embed-card/EmbedPluginCard.d.ts +11 -0
- package/dist/types/components/embed-card/EmbedPluginCard.d.ts.map +1 -0
- package/dist/types/components/embed-card/index.d.ts +1 -1
- package/dist/types/components/embed-card/index.d.ts.map +1 -1
- package/dist/types/components/embed-plugin-stories/storyShared.d.ts +2 -2
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/contexts/EmbedPluginContext/Context.d.ts +4 -0
- package/dist/types/contexts/EmbedPluginContext/Context.d.ts.map +1 -0
- package/dist/types/contexts/EmbedPluginContext/Provider.d.ts +7 -0
- package/dist/types/contexts/EmbedPluginContext/Provider.d.ts.map +1 -0
- package/dist/types/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/State.d.ts +3 -3
- package/dist/types/contexts/EmbedPluginContext/State.d.ts.map +1 -0
- package/dist/types/contexts/EmbedPluginContext/index.d.ts.map +1 -0
- package/dist/types/contexts/EmbedPluginContext/use.d.ts +2 -0
- package/dist/types/contexts/EmbedPluginContext/use.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +1 -1
- package/dist/types/contexts/index.d.ts.map +1 -1
- package/dist/types/types/{XyoEmbedPluginProps.d.ts → EmbedPluginProps.d.ts} +3 -3
- package/dist/types/types/EmbedPluginProps.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/{XyoEmbedPlugin.tsx → EmbedPlugin.tsx} +6 -6
- package/src/components/controls/RenderSelect.tsx +2 -2
- package/src/components/embed-card/{XyoEmbedPluginCard.tsx → EmbedPluginCard.tsx} +10 -10
- package/src/components/embed-card/card/EmbedCardHeader.tsx +2 -2
- package/src/components/embed-card/card/EmbedPluginCard.tsx +2 -2
- package/src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx +4 -4
- package/src/components/embed-card/index.ts +1 -1
- package/src/components/embed-plugin-stories/XyoEmbedPlugin.examples.stories.tsx +1 -1
- package/src/components/embed-plugin-stories/XyoEmbedPlugin.states.stories.tsx +1 -1
- package/src/components/embed-plugin-stories/storyShared.tsx +4 -4
- package/src/components/index.ts +1 -1
- package/src/components/validation-alerts/ValidatePlugins.tsx +2 -2
- package/src/contexts/EmbedPluginContext/Context.tsx +5 -0
- package/src/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/Provider.tsx +6 -6
- package/src/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/State.ts +3 -3
- package/src/contexts/EmbedPluginContext/use.tsx +5 -0
- package/src/contexts/ValidatePayloadContext/Provider.stories.tsx +4 -4
- package/src/contexts/index.ts +1 -1
- package/src/types/{XyoEmbedPluginProps.ts → EmbedPluginProps.ts} +2 -2
- package/src/types/index.ts +1 -1
- package/dist/cjs/components/XyoEmbedPlugin.js.map +0 -1
- package/dist/cjs/components/embed-card/XyoEmbedPluginCard.js.map +0 -1
- package/dist/cjs/contexts/XyoEmbedPluginContext/Context.js +0 -6
- package/dist/cjs/contexts/XyoEmbedPluginContext/Context.js.map +0 -1
- package/dist/cjs/contexts/XyoEmbedPluginContext/Provider.js.map +0 -1
- package/dist/cjs/contexts/XyoEmbedPluginContext/State.js.map +0 -1
- package/dist/cjs/contexts/XyoEmbedPluginContext/index.js.map +0 -1
- package/dist/cjs/contexts/XyoEmbedPluginContext/use.js +0 -8
- package/dist/cjs/contexts/XyoEmbedPluginContext/use.js.map +0 -1
- package/dist/cjs/types/XyoEmbedPluginProps.js.map +0 -1
- package/dist/esm/components/XyoEmbedPlugin.js +0 -15
- package/dist/esm/components/XyoEmbedPlugin.js.map +0 -1
- package/dist/esm/components/embed-card/XyoEmbedPluginCard.js.map +0 -1
- package/dist/esm/contexts/XyoEmbedPluginContext/Context.js +0 -3
- package/dist/esm/contexts/XyoEmbedPluginContext/Context.js.map +0 -1
- package/dist/esm/contexts/XyoEmbedPluginContext/Provider.js.map +0 -1
- package/dist/esm/contexts/XyoEmbedPluginContext/State.js.map +0 -1
- package/dist/esm/contexts/XyoEmbedPluginContext/index.js.map +0 -1
- package/dist/esm/contexts/XyoEmbedPluginContext/use.js +0 -4
- package/dist/esm/contexts/XyoEmbedPluginContext/use.js.map +0 -1
- package/dist/esm/types/XyoEmbedPluginProps.js +0 -2
- package/dist/esm/types/XyoEmbedPluginProps.js.map +0 -1
- package/dist/types/components/XyoEmbedPlugin.d.ts +0 -5
- package/dist/types/components/XyoEmbedPlugin.d.ts.map +0 -1
- package/dist/types/components/embed-card/XyoEmbedPluginCard.d.ts +0 -11
- package/dist/types/components/embed-card/XyoEmbedPluginCard.d.ts.map +0 -1
- package/dist/types/contexts/XyoEmbedPluginContext/Context.d.ts +0 -4
- package/dist/types/contexts/XyoEmbedPluginContext/Context.d.ts.map +0 -1
- package/dist/types/contexts/XyoEmbedPluginContext/Provider.d.ts +0 -7
- package/dist/types/contexts/XyoEmbedPluginContext/Provider.d.ts.map +0 -1
- package/dist/types/contexts/XyoEmbedPluginContext/State.d.ts.map +0 -1
- package/dist/types/contexts/XyoEmbedPluginContext/index.d.ts.map +0 -1
- package/dist/types/contexts/XyoEmbedPluginContext/use.d.ts +0 -2
- package/dist/types/contexts/XyoEmbedPluginContext/use.d.ts.map +0 -1
- package/dist/types/types/XyoEmbedPluginProps.d.ts.map +0 -1
- package/src/contexts/XyoEmbedPluginContext/Context.tsx +0 -5
- package/src/contexts/XyoEmbedPluginContext/use.tsx +0 -5
- /package/dist/cjs/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/State.js +0 -0
- /package/dist/cjs/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/index.js +0 -0
- /package/dist/esm/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/State.js +0 -0
- /package/dist/esm/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/index.js +0 -0
- /package/dist/types/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/index.d.ts +0 -0
- /package/src/contexts/{XyoEmbedPluginContext → EmbedPluginContext}/index.ts +0 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { ErrorBoundary, ListModeProvider } from '@xyo-network/react-shared';
|
3
|
+
import { EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider } from '../contexts';
|
4
|
+
import { EmbedResolver } from './EmbedResolver';
|
5
|
+
import { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts';
|
6
|
+
export const EmbedPluginInner = ({ validateSchema, plugins = [], huriPayload, refreshTitle = '', timestampLabel = 'Data From', hideElementsConfig, embedPluginConfig, onRefresh, children, }) => {
|
7
|
+
return (_jsx(ErrorBoundary, { children: _jsx(EmbedPluginProvider, { refreshTitle: refreshTitle, timestampLabel: timestampLabel, hideElementsConfig: hideElementsConfig, plugins: plugins, embedPluginConfig: embedPluginConfig, children: _jsx(WithResolvers, { onRefresh: onRefresh, huriPayload: huriPayload, children: _jsx(WithValidators, { validateSchema: validateSchema, children: _jsx(ListModeProvider, { defaultListMode: embedPluginConfig?.listMode, children: children }) }) }) }) }));
|
8
|
+
};
|
9
|
+
const WithResolvers = ({ children, onRefresh, huriPayload }) => {
|
10
|
+
return (_jsx(RefreshPayloadProvider, { onRefresh: onRefresh, children: _jsx(ResolvePayloadProvider, { huriPayload: huriPayload, children: _jsx(EmbedResolver, { children: children }) }) }));
|
11
|
+
};
|
12
|
+
const WithValidators = ({ children, validateSchema }) => {
|
13
|
+
return (_jsx(ValidatePayloadProvider, { enabled: validateSchema, children: _jsx(ValidatePluginsAlert, { children: _jsx(ValidatePayloadAlert, { children: children }) }) }));
|
14
|
+
};
|
15
|
+
//# sourceMappingURL=EmbedPlugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPlugin.js","sourceRoot":"","sources":["../../../src/components/EmbedPlugin.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE3E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1H,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAA6C,CAAC,EACzE,cAAc,EACd,OAAO,GAAG,EAAE,EACZ,WAAW,EACX,YAAY,GAAG,EAAE,EACjB,cAAc,GAAG,WAAW,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,KAAC,aAAa,cACZ,KAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,iBAAiB,YAEpC,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,YAC3D,KAAC,cAAc,IAAC,cAAc,EAAE,cAAc,YAC5C,KAAC,gBAAgB,IAAC,eAAe,EAAE,iBAAiB,EAAE,QAAQ,YAAG,QAAQ,GAAoB,GAC9E,GACH,GACI,GACR,CACjB,CAAA;AACH,CAAC,CAAA;AAID,MAAM,aAAa,GAA+C,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;IACzG,OAAO,CACL,KAAC,sBAAsB,IAAC,SAAS,EAAE,SAAS,YAC1C,KAAC,sBAAsB,IAAC,WAAW,EAAE,WAAW,YAC9C,KAAC,aAAa,cAAE,QAAQ,GAAiB,GAClB,GACF,CAC1B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,cAAc,GAAyD,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE;IAC5G,OAAO,CACL,KAAC,uBAAuB,IAAC,OAAO,EAAE,cAAc,YAC9C,KAAC,oBAAoB,cACnB,KAAC,oBAAoB,cAAE,QAAQ,GAAwB,GAClC,GACC,CAC3B,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { MenuItem, Select } from '@mui/material';
|
3
|
-
import {
|
3
|
+
import { useEmbedPluginState } from '../../contexts';
|
4
4
|
import { EmbedFormControl } from './EmbedFormControl';
|
5
5
|
const renderSelectId = 'render-select-id';
|
6
6
|
const renderSelectLabel = 'Renderer';
|
7
7
|
export const EmbedRenderSelect = (props) => {
|
8
|
-
const { activePlugin, setActivePlugin, plugins } =
|
8
|
+
const { activePlugin, setActivePlugin, plugins } = useEmbedPluginState();
|
9
9
|
return (_jsx(EmbedFormControl, { formId: renderSelectId, formLabel: renderSelectLabel, children: _jsx(Select, { size: "small", value: activePlugin?.name, ...props, children: plugins?.map((plugin) => (_jsx(MenuItem, { value: plugin.name, onClick: () => setActivePlugin?.(plugin), children: plugin.name }, plugin.name))) }) }));
|
10
10
|
};
|
11
11
|
//# sourceMappingURL=RenderSelect.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RenderSelect.js","sourceRoot":"","sources":["../../../../src/components/controls/RenderSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"RenderSelect.js","sourceRoot":"","sources":["../../../../src/components/controls/RenderSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,cAAc,GAAG,kBAAkB,CAAA;AACzC,MAAM,iBAAiB,GAAG,UAAU,CAAA;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAA0B,CAAC,KAAK,EAAE,EAAE;IAChE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACxE,OAAO,CACL,KAAC,gBAAgB,IAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,YACpE,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,KAAM,KAAK,YACtD,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACxB,KAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAoB,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,YACrF,MAAM,CAAC,IAAI,IADqB,MAAM,CAAC,IAAI,CAEnC,CACZ,CAAC,GACK,GACQ,CACpB,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useTheme } from '@mui/material';
|
3
3
|
import { useRefreshPayload, useResolvePayload } from '../../contexts';
|
4
|
-
import {
|
4
|
+
import { EmbedPluginInner } from '../EmbedPlugin';
|
5
5
|
import { EmbedPluginCard } from './card';
|
6
6
|
import { EmbedCardApiErrorRenderer } from './error-handling';
|
7
|
-
export const
|
7
|
+
export const ApiEmbedPluginCard = ({ children, ...props }) => {
|
8
8
|
const { validateSchema, plugins = [], huriPayload, refreshTitle = '', timestampLabel = 'Data From', hideElementsConfig, embedPluginConfig, onRefresh, ...busyCardProps } = props;
|
9
|
-
return (_jsxs(
|
9
|
+
return (_jsxs(EmbedPluginInner, { ...{
|
10
10
|
embedPluginConfig,
|
11
11
|
hideElementsConfig,
|
12
12
|
huriPayload,
|
@@ -15,14 +15,14 @@ export const XyoEmbedPluginCard = ({ children, ...props }) => {
|
|
15
15
|
refreshTitle,
|
16
16
|
timestampLabel,
|
17
17
|
validateSchema,
|
18
|
-
}, children: [_jsx(
|
18
|
+
}, children: [_jsx(EmbedPluginCardInner, { ...busyCardProps }), children] }));
|
19
19
|
};
|
20
|
-
export const
|
20
|
+
export const EmbedPluginCardInner = (props) => {
|
21
21
|
const { payload, huriError } = useResolvePayload();
|
22
22
|
const { refreshPayload } = useRefreshPayload();
|
23
23
|
const theme = useTheme();
|
24
24
|
return (_jsx(EmbedCardApiErrorRenderer, { xyoError: huriError, children: _jsx(EmbedPluginCard, { elevation: 3, variant: "elevation", busy: Boolean(!refreshPayload && payload), busyVariantProps: { style: { alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2 } }, sx: { position: 'relative' }, ...props }) }));
|
25
25
|
};
|
26
|
-
/** @deprecated - use
|
27
|
-
export const
|
28
|
-
//# sourceMappingURL=
|
26
|
+
/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */
|
27
|
+
export const EmbedPlugin = EmbedPluginCard;
|
28
|
+
//# sourceMappingURL=EmbedPluginCard.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPluginCard.js","sourceRoot":"","sources":["../../../../src/components/embed-card/EmbedPluginCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAiB,eAAe,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAI5D,MAAM,CAAC,MAAM,kBAAkB,GAAmC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC3F,MAAM,EACJ,cAAc,EACd,OAAO,GAAG,EAAE,EACZ,WAAW,EACX,YAAY,GAAG,EAAE,EACjB,cAAc,GAAG,WAAW,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,GAAG,aAAa,EACjB,GAAG,KAAK,CAAA;IAET,OAAO,CACL,MAAC,gBAAgB,OACX;YACF,iBAAiB;YACjB,kBAAkB;YAClB,WAAW;YACX,SAAS;YACT,OAAO;YACP,YAAY;YACZ,cAAc;YACd,cAAc;SACf,aAED,KAAC,oBAAoB,OAAK,aAAa,GAAI,EAC1C,QAAQ,IACQ,CACpB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAA4B,CAAC,KAAK,EAAE,EAAE;IACrE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAClD,MAAM,EAAE,cAAc,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC9C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,OAAO,CACL,KAAC,yBAAyB,IAAC,QAAQ,EAAE,SAAS,YAC5C,KAAC,eAAe,IACd,SAAS,EAAE,CAAC,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,OAAO,CAAC,CAAC,cAAc,IAAI,OAAO,CAAC,EACzC,gBAAgB,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAC7F,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KACxB,KAAK,GACT,GACwB,CAC7B,CAAA;AACH,CAAC,CAAA;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAA"}
|
@@ -2,11 +2,11 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
2
2
|
import RefreshIcon from '@mui/icons-material/Refresh';
|
3
3
|
import { Avatar, CardHeader, Chip } from '@mui/material';
|
4
4
|
import { FlexRow } from '@xylabs/react-flexbox';
|
5
|
-
import {
|
5
|
+
import { useEmbedPluginState, useResolvePayload } from '../../../contexts';
|
6
6
|
import { EmbedMenu } from '../menu';
|
7
7
|
export const EmbedCardHeader = () => {
|
8
8
|
const { payload, refreshHuri, huri } = useResolvePayload();
|
9
|
-
const { activePlugin, timestampLabel, hideElementsConfig } =
|
9
|
+
const { activePlugin, timestampLabel, hideElementsConfig } = useEmbedPluginState();
|
10
10
|
const { hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions } = hideElementsConfig ?? {};
|
11
11
|
return (_jsx(CardHeader, { sx: { flexWrap: 'wrap', rowGap: 1 }, avatar: hideAvatar ? (_jsx(_Fragment, {})) : (_jsx(Avatar, { sx: { bgcolor: (theme) => theme.palette.primary.main }, "aria-label": activePlugin?.name, children: activePlugin?.name?.charAt(0) })), action: _jsxs(FlexRow, { flexWrap: "wrap", columnGap: 0.5, children: [payload?.timestamp ? (hideTimestamp && hideRefreshButton ? ('') : (_jsx(Chip, { avatar: hideRefreshButton ? _jsx(_Fragment, {}) : _jsx(RefreshIcon, {}), clickable: hideRefreshButton ? false : true, onClick: refreshHuri, label: hideTimestamp ? '' : `${timestampLabel} ${new Date(payload.timestamp).toLocaleString()}` }))) : null, hideCardActions || huri === undefined ? null : _jsx(EmbedMenu, {})] }), title: hideTitle ? '' : activePlugin?.name }));
|
12
12
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,IAAI,EAAS,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,IAAI,EAAS,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAA8B,GAAG,EAAE;IAC7D,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC1D,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAClF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,kBAAkB,IAAI,EAAE,CAAA;IAC7G,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,EACnC,MAAM,EACJ,UAAU,CAAC,CAAC,CAAC,CACX,mBAAK,CACN,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAc,YAAY,EAAE,IAAI,YAClG,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GACvB,CACV,EAEH,MAAM,EACJ,MAAC,OAAO,IAAC,QAAQ,EAAC,MAAM,EAAC,SAAS,EAAE,GAAG,aACpC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CACpB,aAAa,IAAI,iBAAiB,CAAC,CAAC,CAAC,CACnC,EAAE,CACH,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,mBAAK,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,EACnD,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAC3C,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE,GAC/F,CACH,CACF,CAAC,CAAC,CAAC,IAAI,EAEP,eAAe,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,SAAS,KAAG,IACrD,EAEZ,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,IAAI,GAC1C,CACH,CAAA;AACH,CAAC,CAAA"}
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CardContent } from '@mui/material';
|
3
3
|
import { FlexGrowRow } from '@xylabs/react-flexbox';
|
4
4
|
import { useListMode } from '@xyo-network/react-shared';
|
5
|
-
import {
|
5
|
+
import { useEmbedPluginState, useResolvePayload } from '../../../contexts';
|
6
6
|
import { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls';
|
7
7
|
import { BusyCard } from './BusyCard';
|
8
8
|
import { EmbedCardHeader } from './EmbedCardHeader';
|
9
9
|
export const EmbedPluginCard = ({ ...props }) => {
|
10
10
|
const { payload } = useResolvePayload();
|
11
|
-
const { activePlugin: ActivePlugin, plugins, hideElementsConfig } =
|
11
|
+
const { activePlugin: ActivePlugin, plugins, hideElementsConfig } = useEmbedPluginState();
|
12
12
|
const { listMode } = useListMode();
|
13
13
|
const supportsListMode = ActivePlugin?.components?.box?.listModes?.length ?? 0 > 1;
|
14
14
|
return (_jsxs(BusyCard, { ...props, children: [hideElementsConfig?.hideCardHeader ? null : _jsx(EmbedCardHeader, {}), (plugins && plugins.length) || supportsListMode ? (_jsxs(FlexGrowRow, { columnGap: 2, rowGap: 2, flexWrap: "wrap", pb: 1, children: [plugins && plugins.length > 1 ? _jsx(EmbedRenderSelect, {}) : null, supportsListMode ? _jsx(ListModeSelectFormControl, {}) : null] })) : null, _jsx(CardContent, { sx: { height: '100%' }, children: ActivePlugin ? _jsx(ActivePlugin.components.box.detailsBox, { payload: payload, ...(supportsListMode && { listMode }) }) : null })] }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedPluginCard.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedPluginCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"EmbedPluginCard.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedPluginCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,MAAM,eAAe,GAA4B,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACvE,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACvC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACzF,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAA;IAClC,MAAM,gBAAgB,GAAG,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;IAElF,OAAO,CACL,MAAC,QAAQ,OAAK,KAAK,aAChB,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,EAE/D,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CACjD,MAAC,WAAW,IAAC,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,aACxD,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,IAAI,EAC5D,gBAAgB,CAAC,CAAC,CAAC,KAAC,yBAAyB,KAAG,CAAC,CAAC,CAAC,IAAI,IAC5C,CACf,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,WAAW,IAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAChC,YAAY,CAAC,CAAC,CAAC,KAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,IAAC,OAAO,EAAE,OAAO,KAAM,CAAC,gBAAgB,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,GAC/G,IACL,CACZ,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { ErrorAlert, ErrorRender } from '@xyo-network/react-error';
|
3
3
|
import { EmbedErrorCard } from './EmbedErrorCard';
|
4
4
|
export const EmbedCardApiErrorRenderer = ({ xyoError, children, ...props }) => {
|
5
|
-
return (_jsx(
|
5
|
+
return (_jsx(ErrorRender, { error: xyoError, noReAuth: true, noErrorDisplay: true, customError: _jsx(CustomApiErrorCard, { xyoError: xyoError, ...props }), children: children }));
|
6
6
|
};
|
7
7
|
const CustomApiErrorCard = ({ xyoError, ...props }) => {
|
8
|
-
return (_jsx(EmbedErrorCard, { ...props, children: _jsx(
|
8
|
+
return (_jsx(EmbedErrorCard, { ...props, children: _jsx(ErrorAlert, { error: xyoError }) }));
|
9
9
|
};
|
10
10
|
//# sourceMappingURL=EmbedCardApiErrorRenderer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedCardApiErrorRenderer.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"EmbedCardApiErrorRenderer.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMjD,MAAM,CAAC,MAAM,yBAAyB,GAA2D,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACpI,OAAO,CACL,KAAC,WAAW,IAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,QAAC,cAAc,QAAC,WAAW,EAAE,KAAC,kBAAkB,IAAC,QAAQ,EAAE,QAAQ,KAAM,KAAK,GAAI,YACrH,QAAQ,GACG,CACf,CAAA;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAA6C,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9F,OAAO,CACL,KAAC,cAAc,OAAK,KAAK,YACvB,KAAC,UAAU,IAAC,KAAK,EAAE,QAAQ,GAAI,GAChB,CAClB,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/embed-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/embed-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { BrowserRouter } from 'react-router-dom';
|
3
|
-
import {
|
3
|
+
import { ApiEmbedPluginCard } from '../embed-card';
|
4
4
|
export const xyoEmbedStoryBase = {
|
5
5
|
argTypes: {},
|
6
|
-
component:
|
6
|
+
component: ApiEmbedPluginCard,
|
7
7
|
parameters: {
|
8
8
|
docs: {
|
9
9
|
page: null,
|
@@ -11,6 +11,6 @@ export const xyoEmbedStoryBase = {
|
|
11
11
|
},
|
12
12
|
};
|
13
13
|
export const Template = (args) => {
|
14
|
-
return (_jsx(BrowserRouter, { children: _jsx(
|
14
|
+
return (_jsx(BrowserRouter, { children: _jsx(ApiEmbedPluginCard, { ...args }) }));
|
15
15
|
};
|
16
16
|
//# sourceMappingURL=storyShared.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { Alert, AlertTitle } from '@mui/material';
|
3
|
-
import {
|
3
|
+
import { useEmbedPluginState, useResolvePayload } from '../../contexts';
|
4
4
|
export const ValidatePluginsAlert = ({ children, ...props }) => {
|
5
5
|
const { payload } = useResolvePayload();
|
6
|
-
const { plugins } =
|
6
|
+
const { plugins } = useEmbedPluginState();
|
7
7
|
if (payload && plugins?.length === 0) {
|
8
8
|
return (_jsxs(Alert, { severity: "warning", ...props, children: [_jsx(AlertTitle, { children: "Missing plugins!" }), "Payload found but no plugins were present."] }));
|
9
9
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ValidatePlugins.js","sourceRoot":"","sources":["../../../../src/components/validation-alerts/ValidatePlugins.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAc,UAAU,EAAE,MAAM,eAAe,CAAA;AAG7D,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"ValidatePlugins.js","sourceRoot":"","sources":["../../../../src/components/validation-alerts/ValidatePlugins.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAc,UAAU,EAAE,MAAM,eAAe,CAAA;AAG7D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAuC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjG,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAEzC,IAAI,OAAO,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE;QACpC,OAAO,CACL,MAAC,KAAK,IAAC,QAAQ,EAAC,SAAS,KAAK,KAAK,aACjC,KAAC,UAAU,mCAA8B,kDACnC,CACT,CAAA;KACF;IAED,OAAO,4BAAG,QAAQ,GAAI,CAAA;AACxB,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAI3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,EAAoB,CAAA"}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from 'react';
|
3
|
-
import {
|
3
|
+
import { EmbedPluginContext } from './Context';
|
4
4
|
/** Expose passed embed plugin props via context */
|
5
|
-
export const
|
5
|
+
export const EmbedPluginProvider = ({ children, refreshTitle, timestampLabel, hideElementsConfig, plugins, embedPluginConfig, }) => {
|
6
6
|
const [activePlugin, setActivePlugin] = useState(plugins ? plugins[0] : undefined);
|
7
7
|
useEffect(() => {
|
8
8
|
setActivePlugin(plugins ? plugins[0] : undefined);
|
9
9
|
}, [plugins]);
|
10
|
-
return (_jsx(
|
10
|
+
return (_jsx(EmbedPluginContext.Provider, { value: {
|
11
11
|
activePlugin,
|
12
12
|
embedPluginConfig,
|
13
13
|
hideElementsConfig,
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/Provider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAK9C,mDAAmD;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAqD,CAAC,EACpF,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,iBAAiB,GAClB,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAkC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAEnH,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACnD,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,OAAO,CACL,KAAC,kBAAkB,CAAC,QAAQ,IAC1B,KAAK,EAAE;YACL,YAAY;YACZ,iBAAiB;YACjB,kBAAkB;YAClB,QAAQ,EAAE,IAAI;YACd,YAAY;YACZ,eAAe;YACf,cAAc;SACf,YAEA,QAAQ,GACmB,CAC/B,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/State.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/use.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,aAAa,EAAE,IAAI,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPluginProps.js","sourceRoot":"","sources":["../../../src/types/EmbedPluginProps.ts"],"names":[],"mappings":""}
|
package/dist/esm/types/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './EmbedPluginProps';
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPlugin.d.ts","sourceRoot":"","sources":["../../../src/components/EmbedPlugin.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAI3C,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,CA4BrE,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { WithChildren } from '@xylabs/react-shared';
|
3
|
+
import { EmbedPluginProps } from '../../types';
|
4
|
+
import { BusyCardProps } from './card';
|
5
|
+
export interface EmbedPluginCardProps extends WithChildren, EmbedPluginProps, BusyCardProps {
|
6
|
+
}
|
7
|
+
export declare const ApiEmbedPluginCard: React.FC<EmbedPluginCardProps>;
|
8
|
+
export declare const EmbedPluginCardInner: React.FC<BusyCardProps>;
|
9
|
+
/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */
|
10
|
+
export declare const EmbedPlugin: import("react").FC<BusyCardProps>;
|
11
|
+
//# sourceMappingURL=EmbedPluginCard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPluginCard.d.ts","sourceRoot":"","sources":["../../../../src/components/embed-card/EmbedPluginCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAmB,MAAM,QAAQ,CAAA;AAGvD,MAAM,WAAW,oBAAqB,SAAQ,YAAY,EAAE,gBAAgB,EAAE,aAAa;CAAG;AAE9F,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8B7D,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiBxD,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,WAAW,mCAAkB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/embed-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/embed-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Meta, StoryFn } from '@storybook/react';
|
2
|
-
import {
|
2
|
+
import { ApiEmbedPluginCard } from '../embed-card';
|
3
3
|
export declare const xyoEmbedStoryBase: Meta;
|
4
|
-
export declare const Template: StoryFn<typeof
|
4
|
+
export declare const Template: StoryFn<typeof ApiEmbedPluginCard>;
|
5
5
|
//# sourceMappingURL=storyShared.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,eAAO,MAAM,kBAAkB,gGAAsC,CAAA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { WithChildren } from '@xylabs/react-shared';
|
3
|
+
import { EmbedPluginBase } from './State';
|
4
|
+
export type EmbedPluginProviderProps = EmbedPluginBase;
|
5
|
+
/** Expose passed embed plugin props via context */
|
6
|
+
export declare const EmbedPluginProvider: React.FC<WithChildren<EmbedPluginProviderProps>>;
|
7
|
+
//# sourceMappingURL=Provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAA;AAEtD,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,wBAAwB,CAAC,CA6BhF,CAAA"}
|
@@ -16,8 +16,8 @@ export interface EmbedPluginVisibilityConfig {
|
|
16
16
|
export interface PluginConfig {
|
17
17
|
listMode?: ListMode;
|
18
18
|
}
|
19
|
-
export interface
|
20
|
-
/**
|
19
|
+
export interface EmbedPluginBase {
|
20
|
+
/** EmbedPlugin component configuration */
|
21
21
|
embedPluginConfig?: PluginConfig;
|
22
22
|
hideElementsConfig?: EmbedPluginVisibilityConfig;
|
23
23
|
/** @deprecated use huriPayload */
|
@@ -26,7 +26,7 @@ export interface XyoEmbedPluginBase {
|
|
26
26
|
refreshTitle?: string;
|
27
27
|
timestampLabel?: string;
|
28
28
|
}
|
29
|
-
export interface
|
29
|
+
export interface EmbedPluginState extends EmbedPluginBase, ContextExState {
|
30
30
|
activePlugin?: PayloadRenderPlugin;
|
31
31
|
setActivePlugin?: Dispatch<SetStateAction<PayloadRenderPlugin | undefined>>;
|
32
32
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEhD,MAAM,WAAW,2BAA2B;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,YAAY,CAAA;IAChC,kBAAkB,CAAC,EAAE,2BAA2B,CAAA;IAChD,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe,EAAE,cAAc;IACvE,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAClC,eAAe,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC,CAAA;CAC5E"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/EmbedPluginContext/use.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,iHAA8D,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { Payload } from '@xyo-network/payload-model';
|
2
|
-
import {
|
3
|
-
export interface
|
2
|
+
import { EmbedPluginBase, EmbedPluginVisibilityConfig } from '../contexts';
|
3
|
+
export interface EmbedPluginProps extends EmbedPluginBase {
|
4
4
|
hideElementsConfig?: EmbedPluginVisibilityConfig;
|
5
5
|
huriPayload?: string | Payload;
|
6
6
|
/** string for huri to resolve and payload for bypassing huri resolution */
|
7
7
|
onRefresh?: () => void;
|
8
8
|
validateSchema?: boolean;
|
9
9
|
}
|
10
|
-
//# sourceMappingURL=
|
10
|
+
//# sourceMappingURL=EmbedPluginProps.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmbedPluginProps.d.ts","sourceRoot":"","sources":["../../../src/types/EmbedPluginProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE1E,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,kBAAkB,CAAC,EAAE,2BAA2B,CAAA;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './EmbedPluginProps';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
package/package.json
CHANGED
@@ -17,9 +17,9 @@
|
|
17
17
|
"@xyo-network/huri": "^2.62.1",
|
18
18
|
"@xyo-network/module": "^2.62.1",
|
19
19
|
"@xyo-network/payload-model": "^2.62.1",
|
20
|
-
"@xyo-network/react-error": "^2.
|
21
|
-
"@xyo-network/react-payload-plugin": "^2.
|
22
|
-
"@xyo-network/react-shared": "^2.
|
20
|
+
"@xyo-network/react-error": "^2.54.0",
|
21
|
+
"@xyo-network/react-payload-plugin": "^2.54.0",
|
22
|
+
"@xyo-network/react-shared": "^2.54.0",
|
23
23
|
"@xyo-network/schema-cache": "^2.62.1"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
@@ -29,8 +29,8 @@
|
|
29
29
|
"@uniswap/v3-sdk": "^3.9.0",
|
30
30
|
"@xylabs/ts-scripts-yarn3": "^2.17.13",
|
31
31
|
"@xylabs/tsconfig-react": "^2.17.13",
|
32
|
-
"@xyo-network/react-aggregate-price-plugin": "^2.
|
33
|
-
"@xyo-network/react-crypto-market-uniswap-plugin": "^2.
|
32
|
+
"@xyo-network/react-aggregate-price-plugin": "^2.54.0",
|
33
|
+
"@xyo-network/react-crypto-market-uniswap-plugin": "^2.54.0",
|
34
34
|
"typescript": "^5.1.3"
|
35
35
|
},
|
36
36
|
"peerDependencies": {
|
@@ -85,5 +85,5 @@
|
|
85
85
|
},
|
86
86
|
"sideEffects": false,
|
87
87
|
"types": "dist/types/index.d.ts",
|
88
|
-
"version": "2.
|
88
|
+
"version": "2.54.0"
|
89
89
|
}
|
@@ -2,12 +2,12 @@ import { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
2
|
import { WithChildren } from '@xylabs/react-shared'
|
3
3
|
import { ErrorBoundary, ListModeProvider } from '@xyo-network/react-shared'
|
4
4
|
|
5
|
-
import { RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider
|
6
|
-
import {
|
5
|
+
import { EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider } from '../contexts'
|
6
|
+
import { EmbedPluginProps } from '../types'
|
7
7
|
import { EmbedResolver } from './EmbedResolver'
|
8
8
|
import { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts'
|
9
9
|
|
10
|
-
export const
|
10
|
+
export const EmbedPluginInner: React.FC<WithChildren<EmbedPluginProps>> = ({
|
11
11
|
validateSchema,
|
12
12
|
plugins = [],
|
13
13
|
huriPayload,
|
@@ -20,7 +20,7 @@ export const XyoEmbedPluginInner: React.FC<WithChildren<XyoEmbedPluginProps>> =
|
|
20
20
|
}) => {
|
21
21
|
return (
|
22
22
|
<ErrorBoundary>
|
23
|
-
<
|
23
|
+
<EmbedPluginProvider
|
24
24
|
refreshTitle={refreshTitle}
|
25
25
|
timestampLabel={timestampLabel}
|
26
26
|
hideElementsConfig={hideElementsConfig}
|
@@ -32,12 +32,12 @@ export const XyoEmbedPluginInner: React.FC<WithChildren<XyoEmbedPluginProps>> =
|
|
32
32
|
<ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>
|
33
33
|
</WithValidators>
|
34
34
|
</WithResolvers>
|
35
|
-
</
|
35
|
+
</EmbedPluginProvider>
|
36
36
|
</ErrorBoundary>
|
37
37
|
)
|
38
38
|
}
|
39
39
|
|
40
|
-
interface WithResolversProps extends Pick<
|
40
|
+
interface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}
|
41
41
|
|
42
42
|
const WithResolvers: React.FC<WithChildren<WithResolversProps>> = ({ children, onRefresh, huriPayload }) => {
|
43
43
|
return (
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { MenuItem, Select, SelectProps } from '@mui/material'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { useEmbedPluginState } from '../../contexts'
|
4
4
|
import { EmbedFormControl } from './EmbedFormControl'
|
5
5
|
|
6
6
|
const renderSelectId = 'render-select-id'
|
7
7
|
const renderSelectLabel = 'Renderer'
|
8
8
|
|
9
9
|
export const EmbedRenderSelect: React.FC<SelectProps> = (props) => {
|
10
|
-
const { activePlugin, setActivePlugin, plugins } =
|
10
|
+
const { activePlugin, setActivePlugin, plugins } = useEmbedPluginState()
|
11
11
|
return (
|
12
12
|
<EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>
|
13
13
|
<Select size="small" value={activePlugin?.name} {...props}>
|