@ariestools/sdk-react 10.0.2

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 (670) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +10 -0
  3. package/dist/_pkg/accordion/browser/AccordionGroup.d.ts +24 -0
  4. package/dist/_pkg/accordion/browser/index.d.ts +1 -0
  5. package/dist/_pkg/accordion/browser/index.mjs +61 -0
  6. package/dist/_pkg/animation/browser/AnimatedList.d.ts +13 -0
  7. package/dist/_pkg/animation/browser/RotationAnimation.d.ts +7 -0
  8. package/dist/_pkg/animation/browser/Trail.d.ts +9 -0
  9. package/dist/_pkg/animation/browser/index.d.ts +3 -0
  10. package/dist/_pkg/animation/browser/index.mjs +178 -0
  11. package/dist/_pkg/appbar/browser/AppBar/Application.d.ts +11 -0
  12. package/dist/_pkg/appbar/browser/AppBar/index.d.ts +1 -0
  13. package/dist/_pkg/appbar/browser/AppBarEx.d.ts +3 -0
  14. package/dist/_pkg/appbar/browser/AppBarExProps.d.ts +10 -0
  15. package/dist/_pkg/appbar/browser/SiteMenu/Menu.d.ts +8 -0
  16. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/MenuListItemContainer.d.ts +10 -0
  17. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/index.d.ts +1 -0
  18. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts +6 -0
  19. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts +7 -0
  20. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts +6 -0
  21. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/list-item-components/index.d.ts +3 -0
  22. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts +10 -0
  23. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts +8 -0
  24. package/dist/_pkg/appbar/browser/SiteMenu/MenuListItem/sub-nav/index.d.ts +2 -0
  25. package/dist/_pkg/appbar/browser/SiteMenu/MenuSection.d.ts +10 -0
  26. package/dist/_pkg/appbar/browser/SiteMenu/hooks/index.d.ts +1 -0
  27. package/dist/_pkg/appbar/browser/SiteMenu/hooks/useMenuItemsShared.d.ts +6 -0
  28. package/dist/_pkg/appbar/browser/SiteMenu/index.d.ts +5 -0
  29. package/dist/_pkg/appbar/browser/SiteMenu/lib/MenuListItemBase.d.ts +4 -0
  30. package/dist/_pkg/appbar/browser/SiteMenu/lib/NavListItemProps.d.ts +11 -0
  31. package/dist/_pkg/appbar/browser/SiteMenu/lib/index.d.ts +2 -0
  32. package/dist/_pkg/appbar/browser/Toolbar/Context/ContextToolbar.d.ts +9 -0
  33. package/dist/_pkg/appbar/browser/Toolbar/Context/Logo.d.ts +3 -0
  34. package/dist/_pkg/appbar/browser/Toolbar/Context/LogoLinkEx.d.ts +8 -0
  35. package/dist/_pkg/appbar/browser/Toolbar/Context/index.d.ts +1 -0
  36. package/dist/_pkg/appbar/browser/Toolbar/System/SystemToolbar.d.ts +12 -0
  37. package/dist/_pkg/appbar/browser/Toolbar/System/index.d.ts +1 -0
  38. package/dist/_pkg/appbar/browser/Toolbar/index.d.ts +2 -0
  39. package/dist/_pkg/appbar/browser/index.d.ts +5 -0
  40. package/dist/_pkg/appbar/browser/index.mjs +494 -0
  41. package/dist/_pkg/async-effect/browser/index.d.ts +1 -0
  42. package/dist/_pkg/async-effect/browser/index.mjs +18 -0
  43. package/dist/_pkg/async-effect/browser/useAsyncEffect.d.ts +6 -0
  44. package/dist/_pkg/base-page/browser/components/BasePage/BasePage.d.ts +4 -0
  45. package/dist/_pkg/base-page/browser/components/BasePage/BasePageProps.d.ts +44 -0
  46. package/dist/_pkg/base-page/browser/components/BasePage/DynamicSharePage.d.ts +3 -0
  47. package/dist/_pkg/base-page/browser/components/BasePage/LiveSharePage.d.ts +3 -0
  48. package/dist/_pkg/base-page/browser/components/BasePage/PermaSharePage.d.ts +3 -0
  49. package/dist/_pkg/base-page/browser/components/BasePage/index.d.ts +5 -0
  50. package/dist/_pkg/base-page/browser/components/index.d.ts +1 -0
  51. package/dist/_pkg/base-page/browser/contexts/LoadStatus/Context.d.ts +2 -0
  52. package/dist/_pkg/base-page/browser/contexts/LoadStatus/Provider.d.ts +6 -0
  53. package/dist/_pkg/base-page/browser/contexts/LoadStatus/State.d.ts +6 -0
  54. package/dist/_pkg/base-page/browser/contexts/LoadStatus/index.d.ts +3 -0
  55. package/dist/_pkg/base-page/browser/contexts/index.d.ts +1 -0
  56. package/dist/_pkg/base-page/browser/index.d.ts +2 -0
  57. package/dist/_pkg/base-page/browser/index.mjs +169 -0
  58. package/dist/_pkg/button/browser/components/ButtonEx.d.ts +7 -0
  59. package/dist/_pkg/button/browser/components/ButtonExBase.d.ts +7 -0
  60. package/dist/_pkg/button/browser/components/ButtonExProps.d.ts +33 -0
  61. package/dist/_pkg/button/browser/components/ButtonExTo.d.ts +7 -0
  62. package/dist/_pkg/button/browser/components/index.d.ts +2 -0
  63. package/dist/_pkg/button/browser/index.d.ts +1 -0
  64. package/dist/_pkg/button/browser/index.mjs +124 -0
  65. package/dist/_pkg/common/browser/components/Background.d.ts +7 -0
  66. package/dist/_pkg/common/browser/components/Breadcrumbs/BreadcrumbsEx.d.ts +9 -0
  67. package/dist/_pkg/common/browser/components/Breadcrumbs/index.d.ts +1 -0
  68. package/dist/_pkg/common/browser/components/Copy/CopyIconButton.d.ts +10 -0
  69. package/dist/_pkg/common/browser/components/Copy/index.d.ts +2 -0
  70. package/dist/_pkg/common/browser/components/Copy/onCopy.d.ts +1 -0
  71. package/dist/_pkg/common/browser/components/CoverProgress.d.ts +9 -0
  72. package/dist/_pkg/common/browser/components/MenuEx.d.ts +7 -0
  73. package/dist/_pkg/common/browser/components/RedirectWithQuery.d.ts +8 -0
  74. package/dist/_pkg/common/browser/components/index.d.ts +6 -0
  75. package/dist/_pkg/common/browser/index.d.ts +5 -0
  76. package/dist/_pkg/common/browser/index.mjs +235 -0
  77. package/dist/_pkg/cookie-consent/browser/components/CookieConsent.d.ts +3 -0
  78. package/dist/_pkg/cookie-consent/browser/components/CookieConsentBody.d.ts +3 -0
  79. package/dist/_pkg/cookie-consent/browser/components/CookieConsentProps.d.ts +6 -0
  80. package/dist/_pkg/cookie-consent/browser/components/index.d.ts +3 -0
  81. package/dist/_pkg/cookie-consent/browser/contexts/Context.d.ts +7 -0
  82. package/dist/_pkg/cookie-consent/browser/contexts/Loader.d.ts +4 -0
  83. package/dist/_pkg/cookie-consent/browser/contexts/index.d.ts +3 -0
  84. package/dist/_pkg/cookie-consent/browser/contexts/use.d.ts +7 -0
  85. package/dist/_pkg/cookie-consent/browser/index.d.ts +2 -0
  86. package/dist/_pkg/cookie-consent/browser/index.mjs +189 -0
  87. package/dist/_pkg/crypto/browser/components/EthAccount/EthAccountBox.d.ts +4 -0
  88. package/dist/_pkg/crypto/browser/components/EthAccount/EthAccountButton.d.ts +9 -0
  89. package/dist/_pkg/crypto/browser/components/EthAccount/EthAccountProps.d.ts +14 -0
  90. package/dist/_pkg/crypto/browser/components/EthAccount/index.d.ts +3 -0
  91. package/dist/_pkg/crypto/browser/components/EthBlock.d.ts +6 -0
  92. package/dist/_pkg/crypto/browser/components/TokenAmount/TokenAmount.d.ts +3 -0
  93. package/dist/_pkg/crypto/browser/components/TokenAmount/TokenAmountProps.d.ts +12 -0
  94. package/dist/_pkg/crypto/browser/components/TokenAmount/img/index.d.ts +1 -0
  95. package/dist/_pkg/crypto/browser/components/TokenAmount/index.d.ts +2 -0
  96. package/dist/_pkg/crypto/browser/components/index.d.ts +4 -0
  97. package/dist/_pkg/crypto/browser/components/stories/EthWalletSbComponent.d.ts +6 -0
  98. package/dist/_pkg/crypto/browser/components/stories/index.d.ts +1 -0
  99. package/dist/_pkg/crypto/browser/contexts/Ethers/Context.d.ts +22 -0
  100. package/dist/_pkg/crypto/browser/contexts/Ethers/Infura/Infura.d.ts +8 -0
  101. package/dist/_pkg/crypto/browser/contexts/Ethers/Infura/index.d.ts +2 -0
  102. package/dist/_pkg/crypto/browser/contexts/Ethers/Infura/use.d.ts +5 -0
  103. package/dist/_pkg/crypto/browser/contexts/Ethers/Loader.d.ts +7 -0
  104. package/dist/_pkg/crypto/browser/contexts/Ethers/MetaMask.d.ts +9 -0
  105. package/dist/_pkg/crypto/browser/contexts/Ethers/MyEtherWallet.d.ts +7 -0
  106. package/dist/_pkg/crypto/browser/contexts/Ethers/Opera.d.ts +7 -0
  107. package/dist/_pkg/crypto/browser/contexts/Ethers/Trust.d.ts +7 -0
  108. package/dist/_pkg/crypto/browser/contexts/Ethers/index.d.ts +8 -0
  109. package/dist/_pkg/crypto/browser/contexts/Ethers/use.d.ts +1 -0
  110. package/dist/_pkg/crypto/browser/contexts/NetworkSettings/Context.d.ts +8 -0
  111. package/dist/_pkg/crypto/browser/contexts/NetworkSettings/Loader.d.ts +6 -0
  112. package/dist/_pkg/crypto/browser/contexts/NetworkSettings/index.d.ts +2 -0
  113. package/dist/_pkg/crypto/browser/contexts/index.d.ts +2 -0
  114. package/dist/_pkg/crypto/browser/hooks/index.d.ts +2 -0
  115. package/dist/_pkg/crypto/browser/hooks/useNavigateToEthAddress.d.ts +5 -0
  116. package/dist/_pkg/crypto/browser/hooks/useTryMethodCalls.d.ts +4 -0
  117. package/dist/_pkg/crypto/browser/index.d.ts +5 -0
  118. package/dist/_pkg/crypto/browser/index.mjs +2214 -0
  119. package/dist/_pkg/crypto/browser/token/StandardTokenRow.d.ts +15 -0
  120. package/dist/_pkg/crypto/browser/token/TokenAvatar.d.ts +12 -0
  121. package/dist/_pkg/crypto/browser/token/icons/XYOColorLogoIcon.d.ts +3 -0
  122. package/dist/_pkg/crypto/browser/token/icons/Xl1ColorLogoIcon.d.ts +3 -0
  123. package/dist/_pkg/crypto/browser/token/icons/index.d.ts +2 -0
  124. package/dist/_pkg/crypto/browser/token/img/index.d.ts +5 -0
  125. package/dist/_pkg/crypto/browser/token/index.d.ts +4 -0
  126. package/dist/_pkg/crypto/browser/wallets/classes/EIP1193Events.d.ts +23 -0
  127. package/dist/_pkg/crypto/browser/wallets/classes/EIP6963Connector.d.ts +14 -0
  128. package/dist/_pkg/crypto/browser/wallets/classes/EthWalletApiInstance.d.ts +19 -0
  129. package/dist/_pkg/crypto/browser/wallets/classes/EthWalletConnections.d.ts +16 -0
  130. package/dist/_pkg/crypto/browser/wallets/classes/EthWalletConnectorBase.d.ts +101 -0
  131. package/dist/_pkg/crypto/browser/wallets/classes/index.d.ts +5 -0
  132. package/dist/_pkg/crypto/browser/wallets/components/Discovery/MenuItem.d.ts +13 -0
  133. package/dist/_pkg/crypto/browser/wallets/components/Discovery/MenuItems.d.ts +10 -0
  134. package/dist/_pkg/crypto/browser/wallets/components/Discovery/Paper.d.ts +7 -0
  135. package/dist/_pkg/crypto/browser/wallets/components/Discovery/hooks/index.d.ts +1 -0
  136. package/dist/_pkg/crypto/browser/wallets/components/Discovery/hooks/use.d.ts +1 -0
  137. package/dist/_pkg/crypto/browser/wallets/components/Discovery/index.d.ts +5 -0
  138. package/dist/_pkg/crypto/browser/wallets/components/Discovery/lib/index.d.ts +1 -0
  139. package/dist/_pkg/crypto/browser/wallets/components/Discovery/lib/onWalletSelect.d.ts +2 -0
  140. package/dist/_pkg/crypto/browser/wallets/components/Overview/Card.d.ts +7 -0
  141. package/dist/_pkg/crypto/browser/wallets/components/Overview/CardActions.d.ts +12 -0
  142. package/dist/_pkg/crypto/browser/wallets/components/Overview/CardContent.d.ts +18 -0
  143. package/dist/_pkg/crypto/browser/wallets/components/Overview/CardHeader.d.ts +9 -0
  144. package/dist/_pkg/crypto/browser/wallets/components/Overview/index.d.ts +4 -0
  145. package/dist/_pkg/crypto/browser/wallets/components/Overview/lib/SampleTypedData.d.ts +9 -0
  146. package/dist/_pkg/crypto/browser/wallets/components/Overview/lib/index.d.ts +1 -0
  147. package/dist/_pkg/crypto/browser/wallets/components/index.d.ts +3 -0
  148. package/dist/_pkg/crypto/browser/wallets/components/shared/ConstrainedImage.d.ts +11 -0
  149. package/dist/_pkg/crypto/browser/wallets/components/shared/index.d.ts +1 -0
  150. package/dist/_pkg/crypto/browser/wallets/eip/1193/Eip1193.d.ts +10 -0
  151. package/dist/_pkg/crypto/browser/wallets/eip/1193/index.d.ts +1 -0
  152. package/dist/_pkg/crypto/browser/wallets/eip/6963/Eip6963.d.ts +30 -0
  153. package/dist/_pkg/crypto/browser/wallets/eip/6963/index.d.ts +1 -0
  154. package/dist/_pkg/crypto/browser/wallets/eip/SupportedEvents.d.ts +1 -0
  155. package/dist/_pkg/crypto/browser/wallets/eip/index.d.ts +3 -0
  156. package/dist/_pkg/crypto/browser/wallets/hooks/index.d.ts +10 -0
  157. package/dist/_pkg/crypto/browser/wallets/hooks/useChainId.d.ts +7 -0
  158. package/dist/_pkg/crypto/browser/wallets/hooks/useConnect.d.ts +11 -0
  159. package/dist/_pkg/crypto/browser/wallets/hooks/useCurrentAccount.d.ts +3 -0
  160. package/dist/_pkg/crypto/browser/wallets/hooks/useCurrentAccountExternal.d.ts +6 -0
  161. package/dist/_pkg/crypto/browser/wallets/hooks/useEip6963Wallet.d.ts +2 -0
  162. package/dist/_pkg/crypto/browser/wallets/hooks/useEthWallet.d.ts +6 -0
  163. package/dist/_pkg/crypto/browser/wallets/hooks/useEthWalletApiInstance.d.ts +16 -0
  164. package/dist/_pkg/crypto/browser/wallets/hooks/useEthWalletInstance.d.ts +22 -0
  165. package/dist/_pkg/crypto/browser/wallets/hooks/useProvider.d.ts +10 -0
  166. package/dist/_pkg/crypto/browser/wallets/hooks/useSigner.d.ts +5 -0
  167. package/dist/_pkg/crypto/browser/wallets/index.d.ts +7 -0
  168. package/dist/_pkg/crypto/browser/wallets/third-party/Coinbase/CoinbaseConnector.d.ts +9 -0
  169. package/dist/_pkg/crypto/browser/wallets/third-party/Coinbase/index.d.ts +1 -0
  170. package/dist/_pkg/crypto/browser/wallets/third-party/Coinbase/lib/CoinbaseProvider.d.ts +3 -0
  171. package/dist/_pkg/crypto/browser/wallets/third-party/Coinbase/lib/index.d.ts +1 -0
  172. package/dist/_pkg/crypto/browser/wallets/third-party/Coinbase/use.d.ts +2 -0
  173. package/dist/_pkg/crypto/browser/wallets/third-party/MetaMask/MetaMaskConnector.d.ts +9 -0
  174. package/dist/_pkg/crypto/browser/wallets/third-party/MetaMask/index.d.ts +2 -0
  175. package/dist/_pkg/crypto/browser/wallets/third-party/MetaMask/use.d.ts +2 -0
  176. package/dist/_pkg/crypto/browser/wallets/third-party/Phantom/PhantomConnector.d.ts +9 -0
  177. package/dist/_pkg/crypto/browser/wallets/third-party/Phantom/index.d.ts +2 -0
  178. package/dist/_pkg/crypto/browser/wallets/third-party/Phantom/use.d.ts +2 -0
  179. package/dist/_pkg/crypto/browser/wallets/third-party/Trust/TrustConnector.d.ts +9 -0
  180. package/dist/_pkg/crypto/browser/wallets/third-party/Trust/index.d.ts +2 -0
  181. package/dist/_pkg/crypto/browser/wallets/third-party/Trust/lib/TrustProvider.d.ts +3 -0
  182. package/dist/_pkg/crypto/browser/wallets/third-party/Trust/lib/index.d.ts +1 -0
  183. package/dist/_pkg/crypto/browser/wallets/third-party/Trust/use.d.ts +2 -0
  184. package/dist/_pkg/crypto/browser/wallets/third-party/index.d.ts +4 -0
  185. package/dist/_pkg/crypto/browser/wallets/types/DiscoveredWallets.d.ts +2 -0
  186. package/dist/_pkg/crypto/browser/wallets/types/EthWallet.d.ts +27 -0
  187. package/dist/_pkg/crypto/browser/wallets/types/EthWalletApi.d.ts +13 -0
  188. package/dist/_pkg/crypto/browser/wallets/types/SelectedWallet.d.ts +7 -0
  189. package/dist/_pkg/crypto/browser/wallets/types/TypedData.d.ts +9 -0
  190. package/dist/_pkg/crypto/browser/wallets/types/events/AccountsChanged.d.ts +7 -0
  191. package/dist/_pkg/crypto/browser/wallets/types/events/ChainChanged.d.ts +7 -0
  192. package/dist/_pkg/crypto/browser/wallets/types/events/index.d.ts +2 -0
  193. package/dist/_pkg/crypto/browser/wallets/types/index.d.ts +6 -0
  194. package/dist/_pkg/crypto/browser/wallets/utils/findChain.d.ts +841 -0
  195. package/dist/_pkg/crypto/browser/wallets/utils/index.d.ts +1 -0
  196. package/dist/_pkg/dialogs/browser/ErrorDialog.d.ts +8 -0
  197. package/dist/_pkg/dialogs/browser/MessageDialog.d.ts +7 -0
  198. package/dist/_pkg/dialogs/browser/index.d.ts +2 -0
  199. package/dist/_pkg/dialogs/browser/index.mjs +96 -0
  200. package/dist/_pkg/error/browser/components/ErrorBoundary/ThrownErrorBoundary.d.ts +19 -0
  201. package/dist/_pkg/error/browser/components/ErrorBoundary/index.d.ts +1 -0
  202. package/dist/_pkg/error/browser/components/ErrorBoundary.d.ts +19 -0
  203. package/dist/_pkg/error/browser/components/ErrorEx.d.ts +1 -0
  204. package/dist/_pkg/error/browser/components/ErrorQuickTipButton.d.ts +9 -0
  205. package/dist/_pkg/error/browser/components/ErrorRender/ErrorAlert.d.ts +9 -0
  206. package/dist/_pkg/error/browser/components/ErrorRender/ErrorRenderWithSupport.d.ts +14 -0
  207. package/dist/_pkg/error/browser/components/ErrorRender/Popover.d.ts +7 -0
  208. package/dist/_pkg/error/browser/components/ErrorRender/Props.d.ts +18 -0
  209. package/dist/_pkg/error/browser/components/ErrorRender/Render.d.ts +3 -0
  210. package/dist/_pkg/error/browser/components/ErrorRender/index.d.ts +5 -0
  211. package/dist/_pkg/error/browser/components/Errors/ErrorViewer.d.ts +4 -0
  212. package/dist/_pkg/error/browser/components/Errors/ErrorViewerProps.d.ts +5 -0
  213. package/dist/_pkg/error/browser/components/Errors/ErrorsViewer.d.ts +4 -0
  214. package/dist/_pkg/error/browser/components/Errors/ErrorsViewerProps.d.ts +6 -0
  215. package/dist/_pkg/error/browser/components/Errors/index.d.ts +4 -0
  216. package/dist/_pkg/error/browser/components/index.d.ts +6 -0
  217. package/dist/_pkg/error/browser/contexts/ErrorReporter/Context.d.ts +2 -0
  218. package/dist/_pkg/error/browser/contexts/ErrorReporter/Provider.d.ts +8 -0
  219. package/dist/_pkg/error/browser/contexts/ErrorReporter/State.d.ts +4 -0
  220. package/dist/_pkg/error/browser/contexts/ErrorReporter/index.d.ts +3 -0
  221. package/dist/_pkg/error/browser/contexts/ErrorReporter/useErrorReporter.d.ts +1 -0
  222. package/dist/_pkg/error/browser/contexts/index.d.ts +1 -0
  223. package/dist/_pkg/error/browser/index.d.ts +2 -0
  224. package/dist/_pkg/error/browser/index.mjs +442 -0
  225. package/dist/_pkg/experiments/browser/components/Experiment.d.ts +7 -0
  226. package/dist/_pkg/experiments/browser/components/Experiments.d.ts +4 -0
  227. package/dist/_pkg/experiments/browser/components/ExperimentsDebugger.d.ts +3 -0
  228. package/dist/_pkg/experiments/browser/components/ExperimentsProps.d.ts +7 -0
  229. package/dist/_pkg/experiments/browser/components/index.d.ts +5 -0
  230. package/dist/_pkg/experiments/browser/components/models/index.d.ts +12 -0
  231. package/dist/_pkg/experiments/browser/hooks/index.d.ts +1 -0
  232. package/dist/_pkg/experiments/browser/hooks/useExperiment.d.ts +6 -0
  233. package/dist/_pkg/experiments/browser/index.d.ts +3 -0
  234. package/dist/_pkg/experiments/browser/index.mjs +331 -0
  235. package/dist/_pkg/experiments/browser/lib/ExperimentsHelper.d.ts +16 -0
  236. package/dist/_pkg/experiments/browser/lib/index.d.ts +1 -0
  237. package/dist/_pkg/flexbox/browser/components/BusyBox/BusyBox.d.ts +9 -0
  238. package/dist/_pkg/flexbox/browser/components/BusyBox/index.d.ts +1 -0
  239. package/dist/_pkg/flexbox/browser/components/BusyCard.d.ts +11 -0
  240. package/dist/_pkg/flexbox/browser/components/FlexBoxProps.d.ts +2 -0
  241. package/dist/_pkg/flexbox/browser/components/FlexCol.d.ts +5 -0
  242. package/dist/_pkg/flexbox/browser/components/FlexRow.d.ts +5 -0
  243. package/dist/_pkg/flexbox/browser/components/HoverScale.d.ts +6 -0
  244. package/dist/_pkg/flexbox/browser/components/index.d.ts +6 -0
  245. package/dist/_pkg/flexbox/browser/hooks/index.d.ts +1 -0
  246. package/dist/_pkg/flexbox/browser/hooks/useBusyTiming.d.ts +1 -0
  247. package/dist/_pkg/flexbox/browser/index.d.ts +2 -0
  248. package/dist/_pkg/flexbox/browser/index.mjs +244 -0
  249. package/dist/_pkg/hooks/browser/index.d.ts +2 -0
  250. package/dist/_pkg/hooks/browser/index.mjs +37 -0
  251. package/dist/_pkg/hooks/browser/useResetState.d.ts +3 -0
  252. package/dist/_pkg/hooks/browser/useUniversalRedirect.d.ts +2 -0
  253. package/dist/_pkg/identicon/browser/components/Identicon.d.ts +13 -0
  254. package/dist/_pkg/identicon/browser/components/index.d.ts +1 -0
  255. package/dist/_pkg/identicon/browser/index.d.ts +1 -0
  256. package/dist/_pkg/identicon/browser/index.mjs +92 -0
  257. package/dist/_pkg/json-viewer/browser/JsonViewer.d.ts +8 -0
  258. package/dist/_pkg/json-viewer/browser/components/DataKeyPair.d.ts +10 -0
  259. package/dist/_pkg/json-viewer/browser/components/DataTypeLabel.d.ts +6 -0
  260. package/dist/_pkg/json-viewer/browser/components/DataTypes/Boolean.d.ts +1 -0
  261. package/dist/_pkg/json-viewer/browser/components/DataTypes/Date.d.ts +1 -0
  262. package/dist/_pkg/json-viewer/browser/components/DataTypes/Function.d.ts +2 -0
  263. package/dist/_pkg/json-viewer/browser/components/DataTypes/Null.d.ts +1 -0
  264. package/dist/_pkg/json-viewer/browser/components/DataTypes/Number.d.ts +4 -0
  265. package/dist/_pkg/json-viewer/browser/components/DataTypes/Object.d.ts +2 -0
  266. package/dist/_pkg/json-viewer/browser/components/DataTypes/String.d.ts +1 -0
  267. package/dist/_pkg/json-viewer/browser/components/DataTypes/Undefined.d.ts +1 -0
  268. package/dist/_pkg/json-viewer/browser/components/DataTypes/defineEasyType.d.ts +21 -0
  269. package/dist/_pkg/json-viewer/browser/components/DataTypes/index.d.ts +9 -0
  270. package/dist/_pkg/json-viewer/browser/components/Icons.d.ts +11 -0
  271. package/dist/_pkg/json-viewer/browser/components/mui/DataBox.d.ts +7 -0
  272. package/dist/_pkg/json-viewer/browser/hooks/useColor.d.ts +1 -0
  273. package/dist/_pkg/json-viewer/browser/hooks/useCopyToClipboard.d.ts +14 -0
  274. package/dist/_pkg/json-viewer/browser/hooks/useInspect.d.ts +2 -0
  275. package/dist/_pkg/json-viewer/browser/hooks/useIsCycleReference.d.ts +1 -0
  276. package/dist/_pkg/json-viewer/browser/hooks/useThemeDetector.d.ts +1 -0
  277. package/dist/_pkg/json-viewer/browser/index.d.ts +1 -0
  278. package/dist/_pkg/json-viewer/browser/index.mjs +1905 -0
  279. package/dist/_pkg/json-viewer/browser/stores/JsonViewerStore.d.ts +45 -0
  280. package/dist/_pkg/json-viewer/browser/stores/typeRegistry.d.ts +14 -0
  281. package/dist/_pkg/json-viewer/browser/theme/base16.d.ts +24 -0
  282. package/dist/_pkg/json-viewer/browser/type.d.ts +250 -0
  283. package/dist/_pkg/json-viewer/browser/utils/index.d.ts +98 -0
  284. package/dist/_pkg/link/browser/LinkEx.d.ts +8 -0
  285. package/dist/_pkg/link/browser/LinkExProps.d.ts +31 -0
  286. package/dist/_pkg/link/browser/LinkToEx.d.ts +8 -0
  287. package/dist/_pkg/link/browser/index.d.ts +3 -0
  288. package/dist/_pkg/link/browser/index.mjs +127 -0
  289. package/dist/_pkg/number-status/browser/NumberStatus.d.ts +4 -0
  290. package/dist/_pkg/number-status/browser/NumberStatusProps.d.ts +13 -0
  291. package/dist/_pkg/number-status/browser/index.d.ts +2 -0
  292. package/dist/_pkg/number-status/browser/index.mjs +83 -0
  293. package/dist/_pkg/pixel/browser/contexts/UserEvents/Context.d.ts +11 -0
  294. package/dist/_pkg/pixel/browser/contexts/UserEvents/Provider.d.ts +8 -0
  295. package/dist/_pkg/pixel/browser/contexts/UserEvents/index.d.ts +2 -0
  296. package/dist/_pkg/pixel/browser/contexts/index.d.ts +1 -0
  297. package/dist/_pkg/pixel/browser/hooks/index.d.ts +1 -0
  298. package/dist/_pkg/pixel/browser/hooks/useUserEvents.d.ts +5 -0
  299. package/dist/_pkg/pixel/browser/index.d.ts +3 -0
  300. package/dist/_pkg/pixel/browser/index.mjs +1211 -0
  301. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/BaseEvent.d.ts +11 -0
  302. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/CustomEvent.d.ts +4 -0
  303. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/Base.d.ts +6 -0
  304. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/CustomFields.d.ts +4 -0
  305. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/Identify.d.ts +14 -0
  306. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/Result.d.ts +6 -0
  307. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/StandardFields.d.ts +12 -0
  308. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/Data/index.d.ts +2 -0
  309. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/StandardEvents.d.ts +6 -0
  310. package/dist/_pkg/pixel/browser/lib/Tracking/Drip/index.d.ts +4 -0
  311. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/BaseEvent.d.ts +9 -0
  312. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/CustomEvent.d.ts +6 -0
  313. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/Fbq.d.ts +87 -0
  314. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/StandardEvent.d.ts +7 -0
  315. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/StandardEvents.d.ts +66 -0
  316. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/UserEventHandler.d.ts +9 -0
  317. package/dist/_pkg/pixel/browser/lib/Tracking/Facebook/index.d.ts +10 -0
  318. package/dist/_pkg/pixel/browser/lib/Tracking/Google/BaseEvent.d.ts +13 -0
  319. package/dist/_pkg/pixel/browser/lib/Tracking/Google/CustomEvent.d.ts +5 -0
  320. package/dist/_pkg/pixel/browser/lib/Tracking/Google/DataLayer.d.ts +9 -0
  321. package/dist/_pkg/pixel/browser/lib/Tracking/Google/Gtag.d.ts +20 -0
  322. package/dist/_pkg/pixel/browser/lib/Tracking/Google/Gtm.d.ts +10 -0
  323. package/dist/_pkg/pixel/browser/lib/Tracking/Google/StandardEvent.d.ts +4 -0
  324. package/dist/_pkg/pixel/browser/lib/Tracking/Google/StandardEvents.d.ts +152 -0
  325. package/dist/_pkg/pixel/browser/lib/Tracking/Google/UserEventHandler.d.ts +9 -0
  326. package/dist/_pkg/pixel/browser/lib/Tracking/Google/index.d.ts +7 -0
  327. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/BaseEvent.d.ts +9 -0
  328. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/CustomEvent.d.ts +4 -0
  329. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/MixpanelLike.d.ts +5 -0
  330. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/PageViewEvent.d.ts +8 -0
  331. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/UserEventHandler.d.ts +12 -0
  332. package/dist/_pkg/pixel/browser/lib/Tracking/Mixpanel/index.d.ts +5 -0
  333. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/BaseEvent.d.ts +8 -0
  334. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/CustomEvent.d.ts +5 -0
  335. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/Rdt.d.ts +8 -0
  336. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/StandardEvent.d.ts +5 -0
  337. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/StandardEvents.d.ts +12 -0
  338. package/dist/_pkg/pixel/browser/lib/Tracking/Reddit/index.d.ts +5 -0
  339. package/dist/_pkg/pixel/browser/lib/Tracking/Referrer.d.ts +12 -0
  340. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/BaseEvent.d.ts +6 -0
  341. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/Snaptr.d.ts +6 -0
  342. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/StandardEvent.d.ts +5 -0
  343. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/StandardEvents.d.ts +33 -0
  344. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/StandardProperties.d.ts +15 -0
  345. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/UserProperties.d.ts +7 -0
  346. package/dist/_pkg/pixel/browser/lib/Tracking/Snapchat/index.d.ts +6 -0
  347. package/dist/_pkg/pixel/browser/lib/Tracking/Tapjoy/BaseEvent.d.ts +8 -0
  348. package/dist/_pkg/pixel/browser/lib/Tracking/Tapjoy/StandardEvent.d.ts +5 -0
  349. package/dist/_pkg/pixel/browser/lib/Tracking/Tapjoy/StandardEvents.d.ts +5 -0
  350. package/dist/_pkg/pixel/browser/lib/Tracking/Tapjoy/ef.d.ts +8 -0
  351. package/dist/_pkg/pixel/browser/lib/Tracking/Tapjoy/index.d.ts +3 -0
  352. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/BaseEvent.d.ts +7 -0
  353. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/CustomEvent.d.ts +5 -0
  354. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/StandardEvent.d.ts +4 -0
  355. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/StandardEvents.d.ts +19 -0
  356. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/StandardProperties.d.ts +4 -0
  357. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/Ttq.d.ts +8 -0
  358. package/dist/_pkg/pixel/browser/lib/Tracking/Tiktok/index.d.ts +6 -0
  359. package/dist/_pkg/pixel/browser/lib/Tracking/Xy/BaseEvent.d.ts +7 -0
  360. package/dist/_pkg/pixel/browser/lib/Tracking/Xy/CustomEvent.d.ts +5 -0
  361. package/dist/_pkg/pixel/browser/lib/Tracking/Xy/UserEventHandler.d.ts +10 -0
  362. package/dist/_pkg/pixel/browser/lib/Tracking/Xy/index.d.ts +3 -0
  363. package/dist/_pkg/pixel/browser/lib/Tracking/XyoUserEventHandler.d.ts +14 -0
  364. package/dist/_pkg/pixel/browser/lib/Tracking/index.d.ts +11 -0
  365. package/dist/_pkg/pixel/browser/lib/index.d.ts +1 -0
  366. package/dist/_pkg/pixel-debugger/browser/PixelEvent.d.ts +4 -0
  367. package/dist/_pkg/pixel-debugger/browser/components/PixelDebugger.d.ts +2 -0
  368. package/dist/_pkg/pixel-debugger/browser/components/PixelDebuggerProvider.d.ts +3 -0
  369. package/dist/_pkg/pixel-debugger/browser/components/PixelDebuggerToggle.d.ts +3 -0
  370. package/dist/_pkg/pixel-debugger/browser/components/index.d.ts +3 -0
  371. package/dist/_pkg/pixel-debugger/browser/hooks/index.d.ts +1 -0
  372. package/dist/_pkg/pixel-debugger/browser/hooks/usePixelAltSendHandler.d.ts +1 -0
  373. package/dist/_pkg/pixel-debugger/browser/index.d.ts +3 -0
  374. package/dist/_pkg/pixel-debugger/browser/index.mjs +174 -0
  375. package/dist/_pkg/portal/browser/components/Portal/Portal.d.ts +2 -0
  376. package/dist/_pkg/portal/browser/components/Portal/PortalProps.d.ts +6 -0
  377. package/dist/_pkg/portal/browser/components/Portal/index.d.ts +2 -0
  378. package/dist/_pkg/portal/browser/components/index.d.ts +1 -0
  379. package/dist/_pkg/portal/browser/index.d.ts +1 -0
  380. package/dist/_pkg/portal/browser/index.mjs +34 -0
  381. package/dist/_pkg/promise/browser/context/context.d.ts +5 -0
  382. package/dist/_pkg/promise/browser/context/hook.d.ts +2 -0
  383. package/dist/_pkg/promise/browser/context/index.d.ts +3 -0
  384. package/dist/_pkg/promise/browser/context/provider.d.ts +7 -0
  385. package/dist/_pkg/promise/browser/index.d.ts +3 -0
  386. package/dist/_pkg/promise/browser/index.mjs +117 -0
  387. package/dist/_pkg/promise/browser/model.d.ts +21 -0
  388. package/dist/_pkg/promise/browser/useAtomicPromise.d.ts +14 -0
  389. package/dist/_pkg/promise/browser/usePromise.d.ts +17 -0
  390. package/dist/_pkg/quick-tip-button/browser/QuickTipButton.d.ts +11 -0
  391. package/dist/_pkg/quick-tip-button/browser/index.d.ts +1 -0
  392. package/dist/_pkg/quick-tip-button/browser/index.mjs +40 -0
  393. package/dist/_pkg/render-spin-check/browser/components/RenderSpinCheck.d.ts +5 -0
  394. package/dist/_pkg/render-spin-check/browser/components/index.d.ts +1 -0
  395. package/dist/_pkg/render-spin-check/browser/hooks/index.d.ts +1 -0
  396. package/dist/_pkg/render-spin-check/browser/hooks/useRenderSpinCheck.d.ts +10 -0
  397. package/dist/_pkg/render-spin-check/browser/index.d.ts +2 -0
  398. package/dist/_pkg/render-spin-check/browser/index.mjs +58 -0
  399. package/dist/_pkg/rich-result/browser/RichResult.d.ts +6 -0
  400. package/dist/_pkg/rich-result/browser/index.d.ts +2 -0
  401. package/dist/_pkg/rich-result/browser/index.mjs +62 -0
  402. package/dist/_pkg/rich-result/browser/jsonld/Action.d.ts +23 -0
  403. package/dist/_pkg/rich-result/browser/jsonld/ActionStatusType.d.ts +9 -0
  404. package/dist/_pkg/rich-result/browser/jsonld/AdministrativeArea.d.ts +3 -0
  405. package/dist/_pkg/rich-result/browser/jsonld/AggregateRating.d.ts +8 -0
  406. package/dist/_pkg/rich-result/browser/jsonld/Article.d.ts +14 -0
  407. package/dist/_pkg/rich-result/browser/jsonld/Base.d.ts +4 -0
  408. package/dist/_pkg/rich-result/browser/jsonld/Brand.d.ts +10 -0
  409. package/dist/_pkg/rich-result/browser/jsonld/Class.d.ts +7 -0
  410. package/dist/_pkg/rich-result/browser/jsonld/ContactPoint.d.ts +18 -0
  411. package/dist/_pkg/rich-result/browser/jsonld/ContactPointOption.d.ts +7 -0
  412. package/dist/_pkg/rich-result/browser/jsonld/Country.d.ts +3 -0
  413. package/dist/_pkg/rich-result/browser/jsonld/CreativeWork.d.ts +121 -0
  414. package/dist/_pkg/rich-result/browser/jsonld/DateTime.d.ts +2 -0
  415. package/dist/_pkg/rich-result/browser/jsonld/EntryPoint.d.ts +13 -0
  416. package/dist/_pkg/rich-result/browser/jsonld/Enumeration.d.ts +7 -0
  417. package/dist/_pkg/rich-result/browser/jsonld/GeoShape.d.ts +15 -0
  418. package/dist/_pkg/rich-result/browser/jsonld/GeospatialGeometry.d.ts +15 -0
  419. package/dist/_pkg/rich-result/browser/jsonld/ImageObject.d.ts +9 -0
  420. package/dist/_pkg/rich-result/browser/jsonld/Intangible.d.ts +3 -0
  421. package/dist/_pkg/rich-result/browser/jsonld/Integer.d.ts +2 -0
  422. package/dist/_pkg/rich-result/browser/jsonld/ItemAvailability.d.ts +14 -0
  423. package/dist/_pkg/rich-result/browser/jsonld/Language.d.ts +3 -0
  424. package/dist/_pkg/rich-result/browser/jsonld/Map.d.ts +6 -0
  425. package/dist/_pkg/rich-result/browser/jsonld/MapCategoryType.d.ts +9 -0
  426. package/dist/_pkg/rich-result/browser/jsonld/MediaObject.d.ts +10 -0
  427. package/dist/_pkg/rich-result/browser/jsonld/MobileApplication.d.ts +6 -0
  428. package/dist/_pkg/rich-result/browser/jsonld/Offer.d.ts +58 -0
  429. package/dist/_pkg/rich-result/browser/jsonld/Organization.d.ts +76 -0
  430. package/dist/_pkg/rich-result/browser/jsonld/Person.d.ts +70 -0
  431. package/dist/_pkg/rich-result/browser/jsonld/Photograph.d.ts +3 -0
  432. package/dist/_pkg/rich-result/browser/jsonld/Place.d.ts +42 -0
  433. package/dist/_pkg/rich-result/browser/jsonld/PostalAddress.d.ts +12 -0
  434. package/dist/_pkg/rich-result/browser/jsonld/Product.d.ts +56 -0
  435. package/dist/_pkg/rich-result/browser/jsonld/Property.d.ts +10 -0
  436. package/dist/_pkg/rich-result/browser/jsonld/PropertyValue.d.ts +16 -0
  437. package/dist/_pkg/rich-result/browser/jsonld/QualitativeValue.d.ts +15 -0
  438. package/dist/_pkg/rich-result/browser/jsonld/QuantitativeValue.d.ts +15 -0
  439. package/dist/_pkg/rich-result/browser/jsonld/Rating.d.ts +10 -0
  440. package/dist/_pkg/rich-result/browser/jsonld/Review.d.ts +10 -0
  441. package/dist/_pkg/rich-result/browser/jsonld/Service.d.ts +37 -0
  442. package/dist/_pkg/rich-result/browser/jsonld/SoftwareApplication.d.ts +28 -0
  443. package/dist/_pkg/rich-result/browser/jsonld/StructuredValue.d.ts +3 -0
  444. package/dist/_pkg/rich-result/browser/jsonld/Text.d.ts +2 -0
  445. package/dist/_pkg/rich-result/browser/jsonld/Thing.d.ts +22 -0
  446. package/dist/_pkg/rich-result/browser/jsonld/Time.d.ts +2 -0
  447. package/dist/_pkg/rich-result/browser/jsonld/VirtualLocation.d.ts +3 -0
  448. package/dist/_pkg/rich-result/browser/jsonld/index.d.ts +47 -0
  449. package/dist/_pkg/rich-result/browser/jsonld/url.d.ts +2 -0
  450. package/dist/_pkg/scroll-to-top/browser/ScrollToTop.d.ts +1 -0
  451. package/dist/_pkg/scroll-to-top/browser/ScrollToTopButton.d.ts +6 -0
  452. package/dist/_pkg/scroll-to-top/browser/index.d.ts +2 -0
  453. package/dist/_pkg/scroll-to-top/browser/index.mjs +55 -0
  454. package/dist/_pkg/select/browser/components/SelectEx.d.ts +7 -0
  455. package/dist/_pkg/select/browser/components/index.d.ts +1 -0
  456. package/dist/_pkg/select/browser/index.d.ts +1 -0
  457. package/dist/_pkg/select/browser/index.mjs +23 -0
  458. package/dist/_pkg/shared/browser/BoxlikeComponentProps.d.ts +39 -0
  459. package/dist/_pkg/shared/browser/BusyProps.d.ts +14 -0
  460. package/dist/_pkg/shared/browser/Collapsible/State.d.ts +8 -0
  461. package/dist/_pkg/shared/browser/Collapsible/context.d.ts +22 -0
  462. package/dist/_pkg/shared/browser/Collapsible/index.d.ts +3 -0
  463. package/dist/_pkg/shared/browser/Collapsible/provider.d.ts +7 -0
  464. package/dist/_pkg/shared/browser/Collapsible/use.d.ts +8 -0
  465. package/dist/_pkg/shared/browser/WithChildren.d.ts +5 -0
  466. package/dist/_pkg/shared/browser/calcSpacing.d.ts +3 -0
  467. package/dist/_pkg/shared/browser/components/BusyCircularProgress.d.ts +10 -0
  468. package/dist/_pkg/shared/browser/components/BusyLinearProgress.d.ts +9 -0
  469. package/dist/_pkg/shared/browser/components/NotFound.d.ts +4 -0
  470. package/dist/_pkg/shared/browser/components/index.d.ts +3 -0
  471. package/dist/_pkg/shared/browser/contextEx/ContextExProviderProps.d.ts +6 -0
  472. package/dist/_pkg/shared/browser/contextEx/State.d.ts +11 -0
  473. package/dist/_pkg/shared/browser/contextEx/create.d.ts +4 -0
  474. package/dist/_pkg/shared/browser/contextEx/index.d.ts +4 -0
  475. package/dist/_pkg/shared/browser/contextEx/use.d.ts +5 -0
  476. package/dist/_pkg/shared/browser/hooks/index.d.ts +9 -0
  477. package/dist/_pkg/shared/browser/hooks/useBreakpoint.d.ts +1 -0
  478. package/dist/_pkg/shared/browser/hooks/useInterval.d.ts +1 -0
  479. package/dist/_pkg/shared/browser/hooks/useLocalStorage.d.ts +1 -0
  480. package/dist/_pkg/shared/browser/hooks/useMediaQuery.d.ts +2 -0
  481. package/dist/_pkg/shared/browser/hooks/useMounted.d.ts +1 -0
  482. package/dist/_pkg/shared/browser/hooks/useSpacing.d.ts +1 -0
  483. package/dist/_pkg/shared/browser/hooks/useTimeout.d.ts +1 -0
  484. package/dist/_pkg/shared/browser/hooks/useWebP.d.ts +1 -0
  485. package/dist/_pkg/shared/browser/hooks/useWindowSize.d.ts +5 -0
  486. package/dist/_pkg/shared/browser/index.d.ts +9 -0
  487. package/dist/_pkg/shared/browser/index.mjs +498 -0
  488. package/dist/_pkg/shared/browser/lib/ComponentSizes.d.ts +2 -0
  489. package/dist/_pkg/shared/browser/lib/getApiStage.d.ts +2 -0
  490. package/dist/_pkg/shared/browser/lib/index.d.ts +6 -0
  491. package/dist/_pkg/shared/browser/lib/isLocalHost.d.ts +2 -0
  492. package/dist/_pkg/shared/browser/lib/profile.d.ts +8 -0
  493. package/dist/_pkg/shared/browser/lib/safeLocalStorage.d.ts +3 -0
  494. package/dist/_pkg/shared/browser/lib/safeSessionStorage.d.ts +3 -0
  495. package/dist/_pkg/shared/browser/mergeBoxlikeStyles.d.ts +4 -0
  496. package/dist/_pkg/theme/browser/alphaCss.d.ts +1 -0
  497. package/dist/_pkg/theme/browser/components/ColorSchemeButton.d.ts +7 -0
  498. package/dist/_pkg/theme/browser/components/index.d.ts +1 -0
  499. package/dist/_pkg/theme/browser/darkenCss.d.ts +1 -0
  500. package/dist/_pkg/theme/browser/index.d.ts +7 -0
  501. package/dist/_pkg/theme/browser/index.mjs +1374 -0
  502. package/dist/_pkg/theme/browser/lightenCss.d.ts +1 -0
  503. package/dist/_pkg/theme/browser/product-theme/ThemeExtensions/CreateThemeOptions.d.ts +2 -0
  504. package/dist/_pkg/theme/browser/product-theme/ThemeExtensions/customThemeTypes.d.ts +30 -0
  505. package/dist/_pkg/theme/browser/product-theme/ThemeExtensions/index.d.ts +3 -0
  506. package/dist/_pkg/theme/browser/product-theme/ThemeExtensions/typography.d.ts +48 -0
  507. package/dist/_pkg/theme/browser/product-theme/ThemeViewer.d.ts +2 -0
  508. package/dist/_pkg/theme/browser/product-theme/dataism/customThemeColors.d.ts +127 -0
  509. package/dist/_pkg/theme/browser/product-theme/dataism/darkThemePalette.d.ts +2 -0
  510. package/dist/_pkg/theme/browser/product-theme/dataism/index.d.ts +1 -0
  511. package/dist/_pkg/theme/browser/product-theme/dataism/lightThemePalette.d.ts +2 -0
  512. package/dist/_pkg/theme/browser/product-theme/dataism/theme.d.ts +4 -0
  513. package/dist/_pkg/theme/browser/product-theme/index.d.ts +6 -0
  514. package/dist/_pkg/theme/browser/product-theme/xl1/darkThemeOptions.d.ts +2 -0
  515. package/dist/_pkg/theme/browser/product-theme/xl1/index.d.ts +1 -0
  516. package/dist/_pkg/theme/browser/product-theme/xl1/lightThemeOptions.d.ts +2 -0
  517. package/dist/_pkg/theme/browser/product-theme/xl1/theme.d.ts +4 -0
  518. package/dist/_pkg/theme/browser/product-theme/xylabs/darkThemeOptions.d.ts +2 -0
  519. package/dist/_pkg/theme/browser/product-theme/xylabs/index.d.ts +1 -0
  520. package/dist/_pkg/theme/browser/product-theme/xylabs/lightThemeOptions.d.ts +2 -0
  521. package/dist/_pkg/theme/browser/product-theme/xylabs/theme.d.ts +4 -0
  522. package/dist/_pkg/theme/browser/product-theme/xyo/breakpoints.d.ts +2 -0
  523. package/dist/_pkg/theme/browser/product-theme/xyo/components.d.ts +2 -0
  524. package/dist/_pkg/theme/browser/product-theme/xyo/darkThemeOptions.d.ts +2 -0
  525. package/dist/_pkg/theme/browser/product-theme/xyo/index.d.ts +6 -0
  526. package/dist/_pkg/theme/browser/product-theme/xyo/lightThemeOptions.d.ts +2 -0
  527. package/dist/_pkg/theme/browser/product-theme/xyo/theme.d.ts +4 -0
  528. package/dist/_pkg/theme/browser/product-theme/xyo/typography.d.ts +2 -0
  529. package/dist/_pkg/theme/browser/product-theme/xyos/darkThemeOptions.d.ts +2 -0
  530. package/dist/_pkg/theme/browser/product-theme/xyos/index.d.ts +1 -0
  531. package/dist/_pkg/theme/browser/product-theme/xyos/lightThemeOptions.d.ts +2 -0
  532. package/dist/_pkg/theme/browser/product-theme/xyos/theme.d.ts +4 -0
  533. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/LineCharts/DailyVerificationLineChart.d.ts +3 -0
  534. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/LineCharts/DailyVerificationStackedAreaChart.d.ts +3 -0
  535. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/LineCharts/index.d.ts +3 -0
  536. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/LineCharts/sampleVerificationData.d.ts +3 -0
  537. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/PieCharts/DualRingPieChart.d.ts +3 -0
  538. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/PieCharts/index.d.ts +1 -0
  539. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/ScatterCharts/DailyVerificationScatterChart.d.ts +3 -0
  540. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/ScatterCharts/index.d.ts +2 -0
  541. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/ScatterCharts/sampleVerificationData.d.ts +4 -0
  542. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/Shared/CustomTooltip.d.ts +15 -0
  543. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/Shared/DataProps.d.ts +58 -0
  544. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/Shared/index.d.ts +2 -0
  545. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/Charts/index.d.ts +4 -0
  546. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/DataHealth.d.ts +8 -0
  547. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/VerificationSummary/VerificationList.d.ts +14 -0
  548. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/VerificationSummary/VerificationSummaryProps.d.ts +21 -0
  549. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/VerificationSummary/index.d.ts +2 -0
  550. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/img/index.d.ts +1 -0
  551. package/dist/_pkg/theme/browser/showcase/dashboard/DataViewers/index.d.ts +3 -0
  552. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/BottomMenuArea.d.ts +3 -0
  553. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/LogoutListItem.d.ts +3 -0
  554. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/MenuList.d.ts +7 -0
  555. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/MenuListItem.d.ts +10 -0
  556. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/MiniDrawer.d.ts +13 -0
  557. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/StyledListItemButton.d.ts +7 -0
  558. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/Styling.d.ts +5 -0
  559. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/StylingMixin.d.ts +4 -0
  560. package/dist/_pkg/theme/browser/showcase/dashboard/Drawer/index.d.ts +3 -0
  561. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/AllCategoriesData.d.ts +2 -0
  562. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/DataMapping.d.ts +4 -0
  563. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/Depin.d.ts +4 -0
  564. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/EmployeeTracking.d.ts +4 -0
  565. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/EventAttendance.d.ts +4 -0
  566. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/GameFi.d.ts +4 -0
  567. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/MobileApp.d.ts +4 -0
  568. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/PartnerValidation.d.ts +4 -0
  569. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/RewardPrograms.d.ts +4 -0
  570. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/SupplyChain.d.ts +4 -0
  571. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard1/index.d.ts +2 -0
  572. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard2/AllCategoriesData.d.ts +2 -0
  573. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard2/DataMapping.d.ts +2 -0
  574. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/SampleDashboard2/index.d.ts +1 -0
  575. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/Data/index.d.ts +2 -0
  576. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/SampleDashboard1.d.ts +25 -0
  577. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/SampleDashboard2.d.ts +22 -0
  578. package/dist/_pkg/theme/browser/showcase/dashboard/ExampleDashboards/index.d.ts +2 -0
  579. package/dist/_pkg/theme/browser/showcase/dashboard/MenuNavItem.d.ts +12 -0
  580. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/AppChrome/AppChrome.d.ts +14 -0
  581. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/AppChrome/index.d.ts +1 -0
  582. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DataCard/DataCard.d.ts +9 -0
  583. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DataCard/DataCardSpeedDial.d.ts +11 -0
  584. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DataCard/index.d.ts +2 -0
  585. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DropdownSelect/DropdownSelect.d.ts +14 -0
  586. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DropdownSelect/DropdownSelectData.d.ts +2 -0
  587. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/DropdownSelect/index.d.ts +2 -0
  588. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/StatCard/StatCard.d.ts +10 -0
  589. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/StatCard/index.d.ts +1 -0
  590. package/dist/_pkg/theme/browser/showcase/dashboard/StandardComponents/index.d.ts +3 -0
  591. package/dist/_pkg/theme/browser/showcase/dashboard/StyledListItemButton.d.ts +8 -0
  592. package/dist/_pkg/theme/browser/showcase/dashboard/index.d.ts +4 -0
  593. package/dist/_pkg/theme/browser/showcase/index.d.ts +2 -0
  594. package/dist/_pkg/theme/browser/showcase/theme/ColorCard.d.ts +7 -0
  595. package/dist/_pkg/theme/browser/showcase/theme/ColorShowcase.d.ts +2 -0
  596. package/dist/_pkg/theme/browser/showcase/theme/ThemeShowcase.d.ts +2 -0
  597. package/dist/_pkg/theme/browser/showcase/theme/TypographyShowcase.d.ts +2 -0
  598. package/dist/_pkg/theme/browser/showcase/theme/index.d.ts +3 -0
  599. package/dist/_pkg/theme/browser/theme-fragments/components.d.ts +2 -0
  600. package/dist/_pkg/theme/browser/theme-fragments/index.d.ts +4 -0
  601. package/dist/_pkg/theme/browser/theme-fragments/link.d.ts +2 -0
  602. package/dist/_pkg/theme/browser/theme-fragments/shape.d.ts +2 -0
  603. package/dist/_pkg/theme/browser/theme-fragments/spacing.d.ts +2 -0
  604. package/dist/_pkg/theme/browser/useIsDark.d.ts +1 -0
  605. package/dist/_pkg/theme/browser/useIsSmall.d.ts +1 -0
  606. package/dist/browser/accordion.d.ts +1 -0
  607. package/dist/browser/accordion.mjs +1 -0
  608. package/dist/browser/animation.d.ts +1 -0
  609. package/dist/browser/animation.mjs +1 -0
  610. package/dist/browser/appbar.d.ts +1 -0
  611. package/dist/browser/appbar.mjs +1 -0
  612. package/dist/browser/async-effect.d.ts +1 -0
  613. package/dist/browser/async-effect.mjs +1 -0
  614. package/dist/browser/base-page.d.ts +1 -0
  615. package/dist/browser/base-page.mjs +1 -0
  616. package/dist/browser/button.d.ts +1 -0
  617. package/dist/browser/button.mjs +1 -0
  618. package/dist/browser/common.d.ts +1 -0
  619. package/dist/browser/common.mjs +1 -0
  620. package/dist/browser/cookie-consent.d.ts +1 -0
  621. package/dist/browser/cookie-consent.mjs +1 -0
  622. package/dist/browser/crypto.d.ts +1 -0
  623. package/dist/browser/crypto.mjs +1 -0
  624. package/dist/browser/dialogs.d.ts +1 -0
  625. package/dist/browser/dialogs.mjs +1 -0
  626. package/dist/browser/error.d.ts +1 -0
  627. package/dist/browser/error.mjs +1 -0
  628. package/dist/browser/experiments.d.ts +1 -0
  629. package/dist/browser/experiments.mjs +1 -0
  630. package/dist/browser/flexbox.d.ts +1 -0
  631. package/dist/browser/flexbox.mjs +1 -0
  632. package/dist/browser/hooks.d.ts +1 -0
  633. package/dist/browser/hooks.mjs +1 -0
  634. package/dist/browser/identicon.d.ts +1 -0
  635. package/dist/browser/identicon.mjs +1 -0
  636. package/dist/browser/index.d.ts +29 -0
  637. package/dist/browser/index.mjs +29 -0
  638. package/dist/browser/json-viewer.d.ts +1 -0
  639. package/dist/browser/json-viewer.mjs +1 -0
  640. package/dist/browser/link.d.ts +1 -0
  641. package/dist/browser/link.mjs +1 -0
  642. package/dist/browser/number-status.d.ts +1 -0
  643. package/dist/browser/number-status.mjs +1 -0
  644. package/dist/browser/pixel-debugger.d.ts +1 -0
  645. package/dist/browser/pixel-debugger.mjs +1 -0
  646. package/dist/browser/pixel.d.ts +1 -0
  647. package/dist/browser/pixel.mjs +1 -0
  648. package/dist/browser/portal.d.ts +1 -0
  649. package/dist/browser/portal.mjs +1 -0
  650. package/dist/browser/promise.d.ts +1 -0
  651. package/dist/browser/promise.mjs +1 -0
  652. package/dist/browser/quick-tip-button.d.ts +1 -0
  653. package/dist/browser/quick-tip-button.mjs +1 -0
  654. package/dist/browser/render-spin-check.d.ts +1 -0
  655. package/dist/browser/render-spin-check.mjs +1 -0
  656. package/dist/browser/rich-result.d.ts +1 -0
  657. package/dist/browser/rich-result.mjs +1 -0
  658. package/dist/browser/scroll-to-top.d.ts +1 -0
  659. package/dist/browser/scroll-to-top.mjs +1 -0
  660. package/dist/browser/select.d.ts +1 -0
  661. package/dist/browser/select.mjs +1 -0
  662. package/dist/browser/shared.d.ts +1 -0
  663. package/dist/browser/shared.mjs +1 -0
  664. package/dist/browser/theme.d.ts +1 -0
  665. package/dist/browser/theme.mjs +1 -0
  666. package/dist/neutral/model.d.ts +1 -0
  667. package/dist/neutral/model.mjs +1 -0
  668. package/dist/node/index.d.ts +29 -0
  669. package/dist/node/index.mjs +29 -0
  670. package/package.json +433 -0
