@xyo-network/react-embed 10.0.2 → 10.0.3

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.
@@ -1,5 +1,5 @@
1
1
  import type { CardProps } from '@mui/material';
2
- import type { ModuleError } from '@xyo-network/sdk-js';
2
+ import type { ModuleError } from '@xyo-network/sdk';
3
3
  import type { PropsWithChildren } from 'react';
4
4
  import React from 'react';
5
5
  interface EmbedCardApiErrorRendererProps extends CardProps {
@@ -1 +1 @@
1
- {"version":3,"file":"EmbedCardApiErrorRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,UAAU,8BAA+B,SAAQ,SAAS;IACxD,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAQjG,CAAA"}
1
+ {"version":3,"file":"EmbedCardApiErrorRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,UAAU,8BAA+B,SAAQ,SAAS;IACxD,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAQjG,CAAA"}
@@ -1,31 +1,31 @@
1
1
  export declare const ResolvePayloadContext: import("react").Context<({
2
2
  huri?: string;
3
- huriError?: import("@xyo-network/sdk-protocol-js").ModuleError;
4
- huriPayload?: string | import("@xyo-network/sdk-protocol-js").Payload;
3
+ huriError?: import("@xyo-network/sdk").ModuleError;
4
+ huriPayload?: string | import("@xyo-network/sdk").Payload;
5
5
  notFound?: boolean;
6
- payload?: import("@xyo-network/sdk-protocol-js").Payload;
6
+ payload?: import("@xyo-network/sdk").Payload;
7
7
  refreshHuri?: () => void;
8
- setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk-protocol-js").Payload | undefined>>;
8
+ setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk").Payload | undefined>>;
9
9
  } & {
10
10
  provided: true;
11
11
  }) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<{
12
12
  huri?: string;
13
- huriError?: import("@xyo-network/sdk-protocol-js").ModuleError;
14
- huriPayload?: string | import("@xyo-network/sdk-protocol-js").Payload;
13
+ huriError?: import("@xyo-network/sdk").ModuleError;
14
+ huriPayload?: string | import("@xyo-network/sdk").Payload;
15
15
  notFound?: boolean;
16
- payload?: import("@xyo-network/sdk-protocol-js").Payload;
16
+ payload?: import("@xyo-network/sdk").Payload;
17
17
  refreshHuri?: () => void;
18
- setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk-protocol-js").Payload | undefined>>;
18
+ setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk").Payload | undefined>>;
19
19
  }>, never> & {
20
20
  provided: false;
21
21
  }) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<{
22
22
  huri?: string;
23
- huriError?: import("@xyo-network/sdk-protocol-js").ModuleError;
24
- huriPayload?: string | import("@xyo-network/sdk-protocol-js").Payload;
23
+ huriError?: import("@xyo-network/sdk").ModuleError;
24
+ huriPayload?: string | import("@xyo-network/sdk").Payload;
25
25
  notFound?: boolean;
26
- payload?: import("@xyo-network/sdk-protocol-js").Payload;
26
+ payload?: import("@xyo-network/sdk").Payload;
27
27
  refreshHuri?: () => void;
28
- setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk-protocol-js").Payload | undefined>>;
28
+ setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk").Payload | undefined>>;
29
29
  }>, never> & {
30
30
  provided: false;
31
31
  })>;
@@ -1,5 +1,5 @@
1
1
  import type { ContextExState } from '@xylabs/react-shared';
2
- import type { ModuleError, Payload } from '@xyo-network/sdk-js';
2
+ import type { ModuleError, Payload } from '@xyo-network/sdk';
3
3
  import type { Dispatch, SetStateAction } from 'react';
