forgebook 0.1.3 → 0.1.5

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 (379) hide show
  1. package/README.md +99 -6
  2. package/dist/bin/forgebook/agentClient.d.ts +17 -0
  3. package/dist/bin/forgebook/agentClient.d.ts.map +1 -1
  4. package/dist/bin/forgebook/agentClient.js +21 -0
  5. package/dist/bin/forgebook/agentClient.js.map +1 -1
  6. package/dist/bin/forgebook/agentLoopCommands.d.mts +9 -0
  7. package/dist/bin/forgebook/agentLoopCommands.d.mts.map +1 -0
  8. package/dist/bin/forgebook/agentLoopCommands.mjs +217 -0
  9. package/dist/bin/forgebook/agentLoopCommands.mjs.map +1 -0
  10. package/dist/bin/forgebook/agentText.d.ts +37 -1
  11. package/dist/bin/forgebook/agentText.d.ts.map +1 -1
  12. package/dist/bin/forgebook/agentText.js +49 -2
  13. package/dist/bin/forgebook/agentText.js.map +1 -1
  14. package/dist/bin/forgebook/agents.md +51 -0
  15. package/dist/bin/forgebook/agentsText.d.ts +29 -0
  16. package/dist/bin/forgebook/agentsText.d.ts.map +1 -0
  17. package/dist/bin/forgebook/agentsText.js +48 -0
  18. package/dist/bin/forgebook/agentsText.js.map +1 -0
  19. package/dist/bin/forgebook/catalogueCommands.d.ts +51 -0
  20. package/dist/bin/forgebook/catalogueCommands.d.ts.map +1 -0
  21. package/dist/bin/forgebook/catalogueCommands.js +90 -0
  22. package/dist/bin/forgebook/catalogueCommands.js.map +1 -0
  23. package/dist/bin/forgebook/errorsRun.d.ts +27 -0
  24. package/dist/bin/forgebook/errorsRun.d.ts.map +1 -0
  25. package/dist/bin/forgebook/errorsRun.js +60 -0
  26. package/dist/bin/forgebook/errorsRun.js.map +1 -0
  27. package/dist/bin/forgebook/forgebook.mjs +121 -86
  28. package/dist/bin/forgebook/forgebook.mjs.map +1 -1
  29. package/dist/bin/forgebook/importers/storybook.d.ts +53 -0
  30. package/dist/bin/forgebook/importers/storybook.d.ts.map +1 -0
  31. package/dist/bin/forgebook/importers/storybook.js +318 -0
  32. package/dist/bin/forgebook/importers/storybook.js.map +1 -0
  33. package/dist/bin/forgebook/initCommands.d.mts +9 -0
  34. package/dist/bin/forgebook/initCommands.d.mts.map +1 -0
  35. package/dist/bin/forgebook/initCommands.mjs +86 -0
  36. package/dist/bin/forgebook/initCommands.mjs.map +1 -0
  37. package/dist/bin/forgebook/initConfig.d.ts +22 -0
  38. package/dist/bin/forgebook/initConfig.d.ts.map +1 -0
  39. package/dist/bin/forgebook/initConfig.js +51 -0
  40. package/dist/bin/forgebook/initConfig.js.map +1 -0
  41. package/dist/bin/forgebook/mcpTools.d.ts +29 -3
  42. package/dist/bin/forgebook/mcpTools.d.ts.map +1 -1
  43. package/dist/bin/forgebook/mcpTools.js +130 -7
  44. package/dist/bin/forgebook/mcpTools.js.map +1 -1
  45. package/dist/bin/forgebook/newStories.d.ts +27 -0
  46. package/dist/bin/forgebook/newStories.d.ts.map +1 -0
  47. package/dist/bin/forgebook/newStories.js +109 -0
  48. package/dist/bin/forgebook/newStories.js.map +1 -0
  49. package/dist/bin/forgebook/newStoriesFile.d.ts +18 -0
  50. package/dist/bin/forgebook/newStoriesFile.d.ts.map +1 -0
  51. package/dist/bin/forgebook/newStoriesFile.js +58 -0
  52. package/dist/bin/forgebook/newStoriesFile.js.map +1 -0
  53. package/dist/bin/forgebook/storyCheckRun.d.ts +49 -0
  54. package/dist/bin/forgebook/storyCheckRun.d.ts.map +1 -0
  55. package/dist/bin/forgebook/storyCheckRun.js +178 -0
  56. package/dist/bin/forgebook/storyCheckRun.js.map +1 -0
  57. package/dist/bin/forgebook/touchWindowRun.d.ts +17 -0
  58. package/dist/bin/forgebook/touchWindowRun.d.ts.map +1 -0
  59. package/dist/bin/forgebook/touchWindowRun.js +21 -0
  60. package/dist/bin/forgebook/touchWindowRun.js.map +1 -0
  61. package/dist/bin/forgebook-docs/catalogueDocs.d.ts +24 -0
  62. package/dist/bin/forgebook-docs/catalogueDocs.d.ts.map +1 -0
  63. package/dist/bin/forgebook-docs/catalogueDocs.js +71 -0
  64. package/dist/bin/forgebook-docs/catalogueDocs.js.map +1 -0
  65. package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts +8 -0
  66. package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts.map +1 -1
  67. package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts +3 -1
  68. package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts.map +1 -1
  69. package/dist/bin/forgebook-docs/catalogueMarkdown.js +62 -42
  70. package/dist/bin/forgebook-docs/catalogueMarkdown.js.map +1 -1
  71. package/dist/bin/forgebook-docs/catalogueOptions.d.ts +39 -0
  72. package/dist/bin/forgebook-docs/catalogueOptions.d.ts.map +1 -0
  73. package/dist/bin/forgebook-docs/catalogueOptions.js +76 -0
  74. package/dist/bin/forgebook-docs/catalogueOptions.js.map +1 -0
  75. package/dist/bin/forgebook-docs/collectDocs.d.ts +3 -1
  76. package/dist/bin/forgebook-docs/collectDocs.d.ts.map +1 -1
  77. package/dist/bin/forgebook-docs/collectDocs.js +37 -13
  78. package/dist/bin/forgebook-docs/collectDocs.js.map +1 -1
  79. package/dist/bin/forgebook-docs/forgebook-docs.mjs +17 -80
  80. package/dist/bin/forgebook-docs/forgebook-docs.mjs.map +1 -1
  81. package/dist/bin/forgebook-docs/llmsText.d.ts +24 -0
  82. package/dist/bin/forgebook-docs/llmsText.d.ts.map +1 -0
  83. package/dist/bin/forgebook-docs/llmsText.js +33 -0
  84. package/dist/bin/forgebook-docs/llmsText.js.map +1 -0
  85. package/dist/bin/forgebook-docs/sourceId.d.ts +9 -0
  86. package/dist/bin/forgebook-docs/sourceId.d.ts.map +1 -0
  87. package/dist/bin/forgebook-docs/sourceId.js +45 -0
  88. package/dist/bin/forgebook-docs/sourceId.js.map +1 -0
  89. package/dist/bin/frameworkDocs.d.ts +10 -0
  90. package/dist/bin/frameworkDocs.d.ts.map +1 -0
  91. package/dist/bin/frameworkDocs.js +43 -0
  92. package/dist/bin/frameworkDocs.js.map +1 -0
  93. package/dist/src/argTypes.d.ts +23 -0
  94. package/dist/src/argTypes.d.ts.map +1 -1
  95. package/dist/src/argTypes.js +27 -0
  96. package/dist/src/argTypes.js.map +1 -1
  97. package/dist/src/catalogue.d.ts +70 -3
  98. package/dist/src/catalogue.d.ts.map +1 -1
  99. package/dist/src/catalogue.js +85 -3
  100. package/dist/src/catalogue.js.map +1 -1
  101. package/dist/src/controlKeys.d.ts +85 -0
  102. package/dist/src/controlKeys.d.ts.map +1 -0
  103. package/dist/src/controlKeys.js +118 -0
  104. package/dist/src/controlKeys.js.map +1 -0
  105. package/dist/src/frame/frame.css +33 -2
  106. package/dist/src/frame/frameView.d.ts +2 -2
  107. package/dist/src/frame/frameView.d.ts.map +1 -1
  108. package/dist/src/frame/frameView.js +7 -3
  109. package/dist/src/frame/frameView.js.map +1 -1
  110. package/dist/src/frame/mountFrame.d.ts.map +1 -1
  111. package/dist/src/frame/mountFrame.js +30 -2
  112. package/dist/src/frame/mountFrame.js.map +1 -1
  113. package/dist/src/frame/spillOutline.d.ts +10 -0
  114. package/dist/src/frame/spillOutline.d.ts.map +1 -0
  115. package/dist/src/frame/spillOutline.js +80 -0
  116. package/dist/src/frame/spillOutline.js.map +1 -0
  117. package/dist/src/frame/touchDots.d.ts +32 -0
  118. package/dist/src/frame/touchDots.d.ts.map +1 -0
  119. package/dist/src/frame/touchDots.js +52 -0
  120. package/dist/src/frame/touchDots.js.map +1 -0
  121. package/dist/src/frame/touchEvents.d.ts +66 -0
  122. package/dist/src/frame/touchEvents.d.ts.map +1 -0
  123. package/dist/src/frame/touchEvents.js +152 -0
  124. package/dist/src/frame/touchEvents.js.map +1 -0
  125. package/dist/src/frame/touchGesture.d.ts +80 -0
  126. package/dist/src/frame/touchGesture.d.ts.map +1 -0
  127. package/dist/src/frame/touchGesture.js +87 -0
  128. package/dist/src/frame/touchGesture.js.map +1 -0
  129. package/dist/src/frame/touchLayer.d.ts +7 -0
  130. package/dist/src/frame/touchLayer.d.ts.map +1 -0
  131. package/dist/src/frame/touchLayer.js +399 -0
  132. package/dist/src/frame/touchLayer.js.map +1 -0
  133. package/dist/src/frame/touchScroll.d.ts +51 -0
  134. package/dist/src/frame/touchScroll.d.ts.map +1 -0
  135. package/dist/src/frame/touchScroll.js +137 -0
  136. package/dist/src/frame/touchScroll.js.map +1 -0
  137. package/dist/src/liveErrors.d.ts +57 -0
  138. package/dist/src/liveErrors.d.ts.map +1 -0
  139. package/dist/src/liveErrors.js +52 -0
  140. package/dist/src/liveErrors.js.map +1 -0
  141. package/dist/src/messages.d.ts +12 -0
  142. package/dist/src/messages.d.ts.map +1 -1
  143. package/dist/src/messages.js +4 -0
  144. package/dist/src/messages.js.map +1 -1
  145. package/dist/src/namedViews.d.ts +80 -0
  146. package/dist/src/namedViews.d.ts.map +1 -0
  147. package/dist/src/namedViews.js +88 -0
  148. package/dist/src/namedViews.js.map +1 -0
  149. package/dist/src/realTouch.d.ts +21 -0
  150. package/dist/src/realTouch.d.ts.map +1 -0
  151. package/dist/src/realTouch.js +16 -0
  152. package/dist/src/realTouch.js.map +1 -0
  153. package/dist/src/shell/AppearanceMenu.d.ts +15 -0
  154. package/dist/src/shell/AppearanceMenu.d.ts.map +1 -0
  155. package/dist/src/shell/AppearanceMenu.js +28 -0
  156. package/dist/src/shell/AppearanceMenu.js.map +1 -0
  157. package/dist/src/shell/BoxWidth.d.ts +40 -0
  158. package/dist/src/shell/BoxWidth.d.ts.map +1 -0
  159. package/dist/src/shell/BoxWidth.js +56 -0
  160. package/dist/src/shell/BoxWidth.js.map +1 -0
  161. package/dist/src/shell/ComponentPage.d.ts +17 -1
  162. package/dist/src/shell/ComponentPage.d.ts.map +1 -1
  163. package/dist/src/shell/ComponentPage.js +19 -54
  164. package/dist/src/shell/ComponentPage.js.map +1 -1
  165. package/dist/src/shell/ControlKeyField.d.ts +21 -0
  166. package/dist/src/shell/ControlKeyField.d.ts.map +1 -0
  167. package/dist/src/shell/ControlKeyField.js +46 -0
  168. package/dist/src/shell/ControlKeyField.js.map +1 -0
  169. package/dist/src/shell/ControlRow.d.ts +31 -0
  170. package/dist/src/shell/ControlRow.d.ts.map +1 -0
  171. package/dist/src/shell/ControlRow.js +30 -0
  172. package/dist/src/shell/ControlRow.js.map +1 -0
  173. package/dist/src/shell/Example.d.ts +58 -0
  174. package/dist/src/shell/Example.d.ts.map +1 -0
  175. package/dist/src/shell/Example.js +89 -0
  176. package/dist/src/shell/Example.js.map +1 -0
  177. package/dist/src/shell/InfoTip.d.ts +23 -0
  178. package/dist/src/shell/InfoTip.d.ts.map +1 -0
  179. package/dist/src/shell/InfoTip.js +51 -0
  180. package/dist/src/shell/InfoTip.js.map +1 -0
  181. package/dist/src/shell/NamedViews.d.ts +23 -0
  182. package/dist/src/shell/NamedViews.d.ts.map +1 -0
  183. package/dist/src/shell/NamedViews.js +49 -0
  184. package/dist/src/shell/NamedViews.js.map +1 -0
  185. package/dist/src/shell/PinnedControl.d.ts +25 -0
  186. package/dist/src/shell/PinnedControl.d.ts.map +1 -0
  187. package/dist/src/shell/PinnedControl.js +82 -0
  188. package/dist/src/shell/PinnedControl.js.map +1 -0
  189. package/dist/src/shell/PropsTab.d.ts +5 -2
  190. package/dist/src/shell/PropsTab.d.ts.map +1 -1
  191. package/dist/src/shell/PropsTab.js +12 -15
  192. package/dist/src/shell/PropsTab.js.map +1 -1
  193. package/dist/src/shell/Shell.d.ts.map +1 -1
  194. package/dist/src/shell/Shell.js +27 -2
  195. package/dist/src/shell/Shell.js.map +1 -1
  196. package/dist/src/shell/Sidebar.d.ts +11 -9
  197. package/dist/src/shell/Sidebar.d.ts.map +1 -1
  198. package/dist/src/shell/Sidebar.js +48 -42
  199. package/dist/src/shell/Sidebar.js.map +1 -1
  200. package/dist/src/shell/SidebarEntries.d.ts +50 -0
  201. package/dist/src/shell/SidebarEntries.d.ts.map +1 -0
  202. package/dist/src/shell/SidebarEntries.js +51 -0
  203. package/dist/src/shell/SidebarEntries.js.map +1 -0
  204. package/dist/src/shell/Stage.d.ts.map +1 -1
  205. package/dist/src/shell/Stage.js +19 -2
  206. package/dist/src/shell/Stage.js.map +1 -1
  207. package/dist/src/shell/Toolbar.d.ts +7 -3
  208. package/dist/src/shell/Toolbar.d.ts.map +1 -1
  209. package/dist/src/shell/Toolbar.js +38 -68
  210. package/dist/src/shell/Toolbar.js.map +1 -1
  211. package/dist/src/shell/ToolbarControl.d.ts +47 -0
  212. package/dist/src/shell/ToolbarControl.d.ts.map +1 -0
  213. package/dist/src/shell/ToolbarControl.js +150 -0
  214. package/dist/src/shell/ToolbarControl.js.map +1 -0
  215. package/dist/src/shell/UsedIn.d.ts +38 -0
  216. package/dist/src/shell/UsedIn.d.ts.map +1 -0
  217. package/dist/src/shell/UsedIn.js +77 -0
  218. package/dist/src/shell/UsedIn.js.map +1 -0
  219. package/dist/src/shell/ViewMenu.d.ts +37 -0
  220. package/dist/src/shell/ViewMenu.d.ts.map +1 -0
  221. package/dist/src/shell/ViewMenu.js +219 -0
  222. package/dist/src/shell/ViewMenu.js.map +1 -0
  223. package/dist/src/shell/controlCycle.d.ts +28 -0
  224. package/dist/src/shell/controlCycle.d.ts.map +1 -0
  225. package/dist/src/shell/controlCycle.js +51 -0
  226. package/dist/src/shell/controlCycle.js.map +1 -0
  227. package/dist/src/shell/dockTabs.d.ts +3 -0
  228. package/dist/src/shell/dockTabs.d.ts.map +1 -1
  229. package/dist/src/shell/dockTabs.js +1 -1
  230. package/dist/src/shell/dockTabs.js.map +1 -1
  231. package/dist/src/shell/icons.d.ts +7 -0
  232. package/dist/src/shell/icons.d.ts.map +1 -1
  233. package/dist/src/shell/icons.js +8 -1
  234. package/dist/src/shell/icons.js.map +1 -1
  235. package/dist/src/shell/keyboard.d.ts +2 -1
  236. package/dist/src/shell/keyboard.d.ts.map +1 -1
  237. package/dist/src/shell/keyboard.js +5 -2
  238. package/dist/src/shell/keyboard.js.map +1 -1
  239. package/dist/src/shell/shell.css +876 -244
  240. package/dist/src/shell/strings.d.ts +46 -0
  241. package/dist/src/shell/strings.d.ts.map +1 -1
  242. package/dist/src/shell/strings.js +46 -0
  243. package/dist/src/shell/strings.js.map +1 -1
  244. package/dist/src/shell/useAppearance.d.ts +17 -0
  245. package/dist/src/shell/useAppearance.d.ts.map +1 -0
  246. package/dist/src/shell/useAppearance.js +36 -0
  247. package/dist/src/shell/useAppearance.js.map +1 -0
  248. package/dist/src/shell/useControlKeys.d.ts +23 -0
  249. package/dist/src/shell/useControlKeys.d.ts.map +1 -0
  250. package/dist/src/shell/useControlKeys.js +44 -0
  251. package/dist/src/shell/useControlKeys.js.map +1 -0
  252. package/dist/src/shell/useFold.d.ts +27 -0
  253. package/dist/src/shell/useFold.d.ts.map +1 -0
  254. package/dist/src/shell/useFold.js +87 -0
  255. package/dist/src/shell/useFold.js.map +1 -0
  256. package/dist/src/shell/useFrameMessages.d.ts +2 -0
  257. package/dist/src/shell/useFrameMessages.d.ts.map +1 -1
  258. package/dist/src/shell/useFrameMessages.js +3 -0
  259. package/dist/src/shell/useFrameMessages.js.map +1 -1
  260. package/dist/src/shell/useFullPage.d.ts +45 -0
  261. package/dist/src/shell/useFullPage.d.ts.map +1 -0
  262. package/dist/src/shell/useFullPage.js +149 -0
  263. package/dist/src/shell/useFullPage.js.map +1 -0
  264. package/dist/src/shell/usePopover.d.ts +17 -3
  265. package/dist/src/shell/usePopover.d.ts.map +1 -1
  266. package/dist/src/shell/usePopover.js +65 -4
  267. package/dist/src/shell/usePopover.js.map +1 -1
  268. package/dist/src/shell/useStored.d.ts +13 -2
  269. package/dist/src/shell/useStored.d.ts.map +1 -1
  270. package/dist/src/shell/useStored.js +1 -1
  271. package/dist/src/shell/useStored.js.map +1 -1
  272. package/dist/src/shell/useToolbarLayout.d.ts +39 -0
  273. package/dist/src/shell/useToolbarLayout.d.ts.map +1 -0
  274. package/dist/src/shell/useToolbarLayout.js +58 -0
  275. package/dist/src/shell/useToolbarLayout.js.map +1 -0
  276. package/dist/src/shell/useToolbarOverflow.d.ts +31 -0
  277. package/dist/src/shell/useToolbarOverflow.d.ts.map +1 -0
  278. package/dist/src/shell/useToolbarOverflow.js +62 -0
  279. package/dist/src/shell/useToolbarOverflow.js.map +1 -0
  280. package/dist/src/shell/useWorstCase.d.ts +46 -0
  281. package/dist/src/shell/useWorstCase.d.ts.map +1 -0
  282. package/dist/src/shell/useWorstCase.js +42 -0
  283. package/dist/src/shell/useWorstCase.js.map +1 -0
  284. package/dist/src/shell/worstArgs.d.ts +42 -0
  285. package/dist/src/shell/worstArgs.d.ts.map +1 -0
  286. package/dist/src/shell/worstArgs.js +47 -0
  287. package/dist/src/shell/worstArgs.js.map +1 -0
  288. package/dist/src/spills.d.ts +31 -0
  289. package/dist/src/spills.d.ts.map +1 -0
  290. package/dist/src/spills.js +65 -0
  291. package/dist/src/spills.js.map +1 -0
  292. package/dist/src/storyCheck.d.ts +105 -0
  293. package/dist/src/storyCheck.d.ts.map +1 -0
  294. package/dist/src/storyCheck.js +63 -0
  295. package/dist/src/storyCheck.js.map +1 -0
  296. package/dist/src/switches.d.ts +26 -4
  297. package/dist/src/switches.d.ts.map +1 -1
  298. package/dist/src/switches.js +50 -5
  299. package/dist/src/switches.js.map +1 -1
  300. package/dist/src/toolbarLayout.d.ts +119 -0
  301. package/dist/src/toolbarLayout.d.ts.map +1 -0
  302. package/dist/src/toolbarLayout.js +155 -0
  303. package/dist/src/toolbarLayout.js.map +1 -0
  304. package/dist/src/usedIn.d.ts +60 -0
  305. package/dist/src/usedIn.d.ts.map +1 -0
  306. package/dist/src/usedIn.js +92 -0
  307. package/dist/src/usedIn.js.map +1 -0
  308. package/dist/src/viewState.d.ts +9 -11
  309. package/dist/src/viewState.d.ts.map +1 -1
  310. package/dist/src/viewState.js +24 -20
  311. package/dist/src/viewState.js.map +1 -1
  312. package/dist/src/viewWords.d.ts +26 -0
  313. package/dist/src/viewWords.d.ts.map +1 -0
  314. package/dist/src/viewWords.js +29 -0
  315. package/dist/src/viewWords.js.map +1 -0
  316. package/dist/src/vite/adapter.d.ts +13 -4
  317. package/dist/src/vite/adapter.d.ts.map +1 -1
  318. package/dist/src/vite/adapter.js +4 -2
  319. package/dist/src/vite/adapter.js.map +1 -1
  320. package/dist/src/vite/agent.types.d.ts +32 -2
  321. package/dist/src/vite/agent.types.d.ts.map +1 -1
  322. package/dist/src/vite/agentApi.d.ts +15 -3
  323. package/dist/src/vite/agentApi.d.ts.map +1 -1
  324. package/dist/src/vite/agentApi.js +63 -9
  325. package/dist/src/vite/agentApi.js.map +1 -1
  326. package/dist/src/vite/agentRoutes.d.ts +8 -3
  327. package/dist/src/vite/agentRoutes.d.ts.map +1 -1
  328. package/dist/src/vite/agentRoutes.js +84 -23
  329. package/dist/src/vite/agentRoutes.js.map +1 -1
  330. package/dist/src/vite/configFile.d.ts +2 -1
  331. package/dist/src/vite/configFile.d.ts.map +1 -1
  332. package/dist/src/vite/configFile.js +29 -11
  333. package/dist/src/vite/configFile.js.map +1 -1
  334. package/dist/src/vite/docsExtractor.d.ts +26 -2
  335. package/dist/src/vite/docsExtractor.d.ts.map +1 -1
  336. package/dist/src/vite/docsExtractor.js +12 -9
  337. package/dist/src/vite/docsExtractor.js.map +1 -1
  338. package/dist/src/vite/docsWorker.js +18 -2
  339. package/dist/src/vite/docsWorker.js.map +1 -1
  340. package/dist/src/vite/forcedStates.d.ts +6 -2
  341. package/dist/src/vite/forcedStates.d.ts.map +1 -1
  342. package/dist/src/vite/forcedStates.js +20 -4
  343. package/dist/src/vite/forcedStates.js.map +1 -1
  344. package/dist/src/vite/forgebookPlugin.d.ts.map +1 -1
  345. package/dist/src/vite/forgebookPlugin.js +104 -16
  346. package/dist/src/vite/forgebookPlugin.js.map +1 -1
  347. package/dist/src/vite/indexStoryFile.d.ts +14 -0
  348. package/dist/src/vite/indexStoryFile.d.ts.map +1 -1
  349. package/dist/src/vite/indexStoryFile.js +13 -4
  350. package/dist/src/vite/indexStoryFile.js.map +1 -1
  351. package/dist/src/vite/mcpProtocol.d.ts +9 -0
  352. package/dist/src/vite/mcpProtocol.d.ts.map +1 -1
  353. package/dist/src/vite/mcpProtocol.js +6 -3
  354. package/dist/src/vite/mcpProtocol.js.map +1 -1
  355. package/dist/src/vite/storyFilesModule.d.ts +44 -1
  356. package/dist/src/vite/storyFilesModule.d.ts.map +1 -1
  357. package/dist/src/vite/storyFilesModule.js +49 -14
  358. package/dist/src/vite/storyFilesModule.js.map +1 -1
  359. package/dist/src/vite/touchMedia.d.ts +35 -0
  360. package/dist/src/vite/touchMedia.d.ts.map +1 -0
  361. package/dist/src/vite/touchMedia.js +187 -0
  362. package/dist/src/vite/touchMedia.js.map +1 -0
  363. package/dist/src/vite/usageGraph.d.ts +45 -0
  364. package/dist/src/vite/usageGraph.d.ts.map +1 -0
  365. package/dist/src/vite/usageGraph.js +246 -0
  366. package/dist/src/vite/usageGraph.js.map +1 -0
  367. package/dist/src/vite/usageModule.d.ts +33 -0
  368. package/dist/src/vite/usageModule.d.ts.map +1 -0
  369. package/dist/src/vite/usageModule.js +135 -0
  370. package/dist/src/vite/usageModule.js.map +1 -0
  371. package/dist/src/worstCase.d.ts +16 -0
  372. package/dist/src/worstCase.d.ts.map +1 -0
  373. package/dist/src/worstCase.js +16 -0
  374. package/dist/src/worstCase.js.map +1 -0
  375. package/package.json +18 -2
  376. package/dist/src/shell/SchemeSwitches.d.ts +0 -24
  377. package/dist/src/shell/SchemeSwitches.d.ts.map +0 -1
  378. package/dist/src/shell/SchemeSwitches.js +0 -36
  379. package/dist/src/shell/SchemeSwitches.js.map +0 -1
