@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.
Files changed (386) hide show
  1. package/dist/docs.json +109 -109
  2. package/package.json +15 -15
  3. package/dist/browser/components/EmbedPlugin.cjs +0 -251
  4. package/dist/browser/components/EmbedPlugin.cjs.map +0 -1
  5. package/dist/browser/components/EmbedPlugin.js +0 -230
  6. package/dist/browser/components/EmbedPlugin.js.map +0 -1
  7. package/dist/browser/components/EmbedResolver.cjs +0 -42
  8. package/dist/browser/components/EmbedResolver.cjs.map +0 -1
  9. package/dist/browser/components/EmbedResolver.js +0 -21
  10. package/dist/browser/components/EmbedResolver.js.map +0 -1
  11. package/dist/browser/components/controls/EmbedFormControl.cjs +0 -34
  12. package/dist/browser/components/controls/EmbedFormControl.cjs.map +0 -1
  13. package/dist/browser/components/controls/EmbedFormControl.js +0 -13
  14. package/dist/browser/components/controls/EmbedFormControl.js.map +0 -1
  15. package/dist/browser/components/controls/ListModeSelect.cjs +0 -65
  16. package/dist/browser/components/controls/ListModeSelect.cjs.map +0 -1
  17. package/dist/browser/components/controls/ListModeSelect.js +0 -44
  18. package/dist/browser/components/controls/ListModeSelect.js.map +0 -1
  19. package/dist/browser/components/controls/RenderSelect.cjs +0 -54
  20. package/dist/browser/components/controls/RenderSelect.cjs.map +0 -1
  21. package/dist/browser/components/controls/RenderSelect.js +0 -33
  22. package/dist/browser/components/controls/RenderSelect.js.map +0 -1
  23. package/dist/browser/components/controls/index.cjs +0 -87
  24. package/dist/browser/components/controls/index.cjs.map +0 -1
  25. package/dist/browser/components/controls/index.js +0 -64
  26. package/dist/browser/components/controls/index.js.map +0 -1
  27. package/dist/browser/components/embed-card/EmbedCardResolver.cjs +0 -95
  28. package/dist/browser/components/embed-card/EmbedCardResolver.cjs.map +0 -1
  29. package/dist/browser/components/embed-card/EmbedCardResolver.js +0 -74
  30. package/dist/browser/components/embed-card/EmbedCardResolver.js.map +0 -1
  31. package/dist/browser/components/embed-card/EmbedPluginCard.cjs +0 -497
  32. package/dist/browser/components/embed-card/EmbedPluginCard.cjs.map +0 -1
  33. package/dist/browser/components/embed-card/EmbedPluginCard.js +0 -479
  34. package/dist/browser/components/embed-card/EmbedPluginCard.js.map +0 -1
  35. package/dist/browser/components/embed-card/card/BusyCard.cjs +0 -45
  36. package/dist/browser/components/embed-card/card/BusyCard.cjs.map +0 -1
  37. package/dist/browser/components/embed-card/card/BusyCard.js +0 -27
  38. package/dist/browser/components/embed-card/card/BusyCard.js.map +0 -1
  39. package/dist/browser/components/embed-card/card/EmbedCardHeader.cjs +0 -108
  40. package/dist/browser/components/embed-card/card/EmbedCardHeader.cjs.map +0 -1
  41. package/dist/browser/components/embed-card/card/EmbedCardHeader.js +0 -87
  42. package/dist/browser/components/embed-card/card/EmbedCardHeader.js.map +0 -1
  43. package/dist/browser/components/embed-card/card/EmbedPluginCard.cjs +0 -199
  44. package/dist/browser/components/embed-card/card/EmbedPluginCard.cjs.map +0 -1
  45. package/dist/browser/components/embed-card/card/EmbedPluginCard.js +0 -181
  46. package/dist/browser/components/embed-card/card/EmbedPluginCard.js.map +0 -1
  47. package/dist/browser/components/embed-card/card/index.cjs +0 -203
  48. package/dist/browser/components/embed-card/card/index.cjs.map +0 -1
  49. package/dist/browser/components/embed-card/card/index.js +0 -183
  50. package/dist/browser/components/embed-card/card/index.js.map +0 -1
  51. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs +0 -54
  52. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs.map +0 -1
  53. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +0 -33
  54. package/dist/browser/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +0 -1
  55. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.cjs +0 -42
  56. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.cjs.map +0 -1
  57. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.js +0 -21
  58. package/dist/browser/components/embed-card/error-handling/EmbedErrorCard.js.map +0 -1
  59. package/dist/browser/components/embed-card/error-handling/index.cjs +0 -57
  60. package/dist/browser/components/embed-card/error-handling/index.cjs.map +0 -1
  61. package/dist/browser/components/embed-card/error-handling/index.js +0 -34
  62. package/dist/browser/components/embed-card/error-handling/index.js.map +0 -1
  63. package/dist/browser/components/embed-card/index.cjs +0 -502
  64. package/dist/browser/components/embed-card/index.cjs.map +0 -1
  65. package/dist/browser/components/embed-card/index.js +0 -482
  66. package/dist/browser/components/embed-card/index.js.map +0 -1
  67. package/dist/browser/components/embed-card/menu/EmbedMenu.cjs +0 -68
  68. package/dist/browser/components/embed-card/menu/EmbedMenu.cjs.map +0 -1
  69. package/dist/browser/components/embed-card/menu/EmbedMenu.js +0 -47
  70. package/dist/browser/components/embed-card/menu/EmbedMenu.js.map +0 -1
  71. package/dist/browser/components/embed-card/menu/JsonMenuItem.cjs +0 -46
  72. package/dist/browser/components/embed-card/menu/JsonMenuItem.cjs.map +0 -1
  73. package/dist/browser/components/embed-card/menu/JsonMenuItem.js +0 -25
  74. package/dist/browser/components/embed-card/menu/JsonMenuItem.js.map +0 -1
  75. package/dist/browser/components/embed-card/menu/index.cjs +0 -70
  76. package/dist/browser/components/embed-card/menu/index.cjs.map +0 -1
  77. package/dist/browser/components/embed-card/menu/index.js +0 -47
  78. package/dist/browser/components/embed-card/menu/index.js.map +0 -1
  79. package/dist/browser/components/embed-plugin-stories/storyPayload.cjs +0 -47
  80. package/dist/browser/components/embed-plugin-stories/storyPayload.cjs.map +0 -1
  81. package/dist/browser/components/embed-plugin-stories/storyPayload.js +0 -26
  82. package/dist/browser/components/embed-plugin-stories/storyPayload.js.map +0 -1
  83. package/dist/browser/components/embed-plugin-stories/storyShared.cjs +0 -513
  84. package/dist/browser/components/embed-plugin-stories/storyShared.cjs.map +0 -1
  85. package/dist/browser/components/embed-plugin-stories/storyShared.js +0 -495
  86. package/dist/browser/components/embed-plugin-stories/storyShared.js.map +0 -1
  87. package/dist/browser/components/index.cjs +0 -503
  88. package/dist/browser/components/index.cjs.map +0 -1
  89. package/dist/browser/components/index.js +0 -483
  90. package/dist/browser/components/index.js.map +0 -1
  91. package/dist/browser/components/validation-alerts/ValidatePayload.cjs +0 -49
  92. package/dist/browser/components/validation-alerts/ValidatePayload.cjs.map +0 -1
  93. package/dist/browser/components/validation-alerts/ValidatePayload.js +0 -28
  94. package/dist/browser/components/validation-alerts/ValidatePayload.js.map +0 -1
  95. package/dist/browser/components/validation-alerts/ValidatePlugins.cjs +0 -57
  96. package/dist/browser/components/validation-alerts/ValidatePlugins.cjs.map +0 -1
  97. package/dist/browser/components/validation-alerts/ValidatePlugins.js +0 -36
  98. package/dist/browser/components/validation-alerts/ValidatePlugins.js.map +0 -1
  99. package/dist/browser/components/validation-alerts/index.cjs +0 -83
  100. package/dist/browser/components/validation-alerts/index.cjs.map +0 -1
  101. package/dist/browser/components/validation-alerts/index.js +0 -60
  102. package/dist/browser/components/validation-alerts/index.js.map +0 -1
  103. package/dist/browser/contexts/EmbedPluginContext/Context.cjs +0 -28
  104. package/dist/browser/contexts/EmbedPluginContext/Context.cjs.map +0 -1
  105. package/dist/browser/contexts/EmbedPluginContext/Context.js +0 -7
  106. package/dist/browser/contexts/EmbedPluginContext/Context.js.map +0 -1
  107. package/dist/browser/contexts/EmbedPluginContext/Provider.cjs +0 -62
  108. package/dist/browser/contexts/EmbedPluginContext/Provider.cjs.map +0 -1
  109. package/dist/browser/contexts/EmbedPluginContext/Provider.js +0 -41
  110. package/dist/browser/contexts/EmbedPluginContext/Provider.js.map +0 -1
  111. package/dist/browser/contexts/EmbedPluginContext/State.cjs +0 -19
  112. package/dist/browser/contexts/EmbedPluginContext/State.cjs.map +0 -1
  113. package/dist/browser/contexts/EmbedPluginContext/State.js +0 -1
  114. package/dist/browser/contexts/EmbedPluginContext/State.js.map +0 -1
  115. package/dist/browser/contexts/EmbedPluginContext/index.cjs +0 -68
  116. package/dist/browser/contexts/EmbedPluginContext/index.cjs.map +0 -1
  117. package/dist/browser/contexts/EmbedPluginContext/index.js +0 -45
  118. package/dist/browser/contexts/EmbedPluginContext/index.js.map +0 -1
  119. package/dist/browser/contexts/EmbedPluginContext/use.cjs +0 -34
  120. package/dist/browser/contexts/EmbedPluginContext/use.cjs.map +0 -1
  121. package/dist/browser/contexts/EmbedPluginContext/use.js +0 -13
  122. package/dist/browser/contexts/EmbedPluginContext/use.js.map +0 -1
  123. package/dist/browser/contexts/RefreshPayloadContext/Context.cjs +0 -28
  124. package/dist/browser/contexts/RefreshPayloadContext/Context.cjs.map +0 -1
  125. package/dist/browser/contexts/RefreshPayloadContext/Context.js +0 -7
  126. package/dist/browser/contexts/RefreshPayloadContext/Context.js.map +0 -1
  127. package/dist/browser/contexts/RefreshPayloadContext/Provider.cjs +0 -38
  128. package/dist/browser/contexts/RefreshPayloadContext/Provider.cjs.map +0 -1
  129. package/dist/browser/contexts/RefreshPayloadContext/Provider.js +0 -17
  130. package/dist/browser/contexts/RefreshPayloadContext/Provider.js.map +0 -1
  131. package/dist/browser/contexts/RefreshPayloadContext/State.cjs +0 -19
  132. package/dist/browser/contexts/RefreshPayloadContext/State.cjs.map +0 -1
  133. package/dist/browser/contexts/RefreshPayloadContext/State.js +0 -1
  134. package/dist/browser/contexts/RefreshPayloadContext/State.js.map +0 -1
  135. package/dist/browser/contexts/RefreshPayloadContext/index.cjs +0 -45
  136. package/dist/browser/contexts/RefreshPayloadContext/index.cjs.map +0 -1
  137. package/dist/browser/contexts/RefreshPayloadContext/index.js +0 -22
  138. package/dist/browser/contexts/RefreshPayloadContext/index.js.map +0 -1
  139. package/dist/browser/contexts/RefreshPayloadContext/use.cjs +0 -34
  140. package/dist/browser/contexts/RefreshPayloadContext/use.cjs.map +0 -1
  141. package/dist/browser/contexts/RefreshPayloadContext/use.js +0 -13
  142. package/dist/browser/contexts/RefreshPayloadContext/use.js.map +0 -1
  143. package/dist/browser/contexts/ResolvePayloadContext/Context.cjs +0 -28
  144. package/dist/browser/contexts/ResolvePayloadContext/Context.cjs.map +0 -1
  145. package/dist/browser/contexts/ResolvePayloadContext/Context.js +0 -7
  146. package/dist/browser/contexts/ResolvePayloadContext/Context.js.map +0 -1
  147. package/dist/browser/contexts/ResolvePayloadContext/Provider.cjs +0 -88
  148. package/dist/browser/contexts/ResolvePayloadContext/Provider.cjs.map +0 -1
  149. package/dist/browser/contexts/ResolvePayloadContext/Provider.js +0 -67
  150. package/dist/browser/contexts/ResolvePayloadContext/Provider.js.map +0 -1
  151. package/dist/browser/contexts/ResolvePayloadContext/State.cjs +0 -19
  152. package/dist/browser/contexts/ResolvePayloadContext/State.cjs.map +0 -1
  153. package/dist/browser/contexts/ResolvePayloadContext/State.js +0 -1
  154. package/dist/browser/contexts/ResolvePayloadContext/State.js.map +0 -1
  155. package/dist/browser/contexts/ResolvePayloadContext/index.cjs +0 -96
  156. package/dist/browser/contexts/ResolvePayloadContext/index.cjs.map +0 -1
  157. package/dist/browser/contexts/ResolvePayloadContext/index.js +0 -73
  158. package/dist/browser/contexts/ResolvePayloadContext/index.js.map +0 -1
  159. package/dist/browser/contexts/ResolvePayloadContext/use.cjs +0 -34
  160. package/dist/browser/contexts/ResolvePayloadContext/use.cjs.map +0 -1
  161. package/dist/browser/contexts/ResolvePayloadContext/use.js +0 -13
  162. package/dist/browser/contexts/ResolvePayloadContext/use.js.map +0 -1
  163. package/dist/browser/contexts/ValidatePayloadContext/Context.cjs +0 -28
  164. package/dist/browser/contexts/ValidatePayloadContext/Context.cjs.map +0 -1
  165. package/dist/browser/contexts/ValidatePayloadContext/Context.js +0 -7
  166. package/dist/browser/contexts/ValidatePayloadContext/Context.js.map +0 -1
  167. package/dist/browser/contexts/ValidatePayloadContext/Provider.cjs +0 -66
  168. package/dist/browser/contexts/ValidatePayloadContext/Provider.cjs.map +0 -1
  169. package/dist/browser/contexts/ValidatePayloadContext/Provider.js +0 -45
  170. package/dist/browser/contexts/ValidatePayloadContext/Provider.js.map +0 -1
  171. package/dist/browser/contexts/ValidatePayloadContext/State.cjs +0 -19
  172. package/dist/browser/contexts/ValidatePayloadContext/State.cjs.map +0 -1
  173. package/dist/browser/contexts/ValidatePayloadContext/State.js +0 -1
  174. package/dist/browser/contexts/ValidatePayloadContext/State.js.map +0 -1
  175. package/dist/browser/contexts/ValidatePayloadContext/index.cjs +0 -73
  176. package/dist/browser/contexts/ValidatePayloadContext/index.cjs.map +0 -1
  177. package/dist/browser/contexts/ValidatePayloadContext/index.js +0 -50
  178. package/dist/browser/contexts/ValidatePayloadContext/index.js.map +0 -1
  179. package/dist/browser/contexts/ValidatePayloadContext/use.cjs +0 -34
  180. package/dist/browser/contexts/ValidatePayloadContext/use.cjs.map +0 -1
  181. package/dist/browser/contexts/ValidatePayloadContext/use.js +0 -13
  182. package/dist/browser/contexts/ValidatePayloadContext/use.js.map +0 -1
  183. package/dist/browser/contexts/index.cjs +0 -189
  184. package/dist/browser/contexts/index.cjs.map +0 -1
  185. package/dist/browser/contexts/index.js +0 -166
  186. package/dist/browser/contexts/index.js.map +0 -1
  187. package/dist/browser/types/EmbedPluginProps.cjs +0 -19
  188. package/dist/browser/types/EmbedPluginProps.cjs.map +0 -1
  189. package/dist/browser/types/EmbedPluginProps.js +0 -1
  190. package/dist/browser/types/EmbedPluginProps.js.map +0 -1
  191. package/dist/browser/types/index.cjs +0 -19
  192. package/dist/browser/types/index.cjs.map +0 -1
  193. package/dist/browser/types/index.js +0 -1
  194. package/dist/browser/types/index.js.map +0 -1
  195. package/dist/node/components/EmbedPlugin.cjs +0 -255
  196. package/dist/node/components/EmbedPlugin.cjs.map +0 -1
  197. package/dist/node/components/EmbedPlugin.js +0 -230
  198. package/dist/node/components/EmbedPlugin.js.map +0 -1
  199. package/dist/node/components/EmbedResolver.cjs +0 -46
  200. package/dist/node/components/EmbedResolver.cjs.map +0 -1
  201. package/dist/node/components/EmbedResolver.js +0 -21
  202. package/dist/node/components/EmbedResolver.js.map +0 -1
  203. package/dist/node/components/controls/EmbedFormControl.cjs +0 -38
  204. package/dist/node/components/controls/EmbedFormControl.cjs.map +0 -1
  205. package/dist/node/components/controls/EmbedFormControl.js +0 -13
  206. package/dist/node/components/controls/EmbedFormControl.js.map +0 -1
  207. package/dist/node/components/controls/ListModeSelect.cjs +0 -70
  208. package/dist/node/components/controls/ListModeSelect.cjs.map +0 -1
  209. package/dist/node/components/controls/ListModeSelect.js +0 -44
  210. package/dist/node/components/controls/ListModeSelect.js.map +0 -1
  211. package/dist/node/components/controls/RenderSelect.cjs +0 -58
  212. package/dist/node/components/controls/RenderSelect.cjs.map +0 -1
  213. package/dist/node/components/controls/RenderSelect.js +0 -33
  214. package/dist/node/components/controls/RenderSelect.js.map +0 -1
  215. package/dist/node/components/controls/index.cjs +0 -94
  216. package/dist/node/components/controls/index.cjs.map +0 -1
  217. package/dist/node/components/controls/index.js +0 -64
  218. package/dist/node/components/controls/index.js.map +0 -1
  219. package/dist/node/components/embed-card/EmbedCardResolver.cjs +0 -99
  220. package/dist/node/components/embed-card/EmbedCardResolver.cjs.map +0 -1
  221. package/dist/node/components/embed-card/EmbedCardResolver.js +0 -74
  222. package/dist/node/components/embed-card/EmbedCardResolver.js.map +0 -1
  223. package/dist/node/components/embed-card/EmbedPluginCard.cjs +0 -505
  224. package/dist/node/components/embed-card/EmbedPluginCard.cjs.map +0 -1
  225. package/dist/node/components/embed-card/EmbedPluginCard.js +0 -481
  226. package/dist/node/components/embed-card/EmbedPluginCard.js.map +0 -1
  227. package/dist/node/components/embed-card/card/BusyCard.cjs +0 -49
  228. package/dist/node/components/embed-card/card/BusyCard.cjs.map +0 -1
  229. package/dist/node/components/embed-card/card/BusyCard.js +0 -27
  230. package/dist/node/components/embed-card/card/BusyCard.js.map +0 -1
  231. package/dist/node/components/embed-card/card/EmbedCardHeader.cjs +0 -113
  232. package/dist/node/components/embed-card/card/EmbedCardHeader.cjs.map +0 -1
  233. package/dist/node/components/embed-card/card/EmbedCardHeader.js +0 -88
  234. package/dist/node/components/embed-card/card/EmbedCardHeader.js.map +0 -1
  235. package/dist/node/components/embed-card/card/EmbedPluginCard.cjs +0 -205
  236. package/dist/node/components/embed-card/card/EmbedPluginCard.cjs.map +0 -1
  237. package/dist/node/components/embed-card/card/EmbedPluginCard.js +0 -183
  238. package/dist/node/components/embed-card/card/EmbedPluginCard.js.map +0 -1
  239. package/dist/node/components/embed-card/card/index.cjs +0 -211
  240. package/dist/node/components/embed-card/card/index.cjs.map +0 -1
  241. package/dist/node/components/embed-card/card/index.js +0 -185
  242. package/dist/node/components/embed-card/card/index.js.map +0 -1
  243. package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs +0 -58
  244. package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.cjs.map +0 -1
  245. package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js +0 -33
  246. package/dist/node/components/embed-card/error-handling/EmbedCardApiErrorRenderer.js.map +0 -1
  247. package/dist/node/components/embed-card/error-handling/EmbedErrorCard.cjs +0 -46
  248. package/dist/node/components/embed-card/error-handling/EmbedErrorCard.cjs.map +0 -1
  249. package/dist/node/components/embed-card/error-handling/EmbedErrorCard.js +0 -21
  250. package/dist/node/components/embed-card/error-handling/EmbedErrorCard.js.map +0 -1
  251. package/dist/node/components/embed-card/error-handling/index.cjs +0 -62
  252. package/dist/node/components/embed-card/error-handling/index.cjs.map +0 -1
  253. package/dist/node/components/embed-card/error-handling/index.js +0 -34
  254. package/dist/node/components/embed-card/error-handling/index.js.map +0 -1
  255. package/dist/node/components/embed-card/index.cjs +0 -513
  256. package/dist/node/components/embed-card/index.cjs.map +0 -1
  257. package/dist/node/components/embed-card/index.js +0 -484
  258. package/dist/node/components/embed-card/index.js.map +0 -1
  259. package/dist/node/components/embed-card/menu/EmbedMenu.cjs +0 -72
  260. package/dist/node/components/embed-card/menu/EmbedMenu.cjs.map +0 -1
  261. package/dist/node/components/embed-card/menu/EmbedMenu.js +0 -47
  262. package/dist/node/components/embed-card/menu/EmbedMenu.js.map +0 -1
  263. package/dist/node/components/embed-card/menu/JsonMenuItem.cjs +0 -50
  264. package/dist/node/components/embed-card/menu/JsonMenuItem.cjs.map +0 -1
  265. package/dist/node/components/embed-card/menu/JsonMenuItem.js +0 -25
  266. package/dist/node/components/embed-card/menu/JsonMenuItem.js.map +0 -1
  267. package/dist/node/components/embed-card/menu/index.cjs +0 -74
  268. package/dist/node/components/embed-card/menu/index.cjs.map +0 -1
  269. package/dist/node/components/embed-card/menu/index.js +0 -47
  270. package/dist/node/components/embed-card/menu/index.js.map +0 -1
  271. package/dist/node/components/embed-plugin-stories/storyPayload.cjs +0 -51
  272. package/dist/node/components/embed-plugin-stories/storyPayload.cjs.map +0 -1
  273. package/dist/node/components/embed-plugin-stories/storyPayload.js +0 -26
  274. package/dist/node/components/embed-plugin-stories/storyPayload.js.map +0 -1
  275. package/dist/node/components/embed-plugin-stories/storyShared.cjs +0 -520
  276. package/dist/node/components/embed-plugin-stories/storyShared.cjs.map +0 -1
  277. package/dist/node/components/embed-plugin-stories/storyShared.js +0 -497
  278. package/dist/node/components/embed-plugin-stories/storyShared.js.map +0 -1
  279. package/dist/node/components/index.cjs +0 -515
  280. package/dist/node/components/index.cjs.map +0 -1
  281. package/dist/node/components/index.js +0 -485
  282. package/dist/node/components/index.js.map +0 -1
  283. package/dist/node/components/validation-alerts/ValidatePayload.cjs +0 -53
  284. package/dist/node/components/validation-alerts/ValidatePayload.cjs.map +0 -1
  285. package/dist/node/components/validation-alerts/ValidatePayload.js +0 -28
  286. package/dist/node/components/validation-alerts/ValidatePayload.js.map +0 -1
  287. package/dist/node/components/validation-alerts/ValidatePlugins.cjs +0 -61
  288. package/dist/node/components/validation-alerts/ValidatePlugins.cjs.map +0 -1
  289. package/dist/node/components/validation-alerts/ValidatePlugins.js +0 -36
  290. package/dist/node/components/validation-alerts/ValidatePlugins.js.map +0 -1
  291. package/dist/node/components/validation-alerts/index.cjs +0 -88
  292. package/dist/node/components/validation-alerts/index.cjs.map +0 -1
  293. package/dist/node/components/validation-alerts/index.js +0 -60
  294. package/dist/node/components/validation-alerts/index.js.map +0 -1
  295. package/dist/node/contexts/EmbedPluginContext/Context.cjs +0 -32
  296. package/dist/node/contexts/EmbedPluginContext/Context.cjs.map +0 -1
  297. package/dist/node/contexts/EmbedPluginContext/Context.js +0 -7
  298. package/dist/node/contexts/EmbedPluginContext/Context.js.map +0 -1
  299. package/dist/node/contexts/EmbedPluginContext/Provider.cjs +0 -66
  300. package/dist/node/contexts/EmbedPluginContext/Provider.cjs.map +0 -1
  301. package/dist/node/contexts/EmbedPluginContext/Provider.js +0 -41
  302. package/dist/node/contexts/EmbedPluginContext/Provider.js.map +0 -1
  303. package/dist/node/contexts/EmbedPluginContext/State.cjs +0 -19
  304. package/dist/node/contexts/EmbedPluginContext/State.cjs.map +0 -1
  305. package/dist/node/contexts/EmbedPluginContext/State.js +0 -1
  306. package/dist/node/contexts/EmbedPluginContext/State.js.map +0 -1
  307. package/dist/node/contexts/EmbedPluginContext/index.cjs +0 -74
  308. package/dist/node/contexts/EmbedPluginContext/index.cjs.map +0 -1
  309. package/dist/node/contexts/EmbedPluginContext/index.js +0 -45
  310. package/dist/node/contexts/EmbedPluginContext/index.js.map +0 -1
  311. package/dist/node/contexts/EmbedPluginContext/use.cjs +0 -38
  312. package/dist/node/contexts/EmbedPluginContext/use.cjs.map +0 -1
  313. package/dist/node/contexts/EmbedPluginContext/use.js +0 -13
  314. package/dist/node/contexts/EmbedPluginContext/use.js.map +0 -1
  315. package/dist/node/contexts/RefreshPayloadContext/Context.cjs +0 -32
  316. package/dist/node/contexts/RefreshPayloadContext/Context.cjs.map +0 -1
  317. package/dist/node/contexts/RefreshPayloadContext/Context.js +0 -7
  318. package/dist/node/contexts/RefreshPayloadContext/Context.js.map +0 -1
  319. package/dist/node/contexts/RefreshPayloadContext/Provider.cjs +0 -42
  320. package/dist/node/contexts/RefreshPayloadContext/Provider.cjs.map +0 -1
  321. package/dist/node/contexts/RefreshPayloadContext/Provider.js +0 -17
  322. package/dist/node/contexts/RefreshPayloadContext/Provider.js.map +0 -1
  323. package/dist/node/contexts/RefreshPayloadContext/State.cjs +0 -19
  324. package/dist/node/contexts/RefreshPayloadContext/State.cjs.map +0 -1
  325. package/dist/node/contexts/RefreshPayloadContext/State.js +0 -1
  326. package/dist/node/contexts/RefreshPayloadContext/State.js.map +0 -1
  327. package/dist/node/contexts/RefreshPayloadContext/index.cjs +0 -50
  328. package/dist/node/contexts/RefreshPayloadContext/index.cjs.map +0 -1
  329. package/dist/node/contexts/RefreshPayloadContext/index.js +0 -22
  330. package/dist/node/contexts/RefreshPayloadContext/index.js.map +0 -1
  331. package/dist/node/contexts/RefreshPayloadContext/use.cjs +0 -38
  332. package/dist/node/contexts/RefreshPayloadContext/use.cjs.map +0 -1
  333. package/dist/node/contexts/RefreshPayloadContext/use.js +0 -13
  334. package/dist/node/contexts/RefreshPayloadContext/use.js.map +0 -1
  335. package/dist/node/contexts/ResolvePayloadContext/Context.cjs +0 -32
  336. package/dist/node/contexts/ResolvePayloadContext/Context.cjs.map +0 -1
  337. package/dist/node/contexts/ResolvePayloadContext/Context.js +0 -7
  338. package/dist/node/contexts/ResolvePayloadContext/Context.js.map +0 -1
  339. package/dist/node/contexts/ResolvePayloadContext/Provider.cjs +0 -92
  340. package/dist/node/contexts/ResolvePayloadContext/Provider.cjs.map +0 -1
  341. package/dist/node/contexts/ResolvePayloadContext/Provider.js +0 -67
  342. package/dist/node/contexts/ResolvePayloadContext/Provider.js.map +0 -1
  343. package/dist/node/contexts/ResolvePayloadContext/State.cjs +0 -19
  344. package/dist/node/contexts/ResolvePayloadContext/State.cjs.map +0 -1
  345. package/dist/node/contexts/ResolvePayloadContext/State.js +0 -1
  346. package/dist/node/contexts/ResolvePayloadContext/State.js.map +0 -1
  347. package/dist/node/contexts/ResolvePayloadContext/index.cjs +0 -102
  348. package/dist/node/contexts/ResolvePayloadContext/index.cjs.map +0 -1
  349. package/dist/node/contexts/ResolvePayloadContext/index.js +0 -73
  350. package/dist/node/contexts/ResolvePayloadContext/index.js.map +0 -1
  351. package/dist/node/contexts/ResolvePayloadContext/use.cjs +0 -38
  352. package/dist/node/contexts/ResolvePayloadContext/use.cjs.map +0 -1
  353. package/dist/node/contexts/ResolvePayloadContext/use.js +0 -13
  354. package/dist/node/contexts/ResolvePayloadContext/use.js.map +0 -1
  355. package/dist/node/contexts/ValidatePayloadContext/Context.cjs +0 -32
  356. package/dist/node/contexts/ValidatePayloadContext/Context.cjs.map +0 -1
  357. package/dist/node/contexts/ValidatePayloadContext/Context.js +0 -7
  358. package/dist/node/contexts/ValidatePayloadContext/Context.js.map +0 -1
  359. package/dist/node/contexts/ValidatePayloadContext/Provider.cjs +0 -70
  360. package/dist/node/contexts/ValidatePayloadContext/Provider.cjs.map +0 -1
  361. package/dist/node/contexts/ValidatePayloadContext/Provider.js +0 -45
  362. package/dist/node/contexts/ValidatePayloadContext/Provider.js.map +0 -1
  363. package/dist/node/contexts/ValidatePayloadContext/State.cjs +0 -19
  364. package/dist/node/contexts/ValidatePayloadContext/State.cjs.map +0 -1
  365. package/dist/node/contexts/ValidatePayloadContext/State.js +0 -1
  366. package/dist/node/contexts/ValidatePayloadContext/State.js.map +0 -1
  367. package/dist/node/contexts/ValidatePayloadContext/index.cjs +0 -78
  368. package/dist/node/contexts/ValidatePayloadContext/index.cjs.map +0 -1
  369. package/dist/node/contexts/ValidatePayloadContext/index.js +0 -50
  370. package/dist/node/contexts/ValidatePayloadContext/index.js.map +0 -1
  371. package/dist/node/contexts/ValidatePayloadContext/use.cjs +0 -38
  372. package/dist/node/contexts/ValidatePayloadContext/use.cjs.map +0 -1
  373. package/dist/node/contexts/ValidatePayloadContext/use.js +0 -13
  374. package/dist/node/contexts/ValidatePayloadContext/use.js.map +0 -1
  375. package/dist/node/contexts/index.cjs +0 -202
  376. package/dist/node/contexts/index.cjs.map +0 -1
  377. package/dist/node/contexts/index.js +0 -166
  378. package/dist/node/contexts/index.js.map +0 -1
  379. package/dist/node/types/EmbedPluginProps.cjs +0 -19
  380. package/dist/node/types/EmbedPluginProps.cjs.map +0 -1
  381. package/dist/node/types/EmbedPluginProps.js +0 -1
  382. package/dist/node/types/EmbedPluginProps.js.map +0 -1
  383. package/dist/node/types/index.cjs +0 -19
  384. package/dist/node/types/index.cjs.map +0 -1
  385. package/dist/node/types/index.js +0 -1
  386. package/dist/node/types/index.js.map +0 -1