4
4
  export type ResolvePayloadState = ContextExState<{
5
5
  huri?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ResolvePayloadContext/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAErD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,UAAU,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAA;CAC3D,CAAC,CAAA"}
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/ResolvePayloadContext/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAErD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,UAAU,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAA;CAC3D,CAAC,CAAA"}
@@ -1,11 +1,11 @@
1
1
  export declare const useResolvePayload: () => Omit<{
2
2
  huri?: string;
3
- huriError?: import("@xyo-network/sdk-protocol-js").ModuleError;
4
- huriPayload?: string | import("@xyo-network/sdk-protocol-js").Payload;
3
+ huriError?: import("@xyo-network/sdk").ModuleError;
4
+ huriPayload?: string | import("@xyo-network/sdk").Payload;
5
5
  notFound?: boolean;
6
- payload?: import("@xyo-network/sdk-protocol-js").Payload;
6
+ payload?: import("@xyo-network/sdk").Payload;
7
7
  refreshHuri?: () => void;
8
- setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk-protocol-js").Payload | undefined>>;
8
+ setPayload?: import("react").Dispatch<import("react").SetStateAction<import("@xyo-network/sdk").Payload | undefined>>;
9
9
  } & {
10
10
  provided: true;
11
11
  }, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<import("./State.ts").ResolvePayloadState>, "provided">;
@@ -30,7 +30,7 @@ import {
30
30
  Chip as Chip2
31
31
  } from "@mui/material";
32
32
  import { FlexRow } from "@xylabs/react-flexbox";
33
- import { isDefined as isDefined3 } from "@xylabs/sdk-js";
33
+ import { isDefined as isDefined3 } from "@xylabs/sdk";
34
34
  import { useState as useState6 } from "react";
35
35
 
36
36
  // src/contexts/EmbedPluginContext/Context.ts
@@ -133,8 +133,8 @@ var ResolvePayloadContext = createContextEx4();
133
133
 
134
134
  // src/contexts/ResolvePayloadContext/Provider.tsx
135
135
  import { useAsyncEffect } from "@xylabs/react-async-effect";
136
- import { delay, isDefined } from "@xylabs/sdk-js";
137
- import { Huri, ModuleErrorSchema } from "@xyo-network/sdk-js";
136
+ import { delay, isDefined } from "@xylabs/sdk";
137
+ import { Huri, ModuleErrorSchema } from "@xyo-network/sdk";
138
138
  import {
139
139
  useCallback,
140
140
  useEffect as useEffect2,
@@ -209,7 +209,7 @@ var useResolvePayload = () => useContextEx4(ResolvePayloadContext, "ResolvePaylo
209
209
  // src/contexts/ValidatePayloadContext/Provider.tsx
210
210
  import { Chip } from "@mui/material";
211
211
  import { useAsyncEffect as useAsyncEffect2 } from "@xylabs/react-async-effect";
212
- import { SchemaCache } from "@xyo-network/sdk-js";
212
+ import { SchemaCache } from "@xyo-network/sdk";
213
213
  import { useMemo as useMemo5, useState as useState4 } from "react";
214
214
 
215
215
  // src/contexts/ValidatePayloadContext/Context.ts
@@ -260,7 +260,7 @@ import {
260
260
  ListItemText,
261
261
  MenuItem
262
262
  } from "@mui/material";
263
- import { isDefined as isDefined2 } from "@xylabs/sdk-js";
263
+ import { isDefined as isDefined2 } from "@xylabs/sdk";
264
264
  import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
265
265
  var JsonMenuItem = (props) => {
266
266
  const { huri } = useResolvePayload();
@@ -350,7 +350,7 @@ var EmbedCardHeader = () => {
350
350
  // src/components/embed-card/card/EmbedPluginCard.tsx
351
351
  import { CardContent } from "@mui/material";
352
352
  import { FlexGrowRow } from "@xylabs/react-flexbox";
353
- import { isTruthy } from "@xylabs/sdk-js";
353
+ import { isTruthy } from "@xylabs/sdk";
354
354
  import { useListMode as useListMode2 } from "@xyo-network/react-shared";
355
355
 
356
356
  // src/components/controls/EmbedFormControl.tsx
@@ -547,7 +547,7 @@ import {
547
547
  CardContent as CardContent2,
548
548
  Typography
549
549
  } from "@mui/material";
550
- import { isDefined as isDefined4 } from "@xylabs/sdk-js";
550
+ import { isDefined as isDefined4 } from "@xylabs/sdk";
551
551
  import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
552
552
  var EmbedErrorCard = (props) => {
553
553
  const {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/embed-card/card/BusyCard.tsx", "../../src/components/embed-card/card/EmbedCardHeader.tsx", "../../src/contexts/EmbedPluginContext/Context.ts", "../../src/contexts/EmbedPluginContext/Provider.tsx", "../../src/contexts/EmbedPluginContext/use.ts", "../../src/contexts/PluginPropsContext/context.ts", "../../src/contexts/PluginPropsContext/Provider.tsx", "../../src/contexts/PluginPropsContext/use.ts", "../../src/contexts/RefreshPayloadContext/Provider.tsx", "../../src/contexts/RefreshPayloadContext/Context.ts", "../../src/contexts/RefreshPayloadContext/use.ts", "../../src/contexts/ResolvePayloadContext/Context.ts", "../../src/contexts/ResolvePayloadContext/Provider.tsx", "../../src/contexts/ResolvePayloadContext/use.ts", "../../src/contexts/ValidatePayloadContext/Provider.tsx", "../../src/contexts/ValidatePayloadContext/Context.ts", "../../src/contexts/ValidatePayloadContext/use.ts", "../../src/components/embed-card/menu/EmbedMenu.tsx", "../../src/components/embed-card/menu/JsonMenuItem.tsx", "../../src/components/embed-card/card/EmbedPluginCard.tsx", "../../src/components/controls/EmbedFormControl.tsx", "../../src/components/controls/ListModeSelect.tsx", "../../src/components/controls/RenderSelect.tsx", "../../src/components/embed-card/EmbedPluginCard.tsx", "../../src/components/EmbedPlugin.tsx", "../../src/components/EmbedResolver.tsx", "../../src/components/validation-alerts/ValidatePayload.tsx", "../../src/components/validation-alerts/ValidatePlugins.tsx", "../../src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx", "../../src/components/embed-card/error-handling/EmbedErrorCard.tsx"],
4
- "sourcesContent": ["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useBusyTiming } from '@xylabs/react-flexbox'\nimport type {\n BusyCircularProgressProps,\n BusyLinearProgressProps,\n BusyVariant,\n} from '@xylabs/react-shared'\nimport {\n BusyCircularProgress,\n BusyLinearProgress,\n} from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nexport interface BusyCardProps extends CardProps {\n busy?: boolean\n busyMinimum?: number\n busyVariant?: BusyVariant\n busyVariantProps?: BusyCircularProgressProps | BusyLinearProgressProps\n}\n\nexport const BusyCard: React.FC<PropsWithChildren<BusyCardProps>> = ({\n busy,\n busyMinimum = 500,\n busyVariant = 'circular',\n busyVariantProps,\n children,\n ...props\n}) => {\n const internalBusy = useBusyTiming(busy, busyMinimum)\n return (\n <Card {...props}>\n {children}\n {busyVariant === 'circular' && internalBusy\n ? <BusyCircularProgress {...(busyVariantProps as BusyCircularProgressProps)} />\n : null}\n {busyVariant === 'linear' && internalBusy\n ? <BusyLinearProgress {...(busyVariantProps as BusyLinearProgressProps)} />\n : null}\n </Card>\n )\n}\n", "import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps, Theme } from '@mui/material'\nimport {\n Avatar, CardHeader, Chip,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { isDefined } from '@xylabs/sdk-js'\nimport React, { useState } from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'\nimport { EmbedMenu } from '../menu/index.ts'\n\nexport const EmbedCardHeader: React.FC<CardHeaderProps> = () => {\n const { refreshHuri, huri } = useResolvePayload()\n const {\n activePlugin, timestampLabel, hideElementsConfig,\n } = useEmbedPluginState()\n const {\n hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions,\n } = hideElementsConfig ?? {}\n // this is temporary so that we can add the ability to get a timestamp via diviner later\n const [timestamp] = useState(() => Date.now())\n return (\n <CardHeader\n sx={{ flexWrap: 'wrap', rowGap: 1 }}\n avatar={\n hideAvatar\n ? <></>\n : (\n <Avatar sx={{ bgcolor: (theme: Theme) => theme.vars.palette.primary.main }} aria-label={activePlugin?.name}>\n {activePlugin?.name?.charAt(0)}\n </Avatar>\n )\n }\n action={(\n <FlexRow\n sx={{\n flexWrap: 'wrap',\n columnGap: 0.5,\n }}\n >\n {isDefined(timestamp) && !Number.isNaN(timestamp)\n ? hideTimestamp && hideRefreshButton\n ? ''\n : (\n <Chip\n avatar={hideRefreshButton ? <></> : <RefreshIcon />}\n clickable={hideRefreshButton ? false : true}\n onClick={refreshHuri}\n label={hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`}\n />\n )\n\n : null}\n {/* Huri case is valid as long as the only menu item is JSON */}\n {hideCardActions || huri === undefined ? null : <EmbedMenu />}\n </FlexRow>\n )}\n title={hideTitle ? '' : activePlugin?.name}\n />\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { EmbedPluginState } from './State.ts'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n", "import { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { EmbedPluginContext } from './Context.ts'\nimport type { EmbedPluginBase } from './State.ts'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<PropsWithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useResetState(plugins ? plugins[0] : undefined)\n\n const value = useMemo(() => ({\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true as const,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }), [activePlugin, embedPluginConfig, hideElementsConfig, refreshTitle, setActivePlugin, timestampLabel])\n\n return (\n <EmbedPluginContext\n value={value}\n >\n {children}\n </EmbedPluginContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { EmbedPluginContext } from './Context.ts'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PluginPropsState } from './state.ts'\n\nexport const PluginPropsContext = createContextEx<PluginPropsState>()\n", "import type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { PluginPropsContext } from './context.ts'\nimport type { PluginProps, PluginPropsState } from './state.ts'\n\nexport interface PluginPropsProviderProps extends PropsWithChildren {\n pluginProps?: PluginProps\n}\n\nexport const PluginPropsProvider: React.FC<PluginPropsProviderProps> = ({ children, pluginProps: pluginPropsProp }) => {\n const [pluginProps, setPluginProps] = useState<PluginProps | undefined>(pluginPropsProp)\n\n useEffect(() => {\n // needs to be in useEffect since we are in a provider\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-x/set-state-in-effect\n setPluginProps(pluginPropsProp)\n }, [pluginPropsProp])\n\n const value: PluginPropsState = useMemo(() => ({\n pluginProps,\n provided: true as const,\n }), [pluginProps])\n\n return (\n <PluginPropsContext value={value}>\n {children}\n </PluginPropsContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { PluginPropsContext } from './context.ts'\n\nexport const usePluginProps = (required = false) => useContextEx(PluginPropsContext, 'PluginProps', required)\n", "import type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<PropsWithChildren<RefreshPayloadProps>> = ({\n children, onRefresh, refreshPayload,\n}) => {\n const [localRefreshPayload, setLocalRefreshPayload] = useState(refreshPayload)\n\n const value = useMemo(() => ({\n onRefresh, provided: true as const, refreshPayload: localRefreshPayload, setRefreshPayload: setLocalRefreshPayload,\n }), [onRefresh, localRefreshPayload])\n\n return (\n <RefreshPayloadContext value={value}>\n {children}\n </RefreshPayloadContext>\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { RefreshPayloadState } from './State.ts'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ResolvePayloadState } from './State.ts'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n", "import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { delay, isDefined } from '@xylabs/sdk-js'\nimport type {\n ModuleError, Payload, WithSources,\n} from '@xyo-network/sdk-js'\nimport { Huri, ModuleErrorSchema } from '@xyo-network/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext/index.ts'\nimport { ResolvePayloadContext } from './Context.ts'\nimport type { ResolvePayloadState } from './State.ts'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const {\n refreshPayload, setRefreshPayload, onRefresh,\n } = useRefreshPayload()\n\n useEffect(() => {\n if (typeof huriPayload === 'string') {\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-x/set-state-in-effect\n setHuri(huriPayload)\n } else if (typeof huriPayload === 'object') {\n // eslint-disable-next-line react-x/set-state-in-effect\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps, react-x/exhaustive-deps\n }, [huriPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<WithSources<ModuleError>>()\n\n useAsyncEffect(\n async (mounted) => {\n if (isDefined(huri) && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\n // eslint-disable-next-line react-web-api/no-leaked-fetch -- Huri.fetch does not support AbortSignal; mounted() guards stale writes\n const result = await huriInstance.fetch()\n // ensure the busy state can stay for a moment to avoid flashing too quickly\n await delay(500)\n\n if (mounted()) {\n setNotFound(result === null)\n setPayload(result)\n setRefreshPayload?.(true)\n }\n } catch (e) {\n const error = e as Error\n setHuriError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = useCallback(() => {\n onRefresh?.()\n if (isDefined(huri)) {\n setRefreshPayload?.(false)\n }\n }, [onRefresh, huri, setRefreshPayload])\n\n const value = useMemo(() => ({\n huri, huriError, notFound, payload, provided: true as const, refreshHuri, setPayload,\n }), [huri, huriError, notFound, payload, refreshHuri, setPayload])\n\n return (\n <ResolvePayloadContext value={value}>\n {children}\n </ResolvePayloadContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { ResolvePayloadContext } from './Context.ts'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n", "import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { SchemaNameToValidatorMap } from '@xyo-network/sdk-js'\nimport { SchemaCache } from '@xyo-network/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext/index.ts'\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport interface ValidatePayloadProviderProps {\n // Opt-in flag to validate payloads for the plugin(s)\n enabled?: boolean\n}\n\nexport const ValidatePayloadProvider: React.FC<PropsWithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n // eslint-disable-next-line react-x/use-state\n const [valid, _setValid] = useState<boolean>()\n\n useAsyncEffect(\n async () => {\n if (payload && enabled) {\n await SchemaCache.instance.get(payload.schema)\n\n const possibleKnownSchema = payload.schema as keyof SchemaNameToValidatorMap\n\n if (SchemaCache.instance.validators[possibleKnownSchema]) {\n const _validator = SchemaCache.instance.validators[possibleKnownSchema]\n // TODO: Fix Types\n // setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n const value = useMemo(() => ({\n enabled, provided: true as const, schema: payload?.schema, validPayload: valid,\n }), [enabled, payload?.schema, valid])\n\n return (\n <ValidatePayloadContext value={value}>\n {enabled\n ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</>\n : children}\n </ValidatePayloadContext>\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ValidatePayloadState } from './State.ts'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n", "import { MoreVert as MoreVertIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport { IconButton, Menu } from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { JsonMenuItem } from './JsonMenuItem.tsx'\n\nexport const EmbedMenu: React.FC<IconButtonProps> = (props) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = Boolean(anchorEl)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return (\n <>\n <IconButton onClick={handleClick} {...props}>\n <MoreVertIcon />\n </IconButton>\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n slotProps={{\n paper: { variant: 'elevation' },\n list: { dense: true },\n }}\n >\n <JsonMenuItem />\n </Menu>\n </>\n )\n}\n", "import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'\nimport type { MenuItemProps } from '@mui/material'\nimport {\n ListItemIcon, ListItemText, MenuItem,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport React from 'react'\n\nimport { useResolvePayload } from '../../../contexts/index.ts'\n\nexport const JsonMenuItem: React.FC<MenuItemProps> = (props) => {\n const { huri } = useResolvePayload()\n\n return (\n <>\n {isDefined(huri)\n ? (\n <MenuItem title=\"Source Payload JSON\" onClick={() => window.open(huri, '_blank')} {...props}>\n <ListItemText sx={{ mr: 1 }}>JSON</ListItemText>\n <ListItemIcon sx={{ justifyContent: 'end' }}>\n <OpenInNewIcon sx={{ fontSize: 'small' }} />\n </ListItemIcon>\n </MenuItem>\n )\n : null}\n </>\n )\n}\n", "import { CardContent } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { isTruthy } from '@xylabs/sdk-js'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport {\n useEmbedPluginState, usePluginProps, useResolvePayload,\n} from '../../../contexts/index.ts'\nimport { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'\nimport type { BusyCardProps } from './BusyCard.tsx'\nimport { BusyCard } from './BusyCard.tsx'\nimport { EmbedCardHeader } from './EmbedCardHeader.tsx'\n\nexport const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {\n const { payload } = useResolvePayload()\n const {\n activePlugin: ActivePlugin, plugins, hideElementsConfig,\n } = useEmbedPluginState()\n const { listMode } = useListMode()\n const { pluginProps } = usePluginProps()\n const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false\n\n return (\n <BusyCard {...props}>\n {hideElementsConfig?.hideCardHeader ? null : <EmbedCardHeader />}\n {/* Only show the row if the children are present */}\n {(plugins && plugins.length > 0) || supportsListMode\n ? (\n <FlexGrowRow\n sx={{\n columnGap: 2,\n rowGap: 2,\n flexWrap: 'wrap',\n pb: 1,\n }}\n >\n {plugins && plugins.length > 1\n ? <EmbedRenderSelect />\n : null}\n {supportsListMode\n ? <ListModeSelectFormControl />\n : null}\n </FlexGrowRow>\n )\n : null}\n <CardContent sx={{ height: '100%' }}>\n {ActivePlugin\n ? <ActivePlugin.components.box.detailsBox payload={payload} {...pluginProps} {...(supportsListMode && { listMode })} />\n : null}\n </CardContent>\n </BusyCard>\n )\n}\n", "import type { FormControlProps } from '@mui/material'\nimport { FormControl, InputLabel } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedFormControlProps extends FormControlProps {\n formId?: string\n formLabel?: string\n}\n\nexport const EmbedFormControl: React.FC<PropsWithChildren<EmbedFormControlProps>> = ({\n formId, formLabel, children, ...props\n}) => {\n return (\n <FormControl {...props}>\n <InputLabel id={formId}>{formLabel}</InputLabel>\n {children}\n </FormControl>\n )\n}\n", "import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { ListMode } from '@xyo-network/react-shared'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst listModeSelectId = 'listmode-select-id'\nconst listModeSelectLabel = 'List Mode'\n\nexport const ListModeSelect: React.FC<SelectExProps<ListMode>> = (props) => {\n const { listMode, setListMode } = useListMode()\n\n return (\n <SelectEx<ListMode>\n value={(listMode ?? 'default')}\n onChange={(event) => {\n setListMode?.(event.target.value)\n }}\n {...props}\n >\n <MenuItem key=\"default\" value=\"default\">\n Default\n </MenuItem>\n <MenuItem key=\"table\" value=\"table\">\n Table\n </MenuItem>\n <MenuItem key=\"grid\" value=\"grid\">\n Grid\n </MenuItem>\n </SelectEx>\n )\n}\n\nexport const ListModeSelectFormControl: React.FC<SelectExProps<ListMode>> = (props) => {\n return (\n <EmbedFormControl formId={listModeSelectId} formLabel={listModeSelectLabel}>\n <ListModeSelect size=\"small\" label={listModeSelectLabel} labelId={listModeSelectId} {...props} />\n </EmbedFormControl>\n )\n}\n", "import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useEmbedPluginState } from '../../contexts/index.ts'\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst renderSelectId = 'render-select-id'\nconst renderSelectLabel = 'Renderer'\n\nexport const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {\n const {\n activePlugin, setActivePlugin, plugins,\n } = useEmbedPluginState()\n return (\n <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>\n <SelectEx size=\"small\" value={activePlugin?.name} {...props}>\n {plugins?.map(plugin => (\n <MenuItem value={plugin.name} key={plugin.name} onClick={() => setActivePlugin?.(plugin)}>\n {plugin.name}\n </MenuItem>\n ))}\n </SelectEx>\n </EmbedFormControl>\n )\n}\n", "import { useTheme } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'\nimport type { EmbedPluginProps } from '../../types/index.ts'\nimport { EmbedPluginInner } from '../EmbedPlugin.tsx'\nimport type { BusyCardProps } from './card/index.ts'\nimport { EmbedPluginCard } from './card/index.ts'\nimport { EmbedCardApiErrorRenderer } from './error-handling/index.ts'\n\nexport interface EmbedPluginCardProps extends PropsWithChildren, EmbedPluginProps, BusyCardProps {}\n\nexport const ApiEmbedPluginCard: React.FC<EmbedPluginCardProps> = ({ children, ...props }) => {\n const {\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n ...busyCardProps\n } = props\n\n return (\n <EmbedPluginInner\n {...{\n embedPluginConfig,\n hideElementsConfig,\n huriPayload,\n onRefresh,\n plugins,\n refreshTitle,\n timestampLabel,\n validateSchema,\n }}\n >\n <EmbedPluginCardInner {...busyCardProps} />\n {children}\n </EmbedPluginInner>\n )\n}\n\nexport const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {\n const { payload, huriError } = useResolvePayload()\n const { refreshPayload } = useRefreshPayload()\n const theme = useTheme()\n\n return (\n <EmbedCardApiErrorRenderer xyoError={huriError}>\n <EmbedPluginCard\n elevation={3}\n variant=\"elevation\"\n busy={Boolean(!refreshPayload && payload)}\n busyVariantProps={{\n style: {\n alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,\n },\n }}\n sx={{ position: 'relative' }}\n {...props}\n />\n </EmbedCardApiErrorRenderer>\n )\n}\n\n/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */\n\nexport { EmbedPluginCard as EmbedPlugin } from './card/index.ts'\n", "import { ErrorBoundary } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { ListModeProvider } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport {\n EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,\n} from '../contexts/index.ts'\nimport type { EmbedPluginProps } from '../types/index.ts'\nimport { EmbedResolver } from './EmbedResolver.tsx'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts/index.ts'\n\nexport const EmbedPluginInner: React.FC<PropsWithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins,\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<PropsWithChildren<WithResolversProps>> = ({\n children, onRefresh, huriPayload,\n}) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<PropsWithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n", "import { LoadResult } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useResolvePayload } from '../contexts/index.ts'\n\nexport const EmbedResolver: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n payload, notFound, huriError,\n } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n", "import type { AlertProps } from '@mui/material'\nimport { Alert } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useValidatePayload } from '../../contexts/index.ts'\n\nexport const ValidatePayloadAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const {\n validPayload, enabled, schema,\n } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be\n {' '}\n {schema}\n {' '}\n but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n", "import type { AlertProps } from '@mui/material'\nimport { Alert, AlertTitle } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts/index.ts'\n\nexport const ValidatePluginsAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>\n Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n", "import type { CardProps } from '@mui/material'\nimport { ErrorAlert, ErrorRender } from '@xylabs/react-error'\nimport type { ModuleError } from '@xyo-network/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedErrorCard } from './EmbedErrorCard.tsx'\n\ninterface EmbedCardApiErrorRendererProps extends CardProps {\n xyoError?: ModuleError\n}\n\nexport const EmbedCardApiErrorRenderer: React.FC<PropsWithChildren<EmbedCardApiErrorRendererProps>> = ({\n xyoError, children, ...props\n}) => {\n return (\n <ErrorRender error={xyoError} noReAuth noErrorDisplay customError={<CustomApiErrorCard xyoError={xyoError} {...props} />}>\n {children}\n </ErrorRender>\n )\n}\n\nconst CustomApiErrorCard: React.FC<EmbedCardApiErrorRendererProps> = ({ xyoError, ...props }) => {\n return (\n <EmbedErrorCard {...props}>\n <ErrorAlert error={xyoError} />\n </EmbedErrorCard>\n )\n}\n", "import type { AlertProps, CardProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Card, CardContent, Typography,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedErrorCardBaseProps {\n alertProps?: AlertProps\n error?: Error\n hideErrorDetails?: boolean\n scope?: string\n}\n\ninterface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}\n\nexport const EmbedErrorCard: React.FC<PropsWithChildren<EmbedErrorCardProps>> = (props) => {\n const {\n alertProps, error, scope, hideErrorDetails = true, children, ...cardProps\n } = props\n const errorProps = {\n alertProps, error, hideErrorDetails, scope,\n }\n return (\n <Card {...cardProps}>\n <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>\n </Card>\n )\n}\n\nconst DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({\n alertProps, scope, hideErrorDetails, error,\n}) => {\n return (\n <Alert severity=\"error\" {...alertProps}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {isDefined(scope)\n ? (\n <Typography variant=\"caption\">\n Scope:\n {scope}\n </Typography>\n )\n : null}\n {!hideErrorDetails && error\n ? (\n <>\n <Typography variant=\"caption\">Error: </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n </>\n )\n : (\n <Typography\n variant=\"caption\"\n sx={{ fontSize: 'small' }}\n >\n Error Loading Plugin\n </Typography>\n )}\n </Alert>\n )\n}\n"],
4
+ "sourcesContent": ["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useBusyTiming } from '@xylabs/react-flexbox'\nimport type {\n BusyCircularProgressProps,\n BusyLinearProgressProps,\n BusyVariant,\n} from '@xylabs/react-shared'\nimport {\n BusyCircularProgress,\n BusyLinearProgress,\n} from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nexport interface BusyCardProps extends CardProps {\n busy?: boolean\n busyMinimum?: number\n busyVariant?: BusyVariant\n busyVariantProps?: BusyCircularProgressProps | BusyLinearProgressProps\n}\n\nexport const BusyCard: React.FC<PropsWithChildren<BusyCardProps>> = ({\n busy,\n busyMinimum = 500,\n busyVariant = 'circular',\n busyVariantProps,\n children,\n ...props\n}) => {\n const internalBusy = useBusyTiming(busy, busyMinimum)\n return (\n <Card {...props}>\n {children}\n {busyVariant === 'circular' && internalBusy\n ? <BusyCircularProgress {...(busyVariantProps as BusyCircularProgressProps)} />\n : null}\n {busyVariant === 'linear' && internalBusy\n ? <BusyLinearProgress {...(busyVariantProps as BusyLinearProgressProps)} />\n : null}\n </Card>\n )\n}\n", "import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps, Theme } from '@mui/material'\nimport {\n Avatar, CardHeader, Chip,\n} from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { isDefined } from '@xylabs/sdk'\nimport React, { useState } from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../../contexts/index.ts'\nimport { EmbedMenu } from '../menu/index.ts'\n\nexport const EmbedCardHeader: React.FC<CardHeaderProps> = () => {\n const { refreshHuri, huri } = useResolvePayload()\n const {\n activePlugin, timestampLabel, hideElementsConfig,\n } = useEmbedPluginState()\n const {\n hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions,\n } = hideElementsConfig ?? {}\n // this is temporary so that we can add the ability to get a timestamp via diviner later\n const [timestamp] = useState(() => Date.now())\n return (\n <CardHeader\n sx={{ flexWrap: 'wrap', rowGap: 1 }}\n avatar={\n hideAvatar\n ? <></>\n : (\n <Avatar sx={{ bgcolor: (theme: Theme) => theme.vars.palette.primary.main }} aria-label={activePlugin?.name}>\n {activePlugin?.name?.charAt(0)}\n </Avatar>\n )\n }\n action={(\n <FlexRow\n sx={{\n flexWrap: 'wrap',\n columnGap: 0.5,\n }}\n >\n {isDefined(timestamp) && !Number.isNaN(timestamp)\n ? hideTimestamp && hideRefreshButton\n ? ''\n : (\n <Chip\n avatar={hideRefreshButton ? <></> : <RefreshIcon />}\n clickable={hideRefreshButton ? false : true}\n onClick={refreshHuri}\n label={hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`}\n />\n )\n\n : null}\n {/* Huri case is valid as long as the only menu item is JSON */}\n {hideCardActions || huri === undefined ? null : <EmbedMenu />}\n </FlexRow>\n )}\n title={hideTitle ? '' : activePlugin?.name}\n />\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { EmbedPluginState } from './State.ts'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n", "import { useResetState } from '@xylabs/react-hooks'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { EmbedPluginContext } from './Context.ts'\nimport type { EmbedPluginBase } from './State.ts'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<PropsWithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useResetState(plugins ? plugins[0] : undefined)\n\n const value = useMemo(() => ({\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true as const,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }), [activePlugin, embedPluginConfig, hideElementsConfig, refreshTitle, setActivePlugin, timestampLabel])\n\n return (\n <EmbedPluginContext\n value={value}\n >\n {children}\n </EmbedPluginContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { EmbedPluginContext } from './Context.ts'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PluginPropsState } from './state.ts'\n\nexport const PluginPropsContext = createContextEx<PluginPropsState>()\n", "import type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { PluginPropsContext } from './context.ts'\nimport type { PluginProps, PluginPropsState } from './state.ts'\n\nexport interface PluginPropsProviderProps extends PropsWithChildren {\n pluginProps?: PluginProps\n}\n\nexport const PluginPropsProvider: React.FC<PluginPropsProviderProps> = ({ children, pluginProps: pluginPropsProp }) => {\n const [pluginProps, setPluginProps] = useState<PluginProps | undefined>(pluginPropsProp)\n\n useEffect(() => {\n // needs to be in useEffect since we are in a provider\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-x/set-state-in-effect\n setPluginProps(pluginPropsProp)\n }, [pluginPropsProp])\n\n const value: PluginPropsState = useMemo(() => ({\n pluginProps,\n provided: true as const,\n }), [pluginProps])\n\n return (\n <PluginPropsContext value={value}>\n {children}\n </PluginPropsContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { PluginPropsContext } from './context.ts'\n\nexport const usePluginProps = (required = false) => useContextEx(PluginPropsContext, 'PluginProps', required)\n", "import type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<PropsWithChildren<RefreshPayloadProps>> = ({\n children, onRefresh, refreshPayload,\n}) => {\n const [localRefreshPayload, setLocalRefreshPayload] = useState(refreshPayload)\n\n const value = useMemo(() => ({\n onRefresh, provided: true as const, refreshPayload: localRefreshPayload, setRefreshPayload: setLocalRefreshPayload,\n }), [onRefresh, localRefreshPayload])\n\n return (\n <RefreshPayloadContext value={value}>\n {children}\n </RefreshPayloadContext>\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { RefreshPayloadState } from './State.ts'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { RefreshPayloadContext } from './Context.ts'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ResolvePayloadState } from './State.ts'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n", "import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { delay, isDefined } from '@xylabs/sdk'\nimport type {\n ModuleError, Payload, WithSources,\n} from '@xyo-network/sdk'\nimport { Huri, ModuleErrorSchema } from '@xyo-network/sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext/index.ts'\nimport { ResolvePayloadContext } from './Context.ts'\nimport type { ResolvePayloadState } from './State.ts'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<PropsWithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const {\n refreshPayload, setRefreshPayload, onRefresh,\n } = useRefreshPayload()\n\n useEffect(() => {\n if (typeof huriPayload === 'string') {\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-x/set-state-in-effect\n setHuri(huriPayload)\n } else if (typeof huriPayload === 'object') {\n // eslint-disable-next-line react-x/set-state-in-effect\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps, react-x/exhaustive-deps\n }, [huriPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<WithSources<ModuleError>>()\n\n useAsyncEffect(\n async (mounted) => {\n if (isDefined(huri) && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\n // eslint-disable-next-line react-web-api/no-leaked-fetch -- Huri.fetch does not support AbortSignal; mounted() guards stale writes\n const result = await huriInstance.fetch()\n // ensure the busy state can stay for a moment to avoid flashing too quickly\n await delay(500)\n\n if (mounted()) {\n setNotFound(result === null)\n setPayload(result)\n setRefreshPayload?.(true)\n }\n } catch (e) {\n const error = e as Error\n setHuriError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = useCallback(() => {\n onRefresh?.()\n if (isDefined(huri)) {\n setRefreshPayload?.(false)\n }\n }, [onRefresh, huri, setRefreshPayload])\n\n const value = useMemo(() => ({\n huri, huriError, notFound, payload, provided: true as const, refreshHuri, setPayload,\n }), [huri, huriError, notFound, payload, refreshHuri, setPayload])\n\n return (\n <ResolvePayloadContext value={value}>\n {children}\n </ResolvePayloadContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { ResolvePayloadContext } from './Context.ts'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n", "import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { SchemaNameToValidatorMap } from '@xyo-network/sdk'\nimport { SchemaCache } from '@xyo-network/sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext/index.ts'\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport interface ValidatePayloadProviderProps {\n // Opt-in flag to validate payloads for the plugin(s)\n enabled?: boolean\n}\n\nexport const ValidatePayloadProvider: React.FC<PropsWithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n // eslint-disable-next-line react-x/use-state\n const [valid, _setValid] = useState<boolean>()\n\n useAsyncEffect(\n async () => {\n if (payload && enabled) {\n await SchemaCache.instance.get(payload.schema)\n\n const possibleKnownSchema = payload.schema as keyof SchemaNameToValidatorMap\n\n if (SchemaCache.instance.validators[possibleKnownSchema]) {\n const _validator = SchemaCache.instance.validators[possibleKnownSchema]\n // TODO: Fix Types\n // setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n const value = useMemo(() => ({\n enabled, provided: true as const, schema: payload?.schema, validPayload: valid,\n }), [enabled, payload?.schema, valid])\n\n return (\n <ValidatePayloadContext value={value}>\n {enabled\n ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</>\n : children}\n </ValidatePayloadContext>\n )\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { ValidatePayloadState } from './State.ts'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { ValidatePayloadContext } from './Context.ts'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n", "import { MoreVert as MoreVertIcon } from '@mui/icons-material'\nimport type { IconButtonProps } from '@mui/material'\nimport { IconButton, Menu } from '@mui/material'\nimport React, { useState } from 'react'\n\nimport { JsonMenuItem } from './JsonMenuItem.tsx'\n\nexport const EmbedMenu: React.FC<IconButtonProps> = (props) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = Boolean(anchorEl)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return (\n <>\n <IconButton onClick={handleClick} {...props}>\n <MoreVertIcon />\n </IconButton>\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n slotProps={{\n paper: { variant: 'elevation' },\n list: { dense: true },\n }}\n >\n <JsonMenuItem />\n </Menu>\n </>\n )\n}\n", "import { OpenInNew as OpenInNewIcon } from '@mui/icons-material'\nimport type { MenuItemProps } from '@mui/material'\nimport {\n ListItemIcon, ListItemText, MenuItem,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk'\nimport React from 'react'\n\nimport { useResolvePayload } from '../../../contexts/index.ts'\n\nexport const JsonMenuItem: React.FC<MenuItemProps> = (props) => {\n const { huri } = useResolvePayload()\n\n return (\n <>\n {isDefined(huri)\n ? (\n <MenuItem title=\"Source Payload JSON\" onClick={() => window.open(huri, '_blank')} {...props}>\n <ListItemText sx={{ mr: 1 }}>JSON</ListItemText>\n <ListItemIcon sx={{ justifyContent: 'end' }}>\n <OpenInNewIcon sx={{ fontSize: 'small' }} />\n </ListItemIcon>\n </MenuItem>\n )\n : null}\n </>\n )\n}\n", "import { CardContent } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { isTruthy } from '@xylabs/sdk'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport {\n useEmbedPluginState, usePluginProps, useResolvePayload,\n} from '../../../contexts/index.ts'\nimport { EmbedRenderSelect, ListModeSelectFormControl } from '../../controls/index.ts'\nimport type { BusyCardProps } from './BusyCard.tsx'\nimport { BusyCard } from './BusyCard.tsx'\nimport { EmbedCardHeader } from './EmbedCardHeader.tsx'\n\nexport const EmbedPluginCard: React.FC<BusyCardProps> = ({ ...props }) => {\n const { payload } = useResolvePayload()\n const {\n activePlugin: ActivePlugin, plugins, hideElementsConfig,\n } = useEmbedPluginState()\n const { listMode } = useListMode()\n const { pluginProps } = usePluginProps()\n const supportsListMode = isTruthy(ActivePlugin?.components?.box?.listModes?.length) ? true : false\n\n return (\n <BusyCard {...props}>\n {hideElementsConfig?.hideCardHeader ? null : <EmbedCardHeader />}\n {/* Only show the row if the children are present */}\n {(plugins && plugins.length > 0) || supportsListMode\n ? (\n <FlexGrowRow\n sx={{\n columnGap: 2,\n rowGap: 2,\n flexWrap: 'wrap',\n pb: 1,\n }}\n >\n {plugins && plugins.length > 1\n ? <EmbedRenderSelect />\n : null}\n {supportsListMode\n ? <ListModeSelectFormControl />\n : null}\n </FlexGrowRow>\n )\n : null}\n <CardContent sx={{ height: '100%' }}>\n {ActivePlugin\n ? <ActivePlugin.components.box.detailsBox payload={payload} {...pluginProps} {...(supportsListMode && { listMode })} />\n : null}\n </CardContent>\n </BusyCard>\n )\n}\n", "import type { FormControlProps } from '@mui/material'\nimport { FormControl, InputLabel } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedFormControlProps extends FormControlProps {\n formId?: string\n formLabel?: string\n}\n\nexport const EmbedFormControl: React.FC<PropsWithChildren<EmbedFormControlProps>> = ({\n formId, formLabel, children, ...props\n}) => {\n return (\n <FormControl {...props}>\n <InputLabel id={formId}>{formLabel}</InputLabel>\n {children}\n </FormControl>\n )\n}\n", "import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport type { ListMode } from '@xyo-network/react-shared'\nimport { useListMode } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst listModeSelectId = 'listmode-select-id'\nconst listModeSelectLabel = 'List Mode'\n\nexport const ListModeSelect: React.FC<SelectExProps<ListMode>> = (props) => {\n const { listMode, setListMode } = useListMode()\n\n return (\n <SelectEx<ListMode>\n value={(listMode ?? 'default')}\n onChange={(event) => {\n setListMode?.(event.target.value)\n }}\n {...props}\n >\n <MenuItem key=\"default\" value=\"default\">\n Default\n </MenuItem>\n <MenuItem key=\"table\" value=\"table\">\n Table\n </MenuItem>\n <MenuItem key=\"grid\" value=\"grid\">\n Grid\n </MenuItem>\n </SelectEx>\n )\n}\n\nexport const ListModeSelectFormControl: React.FC<SelectExProps<ListMode>> = (props) => {\n return (\n <EmbedFormControl formId={listModeSelectId} formLabel={listModeSelectLabel}>\n <ListModeSelect size=\"small\" label={listModeSelectLabel} labelId={listModeSelectId} {...props} />\n </EmbedFormControl>\n )\n}\n", "import { MenuItem } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useEmbedPluginState } from '../../contexts/index.ts'\nimport { EmbedFormControl } from './EmbedFormControl.tsx'\n\nconst renderSelectId = 'render-select-id'\nconst renderSelectLabel = 'Renderer'\n\nexport const EmbedRenderSelect: React.FC<SelectExProps<string>> = (props) => {\n const {\n activePlugin, setActivePlugin, plugins,\n } = useEmbedPluginState()\n return (\n <EmbedFormControl formId={renderSelectId} formLabel={renderSelectLabel}>\n <SelectEx size=\"small\" value={activePlugin?.name} {...props}>\n {plugins?.map(plugin => (\n <MenuItem value={plugin.name} key={plugin.name} onClick={() => setActivePlugin?.(plugin)}>\n {plugin.name}\n </MenuItem>\n ))}\n </SelectEx>\n </EmbedFormControl>\n )\n}\n", "import { useTheme } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useRefreshPayload, useResolvePayload } from '../../contexts/index.ts'\nimport type { EmbedPluginProps } from '../../types/index.ts'\nimport { EmbedPluginInner } from '../EmbedPlugin.tsx'\nimport type { BusyCardProps } from './card/index.ts'\nimport { EmbedPluginCard } from './card/index.ts'\nimport { EmbedCardApiErrorRenderer } from './error-handling/index.ts'\n\nexport interface EmbedPluginCardProps extends PropsWithChildren, EmbedPluginProps, BusyCardProps {}\n\nexport const ApiEmbedPluginCard: React.FC<EmbedPluginCardProps> = ({ children, ...props }) => {\n const {\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n ...busyCardProps\n } = props\n\n return (\n <EmbedPluginInner\n {...{\n embedPluginConfig,\n hideElementsConfig,\n huriPayload,\n onRefresh,\n plugins,\n refreshTitle,\n timestampLabel,\n validateSchema,\n }}\n >\n <EmbedPluginCardInner {...busyCardProps} />\n {children}\n </EmbedPluginInner>\n )\n}\n\nexport const EmbedPluginCardInner: React.FC<BusyCardProps> = (props) => {\n const { payload, huriError } = useResolvePayload()\n const { refreshPayload } = useRefreshPayload()\n const theme = useTheme()\n\n return (\n <EmbedCardApiErrorRenderer xyoError={huriError}>\n <EmbedPluginCard\n elevation={3}\n variant=\"elevation\"\n busy={Boolean(!refreshPayload && payload)}\n busyVariantProps={{\n style: {\n alignItems: 'start', paddingTop: theme.spacing(2), zIndex: 2,\n },\n }}\n sx={{ position: 'relative' }}\n {...props}\n />\n </EmbedCardApiErrorRenderer>\n )\n}\n\n/** @deprecated - use EmbedPluginCard and use CardProps instead of FlexBoxProps */\n\nexport { EmbedPluginCard as EmbedPlugin } from './card/index.ts'\n", "import { ErrorBoundary } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { ListModeProvider } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport {\n EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider,\n} from '../contexts/index.ts'\nimport type { EmbedPluginProps } from '../types/index.ts'\nimport { EmbedResolver } from './EmbedResolver.tsx'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts/index.ts'\n\nexport const EmbedPluginInner: React.FC<PropsWithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins,\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<PropsWithChildren<WithResolversProps>> = ({\n children, onRefresh, huriPayload,\n}) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<PropsWithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n", "import { LoadResult } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useResolvePayload } from '../contexts/index.ts'\n\nexport const EmbedResolver: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n payload, notFound, huriError,\n } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n", "import type { AlertProps } from '@mui/material'\nimport { Alert } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useValidatePayload } from '../../contexts/index.ts'\n\nexport const ValidatePayloadAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const {\n validPayload, enabled, schema,\n } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be\n {' '}\n {schema}\n {' '}\n but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n", "import type { AlertProps } from '@mui/material'\nimport { Alert, AlertTitle } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts/index.ts'\n\nexport const ValidatePluginsAlert: React.FC<PropsWithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>\n Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n", "import type { CardProps } from '@mui/material'\nimport { ErrorAlert, ErrorRender } from '@xylabs/react-error'\nimport type { ModuleError } from '@xyo-network/sdk'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { EmbedErrorCard } from './EmbedErrorCard.tsx'\n\ninterface EmbedCardApiErrorRendererProps extends CardProps {\n xyoError?: ModuleError\n}\n\nexport const EmbedCardApiErrorRenderer: React.FC<PropsWithChildren<EmbedCardApiErrorRendererProps>> = ({\n xyoError, children, ...props\n}) => {\n return (\n <ErrorRender error={xyoError} noReAuth noErrorDisplay customError={<CustomApiErrorCard xyoError={xyoError} {...props} />}>\n {children}\n </ErrorRender>\n )\n}\n\nconst CustomApiErrorCard: React.FC<EmbedCardApiErrorRendererProps> = ({ xyoError, ...props }) => {\n return (\n <EmbedErrorCard {...props}>\n <ErrorAlert error={xyoError} />\n </EmbedErrorCard>\n )\n}\n", "import type { AlertProps, CardProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Card, CardContent, Typography,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\ninterface EmbedErrorCardBaseProps {\n alertProps?: AlertProps\n error?: Error\n hideErrorDetails?: boolean\n scope?: string\n}\n\ninterface EmbedErrorCardProps extends EmbedErrorCardBaseProps, CardProps {}\n\nexport const EmbedErrorCard: React.FC<PropsWithChildren<EmbedErrorCardProps>> = (props) => {\n const {\n alertProps, error, scope, hideErrorDetails = true, children, ...cardProps\n } = props\n const errorProps = {\n alertProps, error, hideErrorDetails, scope,\n }\n return (\n <Card {...cardProps}>\n <CardContent>{children ?? <DefaultErrorAlert {...errorProps} />}</CardContent>\n </Card>\n )\n}\n\nconst DefaultErrorAlert: React.FC<EmbedErrorCardBaseProps> = ({\n alertProps, scope, hideErrorDetails, error,\n}) => {\n return (\n <Alert severity=\"error\" {...alertProps}>\n <AlertTitle>Whoops! Something went wrong</AlertTitle>\n {isDefined(scope)\n ? (\n <Typography variant=\"caption\">\n Scope:\n {scope}\n </Typography>\n )\n : null}\n {!hideErrorDetails && error\n ? (\n <>\n <Typography variant=\"caption\">Error: </Typography>\n <Typography variant=\"caption\">{error?.message}</Typography>\n </>\n )\n : (\n <Typography\n variant=\"caption\"\n sx={{ fontSize: 'small' }}\n >\n Error Loading Plugin\n </Typography>\n )}\n </Alert>\n )\n}\n"],
5
5
  "mappings": ";AACA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAM9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAqBH,SAGM,KAHN;AAVG,IAAM,WAAuD,CAAC;AAAA,EACnE;AAAA,EACA,cAAc;AAAA,EACd,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,cAAc,MAAM,WAAW;AACpD,SACE,qBAAC,QAAM,GAAG,OACP;AAAA;AAAA,IACA,gBAAgB,cAAc,eAC3B,oBAAC,wBAAsB,GAAI,kBAAgD,IAC3E;AAAA,IACH,gBAAgB,YAAY,eACzB,oBAAC,sBAAoB,GAAI,kBAA8C,IACvE;AAAA,KACN;AAEJ;;;AC1CA,SAAS,WAAW,mBAAmB;AAEvC;AAAA,EACE;AAAA,EAAQ;AAAA,EAAY,QAAAA;AAAA,OACf;AACP,SAAS,eAAe;AACxB,SAAS,aAAAC,kBAAiB;AAC1B,SAAgB,YAAAC,iBAAgB;;;ACPhC,SAAS,uBAAuB;AAIzB,IAAM,qBAAqB,gBAAkC;;;ACJpE,SAAS,qBAAqB;AAE9B,SAAgB,eAAe;AA6B3B,gBAAAC,YAAA;AArBG,IAAM,sBAA6E,CAAC;AAAA,EACzF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,cAAc,eAAe,IAAI,cAAc,UAAU,QAAQ,CAAC,IAAI,MAAS;AAEtF,QAAM,QAAQ,QAAQ,OAAO;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,CAAC,cAAc,mBAAmB,oBAAoB,cAAc,iBAAiB,cAAc,CAAC;AAExG,SACE,gBAAA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A;AAAA,EACH;AAEJ;AAEO,IAAM,uBAAgD,CAAC,UAAU;AACtE,QAAM,EAAE,SAAS,UAAU,IAAI,kBAAkB;AACjD,QAAM,EAAE,eAAe,IAAI,kBAAkB;AAC7C,QAAM,QAAQ,SAAS;AAEvB,SACE,gBAAAA,MAAC,6BAA0B,UAAU,WACnC,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,SAAQ;AAAA,MACR,MAAM,QAAQ,CAAC,kBAAkB,OAAO;AAAA,MACxC,kBAAkB;AAAA,QAChB,OAAO;AAAA,UACL,YAAY;AAAA,UAAS,YAAY,MAAM,QAAQ,CAAC;AAAA,UAAG,QAAQ;AAAA,QAC7D;AAAA,MACF;AAAA,MACA,IAAI,EAAE,UAAU,WAAW;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;",
6
6
  "names": ["Chip", "isDefined", "useState", "jsx", "createContextEx", "useMemo", "jsx", "useMemo", "useContextEx", "useContextEx", "useMemo", "useState", "createContextEx", "jsx", "useState", "useMemo", "useContextEx", "useContextEx", "createContextEx", "useEffect", "useMemo", "useState", "jsx", "useState", "useEffect", "useMemo", "useContextEx", "useContextEx", "useAsyncEffect", "useMemo", "useState", "createContextEx", "jsx", "useState", "useAsyncEffect", "useMemo", "useContextEx", "useContextEx", "useState", "isDefined", "Fragment", "jsx", "jsxs", "isDefined", "Fragment", "jsx", "jsxs", "useState", "Fragment", "jsx", "jsxs", "useState", "isDefined", "Chip", "useListMode", "jsx", "jsxs", "MenuItem", "jsx", "jsxs", "MenuItem", "MenuItem", "SelectEx", "jsx", "SelectEx", "MenuItem", "jsx", "jsxs", "useListMode", "jsx", "Fragment", "jsx", "jsxs", "Alert", "Fragment", "jsx", "jsxs", "Alert", "jsx", "Alert", "AlertTitle", "Card", "CardContent", "isDefined", "Fragment", "jsx", "jsxs", "jsx", "jsx", "jsxs"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/sdk-js';
1
+ import type { Payload } from '@xyo-network/sdk';
2
2
  import type { EmbedPluginBase, EmbedPluginVisibilityConfig } from '../contexts/index.ts';
3
3
  export interface EmbedPluginProps extends EmbedPluginBase {
4
4
  hideElementsConfig?: EmbedPluginVisibilityConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"EmbedPluginProps.d.ts","sourceRoot":"","sources":["../../../src/types/EmbedPluginProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAExF,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
+ {"version":3,"file":"EmbedPluginProps.d.ts","sourceRoot":"","sources":["../../../src/types/EmbedPluginProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAExF,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-embed",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -41,59 +41,58 @@
41
41
  "README.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@xyo-network/react-payload-plugin": "~10.0.2",
45
- "@xyo-network/react-shared": "~10.0.2"
44
+ "@xyo-network/react-payload-plugin": "~10.0.3",
45
+ "@xyo-network/react-shared": "~10.0.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@bitauth/libauth": "~3.0.0",
49
- "@metamask/providers": "^22.1.1",
50
49
  "@mui/icons-material": "^9.1.1",
51
50
  "@mui/material": "^9.1.2",
52
51
  "@mui/system": "^9.1.2",
53
- "@mui/x-tree-view": "~9.6",
52
+ "@mui/x-tree-view": "~9.7.0",
54
53
  "@noble/post-quantum": "~0.6.1",
55
54
  "@opentelemetry/api": "^1.9.1",
56
55
  "@opentelemetry/sdk-trace-base": "^2.8.0",
57
- "@react-spring/web": "~10.1.1",
56
+ "@react-spring/web": "~10.1.2",
58
57
  "@scure/base": "~2.2.0",
59
58
  "@scure/bip39": "~2.2.0",
60
59
  "@storybook/react-vite": "~10.4.6",
61
60
  "@types/react": "^19.2.17",
62
- "@xylabs/eth-address": "^6.1.4",
63
- "@xylabs/geo": "^6.1.4",
64
- "@xylabs/pixel": "^6.1.4",
65
- "@xylabs/react-async-effect": "^9.1.2",
66
- "@xylabs/react-button": "^9.1.2",
67
- "@xylabs/react-error": "^9.1.2",
68
- "@xylabs/react-flexbox": "^9.1.2",
69
- "@xylabs/react-hooks": "^9.1.2",
70
- "@xylabs/react-identicon": "^9.1.2",
71
- "@xylabs/react-link": "^9.1.2",
72
- "@xylabs/react-promise": "^9.1.2",
73
- "@xylabs/react-quick-tip-button": "^9.1.2",
74
- "@xylabs/react-select": "^9.1.2",
75
- "@xylabs/react-shared": "^9.1.2",
76
- "@xylabs/react-theme": "^9.1.2",
77
- "@xylabs/sdk-js": "^6.1.4",
78
- "@xylabs/sdk-react": "~9.1.2",
79
- "@xylabs/threads": "^6.1.4",
80
- "@xylabs/toolchain": "~8.3.0",
81
- "@xylabs/tsconfig": "^8.3.0",
82
- "@xylabs/tsconfig-dom": "^8.3.0",
83
- "@xylabs/tsconfig-react": "~8.3.0",
84
- "@xyo-network/crypto-asset-payload-plugin": "~7.0",
85
- "@xyo-network/diviner-schema-list": "~7.0",
86
- "@xyo-network/diviner-schema-stats": "~7.0",
61
+ "@xylabs/eth-address": "^7.0.1",
62
+ "@xylabs/geo": "^7.0.1",
63
+ "@xylabs/pixel": "^7.0.1",
64
+ "@xylabs/react-async-effect": "~10.0",
65
+ "@xylabs/react-button": "~10.0",
66
+ "@xylabs/react-error": "~10.0",
67
+ "@xylabs/react-flexbox": "~10.0",
68
+ "@xylabs/react-hooks": "~10.0",
69
+ "@xylabs/react-identicon": "~10.0",
70
+ "@xylabs/react-link": "~10.0",
71
+ "@xylabs/react-promise": "~10.0",
72
+ "@xylabs/react-quick-tip-button": "~10.0",
73
+ "@xylabs/react-select": "~10.0",
74
+ "@xylabs/react-shared": "~10.0",
75
+ "@xylabs/react-theme": "~10.0",
76
+ "@xylabs/sdk": "^7.0.1",
77
+ "@xylabs/sdk-react": "~10.0",
78
+ "@xylabs/threads": "^7.0.1",
79
+ "@xylabs/toolchain": "~8.5.3",
80
+ "@xylabs/tsconfig": "^8.5.3",
81
+ "@xylabs/tsconfig-dom": "^8.5.3",
82
+ "@xylabs/tsconfig-react": "~8.5.3",
83
+ "@xyo-network/crypto-asset-payload-plugin": "^7.0.1",
84
+ "@xyo-network/diviner-schema-list": "^7.0.3",
85
+ "@xyo-network/diviner-schema-stats": "^7.0.3",
87
86
  "@xyo-network/node-core-types": "~4.2.2",
88
- "@xyo-network/sdk-js": "~7.0",
89
- "@xyo-network/sdk-protocol-js": "~7.0",
87
+ "@xyo-network/sdk": "^7.0.3",
88
+ "@xyo-network/sdk-protocol": "^7.0.4",
90
89
  "@xyo-network/typeof": "~5.3.30",
91
90
  "ajv": "^8.20.0",
92
91
  "async-mutex": "^0.5.0",
93
92
  "axios": "^1.18.1",
94
93
  "clsx": "~2.1.1",
95
- "debug": "~4.4.3",
96
- "eslint": "^10.5.0",
94
+ "debug": "^4.4.3",
95
+ "eslint": "^10.6.0",
97
96
  "ethers": "^6.17.0",
98
97
  "hash-wasm": "~4.12.0",
99
98
  "idb": "^8.0.3",
@@ -102,8 +101,8 @@
102
101
  "luxon": "^3.7.2",
103
102
  "md5": "~2.3.0",
104
103
  "numeral": "~2.0.6",
105
- "observable-fns": "~0.6.1",
106
- "query-string": "~9.4.0",
104
+ "observable-fns": "^0.6.1",
105
+ "query-string": "~9.4.1",
107
106
  "react": "^19.2.7",
108
107
  "react-dom": "^19.2.7",
109
108
  "react-router-dom": "^7.18.0",
@@ -111,53 +110,52 @@
111
110
  "typescript": "^6.0.3",
112
111
  "viem": "^2.53.1",
113
112
  "vite": "^8.1.0",
114
- "webextension-polyfill": "^0.12.0",
115
113
  "zod": "^4.4.3",
116
114
  "zustand": "~5.0.14",
117
- "@xyo-network/react-crypto-market-uniswap-plugin": "~10.0.2",
118
- "@xyo-network/react-aggregate-price-plugin": "~10.0.2"
115
+ "@xyo-network/react-crypto-market-uniswap-plugin": "~10.0.3",
116
+ "@xyo-network/react-aggregate-price-plugin": "~10.0.3"
119
117
  },
120
118
  "peerDependencies": {
121
119
  "@bitauth/libauth": "~3.0",
122
- "@metamask/providers": "^22.1",
123
120
  "@mui/icons-material": "^9.0",
124
121
  "@mui/material": "^9.0",
125
122
  "@mui/system": "^9.0",
126
- "@mui/x-tree-view": "~9.6",
123
+ "@mui/x-tree-view": "~9.7",
127
124
  "@noble/post-quantum": "~0.6.1",
128
125
  "@opentelemetry/api": "^1.9",
129
126
  "@opentelemetry/sdk-trace-base": "^2.7",
130
127
  "@react-spring/web": "~10.1",
131
128
  "@scure/base": "~2.2",
132
129
  "@scure/bip39": "~2.2",
133
- "@xylabs/eth-address": "^6.1.0",
134
- "@xylabs/geo": "^6.0",
135
- "@xylabs/pixel": "^6.1",
136
- "@xylabs/react-async-effect": "^9.1",
137
- "@xylabs/react-button": "^9.1",
138
- "@xylabs/react-error": "^9.1",
139
- "@xylabs/react-flexbox": "^9.1",
140
- "@xylabs/react-hooks": "^9.1",
141
- "@xylabs/react-identicon": "^9.1",
142
- "@xylabs/react-link": "^9.1",
143
- "@xylabs/react-promise": "^9.1",
144
- "@xylabs/react-quick-tip-button": "^9.1",
145
- "@xylabs/react-select": "^9.1",
146
- "@xylabs/react-shared": "^9.1",
147
- "@xylabs/react-theme": "^9.1",
148
- "@xylabs/sdk-js": "^6.0",
149
- "@xylabs/sdk-react": "^9.1",
150
- "@xylabs/threads": "^6.0",
130
+ "@types/react": "^19.2",
131
+ "@xylabs/eth-address": "^7.0",
132
+ "@xylabs/geo": "^7.0",
133
+ "@xylabs/pixel": "^7.0",
134
+ "@xylabs/react-async-effect": "^10.0",
135
+ "@xylabs/react-button": "^10.0",
136
+ "@xylabs/react-error": "^10.0",
137
+ "@xylabs/react-flexbox": "^10.0",
138
+ "@xylabs/react-hooks": "^10.0",
139
+ "@xylabs/react-identicon": "^10.0",
140
+ "@xylabs/react-link": "^10.0",
141
+ "@xylabs/react-promise": "^10.0",
142
+ "@xylabs/react-quick-tip-button": "^10.0",
143
+ "@xylabs/react-select": "^10.0",
144
+ "@xylabs/react-shared": "^10.0",
145
+ "@xylabs/react-theme": "^10.0",
146
+ "@xylabs/sdk": "^7.0",
147
+ "@xylabs/sdk-react": "^10.0",
148
+ "@xylabs/threads": "^7.0",
151
149
  "@xyo-network/diviner-schema-list": "^7.0",
152
150
  "@xyo-network/diviner-schema-stats": "^7.0",
153
151
  "@xyo-network/node-core-types": "~4.2",
154
- "@xyo-network/sdk-js": "^7.0",
155
- "@xyo-network/sdk-protocol-js": "^7.0",
152
+ "@xyo-network/sdk": "*",
153
+ "@xyo-network/sdk-protocol": "^7.0",
156
154
  "@xyo-network/typeof": "~5.3",
157
155
  "ajv": "^8.20",
158
156
  "async-mutex": "^0.5",
159
157
  "clsx": "~2.1",
160
- "debug": "~4.4",
158
+ "debug": "^4.4",
161
159
  "ethers": "^6.16",
162
160
  "hash-wasm": "~4.12",
163
161
  "idb": "^8.0",
@@ -170,7 +168,6 @@
170
168
  "react-dom": "^19.2",
171
169
  "react-router-dom": "^7.15",
172
170
  "viem": "^2.48",
173
- "webextension-polyfill": "^0.12",
174
171
  "zod": "^4.4",
175
172
  "zustand": "~5.0"
176
173
  },