@xyo-network/react-embed 2.64.9 → 2.64.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/docs.json +109 -109
- package/package.json +15 -15
- package/dist/browser/components/EmbedPlugin.cjs +0 -251
- package/dist/browser/components/EmbedPlugin.cjs.map +0 -1
- package/dist/browser/components/EmbedPlugin.js +0 -230
- package/dist/browser/components/EmbedPlugin.js.map +0 -1
- package/dist/browser/components/EmbedResolver.cjs +0 -42
- package/dist/browser/components/EmbedResolver.cjs.map +0 -1
- package/dist/browser/components/EmbedResolver.js +0 -21
- package/dist/browser/components/EmbedResolver.js.map +0 -1
- package/dist/browser/components/controls/EmbedFormControl.cjs +0 -34
- package/dist/browser/components/controls/EmbedFormControl.cjs.map +0 -1
- package/dist/browser/components/controls/EmbedFormControl.js +0 -13
- package/dist/browser/components/controls/EmbedFormControl.js.map +0 -1
- package/dist/browser/components/controls/ListModeSelect.cjs +0 -65
- package/dist/browser/components/controls/ListModeSelect.cjs.map +0 -1
- package/dist/browser/components/controls/ListModeSelect.js +0 -44
- package/dist/browser/components/controls/ListModeSelect.js.map +0 -1
- package/dist/browser/components/controls/RenderSelect.cjs +0 -54
- package/dist/browser/components/controls/RenderSelect.cjs.map +0 -1
- package/dist/browser/components/controls/RenderSelect.js +0 -33
- package/dist/browser/components/controls/RenderSelect.js.map +0 -1
- package/dist/browser/components/controls/index.cjs +0 -87
- package/dist/browser/components/controls/index.cjs.map +0 -1
- package/dist/browser/components/controls/index.js +0 -64
- package/dist/browser/components/controls/index.js.map +0 -1
- package/dist/browser/components/embed-card/EmbedCardResolver.cjs +0 -95
- package/dist/browser/components/embed-card/EmbedCardResolver.cjs.map +0 -1
- package/dist/browser/components/embed-card/EmbedCardResolver.js +0 -74
- package/dist/browser/components/embed-card/EmbedCardResolver.js.map +0 -1
- package/dist/browser/components/embed-card/EmbedPluginCard.cjs +0 -497
- package/dist/browser/components/embed-card/EmbedPluginCard.cjs.map +0 -1
- package/dist/browser/components/embed-card/EmbedPluginCard.js +0 -479
- package/dist/browser/components/embed-card/EmbedPluginCard.js.map +0 -1
- package/dist/browser/components/embed-card/card/BusyCard.cjs +0 -45
- package/dist/browser/components/embed-card/card/BusyCard.cjs.map +0 -1
- package/dist/browser/components/embed-card/card/BusyCard.js +0 -27
- package/dist/browser/components/embed-card/card/BusyCard.js.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedCardHeader.cjs +0 -108
- package/dist/browser/components/embed-card/card/EmbedCardHeader.cjs.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedCardHeader.js +0 -87
- package/dist/browser/components/embed-card/card/EmbedCardHeader.js.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedPluginCard.cjs +0 -199
- package/dist/browser/components/embed-card/card/EmbedPluginCard.cjs.map +0 -1
- package/dist/browser/components/embed-card/card/EmbedPluginCard.js +0 -181
- package/dist/browser/components/embed-card/card/EmbedPluginCard.js.map +0 -1
- package/dist/browser/components/embed-card/card/index.cjs +0 -203
- package/dist/browser/components/embed-card/card/index.cjs.map +0 -1
- package/dist/browser/components/embed-card/card/index.js +0 -183
- package/dist/browser/components/embed-card/card/index.js.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs +0 -54
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +0 -33
- package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.cjs +0 -42
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.cjs.map +0 -1
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.js +0 -21
- package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.js.map +0 -1
- package/dist/browser/components/embed-card/error-handling/index.cjs +0 -57
- package/dist/browser/components/embed-card/error-handling/index.cjs.map +0 -1
- package/dist/browser/components/embed-card/error-handling/index.js +0 -34
- package/dist/browser/components/embed-card/error-handling/index.js.map +0 -1
- package/dist/browser/components/embed-card/index.cjs +0 -502
- package/dist/browser/components/embed-card/index.cjs.map +0 -1
- package/dist/browser/components/embed-card/index.js +0 -482
- package/dist/browser/components/embed-card/index.js.map +0 -1
- package/dist/browser/components/embed-card/menu/EmbedMenu.cjs +0 -68
- package/dist/browser/components/embed-card/menu/EmbedMenu.cjs.map +0 -1
- package/dist/browser/components/embed-card/menu/EmbedMenu.js +0 -47
- package/dist/browser/components/embed-card/menu/EmbedMenu.js.map +0 -1
- package/dist/browser/components/embed-card/menu/JsonMenuItem.cjs +0 -46
- package/dist/browser/components/embed-card/menu/JsonMenuItem.cjs.map +0 -1
- package/dist/browser/components/embed-card/menu/JsonMenuItem.js +0 -25
- package/dist/browser/components/embed-card/menu/JsonMenuItem.js.map +0 -1
- package/dist/browser/components/embed-card/menu/index.cjs +0 -70
- package/dist/browser/components/embed-card/menu/index.cjs.map +0 -1
- package/dist/browser/components/embed-card/menu/index.js +0 -47
- package/dist/browser/components/embed-card/menu/index.js.map +0 -1
- package/dist/browser/components/embed-plugin-stories/storyPayload.cjs +0 -47
- package/dist/browser/components/embed-plugin-stories/storyPayload.cjs.map +0 -1
- package/dist/browser/components/embed-plugin-stories/storyPayload.js +0 -26
- package/dist/browser/components/embed-plugin-stories/storyPayload.js.map +0 -1
- package/dist/browser/components/embed-plugin-stories/storyShared.cjs +0 -513
- package/dist/browser/components/embed-plugin-stories/storyShared.cjs.map +0 -1
- package/dist/browser/components/embed-plugin-stories/storyShared.js +0 -495
- package/dist/browser/components/embed-plugin-stories/storyShared.js.map +0 -1
- package/dist/browser/components/index.cjs +0 -503
- package/dist/browser/components/index.cjs.map +0 -1
- package/dist/browser/components/index.js +0 -483
- package/dist/browser/components/index.js.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePayload.cjs +0 -49
- package/dist/browser/components/validation-alerts/ValidatePayload.cjs.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePayload.js +0 -28
- package/dist/browser/components/validation-alerts/ValidatePayload.js.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePlugins.cjs +0 -57
- package/dist/browser/components/validation-alerts/ValidatePlugins.cjs.map +0 -1
- package/dist/browser/components/validation-alerts/ValidatePlugins.js +0 -36
- package/dist/browser/components/validation-alerts/ValidatePlugins.js.map +0 -1
- package/dist/browser/components/validation-alerts/index.cjs +0 -83
- package/dist/browser/components/validation-alerts/index.cjs.map +0 -1
- package/dist/browser/components/validation-alerts/index.js +0 -60
- package/dist/browser/components/validation-alerts/index.js.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Context.cjs +0 -28
- package/dist/browser/contexts/EmbedPluginContext/Context.cjs.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Context.js +0 -7
- package/dist/browser/contexts/EmbedPluginContext/Context.js.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Provider.cjs +0 -62
- package/dist/browser/contexts/EmbedPluginContext/Provider.cjs.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/Provider.js +0 -41
- package/dist/browser/contexts/EmbedPluginContext/Provider.js.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/State.cjs +0 -19
- package/dist/browser/contexts/EmbedPluginContext/State.cjs.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/State.js +0 -1
- package/dist/browser/contexts/EmbedPluginContext/State.js.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/index.cjs +0 -68
- package/dist/browser/contexts/EmbedPluginContext/index.cjs.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/index.js +0 -45
- package/dist/browser/contexts/EmbedPluginContext/index.js.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/use.cjs +0 -34
- package/dist/browser/contexts/EmbedPluginContext/use.cjs.map +0 -1
- package/dist/browser/contexts/EmbedPluginContext/use.js +0 -13
- package/dist/browser/contexts/EmbedPluginContext/use.js.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Context.cjs +0 -28
- package/dist/browser/contexts/RefreshPayloadContext/Context.cjs.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Context.js +0 -7
- package/dist/browser/contexts/RefreshPayloadContext/Context.js.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Provider.cjs +0 -38
- package/dist/browser/contexts/RefreshPayloadContext/Provider.cjs.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/Provider.js +0 -17
- package/dist/browser/contexts/RefreshPayloadContext/Provider.js.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/State.cjs +0 -19
- package/dist/browser/contexts/RefreshPayloadContext/State.cjs.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/State.js +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/State.js.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/index.cjs +0 -45
- package/dist/browser/contexts/RefreshPayloadContext/index.cjs.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/index.js +0 -22
- package/dist/browser/contexts/RefreshPayloadContext/index.js.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/use.cjs +0 -34
- package/dist/browser/contexts/RefreshPayloadContext/use.cjs.map +0 -1
- package/dist/browser/contexts/RefreshPayloadContext/use.js +0 -13
- package/dist/browser/contexts/RefreshPayloadContext/use.js.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Context.cjs +0 -28
- package/dist/browser/contexts/ResolvePayloadContext/Context.cjs.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Context.js +0 -7
- package/dist/browser/contexts/ResolvePayloadContext/Context.js.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Provider.cjs +0 -88
- package/dist/browser/contexts/ResolvePayloadContext/Provider.cjs.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/Provider.js +0 -67
- package/dist/browser/contexts/ResolvePayloadContext/Provider.js.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/State.cjs +0 -19
- package/dist/browser/contexts/ResolvePayloadContext/State.cjs.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/State.js +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/State.js.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/index.cjs +0 -96
- package/dist/browser/contexts/ResolvePayloadContext/index.cjs.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/index.js +0 -73
- package/dist/browser/contexts/ResolvePayloadContext/index.js.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/use.cjs +0 -34
- package/dist/browser/contexts/ResolvePayloadContext/use.cjs.map +0 -1
- package/dist/browser/contexts/ResolvePayloadContext/use.js +0 -13
- package/dist/browser/contexts/ResolvePayloadContext/use.js.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Context.cjs +0 -28
- package/dist/browser/contexts/ValidatePayloadContext/Context.cjs.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Context.js +0 -7
- package/dist/browser/contexts/ValidatePayloadContext/Context.js.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Provider.cjs +0 -66
- package/dist/browser/contexts/ValidatePayloadContext/Provider.cjs.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/Provider.js +0 -45
- package/dist/browser/contexts/ValidatePayloadContext/Provider.js.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/State.cjs +0 -19
- package/dist/browser/contexts/ValidatePayloadContext/State.cjs.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/State.js +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/State.js.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/index.cjs +0 -73
- package/dist/browser/contexts/ValidatePayloadContext/index.cjs.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/index.js +0 -50
- package/dist/browser/contexts/ValidatePayloadContext/index.js.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/use.cjs +0 -34
- package/dist/browser/contexts/ValidatePayloadContext/use.cjs.map +0 -1
- package/dist/browser/contexts/ValidatePayloadContext/use.js +0 -13
- package/dist/browser/contexts/ValidatePayloadContext/use.js.map +0 -1
- package/dist/browser/contexts/index.cjs +0 -189
- package/dist/browser/contexts/index.cjs.map +0 -1
- package/dist/browser/contexts/index.js +0 -166
- package/dist/browser/contexts/index.js.map +0 -1
- package/dist/browser/types/EmbedPluginProps.cjs +0 -19
- package/dist/browser/types/EmbedPluginProps.cjs.map +0 -1
- package/dist/browser/types/EmbedPluginProps.js +0 -1
- package/dist/browser/types/EmbedPluginProps.js.map +0 -1
- package/dist/browser/types/index.cjs +0 -19
- package/dist/browser/types/index.cjs.map +0 -1
- package/dist/browser/types/index.js +0 -1
- package/dist/browser/types/index.js.map +0 -1
- package/dist/node/components/EmbedPlugin.cjs +0 -255
- package/dist/node/components/EmbedPlugin.cjs.map +0 -1
- package/dist/node/components/EmbedPlugin.js +0 -230
- package/dist/node/components/EmbedPlugin.js.map +0 -1
- package/dist/node/components/EmbedResolver.cjs +0 -46
- package/dist/node/components/EmbedResolver.cjs.map +0 -1
- package/dist/node/components/EmbedResolver.js +0 -21
- package/dist/node/components/EmbedResolver.js.map +0 -1
- package/dist/node/components/controls/EmbedFormControl.cjs +0 -38
- package/dist/node/components/controls/EmbedFormControl.cjs.map +0 -1
- package/dist/node/components/controls/EmbedFormControl.js +0 -13
- package/dist/node/components/controls/EmbedFormControl.js.map +0 -1
- package/dist/node/components/controls/ListModeSelect.cjs +0 -70
- package/dist/node/components/controls/ListModeSelect.cjs.map +0 -1
- package/dist/node/components/controls/ListModeSelect.js +0 -44
- package/dist/node/components/controls/ListModeSelect.js.map +0 -1
- package/dist/node/components/controls/RenderSelect.cjs +0 -58
- package/dist/node/components/controls/RenderSelect.cjs.map +0 -1
- package/dist/node/components/controls/RenderSelect.js +0 -33
- package/dist/node/components/controls/RenderSelect.js.map +0 -1
- package/dist/node/components/controls/index.cjs +0 -94
- package/dist/node/components/controls/index.cjs.map +0 -1
- package/dist/node/components/controls/index.js +0 -64
- package/dist/node/components/controls/index.js.map +0 -1
- package/dist/node/components/embed-card/EmbedCardResolver.cjs +0 -99
- package/dist/node/components/embed-card/EmbedCardResolver.cjs.map +0 -1
- package/dist/node/components/embed-card/EmbedCardResolver.js +0 -74
- package/dist/node/components/embed-card/EmbedCardResolver.js.map +0 -1
- package/dist/node/components/embed-card/EmbedPluginCard.cjs +0 -505
- package/dist/node/components/embed-card/EmbedPluginCard.cjs.map +0 -1
- package/dist/node/components/embed-card/EmbedPluginCard.js +0 -481
- package/dist/node/components/embed-card/EmbedPluginCard.js.map +0 -1
- package/dist/node/components/embed-card/card/BusyCard.cjs +0 -49
- package/dist/node/components/embed-card/card/BusyCard.cjs.map +0 -1
- package/dist/node/components/embed-card/card/BusyCard.js +0 -27
- package/dist/node/components/embed-card/card/BusyCard.js.map +0 -1
- package/dist/node/components/embed-card/card/EmbedCardHeader.cjs +0 -113
- package/dist/node/components/embed-card/card/EmbedCardHeader.cjs.map +0 -1
- package/dist/node/components/embed-card/card/EmbedCardHeader.js +0 -88
- package/dist/node/components/embed-card/card/EmbedCardHeader.js.map +0 -1
- package/dist/node/components/embed-card/card/EmbedPluginCard.cjs +0 -205
- package/dist/node/components/embed-card/card/EmbedPluginCard.cjs.map +0 -1
- package/dist/node/components/embed-card/card/EmbedPluginCard.js +0 -183
- package/dist/node/components/embed-card/card/EmbedPluginCard.js.map +0 -1
- package/dist/node/components/embed-card/card/index.cjs +0 -211
- package/dist/node/components/embed-card/card/index.cjs.map +0 -1
- package/dist/node/components/embed-card/card/index.js +0 -185
- package/dist/node/components/embed-card/card/index.js.map +0 -1
- package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs +0 -58
- package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs.map +0 -1
- package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +0 -33
- package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +0 -1
- package/dist/node/components/embed-card/error-handling/EmbedErrorCard.cjs +0 -46
- package/dist/node/components/embed-card/error-handling/EmbedErrorCard.cjs.map +0 -1
- package/dist/node/components/embed-card/error-handling/EmbedErrorCard.js +0 -21
- package/dist/node/components/embed-card/error-handling/EmbedErrorCard.js.map +0 -1
- package/dist/node/components/embed-card/error-handling/index.cjs +0 -62
- package/dist/node/components/embed-card/error-handling/index.cjs.map +0 -1
- package/dist/node/components/embed-card/error-handling/index.js +0 -34
- package/dist/node/components/embed-card/error-handling/index.js.map +0 -1
- package/dist/node/components/embed-card/index.cjs +0 -513
- package/dist/node/components/embed-card/index.cjs.map +0 -1
- package/dist/node/components/embed-card/index.js +0 -484
- package/dist/node/components/embed-card/index.js.map +0 -1
- package/dist/node/components/embed-card/menu/EmbedMenu.cjs +0 -72
- package/dist/node/components/embed-card/menu/EmbedMenu.cjs.map +0 -1
- package/dist/node/components/embed-card/menu/EmbedMenu.js +0 -47
- package/dist/node/components/embed-card/menu/EmbedMenu.js.map +0 -1
- package/dist/node/components/embed-card/menu/JsonMenuItem.cjs +0 -50
- package/dist/node/components/embed-card/menu/JsonMenuItem.cjs.map +0 -1
- package/dist/node/components/embed-card/menu/JsonMenuItem.js +0 -25
- package/dist/node/components/embed-card/menu/JsonMenuItem.js.map +0 -1
- package/dist/node/components/embed-card/menu/index.cjs +0 -74
- package/dist/node/components/embed-card/menu/index.cjs.map +0 -1
- package/dist/node/components/embed-card/menu/index.js +0 -47
- package/dist/node/components/embed-card/menu/index.js.map +0 -1
- package/dist/node/components/embed-plugin-stories/storyPayload.cjs +0 -51
- package/dist/node/components/embed-plugin-stories/storyPayload.cjs.map +0 -1
- package/dist/node/components/embed-plugin-stories/storyPayload.js +0 -26
- package/dist/node/components/embed-plugin-stories/storyPayload.js.map +0 -1
- package/dist/node/components/embed-plugin-stories/storyShared.cjs +0 -520
- package/dist/node/components/embed-plugin-stories/storyShared.cjs.map +0 -1
- package/dist/node/components/embed-plugin-stories/storyShared.js +0 -497
- package/dist/node/components/embed-plugin-stories/storyShared.js.map +0 -1
- package/dist/node/components/index.cjs +0 -515
- package/dist/node/components/index.cjs.map +0 -1
- package/dist/node/components/index.js +0 -485
- package/dist/node/components/index.js.map +0 -1
- package/dist/node/components/validation-alerts/ValidatePayload.cjs +0 -53
- package/dist/node/components/validation-alerts/ValidatePayload.cjs.map +0 -1
- package/dist/node/components/validation-alerts/ValidatePayload.js +0 -28
- package/dist/node/components/validation-alerts/ValidatePayload.js.map +0 -1
- package/dist/node/components/validation-alerts/ValidatePlugins.cjs +0 -61
- package/dist/node/components/validation-alerts/ValidatePlugins.cjs.map +0 -1
- package/dist/node/components/validation-alerts/ValidatePlugins.js +0 -36
- package/dist/node/components/validation-alerts/ValidatePlugins.js.map +0 -1
- package/dist/node/components/validation-alerts/index.cjs +0 -88
- package/dist/node/components/validation-alerts/index.cjs.map +0 -1
- package/dist/node/components/validation-alerts/index.js +0 -60
- package/dist/node/components/validation-alerts/index.js.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/Context.cjs +0 -32
- package/dist/node/contexts/EmbedPluginContext/Context.cjs.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/Context.js +0 -7
- package/dist/node/contexts/EmbedPluginContext/Context.js.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/Provider.cjs +0 -66
- package/dist/node/contexts/EmbedPluginContext/Provider.cjs.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/Provider.js +0 -41
- package/dist/node/contexts/EmbedPluginContext/Provider.js.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/State.cjs +0 -19
- package/dist/node/contexts/EmbedPluginContext/State.cjs.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/State.js +0 -1
- package/dist/node/contexts/EmbedPluginContext/State.js.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/index.cjs +0 -74
- package/dist/node/contexts/EmbedPluginContext/index.cjs.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/index.js +0 -45
- package/dist/node/contexts/EmbedPluginContext/index.js.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/use.cjs +0 -38
- package/dist/node/contexts/EmbedPluginContext/use.cjs.map +0 -1
- package/dist/node/contexts/EmbedPluginContext/use.js +0 -13
- package/dist/node/contexts/EmbedPluginContext/use.js.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/Context.cjs +0 -32
- package/dist/node/contexts/RefreshPayloadContext/Context.cjs.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/Context.js +0 -7
- package/dist/node/contexts/RefreshPayloadContext/Context.js.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/Provider.cjs +0 -42
- package/dist/node/contexts/RefreshPayloadContext/Provider.cjs.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/Provider.js +0 -17
- package/dist/node/contexts/RefreshPayloadContext/Provider.js.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/State.cjs +0 -19
- package/dist/node/contexts/RefreshPayloadContext/State.cjs.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/State.js +0 -1
- package/dist/node/contexts/RefreshPayloadContext/State.js.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/index.cjs +0 -50
- package/dist/node/contexts/RefreshPayloadContext/index.cjs.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/index.js +0 -22
- package/dist/node/contexts/RefreshPayloadContext/index.js.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/use.cjs +0 -38
- package/dist/node/contexts/RefreshPayloadContext/use.cjs.map +0 -1
- package/dist/node/contexts/RefreshPayloadContext/use.js +0 -13
- package/dist/node/contexts/RefreshPayloadContext/use.js.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/Context.cjs +0 -32
- package/dist/node/contexts/ResolvePayloadContext/Context.cjs.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/Context.js +0 -7
- package/dist/node/contexts/ResolvePayloadContext/Context.js.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/Provider.cjs +0 -92
- package/dist/node/contexts/ResolvePayloadContext/Provider.cjs.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/Provider.js +0 -67
- package/dist/node/contexts/ResolvePayloadContext/Provider.js.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/State.cjs +0 -19
- package/dist/node/contexts/ResolvePayloadContext/State.cjs.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/State.js +0 -1
- package/dist/node/contexts/ResolvePayloadContext/State.js.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/index.cjs +0 -102
- package/dist/node/contexts/ResolvePayloadContext/index.cjs.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/index.js +0 -73
- package/dist/node/contexts/ResolvePayloadContext/index.js.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/use.cjs +0 -38
- package/dist/node/contexts/ResolvePayloadContext/use.cjs.map +0 -1
- package/dist/node/contexts/ResolvePayloadContext/use.js +0 -13
- package/dist/node/contexts/ResolvePayloadContext/use.js.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/Context.cjs +0 -32
- package/dist/node/contexts/ValidatePayloadContext/Context.cjs.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/Context.js +0 -7
- package/dist/node/contexts/ValidatePayloadContext/Context.js.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/Provider.cjs +0 -70
- package/dist/node/contexts/ValidatePayloadContext/Provider.cjs.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/Provider.js +0 -45
- package/dist/node/contexts/ValidatePayloadContext/Provider.js.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/State.cjs +0 -19
- package/dist/node/contexts/ValidatePayloadContext/State.cjs.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/State.js +0 -1
- package/dist/node/contexts/ValidatePayloadContext/State.js.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/index.cjs +0 -78
- package/dist/node/contexts/ValidatePayloadContext/index.cjs.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/index.js +0 -50
- package/dist/node/contexts/ValidatePayloadContext/index.js.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/use.cjs +0 -38
- package/dist/node/contexts/ValidatePayloadContext/use.cjs.map +0 -1
- package/dist/node/contexts/ValidatePayloadContext/use.js +0 -13
- package/dist/node/contexts/ValidatePayloadContext/use.js.map +0 -1
- package/dist/node/contexts/index.cjs +0 -202
- package/dist/node/contexts/index.cjs.map +0 -1
- package/dist/node/contexts/index.js +0 -166
- package/dist/node/contexts/index.js.map +0 -1
- package/dist/node/types/EmbedPluginProps.cjs +0 -19
- package/dist/node/types/EmbedPluginProps.cjs.map +0 -1
- package/dist/node/types/EmbedPluginProps.js +0 -1
- package/dist/node/types/EmbedPluginProps.js.map +0 -1
- package/dist/node/types/index.cjs +0 -19
- package/dist/node/types/index.cjs.map +0 -1
- package/dist/node/types/index.js +0 -1
- package/dist/node/types/index.js.map +0 -1
@@ -1,67 +0,0 @@
|
|
1
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
2
|
-
import { delay } from "@xylabs/delay";
|
3
|
-
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
4
|
-
import { Huri } from "@xyo-network/huri";
|
5
|
-
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
6
|
-
import { useEffect, useState } from "react";
|
7
|
-
|
8
|
-
// src/contexts/RefreshPayloadContext/Context.tsx
|
9
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
10
|
-
var RefreshPayloadContext = createContextEx();
|
11
|
-
|
12
|
-
// src/contexts/RefreshPayloadContext/use.tsx
|
13
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
14
|
-
var useRefreshPayload = () => useContextEx(RefreshPayloadContext, "RefreshPayload", true);
|
15
|
-
|
16
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
17
|
-
import { createContextEx as createContextEx2 } from "@xyo-network/react-shared";
|
18
|
-
var ResolvePayloadContext = createContextEx2();
|
19
|
-
|
20
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
21
|
-
import { jsx } from "react/jsx-runtime";
|
22
|
-
var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
23
|
-
const [payload, setPayload] = useState();
|
24
|
-
const [huri, setHuri] = useState();
|
25
|
-
const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload();
|
26
|
-
useEffect(() => {
|
27
|
-
typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
|
28
|
-
if (typeof huriPayload === "object") {
|
29
|
-
setPayload(huriPayload);
|
30
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
31
|
-
}
|
32
|
-
}, [huriPayload, setRefreshPayload]);
|
33
|
-
const [notFound, setNotFound] = useState();
|
34
|
-
const [huriError, setHuriError] = useState();
|
35
|
-
useAsyncEffect(
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
37
|
-
async (mounted) => {
|
38
|
-
if (huri && !refreshPayload) {
|
39
|
-
try {
|
40
|
-
const huriInstance = new Huri(huri);
|
41
|
-
const result = await huriInstance.fetch();
|
42
|
-
await delay(500);
|
43
|
-
if (mounted()) {
|
44
|
-
setNotFound(result === null);
|
45
|
-
setPayload(result);
|
46
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
47
|
-
}
|
48
|
-
} catch (e) {
|
49
|
-
const error = e;
|
50
|
-
setHuriError({ message: error.message, schema: ModuleErrorSchema, sources: [] });
|
51
|
-
}
|
52
|
-
}
|
53
|
-
},
|
54
|
-
[huri, payload, refreshPayload, setRefreshPayload]
|
55
|
-
);
|
56
|
-
const refreshHuri = () => {
|
57
|
-
onRefresh == null ? void 0 : onRefresh();
|
58
|
-
if (huri) {
|
59
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(false);
|
60
|
-
}
|
61
|
-
};
|
62
|
-
return /* @__PURE__ */ jsx(ResolvePayloadContext.Provider, { value: { huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }, children });
|
63
|
-
};
|
64
|
-
export {
|
65
|
-
ResolvePayloadProvider
|
66
|
-
};
|
67
|
-
//# sourceMappingURL=Provider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/Provider.tsx","../../../../src/contexts/RefreshPayloadContext/Context.tsx","../../../../src/contexts/RefreshPayloadContext/use.tsx","../../../../src/contexts/ResolvePayloadContext/Context.ts"],"sourcesContent":["import { delay } from '@xylabs/delay'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { Huri } from '@xyo-network/huri'\nimport { ModuleError, ModuleErrorSchema, Payload } from '@xyo-network/payload-model'\nimport { useEffect, useState } from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext'\nimport { ResolvePayloadContext } from './Context'\nimport { ResolvePayloadState } from './State'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload()\n\n useEffect(() => {\n typeof huriPayload === 'string' ? setHuri(huriPayload) : undefined\n if (typeof huriPayload === 'object') {\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n }, [huriPayload, setRefreshPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<ModuleError>()\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (huri && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\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({ message: error.message, schema: ModuleErrorSchema, sources: [] })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = () => {\n onRefresh?.()\n if (huri) {\n setRefreshPayload?.(false)\n }\n }\n\n return (\n <ResolvePayloadContext.Provider value={{ huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }}>\n {children}\n </ResolvePayloadContext.Provider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadState } from './State'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadContext } from './Context'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAE/B,SAAS,YAAY;AACrB,SAAsB,yBAAkC;AACxD,SAAS,WAAW,gBAAgB;;;ACLpC,SAAS,uBAAuB;AAIzB,IAAM,wBAAwB,gBAAqC;;;ACJ1E,SAAS,oBAAoB;AAItB,IAAM,oBAAoB,MAAM,aAAa,uBAAuB,kBAAkB,IAAI;;;ACJjG,SAAS,mBAAAA,wBAAuB;AAIzB,IAAM,wBAAwBA,iBAAqC;;;AHyDtE;AAhDG,IAAM,yBAA8E,CAAC,EAAE,UAAU,YAAY,MAAM;AACxH,QAAM,CAAC,SAAS,UAAU,IAAI,SAAkB;AAChD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAiB;AACzC,QAAM,EAAE,gBAAgB,mBAAmB,UAAU,IAAI,kBAAkB;AAE3E,YAAU,MAAM;AACd,WAAO,gBAAgB,WAAW,QAAQ,WAAW,IAAI;AACzD,QAAI,OAAO,gBAAgB,UAAU;AACnC,iBAAW,WAAW;AACtB,6DAAoB;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,aAAa,iBAAiB,CAAC;AAEnC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB;AAClD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAsB;AAExD;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,CAAC,gBAAgB;AAC3B,YAAI;AACF,gBAAM,eAAe,IAAI,KAAK,IAAI;AAClC,gBAAM,SAAS,MAAM,aAAa,MAAM;AAExC,gBAAM,MAAM,GAAG;AAEf,cAAI,QAAQ,GAAG;AACb,wBAAY,WAAW,IAAI;AAC3B,uBAAW,MAAM;AACjB,mEAAoB;AAAA,UACtB;AAAA,QACF,SAAS,GAAG;AACV,gBAAM,QAAQ;AACd,uBAAa,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE,CAAC;AAAA,QACjF;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,gBAAgB,iBAAiB;AAAA,EACnD;AAEA,QAAM,cAAc,MAAM;AACxB;AACA,QAAI,MAAM;AACR,6DAAoB;AAAA,IACtB;AAAA,EACF;AAEA,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,MAAM,WAAW,UAAU,SAAS,UAAU,MAAM,aAAa,WAAW,GAClH,UACH;AAEJ;","names":["createContextEx"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
-
for (let key of __getOwnPropNames(from))
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
-
}
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
15
|
-
|
16
|
-
// src/contexts/ResolvePayloadContext/State.ts
|
17
|
-
var State_exports = {};
|
18
|
-
module.exports = __toCommonJS(State_exports);
|
19
|
-
//# sourceMappingURL=State.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/State.ts"],"sourcesContent":["import { ModuleError, Payload } from '@xyo-network/payload-model'\nimport { ContextExState } from '@xyo-network/react-shared'\nimport { Dispatch, SetStateAction } from 'react'\n\nexport interface ResolvePayloadState extends ContextExState {\n huri?: string\n huriError?: ModuleError\n huriPayload?: string | Payload\n notFound?: boolean\n payload?: Payload\n refreshHuri?: () => void\n setPayload?: Dispatch<SetStateAction<Payload | undefined>>\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
//# sourceMappingURL=State.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -1,102 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ResolvePayloadContext/index.ts
|
21
|
-
var ResolvePayloadContext_exports = {};
|
22
|
-
__export(ResolvePayloadContext_exports, {
|
23
|
-
ResolvePayloadContext: () => ResolvePayloadContext,
|
24
|
-
ResolvePayloadProvider: () => ResolvePayloadProvider,
|
25
|
-
useResolvePayload: () => useResolvePayload
|
26
|
-
});
|
27
|
-
module.exports = __toCommonJS(ResolvePayloadContext_exports);
|
28
|
-
|
29
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
30
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
31
|
-
var ResolvePayloadContext = (0, import_react_shared.createContextEx)();
|
32
|
-
|
33
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
34
|
-
var import_delay = require("@xylabs/delay");
|
35
|
-
var import_react_async_effect = require("@xylabs/react-async-effect");
|
36
|
-
var import_huri = require("@xyo-network/huri");
|
37
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
38
|
-
var import_react = require("react");
|
39
|
-
|
40
|
-
// src/contexts/RefreshPayloadContext/Context.tsx
|
41
|
-
var import_react_shared2 = require("@xyo-network/react-shared");
|
42
|
-
var RefreshPayloadContext = (0, import_react_shared2.createContextEx)();
|
43
|
-
|
44
|
-
// src/contexts/RefreshPayloadContext/use.tsx
|
45
|
-
var import_react_shared3 = require("@xyo-network/react-shared");
|
46
|
-
var useRefreshPayload = () => (0, import_react_shared3.useContextEx)(RefreshPayloadContext, "RefreshPayload", true);
|
47
|
-
|
48
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
49
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
50
|
-
var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
51
|
-
const [payload, setPayload] = (0, import_react.useState)();
|
52
|
-
const [huri, setHuri] = (0, import_react.useState)();
|
53
|
-
const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload();
|
54
|
-
(0, import_react.useEffect)(() => {
|
55
|
-
typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
|
56
|
-
if (typeof huriPayload === "object") {
|
57
|
-
setPayload(huriPayload);
|
58
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
59
|
-
}
|
60
|
-
}, [huriPayload, setRefreshPayload]);
|
61
|
-
const [notFound, setNotFound] = (0, import_react.useState)();
|
62
|
-
const [huriError, setHuriError] = (0, import_react.useState)();
|
63
|
-
(0, import_react_async_effect.useAsyncEffect)(
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
65
|
-
async (mounted) => {
|
66
|
-
if (huri && !refreshPayload) {
|
67
|
-
try {
|
68
|
-
const huriInstance = new import_huri.Huri(huri);
|
69
|
-
const result = await huriInstance.fetch();
|
70
|
-
await (0, import_delay.delay)(500);
|
71
|
-
if (mounted()) {
|
72
|
-
setNotFound(result === null);
|
73
|
-
setPayload(result);
|
74
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
75
|
-
}
|
76
|
-
} catch (e) {
|
77
|
-
const error = e;
|
78
|
-
setHuriError({ message: error.message, schema: import_payload_model.ModuleErrorSchema, sources: [] });
|
79
|
-
}
|
80
|
-
}
|
81
|
-
},
|
82
|
-
[huri, payload, refreshPayload, setRefreshPayload]
|
83
|
-
);
|
84
|
-
const refreshHuri = () => {
|
85
|
-
onRefresh == null ? void 0 : onRefresh();
|
86
|
-
if (huri) {
|
87
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(false);
|
88
|
-
}
|
89
|
-
};
|
90
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResolvePayloadContext.Provider, { value: { huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }, children });
|
91
|
-
};
|
92
|
-
|
93
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
94
|
-
var import_react_shared4 = require("@xyo-network/react-shared");
|
95
|
-
var useResolvePayload = () => (0, import_react_shared4.useContextEx)(ResolvePayloadContext, "ResolvePayload", true);
|
96
|
-
// Annotate the CommonJS export names for ESM import in node:
|
97
|
-
0 && (module.exports = {
|
98
|
-
ResolvePayloadContext,
|
99
|
-
ResolvePayloadProvider,
|
100
|
-
useResolvePayload
|
101
|
-
});
|
102
|
-
//# sourceMappingURL=index.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/index.ts","../../../../src/contexts/ResolvePayloadContext/Context.ts","../../../../src/contexts/ResolvePayloadContext/Provider.tsx","../../../../src/contexts/RefreshPayloadContext/Context.tsx","../../../../src/contexts/RefreshPayloadContext/use.tsx","../../../../src/contexts/ResolvePayloadContext/use.tsx"],"sourcesContent":["export * from './Context'\nexport * from './Provider'\nexport * from './State'\nexport * from './use'\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","import { delay } from '@xylabs/delay'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { Huri } from '@xyo-network/huri'\nimport { ModuleError, ModuleErrorSchema, Payload } from '@xyo-network/payload-model'\nimport { useEffect, useState } from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext'\nimport { ResolvePayloadContext } from './Context'\nimport { ResolvePayloadState } from './State'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload()\n\n useEffect(() => {\n typeof huriPayload === 'string' ? setHuri(huriPayload) : undefined\n if (typeof huriPayload === 'object') {\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n }, [huriPayload, setRefreshPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<ModuleError>()\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (huri && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\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({ message: error.message, schema: ModuleErrorSchema, sources: [] })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = () => {\n onRefresh?.()\n if (huri) {\n setRefreshPayload?.(false)\n }\n }\n\n return (\n <ResolvePayloadContext.Provider value={{ huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }}>\n {children}\n </ResolvePayloadContext.Provider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadState } from './State'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadContext } from './Context'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAgC;AAIzB,IAAM,4BAAwB,qCAAqC;;;ACJ1E,mBAAsB;AACtB,gCAA+B;AAE/B,kBAAqB;AACrB,2BAAwD;AACxD,mBAAoC;;;ACLpC,IAAAA,uBAAgC;AAIzB,IAAM,4BAAwB,sCAAqC;;;ACJ1E,IAAAC,uBAA6B;AAItB,IAAM,oBAAoB,UAAM,mCAAa,uBAAuB,kBAAkB,IAAI;;;AFyD7F;AAhDG,IAAM,yBAA8E,CAAC,EAAE,UAAU,YAAY,MAAM;AACxH,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAkB;AAChD,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAiB;AACzC,QAAM,EAAE,gBAAgB,mBAAmB,UAAU,IAAI,kBAAkB;AAE3E,8BAAU,MAAM;AACd,WAAO,gBAAgB,WAAW,QAAQ,WAAW,IAAI;AACzD,QAAI,OAAO,gBAAgB,UAAU;AACnC,iBAAW,WAAW;AACtB,6DAAoB;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,aAAa,iBAAiB,CAAC;AAEnC,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAkB;AAClD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAsB;AAExD;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,CAAC,gBAAgB;AAC3B,YAAI;AACF,gBAAM,eAAe,IAAI,iBAAK,IAAI;AAClC,gBAAM,SAAS,MAAM,aAAa,MAAM;AAExC,oBAAM,oBAAM,GAAG;AAEf,cAAI,QAAQ,GAAG;AACb,wBAAY,WAAW,IAAI;AAC3B,uBAAW,MAAM;AACjB,mEAAoB;AAAA,UACtB;AAAA,QACF,SAAS,GAAG;AACV,gBAAM,QAAQ;AACd,uBAAa,EAAE,SAAS,MAAM,SAAS,QAAQ,wCAAmB,SAAS,CAAC,EAAE,CAAC;AAAA,QACjF;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,gBAAgB,iBAAiB;AAAA,EACnD;AAEA,QAAM,cAAc,MAAM;AACxB;AACA,QAAI,MAAM;AACR,6DAAoB;AAAA,IACtB;AAAA,EACF;AAEA,SACE,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,MAAM,WAAW,UAAU,SAAS,UAAU,MAAM,aAAa,WAAW,GAClH,UACH;AAEJ;;;AGjEA,IAAAC,uBAA6B;AAItB,IAAM,oBAAoB,UAAM,mCAAa,uBAAuB,kBAAkB,IAAI;","names":["import_react_shared","import_react_shared","import_react_shared"]}
|
@@ -1,73 +0,0 @@
|
|
1
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
2
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
3
|
-
var ResolvePayloadContext = createContextEx();
|
4
|
-
|
5
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
6
|
-
import { delay } from "@xylabs/delay";
|
7
|
-
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
8
|
-
import { Huri } from "@xyo-network/huri";
|
9
|
-
import { ModuleErrorSchema } from "@xyo-network/payload-model";
|
10
|
-
import { useEffect, useState } from "react";
|
11
|
-
|
12
|
-
// src/contexts/RefreshPayloadContext/Context.tsx
|
13
|
-
import { createContextEx as createContextEx2 } from "@xyo-network/react-shared";
|
14
|
-
var RefreshPayloadContext = createContextEx2();
|
15
|
-
|
16
|
-
// src/contexts/RefreshPayloadContext/use.tsx
|
17
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
18
|
-
var useRefreshPayload = () => useContextEx(RefreshPayloadContext, "RefreshPayload", true);
|
19
|
-
|
20
|
-
// src/contexts/ResolvePayloadContext/Provider.tsx
|
21
|
-
import { jsx } from "react/jsx-runtime";
|
22
|
-
var ResolvePayloadProvider = ({ children, huriPayload }) => {
|
23
|
-
const [payload, setPayload] = useState();
|
24
|
-
const [huri, setHuri] = useState();
|
25
|
-
const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload();
|
26
|
-
useEffect(() => {
|
27
|
-
typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
|
28
|
-
if (typeof huriPayload === "object") {
|
29
|
-
setPayload(huriPayload);
|
30
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
31
|
-
}
|
32
|
-
}, [huriPayload, setRefreshPayload]);
|
33
|
-
const [notFound, setNotFound] = useState();
|
34
|
-
const [huriError, setHuriError] = useState();
|
35
|
-
useAsyncEffect(
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
37
|
-
async (mounted) => {
|
38
|
-
if (huri && !refreshPayload) {
|
39
|
-
try {
|
40
|
-
const huriInstance = new Huri(huri);
|
41
|
-
const result = await huriInstance.fetch();
|
42
|
-
await delay(500);
|
43
|
-
if (mounted()) {
|
44
|
-
setNotFound(result === null);
|
45
|
-
setPayload(result);
|
46
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(true);
|
47
|
-
}
|
48
|
-
} catch (e) {
|
49
|
-
const error = e;
|
50
|
-
setHuriError({ message: error.message, schema: ModuleErrorSchema, sources: [] });
|
51
|
-
}
|
52
|
-
}
|
53
|
-
},
|
54
|
-
[huri, payload, refreshPayload, setRefreshPayload]
|
55
|
-
);
|
56
|
-
const refreshHuri = () => {
|
57
|
-
onRefresh == null ? void 0 : onRefresh();
|
58
|
-
if (huri) {
|
59
|
-
setRefreshPayload == null ? void 0 : setRefreshPayload(false);
|
60
|
-
}
|
61
|
-
};
|
62
|
-
return /* @__PURE__ */ jsx(ResolvePayloadContext.Provider, { value: { huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }, children });
|
63
|
-
};
|
64
|
-
|
65
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
66
|
-
import { useContextEx as useContextEx2 } from "@xyo-network/react-shared";
|
67
|
-
var useResolvePayload = () => useContextEx2(ResolvePayloadContext, "ResolvePayload", true);
|
68
|
-
export {
|
69
|
-
ResolvePayloadContext,
|
70
|
-
ResolvePayloadProvider,
|
71
|
-
useResolvePayload
|
72
|
-
};
|
73
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/Context.ts","../../../../src/contexts/ResolvePayloadContext/Provider.tsx","../../../../src/contexts/RefreshPayloadContext/Context.tsx","../../../../src/contexts/RefreshPayloadContext/use.tsx","../../../../src/contexts/ResolvePayloadContext/use.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","import { delay } from '@xylabs/delay'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { Huri } from '@xyo-network/huri'\nimport { ModuleError, ModuleErrorSchema, Payload } from '@xyo-network/payload-model'\nimport { useEffect, useState } from 'react'\n\nimport { useRefreshPayload } from '../RefreshPayloadContext'\nimport { ResolvePayloadContext } from './Context'\nimport { ResolvePayloadState } from './State'\n\nexport type ResolvePayloadProviderProps = Omit<ResolvePayloadState, 'provided'>\n\nexport const ResolvePayloadProvider: React.FC<WithChildren<ResolvePayloadProviderProps>> = ({ children, huriPayload }) => {\n const [payload, setPayload] = useState<Payload>()\n const [huri, setHuri] = useState<string>()\n const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload()\n\n useEffect(() => {\n typeof huriPayload === 'string' ? setHuri(huriPayload) : undefined\n if (typeof huriPayload === 'object') {\n setPayload(huriPayload)\n setRefreshPayload?.(true)\n }\n }, [huriPayload, setRefreshPayload])\n\n const [notFound, setNotFound] = useState<boolean>()\n const [huriError, setHuriError] = useState<ModuleError>()\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (huri && !refreshPayload) {\n try {\n const huriInstance = new Huri(huri)\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({ message: error.message, schema: ModuleErrorSchema, sources: [] })\n }\n }\n },\n [huri, payload, refreshPayload, setRefreshPayload],\n )\n\n const refreshHuri = () => {\n onRefresh?.()\n if (huri) {\n setRefreshPayload?.(false)\n }\n }\n\n return (\n <ResolvePayloadContext.Provider value={{ huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }}>\n {children}\n </ResolvePayloadContext.Provider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadState } from './State'\n\nexport const RefreshPayloadContext = createContextEx<RefreshPayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { RefreshPayloadContext } from './Context'\n\nexport const useRefreshPayload = () => useContextEx(RefreshPayloadContext, 'RefreshPayload', true)\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n"],"mappings":";AAAA,SAAS,uBAAuB;AAIzB,IAAM,wBAAwB,gBAAqC;;;ACJ1E,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAE/B,SAAS,YAAY;AACrB,SAAsB,yBAAkC;AACxD,SAAS,WAAW,gBAAgB;;;ACLpC,SAAS,mBAAAA,wBAAuB;AAIzB,IAAM,wBAAwBA,iBAAqC;;;ACJ1E,SAAS,oBAAoB;AAItB,IAAM,oBAAoB,MAAM,aAAa,uBAAuB,kBAAkB,IAAI;;;AFyD7F;AAhDG,IAAM,yBAA8E,CAAC,EAAE,UAAU,YAAY,MAAM;AACxH,QAAM,CAAC,SAAS,UAAU,IAAI,SAAkB;AAChD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAiB;AACzC,QAAM,EAAE,gBAAgB,mBAAmB,UAAU,IAAI,kBAAkB;AAE3E,YAAU,MAAM;AACd,WAAO,gBAAgB,WAAW,QAAQ,WAAW,IAAI;AACzD,QAAI,OAAO,gBAAgB,UAAU;AACnC,iBAAW,WAAW;AACtB,6DAAoB;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,aAAa,iBAAiB,CAAC;AAEnC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB;AAClD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAsB;AAExD;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,CAAC,gBAAgB;AAC3B,YAAI;AACF,gBAAM,eAAe,IAAI,KAAK,IAAI;AAClC,gBAAM,SAAS,MAAM,aAAa,MAAM;AAExC,gBAAM,MAAM,GAAG;AAEf,cAAI,QAAQ,GAAG;AACb,wBAAY,WAAW,IAAI;AAC3B,uBAAW,MAAM;AACjB,mEAAoB;AAAA,UACtB;AAAA,QACF,SAAS,GAAG;AACV,gBAAM,QAAQ;AACd,uBAAa,EAAE,SAAS,MAAM,SAAS,QAAQ,mBAAmB,SAAS,CAAC,EAAE,CAAC;AAAA,QACjF;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,gBAAgB,iBAAiB;AAAA,EACnD;AAEA,QAAM,cAAc,MAAM;AACxB;AACA,QAAI,MAAM;AACR,6DAAoB;AAAA,IACtB;AAAA,EACF;AAEA,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,MAAM,WAAW,UAAU,SAAS,UAAU,MAAM,aAAa,WAAW,GAClH,UACH;AAEJ;;;AGjEA,SAAS,gBAAAC,qBAAoB;AAItB,IAAM,oBAAoB,MAAMC,cAAa,uBAAuB,kBAAkB,IAAI;","names":["createContextEx","useContextEx","useContextEx"]}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
21
|
-
var use_exports = {};
|
22
|
-
__export(use_exports, {
|
23
|
-
useResolvePayload: () => useResolvePayload
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(use_exports);
|
26
|
-
var import_react_shared2 = require("@xyo-network/react-shared");
|
27
|
-
|
28
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
29
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
30
|
-
var ResolvePayloadContext = (0, import_react_shared.createContextEx)();
|
31
|
-
|
32
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
33
|
-
var useResolvePayload = () => (0, import_react_shared2.useContextEx)(ResolvePayloadContext, "ResolvePayload", true);
|
34
|
-
// Annotate the CommonJS export names for ESM import in node:
|
35
|
-
0 && (module.exports = {
|
36
|
-
useResolvePayload
|
37
|
-
});
|
38
|
-
//# sourceMappingURL=use.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/use.tsx","../../../../src/contexts/ResolvePayloadContext/Context.ts"],"sourcesContent":["import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAA6B;;;ACA7B,0BAAgC;AAIzB,IAAM,4BAAwB,qCAAqC;;;ADAnE,IAAM,oBAAoB,UAAM,mCAAa,uBAAuB,kBAAkB,IAAI;","names":["import_react_shared"]}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
2
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
3
|
-
|
4
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
5
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
6
|
-
var ResolvePayloadContext = createContextEx();
|
7
|
-
|
8
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
9
|
-
var useResolvePayload = () => useContextEx(ResolvePayloadContext, "ResolvePayload", true);
|
10
|
-
export {
|
11
|
-
useResolvePayload
|
12
|
-
};
|
13
|
-
//# sourceMappingURL=use.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ResolvePayloadContext/use.tsx","../../../../src/contexts/ResolvePayloadContext/Context.ts"],"sourcesContent":["import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n"],"mappings":";AAAA,SAAS,oBAAoB;;;ACA7B,SAAS,uBAAuB;AAIzB,IAAM,wBAAwB,gBAAqC;;;ADAnE,IAAM,oBAAoB,MAAM,aAAa,uBAAuB,kBAAkB,IAAI;","names":[]}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ValidatePayloadContext/Context.ts
|
21
|
-
var Context_exports = {};
|
22
|
-
__export(Context_exports, {
|
23
|
-
ValidatePayloadContext: () => ValidatePayloadContext
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(Context_exports);
|
26
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
27
|
-
var ValidatePayloadContext = (0, import_react_shared.createContextEx)();
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
29
|
-
0 && (module.exports = {
|
30
|
-
ValidatePayloadContext
|
31
|
-
});
|
32
|
-
//# sourceMappingURL=Context.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ValidatePayloadContext/Context.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC;AAIzB,IAAM,6BAAyB,qCAAsC;","names":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ValidatePayloadContext/Context.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n"],"mappings":";AAAA,SAAS,uBAAuB;AAIzB,IAAM,yBAAyB,gBAAsC;","names":[]}
|
@@ -1,70 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
|
20
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
21
|
-
var Provider_exports = {};
|
22
|
-
__export(Provider_exports, {
|
23
|
-
ValidatePayloadProvider: () => ValidatePayloadProvider
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(Provider_exports);
|
26
|
-
var import_material = require("@mui/material");
|
27
|
-
var import_react_async_effect = require("@xylabs/react-async-effect");
|
28
|
-
var import_schema_cache = require("@xyo-network/schema-cache");
|
29
|
-
var import_react = require("react");
|
30
|
-
|
31
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
32
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
33
|
-
var ResolvePayloadContext = (0, import_react_shared.createContextEx)();
|
34
|
-
|
35
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
36
|
-
var import_react_shared2 = require("@xyo-network/react-shared");
|
37
|
-
var useResolvePayload = () => (0, import_react_shared2.useContextEx)(ResolvePayloadContext, "ResolvePayload", true);
|
38
|
-
|
39
|
-
// src/contexts/ValidatePayloadContext/Context.ts
|
40
|
-
var import_react_shared3 = require("@xyo-network/react-shared");
|
41
|
-
var ValidatePayloadContext = (0, import_react_shared3.createContextEx)();
|
42
|
-
|
43
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
44
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
45
|
-
var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
46
|
-
const { payload } = useResolvePayload();
|
47
|
-
const [initialized, setInitialized] = (0, import_react.useState)(false);
|
48
|
-
const [valid, setValid] = (0, import_react.useState)();
|
49
|
-
(0, import_react_async_effect.useAsyncEffect)(
|
50
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
51
|
-
async () => {
|
52
|
-
if (payload && enabled) {
|
53
|
-
await import_schema_cache.SchemaCache.instance.get(payload.schema);
|
54
|
-
const possibleKnownSchema = payload.schema;
|
55
|
-
if (import_schema_cache.SchemaCache.instance.validators[possibleKnownSchema]) {
|
56
|
-
const validator = import_schema_cache.SchemaCache.instance.validators[possibleKnownSchema];
|
57
|
-
setValid(validator == null ? void 0 : validator(payload));
|
58
|
-
}
|
59
|
-
setInitialized(true);
|
60
|
-
}
|
61
|
-
},
|
62
|
-
[payload, enabled]
|
63
|
-
);
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ValidatePayloadContext.Provider, { value: { enabled, provided: true, schema: payload == null ? void 0 : payload.schema, validPayload: valid }, children: enabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: initialized ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Chip, { label: "Validating Payload..." }) }) : children });
|
65
|
-
};
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
67
|
-
0 && (module.exports = {
|
68
|
-
ValidatePayloadProvider
|
69
|
-
});
|
70
|
-
//# sourceMappingURL=Provider.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ValidatePayloadContext/Provider.tsx","../../../../src/contexts/ResolvePayloadContext/Context.ts","../../../../src/contexts/ResolvePayloadContext/use.tsx","../../../../src/contexts/ValidatePayloadContext/Context.ts"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { SchemaCache, SchemaNameToValidatorMap } from '@xyo-network/schema-cache'\nimport { useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext'\nimport { ValidatePayloadContext } from './Context'\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<WithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n const [valid, setValid] = useState<boolean>()\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n return (\n <ValidatePayloadContext.Provider value={{ enabled, provided: true, schema: payload?.schema, validPayload: valid }}>\n {enabled ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</> : children}\n </ValidatePayloadContext.Provider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqB;AACrB,gCAA+B;AAE/B,0BAAsD;AACtD,mBAAyB;;;ACJzB,0BAAgC;AAIzB,IAAM,4BAAwB,qCAAqC;;;ACJ1E,IAAAA,uBAA6B;AAItB,IAAM,oBAAoB,UAAM,mCAAa,uBAAuB,kBAAkB,IAAI;;;ACJjG,IAAAC,uBAAgC;AAIzB,IAAM,6BAAyB,sCAAsC;;;AHmC3D;AAzBV,IAAM,0BAAgF,CAAC,EAAE,UAAU,UAAU,MAAM,MAAM;AAC9H,QAAM,EAAE,QAAQ,IAAI,kBAAkB;AACtC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAkB;AAE5C;AAAA;AAAA,IAEE,YAAY;AACV,UAAI,WAAW,SAAS;AACtB,cAAM,gCAAY,SAAS,IAAI,QAAQ,MAAM;AAE7C,cAAM,sBAAsB,QAAQ;AAEpC,YAAI,gCAAY,SAAS,WAAW,mBAAmB,GAAG;AACxD,gBAAM,YAAY,gCAAY,SAAS,WAAW,mBAAmB;AACrE,mBAAS,uCAAY,QAAQ;AAAA,QAC/B;AACA,uBAAe,IAAI;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,SAAS,OAAO;AAAA,EACnB;AAEA,SACE,4CAAC,uBAAuB,UAAvB,EAAgC,OAAO,EAAE,SAAS,UAAU,MAAM,QAAQ,mCAAS,QAAQ,cAAc,MAAM,GAC7G,oBAAU,2EAAG,wBAAc,WAAW,4CAAC,wBAAK,OAAM,yBAAwB,GAAG,IAAM,UACtF;AAEJ;","names":["import_react_shared","import_react_shared"]}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
2
|
-
import { Chip } from "@mui/material";
|
3
|
-
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
4
|
-
import { SchemaCache } from "@xyo-network/schema-cache";
|
5
|
-
import { useState } from "react";
|
6
|
-
|
7
|
-
// src/contexts/ResolvePayloadContext/Context.ts
|
8
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
9
|
-
var ResolvePayloadContext = createContextEx();
|
10
|
-
|
11
|
-
// src/contexts/ResolvePayloadContext/use.tsx
|
12
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
13
|
-
var useResolvePayload = () => useContextEx(ResolvePayloadContext, "ResolvePayload", true);
|
14
|
-
|
15
|
-
// src/contexts/ValidatePayloadContext/Context.ts
|
16
|
-
import { createContextEx as createContextEx2 } from "@xyo-network/react-shared";
|
17
|
-
var ValidatePayloadContext = createContextEx2();
|
18
|
-
|
19
|
-
// src/contexts/ValidatePayloadContext/Provider.tsx
|
20
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
21
|
-
var ValidatePayloadProvider = ({ children, enabled = false }) => {
|
22
|
-
const { payload } = useResolvePayload();
|
23
|
-
const [initialized, setInitialized] = useState(false);
|
24
|
-
const [valid, setValid] = useState();
|
25
|
-
useAsyncEffect(
|
26
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
27
|
-
async () => {
|
28
|
-
if (payload && enabled) {
|
29
|
-
await SchemaCache.instance.get(payload.schema);
|
30
|
-
const possibleKnownSchema = payload.schema;
|
31
|
-
if (SchemaCache.instance.validators[possibleKnownSchema]) {
|
32
|
-
const validator = SchemaCache.instance.validators[possibleKnownSchema];
|
33
|
-
setValid(validator == null ? void 0 : validator(payload));
|
34
|
-
}
|
35
|
-
setInitialized(true);
|
36
|
-
}
|
37
|
-
},
|
38
|
-
[payload, enabled]
|
39
|
-
);
|
40
|
-
return /* @__PURE__ */ jsx(ValidatePayloadContext.Provider, { value: { enabled, provided: true, schema: payload == null ? void 0 : payload.schema, validPayload: valid }, children: enabled ? /* @__PURE__ */ jsx(Fragment, { children: initialized ? children : /* @__PURE__ */ jsx(Chip, { label: "Validating Payload..." }) }) : children });
|
41
|
-
};
|
42
|
-
export {
|
43
|
-
ValidatePayloadProvider
|
44
|
-
};
|
45
|
-
//# sourceMappingURL=Provider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ValidatePayloadContext/Provider.tsx","../../../../src/contexts/ResolvePayloadContext/Context.ts","../../../../src/contexts/ResolvePayloadContext/use.tsx","../../../../src/contexts/ValidatePayloadContext/Context.ts"],"sourcesContent":["import { Chip } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { SchemaCache, SchemaNameToValidatorMap } from '@xyo-network/schema-cache'\nimport { useState } from 'react'\n\nimport { useResolvePayload } from '../ResolvePayloadContext'\nimport { ValidatePayloadContext } from './Context'\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<WithChildren<ValidatePayloadProviderProps>> = ({ children, enabled = false }) => {\n const { payload } = useResolvePayload()\n const [initialized, setInitialized] = useState(false)\n const [valid, setValid] = useState<boolean>()\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\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 setValid(validator?.(payload))\n }\n setInitialized(true)\n }\n },\n [payload, enabled],\n )\n\n return (\n <ValidatePayloadContext.Provider value={{ enabled, provided: true, schema: payload?.schema, validPayload: valid }}>\n {enabled ? <>{initialized ? children : <Chip label=\"Validating Payload...\" />}</> : children}\n </ValidatePayloadContext.Provider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadState } from './State'\n\nexport const ResolvePayloadContext = createContextEx<ResolvePayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAE/B,SAAS,mBAA6C;AACtD,SAAS,gBAAgB;;;ACJzB,SAAS,uBAAuB;AAIzB,IAAM,wBAAwB,gBAAqC;;;ACJ1E,SAAS,oBAAoB;AAItB,IAAM,oBAAoB,MAAM,aAAa,uBAAuB,kBAAkB,IAAI;;;ACJjG,SAAS,mBAAAA,wBAAuB;AAIzB,IAAM,yBAAyBA,iBAAsC;;;AHmC3D,mBAA4B,WAA5B;AAzBV,IAAM,0BAAgF,CAAC,EAAE,UAAU,UAAU,MAAM,MAAM;AAC9H,QAAM,EAAE,QAAQ,IAAI,kBAAkB;AACtC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAkB;AAE5C;AAAA;AAAA,IAEE,YAAY;AACV,UAAI,WAAW,SAAS;AACtB,cAAM,YAAY,SAAS,IAAI,QAAQ,MAAM;AAE7C,cAAM,sBAAsB,QAAQ;AAEpC,YAAI,YAAY,SAAS,WAAW,mBAAmB,GAAG;AACxD,gBAAM,YAAY,YAAY,SAAS,WAAW,mBAAmB;AACrE,mBAAS,uCAAY,QAAQ;AAAA,QAC/B;AACA,uBAAe,IAAI;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,SAAS,OAAO;AAAA,EACnB;AAEA,SACE,oBAAC,uBAAuB,UAAvB,EAAgC,OAAO,EAAE,SAAS,UAAU,MAAM,QAAQ,mCAAS,QAAQ,cAAc,MAAM,GAC7G,oBAAU,gCAAG,wBAAc,WAAW,oBAAC,QAAK,OAAM,yBAAwB,GAAG,IAAM,UACtF;AAEJ;","names":["createContextEx"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
8
|
-
for (let key of __getOwnPropNames(from))
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
11
|
-
}
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
15
|
-
|
16
|
-
// src/contexts/ValidatePayloadContext/State.ts
|
17
|
-
var State_exports = {};
|
18
|
-
module.exports = __toCommonJS(State_exports);
|
19
|
-
//# sourceMappingURL=State.cjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/ValidatePayloadContext/State.ts"],"sourcesContent":["import { ContextExState } from '@xyo-network/react-shared'\n\nexport interface ValidatePayloadState extends ContextExState {\n enabled?: boolean\n schema?: string\n validPayload?: boolean\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
//# sourceMappingURL=State.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|