@@ -1,255 +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/components/EmbedPlugin.tsx
21
- var EmbedPlugin_exports = {};
22
- __export(EmbedPlugin_exports, {
23
- EmbedPluginInner: () => EmbedPluginInner
24
- });
25
- module.exports = __toCommonJS(EmbedPlugin_exports);
26
- var import_react_shared10 = require("@xyo-network/react-shared");
27
-
28
- // src/contexts/EmbedPluginContext/Context.tsx
29
- var import_react_shared = require("@xyo-network/react-shared");
30
- var EmbedPluginContext = (0, import_react_shared.createContextEx)();
31
-
32
- // src/contexts/EmbedPluginContext/Provider.tsx
33
- var import_react = require("react");
34
- var import_jsx_runtime = require("react/jsx-runtime");
35
- var EmbedPluginProvider = ({
36
- children,
37
- refreshTitle,
38
- timestampLabel,
39
- hideElementsConfig,
40
- plugins,
41
- embedPluginConfig
42
- }) => {
43
- const [activePlugin, setActivePlugin] = (0, import_react.useState)(plugins ? plugins[0] : void 0);
44
- (0, import_react.useEffect)(() => {
45
- setActivePlugin(plugins ? plugins[0] : void 0);
46
- }, [plugins]);
47
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
- EmbedPluginContext.Provider,
49
- {
50
- value: {
51
- activePlugin,
52
- embedPluginConfig,
53
- hideElementsConfig,
54
- provided: true,
55
- refreshTitle,
56
- setActivePlugin,
57
- timestampLabel
58
- },
59
- children
60
- }
61
- );
62
- };
63
-
64
- // src/contexts/EmbedPluginContext/use.tsx
65
- var import_react_shared2 = require("@xyo-network/react-shared");
66
- var useEmbedPluginState = () => (0, import_react_shared2.useContextEx)(EmbedPluginContext, "EmbedPlugin", true);
67
-
68
- // src/contexts/RefreshPayloadContext/Provider.tsx
69
- var import_react2 = require("react");
70
-
71
- // src/contexts/RefreshPayloadContext/Context.tsx
72
- var import_react_shared3 = require("@xyo-network/react-shared");
73
- var RefreshPayloadContext = (0, import_react_shared3.createContextEx)();
74
-
75
- // src/contexts/RefreshPayloadContext/Provider.tsx
76
- var import_jsx_runtime2 = require("react/jsx-runtime");
77
- var RefreshPayloadProvider = ({ children, onRefresh, refreshPayload }) => {
78
- const [localRefreshPayload, setRefreshPayload] = (0, import_react2.useState)(refreshPayload);
79
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RefreshPayloadContext.Provider, { value: { onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload }, children });
80
- };
81
-
82
- // src/contexts/RefreshPayloadContext/use.tsx
83
- var import_react_shared4 = require("@xyo-network/react-shared");
84
- var useRefreshPayload = () => (0, import_react_shared4.useContextEx)(RefreshPayloadContext, "RefreshPayload", true);
85
-
86
- // src/contexts/ResolvePayloadContext/Context.ts
87
- var import_react_shared5 = require("@xyo-network/react-shared");
88
- var ResolvePayloadContext = (0, import_react_shared5.createContextEx)();
89
-
90
- // src/contexts/ResolvePayloadContext/Provider.tsx
91
- var import_delay = require("@xylabs/delay");
92
- var import_react_async_effect = require("@xylabs/react-async-effect");
93
- var import_huri = require("@xyo-network/huri");
94
- var import_payload_model = require("@xyo-network/payload-model");
95
- var import_react3 = require("react");
96
- var import_jsx_runtime3 = require("react/jsx-runtime");
97
- var ResolvePayloadProvider = ({ children, huriPayload }) => {
98
- const [payload, setPayload] = (0, import_react3.useState)();
99
- const [huri, setHuri] = (0, import_react3.useState)();
100
- const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload();
101
- (0, import_react3.useEffect)(() => {
102
- typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
103
- if (typeof huriPayload === "object") {
104
- setPayload(huriPayload);
105
- setRefreshPayload == null ? void 0 : setRefreshPayload(true);
106
- }
107
- }, [huriPayload, setRefreshPayload]);
108
- const [notFound, setNotFound] = (0, import_react3.useState)();
109
- const [huriError, setHuriError] = (0, import_react3.useState)();
110
- (0, import_react_async_effect.useAsyncEffect)(
111
- // eslint-disable-next-line react-hooks/exhaustive-deps
112
- async (mounted) => {
113
- if (huri && !refreshPayload) {
114
- try {
115
- const huriInstance = new import_huri.Huri(huri);
116
- const result = await huriInstance.fetch();
117
- await (0, import_delay.delay)(500);
118
- if (mounted()) {
119
- setNotFound(result === null);
120
- setPayload(result);
121
- setRefreshPayload == null ? void 0 : setRefreshPayload(true);
122
- }
123
- } catch (e) {
124
- const error = e;
125
- setHuriError({ message: error.message, schema: import_payload_model.ModuleErrorSchema, sources: [] });
126
- }
127
- }
128
- },
129
- [huri, payload, refreshPayload, setRefreshPayload]
130
- );
131
- const refreshHuri = () => {
132
- onRefresh == null ? void 0 : onRefresh();
133
- if (huri) {
134
- setRefreshPayload == null ? void 0 : setRefreshPayload(false);
135
- }
136
- };
137
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ResolvePayloadContext.Provider, { value: { huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }, children });
138
- };
139
-
140
- // src/contexts/ResolvePayloadContext/use.tsx
141
- var import_react_shared6 = require("@xyo-network/react-shared");
142
- var useResolvePayload = () => (0, import_react_shared6.useContextEx)(ResolvePayloadContext, "ResolvePayload", true);
143
-
144
- // src/contexts/ValidatePayloadContext/Provider.tsx
145
- var import_material = require("@mui/material");
146
- var import_react_async_effect2 = require("@xylabs/react-async-effect");
147
- var import_schema_cache = require("@xyo-network/schema-cache");
148
- var import_react4 = require("react");
149
-
150
- // src/contexts/ValidatePayloadContext/Context.ts
151
- var import_react_shared7 = require("@xyo-network/react-shared");
152
- var ValidatePayloadContext = (0, import_react_shared7.createContextEx)();
153
-
154
- // src/contexts/ValidatePayloadContext/Provider.tsx
155
- var import_jsx_runtime4 = require("react/jsx-runtime");
156
- var ValidatePayloadProvider = ({ children, enabled = false }) => {
157
- const { payload } = useResolvePayload();
158
- const [initialized, setInitialized] = (0, import_react4.useState)(false);
159
- const [valid, setValid] = (0, import_react4.useState)();
160
- (0, import_react_async_effect2.useAsyncEffect)(
161
- // eslint-disable-next-line react-hooks/exhaustive-deps
162
- async () => {
163
- if (payload && enabled) {
164
- await import_schema_cache.SchemaCache.instance.get(payload.schema);
165
- const possibleKnownSchema = payload.schema;
166
- if (import_schema_cache.SchemaCache.instance.validators[possibleKnownSchema]) {
167
- const validator = import_schema_cache.SchemaCache.instance.validators[possibleKnownSchema];
168
- setValid(validator == null ? void 0 : validator(payload));
169
- }
170
- setInitialized(true);
171
- }
172
- },
173
- [payload, enabled]
174
- );
175
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ValidatePayloadContext.Provider, { value: { enabled, provided: true, schema: payload == null ? void 0 : payload.schema, validPayload: valid }, children: enabled ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: initialized ? children : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material.Chip, { label: "Validating Payload..." }) }) : children });
176
- };
177
-
178
- // src/contexts/ValidatePayloadContext/use.tsx
179
- var import_react_shared8 = require("@xyo-network/react-shared");
180
- var useValidatePayload = () => (0, import_react_shared8.useContextEx)(ValidatePayloadContext, "ValidateSchema", true);
181
-
182
- // src/components/EmbedResolver.tsx
183
- var import_react_shared9 = require("@xyo-network/react-shared");
184
- var import_jsx_runtime5 = require("react/jsx-runtime");
185
- var EmbedResolver = ({ children }) => {
186
- const { payload, notFound, huriError } = useResolvePayload();
187
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_shared9.LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
188
- };
189
-
190
- // src/components/validation-alerts/ValidatePayload.tsx
191
- var import_material2 = require("@mui/material");
192
- var import_jsx_runtime6 = require("react/jsx-runtime");
193
- var ValidatePayloadAlert = ({ children, ...props }) => {
194
- const { validPayload, enabled, schema } = useValidatePayload();
195
- if (enabled && validPayload === false) {
196
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Alert, { severity: "error", title: "Invalid Payload!", ...props, children: [
197
- "Payload schema claimed to be ",
198
- schema,
199
- " but failed to validate."
200
- ] });
201
- }
202
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
203
- };
204
-
205
- // src/components/validation-alerts/ValidatePlugins.tsx
206
- var import_material3 = require("@mui/material");
207
- var import_jsx_runtime7 = require("react/jsx-runtime");
208
- var ValidatePluginsAlert = ({ children, ...props }) => {
209
- const { payload } = useResolvePayload();
210
- const { plugins } = useEmbedPluginState();
211
- if (payload && (plugins == null ? void 0 : plugins.length) === 0) {
212
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material3.Alert, { severity: "warning", ...props, children: [
213
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material3.AlertTitle, { children: "Missing plugins!" }),
214
- "Payload found but no plugins were present."
215
- ] });
216
- }
217
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children });
218
- };
219
-
220
- // src/components/EmbedPlugin.tsx
221
- var import_jsx_runtime8 = require("react/jsx-runtime");
222
- var EmbedPluginInner = ({
223
- validateSchema,
224
- plugins = [],
225
- huriPayload,
226
- refreshTitle = "",
227
- timestampLabel = "Data From",
228
- hideElementsConfig,
229
- embedPluginConfig,
230
- onRefresh,
231
- children
232
- }) => {
233
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_shared10.ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
234
- EmbedPluginProvider,
235
- {
236
- refreshTitle,
237
- timestampLabel,
238
- hideElementsConfig,
239
- plugins,
240
- embedPluginConfig,
241
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(WithResolvers, { onRefresh, huriPayload, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(WithValidators, { validateSchema, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_shared10.ListModeProvider, { defaultListMode: embedPluginConfig == null ? void 0 : embedPluginConfig.listMode, children }) }) })
242
- }
243
- ) });
244
- };
245
- var WithResolvers = ({ children, onRefresh, huriPayload }) => {
246
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RefreshPayloadProvider, { onRefresh, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ResolvePayloadProvider, { huriPayload, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(EmbedResolver, { children }) }) });
247
- };
248
- var WithValidators = ({ children, validateSchema }) => {
249
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ValidatePayloadProvider, { enabled: validateSchema, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ValidatePluginsAlert, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ValidatePayloadAlert, { children }) }) });
250
- };
251
- // Annotate the CommonJS export names for ESM import in node:
252
- 0 && (module.exports = {
253
- EmbedPluginInner
254
- });
255
- //# sourceMappingURL=EmbedPlugin.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/EmbedPlugin.tsx","../../../src/contexts/EmbedPluginContext/Context.tsx","../../../src/contexts/EmbedPluginContext/Provider.tsx","../../../src/contexts/EmbedPluginContext/use.tsx","../../../src/contexts/RefreshPayloadContext/Provider.tsx","../../../src/contexts/RefreshPayloadContext/Context.tsx","../../../src/contexts/RefreshPayloadContext/use.tsx","../../../src/contexts/ResolvePayloadContext/Context.ts","../../../src/contexts/ResolvePayloadContext/Provider.tsx","../../../src/contexts/ResolvePayloadContext/use.tsx","../../../src/contexts/ValidatePayloadContext/Provider.tsx","../../../src/contexts/ValidatePayloadContext/Context.ts","../../../src/contexts/ValidatePayloadContext/use.tsx","../../../src/components/EmbedResolver.tsx","../../../src/components/validation-alerts/ValidatePayload.tsx","../../../src/components/validation-alerts/ValidatePlugins.tsx"],"sourcesContent":["import { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { ErrorBoundary, ListModeProvider } from '@xyo-network/react-shared'\n\nimport { EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider } from '../contexts'\nimport { EmbedPluginProps } from '../types'\nimport { EmbedResolver } from './EmbedResolver'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts'\n\nexport const EmbedPluginInner: React.FC<WithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<WithChildren<WithResolversProps>> = ({ children, onRefresh, huriPayload }) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<WithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { EmbedPluginState } from './State'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n","import { WithChildren } from '@xylabs/react-shared'\nimport { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\nimport { useEffect, useState } from 'react'\n\nimport { EmbedPluginContext } from './Context'\nimport { EmbedPluginBase } from './State'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<WithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useState<PayloadRenderPlugin | undefined>(plugins ? plugins[0] : undefined)\n\n useEffect(() => {\n setActivePlugin(plugins ? plugins[0] : undefined)\n }, [plugins])\n\n return (\n <EmbedPluginContext.Provider\n value={{\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }}\n >\n {children}\n </EmbedPluginContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { EmbedPluginContext } from './Context'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n","import { WithChildren } from '@xylabs/react-shared'\nimport { useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<WithChildren<RefreshPayloadProps>> = ({ children, onRefresh, refreshPayload }) => {\n const [localRefreshPayload, setRefreshPayload] = useState(refreshPayload)\n\n return (\n <RefreshPayloadContext.Provider value={{ onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload }}>\n {children}\n </RefreshPayloadContext.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","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 { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","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 { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadContext } from './Context'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n","import { WithChildren } from '@xylabs/react-shared'\nimport { LoadResult } from '@xyo-network/react-shared'\n\nimport { useResolvePayload } from '../contexts'\n\nexport const EmbedResolver: React.FC<WithChildren> = ({ children }) => {\n const { payload, notFound, huriError } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n","import { Alert, AlertProps } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\n\nimport { useValidatePayload } from '../../contexts'\n\nexport const ValidatePayloadAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {\n const { validPayload, enabled, schema } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be {schema} but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import { Alert, AlertProps, AlertTitle } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts'\n\nexport const ValidatePluginsAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,wBAAgD;;;ACFhD,0BAAgC;AAIzB,IAAM,yBAAqB,qCAAkC;;;ACFpE,mBAAoC;AAuBhC;AAfG,IAAM,sBAAwE,CAAC;AAAA,EACpF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,cAAc,eAAe,QAAI,uBAA0C,UAAU,QAAQ,CAAC,IAAI,MAAS;AAElH,8BAAU,MAAM;AACd,oBAAgB,UAAU,QAAQ,CAAC,IAAI,MAAS;AAAA,EAClD,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACvCA,IAAAC,uBAA6B;AAItB,IAAM,sBAAsB,UAAM,mCAAa,oBAAoB,eAAe,IAAI;;;ACH7F,IAAAC,gBAAyB;;;ACDzB,IAAAC,uBAAgC;AAIzB,IAAM,4BAAwB,sCAAqC;;;ADUtE,IAAAC,sBAAA;AAJG,IAAM,yBAAsE,CAAC,EAAE,UAAU,WAAW,eAAe,MAAM;AAC9H,QAAM,CAAC,qBAAqB,iBAAiB,QAAI,wBAAS,cAAc;AAExE,SACE,6CAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,WAAW,UAAU,MAAM,gBAAgB,qBAAqB,kBAAkB,GACxH,UACH;AAEJ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AAA,MAEA,uDAAC,iBAAc,WAAsB,aACnC,uDAAC,kBAAe,gBACd,uDAAC,0CAAiB,iBAAiB,uDAAmB,UAAW,UAAS,GAC5E,GACF;AAAA;AAAA,EACF,GACF;AAEJ;AAIA,IAAM,gBAA4D,CAAC,EAAE,UAAU,WAAW,YAAY,MAAM;AAC1G,SACE,6CAAC,0BAAuB,WACtB,uDAAC,0BAAuB,aACtB,uDAAC,iBAAe,UAAS,GAC3B,GACF;AAEJ;AAEA,IAAM,iBAAuE,CAAC,EAAE,UAAU,eAAe,MAAM;AAC7G,SACE,6CAAC,2BAAwB,SAAS,gBAChC,uDAAC,wBACC,uDAAC,wBAAsB,UAAS,GAClC,GACF;AAEJ;","names":["import_react_shared","import_react_shared","import_react","import_react_shared","import_jsx_runtime","import_react_shared","import_react_shared","import_react","import_jsx_runtime","import_react_shared","import_react_async_effect","import_react","import_react_shared","import_jsx_runtime","import_react_shared","import_react_shared","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_jsx_runtime"]}
@@ -1,230 +0,0 @@
1
- // src/components/EmbedPlugin.tsx
2
- import { ErrorBoundary, ListModeProvider } from "@xyo-network/react-shared";
3
-
4
- // src/contexts/EmbedPluginContext/Context.tsx
5
- import { createContextEx } from "@xyo-network/react-shared";
6
- var EmbedPluginContext = createContextEx();
7
-
8
- // src/contexts/EmbedPluginContext/Provider.tsx
9
- import { useEffect, useState } from "react";
10
- import { jsx } from "react/jsx-runtime";
11
- var EmbedPluginProvider = ({
12
- children,
13
- refreshTitle,
14
- timestampLabel,
15
- hideElementsConfig,
16
- plugins,
17
- embedPluginConfig
18
- }) => {
19
- const [activePlugin, setActivePlugin] = useState(plugins ? plugins[0] : void 0);
20
- useEffect(() => {
21
- setActivePlugin(plugins ? plugins[0] : void 0);
22
- }, [plugins]);
23
- return /* @__PURE__ */ jsx(
24
- EmbedPluginContext.Provider,
25
- {
26
- value: {
27
- activePlugin,
28
- embedPluginConfig,
29
- hideElementsConfig,
30
- provided: true,
31
- refreshTitle,
32
- setActivePlugin,
33
- timestampLabel
34
- },
35
- children
36
- }
37
- );
38
- };
39
-
40
- // src/contexts/EmbedPluginContext/use.tsx
41
- import { useContextEx } from "@xyo-network/react-shared";
42
- var useEmbedPluginState = () => useContextEx(EmbedPluginContext, "EmbedPlugin", true);
43
-
44
- // src/contexts/RefreshPayloadContext/Provider.tsx
45
- import { useState as useState2 } from "react";
46
-
47
- // src/contexts/RefreshPayloadContext/Context.tsx
48
- import { createContextEx as createContextEx2 } from "@xyo-network/react-shared";
49
- var RefreshPayloadContext = createContextEx2();
50
-
51
- // src/contexts/RefreshPayloadContext/Provider.tsx
52
- import { jsx as jsx2 } from "react/jsx-runtime";
53
- var RefreshPayloadProvider = ({ children, onRefresh, refreshPayload }) => {
54
- const [localRefreshPayload, setRefreshPayload] = useState2(refreshPayload);
55
- return /* @__PURE__ */ jsx2(RefreshPayloadContext.Provider, { value: { onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload }, children });
56
- };
57
-
58
- // src/contexts/RefreshPayloadContext/use.tsx
59
- import { useContextEx as useContextEx2 } from "@xyo-network/react-shared";
60
- var useRefreshPayload = () => useContextEx2(RefreshPayloadContext, "RefreshPayload", true);
61
-
62
- // src/contexts/ResolvePayloadContext/Context.ts
63
- import { createContextEx as createContextEx3 } from "@xyo-network/react-shared";
64
- var ResolvePayloadContext = createContextEx3();
65
-
66
- // src/contexts/ResolvePayloadContext/Provider.tsx
67
- import { delay } from "@xylabs/delay";
68
- import { useAsyncEffect } from "@xylabs/react-async-effect";
69
- import { Huri } from "@xyo-network/huri";
70
- import { ModuleErrorSchema } from "@xyo-network/payload-model";
71
- import { useEffect as useEffect2, useState as useState3 } from "react";
72
- import { jsx as jsx3 } from "react/jsx-runtime";
73
- var ResolvePayloadProvider = ({ children, huriPayload }) => {
74
- const [payload, setPayload] = useState3();
75
- const [huri, setHuri] = useState3();
76
- const { refreshPayload, setRefreshPayload, onRefresh } = useRefreshPayload();
77
- useEffect2(() => {
78
- typeof huriPayload === "string" ? setHuri(huriPayload) : void 0;
79
- if (typeof huriPayload === "object") {
80
- setPayload(huriPayload);
81
- setRefreshPayload == null ? void 0 : setRefreshPayload(true);
82
- }
83
- }, [huriPayload, setRefreshPayload]);
84
- const [notFound, setNotFound] = useState3();
85
- const [huriError, setHuriError] = useState3();
86
- useAsyncEffect(
87
- // eslint-disable-next-line react-hooks/exhaustive-deps
88
- async (mounted) => {
89
- if (huri && !refreshPayload) {
90
- try {
91
- const huriInstance = new Huri(huri);
92
- const result = await huriInstance.fetch();
93
- await delay(500);
94
- if (mounted()) {
95
- setNotFound(result === null);
96
- setPayload(result);
97
- setRefreshPayload == null ? void 0 : setRefreshPayload(true);
98
- }
99
- } catch (e) {
100
- const error = e;
101
- setHuriError({ message: error.message, schema: ModuleErrorSchema, sources: [] });
102
- }
103
- }
104
- },
105
- [huri, payload, refreshPayload, setRefreshPayload]
106
- );
107
- const refreshHuri = () => {
108
- onRefresh == null ? void 0 : onRefresh();
109
- if (huri) {
110
- setRefreshPayload == null ? void 0 : setRefreshPayload(false);
111
- }
112
- };
113
- return /* @__PURE__ */ jsx3(ResolvePayloadContext.Provider, { value: { huri, huriError, notFound, payload, provided: true, refreshHuri, setPayload }, children });
114
- };
115
-
116
- // src/contexts/ResolvePayloadContext/use.tsx
117
- import { useContextEx as useContextEx3 } from "@xyo-network/react-shared";
118
- var useResolvePayload = () => useContextEx3(ResolvePayloadContext, "ResolvePayload", true);
119
-
120
- // src/contexts/ValidatePayloadContext/Provider.tsx
121
- import { Chip } from "@mui/material";
122
- import { useAsyncEffect as useAsyncEffect2 } from "@xylabs/react-async-effect";
123
- import { SchemaCache } from "@xyo-network/schema-cache";
124
- import { useState as useState4 } from "react";
125
-
126
- // src/contexts/ValidatePayloadContext/Context.ts
127
- import { createContextEx as createContextEx4 } from "@xyo-network/react-shared";
128
- var ValidatePayloadContext = createContextEx4();
129
-
130
- // src/contexts/ValidatePayloadContext/Provider.tsx
131
- import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
132
- var ValidatePayloadProvider = ({ children, enabled = false }) => {
133
- const { payload } = useResolvePayload();
134
- const [initialized, setInitialized] = useState4(false);
135
- const [valid, setValid] = useState4();
136
- useAsyncEffect2(
137
- // eslint-disable-next-line react-hooks/exhaustive-deps
138
- async () => {
139
- if (payload && enabled) {
140
- await SchemaCache.instance.get(payload.schema);
141
- const possibleKnownSchema = payload.schema;
142
- if (SchemaCache.instance.validators[possibleKnownSchema]) {
143
- const validator = SchemaCache.instance.validators[possibleKnownSchema];
144
- setValid(validator == null ? void 0 : validator(payload));
145
- }
146
- setInitialized(true);
147
- }
148
- },
149
- [payload, enabled]
150
- );
151
- return /* @__PURE__ */ jsx4(ValidatePayloadContext.Provider, { value: { enabled, provided: true, schema: payload == null ? void 0 : payload.schema, validPayload: valid }, children: enabled ? /* @__PURE__ */ jsx4(Fragment, { children: initialized ? children : /* @__PURE__ */ jsx4(Chip, { label: "Validating Payload..." }) }) : children });
152
- };
153
-
154
- // src/contexts/ValidatePayloadContext/use.tsx
155
- import { useContextEx as useContextEx4 } from "@xyo-network/react-shared";
156
- var useValidatePayload = () => useContextEx4(ValidatePayloadContext, "ValidateSchema", true);
157
-
158
- // src/components/EmbedResolver.tsx
159
- import { LoadResult } from "@xyo-network/react-shared";
160
- import { jsx as jsx5 } from "react/jsx-runtime";
161
- var EmbedResolver = ({ children }) => {
162
- const { payload, notFound, huriError } = useResolvePayload();
163
- return /* @__PURE__ */ jsx5(LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
164
- };
165
-
166
- // src/components/validation-alerts/ValidatePayload.tsx
167
- import { Alert } from "@mui/material";
168
- import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
169
- var ValidatePayloadAlert = ({ children, ...props }) => {
170
- const { validPayload, enabled, schema } = useValidatePayload();
171
- if (enabled && validPayload === false) {
172
- return /* @__PURE__ */ jsxs(Alert, { severity: "error", title: "Invalid Payload!", ...props, children: [
173
- "Payload schema claimed to be ",
174
- schema,
175
- " but failed to validate."
176
- ] });
177
- }
178
- return /* @__PURE__ */ jsx6(Fragment2, { children });
179
- };
180
-
181
- // src/components/validation-alerts/ValidatePlugins.tsx
182
- import { Alert as Alert2, AlertTitle } from "@mui/material";
183
- import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
184
- var ValidatePluginsAlert = ({ children, ...props }) => {
185
- const { payload } = useResolvePayload();
186
- const { plugins } = useEmbedPluginState();
187
- if (payload && (plugins == null ? void 0 : plugins.length) === 0) {
188
- return /* @__PURE__ */ jsxs2(Alert2, { severity: "warning", ...props, children: [
189
- /* @__PURE__ */ jsx7(AlertTitle, { children: "Missing plugins!" }),
190
- "Payload found but no plugins were present."
191
- ] });
192
- }
193
- return /* @__PURE__ */ jsx7(Fragment3, { children });
194
- };
195
-
196
- // src/components/EmbedPlugin.tsx
197
- import { jsx as jsx8 } from "react/jsx-runtime";
198
- var EmbedPluginInner = ({
199
- validateSchema,
200
- plugins = [],
201
- huriPayload,
202
- refreshTitle = "",
203
- timestampLabel = "Data From",
204
- hideElementsConfig,
205
- embedPluginConfig,
206
- onRefresh,
207
- children
208
- }) => {
209
- return /* @__PURE__ */ jsx8(ErrorBoundary, { children: /* @__PURE__ */ jsx8(
210
- EmbedPluginProvider,
211
- {
212
- refreshTitle,
213
- timestampLabel,
214
- hideElementsConfig,
215
- plugins,
216
- embedPluginConfig,
217
- children: /* @__PURE__ */ jsx8(WithResolvers, { onRefresh, huriPayload, children: /* @__PURE__ */ jsx8(WithValidators, { validateSchema, children: /* @__PURE__ */ jsx8(ListModeProvider, { defaultListMode: embedPluginConfig == null ? void 0 : embedPluginConfig.listMode, children }) }) })
218
- }
219
- ) });
220
- };
221
- var WithResolvers = ({ children, onRefresh, huriPayload }) => {
222
- return /* @__PURE__ */ jsx8(RefreshPayloadProvider, { onRefresh, children: /* @__PURE__ */ jsx8(ResolvePayloadProvider, { huriPayload, children: /* @__PURE__ */ jsx8(EmbedResolver, { children }) }) });
223
- };
224
- var WithValidators = ({ children, validateSchema }) => {
225
- return /* @__PURE__ */ jsx8(ValidatePayloadProvider, { enabled: validateSchema, children: /* @__PURE__ */ jsx8(ValidatePluginsAlert, { children: /* @__PURE__ */ jsx8(ValidatePayloadAlert, { children }) }) });
226
- };
227
- export {
228
- EmbedPluginInner
229
- };
230
- //# sourceMappingURL=EmbedPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/EmbedPlugin.tsx","../../../src/contexts/EmbedPluginContext/Context.tsx","../../../src/contexts/EmbedPluginContext/Provider.tsx","../../../src/contexts/EmbedPluginContext/use.tsx","../../../src/contexts/RefreshPayloadContext/Provider.tsx","../../../src/contexts/RefreshPayloadContext/Context.tsx","../../../src/contexts/RefreshPayloadContext/use.tsx","../../../src/contexts/ResolvePayloadContext/Context.ts","../../../src/contexts/ResolvePayloadContext/Provider.tsx","../../../src/contexts/ResolvePayloadContext/use.tsx","../../../src/contexts/ValidatePayloadContext/Provider.tsx","../../../src/contexts/ValidatePayloadContext/Context.ts","../../../src/contexts/ValidatePayloadContext/use.tsx","../../../src/components/EmbedResolver.tsx","../../../src/components/validation-alerts/ValidatePayload.tsx","../../../src/components/validation-alerts/ValidatePlugins.tsx"],"sourcesContent":["import { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { ErrorBoundary, ListModeProvider } from '@xyo-network/react-shared'\n\nimport { EmbedPluginProvider, RefreshPayloadProvider, ResolvePayloadProvider, ValidatePayloadProvider } from '../contexts'\nimport { EmbedPluginProps } from '../types'\nimport { EmbedResolver } from './EmbedResolver'\nimport { ValidatePayloadAlert, ValidatePluginsAlert } from './validation-alerts'\n\nexport const EmbedPluginInner: React.FC<WithChildren<EmbedPluginProps>> = ({\n validateSchema,\n plugins = [],\n huriPayload,\n refreshTitle = '',\n timestampLabel = 'Data From',\n hideElementsConfig,\n embedPluginConfig,\n onRefresh,\n children,\n}) => {\n return (\n <ErrorBoundary>\n <EmbedPluginProvider\n refreshTitle={refreshTitle}\n timestampLabel={timestampLabel}\n hideElementsConfig={hideElementsConfig}\n plugins={plugins}\n embedPluginConfig={embedPluginConfig}\n >\n <WithResolvers onRefresh={onRefresh} huriPayload={huriPayload}>\n <WithValidators validateSchema={validateSchema}>\n <ListModeProvider defaultListMode={embedPluginConfig?.listMode}>{children}</ListModeProvider>\n </WithValidators>\n </WithResolvers>\n </EmbedPluginProvider>\n </ErrorBoundary>\n )\n}\n\ninterface WithResolversProps extends Pick<EmbedPluginProps, 'onRefresh' | 'huriPayload'>, FlexBoxProps {}\n\nconst WithResolvers: React.FC<WithChildren<WithResolversProps>> = ({ children, onRefresh, huriPayload }) => {\n return (\n <RefreshPayloadProvider onRefresh={onRefresh}>\n <ResolvePayloadProvider huriPayload={huriPayload}>\n <EmbedResolver>{children}</EmbedResolver>\n </ResolvePayloadProvider>\n </RefreshPayloadProvider>\n )\n}\n\nconst WithValidators: React.FC<WithChildren<{ validateSchema?: boolean }>> = ({ children, validateSchema }) => {\n return (\n <ValidatePayloadProvider enabled={validateSchema}>\n <ValidatePluginsAlert>\n <ValidatePayloadAlert>{children}</ValidatePayloadAlert>\n </ValidatePluginsAlert>\n </ValidatePayloadProvider>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { EmbedPluginState } from './State'\n\nexport const EmbedPluginContext = createContextEx<EmbedPluginState>()\n","import { WithChildren } from '@xylabs/react-shared'\nimport { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\nimport { useEffect, useState } from 'react'\n\nimport { EmbedPluginContext } from './Context'\nimport { EmbedPluginBase } from './State'\n\nexport type EmbedPluginProviderProps = EmbedPluginBase\n\n/** Expose passed embed plugin props via context */\nexport const EmbedPluginProvider: React.FC<WithChildren<EmbedPluginProviderProps>> = ({\n children,\n refreshTitle,\n timestampLabel,\n hideElementsConfig,\n plugins,\n embedPluginConfig,\n}) => {\n const [activePlugin, setActivePlugin] = useState<PayloadRenderPlugin | undefined>(plugins ? plugins[0] : undefined)\n\n useEffect(() => {\n setActivePlugin(plugins ? plugins[0] : undefined)\n }, [plugins])\n\n return (\n <EmbedPluginContext.Provider\n value={{\n activePlugin,\n embedPluginConfig,\n hideElementsConfig,\n provided: true,\n refreshTitle,\n setActivePlugin,\n timestampLabel,\n }}\n >\n {children}\n </EmbedPluginContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { EmbedPluginContext } from './Context'\n\nexport const useEmbedPluginState = () => useContextEx(EmbedPluginContext, 'EmbedPlugin', true)\n","import { WithChildren } from '@xylabs/react-shared'\nimport { useState } from 'react'\n\nimport { RefreshPayloadContext } from './Context'\n\nexport interface RefreshPayloadProps {\n onRefresh?: () => void\n refreshPayload?: boolean\n}\n\nexport const RefreshPayloadProvider: React.FC<WithChildren<RefreshPayloadProps>> = ({ children, onRefresh, refreshPayload }) => {\n const [localRefreshPayload, setRefreshPayload] = useState(refreshPayload)\n\n return (\n <RefreshPayloadContext.Provider value={{ onRefresh, provided: true, refreshPayload: localRefreshPayload, setRefreshPayload }}>\n {children}\n </RefreshPayloadContext.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","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 { useContextEx } from '@xyo-network/react-shared'\n\nimport { ResolvePayloadContext } from './Context'\n\nexport const useResolvePayload = () => useContextEx(ResolvePayloadContext, 'ResolvePayload', true)\n","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 { ValidatePayloadState } from './State'\n\nexport const ValidatePayloadContext = createContextEx<ValidatePayloadState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { ValidatePayloadContext } from './Context'\n\nexport const useValidatePayload = () => useContextEx(ValidatePayloadContext, 'ValidateSchema', true)\n","import { WithChildren } from '@xylabs/react-shared'\nimport { LoadResult } from '@xyo-network/react-shared'\n\nimport { useResolvePayload } from '../contexts'\n\nexport const EmbedResolver: React.FC<WithChildren> = ({ children }) => {\n const { payload, notFound, huriError } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\n )\n}\n","import { Alert, AlertProps } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\n\nimport { useValidatePayload } from '../../contexts'\n\nexport const ValidatePayloadAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {\n const { validPayload, enabled, schema } = useValidatePayload()\n\n if (enabled && validPayload === false) {\n return (\n <Alert severity=\"error\" title=\"Invalid Payload!\" {...props}>\n Payload schema claimed to be {schema} but failed to validate.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n","import { Alert, AlertProps, AlertTitle } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\n\nimport { useEmbedPluginState, useResolvePayload } from '../../contexts'\n\nexport const ValidatePluginsAlert: React.FC<WithChildren<AlertProps>> = ({ children, ...props }) => {\n const { payload } = useResolvePayload()\n const { plugins } = useEmbedPluginState()\n\n if (payload && plugins?.length === 0) {\n return (\n <Alert severity=\"warning\" {...props}>\n <AlertTitle>Missing plugins!</AlertTitle>Payload found but no plugins were present.\n </Alert>\n )\n }\n\n return <>{children}</>\n}\n"],"mappings":";AAEA,SAAS,eAAe,wBAAwB;;;ACFhD,SAAS,uBAAuB;AAIzB,IAAM,qBAAqB,gBAAkC;;;ACFpE,SAAS,WAAW,gBAAgB;AAuBhC;AAfG,IAAM,sBAAwE,CAAC;AAAA,EACpF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,cAAc,eAAe,IAAI,SAA0C,UAAU,QAAQ,CAAC,IAAI,MAAS;AAElH,YAAU,MAAM;AACd,oBAAgB,UAAU,QAAQ,CAAC,IAAI,MAAS;AAAA,EAClD,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACvCA,SAAS,oBAAoB;AAItB,IAAM,sBAAsB,MAAM,aAAa,oBAAo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uBAA2D,CAAC,EAAE,UAAU,GAAG,MAAM,MAAM;AAClG,QAAM,EAAE,QAAQ,IAAI,kBAAkB;AACtC,QAAM,EAAE,QAAQ,IAAI,oBAAoB;AAExC,MAAI,YAAW,mCAAS,YAAW,GAAG;AACpC,WACE,gBAAAA,MAACC,QAAA,EAAM,UAAS,WAAW,GAAG,OAC5B;AAAA,sBAAAF,KAAC,cAAW,8BAAgB;AAAA,MAAa;AAAA,OAC3C;AAAA,EAEJ;AAEA,SAAO,gBAAAA,KAAAD,WAAA,EAAG,UAAS;AACrB;;;AfaY,gBAAAI,YAAA;AAtBL,IAAM,mBAA6D,CAAC;AAAA,EACzE;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SACE,gBAAAA,KAAC,iBACC,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,0BAAAA,KAAC,iBAAc,WAAsB,aACnC,0BAAAA,KAAC,kBAAe,gBACd,0BAAAA,KAAC,oBAAiB,iBAAiB,uDAAmB,UAAW,UAAS,GAC5E,GACF;AAAA;AAAA,EACF,GACF;AAEJ;AAIA,IAAM,gBAA4D,CAAC,EAAE,UAAU,WAAW,YAAY,MAAM;AAC1G,SACE,gBAAAA,KAAC,0BAAuB,WACtB,0BAAAA,KAAC,0BAAuB,aACtB,0BAAAA,KAAC,iBAAe,UAAS,GAC3B,GACF;AAEJ;AAEA,IAAM,iBAAuE,CAAC,EAAE,UAAU,eAAe,MAAM;AAC7G,SACE,gBAAAA,KAAC,2BAAwB,SAAS,gBAChC,0BAAAA,KAAC,wBACC,0BAAAA,KAAC,wBAAsB,UAAS,GAClC,GACF;AAEJ;","names":["useState","createContextEx","jsx","useState","useContextEx","useContextEx","createContextEx","useEffect","useState","jsx","useState","useEffect","useContextEx","useContextEx","useAsyncEffect","useState","createContextEx","jsx","useState","useAsyncEffect","useContextEx","useContextEx","jsx","Fragment","jsx","Alert","Fragment","jsx","jsxs","Alert","jsx"]}
@@ -1,46 +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/components/EmbedResolver.tsx
21
- var EmbedResolver_exports = {};
22
- __export(EmbedResolver_exports, {
23
- EmbedResolver: () => EmbedResolver
24
- });
25
- module.exports = __toCommonJS(EmbedResolver_exports);
26
- var import_react_shared3 = 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 import_react_shared2 = require("@xyo-network/react-shared");
34
- var useResolvePayload = () => (0, import_react_shared2.useContextEx)(ResolvePayloadContext, "ResolvePayload", true);
35
-
36
- // src/components/EmbedResolver.tsx
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
- var EmbedResolver = ({ children }) => {
39
- const { payload, notFound, huriError } = useResolvePayload();
40
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared3.LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
41
- };
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
44
- EmbedResolver
45
- });
46
- //# sourceMappingURL=EmbedResolver.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/EmbedResolver.tsx","../../../src/contexts/ResolvePayloadContext/Context.ts","../../../src/contexts/ResolvePayloadContext/use.tsx"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { LoadResult } from '@xyo-network/react-shared'\n\nimport { useResolvePayload } from '../contexts'\n\nexport const EmbedResolver: React.FC<WithChildren> = ({ children }) => {\n const { payload, notFound, huriError } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,uBAA2B;;;ACD3B,0BAAgC;AAIzB,IAAM,4BAAwB,qCAAqC;;;ACJ1E,IAAAC,uBAA6B;AAItB,IAAM,oBAAoB,UAAM,mCAAa,uBAAuB,kBAAkB,IAAI;;;AFK7F;AAJG,IAAM,gBAAwC,CAAC,EAAE,SAAS,MAAM;AACrE,QAAM,EAAE,SAAS,UAAU,UAAU,IAAI,kBAAkB;AAE3D,SACE,4CAAC,mCAAW,cAAc,SAAS,UAAU,CAAC,CAAC,UAAU,OAAO,CAAC,CAAC,WAC/D,UACH;AAEJ;","names":["import_react_shared","import_react_shared"]}
@@ -1,21 +0,0 @@
1
- // src/components/EmbedResolver.tsx
2
- import { LoadResult } 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
- import { useContextEx } from "@xyo-network/react-shared";
10
- var useResolvePayload = () => useContextEx(ResolvePayloadContext, "ResolvePayload", true);
11
-
12
- // src/components/EmbedResolver.tsx
13
- import { jsx } from "react/jsx-runtime";
14
- var EmbedResolver = ({ children }) => {
15
- const { payload, notFound, huriError } = useResolvePayload();
16
- return /* @__PURE__ */ jsx(LoadResult, { searchResult: payload, notFound: !!notFound, error: !!huriError, children });
17
- };
18
- export {
19
- EmbedResolver
20
- };
21
- //# sourceMappingURL=EmbedResolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/EmbedResolver.tsx","../../../src/contexts/ResolvePayloadContext/Context.ts","../../../src/contexts/ResolvePayloadContext/use.tsx"],"sourcesContent":["import { WithChildren } from '@xylabs/react-shared'\nimport { LoadResult } from '@xyo-network/react-shared'\n\nimport { useResolvePayload } from '../contexts'\n\nexport const EmbedResolver: React.FC<WithChildren> = ({ children }) => {\n const { payload, notFound, huriError } = useResolvePayload()\n\n return (\n <LoadResult searchResult={payload} notFound={!!notFound} error={!!huriError}>\n {children}\n </LoadResult>\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"],"mappings":";AACA,SAAS,kBAAkB;;;ACD3B,SAAS,uBAAuB;AAIzB,IAAM,wBAAwB,gBAAqC;;;ACJ1E,SAAS,oBAAoB;AAItB,IAAM,oBAAoB,MAAM,aAAa,uBAAuB,kBAAkB,IAAI;;;AFK7F;AAJG,IAAM,gBAAwC,CAAC,EAAE,SAAS,MAAM;AACrE,QAAM,EAAE,SAAS,UAAU,UAAU,IAAI,kBAAkB;AAE3D,SACE,oBAAC,cAAW,cAAc,SAAS,UAAU,CAAC,CAAC,UAAU,OAAO,CAAC,CAAC,WAC/D,UACH;AAEJ;","names":[]}