@@ -1,70 +1,36 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
- * The catalogue's toolbar: the colour scheme and the contrast switches, the View menu (every other declared switch,
4
- * the background, the style sheets, the text size), the stage's width, the panel, and Compare; every value kept in the
5
- * address.
3
+ * The catalogue's toolbar: the View menu first, then the controls the person pinned, in their order, then the panel
4
+ * and Compare; every value kept in the address, the arrangement in the person's browser.
5
+ *
6
+ * @remarks
7
+ * The controls are the catalogue's switches and Forgebook's own (the background, the style sheets, the text size, the
8
+ * stage's width); which start pinned is the catalogue's choice, where each sits is the person's (`toolbarLayout.ts`).
9
+ * The panel and Compare belong to the page, not to the view: they stay at the end.
6
10
  *
7
11
  * @module
8
12
  */
9
- import { useId } from "react";
13
+ import { useId, useRef } from "react";
10
14
  import { NOT_FIXED, withFixed, withOwnFixed } from "../storyGlobals.js";
11
- import { switchControl, switchWithRole } from "../switches.js";
12
- import { DEFAULT_VIEW, hasViewChanges, isComparing, isMenuSwitch, PLAIN_BACKDROP, SHEETS_CHOICES } from "../viewState.js";
15
+ import { switchWithRole } from "../switches.js";
16
+ import { hasViewChanges, isComparing } from "../viewState.js";
13
17
  import { useCatalogue } from "./catalogueContext.js";
14
18
  import { Icon } from "./icons.js";
15
- import { SchemeSwitches } from "./SchemeSwitches.js";
16
- import { Segmented } from "./Segmented.js";
19
+ import { PinnedControl } from "./PinnedControl.js";
17
20
  import { STRINGS } from "./strings.js";
18
- import { switchValueIn, withSwitch } from "./switchView.js";
21
+ import { useControlKeys } from "./useControlKeys.js";
19
22
  import { usePopover } from "./usePopover.js";
20
- import { WidthField } from "./WidthField.js";
21
- /**
22
- * One switch's row in the View menu: segments, or a list for many values.
23
- *
24
- * @param props - the switch, the view and its setter.
25
- */
26
- const SwitchRow = ({ each, view, onViewChange, isFixed }) => {
27
- const listId = useId();
28
- const isCompared = view.compare.includes(each.id) || isFixed;
29
- if (switchControl(each) === "list") {
30
- return (_jsxs("div", { className: "forgebook-popover__row", children: [_jsx("label", { className: "forgebook-popover__label", htmlFor: listId, children: each.label }), _jsx("select", { id: listId, className: "forgebook-select", value: switchValueIn(view, each), disabled: isCompared, title: isFixed ? STRINGS.setByStory : undefined, onChange: (event) => onViewChange(withSwitch(view, each, event.currentTarget.value)), children: each.values.map((value) => (_jsx("option", { value: value.value, children: value.label }, value.value))) })] }));
31
- }
32
- return (_jsxs("div", { className: "forgebook-popover__row", children: [_jsx("span", { className: "forgebook-popover__label", children: each.label }), _jsx(Segmented, { label: each.label, options: each.values.map((value) => ({ value: value.value, label: value.label })), value: switchValueIn(view, each), isDisabled: isCompared, disabledNote: isFixed ? STRINGS.setByStory : undefined, onValueChange: (value) => onViewChange(withSwitch(view, each, value)) })] }));
33
- };
34
- /**
35
- * The View menu: every declared switch the toolbar does not show itself, the background, the style sheets and the
36
- * text size, with a dot on its button when one is changed. The background is a list: its six names are too long for
37
- * a row of segments.
38
- *
39
- * @param props - the view and its setter.
40
- */
41
- const ViewMenu = ({ view, onViewChange, fixed = NOT_FIXED, hasOwnChanges }) => {
42
- const { isOpen, setIsOpen, buttonRef, panelRef, panelId } = usePopover();
43
- const catalogue = useCatalogue();
44
- const { switches } = catalogue;
45
- const backdropId = useId();
46
- const menuSwitches = switches.filter(isMenuSwitch);
47
- return (_jsxs("div", { className: "forgebook-view-menu", children: [_jsxs("button", { ref: buttonRef, type: "button", className: "forgebook-button", "aria-expanded": isOpen, "aria-controls": panelId, onClick: () => setIsOpen(!isOpen), children: [_jsx(Icon, { name: "sliders", size: 14 }), STRINGS.view, hasOwnChanges ? (_jsx("span", { className: "forgebook-dot", role: "img", "aria-label": STRINGS.viewChanged })) : null, _jsx(Icon, { name: "chevronDown", size: 12 })] }), isOpen ? (_jsxs("div", { ref: panelRef, id: panelId, className: "forgebook-popover", role: "dialog", "aria-label": STRINGS.view, children: [menuSwitches.map((each) => (_jsx(SwitchRow, { each: each, view: view, onViewChange: onViewChange, isFixed: fixed.switches[each.id] !== undefined }, each.id))), _jsxs("div", { className: "forgebook-popover__row", children: [_jsx("label", { className: "forgebook-popover__label", htmlFor: backdropId, children: STRINGS.backdrop }), _jsxs("select", { id: backdropId, className: "forgebook-select", value: view.backdrop, disabled: fixed.backdrop !== undefined, title: fixed.backdrop === undefined ? undefined : STRINGS.setByStory, onChange: (event) => onViewChange({ ...view, backdrop: event.currentTarget.value }), children: [_jsx("option", { value: PLAIN_BACKDROP, children: STRINGS.backdropPlain }), catalogue.backdrops.map((backdrop) => (_jsx("option", { value: backdrop.id, children: backdrop.label }, backdrop.id)))] })] }), _jsxs("div", { className: "forgebook-popover__row", children: [_jsx("span", { className: "forgebook-popover__label", children: STRINGS.sheets }), _jsx(Segmented, { label: STRINGS.sheets, options: SHEETS_CHOICES.map((sheets) => ({
48
- value: sheets,
49
- label: STRINGS.sheetChoices[sheets]
50
- })), value: view.sheets, isDisabled: view.compare.includes("sheets"), onValueChange: (sheets) => onViewChange({ ...view, sheets }) })] }), _jsxs("div", { className: "forgebook-popover__row", children: [_jsx("span", { className: "forgebook-popover__label", children: STRINGS.text }), _jsx(Segmented, { label: STRINGS.text, options: catalogue.textSizes.map((text) => ({ value: text, label: STRINGS.textScale(text) })), value: view.text, isDisabled: view.compare.includes("text"), onValueChange: (text) => onViewChange({ ...view, text }) })] }), _jsxs("div", { className: "forgebook-popover__foot", children: [_jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => onViewChange({
51
- ...view,
52
- switches: {
53
- ...view.switches,
54
- ...Object.fromEntries(menuSwitches.map((each) => [each.id, each.default]))
55
- },
56
- backdrop: DEFAULT_VIEW.backdrop,
57
- sheets: DEFAULT_VIEW.sheets,
58
- text: DEFAULT_VIEW.text
59
- }), children: STRINGS.resetView }), _jsx("span", { className: "forgebook-popover__note", children: STRINGS.viewInAddress })] })] })) : null] }));
60
- };
23
+ import { useToolbarLayout } from "./useToolbarLayout.js";
24
+ import { useToolbarOverflow } from "./useToolbarOverflow.js";
25
+ import { ViewMenu } from "./ViewMenu.js";
61
26
  /**
62
- * The Compare menu's choices: Off, the colour scheme at both contrasts when the catalogue has both, each switch of
63
- * the View menu, the text sizes and the style sheets.
27
+ * The Compare menu's choices: Off, the colour scheme at both contrasts when the catalogue has both, each other switch,
28
+ * and the text sizes and the style sheets when the catalogue shows them.
64
29
  *
65
- * @param switches - the catalogue's switches.
30
+ * @param catalogue - the catalogue's switches and controls.
66
31
  */
