this.gui 1.3.41 → 1.3.42

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 (310) hide show
  1. package/package.json +3 -2
  2. package/src/GUI.tsx +46 -0
  3. package/src/QRouter/QRegistry.tsx +53 -0
  4. package/src/QRouter/QRouter.stories.tsx +31 -0
  5. package/src/QRouter/QRouter.tsx +57 -0
  6. package/src/gui/Theme/GuiProvider.tsx +111 -0
  7. package/src/gui/Theme/Icon/Icon.resolver.tsx +29 -0
  8. package/src/gui/Theme/Icon/Icon.tsx +43 -0
  9. package/src/gui/Theme/Layout/Content/Content.resolver.tsx +0 -0
  10. package/src/gui/Theme/Layout/Content/Content.stories.tsx +88 -0
  11. package/src/gui/Theme/Layout/Content/Content.tsx +53 -0
  12. package/src/gui/Theme/Layout/Content/Content.types.tsx +40 -0
  13. package/src/gui/Theme/Layout/Footer/Footer.resolver.tsx +45 -0
  14. package/src/gui/Theme/Layout/Footer/Footer.stories.tsx +205 -0
  15. package/src/gui/Theme/Layout/Footer/Footer.tsx +337 -0
  16. package/src/gui/Theme/Layout/Footer/Footer.types.ts +40 -0
  17. package/src/gui/Theme/Layout/Layout/Layout.resolver.tsx +37 -0
  18. package/src/gui/Theme/Layout/Layout/Layout.stories.tsx +289 -0
  19. package/src/gui/Theme/Layout/Layout/Layout.tsx +117 -0
  20. package/src/gui/Theme/Layout/Layout/Layout.types.ts +57 -0
  21. package/src/gui/Theme/Layout/Layout/useLayoutBreakpoints.ts +9 -0
  22. package/src/gui/Theme/Layout/Namespace/Namespace.stories.tsx +105 -0
  23. package/src/gui/Theme/Layout/Namespace/Namespace.tsx +26 -0
  24. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.resolver.tsx +87 -0
  25. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.stories.tsx +199 -0
  26. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.tsx +311 -0
  27. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/LeftSidebar.types.ts +41 -0
  28. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/SidebarToggleButton.tsx +53 -0
  29. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.resolver.tsx +19 -0
  30. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarAction/LeftSidebarAction.tsx +107 -0
  31. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.resolver.tsx +0 -0
  32. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.tsx +134 -0
  33. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarLink/LeftSidebarLink.types.ts +15 -0
  34. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarMenu/LeftSidebarMenu.tsx +142 -0
  35. package/src/gui/Theme/Layout/Sidebars/LeftSidebar/components/LeftSidebarToggleButton/LeftSidebarToggleButton.tsx +23 -0
  36. package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.resolver.tsx +35 -0
  37. package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.stories.tsx +239 -0
  38. package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.tsx +319 -0
  39. package/src/gui/Theme/Layout/Sidebars/RightSidebar/RightSidebar.types.ts +17 -0
  40. package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarAction/RightSidebarAction.tsx +102 -0
  41. package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarLink/RightSidebarLink.tsx +132 -0
  42. package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarMenu/RightSidebarMenu.tsx +140 -0
  43. package/src/gui/Theme/Layout/Sidebars/RightSidebar/components/RightSidebarToggleButton/RightSidebarToggleButton.tsx +22 -0
  44. package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.stories.tsx +469 -0
  45. package/src/gui/Theme/Layout/StickyOptions/StickyOptionsTop.tsx +489 -0
  46. package/src/gui/Theme/Layout/TopBar/TopBar.resolver.tsx +86 -0
  47. package/src/gui/Theme/Layout/TopBar/TopBar.stories.tsx +350 -0
  48. package/src/gui/Theme/Layout/TopBar/TopBar.tsx +292 -0
  49. package/src/gui/Theme/Layout/TopBar/TopBar.types.ts +39 -0
  50. package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.stories.tsx +83 -0
  51. package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.tsx +18 -0
  52. package/src/gui/Theme/Layout/TopBar/components/TopBarAction/TopBarAction.types.ts +4 -0
  53. package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.stories.tsx +189 -0
  54. package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.tsx +30 -0
  55. package/src/gui/Theme/Layout/TopBar/components/TopBarLink/TopBarLink.types.ts +9 -0
  56. package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.resolver.tsx +14 -0
  57. package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.stories.tsx +56 -0
  58. package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.tsx +123 -0
  59. package/src/gui/Theme/Layout/TopBar/components/TopBarMenu/TopBarMenu.types.ts +44 -0
  60. package/src/gui/Theme/catalog/CherryByte/CherryByte.png +0 -0
  61. package/src/gui/Theme/catalog/CherryByte/dark.tokens.ts +47 -0
  62. package/src/gui/Theme/catalog/CherryByte/light.tokens.ts +47 -0
  63. package/src/gui/Theme/catalog/CherryByte/manifest.ts +24 -0
  64. package/src/gui/Theme/catalog/GhostShell/dark.tokens.ts +43 -0
  65. package/src/gui/Theme/catalog/GhostShell/ghost.png +0 -0
  66. package/src/gui/Theme/catalog/GhostShell/light.tokens.ts +39 -0
  67. package/src/gui/Theme/catalog/GhostShell/manifest.ts +24 -0
  68. package/src/gui/Theme/catalog/LunaHex/LunaHex.png +0 -0
  69. package/src/gui/Theme/catalog/LunaHex/dark.tokens.ts +34 -0
  70. package/src/gui/Theme/catalog/LunaHex/light.tokens.ts +74 -0
  71. package/src/gui/Theme/catalog/LunaHex/manifest.ts +24 -0
  72. package/src/gui/Theme/catalog/MUI/MUI.png +0 -0
  73. package/src/gui/Theme/catalog/MUI/dark.tokens.ts +58 -0
  74. package/src/gui/Theme/catalog/MUI/light.tokens.ts +74 -0
  75. package/src/gui/Theme/catalog/MUI/manifest.ts +24 -0
  76. package/src/gui/Theme/catalog/PrinceOfDarkness/dark.tokens.ts +48 -0
  77. package/src/gui/Theme/catalog/PrinceOfDarkness/light.tokens.ts +47 -0
  78. package/src/gui/Theme/catalog/PrinceOfDarkness/manifest.ts +24 -0
  79. package/src/gui/Theme/catalog/PrinceOfDarkness/prince.png +0 -0
  80. package/src/gui/Theme/catalog/PrinceOfDarkness/princeOfDarkness.png +0 -0
  81. package/src/gui/Theme/catalog/Seafoam/dark.tokens.ts +49 -0
  82. package/src/gui/Theme/catalog/Seafoam/light.tokens.ts +47 -0
  83. package/src/gui/Theme/catalog/Seafoam/manifest.ts +24 -0
  84. package/src/gui/Theme/catalog/Seafoam/seaFoam.png +0 -0
  85. package/src/gui/Theme/catalog/neurons/dark.tokens.ts +58 -0
  86. package/src/gui/Theme/catalog/neurons/light.tokens.ts +74 -0
  87. package/src/gui/Theme/catalog/neurons/manifest.ts +24 -0
  88. package/src/gui/Theme/catalog/neurons/neurons.me.png +0 -0
  89. package/src/gui/Theme/fromTokens.ts +272 -0
  90. package/src/gui/Theme/gui.css +31 -0
  91. package/src/gui/Theme/index.ts +17 -0
  92. package/src/gui/Theme/styles/buildShadows.ts +83 -0
  93. package/src/gui/Theme/styles/theme.tokens.ts +108 -0
  94. package/src/gui/Theme/utils/catalog.ts +61 -0
  95. package/src/gui/Theme/utils/persistence.ts +66 -0
  96. package/src/gui/Theme/utils/themeUtils.ts +34 -0
  97. package/src/gui/components/atoms/AppBar/AppBar.resolver.tsx +46 -0
  98. package/src/gui/components/atoms/AppBar/AppBar.stories.tsx +251 -0
  99. package/src/gui/components/atoms/AppBar/AppBar.tsx +107 -0
  100. package/src/gui/components/atoms/AppBar/AppBar.types.ts +28 -0
  101. package/src/gui/components/atoms/Avatar/Avatar.resolver.tsx +61 -0
  102. package/src/gui/components/atoms/Avatar/Avatar.stories.tsx +36 -0
  103. package/src/gui/components/atoms/Avatar/Avatar.tsx +14 -0
  104. package/src/gui/components/atoms/Box/Box.resolver.tsx +171 -0
  105. package/src/gui/components/atoms/Box/Box.stories.tsx +263 -0
  106. package/src/gui/components/atoms/Box/Box.tsx +15 -0
  107. package/src/gui/components/atoms/Button/Button.resolver.tsx +103 -0
  108. package/src/gui/components/atoms/Button/Button.stories.tsx +219 -0
  109. package/src/gui/components/atoms/Button/Button.tsx +40 -0
  110. package/src/gui/components/atoms/Card/Card.resolver.tsx +63 -0
  111. package/src/gui/components/atoms/Card/Card.stories.tsx +54 -0
  112. package/src/gui/components/atoms/Card/Card.tsx +13 -0
  113. package/src/gui/components/atoms/CardActions/CardActions.resolver.tsx +59 -0
  114. package/src/gui/components/atoms/CardActions/CardActions.stories.tsx +32 -0
  115. package/src/gui/components/atoms/CardActions/CardActions.tsx +14 -0
  116. package/src/gui/components/atoms/CardContent/CardContent.resolver.tsx +60 -0
  117. package/src/gui/components/atoms/CardContent/CardContent.stories.tsx +34 -0
  118. package/src/gui/components/atoms/CardContent/CardContent.tsx +13 -0
  119. package/src/gui/components/atoms/CardHeader/CardHeader.resolver.tsx +68 -0
  120. package/src/gui/components/atoms/CardHeader/CardHeader.stories.tsx +40 -0
  121. package/src/gui/components/atoms/CardHeader/CardHeader.tsx +12 -0
  122. package/src/gui/components/atoms/Collapse/Collapse.resolver.tsx +85 -0
  123. package/src/gui/components/atoms/Collapse/Collapse.stories.tsx +130 -0
  124. package/src/gui/components/atoms/Collapse/Collapse.tsx +17 -0
  125. package/src/gui/components/atoms/Divider/Divider.resolver.tsx +95 -0
  126. package/src/gui/components/atoms/Divider/Divider.stories.tsx +108 -0
  127. package/src/gui/components/atoms/Divider/Divider.tsx +14 -0
  128. package/src/gui/components/atoms/Drawer/Drawer.resolver.tsx +116 -0
  129. package/src/gui/components/atoms/Drawer/Drawer.stories.tsx +223 -0
  130. package/src/gui/components/atoms/Drawer/Drawer.tsx +25 -0
  131. package/src/gui/components/atoms/Grid/Grid.resolver.tsx +33 -0
  132. package/src/gui/components/atoms/Grid/Grid.stories.tsx +136 -0
  133. package/src/gui/components/atoms/Grid/Grid.tsx +15 -0
  134. package/src/gui/components/atoms/Grid/Grid.types.ts +9 -0
  135. package/src/gui/components/atoms/IconButton/IconButton.resolver.tsx +137 -0
  136. package/src/gui/components/atoms/IconButton/IconButton.stories.tsx +134 -0
  137. package/src/gui/components/atoms/IconButton/IconButton.tsx +22 -0
  138. package/src/gui/components/atoms/Link/Link.resolver.tsx +74 -0
  139. package/src/gui/components/atoms/Link/Link.stories.tsx +157 -0
  140. package/src/gui/components/atoms/Link/Link.tsx +36 -0
  141. package/src/gui/components/atoms/List/List.resolver.tsx +94 -0
  142. package/src/gui/components/atoms/List/List.stories.tsx +137 -0
  143. package/src/gui/components/atoms/List/List.tsx +20 -0
  144. package/src/gui/components/atoms/ListItem/ListItem.resolver.tsx +88 -0
  145. package/src/gui/components/atoms/ListItem/ListItem.stories.tsx +151 -0
  146. package/src/gui/components/atoms/ListItem/ListItem.tsx +19 -0
  147. package/src/gui/components/atoms/ListItemButton/ListItemButton.resolver.tsx +214 -0
  148. package/src/gui/components/atoms/ListItemButton/ListItemButton.stories.tsx +155 -0
  149. package/src/gui/components/atoms/ListItemButton/ListItemButton.tsx +15 -0
  150. package/src/gui/components/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
  151. package/src/gui/components/atoms/ListItemIcon/ListItemIcon.stories.tsx +132 -0
  152. package/src/gui/components/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
  153. package/src/gui/components/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
  154. package/src/gui/components/atoms/ListItemText/ListItemText.stories.tsx +156 -0
  155. package/src/gui/components/atoms/ListItemText/ListItemText.tsx +15 -0
  156. package/src/gui/components/atoms/Menu/Menu.resolver.tsx +112 -0
  157. package/src/gui/components/atoms/Menu/Menu.stories.tsx +162 -0
  158. package/src/gui/components/atoms/Menu/Menu.tsx +17 -0
  159. package/src/gui/components/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
  160. package/src/gui/components/atoms/MenuItem/MenuItem.stories.tsx +134 -0
  161. package/src/gui/components/atoms/MenuItem/MenuItem.tsx +14 -0
  162. package/src/gui/components/atoms/Paper/Paper.resolver.tsx +98 -0
  163. package/src/gui/components/atoms/Paper/Paper.stories.tsx +184 -0
  164. package/src/gui/components/atoms/Paper/Paper.tsx +15 -0
  165. package/src/gui/components/atoms/Section/Section.resolver.tsx +10 -0
  166. package/src/gui/components/atoms/Section/Section.stories.tsx +189 -0
  167. package/src/gui/components/atoms/Section/Section.tsx +76 -0
  168. package/src/gui/components/atoms/Section/Section.types.tsx +24 -0
  169. package/src/gui/components/atoms/Stack/Stack.resolver.tsx +94 -0
  170. package/src/gui/components/atoms/Stack/Stack.stories.tsx +160 -0
  171. package/src/gui/components/atoms/Stack/Stack.tsx +15 -0
  172. package/src/gui/components/atoms/Surface/Surface.resolver.tsx +37 -0
  173. package/src/gui/components/atoms/Surface/Surface.tsx +49 -0
  174. package/src/gui/components/atoms/Surface/Surface.types.ts +20 -0
  175. package/src/gui/components/atoms/Switch/Switch.resolver.tsx +53 -0
  176. package/src/gui/components/atoms/Switch/Switch.stories.tsx +236 -0
  177. package/src/gui/components/atoms/Switch/Switch.tsx +22 -0
  178. package/src/gui/components/atoms/Table/Body/TableBody.tsx +7 -0
  179. package/src/gui/components/atoms/Table/Cell/TableCell.tsx +18 -0
  180. package/src/gui/components/atoms/Table/Head/TableHead.tsx +9 -0
  181. package/src/gui/components/atoms/Table/Row/TableRow.tsx +20 -0
  182. package/src/gui/components/atoms/Table/Table.resolver.tsx +77 -0
  183. package/src/gui/components/atoms/Table/Table.stories.tsx +173 -0
  184. package/src/gui/components/atoms/Table/Table.tsx +20 -0
  185. package/src/gui/components/atoms/TextField/TextField.stories.tsx +25 -0
  186. package/src/gui/components/atoms/TextField/TextField.tsx +15 -0
  187. package/src/gui/components/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
  188. package/src/gui/components/atoms/Toolbar/Toolbar.stories.tsx +155 -0
  189. package/src/gui/components/atoms/Toolbar/Toolbar.tsx +16 -0
  190. package/src/gui/components/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
  191. package/src/gui/components/atoms/Tooltip/Tooltip.stories.tsx +117 -0
  192. package/src/gui/components/atoms/Tooltip/Tooltip.tsx +70 -0
  193. package/src/gui/components/atoms/Typography/Typography.resolver.tsx +158 -0
  194. package/src/gui/components/atoms/Typography/Typography.stories.tsx +222 -0
  195. package/src/gui/components/atoms/Typography/Typography.tsx +27 -0
  196. package/src/gui/components/atoms/Window/Nodes/node.ts +0 -0
  197. package/src/gui/components/atoms/Window/code/block/node.tsx +0 -0
  198. package/src/gui/components/atoms/Window/code/hugging.face.api.ts +11 -0
  199. package/src/gui/components/atoms/Window/connectors/index.ts +19 -0
  200. package/src/gui/components/atoms/Window/window.stories.tsx +20 -0
  201. package/src/gui/components/atoms/Window/window.tsx +636 -0
  202. package/src/gui/components/atoms/atoms.tsx +151 -0
  203. package/src/gui/components/atoms/index.ts +2 -0
  204. package/src/gui/components/generics/Cards/Gridme.jsx +52 -0
  205. package/src/gui/components/generics/Cards/LilBox.jsx +65 -0
  206. package/src/gui/components/generics/Cards/ModuleCard.jsx +106 -0
  207. package/src/gui/components/generics/Chats/FullChatBot.jsx +223 -0
  208. package/src/gui/components/generics/Code/CodeBlock.jsx +33 -0
  209. package/src/gui/components/generics/EmojiCursor/EmojiCursor.stories.tsx +153 -0
  210. package/src/gui/components/generics/EmojiCursor/EmojiCursor.tsx +23 -0
  211. package/src/gui/components/generics/Feedback/Callout.jsx +92 -0
  212. package/src/gui/components/generics/Layout/GridX.jsx +29 -0
  213. package/src/gui/components/generics/Layout/Hero2.jsx +132 -0
  214. package/src/gui/components/generics/Layout/PageContainer.jsx +29 -0
  215. package/src/gui/components/generics/Layout/PageDivider.jsx +20 -0
  216. package/src/gui/components/generics/Layout/Section.jsx +43 -0
  217. package/src/gui/components/generics/Layout/SectionHeader.jsx +21 -0
  218. package/src/gui/components/generics/Media/Img.jsx +58 -0
  219. package/src/gui/components/generics/Media/VideoEmbed.jsx +51 -0
  220. package/src/gui/components/generics/Organization/TableOfContents.jsx +51 -0
  221. package/src/gui/components/generics/Organization/Tabs.jsx +45 -0
  222. package/src/gui/components/generics/Text/TextList.jsx +41 -0
  223. package/src/gui/components/generics/Text/TextParagraph.jsx +28 -0
  224. package/src/gui/components/generics/Text/TextQuote.jsx +23 -0
  225. package/src/gui/components/generics/Text/TextTitle.jsx +44 -0
  226. package/src/gui/components/molecules/Dialog/Dialog.stories.tsx +18 -0
  227. package/src/gui/components/molecules/Dialog/Dialog.tsx +5 -0
  228. package/src/gui/components/molecules/Hero/Hero.stories.tsx +140 -0
  229. package/src/gui/components/molecules/Hero/Hero.tsx +152 -0
  230. package/src/gui/components/molecules/Hero/Hero.types.tsx +18 -0
  231. package/src/gui/components/molecules/Modal/Modal.resolver.tsx +38 -0
  232. package/src/gui/components/molecules/Modal/Modal.stories.tsx +82 -0
  233. package/src/gui/components/molecules/Modal/Modal.tsx +110 -0
  234. package/src/gui/components/molecules/Modal/Modal.types.ts +29 -0
  235. package/src/gui/components/molecules/Page/Page.stories.tsx +135 -0
  236. package/src/gui/components/molecules/Page/Page.tsx +94 -0
  237. package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.resolver.tsx +58 -0
  238. package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.stories.tsx +133 -0
  239. package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.tsx +101 -0
  240. package/src/gui/components/molecules/Theme/ThemeModeToggle/ThemeModeToggle.types.ts +29 -0
  241. package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.resolver.tsx +15 -0
  242. package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.stories.tsx +88 -0
  243. package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.tsx +167 -0
  244. package/src/gui/components/molecules/Theme/ThemesCatalog/ThemesCatalog.types.ts +34 -0
  245. package/src/gui/components/molecules/molecules.ts +49 -0
  246. package/src/gui/components/organisms/Blockchain/Blocks/BlocksTable.tsx +119 -0
  247. package/src/gui/components/organisms/Blockchain/Usernames/Identities.stories.tsx +20 -0
  248. package/src/gui/components/organisms/Blockchain/Usernames/QR.tsx +566 -0
  249. package/src/gui/components/organisms/Blockchain/Usernames/Usernames.tsx +448 -0
  250. package/src/gui/components/organisms/Blockchain/Usernames/identities.tsx +710 -0
  251. package/src/gui/components/organisms/Blockchain/blockchain.stories.tsx +17 -0
  252. package/src/gui/components/organisms/Blockchain/blockchain.tsx +368 -0
  253. package/src/gui/components/organisms/Blockchain/scripts/connection.ts +82 -0
  254. package/src/gui/components/organisms/Blockchain/scripts/match_face.ts +143 -0
  255. package/src/gui/components/organisms/HighLighter/HighLighter.stories.tsx +168 -0
  256. package/src/gui/components/organisms/HighLighter/HighLighter.tsx +420 -0
  257. package/src/gui/components/organisms/HighLighter/HighLightsDrawer.tsx +197 -0
  258. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.stories.tsx +312 -0
  259. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/FaceRecognition.tsx +765 -0
  260. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceCameraPermission.ts +70 -0
  261. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceLandmarker.ts +106 -0
  262. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceOverlay.ts +489 -0
  263. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplate.ts +32 -0
  264. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/useFaceTemplateBurst.ts +178 -0
  265. package/src/gui/components/organisms/IdentityNoise/FaceRecognition/modules/verifyTemplate.ts +136 -0
  266. package/src/gui/components/organisms/IdentityNoise/IdentityNoise.tsx +403 -0
  267. package/src/gui/components/organisms/IdentityNoise/IndentityNoise.stories.tsx +15 -0
  268. package/src/gui/components/organisms/IdentityNoise/Noise/Noise.stories.tsx +206 -0
  269. package/src/gui/components/organisms/IdentityNoise/Noise/Noise.tsx +394 -0
  270. package/src/gui/components/organisms/IdentityNoise/Triad/QR.tsx +566 -0
  271. package/src/gui/components/organisms/IdentityNoise/Triad/Tiad.stories.tsx +6 -0
  272. package/src/gui/components/organisms/IdentityNoise/Triad/Triad.tsx +917 -0
  273. package/src/gui/components/organisms/IdentityNoise/Triad/handleCleak.ts +0 -0
  274. package/src/gui/components/organisms/IdentityNoise/Triad/identity.ts +31 -0
  275. package/src/gui/components/organisms/IdentityNoise/Triad/me/fundamentals/vectors/vectors.tsx +252 -0
  276. package/src/gui/components/organisms/IdentityNoise/Triad/me/me.stories.tsx +314 -0
  277. package/src/gui/components/organisms/IdentityNoise/Triad/me/me.tsx +0 -0
  278. package/src/gui/components/organisms/organisms.ts +15 -0
  279. package/src/gui/contexts/InsetsContext.tsx +40 -0
  280. package/src/gui/contexts/LeftSidebarContext.tsx +20 -0
  281. package/src/gui/contexts/RightSidebarContext.tsx +25 -0
  282. package/src/gui/contexts/ThemeContext.ts +34 -0
  283. package/src/gui/contexts/index.ts +4 -0
  284. package/src/gui/hooks/index.ts +11 -0
  285. package/src/gui/hooks/resolveColorToken.ts +39 -0
  286. package/src/gui/hooks/useCodeGen.ts +12 -0
  287. package/src/gui/hooks/useGuiMediaQuery.ts +18 -0
  288. package/src/gui/hooks/useGuiTheme.ts +18 -0
  289. package/src/gui/hooks/useInsets.ts +26 -0
  290. package/src/gui/hooks/useIsMobile.ts +13 -0
  291. package/src/gui/hooks/useIsTouchDevice.ts +25 -0
  292. package/src/gui/hooks/useLeftSidebar.ts +10 -0
  293. package/src/gui/hooks/useRightSidebar.ts +12 -0
  294. package/src/gui/hooks/useViewportKey.ts +19 -0
  295. package/src/gui/hooks/useViewportProp.ts +17 -0
  296. package/src/gui/registry/GuiRegistry.ts +19 -0
  297. package/src/gui/registry/factory.ts +12 -0
  298. package/src/gui/registry/index.ts +3 -0
  299. package/src/gui/registry/types.ts +6 -0
  300. package/src/gui/utils/nodeID.ts +11 -0
  301. package/src/registry/GuiRegistry.ts +19 -0
  302. package/src/stories/01.Home.mdx +22 -0
  303. package/src/stories/02.Understanding.This.GUI.mdx +149 -0
  304. package/src/stories/Theme/Palette.stories.tsx +86 -0
  305. package/src/stories/Theme/ThemeViewer.stories.tsx +91 -0
  306. package/src/stories/Theme/Typography.stories.jsx +211 -0
  307. package/src/stories/assets/this.GUI.png +0 -0
  308. package/src/types/gui.d.ts +67 -0
  309. package/src/types/theme.d.ts +191 -0
  310. package/src/types/viewport.ts +132 -0
