@iota-uz/sdk 0.4.44 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -142
  3. package/dist/client-host/applet.d.ts +52 -0
  4. package/dist/client-host/applet.d.ts.map +1 -0
  5. package/dist/client-host/applet.js +24 -0
  6. package/dist/client-host/cache.d.ts +15 -0
  7. package/dist/client-host/cache.d.ts.map +1 -0
  8. package/dist/client-host/cache.js +27 -0
  9. package/dist/client-host/errors.d.ts +16 -0
  10. package/dist/client-host/errors.d.ts.map +1 -0
  11. package/dist/client-host/errors.js +45 -0
  12. package/dist/client-host/identity.d.ts +21 -0
  13. package/dist/client-host/identity.d.ts.map +1 -0
  14. package/dist/client-host/identity.js +28 -0
  15. package/dist/client-host/index.d.ts +11 -0
  16. package/dist/client-host/index.d.ts.map +1 -0
  17. package/dist/client-host/index.js +10 -0
  18. package/dist/client-host/portals.d.ts +30 -0
  19. package/dist/client-host/portals.d.ts.map +1 -0
  20. package/dist/client-host/portals.js +149 -0
  21. package/dist/client-host/protocol.d.ts +2 -0
  22. package/dist/client-host/protocol.d.ts.map +1 -0
  23. package/dist/client-host/protocol.js +2 -0
  24. package/dist/client-host/route.d.ts +29 -0
  25. package/dist/client-host/route.d.ts.map +1 -0
  26. package/dist/client-host/route.js +32 -0
  27. package/dist/client-host/rpc.d.ts +46 -0
  28. package/dist/client-host/rpc.d.ts.map +1 -0
  29. package/dist/client-host/rpc.js +90 -0
  30. package/dist/client-host/streaming.d.ts +43 -0
  31. package/dist/client-host/streaming.d.ts.map +1 -0
  32. package/dist/client-host/streaming.js +141 -0
  33. package/dist/client-host/transport.d.ts +26 -0
  34. package/dist/client-host/transport.d.ts.map +1 -0
  35. package/dist/client-host/transport.js +53 -0
  36. package/dist/lens/CascadePanel-DqOZFdR-.js +512 -0
  37. package/dist/lens/ChartDataEquivalent-BFDdHoQn.js +52 -0
  38. package/dist/lens/ChartHost-Bl2lxIqU.js +68 -0
  39. package/dist/lens/ChartPanel-CTIp_4YE.js +720 -0
  40. package/dist/lens/CoveragePanel-DZZWkjSv.js +131 -0
  41. package/dist/lens/DashboardPanels.d.ts +36 -0
  42. package/dist/lens/DashboardPanels.d.ts.map +1 -0
  43. package/dist/lens/GaugePanel-BcNdd_Wj.js +43 -0
  44. package/dist/lens/LensDashboard.d.ts +21 -0
  45. package/dist/lens/LensDashboard.d.ts.map +1 -0
  46. package/dist/lens/MapPanel-6sI_Ei9L.js +178 -0
  47. package/dist/lens/MetricFlowPanel-LzqevSPs.js +70 -0
  48. package/dist/lens/MetricHierarchyPanel-h6tJqRPg.js +72 -0
  49. package/dist/lens/MetricRelationshipPanel-CgckUvvJ.js +54 -0
  50. package/dist/lens/PrintReport-DJv4Rm_U.js +1351 -0
  51. package/dist/lens/TablePanel-Dh6bXlwM.js +619 -0
  52. package/dist/lens/adapter-zBDC8hbZ.js +29093 -0
  53. package/dist/lens/breakpoints.d.ts +37 -0
  54. package/dist/lens/breakpoints.d.ts.map +1 -0
  55. package/dist/lens/charts/adapter.d.ts +157 -0
  56. package/dist/lens/charts/adapter.d.ts.map +1 -0
  57. package/dist/lens/charts/echarts/adapter.d.ts +9 -0
  58. package/dist/lens/charts/echarts/adapter.d.ts.map +1 -0
  59. package/dist/lens/charts/echarts/distributions.d.ts +9 -0
  60. package/dist/lens/charts/echarts/distributions.d.ts.map +1 -0
  61. package/dist/lens/charts/echarts/events.d.ts +7 -0
  62. package/dist/lens/charts/echarts/events.d.ts.map +1 -0
  63. package/dist/lens/charts/echarts/options.d.ts +163 -0
  64. package/dist/lens/charts/echarts/options.d.ts.map +1 -0
  65. package/dist/lens/charts/echarts/theme.d.ts +49 -0
  66. package/dist/lens/charts/echarts/theme.d.ts.map +1 -0
  67. package/dist/lens/charts/echarts/tooltip.d.ts +79 -0
  68. package/dist/lens/charts/echarts/tooltip.d.ts.map +1 -0
  69. package/dist/lens/charts/index.d.ts +9 -0
  70. package/dist/lens/charts/index.d.ts.map +1 -0
  71. package/dist/lens/charts/keys.d.ts +8 -0
  72. package/dist/lens/charts/keys.d.ts.map +1 -0
  73. package/dist/lens/charts/overlays.d.ts +134 -0
  74. package/dist/lens/charts/overlays.d.ts.map +1 -0
  75. package/dist/lens/charts/palette.d.ts +54 -0
  76. package/dist/lens/charts/palette.d.ts.map +1 -0
  77. package/dist/lens/charts/scales.d.ts +26 -0
  78. package/dist/lens/charts/scales.d.ts.map +1 -0
  79. package/dist/lens/charts/shares.d.ts +44 -0
  80. package/dist/lens/charts/shares.d.ts.map +1 -0
  81. package/dist/lens/charts/text.d.ts +23 -0
  82. package/dist/lens/charts/text.d.ts.map +1 -0
  83. package/dist/lens/contract/index.d.ts +4 -0
  84. package/dist/lens/contract/index.d.ts.map +1 -0
  85. package/dist/lens/contract/palette.d.ts +13 -0
  86. package/dist/lens/contract/palette.d.ts.map +1 -0
  87. package/dist/lens/contract/schemas.d.ts +132 -0
  88. package/dist/lens/contract/schemas.d.ts.map +1 -0
  89. package/dist/lens/contract/types.d.ts +788 -0
  90. package/dist/lens/contract/types.d.ts.map +1 -0
  91. package/dist/lens/controls/Calendar.d.ts +24 -0
  92. package/dist/lens/controls/Calendar.d.ts.map +1 -0
  93. package/dist/lens/controls/CompareFilterControl.d.ts +23 -0
  94. package/dist/lens/controls/CompareFilterControl.d.ts.map +1 -0
  95. package/dist/lens/controls/FacetFilterMenu.d.ts +29 -0
  96. package/dist/lens/controls/FacetFilterMenu.d.ts.map +1 -0
  97. package/dist/lens/controls/FilterBar.d.ts +30 -0
  98. package/dist/lens/controls/FilterBar.d.ts.map +1 -0
  99. package/dist/lens/controls/PeriodFilterControl.d.ts +50 -0
  100. package/dist/lens/controls/PeriodFilterControl.d.ts.map +1 -0
  101. package/dist/lens/controls/SegmentedFilterControl.d.ts +22 -0
  102. package/dist/lens/controls/SegmentedFilterControl.d.ts.map +1 -0
  103. package/dist/lens/controls/facetOptions.d.ts +33 -0
  104. package/dist/lens/controls/facetOptions.d.ts.map +1 -0
  105. package/dist/lens/controls/index.d.ts +6 -0
  106. package/dist/lens/controls/index.d.ts.map +1 -0
  107. package/dist/lens/controls/model.d.ts +181 -0
  108. package/dist/lens/controls/model.d.ts.map +1 -0
  109. package/dist/lens/drillPrefetch-Bs-6Oyxa.js +68 -0
  110. package/dist/lens/element.d.ts +12 -0
  111. package/dist/lens/element.d.ts.map +1 -0
  112. package/dist/lens/explore/ContextMiniChart.d.ts +18 -0
  113. package/dist/lens/explore/ContextMiniChart.d.ts.map +1 -0
  114. package/dist/lens/explore/DrillOverlay.d.ts +66 -0
  115. package/dist/lens/explore/DrillOverlay.d.ts.map +1 -0
  116. package/dist/lens/explore/ExplorePanel.d.ts +8 -0
  117. package/dist/lens/explore/ExplorePanel.d.ts.map +1 -0
  118. package/dist/lens/explore/FocusContextHeader.d.ts +20 -0
  119. package/dist/lens/explore/FocusContextHeader.d.ts.map +1 -0
  120. package/dist/lens/explore/LensSelector.d.ts +17 -0
  121. package/dist/lens/explore/LensSelector.d.ts.map +1 -0
  122. package/dist/lens/explore/SourceDataDisclosure.d.ts +15 -0
  123. package/dist/lens/explore/SourceDataDisclosure.d.ts.map +1 -0
  124. package/dist/lens/explore/actions.d.ts +22 -0
  125. package/dist/lens/explore/actions.d.ts.map +1 -0
  126. package/dist/lens/explore/focusModel.d.ts +55 -0
  127. package/dist/lens/explore/focusModel.d.ts.map +1 -0
  128. package/dist/lens/explore/index.d.ts +9 -0
  129. package/dist/lens/explore/index.d.ts.map +1 -0
  130. package/dist/lens/explore/model.d.ts +59 -0
  131. package/dist/lens/explore/model.d.ts.map +1 -0
  132. package/dist/lens/export-B0U20F4u.js +57 -0
  133. package/dist/lens/icons.d.ts +103 -0
  134. package/dist/lens/icons.d.ts.map +1 -0
  135. package/dist/lens/idlePrefetch-Bi4Wk1uR.js +80 -0
  136. package/dist/lens/index-C45DAO6w.js +10883 -0
  137. package/dist/lens/index-CspKnSQn.js +11 -0
  138. package/dist/lens/index.d.ts +7 -0
  139. package/dist/lens/index.d.ts.map +1 -0
  140. package/dist/lens/index.js +17 -0
  141. package/dist/lens/install-3GLgv_LN.js +2028 -0
  142. package/dist/lens/install-B5oSx3pv.js +233 -0
  143. package/dist/lens/install-DT0AQkUj.js +1490 -0
  144. package/dist/lens/install-DyXK20dR.js +307 -0
  145. package/dist/lens/keys-DenV5HsJ.js +12 -0
  146. package/dist/lens/listSearch.d.ts +12 -0
  147. package/dist/lens/listSearch.d.ts.map +1 -0
  148. package/dist/lens/metricViews-QvoFHVdh.js +170 -0
  149. package/dist/lens/panels/CascadePanel.d.ts +138 -0
  150. package/dist/lens/panels/CascadePanel.d.ts.map +1 -0
  151. package/dist/lens/panels/ChartDataEquivalent.d.ts +23 -0
  152. package/dist/lens/panels/ChartDataEquivalent.d.ts.map +1 -0
  153. package/dist/lens/panels/ChartHost.d.ts +14 -0
  154. package/dist/lens/panels/ChartHost.d.ts.map +1 -0
  155. package/dist/lens/panels/ChartPanel.d.ts +29 -0
  156. package/dist/lens/panels/ChartPanel.d.ts.map +1 -0
  157. package/dist/lens/panels/CopyValueButton.d.ts +15 -0
  158. package/dist/lens/panels/CopyValueButton.d.ts.map +1 -0
  159. package/dist/lens/panels/CoveragePanel.d.ts +17 -0
  160. package/dist/lens/panels/CoveragePanel.d.ts.map +1 -0
  161. package/dist/lens/panels/ExportMenu.d.ts +12 -0
  162. package/dist/lens/panels/ExportMenu.d.ts.map +1 -0
  163. package/dist/lens/panels/GaugePanel.d.ts +6 -0
  164. package/dist/lens/panels/GaugePanel.d.ts.map +1 -0
  165. package/dist/lens/panels/InfoTip.d.ts +50 -0
  166. package/dist/lens/panels/InfoTip.d.ts.map +1 -0
  167. package/dist/lens/panels/MapPanel.d.ts +17 -0
  168. package/dist/lens/panels/MapPanel.d.ts.map +1 -0
  169. package/dist/lens/panels/MetricFlowPanel.d.ts +6 -0
  170. package/dist/lens/panels/MetricFlowPanel.d.ts.map +1 -0
  171. package/dist/lens/panels/MetricHierarchyPanel.d.ts +6 -0
  172. package/dist/lens/panels/MetricHierarchyPanel.d.ts.map +1 -0
  173. package/dist/lens/panels/MetricRelationshipPanel.d.ts +14 -0
  174. package/dist/lens/panels/MetricRelationshipPanel.d.ts.map +1 -0
  175. package/dist/lens/panels/PanelExportMenu.d.ts +5 -0
  176. package/dist/lens/panels/PanelExportMenu.d.ts.map +1 -0
  177. package/dist/lens/panels/PanelFrame.d.ts +42 -0
  178. package/dist/lens/panels/PanelFrame.d.ts.map +1 -0
  179. package/dist/lens/panels/PanelOverlay.d.ts +19 -0
  180. package/dist/lens/panels/PanelOverlay.d.ts.map +1 -0
  181. package/dist/lens/panels/QualityChip.d.ts +51 -0
  182. package/dist/lens/panels/QualityChip.d.ts.map +1 -0
  183. package/dist/lens/panels/ShareSliceButton.d.ts +3 -0
  184. package/dist/lens/panels/ShareSliceButton.d.ts.map +1 -0
  185. package/dist/lens/panels/Skeleton.d.ts +67 -0
  186. package/dist/lens/panels/Skeleton.d.ts.map +1 -0
  187. package/dist/lens/panels/StatPanel.d.ts +52 -0
  188. package/dist/lens/panels/StatPanel.d.ts.map +1 -0
  189. package/dist/lens/panels/StatValueTicker.d.ts +27 -0
  190. package/dist/lens/panels/StatValueTicker.d.ts.map +1 -0
  191. package/dist/lens/panels/TablePanel.d.ts +19 -0
  192. package/dist/lens/panels/TablePanel.d.ts.map +1 -0
  193. package/dist/lens/panels/WaterfallPlot.d.ts +51 -0
  194. package/dist/lens/panels/WaterfallPlot.d.ts.map +1 -0
  195. package/dist/lens/panels/actions.d.ts +75 -0
  196. package/dist/lens/panels/actions.d.ts.map +1 -0
  197. package/dist/lens/panels/context.d.ts +32 -0
  198. package/dist/lens/panels/context.d.ts.map +1 -0
  199. package/dist/lens/panels/data.d.ts +95 -0
  200. package/dist/lens/panels/data.d.ts.map +1 -0
  201. package/dist/lens/panels/kinds.d.ts +4 -0
  202. package/dist/lens/panels/kinds.d.ts.map +1 -0
  203. package/dist/lens/panels/metricViews.d.ts +79 -0
  204. package/dist/lens/panels/metricViews.d.ts.map +1 -0
  205. package/dist/lens/panels/registry.d.ts +45 -0
  206. package/dist/lens/panels/registry.d.ts.map +1 -0
  207. package/dist/lens/panels/useIsClamped.d.ts +16 -0
  208. package/dist/lens/panels/useIsClamped.d.ts.map +1 -0
  209. package/dist/lens/panels/useMenuButton.d.ts +68 -0
  210. package/dist/lens/panels/useMenuButton.d.ts.map +1 -0
  211. package/dist/lens/prefetch-Dov5CBoH.js +74 -0
  212. package/dist/lens/prefetchPanels-B7bIY0bM.js +31 -0
  213. package/dist/lens/print/PrintReport.d.ts +12 -0
  214. package/dist/lens/print/PrintReport.d.ts.map +1 -0
  215. package/dist/lens/print/footnotes.d.ts +29 -0
  216. package/dist/lens/print/footnotes.d.ts.map +1 -0
  217. package/dist/lens/print/formula.d.ts +9 -0
  218. package/dist/lens/print/formula.d.ts.map +1 -0
  219. package/dist/lens/print/narrative.d.ts +41 -0
  220. package/dist/lens/print/narrative.d.ts.map +1 -0
  221. package/dist/lens/print/outline.d.ts +94 -0
  222. package/dist/lens/print/outline.d.ts.map +1 -0
  223. package/dist/lens/print/palette.d.ts +23 -0
  224. package/dist/lens/print/palette.d.ts.map +1 -0
  225. package/dist/lens/print/quality.d.ts +32 -0
  226. package/dist/lens/print/quality.d.ts.map +1 -0
  227. package/dist/lens/print/units.d.ts +23 -0
  228. package/dist/lens/print/units.d.ts.map +1 -0
  229. package/dist/lens/print/values.d.ts +28 -0
  230. package/dist/lens/print/values.d.ts.map +1 -0
  231. package/dist/lens/print-CwcB0fug.js +216 -0
  232. package/dist/lens/runtime/clipboard.d.ts +11 -0
  233. package/dist/lens/runtime/clipboard.d.ts.map +1 -0
  234. package/dist/lens/runtime/document.d.ts +9 -0
  235. package/dist/lens/runtime/document.d.ts.map +1 -0
  236. package/dist/lens/runtime/drawer.d.ts +21 -0
  237. package/dist/lens/runtime/drawer.d.ts.map +1 -0
  238. package/dist/lens/runtime/drill.d.ts +54 -0
  239. package/dist/lens/runtime/drill.d.ts.map +1 -0
  240. package/dist/lens/runtime/drillPrefetch.d.ts +22 -0
  241. package/dist/lens/runtime/drillPrefetch.d.ts.map +1 -0
  242. package/dist/lens/runtime/export.d.ts +21 -0
  243. package/dist/lens/runtime/export.d.ts.map +1 -0
  244. package/dist/lens/runtime/filters.d.ts +51 -0
  245. package/dist/lens/runtime/filters.d.ts.map +1 -0
  246. package/dist/lens/runtime/focusTrap.d.ts +4 -0
  247. package/dist/lens/runtime/focusTrap.d.ts.map +1 -0
  248. package/dist/lens/runtime/format.d.ts +81 -0
  249. package/dist/lens/runtime/format.d.ts.map +1 -0
  250. package/dist/lens/runtime/idlePrefetch.d.ts +35 -0
  251. package/dist/lens/runtime/idlePrefetch.d.ts.map +1 -0
  252. package/dist/lens/runtime/index.d.ts +15 -0
  253. package/dist/lens/runtime/index.d.ts.map +1 -0
  254. package/dist/lens/runtime/navigate.d.ts +12 -0
  255. package/dist/lens/runtime/navigate.d.ts.map +1 -0
  256. package/dist/lens/runtime/navigation.d.ts +77 -0
  257. package/dist/lens/runtime/navigation.d.ts.map +1 -0
  258. package/dist/lens/runtime/overlayContainer.d.ts +24 -0
  259. package/dist/lens/runtime/overlayContainer.d.ts.map +1 -0
  260. package/dist/lens/runtime/panel.d.ts +47 -0
  261. package/dist/lens/runtime/panel.d.ts.map +1 -0
  262. package/dist/lens/runtime/panelImage.d.ts +28 -0
  263. package/dist/lens/runtime/panelImage.d.ts.map +1 -0
  264. package/dist/lens/runtime/prefetch.d.ts +48 -0
  265. package/dist/lens/runtime/prefetch.d.ts.map +1 -0
  266. package/dist/lens/runtime/prefetchPanels.d.ts +17 -0
  267. package/dist/lens/runtime/prefetchPanels.d.ts.map +1 -0
  268. package/dist/lens/runtime/print.d.ts +50 -0
  269. package/dist/lens/runtime/print.d.ts.map +1 -0
  270. package/dist/lens/runtime/provider.d.ts +195 -0
  271. package/dist/lens/runtime/provider.d.ts.map +1 -0
  272. package/dist/lens/runtime/query.d.ts +32 -0
  273. package/dist/lens/runtime/query.d.ts.map +1 -0
  274. package/dist/lens/runtime/recovery.d.ts +26 -0
  275. package/dist/lens/runtime/recovery.d.ts.map +1 -0
  276. package/dist/lens/runtime/snapshotLease.d.ts +2 -0
  277. package/dist/lens/runtime/snapshotLease.d.ts.map +1 -0
  278. package/dist/lens/runtime/theme.d.ts +4 -0
  279. package/dist/lens/runtime/theme.d.ts.map +1 -0
  280. package/dist/lens/runtime/url.d.ts +23 -0
  281. package/dist/lens/runtime/url.d.ts.map +1 -0
  282. package/dist/lens/scales-DKkoQGtJ.js +195 -0
  283. package/dist/lens/snapshotLease-LjBaqKs-.js +14 -0
  284. package/dist/lens/style.css +1 -0
  285. package/dist/lens/visualRegression.d.ts +2 -0
  286. package/dist/lens/visualRegression.d.ts.map +1 -0
  287. package/dist/sdk-identity.cjs +6 -0
  288. package/dist/sdk-identity.d.ts +4 -0
  289. package/dist/sdk-identity.js +4 -0
  290. package/dist/sdk-identity.json +5 -0
  291. package/package.json +22 -123
  292. package/assets/fonts/Actay/Actay-Regular.otf +0 -0
  293. package/assets/fonts/Actay/Actay-RegularItalic.otf +0 -0
  294. package/assets/fonts/Actay/ActayCondensed-Thin.otf +0 -0
  295. package/assets/fonts/Actay/ActayCondensed-ThinItalic.otf +0 -0
  296. package/assets/fonts/Actay/ActayWide-Bold.otf +0 -0
  297. package/assets/fonts/Actay/ActayWide-BoldItalic.otf +0 -0
  298. package/assets/fonts/Gilroy/Gilroy-Black.woff2 +0 -0
  299. package/assets/fonts/Gilroy/Gilroy-BlackItalic.woff2 +0 -0
  300. package/assets/fonts/Gilroy/Gilroy-Bold.woff2 +0 -0
  301. package/assets/fonts/Gilroy/Gilroy-BoldItalic.woff2 +0 -0
  302. package/assets/fonts/Gilroy/Gilroy-Extrabold.woff2 +0 -0
  303. package/assets/fonts/Gilroy/Gilroy-ExtraboldItalic.woff2 +0 -0
  304. package/assets/fonts/Gilroy/Gilroy-Heavy.woff2 +0 -0
  305. package/assets/fonts/Gilroy/Gilroy-HeavyItalic.woff2 +0 -0
  306. package/assets/fonts/Gilroy/Gilroy-Light.woff2 +0 -0
  307. package/assets/fonts/Gilroy/Gilroy-LightItalic.woff2 +0 -0
  308. package/assets/fonts/Gilroy/Gilroy-Medium.woff2 +0 -0
  309. package/assets/fonts/Gilroy/Gilroy-MediumItalic.woff2 +0 -0
  310. package/assets/fonts/Gilroy/Gilroy-Regular.woff2 +0 -0
  311. package/assets/fonts/Gilroy/Gilroy-RegularItalic.woff2 +0 -0
  312. package/assets/fonts/Gilroy/Gilroy-Semibold.woff2 +0 -0
  313. package/assets/fonts/Gilroy/Gilroy-SemiboldItalic.woff2 +0 -0
  314. package/assets/fonts/Gilroy/Gilroy-Thin.woff2 +0 -0
  315. package/assets/fonts/Gilroy/Gilroy-ThinItalic.woff2 +0 -0
  316. package/assets/fonts/Gilroy/Gilroy-UltraLight.woff2 +0 -0
  317. package/assets/fonts/Gilroy/Gilroy-UltraLightItalic.woff2 +0 -0
  318. package/assets/fonts/Inter.var.woff2 +0 -0
  319. package/dist/applet/core.cjs +0 -412
  320. package/dist/applet/core.cjs.map +0 -1
  321. package/dist/applet/core.d.cts +0 -187
  322. package/dist/applet/core.d.ts +0 -187
  323. package/dist/applet/core.mjs +0 -396
  324. package/dist/applet/core.mjs.map +0 -1
  325. package/dist/applet/devtools.cjs +0 -147
  326. package/dist/applet/devtools.cjs.map +0 -1
  327. package/dist/applet/devtools.d.cts +0 -7
  328. package/dist/applet/devtools.d.ts +0 -7
  329. package/dist/applet/devtools.mjs +0 -144
  330. package/dist/applet/devtools.mjs.map +0 -1
  331. package/dist/applet/host.cjs +0 -397
  332. package/dist/applet/host.cjs.map +0 -1
  333. package/dist/applet/host.d.cts +0 -42
  334. package/dist/applet/host.d.ts +0 -42
  335. package/dist/applet/host.mjs +0 -392
  336. package/dist/applet/host.mjs.map +0 -1
  337. package/dist/applet/vite.cjs +0 -219
  338. package/dist/applet/vite.cjs.map +0 -1
  339. package/dist/applet/vite.d.cts +0 -99
  340. package/dist/applet/vite.d.ts +0 -99
  341. package/dist/applet/vite.mjs +0 -203
  342. package/dist/applet/vite.mjs.map +0 -1
  343. package/dist/applet-runtime/index.cjs +0 -890
  344. package/dist/applet-runtime/index.cjs.map +0 -1
  345. package/dist/applet-runtime/index.d.cts +0 -191
  346. package/dist/applet-runtime/index.d.ts +0 -191
  347. package/dist/applet-runtime/index.mjs +0 -876
  348. package/dist/applet-runtime/index.mjs.map +0 -1
  349. package/dist/bichat/index.cjs +0 -20896
  350. package/dist/bichat/index.cjs.map +0 -1
  351. package/dist/bichat/index.css +0 -618
  352. package/dist/bichat/index.css.map +0 -1
  353. package/dist/bichat/index.d.cts +0 -4522
  354. package/dist/bichat/index.d.ts +0 -4522
  355. package/dist/bichat/index.mjs +0 -20724
  356. package/dist/bichat/index.mjs.map +0 -1
  357. package/dist/bichat/styles.css +0 -774
  358. package/dist/bichat/tailwind.cjs +0 -103
  359. package/dist/bichat/tailwind.cjs.map +0 -1
  360. package/dist/bichat/tailwind.d.cts +0 -21
  361. package/dist/bichat/tailwind.d.ts +0 -21
  362. package/dist/bichat/tailwind.mjs +0 -95
  363. package/dist/bichat/tailwind.mjs.map +0 -1
  364. package/dist/fonts/Actay/Actay-Regular.otf +0 -0
  365. package/dist/fonts/Actay/Actay-RegularItalic.otf +0 -0
  366. package/dist/fonts/Actay/ActayCondensed-Thin.otf +0 -0
  367. package/dist/fonts/Actay/ActayCondensed-ThinItalic.otf +0 -0
  368. package/dist/fonts/Actay/ActayWide-Bold.otf +0 -0
  369. package/dist/fonts/Actay/ActayWide-BoldItalic.otf +0 -0
  370. package/dist/fonts/Gilroy/Gilroy-Black.woff2 +0 -0
  371. package/dist/fonts/Gilroy/Gilroy-BlackItalic.woff2 +0 -0
  372. package/dist/fonts/Gilroy/Gilroy-Bold.woff2 +0 -0
  373. package/dist/fonts/Gilroy/Gilroy-BoldItalic.woff2 +0 -0
  374. package/dist/fonts/Gilroy/Gilroy-Extrabold.woff2 +0 -0
  375. package/dist/fonts/Gilroy/Gilroy-ExtraboldItalic.woff2 +0 -0
  376. package/dist/fonts/Gilroy/Gilroy-Heavy.woff2 +0 -0
  377. package/dist/fonts/Gilroy/Gilroy-HeavyItalic.woff2 +0 -0
  378. package/dist/fonts/Gilroy/Gilroy-Light.woff2 +0 -0
  379. package/dist/fonts/Gilroy/Gilroy-LightItalic.woff2 +0 -0
  380. package/dist/fonts/Gilroy/Gilroy-Medium.woff2 +0 -0
  381. package/dist/fonts/Gilroy/Gilroy-MediumItalic.woff2 +0 -0
  382. package/dist/fonts/Gilroy/Gilroy-Regular.woff2 +0 -0
  383. package/dist/fonts/Gilroy/Gilroy-RegularItalic.woff2 +0 -0
  384. package/dist/fonts/Gilroy/Gilroy-Semibold.woff2 +0 -0
  385. package/dist/fonts/Gilroy/Gilroy-SemiboldItalic.woff2 +0 -0
  386. package/dist/fonts/Gilroy/Gilroy-Thin.woff2 +0 -0
  387. package/dist/fonts/Gilroy/Gilroy-ThinItalic.woff2 +0 -0
  388. package/dist/fonts/Gilroy/Gilroy-UltraLight.woff2 +0 -0
  389. package/dist/fonts/Gilroy/Gilroy-UltraLightItalic.woff2 +0 -0
  390. package/dist/fonts/Inter.var.woff2 +0 -0
  391. package/dist/index-Cs_xWkhC.d.cts +0 -84
  392. package/dist/index-Cs_xWkhC.d.ts +0 -84
  393. package/dist/index.cjs +0 -777
  394. package/dist/index.cjs.map +0 -1
  395. package/dist/index.d.cts +0 -7
  396. package/dist/index.d.ts +0 -7
  397. package/dist/index.mjs +0 -755
  398. package/dist/index.mjs.map +0 -1
  399. package/dist/rpc-fh942_dj.d.cts +0 -31
  400. package/dist/rpc-fh942_dj.d.ts +0 -31
  401. package/tailwind/compiled.css +0 -2
  402. package/tailwind/create-config.cjs +0 -90
  403. package/tailwind/iota.css +0 -1195
  404. package/tailwind/main.css +0 -2
  405. package/tailwind/sdk-content.cjs +0 -177
  406. package/tailwind/sdk-theme.cjs +0 -120