67
- const compareChoices = (switches) => {
32
+ const compareChoices = (catalogue) => {
33
+ const { switches, ownControls } = catalogue;
68
34
  const scheme = switchWithRole(switches, "colorScheme");
69
35
  const contrast = switchWithRole(switches, "contrast");
70
36
  const schemes = scheme === undefined
@@ -77,9 +43,11 @@ const compareChoices = (switches) => {
77
43
  return [
78
44
  { axes: [], label: STRINGS.compareOff },
79
45
  ...schemes,
80
- ...switches.filter(isMenuSwitch).map((each) => ({ axes: [each.id], label: each.label })),
81
- { axes: ["text"], label: STRINGS.compareText },
82
- { axes: ["sheets"], label: STRINGS.compareSheets }
46
+ ...switches
47
+ .filter((each) => each !== scheme && each !== contrast)
48
+ .map((each) => ({ axes: [each.id], label: each.label })),
49
+ ...(ownControls.includes("text") ? [{ axes: ["text"], label: STRINGS.compareText }] : []),
50
+ ...(ownControls.includes("sheets") ? [{ axes: ["sheets"], label: STRINGS.compareSheets }] : [])
83
51
  ];
84
52
  };
85
53
  /**
@@ -88,10 +56,10 @@ const compareChoices = (switches) => {
88
56
  * @param props - the view, its setter, and whether the page compares at all.
89
57
  */
90
58
  const CompareMenu = ({ view, onViewChange, isDisabled, fixed = NOT_FIXED }) => {
91
- const { isOpen, setIsOpen, buttonRef, panelRef, panelId } = usePopover();
92
- const switches = useCatalogue().switches;
59
+ const { isOpen, isDrawn, setIsOpen, buttonRef, panelRef, panelId } = usePopover();
60
+ const catalogue = useCatalogue();
93
61
  const name = useId();
94
- return (_jsxs("div", { className: "forgebook-view-menu", children: [_jsxs("button", { ref: buttonRef, type: "button", className: "forgebook-button", title: STRINGS.compare, "aria-pressed": isComparing(view), "aria-expanded": isOpen, "aria-controls": panelId, disabled: isDisabled, onClick: () => setIsOpen(!isOpen), children: [_jsx(Icon, { name: "compare", size: 14 }), _jsx("span", { className: "forgebook-button__label", children: STRINGS.compare }), _jsx(Icon, { name: "chevronDown", size: 12 })] }), isOpen ? (_jsx("div", { ref: panelRef, id: panelId, className: "forgebook-popover forgebook-popover--end", role: "dialog", "aria-label": STRINGS.compare, children: _jsxs("fieldset", { className: "forgebook-choices", children: [_jsx("legend", { className: "forgebook-visually-hidden", children: STRINGS.compare }), compareChoices(switches).map((choice) => (_jsxs("label", { className: "forgebook-choice", children: [_jsx("input", { type: "radio", name: name,
62
+ return (_jsxs("div", { className: "forgebook-view-menu", children: [_jsxs("button", { ref: buttonRef, type: "button", className: "forgebook-button", title: STRINGS.compare, "aria-pressed": isComparing(view), "aria-expanded": isOpen, "aria-controls": panelId, disabled: isDisabled, onClick: (event) => setIsOpen(!isOpen, event), children: [_jsx(Icon, { name: "compare", size: 14 }), _jsx("span", { className: "forgebook-button__label", children: STRINGS.compare }), _jsx(Icon, { name: "chevronDown", size: 12 })] }), isDrawn ? (_jsx("div", { ref: panelRef, id: panelId, className: "forgebook-popover forgebook-popover--end", role: "dialog", "aria-label": STRINGS.compare, children: _jsxs("fieldset", { className: "forgebook-choices", children: [_jsx("legend", { className: "forgebook-visually-hidden", children: STRINGS.compare }), compareChoices(catalogue).map((choice) => (_jsxs("label", { className: "forgebook-choice", children: [_jsx("input", { type: "radio", name: name,
95
63
  // a switch the story fixes would draw the same story in every cell
96
64
  disabled: choice.axes.some((axis) => fixed.switches[axis] !== undefined), checked: view.compare.join(",") === choice.axes.join(","), onChange: () => {
97
65
  onViewChange({ ...view, compare: choice.axes });
@@ -110,16 +78,18 @@ export const ShowSidebarButton = ({ onShowSidebar }) => (_jsx("button", { type:
110
78
  * @param props - the view, its setter, the page shown and the story's width.
111
79
  */
112
80
  export const Toolbar = ({ view: ownView, onViewChange: onOwnViewChange, isStoryPage = true, onShowSidebar, shownWidth, fixed = NOT_FIXED }) => {
113
- const { widths, switches } = useCatalogue();
81
+ const layout = useToolbarLayout();
82
+ const catalogue = useCatalogue();
114
83
  // the story's fixed values are shown, and a change of anything else keeps the user's own in the address
115
84
  const view = withFixed(ownView, fixed);
116
85
  const onViewChange = (changed) => onOwnViewChange(withOwnFixed(changed, ownView, fixed));
117
- return (_jsxs("div", { className: "forgebook-toolbar", children: [onShowSidebar === undefined ? null : _jsx(ShowSidebarButton, { onShowSidebar: onShowSidebar }), _jsx(SchemeSwitches, { view: view, onViewChange: onViewChange, isStoryPage: isStoryPage, fixed: fixed }), _jsx("span", { className: "forgebook-toolbar__divider" }), _jsx(ViewMenu, { view: view, onViewChange: onViewChange, fixed: fixed, hasOwnChanges: hasViewChanges(ownView, switches) }), _jsx("span", { className: "forgebook-toolbar__divider" }), _jsxs("div", { className: "forgebook-toolbar__width", children: [_jsx("span", { className: "forgebook-toolbar__icon", title: STRINGS.width, children: _jsx(Icon, { name: "width", size: 14 }) }), _jsx(Segmented, { label: STRINGS.width, isDisabled: (isStoryPage && isComparing(view)) || fixed.width !== undefined, disabledNote: fixed.width === undefined ? undefined : STRINGS.setByStory, options: [
118
- { value: "fill", label: STRINGS.widthFill },
119
- ...widths.map((preset) => ({
120
- value: preset.width,
121
- label: preset.label ?? STRINGS.widthPx(preset.width)
122
- }))
123
- ], value: view.width, onValueChange: (width) => onViewChange({ ...view, width }), after: _jsx(WidthField, { width: view.width, shownWidth: shownWidth, onWidthChange: (width) => onViewChange({ ...view, width }) }) })] }), _jsx("span", { className: "forgebook-toolbar__spacer" }), _jsxs("button", { type: "button", className: "forgebook-button", title: STRINGS.panel, "aria-pressed": view.isPanelOpen, disabled: !isStoryPage, onClick: () => onViewChange({ ...view, isPanelOpen: !view.isPanelOpen }), children: [_jsx(Icon, { name: "panel", size: 14 }), _jsx("span", { className: "forgebook-button__label", children: STRINGS.panel })] }), _jsx(CompareMenu, { view: view, onViewChange: onViewChange, isDisabled: !isStoryPage, fixed: fixed })] }));
86
+ const context = { view, onViewChange, isStoryPage, fixed, shownWidth };
87
+ useControlKeys({ keys: layout.keys, view, onViewChange, fixed, isStoryPage });
88
+ const pinnedRef = useRef(null);
89
+ const pinned = layout.placed.filter((each) => each.isPinned);
90
+ const moved = useToolbarOverflow(pinnedRef, pinned.map((each) => each.control.id));
91
+ // a bar that wraps has room for every pinned control
92
+ const onBar = layout.isWrapped ? pinned : pinned.filter((each) => !moved.includes(each.control.id));
93
+ return (_jsxs("div", { className: layout.isWrapped ? "forgebook-toolbar forgebook-toolbar--wrap" : "forgebook-toolbar", children: [onShowSidebar === undefined ? null : _jsx(ShowSidebarButton, { onShowSidebar: onShowSidebar }), _jsx(ViewMenu, { layout: layout, ownView: ownView, movedIds: layout.isWrapped ? [] : moved, ...context }), onBar.length === 0 ? null : _jsx("span", { className: "forgebook-toolbar__divider" }), _jsx("div", { ref: pinnedRef, className: "forgebook-toolbar__pinned-list", children: onBar.map((each) => (_jsx(PinnedControl, { control: each.control, isHidden: each.isHidden, isChanged: hasViewChanges(ownView, catalogue.switches, [each.control.id]), layout: layout, ...context }, each.control.id))) }), _jsxs("button", { type: "button", className: "forgebook-button", title: STRINGS.panel, "aria-pressed": view.isPanelOpen, disabled: !isStoryPage, onClick: () => onViewChange({ ...view, isPanelOpen: !view.isPanelOpen }), children: [_jsx(Icon, { name: "panel", size: 14 }), _jsx("span", { className: "forgebook-button__label", children: STRINGS.panel })] }), _jsx(CompareMenu, { view: view, onViewChange: onViewChange, isDisabled: !isStoryPage, fixed: fixed })] }));
124
94
  };
125
95
  //# sourceMappingURL=Toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/shell/Toolbar.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,EAAoC,KAAK,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAkB,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAmB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EAIf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,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ACnB,KAAC,aAAa,IAEZ,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EACzE,MAAM,EAAE,MAAM,KACV,OAAO,IALN,IAAI,CAAC,OAAO,CAAC,EAAE,CAMpB,CACH,CAAC,GACE,EACN,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,OAAO,CAAC,KAAK,kBACN,IAAI,CAAC,WAAW,EAC9B,QAAQ,EAAE,CAAC,WAAW,EACtB,OAAO,EAAE,GAAS,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,aAE9E,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,EAAE,GAAI,EAC/B,eAAM,SAAS,EAAC,yBAAyB,YAAE,OAAO,CAAC,KAAK,GAAQ,IACzD,EACT,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,IAC3F,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * One control of the toolbar or the View menu, wherever the person placed it: a switch the catalogue declares, or one
3
+ * of Forgebook's own (the background, the style sheets, the text size, the stage's width), drawn for the toolbar or for
4
+ * a row of the View menu; off while the compare view sets it or the story fixes it.
5
+ *
6
+ * @remarks
7
+ * On the toolbar a control takes its compact form: the colour scheme as segments with icons, a two-value contrast as a
8
+ * toggle, a few short values as segments after the control's name, anything longer as a list after it. In the View
9
+ * menu the row shows the name, so the control is the segments or the list alone.
10
+ *
11
+ * @module
12
+ */
13
+ import { type ReactNode } from "react";
14
+ import type { FixedView } from "../storyGlobals.ts";
15
+ import type { ToolbarControl as Control } from "../toolbarLayout.ts";
16
+ import { type ViewState } from "../viewState.ts";
17
+ /** Where a control is drawn: on the toolbar, or in a row of the View menu. */
18
+ export type ControlForm = "bar" | "row";
19
+ /** What every control reads and sets. */
20
+ export type ControlContext = {
21
+ /** The view shown. */
22
+ readonly view: ViewState;
23
+ /** Called with the changed view. */
24
+ readonly onViewChange: (view: ViewState) => void;
25
+ /** Whether a story's page is shown: the compare view sets values there, never on a component's page. */
26
+ readonly isStoryPage: boolean;
27
+ /** What the shown story fixes of the view. */
28
+ readonly fixed: FixedView;
29
+ /** The width the shown story really has, in CSS px, for the width field; none on a component's page. */
30
+ readonly shownWidth: number | undefined;
31
+ };
32
+ /**
33
+ * A control's name, as its row, its menu and its buttons' names write it.
34
+ *
35
+ * @param control - the control.
36
+ */
37
+ export declare const controlLabel: (control: Control) => string;
38
+ /**
39
+ * One control, drawn for where it sits.
40
+ *
41
+ * @param props - the control, its form, and what every control shares.
42
+ */
43
+ export declare const ToolbarControl: ({ control, form, ...context }: ControlContext & {
44
+ readonly control: Control;
45
+ readonly form: ControlForm;
46
+ }) => ReactNode;
47
+ //# sourceMappingURL=ToolbarControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarControl.d.ts","sourceRoot":"","sources":["../../../src/shell/ToolbarControl.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAoB,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAML,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AAQzB,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AAExC,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG;IAC3B,sBAAsB;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,oCAAoC;IACpC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACjD,wGAAwG;IACxG,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,wGAAwG;IACxG,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC,CAAC;AA+BF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,KAAG,MAC6B,CAAC;AA2P9E;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,+BAI5B,cAAc,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,KAAG,SAK7E,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * One control of the toolbar or the View menu, wherever the person placed it: a switch the catalogue declares, or one
4
+ * of Forgebook's own (the background, the style sheets, the text size, the stage's width), drawn for the toolbar or for
5
+ * a row of the View menu; off while the compare view sets it or the story fixes it.
6
+ *
7
+ * @remarks
8
+ * On the toolbar a control takes its compact form: the colour scheme as segments with icons, a two-value contrast as a
9
+ * toggle, a few short values as segments after the control's name, anything longer as a list after it. In the View
10
+ * menu the row shows the name, so the control is the segments or the list alone.
11
+ *
12
+ * @module
13
+ */
14
+ import { useId } from "react";
15
+ import { switchControl } from "../switches.js";
16
+ import { isComparing, PLAIN_BACKDROP, SHEETS_CHOICES } from "../viewState.js";
17
+ import { useCatalogue } from "./catalogueContext.js";
18
+ import { Icon } from "./icons.js";
19
+ import { Segmented } from "./Segmented.js";
20
+ import { STRINGS } from "./strings.js";
21
+ import { switchValueIn, withSwitch } from "./switchView.js";
22
+ import { WidthField } from "./WidthField.js";
23
+ /** The icon of each scheme a colour scheme switch's values draw in. */
24
+ const SCHEME_ICONS = {
25
+ light: "sun",
26
+ dark: "moon",
27
+ system: "monitor"
28
+ };
29
+ /** The most characters a control's values may take together to sit on the toolbar as segments. */
30
+ const COMPACT_LETTERS = 20;
31
+ /** The most values a control may have to sit on the toolbar as segments. */
32
+ const COMPACT_VALUES = 3;
33
+ /**
34
+ * Whether values fit on the toolbar as segments: few, and short together.
35
+ *
36
+ * @param labels - the values' names.
37
+ */
38
+ const isCompact = (labels) => labels.length <= COMPACT_VALUES && labels.join("").length <= COMPACT_LETTERS;
39
+ /** The name of each of Forgebook's own controls. */
40
+ const OWN_LABELS = {
41
+ backdrop: () => STRINGS.backdrop,
42
+ sheets: () => STRINGS.sheets,
43
+ text: () => STRINGS.text,
44
+ width: () => STRINGS.width
45
+ };
46
+ /**
47
+ * A control's name, as its row, its menu and its buttons' names write it.
48
+ *
49
+ * @param control - the control.
50
+ */
51
+ export const controlLabel = (control) => control.kind === "switch" ? control.switch.label : OWN_LABELS[control.id]();
52
+ /**
53
+ * A choice as a native list: the platform's keys and screen reader support, for values too many or too long for
54
+ * segments.
55
+ *
56
+ * @param props - the choice, and the list's id for its label.
57
+ */
58
+ const ChoiceList = ({ id, label, options, value, onValueChange, isDisabled, disabledNote }) => (_jsx("select", { id: id, className: "forgebook-select", "aria-label": label, value: String(value), disabled: isDisabled, title: isDisabled ? disabledNote : undefined, onChange: (event) => {
59
+ const chosen = options.find((option) => String(option.value) === event.currentTarget.value);
60
+ if (chosen !== undefined)
61
+ onValueChange(chosen.value);
62
+ }, children: options.map((option) => (_jsx("option", { value: String(option.value), children: option.label }, String(option.value)))) }));
63
+ /**
64
+ * A choice in its form: in a row, segments (or a list when asked); on the toolbar, segments after its name when the
65
+ * values are few and short, else a list after its name.
66
+ *
67
+ * @param props - the choice, its form, and whether it is a list wherever it is.
68
+ */
69
+ const FormChoice = ({ form, isList, ...choice }) => {
70
+ const id = useId();
71
+ const isSegments = !isList && (form === "row" || isCompact(choice.options.map((option) => option.label)));
72
+ const drawn = isSegments ? _jsx(Segmented, { ...choice }) : _jsx(ChoiceList, { ...choice, id: id });
73
+ if (form === "row")
74
+ return drawn;
75
+ return (_jsxs("div", { className: "forgebook-toolbar__control", children: [isSegments ? (_jsx("span", { className: "forgebook-toolbar__label", "aria-hidden": "true", children: choice.label })) : (_jsx("label", { className: "forgebook-toolbar__label", htmlFor: id, children: choice.label })), drawn] }));
76
+ };
77
+ /**
78
+ * A switch: the colour scheme with icons and a two-value contrast as a toggle on the toolbar, any other as a choice.
79
+ *
80
+ * @param props - the switch, its form, and what every control shares.
81
+ */
82
+ const SwitchControl = ({ each, form, view, onViewChange, isStoryPage, fixed }) => {
83
+ const isFixed = fixed.switches[each.id] !== undefined;
84
+ const isDisabled = (isStoryPage && view.compare.includes(each.id)) || isFixed;
85
+ const disabledNote = isFixed ? STRINGS.setByStory : undefined;
86
+ const value = switchValueIn(view, each);
87
+ const choose = (chosen) => onViewChange(withSwitch(view, each, chosen));
88
+ const more = each.values.find((option) => option.isMore === true);
89
+ const standard = each.values.find((option) => option.isMore !== true);
90
+ if (form === "bar" && each.role === "colorScheme") {
91
+ return (_jsx(Segmented, { label: each.label, isDisabled: isDisabled, disabledNote: disabledNote, options: each.values.map((option) => ({
92
+ value: option.value,
93
+ label: option.label,
94
+ icon: SCHEME_ICONS[option.scheme ?? "light"]
95
+ })), value: value, onValueChange: choose }));
96
+ }
97
+ if (form === "bar" && each.role === "contrast" && more !== undefined && standard !== undefined) {
98
+ return (_jsxs("button", { type: "button", className: "forgebook-button", title: isFixed ? STRINGS.setByStory : each.label, "aria-pressed": value === more.value, disabled: isDisabled, onClick: () => choose(value === more.value ? standard.value : more.value), children: [_jsx(Icon, { name: "contrast", size: 14 }), _jsx("span", { className: "forgebook-button__label", children: each.label })] }));
99
+ }
100
+ return (_jsx(FormChoice, { form: form, isList: switchControl(each) === "list", label: each.label, options: each.values.map((option) => ({ value: option.value, label: option.label })), value: value, onValueChange: choose, isDisabled: isDisabled, disabledNote: disabledNote }));
101
+ };
102
+ /**
103
+ * The stage's width: its presets as segments, closed by the field that takes any width.
104
+ *
105
+ * @param props - its form and what every control shares.
106
+ */
107
+ const WidthControl = ({ form, view, onViewChange, isStoryPage, fixed, shownWidth }) => {
108
+ const { widths } = useCatalogue();
109
+ const setWidth = (width) => onViewChange({ ...view, width });
110
+ const presets = (_jsx(Segmented, { label: STRINGS.width, isDisabled: (isStoryPage && isComparing(view)) || fixed.width !== undefined, disabledNote: fixed.width === undefined ? undefined : STRINGS.setByStory, options: [
111
+ { value: "fill", label: STRINGS.widthFill },
112
+ ...widths.map((preset) => ({
113
+ value: preset.width,
114
+ label: preset.label ?? STRINGS.widthPx(preset.width)
115
+ }))
116
+ ], value: view.width, onValueChange: setWidth, after: _jsx(WidthField, { width: view.width, shownWidth: shownWidth, onWidthChange: setWidth }) }));
117
+ if (form === "row")
118
+ return presets;
119
+ return (_jsxs("div", { className: "forgebook-toolbar__width", children: [_jsx("span", { className: "forgebook-toolbar__icon", title: STRINGS.width, children: _jsx(Icon, { name: "width", size: 14 }) }), presets] }));
120
+ };
121
+ /**
122
+ * One of Forgebook's own controls.
123
+ *
124
+ * @param props - the control, its form, and what every control shares.
125
+ */
126
+ const OwnControl = ({ id, form, ...context }) => {
127
+ const catalogue = useCatalogue();
128
+ const { view, onViewChange, isStoryPage, fixed } = context;
129
+ if (id === "width")
130
+ return _jsx(WidthControl, { form: form, ...context });
131
+ if (id === "backdrop") {
132
+ return (_jsx(FormChoice, { form: form,
133
+ // its names are too long for segments
134
+ isList: true, label: STRINGS.backdrop, options: [
135
+ { value: PLAIN_BACKDROP, label: STRINGS.backdropPlain },
136
+ ...catalogue.backdrops.map((backdrop) => ({ value: backdrop.id, label: backdrop.label }))
137
+ ], value: view.backdrop, onValueChange: (backdrop) => onViewChange({ ...view, backdrop }), isDisabled: fixed.backdrop !== undefined, disabledNote: fixed.backdrop === undefined ? undefined : STRINGS.setByStory }));
138
+ }
139
+ if (id === "sheets") {
140
+ return (_jsx(FormChoice, { form: form, isList: false, label: STRINGS.sheets, options: SHEETS_CHOICES.map((sheets) => ({ value: sheets, label: STRINGS.sheetChoices[sheets] })), value: view.sheets, onValueChange: (sheets) => onViewChange({ ...view, sheets }), isDisabled: isStoryPage && view.compare.includes("sheets"), disabledNote: undefined }));
141
+ }
142
+ return (_jsx(FormChoice, { form: form, isList: false, label: STRINGS.text, options: catalogue.textSizes.map((text) => ({ value: text, label: STRINGS.textScale(text) })), value: view.text, onValueChange: (text) => onViewChange({ ...view, text }), isDisabled: isStoryPage && view.compare.includes("text"), disabledNote: undefined }));
143
+ };
144
+ /**
145
+ * One control, drawn for where it sits.
146
+ *
147
+ * @param props - the control, its form, and what every control shares.
148
+ */
149
+ export const ToolbarControl = ({ control, form, ...context }) => control.kind === "switch" ? (_jsx(SwitchControl, { each: control.switch, form: form, ...context })) : (_jsx(OwnControl, { id: control.id, form: form, ...context }));
150
+ //# sourceMappingURL=ToolbarControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarControl.js","sourceRoot":"","sources":["../../../src/shell/ToolbarControl.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAoC,KAAK,EAAE,MAAM,OAAO,CAAC;AAIhE,OAAO,EAAE,aAAa,EAAmB,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EAIf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAiB,MAAM,YAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAsB,MAAM,gBAAiB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBA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E,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAC7F,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,aAAa,EAAE,CAAC,IAAY,EAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,EACtE,UAAU,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxD,YAAY,EAAE,SAAS,GACvB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,GAAG,OAAO,EACiE,EAAa,EAAE,CAC1F,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC1B,KAAC,aAAa,IAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,KAAM,OAAO,GAAI,CACjE,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,KAAM,OAAO,GAAI,CACxD,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * "Used in" on a component's page: the other components of its source whose stories use it, each linking to its page
3
+ * with the stories that use it, direct users first; a reader folds it away and their browser keeps that.
4
+ *
5
+ * @remarks
6
+ * The usage is loaded only while the block is open, so a reader who keeps it shut never makes the catalogue read its
7
+ * import graph. Twelve components show at first, then "and N more" shows the rest. A component used only through
8
+ * another (Tree renders Row, Row renders it) says so.
9
+ *
10
+ * @module
11
+ */
12
+ import { type ReactNode } from "react";
13
+ import type { TreeComponent, TreeStory } from "../storyTree.ts";
14
+ import { type UsageIndex } from "../usedIn.ts";
15
+ /** What the block reads and opens. */
16
+ export type UsedInProps = {
17
+ /** The page's component's title. */
18
+ readonly title: string;
19
+ /** Loads the source's usage. */
20
+ readonly load: () => Promise<UsageIndex | string>;
21
+ /** A component of the source, by its title; none when the tree no longer has it. */
22
+ readonly componentOf: (title: string) => TreeComponent | undefined;
23
+ /** The address of a component's page. */
24
+ readonly componentHrefOf: (component: TreeComponent) => string;
25
+ /** Opens a component's page. */
26
+ readonly onOpenComponent: (component: TreeComponent) => void;
27
+ /** The address of a story's page. */
28
+ readonly storyHrefOf: (story: TreeStory) => string;
29
+ /** Opens a story's page. */
30
+ readonly onOpenStory: (story: TreeStory) => void;
31
+ };
32
+ /**
33
+ * The block.
34
+ *
35
+ * @param props - the page's component, the usage's loader and how pages open.
36
+ */
37
+ export declare const UsedIn: ({ title, load, componentOf, ...links }: UsedInProps) => ReactNode;
38
+ //# sourceMappingURL=UsedIn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsedIn.d.ts","sourceRoot":"","sources":["../../../src/shell/UsedIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAmB,KAAK,SAAS,EAAmB,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA+B,KAAK,UAAU,EAAuB,MAAM,cAAc,CAAC;AAOjG,sCAAsC;AACtC,MAAM,MAAM,WAAW,GAAG;IACxB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;IAClD,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IACnE,yCAAyC;IACzC,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,MAAM,CAAC;IAC/D,gCAAgC;IAChC,QAAQ,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7D,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IACnD,4BAA4B;IAC5B,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAClD,CAAC;AAyHF;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,wCAAwC,WAAW,KAAG,SAyC5E,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * "Used in" on a component's page: the other components of its source whose stories use it, each linking to its page
4
+ * with the stories that use it, direct users first; a reader folds it away and their browser keeps that.
5
+ *
6
+ * @remarks
7
+ * The usage is loaded only while the block is open, so a reader who keeps it shut never makes the catalogue read its
8
+ * import graph. Twelve components show at first, then "and N more" shows the rest. A component used only through
9
+ * another (Tree renders Row, Row renders it) says so.
10
+ *
11
+ * @module
12
+ */
13
+ import { useId, useState } from "react";
14
+ import { isUsageIndex, USED_IN_SHOWN } from "../usedIn.js";
15
+ import { Icon } from "./icons.js";
16
+ import { STRINGS } from "./strings.js";
17
+ import { useFold } from "./useFold.js";
18
+ import { useLoaded } from "./useLoaded.js";
19
+ import { useStored } from "./useStored.js";
20
+ /**
21
+ * The using components the tree still has, with their stories.
22
+ *
23
+ * @param users - the using components, by title.
24
+ * @param componentOf - a component by its title.
25
+ */
26
+ const shownUsers = (users, componentOf) => users.flatMap((user) => {
27
+ const component = componentOf(user.title);
28
+ if (component === undefined)
29
+ return [];
30
+ const stories = user.stories.flatMap((exportName) => component.stories.filter((story) => story.exportName === exportName));
31
+ return [{ component, isDirect: user.isDirect, stories }];
32
+ });
33
+ /**
34
+ * A link that opens a page in place, keeping a real address for a new tab.
35
+ *
36
+ * @param props - the address, what opening does, its class and its text.
37
+ */
38
+ const PageLink = ({ href, onOpen, className, children }) => (_jsx("a", { className: className, href: href, onClick: (event) => {
39
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0)
40
+ return;
41
+ event.preventDefault();
42
+ onOpen();
43
+ }, children: children }));
44
+ /**
45
+ * The list of using components, twelve first and the rest on request.
46
+ *
47
+ * @param props - the using components and how their pages open.
48
+ */
49
+ const UserList = ({ users, ...links }) => {
50
+ const [isAll, setIsAll] = useState(false);
51
+ if (users.length === 0)
52
+ return _jsx("p", { className: "forgebook-used-in__note", children: STRINGS.usedInNone });
53
+ const shown = isAll ? users : users.slice(0, USED_IN_SHOWN);
54
+ return (_jsxs(_Fragment, { children: [_jsx("ul", { className: "forgebook-used-in__list", children: shown.map((user) => (_jsxs("li", { className: "forgebook-used-in__user", children: [_jsx(PageLink, { href: links.componentHrefOf(user.component), onOpen: () => links.onOpenComponent(user.component), className: "forgebook-link forgebook-used-in__component", children: user.component.name }), _jsx("span", { className: "forgebook-used-in__note", children: user.isDirect ? STRINGS.usedInStories(user.stories.length) : STRINGS.usedInThrough }), _jsx("span", { className: "forgebook-used-in__stories", children: user.stories.map((story) => (_jsx(PageLink, { href: links.storyHrefOf(story), onOpen: () => links.onOpenStory(story), className: "forgebook-used-in__story", children: story.name }, story.id))) })] }, user.component.title))) }), isAll || users.length <= USED_IN_SHOWN ? null : (_jsx("button", { type: "button", className: "forgebook-text-button", onClick: () => setIsAll(true), children: STRINGS.usedInMore(users.length - USED_IN_SHOWN) }))] }));
55
+ };
56
+ /** What the source's usage answered, as a state. */
57
+ const usageState = (value) => {
58
+ if (typeof value === "string")
59
+ return { status: "error", message: value };
60
+ return isUsageIndex(value)
61
+ ? { status: "ready", value }
62
+ : { status: "error", message: "The usage has an unexpected shape" };
63
+ };
64
+ /**
65
+ * The block.
66
+ *
67
+ * @param props - the page's component, the usage's loader and how pages open.
68
+ */
69
+ export const UsedIn = ({ title, load, componentOf, ...links }) => {
70
+ const [isOpen, setIsOpen] = useStored("used-in", (stored) => stored !== "closed", (open) => (open ? "open" : "closed"));
71
+ const usage = useLoaded(isOpen ? load : undefined, usageState);
72
+ const fold = useFold(isOpen, false);
73
+ const headingId = useId();
74
+ const bodyId = useId();
75
+ return (_jsxs("section", { className: "forgebook-doc__section forgebook-used-in", "aria-labelledby": headingId, children: [_jsx("h2", { id: headingId, className: "forgebook-used-in__heading", children: _jsxs("button", { type: "button", className: "forgebook-used-in__toggle", "aria-expanded": isOpen, "aria-controls": bodyId, onClick: () => setIsOpen(!isOpen), children: [_jsx("span", { className: "forgebook-tree__chevron", "data-open": isOpen ? "" : undefined, children: _jsx(Icon, { name: "chevronRight", size: 14 }) }), STRINGS.usedIn] }) }), _jsx("div", { ref: fold.ref, id: bodyId, className: "forgebook-used-in__body", children: fold.isDrawn ? (_jsxs(_Fragment, { children: [usage.status === "loading" ? (_jsx("p", { className: "forgebook-used-in__note", children: STRINGS.usedInLoading })) : null, usage.status === "error" ? _jsx("p", { className: "forgebook-used-in__note", children: usage.message }) : null, usage.status === "ready" ? (_jsx(UserList, { users: shownUsers(usage.value[title] ?? [], componentOf), ...links })) : null] })) : null })] }));
76
+ };
77
+ //# sourceMappingURL=UsedIn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsedIn.js","sourceRoot":"","sources":["../../../src/shell/UsedIn.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAmC,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAwC,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,YAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAe,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA8B3C;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CACjB,KAAgC,EAChC,WAAyD,EAC5C,EAAE,CAC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AA0C,qBAAkB,SAAS,aACtF,aAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAC,4BAA4B,YACvD,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,2BAA2B,mBACtB,MAAM,mBACN,MAAM,EACrB,OAAO,EAAE,GAAS,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,aAEvC,eAAM,SAAS,EAAC,yBAAyB,eAAY,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAC1E,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAE,EAAE,GAAI,GACjC,EACN,OAAO,CAAC,MAAM,IACR,GACN,EACL,cAAK,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,yBAAyB,YAChE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,8BACG,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAC5B,YAAG,SAAS,EAAC,yBAAyB,YAAE,OAAO,CAAC,aAAa,GAAK,CACnE,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,EAC5F,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAC1B,KAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,KAAM,KAAK,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC,CAAC,CAAC,IAAI,GACJ,IACE,CACX,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The View menu: every control the person did not hide in it, in their order, each with its value, a handle to move
3
+ * it, a pin that puts it on the toolbar and a button that hides it here (a pinned one stays on the toolbar); at its
4
+ * foot the hidden controls, the wrap choice, the values' reset and the toolbar's reset.
5
+ *
6
+ * @remarks
7
+ * The order is set here only, and the toolbar shows the pinned controls in it: nothing is dragged on the toolbar. A row
8
+ * follows the pointer one to one while it is dragged, and the others move out of its way animated; with the keyboard,
9
+ * the handle moves its row with the arrow keys and the new position is announced.
10
+ *
11
+ * @module
12
+ */
13
+ import { type ReactNode } from "react";
14
+ import type { PlacedControl } from "../toolbarLayout.ts";
15
+ import { type ViewState } from "../viewState.ts";
16
+ import { type ControlContext } from "./ToolbarControl.tsx";
17
+ import type { ToolbarLayout } from "./useToolbarLayout.ts";
18
+ /**
19
+ * The ids of the controls whose values the View menu answers for: those not on the toolbar (in it, or hidden, whose
20
+ * value still applies), the stage's width aside, which is not a view setting.
21
+ *
22
+ * @param placed - the placed controls.
23
+ */
24
+ export declare const menuControlIds: (placed: readonly PlacedControl[]) => string[];
25
+ /**
26
+ * The View menu.
27
+ *
28
+ * @param props - the arrangement, whether the person changed one of the menu's values, and what every control shares.
29
+ */
30
+ export declare const ViewMenu: ({ layout, ownView, movedIds, ...context }: ControlContext & {
31
+ readonly layout: ToolbarLayout;
32
+ /** The pinned controls the bar has no room for now: listed here as pinned, shown here until there is room. */
33
+ readonly movedIds: readonly string[];
34
+ /** The person's own view, without what the story fixes: a value the story fixes is not a change of theirs. */
35
+ readonly ownView: ViewState;
36
+ }) => ReactNode;
37
+ //# sourceMappingURL=ViewMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewMenu.d.ts","sourceRoot":"","sources":["../../../src/shell/ViewMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAIL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM/E,OAAO,EAAE,KAAK,cAAc,EAAgC,MAAM,sBAAsB,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW3D;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,aAAa,EAAE,KAAG,MAAM,EAC+B,CAAC;AA4IxG;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,2CAKtB,cAAc,GAAG;IAClB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,8GAA8G;IAC9G,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B,KAAG,SAyMH,CAAC"}