@xyo-network/react-embed 3.0.1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/EmbedPlugin.d.ts +5 -0
- package/dist/browser/components/EmbedPlugin.d.ts.map +1 -0
- package/dist/browser/components/EmbedResolver.d.ts +4 -0
- package/dist/browser/components/EmbedResolver.d.ts.map +1 -0
- package/dist/browser/components/controls/EmbedFormControl.d.ts +10 -0
- package/dist/browser/components/controls/EmbedFormControl.d.ts.map +1 -0
- package/dist/browser/components/controls/ListModeSelect.d.ts +6 -0
- package/dist/browser/components/controls/ListModeSelect.d.ts.map +1 -0
- package/dist/browser/components/controls/RenderSelect.d.ts +4 -0
- package/dist/browser/components/controls/RenderSelect.d.ts.map +1 -0
- package/dist/browser/components/controls/index.d.ts +4 -0
- package/dist/browser/components/controls/index.d.ts.map +1 -0
- package/dist/browser/components/embed-card/EmbedCardResolver.d.ts +5 -0
- package/dist/browser/components/embed-card/EmbedCardResolver.d.ts.map +1 -0
- package/dist/browser/components/embed-card/EmbedPluginCard.d.ts +10 -0
- package/dist/browser/components/embed-card/EmbedPluginCard.d.ts.map +1 -0
- package/dist/browser/components/embed-card/card/BusyCard.d.ts +11 -0
- package/dist/browser/components/embed-card/card/BusyCard.d.ts.map +1 -0
- package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts +4 -0
- package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts.map +1 -0
- package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts +4 -0
- package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts.map +1 -0
- package/dist/browser/components/embed-card/card/index.d.ts +4 -0
- package/dist/browser/components/embed-card/card/index.d.ts.map +1 -0
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts +10 -0
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts.map +1 -0
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts +14 -0
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts.map +1 -0
- package/dist/browser/components/embed-card/error-handling/index.d.ts +3 -0
- package/dist/browser/components/embed-card/error-handling/index.d.ts.map +1 -0
- package/dist/browser/components/embed-card/index.d.ts +3 -0
- package/dist/browser/components/embed-card/index.d.ts.map +1 -0
- package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts +4 -0
- package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts.map +1 -0
- package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts +4 -0
- package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts.map +1 -0
- package/dist/browser/components/embed-card/menu/index.d.ts +2 -0
- package/dist/browser/components/embed-card/menu/index.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +3 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/stories/storyPayload.d.ts +126 -0
- package/dist/browser/components/stories/storyPayload.d.ts.map +1 -0
- package/dist/browser/components/stories/storyShared.d.ts +4 -0
- package/dist/browser/components/stories/storyShared.d.ts.map +1 -0
- package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts +3 -0
- package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts.map +1 -0
- package/dist/browser/components/validation-alerts/ValidatePayload.d.ts +5 -0
- package/dist/browser/components/validation-alerts/ValidatePayload.d.ts.map +1 -0
- package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts +5 -0
- package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts.map +1 -0
- package/dist/browser/components/validation-alerts/index.d.ts +3 -0
- package/dist/browser/components/validation-alerts/index.d.ts.map +1 -0
- package/dist/browser/contexts/EmbedPluginContext/Context.d.ts +3 -0
- package/dist/browser/contexts/EmbedPluginContext/Context.d.ts.map +1 -0
- package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts +6 -0
- package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/EmbedPluginContext/State.d.ts +28 -0
- package/dist/browser/contexts/EmbedPluginContext/State.d.ts.map +1 -0
- package/dist/browser/contexts/EmbedPluginContext/index.d.ts +5 -0
- package/dist/browser/contexts/EmbedPluginContext/index.d.ts.map +1 -0
- package/dist/browser/contexts/EmbedPluginContext/use.d.ts +2 -0
- package/dist/browser/contexts/EmbedPluginContext/use.d.ts.map +1 -0
- package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts +3 -0
- package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts.map +1 -0
- package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts +8 -0
- package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/RefreshPayloadContext/State.d.ts +8 -0
- package/dist/browser/contexts/RefreshPayloadContext/State.d.ts.map +1 -0
- package/dist/browser/contexts/RefreshPayloadContext/index.d.ts +4 -0
- package/dist/browser/contexts/RefreshPayloadContext/index.d.ts.map +1 -0
- package/dist/browser/contexts/RefreshPayloadContext/use.d.ts +2 -0
- package/dist/browser/contexts/RefreshPayloadContext/use.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts +3 -0
- package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts +6 -0
- package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/State.d.ts +13 -0
- package/dist/browser/contexts/ResolvePayloadContext/State.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/index.d.ts +5 -0
- package/dist/browser/contexts/ResolvePayloadContext/index.d.ts.map +1 -0
- package/dist/browser/contexts/ResolvePayloadContext/use.d.ts +2 -0
- package/dist/browser/contexts/ResolvePayloadContext/use.d.ts.map +1 -0
- package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts +3 -0
- package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts.map +1 -0
- package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts +7 -0
- package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/ValidatePayloadContext/State.d.ts +7 -0
- package/dist/browser/contexts/ValidatePayloadContext/State.d.ts.map +1 -0
- package/dist/browser/contexts/ValidatePayloadContext/index.d.ts +4 -0
- package/dist/browser/contexts/ValidatePayloadContext/index.d.ts.map +1 -0
- package/dist/browser/contexts/ValidatePayloadContext/use.d.ts +2 -0
- package/dist/browser/contexts/ValidatePayloadContext/use.d.ts.map +1 -0
- package/dist/browser/contexts/index.d.ts +5 -0
- package/dist/browser/contexts/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +4 -112
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/types/EmbedPluginProps.d.ts +9 -0
- package/dist/browser/types/EmbedPluginProps.d.ts.map +1 -0
- package/dist/browser/types/index.d.ts +2 -0
- package/dist/browser/types/index.d.ts.map +1 -0
- package/package.json +57 -54
- package/src/components/EmbedPlugin.tsx +9 -5
- package/src/components/EmbedResolver.tsx +4 -2
- package/src/components/controls/EmbedFormControl.tsx +6 -3
- package/src/components/controls/ListModeSelect.tsx +4 -2
- package/src/components/controls/RenderSelect.tsx +5 -2
- package/src/components/embed-card/EmbedCardResolver.tsx +11 -4
- package/src/components/embed-card/EmbedPluginCard.tsx +9 -4
- package/src/components/embed-card/card/BusyCard.tsx +7 -4
- package/src/components/embed-card/card/EmbedCardHeader.tsx +10 -3
- package/src/components/embed-card/card/EmbedPluginCard.tsx +5 -2
- package/src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx +6 -4
- package/src/components/embed-card/error-handling/EmbedErrorCard.tsx +14 -5
- package/src/components/embed-card/menu/EmbedMenu.tsx +2 -1
- package/src/components/embed-card/menu/JsonMenuItem.tsx +4 -1
- package/src/components/stories/XyoEmbedPlugin.examples.stories.tsx +1 -1
- package/src/components/stories/XyoEmbedPlugin.states.stories.tsx +4 -2
- package/src/components/stories/storyPayload.ts +60 -12
- package/src/components/stories/storyShared.tsx +1 -11
- package/src/components/stories/xyoEmbedStoryBase.ts +9 -0
- package/src/components/validation-alerts/ValidatePayload.tsx +6 -3
- package/src/components/validation-alerts/ValidatePlugins.tsx +3 -2
- package/src/contexts/EmbedPluginContext/Context.ts +1 -1
- package/src/contexts/EmbedPluginContext/Provider.tsx +3 -3
- package/src/contexts/EmbedPluginContext/State.ts +3 -3
- package/src/contexts/RefreshPayloadContext/Context.ts +1 -1
- package/src/contexts/RefreshPayloadContext/Provider.tsx +8 -3
- package/src/contexts/RefreshPayloadContext/State.ts +2 -2
- package/src/contexts/ResolvePayloadContext/Context.ts +1 -1
- package/src/contexts/ResolvePayloadContext/Provider.tsx +14 -6
- package/src/contexts/ResolvePayloadContext/State.ts +3 -3
- package/src/contexts/ValidatePayloadContext/Context.ts +1 -1
- package/src/contexts/ValidatePayloadContext/Provider.stories.tsx +15 -6
- package/src/contexts/ValidatePayloadContext/Provider.tsx +7 -3
- package/src/contexts/ValidatePayloadContext/State.ts +1 -1
- package/src/types/EmbedPluginProps.ts +2 -2
- package/xy.config.ts +2 -4
@@ -1,15 +1,22 @@
|
|
1
1
|
import { Typography } from '@mui/material'
|
2
|
-
import {
|
2
|
+
import type {
|
3
|
+
Decorator, Meta, StoryFn,
|
4
|
+
} from '@storybook/react'
|
3
5
|
import React from 'react'
|
4
6
|
|
5
|
-
import {
|
7
|
+
import type { EmbedPluginState } from '../EmbedPluginContext/index.ts'
|
8
|
+
import { EmbedPluginContext } from '../EmbedPluginContext/index.ts'
|
6
9
|
import { RefreshPayloadProvider } from '../RefreshPayloadContext/index.ts'
|
7
|
-
import {
|
8
|
-
import {
|
10
|
+
import type { ResolvePayloadState } from '../ResolvePayloadContext/index.ts'
|
11
|
+
import { ResolvePayloadContext } from '../ResolvePayloadContext/index.ts'
|
12
|
+
import type { ValidatePayloadProviderProps } from './Provider.tsx'
|
13
|
+
import { ValidatePayloadProvider } from './Provider.tsx'
|
9
14
|
import { useValidatePayload } from './use.ts'
|
10
15
|
|
11
16
|
const EmbedDecorator: Decorator<ValidatePayloadProviderPropsEx> = (Story, { args }) => {
|
12
|
-
const {
|
17
|
+
const {
|
18
|
+
xyoEmbedPluginContext, resolvePayloadContext, ...props
|
19
|
+
} = args
|
13
20
|
console.log(resolvePayloadContext)
|
14
21
|
return (
|
15
22
|
<RefreshPayloadProvider>
|
@@ -69,6 +76,8 @@ ValidationFailed.args = {
|
|
69
76
|
xyoEmbedPluginContext: stubProviderDefaultValue,
|
70
77
|
}
|
71
78
|
|
72
|
-
export {
|
79
|
+
export {
|
80
|
+
Default, ValidationFailed, ValidationSucceeded,
|
81
|
+
}
|
73
82
|
|
74
83
|
export default StorybookEntry
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { Chip } from '@mui/material'
|
2
2
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
3
|
-
import { WithChildren } from '@xylabs/react-shared'
|
4
|
-
import {
|
3
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
4
|
+
import type { SchemaNameToValidatorMap } from '@xyo-network/schema-cache'
|
5
|
+
import { SchemaCache } from '@xyo-network/schema-cache'
|
5
6
|
import React, { useState } from 'react'
|
6
7
|
|
7
8
|
import { useResolvePayload } from '../ResolvePayloadContext/index.ts'
|
@@ -36,7 +37,10 @@ export const ValidatePayloadProvider: React.FC<WithChildren<ValidatePayloadProvi
|
|
36
37
|
|
37
38
|
return (
|
38
39
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
39
|
-
<ValidatePayloadContext.Provider value={{
|
40
|
+
<ValidatePayloadContext.Provider value={{
|
41
|
+
enabled, provided: true, schema: payload?.schema, validPayload: valid,
|
42
|
+
}}
|
43
|
+
>
|
40
44
|
{enabled
|
41
45
|
? <>{initialized ? children : <Chip label="Validating Payload..." />}</>
|
42
46
|
: children}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model'
|
1
|
+
import type { Payload } from '@xyo-network/payload-model'
|
2
2
|
|
3
|
-
import { EmbedPluginBase, EmbedPluginVisibilityConfig } from '../contexts/index.ts'
|
3
|
+
import type { EmbedPluginBase, EmbedPluginVisibilityConfig } from '../contexts/index.ts'
|
4
4
|
|
5
5
|
export interface EmbedPluginProps extends EmbedPluginBase {
|
6
6
|
hideElementsConfig?: EmbedPluginVisibilityConfig
|
package/xy.config.ts
CHANGED