package/dist/index.mjs DELETED
@@ -1,755 +0,0 @@
1
- import { createContext, useContext, useMemo, useState, useRef, useCallback, useEffect } from 'react';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { createRoot } from 'react-dom/client';
4
-
5
- // ui/src/applet-core/context/AppletContext.tsx
6
- var AppletContext = createContext(null);
7
- var REQUIRED_KEYS = ["user", "tenant", "locale", "config", "route", "session"];
8
- function validateInitialContext(value, windowKey) {
9
- if (!value || typeof value !== "object") {
10
- throw new Error(`${windowKey}: expected an object, got ${typeof value}`);
11
- }
12
- const obj = value;
13
- const missing = REQUIRED_KEYS.filter((k) => !(k in obj));
14
- if (missing.length > 0) {
15
- throw new Error(`${windowKey}: missing required keys: ${missing.join(", ")}`);
16
- }
17
- const user = obj.user;
18
- if (!user || typeof user !== "object") {
19
- throw new Error(`${windowKey}.user: expected an object, got ${typeof user}`);
20
- }
21
- if (typeof user.id !== "number") {
22
- throw new Error(`${windowKey}.user.id: expected number, got ${typeof user.id}`);
23
- }
24
- if (!Array.isArray(user.permissions)) {
25
- throw new Error(`${windowKey}.user.permissions: expected array, got ${typeof user.permissions}`);
26
- }
27
- const tenant = obj.tenant;
28
- if (!tenant || typeof tenant !== "object") {
29
- throw new Error(`${windowKey}.tenant: expected an object, got ${typeof tenant}`);
30
- }
31
- if (typeof tenant.id !== "string") {
32
- throw new Error(`${windowKey}.tenant.id: expected string, got ${typeof tenant.id}`);
33
- }
34
- const session = obj.session;
35
- if (!session || typeof session !== "object") {
36
- throw new Error(`${windowKey}.session: expected an object, got ${typeof session}`);
37
- }
38
- if (typeof session.csrfToken !== "string") {
39
- throw new Error(`${windowKey}.session.csrfToken: expected string, got ${typeof session.csrfToken}`);
40
- }
41
- if (typeof session.expiresAt !== "number") {
42
- throw new Error(`${windowKey}.session.expiresAt: expected number, got ${typeof session.expiresAt}`);
43
- }
44
- if (typeof session.refreshURL !== "string") {
45
- throw new Error(`${windowKey}.session.refreshURL: expected string, got ${typeof session.refreshURL}`);
46
- }
47
- const config = obj.config;
48
- if (!config || typeof config !== "object") {
49
- throw new Error(`${windowKey}.config: expected object, got ${typeof config}`);
50
- }
51
- return value;
52
- }
53
- function AppletProvider({ children, windowKey, context }) {
54
- const raw = context ?? window[windowKey];
55
- if (!raw) {
56
- throw new Error(`${windowKey} not found on window. Ensure backend context injection is working.`);
57
- }
58
- const initialContext = validateInitialContext(raw, windowKey);
59
- return /* @__PURE__ */ jsx(AppletContext.Provider, { value: initialContext, children });
60
- }
61
- function useAppletContext() {
62
- const context = useContext(AppletContext);
63
- if (!context) {
64
- throw new Error("useAppletContext must be used within AppletProvider");
65
- }
66
- return context;
67
- }
68
- var ConfigContext = createContext(null);
69
- function ConfigProvider({ children, config }) {
70
- return /* @__PURE__ */ jsx(ConfigContext.Provider, { value: config, children });
71
- }
72
- function useConfigContext() {
73
- const context = useContext(ConfigContext);
74
- if (!context) {
75
- throw new Error("useConfigContext must be used within ConfigProvider");
76
- }
77
- return context;
78
- }
79
-
80
- // ui/src/applet-core/hooks/useAppletContext.ts
81
- function useAppletContext2(windowKey) {
82
- const context = window[windowKey];
83
- if (!context) {
84
- throw new Error(`${windowKey} not found on window. Ensure backend context injection is working.`);
85
- }
86
- return context;
87
- }
88
- function useAppletExtensions() {
89
- const { extensions } = useAppletContext();
90
- return useMemo(
91
- () => extensions ?? {},
92
- [extensions]
93
- );
94
- }
95
-
96
- // ui/src/applet-devtools/enabled.ts
97
- function shouldEnableAppletDevtools() {
98
- if (typeof window === "undefined") {
99
- return false;
100
- }
101
- const url = new URL(window.location.href);
102
- if (url.searchParams.get("appletDebug") === "1") {
103
- return true;
104
- }
105
- try {
106
- return window.localStorage.getItem("iotaAppletDevtools") === "1";
107
- } catch {
108
- return false;
109
- }
110
- }
111
-
112
- // ui/src/applet-host/rpc.ts
113
- var AppletRPCException = class extends Error {
114
- constructor(args) {
115
- super(args.message);
116
- this.name = "AppletRPCException";
117
- this.code = args.code;
118
- this.details = args.details;
119
- this.cause = args.cause;
120
- }
121
- };
122
- function createAppletRPCClient(options) {
123
- const fetcher = options.fetcher ?? fetch;
124
- const timeoutMs = typeof options.timeoutMs === "number" && options.timeoutMs > 0 ? options.timeoutMs : 0;
125
- async function call(method, params) {
126
- const req = { id: crypto.randomUUID(), method, params };
127
- const startedAt = typeof performance !== "undefined" ? performance.now() : Date.now();
128
- const abortController = timeoutMs > 0 ? new AbortController() : void 0;
129
- let timeoutHandle;
130
- let timedOut = false;
131
- maybeDispatchRPCEvent({
132
- id: req.id,
133
- method: req.method,
134
- status: "start"
135
- });
136
- try {
137
- if (abortController) {
138
- timeoutHandle = setTimeout(() => {
139
- timedOut = true;
140
- abortController.abort();
141
- }, timeoutMs);
142
- }
143
- const resp = await fetcher(options.endpoint, {
144
- method: "POST",
145
- headers: { "Content-Type": "application/json" },
146
- body: JSON.stringify(req),
147
- signal: abortController?.signal
148
- });
149
- if (!resp.ok) {
150
- throw new AppletRPCException({
151
- code: "http_error",
152
- message: `HTTP ${resp.status}`,
153
- details: { status: resp.status }
154
- });
155
- }
156
- const json = await resp.json();
157
- if (json.error) {
158
- throw new AppletRPCException({
159
- code: json.error.code,
160
- message: json.error.message,
161
- details: json.error.details
162
- });
163
- }
164
- if (json.result === void 0) {
165
- throw new AppletRPCException({
166
- code: "invalid_response",
167
- message: "Missing result in successful response"
168
- });
169
- }
170
- maybeDispatchRPCEvent({
171
- id: req.id,
172
- method: req.method,
173
- status: "success",
174
- durationMs: elapsedMs(startedAt)
175
- });
176
- return json.result;
177
- } catch (err) {
178
- let rpcErr = err;
179
- if (err instanceof Error && err.name === "AbortError") {
180
- rpcErr = new AppletRPCException({
181
- code: timedOut ? "timeout" : "aborted",
182
- message: timedOut ? `RPC request timed out after ${timeoutMs}ms` : "RPC request was aborted",
183
- cause: err
184
- });
185
- }
186
- maybeDispatchRPCEvent({
187
- id: req.id,
188
- method: req.method,
189
- status: "error",
190
- durationMs: elapsedMs(startedAt),
191
- error: rpcErr
192
- });
193
- throw rpcErr;
194
- } finally {
195
- if (timeoutHandle !== void 0) {
196
- clearTimeout(timeoutHandle);
197
- }
198
- }
199
- }
200
- async function callTyped(method, params) {
201
- return call(method, params);
202
- }
203
- return { call, callTyped };
204
- }
205
- function maybeDispatchRPCEvent(detail) {
206
- if (typeof window === "undefined") {
207
- return;
208
- }
209
- if (!shouldEnableAppletDevtools()) {
210
- return;
211
- }
212
- window.dispatchEvent(new CustomEvent("iota:applet-rpc", { detail }));
213
- }
214
- function elapsedMs(startedAt) {
215
- const now = typeof performance !== "undefined" ? performance.now() : Date.now();
216
- return Math.max(0, Math.round(now - startedAt));
217
- }
218
-
219
- // ui/src/applet-core/hooks/useAppletRPCClient.ts
220
- function useAppletRPCClient(options = {}) {
221
- const { config, session } = useAppletContext();
222
- const endpoint = options.endpoint ?? config.rpcUIEndpoint ?? "/rpc";
223
- const baseFetcher = options.fetcher ?? fetch;
224
- const csrfToken = session.csrfToken;
225
- return useMemo(() => {
226
- const fetcher = async (input, init) => {
227
- const headers = new Headers(init?.headers ?? void 0);
228
- if (csrfToken !== "" && !headers.has("X-CSRF-Token")) {
229
- headers.set("X-CSRF-Token", csrfToken);
230
- }
231
- return baseFetcher(input, {
232
- ...init,
233
- headers
234
- });
235
- };
236
- return createAppletRPCClient({
237
- endpoint,
238
- timeoutMs: options.timeoutMs,
239
- fetcher
240
- });
241
- }, [baseFetcher, csrfToken, endpoint, options.timeoutMs]);
242
- }
243
-
244
- // ui/src/applet-core/hooks/useConfig.ts
245
- function useConfig() {
246
- const { config } = useAppletContext();
247
- return config;
248
- }
249
-
250
- // ui/src/applet-core/hooks/useUser.ts
251
- function useUser() {
252
- const { user } = useAppletContext();
253
- return user;
254
- }
255
-
256
- // ui/src/applet-core/hooks/usePermissions.ts
257
- function usePermissions() {
258
- const { user } = useAppletContext();
259
- const hasPermission = (permission) => {
260
- return user.permissions.includes(permission);
261
- };
262
- const hasAnyPermission = (...permissions) => {
263
- return permissions.some((p) => user.permissions.includes(p));
264
- };
265
- return {
266
- hasPermission,
267
- hasAnyPermission,
268
- permissions: user.permissions
269
- };
270
- }
271
-
272
- // ui/src/applet-core/hooks/useTranslation.ts
273
- function useTranslation() {
274
- const { locale } = useAppletContext();
275
- const t = (key, params) => {
276
- let text = locale.translations[key] || key;
277
- if (params) {
278
- Object.entries(params).forEach(([k, v]) => {
279
- text = text.replace(new RegExp(`\\{${k}\\}`, "g"), String(v));
280
- });
281
- }
282
- return text;
283
- };
284
- return {
285
- t,
286
- language: locale.language
287
- };
288
- }
289
- function useSession(options) {
290
- const { session } = useAppletContext();
291
- const loginPath = options?.loginPath ?? "/login";
292
- const isExpiringSoon = useMemo(() => {
293
- const bufferMs = 5 * 60 * 1e3;
294
- return session.expiresAt - Date.now() < bufferMs;
295
- }, [session.expiresAt]);
296
- const refreshSession = async () => {
297
- const response = await fetch(session.refreshURL, {
298
- method: "POST",
299
- headers: {
300
- "X-CSRF-Token": session.csrfToken
301
- }
302
- });
303
- if (!response.ok) {
304
- const returnUrl = encodeURIComponent(window.location.pathname);
305
- window.location.href = `${loginPath}?redirect=${returnUrl}`;
306
- return;
307
- }
308
- const newToken = response.headers.get("X-CSRF-Token");
309
- if (newToken) {
310
- window.dispatchEvent(
311
- new CustomEvent("iota:csrf-refresh", {
312
- detail: { token: newToken }
313
- })
314
- );
315
- }
316
- };
317
- return {
318
- isExpiringSoon,
319
- refreshSession,
320
- csrfToken: session.csrfToken,
321
- expiresAt: session.expiresAt
322
- };
323
- }
324
-
325
- // ui/src/applet-core/hooks/useRoute.ts
326
- function useRoute() {
327
- const { route } = useAppletContext();
328
- return route;
329
- }
330
- function useStreaming() {
331
- const [isStreaming, setIsStreaming] = useState(false);
332
- const abortControllerRef = useRef(null);
333
- const processStream = useCallback(
334
- async (generator, onChunk, signal) => {
335
- setIsStreaming(true);
336
- const controller = new AbortController();
337
- abortControllerRef.current = controller;
338
- const onExternalAbort = signal ? () => {
339
- controller.abort();
340
- } : void 0;
341
- if (signal && onExternalAbort) {
342
- signal.addEventListener("abort", onExternalAbort);
343
- }
344
- try {
345
- for await (const chunk of generator) {
346
- if (controller.signal.aborted) {
347
- break;
348
- }
349
- onChunk(chunk);
350
- }
351
- } catch (error) {
352
- if (controller.signal.aborted) {
353
- return;
354
- }
355
- throw error;
356
- } finally {
357
- if (signal && onExternalAbort) {
358
- signal.removeEventListener("abort", onExternalAbort);
359
- }
360
- setIsStreaming(false);
361
- abortControllerRef.current = null;
362
- }
363
- },
364
- []
365
- );
366
- const cancel = useCallback(() => {
367
- if (abortControllerRef.current) {
368
- abortControllerRef.current.abort();
369
- }
370
- setIsStreaming(false);
371
- }, []);
372
- const reset = useCallback(() => {
373
- abortControllerRef.current = null;
374
- setIsStreaming(false);
375
- }, []);
376
- return {
377
- isStreaming,
378
- processStream,
379
- cancel,
380
- reset
381
- };
382
- }
383
-
384
- // ui/src/applet-core/hooks/useAppletRuntime.ts
385
- function useAppletRuntime() {
386
- const config = useConfig();
387
- const basePath = config.basePath ?? "";
388
- const normalizedBasePath = basePath.endsWith("/") ? basePath.slice(0, -1) : basePath;
389
- const assetsBasePath = config.assetsBasePath ?? `${normalizedBasePath || ""}/assets`;
390
- const rpcEndpoint = config.rpcUIEndpoint;
391
- const shellMode = config.shellMode;
392
- return { basePath: normalizedBasePath, assetsBasePath, rpcEndpoint, shellMode };
393
- }
394
- function defineReactAppletElement(options) {
395
- const tagName = options.tagName.toLowerCase();
396
- const registry = getRegistry();
397
- const existing = registry.get(tagName);
398
- if (existing) {
399
- existing.options = options;
400
- for (const a of options.observedAttributes ?? []) {
401
- existing.observed.add(a);
402
- }
403
- } else {
404
- const observed = /* @__PURE__ */ new Set(["base-path", "shell-mode", "router-mode"]);
405
- for (const a of options.observedAttributes ?? []) {
406
- observed.add(a);
407
- }
408
- registry.set(tagName, { options, observed });
409
- }
410
- if (customElements.get(tagName)) {
411
- if (typeof window !== "undefined") {
412
- window.dispatchEvent(new CustomEvent("iota:applet-host-update", { detail: { tagName } }));
413
- }
414
- return;
415
- }
416
- function getEntry() {
417
- const entry = getRegistry().get(tagName);
418
- if (!entry) {
419
- throw new Error(`[${tagName}] applet host registry entry missing`);
420
- }
421
- return entry;
422
- }
423
- class ReactAppletElement extends HTMLElement {
424
- constructor() {
425
- super(...arguments);
426
- this.reactRoot = null;
427
- this.container = null;
428
- this.darkModeObserver = null;
429
- this.styleEl = null;
430
- this.updateListener = null;
431
- }
432
- static get observedAttributes() {
433
- return Array.from(getEntry().observed);
434
- }
435
- get useShadow() {
436
- return getEntry().options.shadow !== false;
437
- }
438
- /** The root node that holds the container and styles (shadow root or the element itself). Call ensureMountMode() before reading when using shadow. */
439
- get styleRoot() {
440
- if (!this.useShadow) {
441
- return this;
442
- }
443
- if (!this.shadowRoot) {
444
- throw new Error(`[${tagName}] shadowRoot missing; call ensureMountMode() first`);
445
- }
446
- return this.shadowRoot;
447
- }
448
- /** Ensures shadow root exists when needed and the React container is in the correct root (shadow or light). */
449
- ensureMountMode() {
450
- const targetRoot = this.useShadow ? this.shadowRoot ?? this.attachShadow({ mode: "open" }) : this;
451
- if (this.container && this.container.parentNode !== targetRoot) {
452
- targetRoot.appendChild(this.container);
453
- }
454
- }
455
- connectedCallback() {
456
- if (!this.container) {
457
- this.container = document.createElement("div");
458
- this.container.id = "react-root";
459
- this.container.style.display = "flex";
460
- this.container.style.flexDirection = "column";
461
- this.container.style.flex = "1";
462
- this.container.style.minHeight = "0";
463
- this.container.style.height = "100%";
464
- this.container.style.width = "100%";
465
- }
466
- this.ensureMountMode();
467
- const root = this.styleRoot;
468
- const existingContainer = root.querySelector("#react-root");
469
- if (!existingContainer) {
470
- if (this.useShadow && this.styleEl) {
471
- root.appendChild(this.styleEl);
472
- }
473
- root.appendChild(this.container);
474
- } else if (existingContainer !== this.container) {
475
- this.container = existingContainer;
476
- }
477
- this.syncFromRegistry();
478
- this.updateListener ?? (this.updateListener = (e) => {
479
- if (!(e instanceof CustomEvent)) {
480
- return;
481
- }
482
- const detail = e.detail;
483
- if (!detail || detail.tagName !== tagName) {
484
- return;
485
- }
486
- this.syncFromRegistry();
487
- this.renderReact();
488
- });
489
- window.addEventListener("iota:applet-host-update", this.updateListener);
490
- this.renderReact();
491
- }
492
- disconnectedCallback() {
493
- if (this.updateListener) {
494
- window.removeEventListener("iota:applet-host-update", this.updateListener);
495
- }
496
- this.darkModeObserver?.disconnect();
497
- this.darkModeObserver = null;
498
- this.reactRoot?.unmount();
499
- this.reactRoot = null;
500
- if (this.styleEl) {
501
- if (this.styleEl.parentNode === document.head) {
502
- releaseLightStyle(tagName);
503
- } else {
504
- this.styleEl.remove();
505
- }
506
- this.styleEl = null;
507
- }
508
- }
509
- attributeChangedCallback(_name, oldValue, newValue) {
510
- if (oldValue === newValue) {
511
- return;
512
- }
513
- if (this.container) {
514
- this.renderReact();
515
- }
516
- }
517
- getHostConfig() {
518
- const attrs = {};
519
- for (const { name, value } of Array.from(this.attributes)) {
520
- attrs[name] = value;
521
- }
522
- const basePath = this.getAttribute("base-path") ?? "";
523
- const shellMode = this.getAttribute("shell-mode") ?? void 0;
524
- const routerMode = this.getAttribute("router-mode") ?? "url";
525
- return { basePath, shellMode, routerMode, attrs };
526
- }
527
- renderReact() {
528
- if (!this.container) {
529
- return;
530
- }
531
- if (!this.reactRoot) {
532
- this.reactRoot = createRoot(this.container);
533
- }
534
- try {
535
- this.reactRoot.render(getEntry().options.render(this.getHostConfig()));
536
- } catch (err) {
537
- console.error(`[${tagName}] failed to mount React app:`, err);
538
- }
539
- }
540
- syncFromRegistry() {
541
- this.ensureMountMode();
542
- const entry = getEntry();
543
- const styles = typeof entry.options.styles === "function" ? entry.options.styles() : entry.options.styles;
544
- if (styles) {
545
- if (this.useShadow) {
546
- if (this.styleEl && this.styleEl.parentNode === document.head) {
547
- releaseLightStyle(tagName);
548
- this.styleEl = null;
549
- }
550
- this.styleEl ?? (this.styleEl = document.createElement("style"));
551
- this.styleEl.textContent = styles;
552
- if (this.shadowRoot && !this.shadowRoot.contains(this.styleEl)) {
553
- this.shadowRoot.insertBefore(this.styleEl, this.shadowRoot.firstChild);
554
- }
555
- } else {
556
- if (this.styleEl && this.shadowRoot?.contains(this.styleEl)) {
557
- this.styleEl.remove();
558
- this.styleEl = null;
559
- }
560
- if (this.styleEl && this.styleEl.parentNode !== document.head) {
561
- releaseLightStyle(tagName);
562
- this.styleEl = null;
563
- }
564
- if (!this.styleEl) {
565
- this.styleEl = getOrCreateLightStyle(tagName, styles);
566
- } else {
567
- this.styleEl.textContent = styles;
568
- }
569
- if (!document.head.contains(this.styleEl)) {
570
- document.head.appendChild(this.styleEl);
571
- }
572
- }
573
- } else if (this.styleEl) {
574
- if (this.styleEl.parentNode === document.head) {
575
- releaseLightStyle(tagName);
576
- } else {
577
- this.styleEl.remove();
578
- }
579
- this.styleEl = null;
580
- }
581
- if (entry.options.observeDarkMode !== false) {
582
- this.darkModeObserver ?? (this.darkModeObserver = this.syncDarkMode());
583
- } else if (this.darkModeObserver) {
584
- this.darkModeObserver.disconnect();
585
- this.darkModeObserver = null;
586
- }
587
- }
588
- syncDarkMode() {
589
- const root = this.container;
590
- if (!root) {
591
- throw new Error("react root container not found");
592
- }
593
- const apply = () => {
594
- if (document.documentElement.classList.contains("dark")) {
595
- root.classList.add("dark");
596
- } else {
597
- root.classList.remove("dark");
598
- }
599
- };
600
- apply();
601
- const observer = new MutationObserver(apply);
602
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
603
- return observer;
604
- }
605
- }
606
- customElements.define(tagName, ReactAppletElement);
607
- }
608
- function getRegistry() {
609
- const g = globalThis;
610
- g.__IOTA_REACT_APPLET_HOST_REGISTRY__ ?? (g.__IOTA_REACT_APPLET_HOST_REGISTRY__ = /* @__PURE__ */ new Map());
611
- return g.__IOTA_REACT_APPLET_HOST_REGISTRY__;
612
- }
613
- function getLightStyleRegistry() {
614
- const g = globalThis;
615
- g.__IOTA_REACT_APPLET_LIGHT_STYLES__ ?? (g.__IOTA_REACT_APPLET_LIGHT_STYLES__ = /* @__PURE__ */ new Map());
616
- return g.__IOTA_REACT_APPLET_LIGHT_STYLES__;
617
- }
618
- function getOrCreateLightStyle(tagName, styles) {
619
- const registry = getLightStyleRegistry();
620
- let entry = registry.get(tagName);
621
- if (!entry) {
622
- const el = document.createElement("style");
623
- el.id = `${tagName}-styles`;
624
- entry = { element: el, refCount: 0 };
625
- registry.set(tagName, entry);
626
- }
627
- entry.refCount++;
628
- entry.element.textContent = styles;
629
- return entry.element;
630
- }
631
- function releaseLightStyle(tagName) {
632
- const registry = getLightStyleRegistry();
633
- const entry = registry.get(tagName);
634
- if (!entry) {
635
- return;
636
- }
637
- entry.refCount--;
638
- if (entry.refCount <= 0) {
639
- entry.element.remove();
640
- registry.delete(tagName);
641
- }
642
- }
643
- function createAppletRouter(options) {
644
- const basePath = options.basePath ?? "";
645
- const Router = ({ children }) => {
646
- if (options.mode === "memory") {
647
- const MemoryRouter = options.MemoryRouter;
648
- return /* @__PURE__ */ jsx(MemoryRouter, { children });
649
- }
650
- const BrowserRouter = options.BrowserRouter;
651
- return /* @__PURE__ */ jsx(BrowserRouter, { basename: basePath, children });
652
- };
653
- return { Router };
654
- }
655
- function AppletDevtoolsOverlay() {
656
- const ctx = useAppletContext();
657
- const runtime = useAppletRuntime();
658
- const [rpcEvents, setRPCEvents] = useState([]);
659
- useEffect(() => {
660
- const onEvent = (e) => {
661
- if (!(e instanceof CustomEvent)) {
662
- return;
663
- }
664
- const detail = e.detail;
665
- if (!detail) {
666
- return;
667
- }
668
- setRPCEvents((prev) => [detail, ...prev].slice(0, 50));
669
- };
670
- window.addEventListener("iota:applet-rpc", onEvent);
671
- return () => window.removeEventListener("iota:applet-rpc", onEvent);
672
- }, []);
673
- const summary = useMemo(() => {
674
- return {
675
- basePath: runtime.basePath,
676
- assetsBasePath: runtime.assetsBasePath,
677
- rpcEndpoint: runtime.rpcEndpoint,
678
- shellMode: runtime.shellMode,
679
- route: ctx.route,
680
- user: { id: ctx.user.id, email: ctx.user.email },
681
- tenant: ctx.tenant
682
- };
683
- }, [ctx.route, ctx.tenant, ctx.user.email, ctx.user.id, runtime.assetsBasePath, runtime.basePath, runtime.rpcEndpoint, runtime.shellMode]);
684
- return /* @__PURE__ */ jsxs(
685
- "div",
686
- {
687
- style: {
688
- position: "fixed",
689
- right: 12,
690
- bottom: 12,
691
- width: 420,
692
- maxHeight: "60vh",
693
- overflow: "auto",
694
- background: "rgba(17, 24, 39, 0.92)",
695
- color: "#E5E7EB",
696
- border: "1px solid rgba(255,255,255,0.12)",
697
- borderRadius: 10,
698
- padding: 12,
699
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
700
- fontSize: 12,
701
- zIndex: 2147483647
702
- },
703
- children: [
704
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
705
- /* @__PURE__ */ jsx("div", { style: { fontWeight: 700 }, children: "Applet Devtools" }),
706
- /* @__PURE__ */ jsx("div", { style: { opacity: 0.7 }, children: runtime.shellMode ?? "unknown" })
707
- ] }),
708
- /* @__PURE__ */ jsxs("div", { style: { marginBottom: 10 }, children: [
709
- /* @__PURE__ */ jsx("div", { style: { opacity: 0.85, marginBottom: 4 }, children: "Context" }),
710
- /* @__PURE__ */ jsx("pre", { style: { margin: 0, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: JSON.stringify(summary, null, 2) })
711
- ] }),
712
- /* @__PURE__ */ jsxs("div", { children: [
713
- /* @__PURE__ */ jsx("div", { style: { opacity: 0.85, marginBottom: 4 }, children: "RPC" }),
714
- rpcEvents.length === 0 ? /* @__PURE__ */ jsx("div", { style: { opacity: 0.7 }, children: "No calls yet" }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: rpcEvents.map((ev) => /* @__PURE__ */ jsxs("div", { style: { padding: 8, border: "1px solid rgba(255,255,255,0.08)", borderRadius: 8 }, children: [
715
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
716
- /* @__PURE__ */ jsx("div", { children: ev.method }),
717
- /* @__PURE__ */ jsxs("div", { style: { opacity: 0.8 }, children: [
718
- ev.status,
719
- typeof ev.durationMs === "number" ? ` (${ev.durationMs}ms)` : ""
720
- ] })
721
- ] }),
722
- ev.status === "error" ? /* @__PURE__ */ jsx("pre", { style: { margin: "6px 0 0", opacity: 0.8, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: JSON.stringify(serializeError(ev.error) ?? {}, null, 2) }) : null
723
- ] }, `${ev.id}:${ev.status}`)) })
724
- ] })
725
- ]
726
- }
727
- );
728
- }
729
- function serializeError(err) {
730
- if (err instanceof Error) {
731
- const out = {
732
- name: err.name,
733
- message: err.message
734
- };
735
- if (err.stack) {
736
- out.stack = err.stack;
737
- }
738
- const errRecord = err;
739
- if ("code" in err && typeof errRecord.code === "string") {
740
- out.code = errRecord.code;
741
- }
742
- if ("details" in err) {
743
- out.details = errRecord.details;
744
- }
745
- if ("cause" in err) {
746
- out.cause = errRecord.cause;
747
- }
748
- return out;
749
- }
750
- return err;
751
- }
752
-
753
- export { AppletDevtoolsOverlay, AppletProvider, AppletRPCException, ConfigProvider, createAppletRPCClient, createAppletRouter, defineReactAppletElement, shouldEnableAppletDevtools, useAppletContext, useAppletContext2 as useAppletContextDirect, useAppletExtensions, useAppletRPCClient, useAppletRuntime, useConfig, useConfigContext, usePermissions, useRoute, useSession, useStreaming, useTranslation, useUser };
754
- //# sourceMappingURL=index.mjs.map
755
- //# sourceMappingURL=index.mjs.map