@@ -0,0 +1,1905 @@
1
+ // src/JsonViewer.tsx
2
+ import {
3
+ createTheme,
4
+ Paper,
5
+ ThemeProvider
6
+ } from "@mui/material";
7
+ import clsx from "clsx";
8
+ import {
9
+ useCallback as useCallback5,
10
+ useContext as useContext3,
11
+ useEffect as useEffect4,
12
+ useMemo as useMemo5,
13
+ useRef as useRef3
14
+ } from "react";
15
+
16
+ // src/components/DataKeyPair.tsx
17
+ import { Box as Box8 } from "@mui/material";
18
+ import {
19
+ useCallback as useCallback4,
20
+ useEffect as useEffect2,
21
+ useMemo as useMemo4,
22
+ useRef as useRef2,
23
+ useState as useState5
24
+ } from "react";
25
+
26
+ // src/stores/JsonViewerStore.ts
27
+ import { createContext, useContext } from "react";
28
+ import { create, useStore } from "zustand";
29
+
30
+ // src/theme/base16.ts
31
+ var lightColorspace = {
32
+ scheme: "Light Theme",
33
+ author: "mac gainor (https://github.com/mac-s-g)",
34
+ base00: "rgba(0, 0, 0, 0)",
35
+ base01: "rgb(245, 245, 245)",
36
+ base02: "rgb(235, 235, 235)",
37
+ base03: "#93a1a1",
38
+ base04: "rgba(0, 0, 0, 0.3)",
39
+ base05: "#586e75",
40
+ base06: "#073642",
41
+ base07: "#002b36",
42
+ base08: "#d33682",
43
+ base09: "#cb4b16",
44
+ base0A: "#ffd500",
45
+ base0B: "#859900",
46
+ base0C: "#6c71c4",
47
+ base0D: "#586e75",
48
+ base0E: "#2aa198",
49
+ base0F: "#268bd2"
50
+ };
51
+ var darkColorspace = {
52
+ scheme: "Dark Theme",
53
+ author: "Chris Kempson (http://chriskempson.com)",
54
+ base00: "#181818",
55
+ base01: "#282828",
56
+ base02: "#383838",
57
+ base03: "#585858",
58
+ base04: "#b8b8b8",
59
+ base05: "#d8d8d8",
60
+ base06: "#e8e8e8",
61
+ base07: "#f8f8f8",
62
+ base08: "#ab4642",
63
+ base09: "#dc9656",
64
+ base0A: "#f7ca88",
65
+ base0B: "#a1b56c",
66
+ base0C: "#86c1b9",
67
+ base0D: "#7cafc2",
68
+ base0E: "#ba8baf",
69
+ base0F: "#a16946"
70
+ };
71
+
72
+ // src/stores/JsonViewerStore.ts
73
+ var DefaultKeyRenderer = () => null;
74
+ DefaultKeyRenderer.when = () => false;
75
+ var createJsonViewerStore = (props) => {
76
+ return create()((set, get) => ({
77
+ // provided by user
78
+ rootName: props.rootName ?? "root",
79
+ indentWidth: props.indentWidth ?? 3,
80
+ keyRenderer: props.keyRenderer ?? DefaultKeyRenderer,
81
+ enableAdd: props.enableAdd ?? false,
82
+ enableDelete: props.enableDelete ?? false,
83
+ enableClipboard: props.enableClipboard ?? true,
84
+ editable: props.editable ?? false,
85
+ onChange: props.onChange ?? (() => {
86
+ }),
87
+ onCopy: props.onCopy ?? void 0,
88
+ onSelect: props.onSelect ?? void 0,
89
+ onAdd: props.onAdd ?? void 0,
90
+ onDelete: props.onDelete ?? void 0,
91
+ defaultInspectDepth: props.defaultInspectDepth ?? 5,
92
+ defaultInspectControl: props.defaultInspectControl ?? void 0,
93
+ maxDisplayLength: props.maxDisplayLength ?? 30,
94
+ groupArraysAfterLength: props.groupArraysAfterLength ?? 100,
95
+ collapseStringsAfterLength: props.collapseStringsAfterLength === false ? Number.MAX_VALUE : props.collapseStringsAfterLength ?? 50,
96
+ objectSortKeys: props.objectSortKeys ?? false,
97
+ quotesOnKeys: props.quotesOnKeys ?? true,
98
+ displayDataTypes: props.displayDataTypes ?? true,
99
+ displaySize: props.displaySize ?? true,
100
+ displayComma: props.displayComma ?? false,
101
+ highlightUpdates: props.highlightUpdates ?? false,
102
+ // internal state
103
+ inspectCache: {},
104
+ hoverPath: null,
105
+ colorspace: lightColorspace,
106
+ value: props.value,
107
+ prevValue: void 0,
108
+ getInspectCache: (path, nestedIndex) => {
109
+ const target = nestedIndex === void 0 ? path.join(".") : path.join(".") + `[${nestedIndex}]nt`;
110
+ return get().inspectCache[target];
111
+ },
112
+ setInspectCache: (path, action, nestedIndex) => {
113
+ const target = nestedIndex === void 0 ? path.join(".") : path.join(".") + `[${nestedIndex}]nt`;
114
+ set((state) => ({
115
+ inspectCache: {
116
+ ...state.inspectCache,
117
+ [target]: typeof action === "function" ? action(
118
+ state.inspectCache[target]
119
+ ) : action
120
+ }
121
+ }));
122
+ },
123
+ setHover: (path, nestedIndex) => {
124
+ set({
125
+ hoverPath: path ? { path, nestedIndex } : null
126
+ });
127
+ }
128
+ }));
129
+ };
130
+ var JsonViewerStoreContext = createContext(void 0);
131
+ var JsonViewerProvider = JsonViewerStoreContext.Provider;
132
+ var useJsonViewerStore = (selector) => {
133
+ const store = useContext(JsonViewerStoreContext);
134
+ return useStore(store, selector);
135
+ };
136
+
137
+ // src/hooks/useColor.ts
138
+ var useTextColor = () => {
139
+ return useJsonViewerStore((store) => store.colorspace.base07);
140
+ };
141
+
142
+ // src/hooks/useCopyToClipboard.ts
143
+ import {
144
+ useCallback,
145
+ useRef,
146
+ useState
147
+ } from "react";
148
+
149
+ // src/utils/index.ts
150
+ var objectCtorString = Object.prototype.constructor.toString();
151
+ function isPlainObject(value) {
152
+ if (!value || typeof value !== "object") return false;
153
+ const proto = Object.getPrototypeOf(value);
154
+ if (proto === null) return true;
155
+ const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
156
+ if (Ctor === Object) return true;
157
+ return typeof Ctor === "function" && Function.toString.call(Ctor) === objectCtorString;
158
+ }
159
+ function shouldShallowCopy(value) {
160
+ if (!value) return false;
161
+ return isPlainObject(value) || Array.isArray(value) || value instanceof Map || value instanceof Set;
162
+ }
163
+ function shallowCopy(value) {
164
+ if (Array.isArray(value)) return Array.prototype.slice.call(value);
165
+ if (value instanceof Set) return new Set(value);
166
+ if (value instanceof Map) return new Map(value);
167
+ if (typeof value === "object" && value !== null) {
168
+ return Object.assign({}, value);
169
+ }
170
+ return value;
171
+ }
172
+ function _applyValue(input, path, value, visitedMapping = /* @__PURE__ */ new Map()) {
173
+ if (typeof input !== "object" || input === null) {
174
+ if (path.length > 0) {
175
+ throw new Error("path is incorrect");
176
+ }
177
+ return value;
178
+ }
179
+ const shouldCopy = shouldShallowCopy(input);
180
+ if (shouldCopy) {
181
+ let copiedInput = visitedMapping.get(input);
182
+ if (!copiedInput) {
183
+ copiedInput = shallowCopy(input);
184
+ visitedMapping.set(input, copiedInput);
185
+ }
186
+ input = copiedInput;
187
+ }
188
+ const [key, ...restPath] = path;
189
+ if (key !== void 0) {
190
+ if (key === "__proto__") {
191
+ throw new TypeError("Modification of prototype is not allowed");
192
+ }
193
+ input[key] = restPath.length > 0 ? _applyValue(input[key], restPath, value, visitedMapping) : value;
194
+ }
195
+ return input;
196
+ }
197
+ function applyValue(input, path, value) {
198
+ return _applyValue(input, path, value);
199
+ }
200
+ function deleteValue(input, path, value) {
201
+ if (typeof input !== "object" || input === null) {
202
+ if (path.length > 0) {
203
+ throw new Error("path is incorrect");
204
+ }
205
+ return value;
206
+ }
207
+ const shouldCopy = shouldShallowCopy(input);
208
+ if (shouldCopy) input = shallowCopy(input);
209
+ const [key, ...restPath] = path;
210
+ if (key !== void 0) {
211
+ if (key === "__proto__") {
212
+ throw new TypeError("Modification of prototype is not allowed");
213
+ }
214
+ if (restPath.length > 0) {
215
+ input[key] = deleteValue(input[key], restPath, value);
216
+ } else {
217
+ if (Array.isArray(input)) {
218
+ input.splice(Number(key), 1);
219
+ } else {
220
+ delete input[key];
221
+ }
222
+ }
223
+ }
224
+ return input;
225
+ }
226
+ function defineDataType({
227
+ is,
228
+ serialize,
229
+ deserialize,
230
+ Component,
231
+ Editor,
232
+ PreComponent,
233
+ PostComponent
234
+ }) {
235
+ return {
236
+ is,
237
+ serialize,
238
+ deserialize,
239
+ Component,
240
+ Editor,
241
+ PreComponent,
242
+ PostComponent
243
+ };
244
+ }
245
+ var isCycleReference = (root, path, value) => {
246
+ if (root === null || value === null) {
247
+ return false;
248
+ }
249
+ if (typeof root !== "object") {
250
+ return false;
251
+ }
252
+ if (typeof value !== "object") {
253
+ return false;
254
+ }
255
+ if (Object.is(root, value) && path.length > 0) {
256
+ return "";
257
+ }
258
+ const currentPath = [];
259
+ const arr = [...path];
260
+ let currentRoot = root;
261
+ while (currentRoot !== value || arr.length > 0) {
262
+ if (typeof currentRoot !== "object" || currentRoot === null) {
263
+ return false;
264
+ }
265
+ if (Object.is(currentRoot, value)) {
266
+ return currentPath.reduce((path2, value2, currentIndex) => {
267
+ if (typeof value2 === "number") {
268
+ return path2 + `[${value2}]`;
269
+ }
270
+ return path2 + `${currentIndex === 0 ? "" : "."}${value2}`;
271
+ }, "");
272
+ }
273
+ const target = arr.shift();
274
+ currentPath.push(target);
275
+ currentRoot = currentRoot[target];
276
+ }
277
+ return false;
278
+ };
279
+ function getValueSize(value) {
280
+ if (value === null || void 0) {
281
+ return 0;
282
+ } else if (Array.isArray(value)) {
283
+ return value.length;
284
+ } else if (value instanceof Map || value instanceof Set) {
285
+ return value.size;
286
+ } else if (value instanceof Date) {
287
+ return 1;
288
+ } else if (typeof value === "object") {
289
+ return Object.keys(value).length;
290
+ } else if (typeof value === "string") {
291
+ return value.length;
292
+ }
293
+ return 1;
294
+ }
295
+ function segmentArray(arr, size) {
296
+ const result = [];
297
+ let index = 0;
298
+ while (index < arr.length) {
299
+ result.push(arr.slice(index, index + size));
300
+ index += size;
301
+ }
302
+ return result;
303
+ }
304
+ function safeStringify(obj, space) {
305
+ const seenValues = [];
306
+ function replacer(key, value) {
307
+ if (typeof value === "bigint") return value.toString();
308
+ if (value instanceof Map) {
309
+ if ("toJSON" in value && typeof value.toJSON === "function") return value.toJSON();
310
+ if (value.size === 0) return {};
311
+ if (seenValues.includes(value)) return "[Circular]";
312
+ seenValues.push(value);
313
+ const entries = [...value.entries()];
314
+ if (entries.every(([key2]) => typeof key2 === "string" || typeof key2 === "number")) {
315
+ return Object.fromEntries(entries);
316
+ }
317
+ return {};
318
+ }
319
+ if (value instanceof Set) {
320
+ if ("toJSON" in value && typeof value.toJSON === "function") return value.toJSON();
321
+ if (seenValues.includes(value)) return "[Circular]";
322
+ seenValues.push(value);
323
+ return [...value.values()];
324
+ }
325
+ if (typeof value === "object" && value !== null && Object.keys(value).length > 0) {
326
+ const stackSize = seenValues.length;
327
+ if (stackSize) {
328
+ for (let n = stackSize - 1; n >= 0 && seenValues[n][key] !== value; --n) {
329
+ seenValues.pop();
330
+ }
331
+ if (seenValues.includes(value)) return "[Circular]";
332
+ }
333
+ seenValues.push(value);
334
+ }
335
+ return value;
336
+ }
337
+ return JSON.stringify(obj, replacer, space);
338
+ }
339
+ function fallbackCopyString(value) {
340
+ if (typeof document === "undefined") {
341
+ throw new TypeError("Clipboard API is not available");
342
+ }
343
+ const textArea = document.createElement("textarea");
344
+ textArea.value = value;
345
+ textArea.setAttribute("readonly", "");
346
+ textArea.style.position = "fixed";
347
+ textArea.style.top = "-9999px";
348
+ textArea.style.left = "-9999px";
349
+ document.body.append(textArea);
350
+ textArea.select();
351
+ try {
352
+ if (!document.execCommand("copy")) {
353
+ throw new Error("Unable to copy text to clipboard");
354
+ }
355
+ } finally {
356
+ textArea.remove();
357
+ }
358
+ }
359
+ async function copyString(value) {
360
+ if (typeof navigator !== "undefined" && "clipboard" in navigator) {
361
+ try {
362
+ await navigator.clipboard.writeText(value);
363
+ return;
364
+ } catch {
365
+ }
366
+ }
367
+ fallbackCopyString(value);
368
+ }
369
+ function pathValueDefaultGetter(value, key) {
370
+ if (value === null || value === void 0) {
371
+ return null;
372
+ }
373
+ if (value instanceof Map || value instanceof WeakMap) {
374
+ return value.get(key);
375
+ }
376
+ if (value instanceof Set) {
377
+ return [...value][key];
378
+ }
379
+ if (value instanceof WeakSet) {
380
+ throw new TypeError("WeakSet is not supported");
381
+ }
382
+ if (Array.isArray(value)) {
383
+ return value[Number(key)];
384
+ }
385
+ if (typeof value === "object") {
386
+ return value[key];
387
+ }
388
+ return null;
389
+ }
390
+ function getPathValue(obj, path, customGetters = []) {
391
+ try {
392
+ return path.reduce((acc, key, index) => {
393
+ if (acc === null || acc === void 0) {
394
+ console.error("Invalid path or value encountered at path", path.slice(0, index));
395
+ throw new Error("Invalid path or value encountered");
396
+ }
397
+ for (const handler of customGetters) {
398
+ const currentPath = path.slice(0, index + 1);
399
+ if (handler.is(acc, currentPath)) {
400
+ return handler.handler(acc, key);
401
+ }
402
+ }
403
+ return pathValueDefaultGetter(acc, key);
404
+ }, obj);
405
+ } catch (error) {
406
+ console.error(error);
407
+ return null;
408
+ }
409
+ }
410
+
411
+ // src/hooks/useCopyToClipboard.ts
412
+ function useClipboard({ timeout = 2e3 } = {}) {
413
+ const [copied, setCopied] = useState(false);
414
+ const copyTimeout = useRef(null);
415
+ const handleCopyResult = useCallback((value) => {
416
+ const current = copyTimeout.current;
417
+ if (current) {
418
+ globalThis.clearTimeout(current);
419
+ }
420
+ copyTimeout.current = globalThis.setTimeout(() => setCopied(false), timeout);
421
+ setCopied(value);
422
+ }, [timeout]);
423
+ const onCopy = useJsonViewerStore((store) => store.onCopy);
424
+ const copy = useCallback(async (path, value) => {
425
+ if (typeof onCopy === "function") {
426
+ try {
427
+ await onCopy(path, value, copyString);
428
+ handleCopyResult(true);
429
+ } catch (error) {
430
+ console.error(`error when copy ${path.length === 0 ? "src" : `src[${path.join(
431
+ "."
432
+ )}`}]`, error);
433
+ }
434
+ } else {
435
+ try {
436
+ const valueToCopy = safeStringify(
437
+ typeof value === "function" ? value.toString() : value,
438
+ " "
439
+ );
440
+ await copyString(valueToCopy);
441
+ handleCopyResult(true);
442
+ } catch (error) {
443
+ console.error(`error when copy ${path.length === 0 ? "src" : `src[${path.join(
444
+ "."
445
+ )}`}]`, error);
446
+ }
447
+ }
448
+ }, [handleCopyResult, onCopy]);
449
+ const reset = useCallback(() => {
450
+ setCopied(false);
451
+ if (copyTimeout.current) {
452
+ clearTimeout(copyTimeout.current);
453
+ }
454
+ }, []);
455
+ return {
456
+ copy,
457
+ reset,
458
+ copied
459
+ };
460
+ }
461
+
462
+ // src/hooks/useInspect.ts
463
+ import {
464
+ useCallback as useCallback2,
465
+ useEffect,
466
+ useState as useState2
467
+ } from "react";
468
+
469
+ // src/hooks/useIsCycleReference.ts
470
+ import { useMemo } from "react";
471
+ function useIsCycleReference(path, value) {
472
+ const rootValue = useJsonViewerStore((store) => store.value);
473
+ return useMemo(
474
+ () => isCycleReference(rootValue, path, value),
475
+ [path, value, rootValue]
476
+ );
477
+ }
478
+
479
+ // src/hooks/useInspect.ts
480
+ function useInspect(path, value, nestedIndex) {
481
+ const depth = path.length;
482
+ const isTrap = useIsCycleReference(path, value);
483
+ const getInspectCache = useJsonViewerStore((store) => store.getInspectCache);
484
+ const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
485
+ const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
486
+ const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
487
+ useEffect(() => {
488
+ const inspect2 = getInspectCache(path, nestedIndex);
489
+ if (inspect2 !== void 0) {
490
+ return;
491
+ }
492
+ if (nestedIndex !== void 0) {
493
+ setInspectCache(path, false, nestedIndex);
494
+ return;
495
+ }
496
+ const shouldInspect = isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
497
+ setInspectCache(path, shouldInspect);
498
+ }, [defaultInspectDepth, defaultInspectControl, depth, getInspectCache, isTrap, nestedIndex, path, value, setInspectCache]);
499
+ const [inspect, set] = useState2(() => {
500
+ const shouldInspect = getInspectCache(path, nestedIndex);
501
+ if (shouldInspect !== void 0) {
502
+ return shouldInspect;
503
+ }
504
+ if (nestedIndex !== void 0) {
505
+ return false;
506
+ }
507
+ return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
508
+ });
509
+ const setInspect = useCallback2((apply) => {
510
+ set((oldState) => {
511
+ const newState = typeof apply === "boolean" ? apply : apply(oldState);
512
+ setInspectCache(path, newState, nestedIndex);
513
+ return newState;
514
+ });
515
+ }, [nestedIndex, path, setInspectCache]);
516
+ return [inspect, setInspect];
517
+ }
518
+
519
+ // src/stores/typeRegistry.tsx
520
+ import {
521
+ createContext as createContext2,
522
+ memo as memo2,
523
+ useContext as useContext2,
524
+ useMemo as useMemo3
525
+ } from "react";
526
+ import { createStore, useStore as useStore2 } from "zustand";
527
+
528
+ // src/components/DataTypes/defineEasyType.tsx
529
+ import { InputBase } from "@mui/material";
530
+ import { memo, useCallback as useCallback3 } from "react";
531
+
532
+ // src/components/mui/DataBox.tsx
533
+ import { Box } from "@mui/material";
534
+ import { jsx } from "react/jsx-runtime";
535
+ var DataBox = (props) => /* @__PURE__ */ jsx(
536
+ Box,
537
+ {
538
+ component: "div",
539
+ ...props,
540
+ sx: {
541
+ display: "inline-block",
542
+ ...props.sx
543
+ }
544
+ }
545
+ );
546
+
547
+ // src/components/DataTypeLabel.tsx
548
+ import { jsx as jsx2 } from "react/jsx-runtime";
549
+ var DataTypeLabel = ({ dataType, enable = true }) => {
550
+ if (!enable) return null;
551
+ return /* @__PURE__ */ jsx2(
552
+ DataBox,
553
+ {
554
+ className: "data-type-label",
555
+ sx: {
556
+ mx: 0.5,
557
+ fontSize: "0.7rem",
558
+ opacity: 0.8,
559
+ userSelect: "none"
560
+ },
561
+ children: dataType
562
+ }
563
+ );
564
+ };
565
+
566
+ // src/components/DataTypes/defineEasyType.tsx
567
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
568
+ function defineEasyType({
569
+ is,
570
+ serialize,
571
+ deserialize,
572
+ type,
573
+ colorKey,
574
+ displayTypeLabel = true,
575
+ Renderer
576
+ }) {
577
+ const Render = memo(Renderer);
578
+ const EasyType = (props) => {
579
+ const storeDisplayDataTypes = useJsonViewerStore((store) => store.displayDataTypes);
580
+ const color = useJsonViewerStore((store) => store.colorspace[colorKey]);
581
+ const onSelect = useJsonViewerStore((store) => store.onSelect);
582
+ return /* @__PURE__ */ jsxs(DataBox, { onClick: () => onSelect?.(props.path, props.value), sx: { color }, children: [
583
+ displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ jsx3(DataTypeLabel, { dataType: type }),
584
+ /* @__PURE__ */ jsx3(DataBox, { className: `${type}-value`, children: /* @__PURE__ */ jsx3(
585
+ Render,
586
+ {
587
+ path: props.path,
588
+ inspect: props.inspect,
589
+ setInspect: props.setInspect,
590
+ value: props.value,
591
+ prevValue: props.prevValue
592
+ }
593
+ ) })
594
+ ] });
595
+ };
596
+ EasyType.displayName = `easy-${type}-type`;
597
+ if (!serialize || !deserialize) {
598
+ return {
599
+ is,
600
+ Component: EasyType
601
+ };
602
+ }
603
+ const EasyTypeEditor = ({
604
+ value,
605
+ setValue,
606
+ abortEditing,
607
+ commitEditing
608
+ }) => {
609
+ const color = useJsonViewerStore((store) => store.colorspace[colorKey]);
610
+ const handleKeyDown = useCallback3((event) => {
611
+ if (event.key === "Enter") {
612
+ event.preventDefault();
613
+ commitEditing(value);
614
+ }
615
+ if (event.key === "Escape") {
616
+ event.preventDefault();
617
+ abortEditing();
618
+ }
619
+ }, [abortEditing, commitEditing, value]);
620
+ const handleChange = useCallback3((event) => {
621
+ setValue(event.target.value);
622
+ }, [setValue]);
623
+ return /* @__PURE__ */ jsx3(
624
+ InputBase,
625
+ {
626
+ autoFocus: true,
627
+ value,
628
+ onChange: handleChange,
629
+ onKeyDown: handleKeyDown,
630
+ size: "small",
631
+ multiline: true,
632
+ sx: {
633
+ color,
634
+ padding: 0.5,
635
+ borderStyle: "solid",
636
+ borderColor: "black",
637
+ borderWidth: 1,
638
+ fontSize: "0.8rem",
639
+ fontFamily: "monospace",
640
+ display: "inline-flex"
641
+ }
642
+ }
643
+ );
644
+ };
645
+ EasyTypeEditor.displayName = `easy-${type}-type-editor`;
646
+ return {
647
+ is,
648
+ serialize,
649
+ deserialize,
650
+ Component: EasyType,
651
+ Editor: EasyTypeEditor
652
+ };
653
+ }
654
+
655
+ // src/components/DataTypes/Boolean.tsx
656
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
657
+ var booleanType = defineEasyType({
658
+ is: (value) => typeof value === "boolean",
659
+ type: "bool",
660
+ colorKey: "base0E",
661
+ serialize: (value) => value.toString(),
662
+ deserialize: (value) => {
663
+ if (value === "true") return true;
664
+ if (value === "false") return false;
665
+ throw new Error("Invalid boolean value");
666
+ },
667
+ Renderer: ({ value }) => /* @__PURE__ */ jsx4(Fragment, { children: value ? "true" : "false" })
668
+ });
669
+
670
+ // src/components/DataTypes/Date.tsx
671
+ import { Fragment as Fragment2, jsx as jsx5 } from "react/jsx-runtime";
672
+ var displayOptions = {
673
+ weekday: "short",
674
+ year: "numeric",
675
+ month: "short",
676
+ day: "numeric",
677
+ hour: "2-digit",
678
+ minute: "2-digit"
679
+ };
680
+ var dateType = defineEasyType({
681
+ is: (value) => value instanceof Date,
682
+ type: "date",
683
+ colorKey: "base0D",
684
+ Renderer: ({ value }) => /* @__PURE__ */ jsx5(Fragment2, { children: value.toLocaleTimeString("en-us", displayOptions) })
685
+ });
686
+
687
+ // src/components/DataTypes/Function.tsx
688
+ import { Box as Box2, NoSsr } from "@mui/material";
689
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
690
+ var functionBody = (func) => {
691
+ const funcString = func.toString();
692
+ let isUsualFunction = true;
693
+ const parenthesisPos = funcString.indexOf(")");
694
+ const arrowPos = funcString.indexOf("=>");
695
+ if (arrowPos !== -1 && arrowPos > parenthesisPos) {
696
+ isUsualFunction = false;
697
+ }
698
+ if (isUsualFunction) {
699
+ return funcString.substring(
700
+ funcString.indexOf("{", parenthesisPos) + 1,
701
+ funcString.lastIndexOf("}")
702
+ );
703
+ }
704
+ return funcString.slice(Math.max(0, funcString.indexOf("=>") + 2));
705
+ };
706
+ var functionName = (func) => {
707
+ const funcString = func.toString();
708
+ const isUsualFunction = funcString.includes("function");
709
+ if (isUsualFunction) {
710
+ return funcString.substring(8, funcString.indexOf("{")).trim();
711
+ }
712
+ return funcString.slice(0, Math.max(0, funcString.indexOf("=>") + 2)).trim();
713
+ };
714
+ var lb = "{";
715
+ var rb = "}";
716
+ var PreFunctionType = (props) => {
717
+ return /* @__PURE__ */ jsxs2(NoSsr, { children: [
718
+ /* @__PURE__ */ jsx6(DataTypeLabel, { dataType: "function" }),
719
+ /* @__PURE__ */ jsxs2(
720
+ Box2,
721
+ {
722
+ component: "span",
723
+ className: "data-function-start",
724
+ sx: { letterSpacing: 0.5 },
725
+ children: [
726
+ functionName(props.value),
727
+ " ",
728
+ lb
729
+ ]
730
+ }
731
+ )
732
+ ] });
733
+ };
734
+ var PostFunctionType = () => {
735
+ return /* @__PURE__ */ jsx6(NoSsr, { children: /* @__PURE__ */ jsx6(Box2, { component: "span", className: "data-function-end", children: rb }) });
736
+ };
737
+ var FunctionType = (props) => {
738
+ const functionColor = useJsonViewerStore((store) => store.colorspace.base05);
739
+ return /* @__PURE__ */ jsx6(NoSsr, { children: /* @__PURE__ */ jsx6(
740
+ Box2,
741
+ {
742
+ className: "data-function",
743
+ sx: {
744
+ display: props.inspect ? "block" : "inline-block",
745
+ pl: props.inspect ? 2 : 0,
746
+ color: functionColor
747
+ },
748
+ children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ jsx6(
749
+ Box2,
750
+ {
751
+ component: "span",
752
+ className: "data-function-body",
753
+ onClick: () => props.setInspect(true),
754
+ sx: {
755
+ "&:hover": { cursor: "pointer" },
756
+ "padding": 0.5
757
+ },
758
+ children: "..."
759
+ }
760
+ )
761
+ }
762
+ ) });
763
+ };
764
+ var functionType = {
765
+ is: (value) => typeof value === "function",
766
+ Component: FunctionType,
767
+ PreComponent: PreFunctionType,
768
+ PostComponent: PostFunctionType
769
+ };
770
+
771
+ // src/components/DataTypes/Null.tsx
772
+ import { Box as Box3 } from "@mui/material";
773
+ import { jsx as jsx7 } from "react/jsx-runtime";
774
+ var nullType = defineEasyType({
775
+ is: (value) => value === null,
776
+ type: "null",
777
+ colorKey: "base08",
778
+ displayTypeLabel: false,
779
+ Renderer: () => {
780
+ const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
781
+ return /* @__PURE__ */ jsx7(
782
+ Box3,
783
+ {
784
+ sx: {
785
+ fontSize: "0.8rem",
786
+ backgroundColor,
787
+ fontWeight: "bold",
788
+ borderRadius: "3px",
789
+ padding: "0.5px 2px"
790
+ },
791
+ children: "NULL"
792
+ }
793
+ );
794
+ }
795
+ });
796
+
797
+ // src/components/DataTypes/Number.tsx
798
+ import { Box as Box4 } from "@mui/material";
799
+ import { Fragment as Fragment3, jsx as jsx8 } from "react/jsx-runtime";
800
+ var isInt = (n) => n % 1 === 0;
801
+ var nanType = defineEasyType({
802
+ is: (value) => typeof value === "number" && isNaN(value),
803
+ type: "NaN",
804
+ colorKey: "base08",
805
+ displayTypeLabel: false,
806
+ serialize: () => "NaN",
807
+ // allow deserialize the value back to number
808
+ deserialize: (value) => Number.parseFloat(value),
809
+ Renderer: () => {
810
+ const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
811
+ return /* @__PURE__ */ jsx8(
812
+ Box4,
813
+ {
814
+ sx: {
815
+ backgroundColor,
816
+ fontSize: "0.8rem",
817
+ fontWeight: "bold",
818
+ borderRadius: "3px",
819
+ padding: "0.5px 2px"
820
+ },
821
+ children: "NaN"
822
+ }
823
+ );
824
+ }
825
+ });
826
+ var floatType = defineEasyType({
827
+ is: (value) => typeof value === "number" && !isInt(value) && !isNaN(value),
828
+ type: "float",
829
+ colorKey: "base0B",
830
+ serialize: (value) => value.toString(),
831
+ deserialize: (value) => Number.parseFloat(value),
832
+ Renderer: ({ value }) => /* @__PURE__ */ jsx8(Fragment3, { children: value })
833
+ });
834
+ var intType = defineEasyType({
835
+ is: (value) => typeof value === "number" && isInt(value),
836
+ type: "int",
837
+ colorKey: "base0F",
838
+ serialize: (value) => value.toString(),
839
+ // allow deserialize the value to float
840
+ deserialize: (value) => Number.parseFloat(value),
841
+ Renderer: ({ value }) => /* @__PURE__ */ jsx8(Fragment3, { children: value })
842
+ });
843
+ var bigIntType = defineEasyType({
844
+ is: (value) => typeof value === "bigint",
845
+ type: "bigint",
846
+ colorKey: "base0F",
847
+ serialize: (value) => value.toString(),
848
+ deserialize: (value) => BigInt(value.replaceAll(/\D/g, "")),
849
+ Renderer: ({ value }) => /* @__PURE__ */ jsx8(Fragment3, { children: `${value}n` })
850
+ });
851
+
852
+ // src/components/DataTypes/Object.tsx
853
+ import { Box as Box5 } from "@mui/material";
854
+ import { useMemo as useMemo2, useState as useState3 } from "react";
855
+
856
+ // src/components/Icons.tsx
857
+ import { SvgIcon } from "@mui/material";
858
+ import { jsx as jsx9 } from "react/jsx-runtime";
859
+ var BaseIcon = ({ d, ...props }) => {
860
+ return /* @__PURE__ */ jsx9(SvgIcon, { ...props, children: /* @__PURE__ */ jsx9("path", { d }) });
861
+ };
862
+ var AddBox = "M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-8-2h2v-4h4v-2h-4V7h-2v4H7v2h4z";
863
+ var Check = "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z";
864
+ var ChevronRight = "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z";
865
+ var CircularArrows = "M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z";
866
+ var Close = "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z";
867
+ var ContentCopy = "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z";
868
+ var Edit = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z";
869
+ var ExpandMore = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z";
870
+ var Delete = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z";
871
+ var AddBoxIcon = (props) => {
872
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: AddBox, ...props });
873
+ };
874
+ var CheckIcon = (props) => {
875
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: Check, ...props });
876
+ };
877
+ var ChevronRightIcon = (props) => {
878
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: ChevronRight, ...props });
879
+ };
880
+ var CircularArrowsIcon = (props) => {
881
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: CircularArrows, ...props });
882
+ };
883
+ var CloseIcon = (props) => {
884
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: Close, ...props });
885
+ };
886
+ var ContentCopyIcon = (props) => {
887
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: ContentCopy, ...props });
888
+ };
889
+ var EditIcon = (props) => {
890
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: Edit, ...props });
891
+ };
892
+ var ExpandMoreIcon = (props) => {
893
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: ExpandMore, ...props });
894
+ };
895
+ var DeleteIcon = (props) => {
896
+ return /* @__PURE__ */ jsx9(BaseIcon, { d: Delete, ...props });
897
+ };
898
+
899
+ // src/components/DataTypes/Object.tsx
900
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
901
+ var objectLb = "{";
902
+ var arrayLb = "[";
903
+ var objectRb = "}";
904
+ var arrayRb = "]";
905
+ function inspectMetadata(value) {
906
+ const length = getValueSize(value);
907
+ let name = "";
908
+ if (value instanceof Map || value instanceof Set) {
909
+ name = value[Symbol.toStringTag];
910
+ }
911
+ if (Object.prototype.hasOwnProperty.call(value, Symbol.toStringTag)) {
912
+ name = value[Symbol.toStringTag];
913
+ }
914
+ const itemsPluralized = length === 1 ? "Item" : "Items";
915
+ return `${length} ${itemsPluralized}${name ? ` (${name})` : ""}`;
916
+ }
917
+ var PreObjectType = (props) => {
918
+ const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
919
+ const textColor = useTextColor();
920
+ const isArrayLike = useMemo2(() => Array.isArray(props.value) || props.value instanceof Set, [props.value]);
921
+ const isEmptyValue = useMemo2(() => getValueSize(props.value) === 0, [props.value]);
922
+ const sizeOfValue = useMemo2(() => inspectMetadata(props.value), [props.value]);
923
+ const displaySize = useJsonViewerStore((store) => store.displaySize);
924
+ const shouldDisplaySize = useMemo2(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [displaySize, props.path, props.value]);
925
+ const isTrap = useIsCycleReference(props.path, props.value);
926
+ return /* @__PURE__ */ jsxs3(
927
+ Box5,
928
+ {
929
+ component: "span",
930
+ className: "data-object-start",
931
+ sx: { letterSpacing: 0.5 },
932
+ children: [
933
+ isArrayLike ? arrayLb : objectLb,
934
+ shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ jsx10(
935
+ Box5,
936
+ {
937
+ component: "span",
938
+ sx: {
939
+ pl: 0.5,
940
+ fontStyle: "italic",
941
+ color: metadataColor,
942
+ userSelect: "none"
943
+ },
944
+ children: sizeOfValue
945
+ }
946
+ ),
947
+ isTrap && !props.inspect && /* @__PURE__ */ jsxs3(Fragment4, { children: [
948
+ /* @__PURE__ */ jsx10(
949
+ CircularArrowsIcon,
950
+ {
951
+ sx: {
952
+ fontSize: 12,
953
+ color: textColor,
954
+ mx: 0.5
955
+ }
956
+ }
957
+ ),
958
+ /* @__PURE__ */ jsx10(
959
+ DataBox,
960
+ {
961
+ sx: {
962
+ cursor: "pointer",
963
+ userSelect: "none"
964
+ },
965
+ children: isTrap
966
+ }
967
+ )
968
+ ] })
969
+ ]
970
+ }
971
+ );
972
+ };
973
+ var PostObjectType = (props) => {
974
+ const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
975
+ const textColor = useTextColor();
976
+ const isArrayLike = useMemo2(() => Array.isArray(props.value) || props.value instanceof Set, [props.value]);
977
+ const isEmptyValue = useMemo2(() => getValueSize(props.value) === 0, [props.value]);
978
+ const sizeOfValue = useMemo2(() => inspectMetadata(props.value), [props.value]);
979
+ const displaySize = useJsonViewerStore((store) => store.displaySize);
980
+ const shouldDisplaySize = useMemo2(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [displaySize, props.path, props.value]);
981
+ return /* @__PURE__ */ jsxs3(
982
+ Box5,
983
+ {
984
+ component: "span",
985
+ className: "data-object-end",
986
+ sx: {
987
+ lineHeight: 1.5,
988
+ color: textColor,
989
+ letterSpacing: 0.5,
990
+ opacity: 0.8
991
+ },
992
+ children: [
993
+ isArrayLike ? arrayRb : objectRb,
994
+ shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ jsx10(
995
+ Box5,
996
+ {
997
+ component: "span",
998
+ sx: {
999
+ pl: 0.5,
1000
+ fontStyle: "italic",
1001
+ color: metadataColor,
1002
+ userSelect: "none"
1003
+ },
1004
+ children: sizeOfValue
1005
+ }
1006
+ ) : null
1007
+ ]
1008
+ }
1009
+ );
1010
+ };
1011
+ function getIterator(value) {
1012
+ return typeof value?.[Symbol.iterator] === "function";
1013
+ }
1014
+ var ObjectType = (props) => {
1015
+ const keyColor = useTextColor();
1016
+ const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
1017
+ const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
1018
+ const isTrap = useIsCycleReference(props.path, props.value);
1019
+ const [displayLength, setDisplayLength] = useState3(useJsonViewerStore((store) => store.maxDisplayLength));
1020
+ const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
1021
+ const elements = useMemo2(() => {
1022
+ if (!props.inspect) {
1023
+ return null;
1024
+ }
1025
+ const value = props.value;
1026
+ const iterator = getIterator(value);
1027
+ if (iterator && !Array.isArray(value)) {
1028
+ const elements3 = [];
1029
+ if (value instanceof Map) {
1030
+ const lastIndex2 = value.size - 1;
1031
+ let index = 0;
1032
+ value.forEach((value2, k) => {
1033
+ const key = k.toString();
1034
+ const path = [...props.path, key];
1035
+ elements3.push(
1036
+ /* @__PURE__ */ jsx10(
1037
+ DataKeyPair,
1038
+ {
1039
+ path,
1040
+ value: value2,
1041
+ prevValue: props.prevValue instanceof Map ? props.prevValue.get(k) : void 0,
1042
+ editable: false,
1043
+ last: index === lastIndex2
1044
+ },
1045
+ key
1046
+ )
1047
+ );
1048
+ index++;
1049
+ });
1050
+ } else {
1051
+ const iterator2 = value[Symbol.iterator]();
1052
+ let result = iterator2.next();
1053
+ let count = 0;
1054
+ while (true) {
1055
+ const nextResult = iterator2.next();
1056
+ elements3.push(
1057
+ /* @__PURE__ */ jsx10(
1058
+ DataKeyPair,
1059
+ {
1060
+ path: [...props.path, `iterator:${count}`],
1061
+ value: result.value,
1062
+ nestedIndex: count,
1063
+ editable: false,
1064
+ last: nextResult.done ?? false
1065
+ },
1066
+ count
1067
+ )
1068
+ );
1069
+ if (nextResult.done) {
1070
+ break;
1071
+ }
1072
+ count++;
1073
+ result = nextResult;
1074
+ }
1075
+ }
1076
+ return elements3;
1077
+ }
1078
+ if (Array.isArray(value)) {
1079
+ const lastIndex2 = value.length - 1;
1080
+ if (value.length <= groupArraysAfterLength) {
1081
+ const elements4 = value.slice(0, displayLength).map((value2, _index) => {
1082
+ const index = props.nestedIndex ? props.nestedIndex * groupArraysAfterLength + _index : _index;
1083
+ const path = [...props.path, index];
1084
+ return /* @__PURE__ */ jsx10(
1085
+ DataKeyPair,
1086
+ {
1087
+ path,
1088
+ value: value2,
1089
+ prevValue: Array.isArray(props.prevValue) ? props.prevValue[index] : void 0,
1090
+ last: _index === lastIndex2
1091
+ },
1092
+ index
1093
+ );
1094
+ });
1095
+ if (value.length > displayLength) {
1096
+ const rest = value.length - displayLength;
1097
+ elements4.push(
1098
+ /* @__PURE__ */ jsxs3(
1099
+ DataBox,
1100
+ {
1101
+ sx: {
1102
+ cursor: "pointer",
1103
+ lineHeight: 1.5,
1104
+ color: keyColor,
1105
+ letterSpacing: 0.5,
1106
+ opacity: 0.8,
1107
+ userSelect: "none"
1108
+ },
1109
+ onClick: () => setDisplayLength((length) => length * 2),
1110
+ children: [
1111
+ "hidden",
1112
+ " ",
1113
+ rest,
1114
+ " ",
1115
+ "items..."
1116
+ ]
1117
+ },
1118
+ "last"
1119
+ )
1120
+ );
1121
+ }
1122
+ return elements4;
1123
+ }
1124
+ const elements3 = segmentArray(value, groupArraysAfterLength);
1125
+ const prevElements = Array.isArray(props.prevValue) ? segmentArray(props.prevValue, groupArraysAfterLength) : void 0;
1126
+ const elementsLastIndex = elements3.length - 1;
1127
+ return elements3.map((list, index) => {
1128
+ return /* @__PURE__ */ jsx10(
1129
+ DataKeyPair,
1130
+ {
1131
+ path: props.path,
1132
+ value: list,
1133
+ nestedIndex: index,
1134
+ prevValue: prevElements?.[index],
1135
+ last: index === elementsLastIndex
1136
+ },
1137
+ index
1138
+ );
1139
+ });
1140
+ }
1141
+ let entries = Object.entries(value);
1142
+ if (objectSortKeys) {
1143
+ entries = objectSortKeys === true ? entries.sort(([a], [b]) => a.localeCompare(b)) : entries.sort(([a], [b]) => objectSortKeys(a, b));
1144
+ }
1145
+ const lastIndex = entries.length - 1;
1146
+ const elements2 = entries.slice(0, displayLength).map(([key, value2], index) => {
1147
+ const path = [...props.path, key];
1148
+ return /* @__PURE__ */ jsx10(
1149
+ DataKeyPair,
1150
+ {
1151
+ path,
1152
+ value: value2,
1153
+ prevValue: props.prevValue?.[key],
1154
+ last: index === lastIndex
1155
+ },
1156
+ key
1157
+ );
1158
+ });
1159
+ if (entries.length > displayLength) {
1160
+ const rest = entries.length - displayLength;
1161
+ elements2.push(
1162
+ /* @__PURE__ */ jsxs3(
1163
+ DataBox,
1164
+ {
1165
+ sx: {
1166
+ cursor: "pointer",
1167
+ lineHeight: 1.5,
1168
+ color: keyColor,
1169
+ letterSpacing: 0.5,
1170
+ opacity: 0.8,
1171
+ userSelect: "none"
1172
+ },
1173
+ onClick: () => setDisplayLength((length) => length * 2),
1174
+ children: [
1175
+ "hidden",
1176
+ " ",
1177
+ rest,
1178
+ " ",
1179
+ "items..."
1180
+ ]
1181
+ },
1182
+ "last"
1183
+ )
1184
+ );
1185
+ }
1186
+ return elements2;
1187
+ }, [
1188
+ props.inspect,
1189
+ props.value,
1190
+ props.prevValue,
1191
+ props.path,
1192
+ props.nestedIndex,
1193
+ groupArraysAfterLength,
1194
+ displayLength,
1195
+ keyColor,
1196
+ objectSortKeys
1197
+ ]);
1198
+ const marginLeft = props.inspect ? 0.6 : 0;
1199
+ const width = useJsonViewerStore((store) => store.indentWidth);
1200
+ const indentWidth = props.inspect ? width - marginLeft : width;
1201
+ const isEmptyValue = useMemo2(() => getValueSize(props.value) === 0, [props.value]);
1202
+ if (isEmptyValue) {
1203
+ return null;
1204
+ }
1205
+ return /* @__PURE__ */ jsx10(
1206
+ Box5,
1207
+ {
1208
+ className: "data-object",
1209
+ sx: {
1210
+ display: props.inspect ? "block" : "inline-block",
1211
+ pl: props.inspect ? indentWidth - 0.6 : 0,
1212
+ marginLeft,
1213
+ color: keyColor,
1214
+ borderLeft: props.inspect ? `1px solid ${borderColor}` : "none"
1215
+ },
1216
+ children: props.inspect ? elements : !isTrap && /* @__PURE__ */ jsx10(
1217
+ Box5,
1218
+ {
1219
+ component: "span",
1220
+ className: "data-object-body",
1221
+ onClick: () => props.setInspect(true),
1222
+ sx: {
1223
+ "&:hover": { cursor: "pointer" },
1224
+ "padding": 0.5,
1225
+ "userSelect": "none"
1226
+ },
1227
+ children: "..."
1228
+ }
1229
+ )
1230
+ }
1231
+ );
1232
+ };
1233
+ var objectType = {
1234
+ is: (value) => typeof value === "object",
1235
+ Component: ObjectType,
1236
+ PreComponent: PreObjectType,
1237
+ PostComponent: PostObjectType
1238
+ };
1239
+
1240
+ // src/components/DataTypes/String.tsx
1241
+ import { Box as Box6 } from "@mui/material";
1242
+ import { useState as useState4 } from "react";
1243
+ import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
1244
+ var stringType = defineEasyType({
1245
+ is: (value) => typeof value === "string",
1246
+ type: "string",
1247
+ colorKey: "base09",
1248
+ serialize: (value) => value,
1249
+ deserialize: (value) => value,
1250
+ Renderer: (props) => {
1251
+ const [showRest, setShowRest] = useState4(false);
1252
+ const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
1253
+ const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
1254
+ const hasRest = props.value.length > collapseStringsAfterLength;
1255
+ return /* @__PURE__ */ jsxs4(
1256
+ Box6,
1257
+ {
1258
+ component: "span",
1259
+ sx: {
1260
+ overflowWrap: "anywhere",
1261
+ cursor: hasRest ? "pointer" : "inherit"
1262
+ },
1263
+ onClick: () => {
1264
+ if (globalThis.getSelection()?.type === "Range") {
1265
+ return;
1266
+ }
1267
+ if (hasRest) {
1268
+ setShowRest((value2) => !value2);
1269
+ }
1270
+ },
1271
+ children: [
1272
+ '"',
1273
+ value,
1274
+ hasRest && !showRest && /* @__PURE__ */ jsx11(Box6, { component: "span", sx: { padding: 0.5 }, children: "..." }),
1275
+ '"'
1276
+ ]
1277
+ }
1278
+ );
1279
+ }
1280
+ });
1281
+
1282
+ // src/components/DataTypes/Undefined.tsx
1283
+ import { Box as Box7 } from "@mui/material";
1284
+ import { jsx as jsx12 } from "react/jsx-runtime";
1285
+ var undefinedType = defineEasyType({
1286
+ is: (value) => value === void 0,
1287
+ type: "undefined",
1288
+ colorKey: "base05",
1289
+ displayTypeLabel: false,
1290
+ Renderer: () => {
1291
+ const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
1292
+ return /* @__PURE__ */ jsx12(
1293
+ Box7,
1294
+ {
1295
+ sx: {
1296
+ fontSize: "0.7rem",
1297
+ backgroundColor,
1298
+ borderRadius: "3px",
1299
+ padding: "0.5px 2px"
1300
+ },
1301
+ children: "undefined"
1302
+ }
1303
+ );
1304
+ }
1305
+ });
1306
+
1307
+ // src/stores/typeRegistry.tsx
1308
+ function memorizeDataType(dataType) {
1309
+ function compare(prevProps, nextProps) {
1310
+ return Object.is(prevProps.value, nextProps.value) && prevProps.inspect && nextProps.inspect && prevProps.path?.join(".") === nextProps.path?.join(".");
1311
+ }
1312
+ dataType.Component = memo2(dataType.Component, compare);
1313
+ if (dataType.Editor) {
1314
+ dataType.Editor = memo2(dataType.Editor, function compare2(prevProps, nextProps) {
1315
+ return Object.is(prevProps.value, nextProps.value);
1316
+ });
1317
+ }
1318
+ if (dataType.PreComponent) {
1319
+ dataType.PreComponent = memo2(dataType.PreComponent, compare);
1320
+ }
1321
+ if (dataType.PostComponent) {
1322
+ dataType.PostComponent = memo2(dataType.PostComponent, compare);
1323
+ }
1324
+ return dataType;
1325
+ }
1326
+ var predefinedTypes = [
1327
+ memorizeDataType(booleanType),
1328
+ memorizeDataType(dateType),
1329
+ memorizeDataType(nullType),
1330
+ memorizeDataType(undefinedType),
1331
+ memorizeDataType(stringType),
1332
+ memorizeDataType(functionType),
1333
+ memorizeDataType(nanType),
1334
+ memorizeDataType(intType),
1335
+ memorizeDataType(floatType),
1336
+ memorizeDataType(bigIntType)
1337
+ ];
1338
+ var createTypeRegistryStore = () => {
1339
+ return createStore()((set) => ({
1340
+ registry: predefinedTypes,
1341
+ registerTypes: (setState) => {
1342
+ set((state) => ({
1343
+ registry: typeof setState === "function" ? setState(state.registry) : setState
1344
+ }));
1345
+ }
1346
+ }));
1347
+ };
1348
+ var TypeRegistryStoreContext = createContext2(void 0);
1349
+ var TypeRegistryProvider = TypeRegistryStoreContext.Provider;
1350
+ var useTypeRegistryStore = (selector) => {
1351
+ const store = useContext2(TypeRegistryStoreContext);
1352
+ return useStore2(store, selector);
1353
+ };
1354
+ function matchTypeComponents(value, path, registry) {
1355
+ let potential;
1356
+ for (const T of registry) {
1357
+ if (T.is(value, path)) {
1358
+ potential = T;
1359
+ }
1360
+ }
1361
+ if (potential === void 0) {
1362
+ if (typeof value === "object") {
1363
+ return objectType;
1364
+ }
1365
+ throw new Error(`No type matched for value: ${value}`);
1366
+ }
1367
+ return potential;
1368
+ }
1369
+ function useTypeComponents(value, path) {
1370
+ const registry = useTypeRegistryStore((store) => store.registry);
1371
+ return useMemo3(() => matchTypeComponents(value, path, registry), [value, path, registry]);
1372
+ }
1373
+
1374
+ // src/components/DataKeyPair.tsx
1375
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
1376
+ var IconBox = (props) => /* @__PURE__ */ jsx13(
1377
+ Box8,
1378
+ {
1379
+ component: "span",
1380
+ ...props,
1381
+ sx: {
1382
+ cursor: "pointer",
1383
+ paddingLeft: "0.7rem",
1384
+ ...props.sx
1385
+ }
1386
+ }
1387
+ );
1388
+ var DataKeyPair = (props) => {
1389
+ const {
1390
+ value,
1391
+ prevValue,
1392
+ path,
1393
+ nestedIndex,
1394
+ last
1395
+ } = props;
1396
+ const {
1397
+ Component,
1398
+ PreComponent,
1399
+ PostComponent,
1400
+ Editor,
1401
+ serialize,
1402
+ deserialize
1403
+ } = useTypeComponents(value, path);
1404
+ const propsEditable = props.editable ?? void 0;
1405
+ const storeEditable = useJsonViewerStore((store) => store.editable);
1406
+ const editable = useMemo4(() => {
1407
+ if (storeEditable === false) {
1408
+ return false;
1409
+ }
1410
+ if (propsEditable === false) {
1411
+ return false;
1412
+ }
1413
+ if (typeof storeEditable === "function") {
1414
+ return !!storeEditable(path, value);
1415
+ }
1416
+ return storeEditable;
1417
+ }, [path, propsEditable, storeEditable, value]);
1418
+ const [tempValue, setTempValue] = useState5("");
1419
+ const depth = path.length;
1420
+ const key = path[depth - 1];
1421
+ const hoverPath = useJsonViewerStore((store) => store.hoverPath);
1422
+ const isHover = useMemo4(() => {
1423
+ return hoverPath && path.every(
1424
+ (value2, index) => value2 === hoverPath.path[index] && nestedIndex === hoverPath.nestedIndex
1425
+ );
1426
+ }, [hoverPath, path, nestedIndex]);
1427
+ const setHover = useJsonViewerStore((store) => store.setHover);
1428
+ const root = useJsonViewerStore((store) => store.value);
1429
+ const [inspect, setInspect] = useInspect(path, value, nestedIndex);
1430
+ const [editing, setEditing] = useState5(false);
1431
+ const onChange = useJsonViewerStore((store) => store.onChange);
1432
+ const keyColor = useTextColor();
1433
+ const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
1434
+ const highlightColor = useJsonViewerStore((store) => store.colorspace.base0A);
1435
+ const displayComma = useJsonViewerStore((store) => store.displayComma);
1436
+ const quotesOnKeys = useJsonViewerStore((store) => store.quotesOnKeys);
1437
+ const rootName = useJsonViewerStore((store) => store.rootName);
1438
+ const isRoot = root === value;
1439
+ const isNumberKey = Number.isInteger(Number(key));
1440
+ const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
1441
+ const onAdd = useJsonViewerStore((store) => store.onAdd);
1442
+ const enableAdd = useMemo4(() => {
1443
+ if (!onAdd || nestedIndex !== void 0) return false;
1444
+ if (storeEnableAdd === false) {
1445
+ return false;
1446
+ }
1447
+ if (propsEditable === false) {
1448
+ return false;
1449
+ }
1450
+ if (typeof storeEnableAdd === "function") {
1451
+ return !!storeEnableAdd(path, value);
1452
+ }
1453
+ if (Array.isArray(value) || isPlainObject(value)) {
1454
+ return true;
1455
+ }
1456
+ return false;
1457
+ }, [onAdd, nestedIndex, path, storeEnableAdd, propsEditable, value]);
1458
+ const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
1459
+ const onDelete = useJsonViewerStore((store) => store.onDelete);
1460
+ const enableDelete = useMemo4(() => {
1461
+ if (!onDelete || nestedIndex !== void 0) return false;
1462
+ if (isRoot) {
1463
+ return false;
1464
+ }
1465
+ if (storeEnableDelete === false) {
1466
+ return false;
1467
+ }
1468
+ if (propsEditable === false) {
1469
+ return false;
1470
+ }
1471
+ if (typeof storeEnableDelete === "function") {
1472
+ return !!storeEnableDelete(path, value);
1473
+ }
1474
+ return storeEnableDelete;
1475
+ }, [onDelete, nestedIndex, isRoot, path, storeEnableDelete, propsEditable, value]);
1476
+ const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
1477
+ const { copy, copied } = useClipboard();
1478
+ const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
1479
+ const isHighlight = useMemo4(() => {
1480
+ if (!highlightUpdates || prevValue === void 0) return false;
1481
+ if (typeof value !== typeof prevValue) {
1482
+ return true;
1483
+ }
1484
+ if (typeof value === "number") {
1485
+ if (isNaN(value) && isNaN(prevValue)) return false;
1486
+ return value !== prevValue;
1487
+ }
1488
+ if (Array.isArray(value) !== Array.isArray(prevValue)) {
1489
+ return true;
1490
+ }
1491
+ if (typeof value === "object" || typeof value === "function") {
1492
+ return false;
1493
+ }
1494
+ if (value !== prevValue) {
1495
+ return true;
1496
+ }
1497
+ return false;
1498
+ }, [highlightUpdates, prevValue, value]);
1499
+ const highlightContainer = useRef2(null);
1500
+ useEffect2(() => {
1501
+ if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
1502
+ highlightContainer.current.animate(
1503
+ [
1504
+ { backgroundColor: highlightColor },
1505
+ { backgroundColor: "" }
1506
+ ],
1507
+ {
1508
+ duration: 1e3,
1509
+ easing: "ease-in"
1510
+ }
1511
+ );
1512
+ }
1513
+ }, [highlightColor, isHighlight, prevValue, value]);
1514
+ const startEditing = useCallback4((event) => {
1515
+ event.preventDefault();
1516
+ if (serialize) setTempValue(serialize(value));
1517
+ setEditing(true);
1518
+ }, [serialize, value]);
1519
+ const abortEditing = useCallback4(() => {
1520
+ setEditing(false);
1521
+ setTempValue("");
1522
+ }, [setEditing, setTempValue]);
1523
+ const commitEditing = useCallback4((newValue) => {
1524
+ setEditing(false);
1525
+ if (!deserialize) return;
1526
+ try {
1527
+ onChange(path, value, deserialize(newValue));
1528
+ } catch {
1529
+ }
1530
+ }, [setEditing, deserialize, onChange, path, value]);
1531
+ const actionIcons = useMemo4(
1532
+ () => {
1533
+ if (editing) {
1534
+ return /* @__PURE__ */ jsxs5(Fragment5, { children: [
1535
+ /* @__PURE__ */ jsx13(IconBox, { children: /* @__PURE__ */ jsx13(
1536
+ CloseIcon,
1537
+ {
1538
+ sx: { fontSize: ".8rem" },
1539
+ onClick: abortEditing
1540
+ }
1541
+ ) }),
1542
+ /* @__PURE__ */ jsx13(IconBox, { children: /* @__PURE__ */ jsx13(
1543
+ CheckIcon,
1544
+ {
1545
+ sx: { fontSize: ".8rem" },
1546
+ onClick: () => commitEditing(tempValue)
1547
+ }
1548
+ ) })
1549
+ ] });
1550
+ }
1551
+ return /* @__PURE__ */ jsxs5(Fragment5, { children: [
1552
+ enableClipboard && /* @__PURE__ */ jsx13(
1553
+ IconBox,
1554
+ {
1555
+ onClick: (event) => {
1556
+ event.preventDefault();
1557
+ try {
1558
+ copy(path, value, copyString);
1559
+ } catch (e) {
1560
+ console.error(e);
1561
+ }
1562
+ },
1563
+ children: copied ? /* @__PURE__ */ jsx13(CheckIcon, { sx: { fontSize: ".8rem" } }) : /* @__PURE__ */ jsx13(ContentCopyIcon, { sx: { fontSize: ".8rem" } })
1564
+ }
1565
+ ),
1566
+ Editor && editable && serialize && deserialize && /* @__PURE__ */ jsx13(
1567
+ IconBox,
1568
+ {
1569
+ onClick: startEditing,
1570
+ children: /* @__PURE__ */ jsx13(EditIcon, { sx: { fontSize: ".8rem" } })
1571
+ }
1572
+ ),
1573
+ enableAdd && /* @__PURE__ */ jsx13(
1574
+ IconBox,
1575
+ {
1576
+ onClick: (event) => {
1577
+ event.preventDefault();
1578
+ onAdd?.(path);
1579
+ },
1580
+ children: /* @__PURE__ */ jsx13(AddBoxIcon, { sx: { fontSize: ".8rem" } })
1581
+ }
1582
+ ),
1583
+ enableDelete && /* @__PURE__ */ jsx13(
1584
+ IconBox,
1585
+ {
1586
+ onClick: (event) => {
1587
+ event.preventDefault();
1588
+ onDelete?.(path, value);
1589
+ },
1590
+ children: /* @__PURE__ */ jsx13(DeleteIcon, { sx: { fontSize: ".9rem" } })
1591
+ }
1592
+ )
1593
+ ] });
1594
+ },
1595
+ [
1596
+ Editor,
1597
+ serialize,
1598
+ deserialize,
1599
+ copied,
1600
+ copy,
1601
+ editable,
1602
+ editing,
1603
+ enableClipboard,
1604
+ enableAdd,
1605
+ enableDelete,
1606
+ tempValue,
1607
+ path,
1608
+ value,
1609
+ onAdd,
1610
+ onDelete,
1611
+ startEditing,
1612
+ abortEditing,
1613
+ commitEditing
1614
+ ]
1615
+ );
1616
+ const isEmptyValue = useMemo4(() => getValueSize(value) === 0, [value]);
1617
+ const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
1618
+ const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
1619
+ const downstreamProps = useMemo4(() => ({
1620
+ path,
1621
+ inspect,
1622
+ setInspect,
1623
+ value,
1624
+ prevValue,
1625
+ nestedIndex
1626
+ }), [inspect, path, setInspect, value, prevValue, nestedIndex]);
1627
+ return /* @__PURE__ */ jsxs5(
1628
+ Box8,
1629
+ {
1630
+ className: "data-key-pair",
1631
+ "data-testid": "data-key-pair" + path.join("."),
1632
+ sx: { userSelect: "text" },
1633
+ onMouseEnter: useCallback4(
1634
+ () => setHover(path, nestedIndex),
1635
+ [setHover, path, nestedIndex]
1636
+ ),
1637
+ children: [
1638
+ /* @__PURE__ */ jsxs5(
1639
+ DataBox,
1640
+ {
1641
+ component: "span",
1642
+ className: "data-key",
1643
+ sx: {
1644
+ lineHeight: 1.5,
1645
+ color: keyColor,
1646
+ letterSpacing: 0.5,
1647
+ opacity: 0.8
1648
+ },
1649
+ onClick: useCallback4((event) => {
1650
+ if (event.isDefaultPrevented()) {
1651
+ return;
1652
+ }
1653
+ if (!isEmptyValue) {
1654
+ setInspect((state) => !state);
1655
+ }
1656
+ }, [isEmptyValue, setInspect]),
1657
+ children: [
1658
+ expandable ? inspect ? /* @__PURE__ */ jsx13(
1659
+ ExpandMoreIcon,
1660
+ {
1661
+ className: "data-key-toggle-expanded",
1662
+ sx: {
1663
+ "fontSize": ".8rem",
1664
+ "&:hover": { cursor: "pointer" }
1665
+ }
1666
+ }
1667
+ ) : /* @__PURE__ */ jsx13(
1668
+ ChevronRightIcon,
1669
+ {
1670
+ className: "data-key-toggle-collapsed",
1671
+ sx: {
1672
+ "fontSize": ".8rem",
1673
+ "&:hover": { cursor: "pointer" }
1674
+ }
1675
+ }
1676
+ ) : null,
1677
+ /* @__PURE__ */ jsx13(
1678
+ Box8,
1679
+ {
1680
+ ref: highlightContainer,
1681
+ className: "data-key-key",
1682
+ component: "span",
1683
+ children: isRoot && depth === 0 ? rootName === false ? null : quotesOnKeys ? /* @__PURE__ */ jsxs5(Fragment5, { children: [
1684
+ '"',
1685
+ rootName,
1686
+ '"'
1687
+ ] }) : /* @__PURE__ */ jsx13(Fragment5, { children: rootName }) : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ jsx13(KeyRenderer, { ...downstreamProps }) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ jsx13(
1688
+ Box8,
1689
+ {
1690
+ component: "span",
1691
+ style: {
1692
+ color: numberKeyColor,
1693
+ userSelect: isNumberKey ? "none" : "auto"
1694
+ },
1695
+ children: key
1696
+ }
1697
+ ) : quotesOnKeys ? /* @__PURE__ */ jsxs5(Fragment5, { children: [
1698
+ '"',
1699
+ key,
1700
+ '"'
1701
+ ] }) : /* @__PURE__ */ jsx13(Fragment5, { children: key }))
1702
+ }
1703
+ ),
1704
+ isRoot ? rootName !== false && /* @__PURE__ */ jsx13(
1705
+ DataBox,
1706
+ {
1707
+ className: "data-key-colon",
1708
+ sx: { mr: 0.5 },
1709
+ children: ":"
1710
+ }
1711
+ ) : nestedIndex === void 0 && /* @__PURE__ */ jsx13(
1712
+ DataBox,
1713
+ {
1714
+ className: "data-key-colon",
1715
+ sx: {
1716
+ "mr": 0.5,
1717
+ ".data-key-key:empty + &": { display: "none" },
1718
+ "userSelect": isNumberKey ? "none" : "auto"
1719
+ },
1720
+ children: ":"
1721
+ }
1722
+ ),
1723
+ PreComponent && /* @__PURE__ */ jsx13(PreComponent, { ...downstreamProps }),
1724
+ isHover && expandable && inspect && actionIcons
1725
+ ]
1726
+ }
1727
+ ),
1728
+ editing && editable ? Editor && /* @__PURE__ */ jsx13(
1729
+ Editor,
1730
+ {
1731
+ path,
1732
+ value: tempValue,
1733
+ setValue: setTempValue,
1734
+ abortEditing,
1735
+ commitEditing
1736
+ }
1737
+ ) : Component ? /* @__PURE__ */ jsx13(Component, { ...downstreamProps }) : /* @__PURE__ */ jsx13(Box8, { component: "span", className: "data-value-fallback", children: `fallback: ${value}` }),
1738
+ PostComponent && /* @__PURE__ */ jsx13(PostComponent, { ...downstreamProps }),
1739
+ !last && displayComma && /* @__PURE__ */ jsx13(DataBox, { children: "," }),
1740
+ isHover && expandable && !inspect && actionIcons,
1741
+ isHover && !expandable && actionIcons,
1742
+ !isHover && editing && actionIcons
1743
+ ]
1744
+ }
1745
+ );
1746
+ };
1747
+
1748
+ // src/hooks/useThemeDetector.ts
1749
+ import { useEffect as useEffect3, useState as useState6 } from "react";
1750
+ var query = "(prefers-color-scheme: dark)";
1751
+ function useThemeDetector() {
1752
+ const [isDark, setIsDark] = useState6(false);
1753
+ useEffect3(() => {
1754
+ const listener = (e) => setIsDark(e.matches);
1755
+ setIsDark(globalThis.matchMedia(query).matches);
1756
+ const queryMedia = globalThis.matchMedia(query);
1757
+ queryMedia.addEventListener("change", listener);
1758
+ return () => queryMedia.removeEventListener("change", listener);
1759
+ }, []);
1760
+ return isDark;
1761
+ }
1762
+
1763
+ // src/JsonViewer.tsx
1764
+ import { jsx as jsx14 } from "react/jsx-runtime";
1765
+ function useSetIfNotUndefinedEffect(key, value) {
1766
+ const { setState } = useContext3(JsonViewerStoreContext);
1767
+ useEffect4(() => {
1768
+ if (value !== void 0) {
1769
+ setState({ [key]: value });
1770
+ }
1771
+ }, [key, value, setState]);
1772
+ }
1773
+ var JsonViewerInner = (props) => {
1774
+ const { setState } = useContext3(JsonViewerStoreContext);
1775
+ useEffect4(() => {
1776
+ setState((state) => ({
1777
+ prevValue: state.value,
1778
+ value: props.value
1779
+ }));
1780
+ }, [props.value, setState]);
1781
+ useSetIfNotUndefinedEffect("rootName", props.rootName);
1782
+ useSetIfNotUndefinedEffect("indentWidth", props.indentWidth);
1783
+ useSetIfNotUndefinedEffect("keyRenderer", props.keyRenderer);
1784
+ useSetIfNotUndefinedEffect("enableAdd", props.enableAdd);
1785
+ useSetIfNotUndefinedEffect("enableDelete", props.enableDelete);
1786
+ useSetIfNotUndefinedEffect("enableClipboard", props.enableClipboard);
1787
+ useSetIfNotUndefinedEffect("editable", props.editable);
1788
+ useSetIfNotUndefinedEffect("onChange", props.onChange);
1789
+ useSetIfNotUndefinedEffect("onCopy", props.onCopy);
1790
+ useSetIfNotUndefinedEffect("onSelect", props.onSelect);
1791
+ useSetIfNotUndefinedEffect("onAdd", props.onAdd);
1792
+ useSetIfNotUndefinedEffect("onDelete", props.onDelete);
1793
+ useSetIfNotUndefinedEffect("maxDisplayLength", props.maxDisplayLength);
1794
+ useSetIfNotUndefinedEffect("groupArraysAfterLength", props.groupArraysAfterLength);
1795
+ useSetIfNotUndefinedEffect("quotesOnKeys", props.quotesOnKeys);
1796
+ useSetIfNotUndefinedEffect("displayDataTypes", props.displayDataTypes);
1797
+ useSetIfNotUndefinedEffect("displaySize", props.displaySize);
1798
+ useSetIfNotUndefinedEffect("displayComma", props.displayComma);
1799
+ useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
1800
+ useEffect4(() => {
1801
+ if (props.theme === "light") {
1802
+ setState({ colorspace: lightColorspace });
1803
+ } else if (props.theme === "dark") {
1804
+ setState({ colorspace: darkColorspace });
1805
+ } else if (typeof props.theme === "object") {
1806
+ setState({ colorspace: props.theme });
1807
+ }
1808
+ }, [setState, props.theme]);
1809
+ const themeCls = useMemo5(() => {
1810
+ if (typeof props.theme === "object") return "json-viewer-theme-custom";
1811
+ return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
1812
+ }, [props.theme]);
1813
+ const onceRef = useRef3(true);
1814
+ const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
1815
+ if (onceRef.current) {
1816
+ const allTypes = props.valueTypes ? [...predefinedTypes, ...props.valueTypes] : [...predefinedTypes];
1817
+ registerTypes(allTypes);
1818
+ onceRef.current = false;
1819
+ }
1820
+ useEffect4(() => {
1821
+ const allTypes = props.valueTypes ? [...predefinedTypes, ...props.valueTypes] : [...predefinedTypes];
1822
+ registerTypes(allTypes);
1823
+ }, [props.valueTypes, registerTypes]);
1824
+ const value = useJsonViewerStore((store) => store.value);
1825
+ const prevValue = useJsonViewerStore((store) => store.prevValue);
1826
+ const emptyPath = useMemo5(() => [], []);
1827
+ const setHover = useJsonViewerStore((store) => store.setHover);
1828
+ const onMouseLeave = useCallback5(() => setHover(null), [setHover]);
1829
+ return /* @__PURE__ */ jsx14(
1830
+ Paper,
1831
+ {
1832
+ elevation: 0,
1833
+ className: clsx(themeCls, props.className),
1834
+ style: props.style,
1835
+ sx: {
1836
+ fontFamily: "monospace",
1837
+ userSelect: "none",
1838
+ contentVisibility: "auto",
1839
+ ...props.sx
1840
+ },
1841
+ onMouseLeave,
1842
+ children: /* @__PURE__ */ jsx14(
1843
+ DataKeyPair,
1844
+ {
1845
+ value,
1846
+ prevValue,
1847
+ path: emptyPath,
1848
+ last: true
1849
+ }
1850
+ )
1851
+ }
1852
+ );
1853
+ };
1854
+ var JsonViewer = function JsonViewer2(props) {
1855
+ const isAutoDarkTheme = useThemeDetector();
1856
+ const themeType = useMemo5(() => props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : props.theme ?? "light", [isAutoDarkTheme, props.theme]);
1857
+ const theme = useMemo5(() => {
1858
+ const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
1859
+ const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
1860
+ return createTheme({
1861
+ components: {
1862
+ MuiPaper: {
1863
+ styleOverrides: {
1864
+ root: {
1865
+ backgroundColor,
1866
+ color: foregroundColor
1867
+ }
1868
+ }
1869
+ }
1870
+ },
1871
+ palette: {
1872
+ mode: themeType === "dark" ? "dark" : "light",
1873
+ background: { default: backgroundColor }
1874
+ }
1875
+ });
1876
+ }, [themeType]);
1877
+ const mixedProps = { ...props, theme: themeType };
1878
+ const jsonViewerStore = useMemo5(() => createJsonViewerStore(props), []);
1879
+ const typeRegistryStore = useMemo5(() => createTypeRegistryStore(), []);
1880
+ return /* @__PURE__ */ jsx14(ThemeProvider, { theme, children: /* @__PURE__ */ jsx14(TypeRegistryStoreContext.Provider, { value: typeRegistryStore, children: /* @__PURE__ */ jsx14(JsonViewerStoreContext.Provider, { value: jsonViewerStore, children: /* @__PURE__ */ jsx14(JsonViewerInner, { ...mixedProps }) }) }) });
1881
+ };
1882
+ export {
1883
+ JsonViewer,
1884
+ applyValue,
1885
+ bigIntType,
1886
+ booleanType,
1887
+ darkColorspace,
1888
+ dateType,
1889
+ defineDataType,
1890
+ defineEasyType,
1891
+ deleteValue,
1892
+ floatType,
1893
+ functionType,
1894
+ getPathValue,
1895
+ intType,
1896
+ isCycleReference,
1897
+ lightColorspace,
1898
+ nanType,
1899
+ nullType,
1900
+ objectType,
1901
+ pathValueDefaultGetter,
1902
+ safeStringify,
1903
+ stringType,
1904
+ undefinedType
1905
+ };