@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.
Files changed (138) hide show
  1. package/dist/browser/components/EmbedPlugin.d.ts +5 -0
  2. package/dist/browser/components/EmbedPlugin.d.ts.map +1 -0
  3. package/dist/browser/components/EmbedResolver.d.ts +4 -0
  4. package/dist/browser/components/EmbedResolver.d.ts.map +1 -0
  5. package/dist/browser/components/controls/EmbedFormControl.d.ts +10 -0
  6. package/dist/browser/components/controls/EmbedFormControl.d.ts.map +1 -0
  7. package/dist/browser/components/controls/ListModeSelect.d.ts +6 -0
  8. package/dist/browser/components/controls/ListModeSelect.d.ts.map +1 -0
  9. package/dist/browser/components/controls/RenderSelect.d.ts +4 -0
  10. package/dist/browser/components/controls/RenderSelect.d.ts.map +1 -0
  11. package/dist/browser/components/controls/index.d.ts +4 -0
  12. package/dist/browser/components/controls/index.d.ts.map +1 -0
  13. package/dist/browser/components/embed-card/EmbedCardResolver.d.ts +5 -0
  14. package/dist/browser/components/embed-card/EmbedCardResolver.d.ts.map +1 -0
  15. package/dist/browser/components/embed-card/EmbedPluginCard.d.ts +10 -0
  16. package/dist/browser/components/embed-card/EmbedPluginCard.d.ts.map +1 -0
  17. package/dist/browser/components/embed-card/card/BusyCard.d.ts +11 -0
  18. package/dist/browser/components/embed-card/card/BusyCard.d.ts.map +1 -0
  19. package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts +4 -0
  20. package/dist/browser/components/embed-card/card/EmbedCardHeader.d.ts.map +1 -0
  21. package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts +4 -0
  22. package/dist/browser/components/embed-card/card/EmbedPluginCard.d.ts.map +1 -0
  23. package/dist/browser/components/embed-card/card/index.d.ts +4 -0
  24. package/dist/browser/components/embed-card/card/index.d.ts.map +1 -0
  25. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts +10 -0
  26. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.d.ts.map +1 -0
  27. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts +14 -0
  28. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.d.ts.map +1 -0
  29. package/dist/browser/components/embed-card/error-handling/index.d.ts +3 -0
  30. package/dist/browser/components/embed-card/error-handling/index.d.ts.map +1 -0
  31. package/dist/browser/components/embed-card/index.d.ts +3 -0
  32. package/dist/browser/components/embed-card/index.d.ts.map +1 -0
  33. package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts +4 -0
  34. package/dist/browser/components/embed-card/menu/EmbedMenu.d.ts.map +1 -0
  35. package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts +4 -0
  36. package/dist/browser/components/embed-card/menu/JsonMenuItem.d.ts.map +1 -0
  37. package/dist/browser/components/embed-card/menu/index.d.ts +2 -0
  38. package/dist/browser/components/embed-card/menu/index.d.ts.map +1 -0
  39. package/dist/browser/components/index.d.ts +3 -0
  40. package/dist/browser/components/index.d.ts.map +1 -0
  41. package/dist/browser/components/stories/storyPayload.d.ts +126 -0
  42. package/dist/browser/components/stories/storyPayload.d.ts.map +1 -0
  43. package/dist/browser/components/stories/storyShared.d.ts +4 -0
  44. package/dist/browser/components/stories/storyShared.d.ts.map +1 -0
  45. package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts +3 -0
  46. package/dist/browser/components/stories/xyoEmbedStoryBase.d.ts.map +1 -0
  47. package/dist/browser/components/validation-alerts/ValidatePayload.d.ts +5 -0
  48. package/dist/browser/components/validation-alerts/ValidatePayload.d.ts.map +1 -0
  49. package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts +5 -0
  50. package/dist/browser/components/validation-alerts/ValidatePlugins.d.ts.map +1 -0
  51. package/dist/browser/components/validation-alerts/index.d.ts +3 -0
  52. package/dist/browser/components/validation-alerts/index.d.ts.map +1 -0
  53. package/dist/browser/contexts/EmbedPluginContext/Context.d.ts +3 -0
  54. package/dist/browser/contexts/EmbedPluginContext/Context.d.ts.map +1 -0
  55. package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts +6 -0
  56. package/dist/browser/contexts/EmbedPluginContext/Provider.d.ts.map +1 -0
  57. package/dist/browser/contexts/EmbedPluginContext/State.d.ts +28 -0
  58. package/dist/browser/contexts/EmbedPluginContext/State.d.ts.map +1 -0
  59. package/dist/browser/contexts/EmbedPluginContext/index.d.ts +5 -0
  60. package/dist/browser/contexts/EmbedPluginContext/index.d.ts.map +1 -0
  61. package/dist/browser/contexts/EmbedPluginContext/use.d.ts +2 -0
  62. package/dist/browser/contexts/EmbedPluginContext/use.d.ts.map +1 -0
  63. package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts +3 -0
  64. package/dist/browser/contexts/RefreshPayloadContext/Context.d.ts.map +1 -0
  65. package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts +8 -0
  66. package/dist/browser/contexts/RefreshPayloadContext/Provider.d.ts.map +1 -0
  67. package/dist/browser/contexts/RefreshPayloadContext/State.d.ts +8 -0
  68. package/dist/browser/contexts/RefreshPayloadContext/State.d.ts.map +1 -0
  69. package/dist/browser/contexts/RefreshPayloadContext/index.d.ts +4 -0
  70. package/dist/browser/contexts/RefreshPayloadContext/index.d.ts.map +1 -0
  71. package/dist/browser/contexts/RefreshPayloadContext/use.d.ts +2 -0
  72. package/dist/browser/contexts/RefreshPayloadContext/use.d.ts.map +1 -0
  73. package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts +3 -0
  74. package/dist/browser/contexts/ResolvePayloadContext/Context.d.ts.map +1 -0
  75. package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts +6 -0
  76. package/dist/browser/contexts/ResolvePayloadContext/Provider.d.ts.map +1 -0
  77. package/dist/browser/contexts/ResolvePayloadContext/State.d.ts +13 -0
  78. package/dist/browser/contexts/ResolvePayloadContext/State.d.ts.map +1 -0
  79. package/dist/browser/contexts/ResolvePayloadContext/index.d.ts +5 -0
  80. package/dist/browser/contexts/ResolvePayloadContext/index.d.ts.map +1 -0
  81. package/dist/browser/contexts/ResolvePayloadContext/use.d.ts +2 -0
  82. package/dist/browser/contexts/ResolvePayloadContext/use.d.ts.map +1 -0
  83. package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts +3 -0
  84. package/dist/browser/contexts/ValidatePayloadContext/Context.d.ts.map +1 -0
  85. package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts +7 -0
  86. package/dist/browser/contexts/ValidatePayloadContext/Provider.d.ts.map +1 -0
  87. package/dist/browser/contexts/ValidatePayloadContext/State.d.ts +7 -0
  88. package/dist/browser/contexts/ValidatePayloadContext/State.d.ts.map +1 -0
  89. package/dist/browser/contexts/ValidatePayloadContext/index.d.ts +4 -0
  90. package/dist/browser/contexts/ValidatePayloadContext/index.d.ts.map +1 -0
  91. package/dist/browser/contexts/ValidatePayloadContext/use.d.ts +2 -0
  92. package/dist/browser/contexts/ValidatePayloadContext/use.d.ts.map +1 -0
  93. package/dist/browser/contexts/index.d.ts +5 -0
  94. package/dist/browser/contexts/index.d.ts.map +1 -0
  95. package/dist/browser/index.d.ts +4 -112
  96. package/dist/browser/index.d.ts.map +1 -0
  97. package/dist/browser/index.mjs.map +1 -1
  98. package/dist/browser/types/EmbedPluginProps.d.ts +9 -0
  99. package/dist/browser/types/EmbedPluginProps.d.ts.map +1 -0
  100. package/dist/browser/types/index.d.ts +2 -0
  101. package/dist/browser/types/index.d.ts.map +1 -0
  102. package/package.json +57 -54
  103. package/src/components/EmbedPlugin.tsx +9 -5
  104. package/src/components/EmbedResolver.tsx +4 -2
  105. package/src/components/controls/EmbedFormControl.tsx +6 -3
  106. package/src/components/controls/ListModeSelect.tsx +4 -2
  107. package/src/components/controls/RenderSelect.tsx +5 -2
  108. package/src/components/embed-card/EmbedCardResolver.tsx +11 -4
  109. package/src/components/embed-card/EmbedPluginCard.tsx +9 -4
  110. package/src/components/embed-card/card/BusyCard.tsx +7 -4
  111. package/src/components/embed-card/card/EmbedCardHeader.tsx +10 -3
  112. package/src/components/embed-card/card/EmbedPluginCard.tsx +5 -2
  113. package/src/components/embed-card/error-handling/EmbedCardApiErrorRenderer.tsx +6 -4
  114. package/src/components/embed-card/error-handling/EmbedErrorCard.tsx +14 -5
  115. package/src/components/embed-card/menu/EmbedMenu.tsx +2 -1
  116. package/src/components/embed-card/menu/JsonMenuItem.tsx +4 -1
  117. package/src/components/stories/XyoEmbedPlugin.examples.stories.tsx +1 -1
  118. package/src/components/stories/XyoEmbedPlugin.states.stories.tsx +4 -2
  119. package/src/components/stories/storyPayload.ts +60 -12
  120. package/src/components/stories/storyShared.tsx +1 -11
  121. package/src/components/stories/xyoEmbedStoryBase.ts +9 -0
  122. package/src/components/validation-alerts/ValidatePayload.tsx +6 -3
  123. package/src/components/validation-alerts/ValidatePlugins.tsx +3 -2
  124. package/src/contexts/EmbedPluginContext/Context.ts +1 -1
  125. package/src/contexts/EmbedPluginContext/Provider.tsx +3 -3
  126. package/src/contexts/EmbedPluginContext/State.ts +3 -3
  127. package/src/contexts/RefreshPayloadContext/Context.ts +1 -1
  128. package/src/contexts/RefreshPayloadContext/Provider.tsx +8 -3
  129. package/src/contexts/RefreshPayloadContext/State.ts +2 -2
  130. package/src/contexts/ResolvePayloadContext/Context.ts +1 -1
  131. package/src/contexts/ResolvePayloadContext/Provider.tsx +14 -6
  132. package/src/contexts/ResolvePayloadContext/State.ts +3 -3
  133. package/src/contexts/ValidatePayloadContext/Context.ts +1 -1
  134. package/src/contexts/ValidatePayloadContext/Provider.stories.tsx +15 -6
  135. package/src/contexts/ValidatePayloadContext/Provider.tsx +7 -3
  136. package/src/contexts/ValidatePayloadContext/State.ts +1 -1
  137. package/src/types/EmbedPluginProps.ts +2 -2
  138. package/xy.config.ts +2 -4