@@ -0,0 +1,178 @@
1
+ import * as React from 'react';
2
+
3
+ export type FaceTemplate = number[];
4
+
5
+ export type Blendshape = { categoryName: string; score: number };
6
+ export type Point2D = { x: number; y: number };
7
+
8
+ export type UseFaceTemplateBurstOptions = {
9
+ /** Whether the burst sampler should run. */
10
+ enabled: boolean;
11
+ /** Whether a face is currently detected. If false, the sampler resets. */
12
+ hasFace: boolean;
13
+ /** Ref to the latest MediaPipe points (normalized 0..1, 468 entries when real). */
14
+ pointsRef: React.MutableRefObject<Point2D[] | null>;
15
+ /** Optional ref to blendshapes (if available). */
16
+ blendshapesRef?: React.MutableRefObject<Blendshape[] | null>;
17
+ /** If true, include a stable blendshape score vector appended to the template. */
18
+ includeBlendshapes?: boolean;
19
+ /** How many templates to collect before producing a stable one. Default: 15. */
20
+ burstSize?: number;
21
+ /** Interval for sampling frames into the burst (ms). Default: 60. */
22
+ intervalMs?: number;
23
+ /** Called when a new stable template is produced (or null on reset). */
24
+ onTemplate?: (tpl: FaceTemplate | null) => void;
25
+ };
26
+
27
+ export type UseFaceTemplateBurstResult = {
28
+ stableTemplate: FaceTemplate | null;
29
+ /** Clears burst + stable template. */
30
+ reset: () => void;
31
+ };
32
+
33
+ // MediaPipe mesh template indices (denser but still stable): cover eyes, brows, nose, mouth, cheeks, jaw, forehead.
34
+ const TEMPLATE_INDICES = [
35
+ // eyes / eye corners
36
+ 33, 133, 160, 159, 158, 144,
37
+ 263, 362, 387, 386, 385, 373,
38
+ // brows
39
+ 70, 63, 105, 66, 107,
40
+ 336, 296, 334, 293, 300,
41
+ // nose
42
+ 1, 2, 98, 327, 5, 4,
43
+ // mouth / lips
44
+ 61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291,
45
+ // cheeks
46
+ 234, 93, 132, 58,
47
+ 454, 323, 361, 288,
48
+ // jaw / chin
49
+ 152, 148, 176, 149, 150, 136,
50
+ // forehead / face oval anchors
51
+ 10, 109, 67, 338,
52
+ // misc stabilizers
53
+ 199,
54
+ ];
55
+
56
+ function extractFaceTemplate(
57
+ points: Point2D[],
58
+ blendshapes?: Blendshape[],
59
+ includeBlendshapes?: boolean
60
+ ): FaceTemplate | null {
61
+ if (!points || TEMPLATE_INDICES.some((idx) => !points[idx])) return null;
62
+
63
+ // Center at nose tip (index 1)
64
+ const nose = points[1];
65
+ // Inter-ocular distance: 33 (left eye outer) and 263 (right eye outer)
66
+ const p33 = points[33];
67
+ const p263 = points[263];
68
+ const iod = Math.sqrt((p33.x - p263.x) ** 2 + (p33.y - p263.y) ** 2);
69
+ if (!iod || iod < 1e-6) return null;
70
+
71
+ const arr: number[] = [];
72
+ for (const idx of TEMPLATE_INDICES) {
73
+ const pt = points[idx];
74
+ arr.push((pt.x - nose.x) / iod, (pt.y - nose.y) / iod);
75
+ }
76
+
77
+ if (includeBlendshapes && blendshapes && blendshapes.length) {
78
+ const sorted = [...blendshapes]
79
+ .filter((b) => b && typeof b.categoryName === 'string')
80
+ .sort((a, b) => a.categoryName.localeCompare(b.categoryName));
81
+
82
+ for (const b of sorted) {
83
+ const s = Math.max(0, Math.min(1, Number(b.score ?? 0)));
84
+ arr.push(s);
85
+ }
86
+ }
87
+
88
+ return arr;
89
+ }
90
+
91
+ function medianTemplate(templates: FaceTemplate[]): FaceTemplate | null {
92
+ if (!templates.length) return null;
93
+
94
+ const D = templates[0].length;
95
+ for (let i = 1; i < templates.length; i++) {
96
+ if (templates[i].length !== D) return null; // avoid mixed dims (e.g. blendshape list changed)
97
+ }
98
+
99
+ const out: number[] = [];
100
+ for (let d = 0; d < D; d++) {
101
+ const vals = templates.map((tpl) => tpl[d]).sort((a, b) => a - b);
102
+ const mid = Math.floor(vals.length / 2);
103
+ out.push(vals.length % 2 === 0 ? (vals[mid - 1] + vals[mid]) / 2 : vals[mid]);
104
+ }
105
+ return out;
106
+ }
107
+
108
+ /**
109
+ * useFaceTemplateBurst
110
+ *
111
+ * Collects a short burst of templates from live landmarks and produces a stable template
112
+ * via per-dimension median. Designed to be fed by refs that are updated by the overlay loop.
113
+ */
114
+ export function useFaceTemplateBurst(options: UseFaceTemplateBurstOptions): UseFaceTemplateBurstResult {
115
+ const {
116
+ enabled,
117
+ hasFace,
118
+ pointsRef,
119
+ blendshapesRef,
120
+ includeBlendshapes,
121
+ burstSize = 15,
122
+ intervalMs = 60,
123
+ onTemplate,
124
+ } = options;
125
+
126
+ const burstRef = React.useRef<FaceTemplate[]>([]);
127
+ const [stableTemplate, setStableTemplate] = React.useState<FaceTemplate | null>(null);
128
+
129
+ const reset = React.useCallback(() => {
130
+ burstRef.current = [];
131
+ setStableTemplate(null);
132
+ onTemplate?.(null);
133
+ }, [onTemplate]);
134
+
135
+ // Reset when disabled or face disappears.
136
+ React.useEffect(() => {
137
+ if (!enabled || !hasFace) {
138
+ burstRef.current = [];
139
+ setStableTemplate(null);
140
+ onTemplate?.(null);
141
+ }
142
+ }, [enabled, hasFace, onTemplate]);
143
+
144
+ React.useEffect(() => {
145
+ if (!enabled) return;
146
+ if (!hasFace) return;
147
+
148
+ const handle = window.setInterval(() => {
149
+ const pts = pointsRef.current;
150
+ if (!pts || !pts.length) return;
151
+
152
+ const blend = blendshapesRef?.current ?? undefined;
153
+ const tpl = extractFaceTemplate(pts, blend, includeBlendshapes);
154
+ if (!tpl) return;
155
+
156
+ burstRef.current.push(tpl);
157
+
158
+ if (burstRef.current.length > burstSize) {
159
+ burstRef.current.splice(0, burstRef.current.length - burstSize);
160
+ }
161
+
162
+ if (burstRef.current.length === burstSize) {
163
+ const stable = medianTemplate(burstRef.current);
164
+ if (stable) {
165
+ burstRef.current = [];
166
+ setStableTemplate(stable);
167
+ onTemplate?.(stable);
168
+ }
169
+ }
170
+ }, Math.max(16, intervalMs));
171
+
172
+ return () => window.clearInterval(handle);
173
+ }, [enabled, hasFace, pointsRef, blendshapesRef, includeBlendshapes, burstSize, intervalMs, onTemplate]);
174
+
175
+ return { stableTemplate, reset };
176
+ }
177
+
178
+ export default useFaceTemplateBurst;
@@ -0,0 +1,136 @@
1
+ export type VerifyStatusTone = 'info' | 'warn' | 'error' | 'success' | 'neutral';
2
+
3
+ export type VerifyStatus = {
4
+ /** Local busy flag (client is doing an async verify request). */
5
+ busy?: boolean;
6
+ /** HTTP status from the verify endpoint (if applicable). */
7
+ httpStatus?: number | null;
8
+ /** Human-friendly message (optional). */
9
+ message?: string | null;
10
+ };
11
+
12
+ export type VerifyTemplateArgs<TPayload = any> = {
13
+ /** Endpoint to call for verification. Default should be handled by caller. */
14
+ verifyUrl: string;
15
+ /** Payload to send to the server. Usually contains { template, version, includeBlendshapes }. */
16
+ payload: TPayload;
17
+ /** Optional AbortSignal for cancellation. */
18
+ signal?: AbortSignal;
19
+ /** Optional hook for status updates (e.g., HUD badge). */
20
+ onStatus?: (next: VerifyStatus | null) => void;
21
+ /** Optional hook called with parsed JSON on success. */
22
+ onSuccess?: (data: any) => void;
23
+ /** Optional hook called with an Error on failure. */
24
+ onError?: (err: Error) => void;
25
+ /** Optional custom fetch implementation (useful for testing). */
26
+ fetcher?: typeof fetch;
27
+ /** Optional: treat 404 as a domain-level "not enrolled" condition (common in face flows). Default: true. */
28
+ treat404AsNotFound?: boolean;
29
+ };
30
+
31
+ export type VerifyTemplateResult<T = any> =
32
+ | { ok: true; status: number; data: T }
33
+ | { ok: false; status: number | null; error: Error };
34
+
35
+ export type VerifyTemplateRequestArgs<TPayload = any> = VerifyTemplateArgs<TPayload>;
36
+
37
+ /**
38
+ * verifyTemplate
39
+ *
40
+ * Small helper for POSTing a verification payload and normalizing errors.
41
+ *
42
+ * Notes:
43
+ * - By default, we DO NOT treat a 404 as a "network error"; it's often an expected
44
+ * domain response (e.g. face not enrolled). The server may still return 404,
45
+ * but this function turns it into a clear Error message rather than a noisy stack.
46
+ * - You can disable that behavior with `treat404AsNotFound: false`.
47
+ */
48
+ export async function verifyTemplate<T = any, TPayload = any>(
49
+ args: VerifyTemplateArgs<TPayload>
50
+ ): Promise<VerifyTemplateResult<T>> {
51
+ const {
52
+ verifyUrl,
53
+ payload,
54
+ signal,
55
+ onStatus,
56
+ onSuccess,
57
+ onError,
58
+ fetcher = fetch,
59
+ treat404AsNotFound = true,
60
+ } = args;
61
+
62
+ onStatus?.({ busy: true, httpStatus: 102, message: 'Verifying…' });
63
+
64
+ try {
65
+ const resp = await fetcher(verifyUrl, {
66
+ method: 'POST',
67
+ headers: { 'Content-Type': 'application/json' },
68
+ body: JSON.stringify(payload),
69
+ signal,
70
+ });
71
+
72
+ const status = resp?.status ?? null;
73
+
74
+ if (!resp.ok) {
75
+ // Try to capture any response body for diagnostics (keep it short).
76
+ let txt = '';
77
+ try {
78
+ txt = await resp.text();
79
+ } catch {
80
+ txt = '';
81
+ }
82
+
83
+ if (treat404AsNotFound && status === 404) {
84
+ const err = new Error('404 (Not Found)');
85
+ onStatus?.({ busy: false, httpStatus: 404, message: '404 (Not Found)' });
86
+ onError?.(err);
87
+ return { ok: false, status: 404, error: err };
88
+ }
89
+
90
+ const msg = `HTTP ${status ?? 'ERR'}${txt ? `: ${txt}` : ''}`;
91
+ const err = new Error(msg);
92
+ onStatus?.({ busy: false, httpStatus: status, message: msg });
93
+ onError?.(err);
94
+ return { ok: false, status, error: err };
95
+ }
96
+
97
+ // Success path
98
+ let data: any = null;
99
+ try {
100
+ data = await resp.json();
101
+ } catch {
102
+ // If server returns empty body, treat as success with null data.
103
+ data = null;
104
+ }
105
+
106
+ onStatus?.({ busy: false, httpStatus: 200, message: (data as any)?.match ? 'Match' : 'No match' });
107
+ onSuccess?.(data);
108
+
109
+ return { ok: true, status: status ?? 200, data: data as T };
110
+ } catch (e: any) {
111
+ // Aborts should not be reported as errors (usually).
112
+ if (e?.name === 'AbortError') {
113
+ const err = new Error('Request cancelled');
114
+ onStatus?.({ busy: false, httpStatus: null, message: 'Cancelled' });
115
+ return { ok: false, status: null, error: err };
116
+ }
117
+
118
+ const err = e instanceof Error ? e : new Error(String(e?.message || e || 'Verification failed'));
119
+ onStatus?.({ busy: false, httpStatus: null, message: err.message });
120
+ onError?.(err);
121
+ return { ok: false, status: null, error: err };
122
+ }
123
+ }
124
+
125
+ /**
126
+ * verifyTemplateRequest
127
+ *
128
+ * Backwards-compatible alias for older imports.
129
+ */
130
+ export async function verifyTemplateRequest<T = any, TPayload = any>(
131
+ args: VerifyTemplateArgs<TPayload>
132
+ ): Promise<VerifyTemplateResult<T>> {
133
+ return verifyTemplate<T, TPayload>(args);
134
+ }
135
+
136
+ export default verifyTemplate;