@@ -1,15 +1,22 @@
1
1
  import { Typography } from '@mui/material'
2
- import { Decorator, Meta, StoryFn } from '@storybook/react'
2
+ import type {
3
+ Decorator, Meta, StoryFn,
4
+ } from '@storybook/react'
3
5
  import React from 'react'
4
6
 
5
- import { EmbedPluginContext, EmbedPluginState } from '../EmbedPluginContext/index.ts'
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 { ResolvePayloadContext, ResolvePayloadState } from '../ResolvePayloadContext/index.ts'
8
- import { ValidatePayloadProvider, ValidatePayloadProviderProps } from './Provider.tsx'
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 { xyoEmbedPluginContext, resolvePayloadContext, ...props } = args
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 { Default, ValidationFailed, ValidationSucceeded }
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 { SchemaCache, SchemaNameToValidatorMap } from '@xyo-network/schema-cache'
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={{ enabled, provided: true, schema: payload?.schema, validPayload: valid }}>
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,4 +1,4 @@
1
- import { ContextExState } from '@xyo-network/react-shared'
1
+ import type { ContextExState } from '@xyo-network/react-shared'
2
2
 
3
3
  export interface ValidatePayloadState extends ContextExState {
4
4
  enabled?: boolean
@@ -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
@@ -1,9 +1,7 @@
1
- import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
1
+ import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
- browser: {
5
- src: true,
6
- },
4
+ browser: { src: true },
7
5
  node: {},
8
6
  neutral: {},
9
7
  },