@sheetxl/utils-react 0.7.21 → 0.7.23-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/browser/cjs/C7jPCqFJNiWyD2pr.cjs +1 -0
  2. package/browser/cjs/CyWMySHsu-RvsIGs.cjs +1 -0
  3. package/browser/cjs/DZSvmqU8nRas1uz6.cjs +1 -0
  4. package/browser/cjs/index.cjs +5 -7
  5. package/browser/esm/BlY25fmBdmHNyBqo.mjs +139 -0
  6. package/browser/esm/CQUN3sZz7IrPMYIa.mjs +2171 -0
  7. package/browser/esm/DpI3aVOBON4B0xID.mjs +390 -0
  8. package/browser/esm/index.mjs +6127 -1795
  9. package/licenses/dependencies.txt +246 -39
  10. package/node/esm/B8EaqTMia4qMXy5z.mjs +139 -0
  11. package/node/esm/D9Xo9E4JB3ReeH-J.mjs +2171 -0
  12. package/node/esm/index.mjs +5140 -1763
  13. package/package.json +8 -5
  14. package/types/index.d.ts +2 -1969
  15. package/types/src/animation/AnimationModeContext.d.ts +10 -0
  16. package/types/src/animation/AnimationModeContext.d.ts.map +1 -0
  17. package/types/src/animation/index.d.ts +3 -0
  18. package/types/src/animation/index.d.ts.map +1 -0
  19. package/types/src/animation/useAnimatedMeasure.d.ts +39 -0
  20. package/types/src/animation/useAnimatedMeasure.d.ts.map +1 -0
  21. package/types/src/command/ActivationTracker.d.ts +53 -0
  22. package/types/src/command/ActivationTracker.d.ts.map +1 -0
  23. package/types/src/command/CommandAnchorProvider.d.ts +64 -0
  24. package/types/src/command/CommandAnchorProvider.d.ts.map +1 -0
  25. package/types/src/command/CommandButtonEntryLabel.d.ts +25 -0
  26. package/types/src/command/CommandButtonEntryLabel.d.ts.map +1 -0
  27. package/types/src/command/CommandButtonRegistry.d.ts +159 -0
  28. package/types/src/command/CommandButtonRegistry.d.ts.map +1 -0
  29. package/types/src/command/CommandButtonRegistryContext.d.ts +35 -0
  30. package/types/src/command/CommandButtonRegistryContext.d.ts.map +1 -0
  31. package/types/src/command/CommandCatalog.d.ts +155 -0
  32. package/types/src/command/CommandCatalog.d.ts.map +1 -0
  33. package/types/src/command/CommandCatalogResource.d.ts +7 -0
  34. package/types/src/command/CommandCatalogResource.d.ts.map +1 -0
  35. package/types/src/command/CommandCatalogService.d.ts +61 -0
  36. package/types/src/command/CommandCatalogService.d.ts.map +1 -0
  37. package/types/src/command/CommandChainContext.d.ts +32 -0
  38. package/types/src/command/CommandChainContext.d.ts.map +1 -0
  39. package/types/src/command/CommandFallbackContext.d.ts +30 -0
  40. package/types/src/command/CommandFallbackContext.d.ts.map +1 -0
  41. package/types/src/command/CommandFocusContext.d.ts +21 -0
  42. package/types/src/command/CommandFocusContext.d.ts.map +1 -0
  43. package/types/src/command/CommandRegistry.d.ts +164 -0
  44. package/types/src/command/CommandRegistry.d.ts.map +1 -0
  45. package/types/src/command/CommandRegistryContext.d.ts +16 -0
  46. package/types/src/command/CommandRegistryContext.d.ts.map +1 -0
  47. package/types/src/command/CommandResolver.d.ts +162 -0
  48. package/types/src/command/CommandResolver.d.ts.map +1 -0
  49. package/types/src/command/CommandScope.d.ts +343 -0
  50. package/types/src/command/CommandScope.d.ts.map +1 -0
  51. package/types/src/command/CommandScopeContext.d.ts +205 -0
  52. package/types/src/command/CommandScopeContext.d.ts.map +1 -0
  53. package/types/src/command/FocusActivation.d.ts +140 -0
  54. package/types/src/command/FocusActivation.d.ts.map +1 -0
  55. package/types/src/command/ICommand.d.ts +31 -0
  56. package/types/src/command/ICommand.d.ts.map +1 -0
  57. package/types/src/command/ICommandDefinition.d.ts +82 -0
  58. package/types/src/command/ICommandDefinition.d.ts.map +1 -0
  59. package/types/src/command/KeyBindingDispatcher.d.ts +150 -0
  60. package/types/src/command/KeyBindingDispatcher.d.ts.map +1 -0
  61. package/types/src/command/LayerActivation.d.ts +45 -0
  62. package/types/src/command/LayerActivation.d.ts.map +1 -0
  63. package/types/src/command/Types.d.ts +80 -0
  64. package/types/src/command/Types.d.ts.map +1 -0
  65. package/types/src/command/createResolvedCommand.d.ts +91 -0
  66. package/types/src/command/createResolvedCommand.d.ts.map +1 -0
  67. package/types/src/command/index.d.ts +26 -0
  68. package/types/src/command/index.d.ts.map +1 -0
  69. package/types/src/command/reduceDefinitions.d.ts +33 -0
  70. package/types/src/command/reduceDefinitions.d.ts.map +1 -0
  71. package/types/src/command/useCommands.d.ts +22 -0
  72. package/types/src/command/useCommands.d.ts.map +1 -0
  73. package/types/src/command/useContributeCommands.d.ts +18 -0
  74. package/types/src/command/useContributeCommands.d.ts.map +1 -0
  75. package/types/src/components/FocusKeyNavigation.d.ts +22 -0
  76. package/types/src/components/FocusKeyNavigation.d.ts.map +1 -0
  77. package/types/src/components/ITooltip.d.ts +38 -0
  78. package/types/src/components/ITooltip.d.ts.map +1 -0
  79. package/types/src/components/RoundedTab.d.ts +26 -0
  80. package/types/src/components/RoundedTab.d.ts.map +1 -0
  81. package/types/src/components/index.d.ts +4 -0
  82. package/types/src/components/index.d.ts.map +1 -0
  83. package/types/src/error/ErrorPanel.d.ts +14 -0
  84. package/types/src/error/ErrorPanel.d.ts.map +1 -0
  85. package/types/src/error/ReactErrorBoundary.d.ts +7 -0
  86. package/types/src/error/ReactErrorBoundary.d.ts.map +1 -0
  87. package/types/src/error/UncaughtErrorBoundary.d.ts +5 -0
  88. package/types/src/error/UncaughtErrorBoundary.d.ts.map +1 -0
  89. package/types/src/error/index.d.ts +4 -0
  90. package/types/src/error/index.d.ts.map +1 -0
  91. package/types/src/float/FloatPanel.d.ts +57 -0
  92. package/types/src/float/FloatPanel.d.ts.map +1 -0
  93. package/types/src/float/FloatPopper.d.ts +85 -0
  94. package/types/src/float/FloatPopper.d.ts.map +1 -0
  95. package/types/src/float/FloatPopup.d.ts +19 -0
  96. package/types/src/float/FloatPopup.d.ts.map +1 -0
  97. package/types/src/float/FloatProvider.d.ts +60 -0
  98. package/types/src/float/FloatProvider.d.ts.map +1 -0
  99. package/types/src/float/FloatStackContext.d.ts +25 -0
  100. package/types/src/float/FloatStackContext.d.ts.map +1 -0
  101. package/types/src/float/FloatTooltip.d.ts +22 -0
  102. package/types/src/float/FloatTooltip.d.ts.map +1 -0
  103. package/types/src/float/FloatUtils.d.ts +55 -0
  104. package/types/src/float/FloatUtils.d.ts.map +1 -0
  105. package/types/src/float/_FloatUtils.d.ts +51 -0
  106. package/types/src/float/_FloatUtils.d.ts.map +1 -0
  107. package/types/src/float/index.d.ts +9 -0
  108. package/types/src/float/index.d.ts.map +1 -0
  109. package/types/src/float/useFloatStack.d.ts +92 -0
  110. package/types/src/float/useFloatStack.d.ts.map +1 -0
  111. package/types/src/hooks/LanguageState.d.ts +15 -0
  112. package/types/src/hooks/LanguageState.d.ts.map +1 -0
  113. package/types/src/hooks/index.d.ts +19 -0
  114. package/types/src/hooks/index.d.ts.map +1 -0
  115. package/types/src/hooks/useBoundSyncExternalStore.d.ts +23 -0
  116. package/types/src/hooks/useBoundSyncExternalStore.d.ts.map +1 -0
  117. package/types/src/hooks/useCallbackRef.d.ts +11 -0
  118. package/types/src/hooks/useCallbackRef.d.ts.map +1 -0
  119. package/types/src/hooks/useDevicePixelRatio.d.ts +37 -0
  120. package/types/src/hooks/useDevicePixelRatio.d.ts.map +1 -0
  121. package/types/src/hooks/useEditMode.d.ts +66 -0
  122. package/types/src/hooks/useEditMode.d.ts.map +1 -0
  123. package/types/src/hooks/useGlobalClipboard.d.ts +7 -0
  124. package/types/src/hooks/useGlobalClipboard.d.ts.map +1 -0
  125. package/types/src/hooks/useId.d.ts +9 -0
  126. package/types/src/hooks/useId.d.ts.map +1 -0
  127. package/types/src/hooks/useImperativeElement.d.ts +3 -0
  128. package/types/src/hooks/useImperativeElement.d.ts.map +1 -0
  129. package/types/src/hooks/useLanguage.d.ts +13 -0
  130. package/types/src/hooks/useLanguage.d.ts.map +1 -0
  131. package/types/src/hooks/useMouseDownAndHoldListener.d.ts +13 -0
  132. package/types/src/hooks/useMouseDownAndHoldListener.d.ts.map +1 -0
  133. package/types/src/hooks/useNotifier.d.ts +330 -0
  134. package/types/src/hooks/useNotifier.d.ts.map +1 -0
  135. package/types/src/hooks/useOnClickOrFocusAway.d.ts +8 -0
  136. package/types/src/hooks/useOnClickOrFocusAway.d.ts.map +1 -0
  137. package/types/src/hooks/useOptionalBoundSyncExternalStore.d.ts +20 -0
  138. package/types/src/hooks/useOptionalBoundSyncExternalStore.d.ts.map +1 -0
  139. package/types/src/hooks/useOptionalSyncExternalStore.d.ts +18 -0
  140. package/types/src/hooks/useOptionalSyncExternalStore.d.ts.map +1 -0
  141. package/types/src/hooks/useSynchronizedPointerHandler.d.ts +54 -0
  142. package/types/src/hooks/useSynchronizedPointerHandler.d.ts.map +1 -0
  143. package/types/src/hooks/useTextareaCaretRect.d.ts +85 -0
  144. package/types/src/hooks/useTextareaCaretRect.d.ts.map +1 -0
  145. package/types/src/hooks/useTraceUpdate.d.ts +2 -0
  146. package/types/src/hooks/useTraceUpdate.d.ts.map +1 -0
  147. package/types/src/hooks/useTranslator.d.ts +32 -0
  148. package/types/src/hooks/useTranslator.d.ts.map +1 -0
  149. package/types/src/icons/DynamicIcon.d.ts +17 -0
  150. package/types/src/icons/DynamicIcon.d.ts.map +1 -0
  151. package/types/src/icons/DynamicIconService.d.ts +39 -0
  152. package/types/src/icons/DynamicIconService.d.ts.map +1 -0
  153. package/types/src/icons/ErrorIcon.d.ts +6 -0
  154. package/types/src/icons/ErrorIcon.d.ts.map +1 -0
  155. package/types/src/icons/Types.d.ts +81 -0
  156. package/types/src/icons/Types.d.ts.map +1 -0
  157. package/types/src/icons/WalkingIcon.d.ts +27 -0
  158. package/types/src/icons/WalkingIcon.d.ts.map +1 -0
  159. package/types/src/icons/_Utils.d.ts +3 -0
  160. package/types/src/icons/_Utils.d.ts.map +1 -0
  161. package/types/src/icons/index.d.ts +5 -0
  162. package/types/src/icons/index.d.ts.map +1 -0
  163. package/types/src/icons/packs/Base.d.ts +4 -0
  164. package/types/src/icons/packs/Base.d.ts.map +1 -0
  165. package/types/src/icons/packs/Conditional.d.ts +4 -0
  166. package/types/src/icons/packs/Conditional.d.ts.map +1 -0
  167. package/types/src/index.d.ts +18 -0
  168. package/types/src/index.d.ts.map +1 -0
  169. package/types/src/loading/LoadingPanel.d.ts +31 -0
  170. package/types/src/loading/LoadingPanel.d.ts.map +1 -0
  171. package/types/src/loading/index.d.ts +2 -0
  172. package/types/src/loading/index.d.ts.map +1 -0
  173. package/types/src/persistence/InMemoryStore.d.ts +12 -0
  174. package/types/src/persistence/InMemoryStore.d.ts.map +1 -0
  175. package/types/src/persistence/LocalStorageStore.d.ts +15 -0
  176. package/types/src/persistence/LocalStorageStore.d.ts.map +1 -0
  177. package/types/src/persistence/PersistenceStateProvider.d.ts +3 -0
  178. package/types/src/persistence/PersistenceStateProvider.d.ts.map +1 -0
  179. package/types/src/persistence/Types.d.ts +95 -0
  180. package/types/src/persistence/Types.d.ts.map +1 -0
  181. package/types/src/persistence/_Context.d.ts +9 -0
  182. package/types/src/persistence/_Context.d.ts.map +1 -0
  183. package/types/src/persistence/index.d.ts +6 -0
  184. package/types/src/persistence/index.d.ts.map +1 -0
  185. package/types/src/persistence/usePersistenceState.d.ts +33 -0
  186. package/types/src/persistence/usePersistenceState.d.ts.map +1 -0
  187. package/types/src/react-resizable/Resizable.d.ts +30 -0
  188. package/types/src/react-resizable/Resizable.d.ts.map +1 -0
  189. package/types/src/react-resizable/ResizableBox.d.ts +18 -0
  190. package/types/src/react-resizable/ResizableBox.d.ts.map +1 -0
  191. package/types/src/react-resizable/index.d.ts +11 -0
  192. package/types/src/react-resizable/index.d.ts.map +1 -0
  193. package/types/src/react-resizable/propTypes.d.ts +56 -0
  194. package/types/src/react-resizable/propTypes.d.ts.map +1 -0
  195. package/types/src/react-resizable/utils.d.ts +3 -0
  196. package/types/src/react-resizable/utils.d.ts.map +1 -0
  197. package/types/src/scroll/AxisViewport.d.ts +73 -0
  198. package/types/src/scroll/AxisViewport.d.ts.map +1 -0
  199. package/types/src/scroll/IScrollPane.d.ts +63 -0
  200. package/types/src/scroll/IScrollPane.d.ts.map +1 -0
  201. package/types/src/scroll/IScrollbar.d.ts +94 -0
  202. package/types/src/scroll/IScrollbar.d.ts.map +1 -0
  203. package/types/src/scroll/NativeScrollbar.d.ts +7 -0
  204. package/types/src/scroll/NativeScrollbar.d.ts.map +1 -0
  205. package/types/src/scroll/ScrollButton.d.ts +29 -0
  206. package/types/src/scroll/ScrollButton.d.ts.map +1 -0
  207. package/types/src/scroll/ScrollPane.d.ts +4 -0
  208. package/types/src/scroll/ScrollPane.d.ts.map +1 -0
  209. package/types/src/scroll/Scrollbar.d.ts +4 -0
  210. package/types/src/scroll/Scrollbar.d.ts.map +1 -0
  211. package/types/src/scroll/TouchThumbContext.d.ts +93 -0
  212. package/types/src/scroll/TouchThumbContext.d.ts.map +1 -0
  213. package/types/src/scroll/TouchThumbHandle.d.ts +64 -0
  214. package/types/src/scroll/TouchThumbHandle.d.ts.map +1 -0
  215. package/types/src/scroll/TrackDrag.d.ts +107 -0
  216. package/types/src/scroll/TrackDrag.d.ts.map +1 -0
  217. package/types/src/scroll/Utils.d.ts +8 -0
  218. package/types/src/scroll/Utils.d.ts.map +1 -0
  219. package/types/src/scroll/Viewport.d.ts +285 -0
  220. package/types/src/scroll/Viewport.d.ts.map +1 -0
  221. package/types/src/scroll/VirtualScrollbar.d.ts +49 -0
  222. package/types/src/scroll/VirtualScrollbar.d.ts.map +1 -0
  223. package/types/src/scroll/index.d.ts +14 -0
  224. package/types/src/scroll/index.d.ts.map +1 -0
  225. package/types/src/scroll/scrollbarTheming.d.ts +27 -0
  226. package/types/src/scroll/scrollbarTheming.d.ts.map +1 -0
  227. package/types/src/scroll/useWheelScroll.d.ts +27 -0
  228. package/types/src/scroll/useWheelScroll.d.ts.map +1 -0
  229. package/types/src/scroller/Scroller.d.ts +260 -0
  230. package/types/src/scroller/Scroller.d.ts.map +1 -0
  231. package/types/src/scroller/animate.d.ts +30 -0
  232. package/types/src/scroller/animate.d.ts.map +1 -0
  233. package/types/src/scroller/index.d.ts +2 -0
  234. package/types/src/scroller/index.d.ts.map +1 -0
  235. package/types/src/singletonHook/components/SingleItemContainer.d.ts +6 -0
  236. package/types/src/singletonHook/components/SingleItemContainer.d.ts.map +1 -0
  237. package/types/src/singletonHook/components/SingletonHooksContainer.d.ts +7 -0
  238. package/types/src/singletonHook/components/SingletonHooksContainer.d.ts.map +1 -0
  239. package/types/src/singletonHook/index.d.ts +11 -0
  240. package/types/src/singletonHook/index.d.ts.map +1 -0
  241. package/types/src/singletonHook/singletonHook.d.ts +6 -0
  242. package/types/src/singletonHook/singletonHook.d.ts.map +1 -0
  243. package/types/src/singletonHook/utils/env.d.ts +4 -0
  244. package/types/src/singletonHook/utils/env.d.ts.map +1 -0
  245. package/types/src/singletonHook/utils/env.native.d.ts +1 -0
  246. package/types/src/singletonHook/utils/env.native.d.ts.map +1 -0
  247. package/types/src/singletonHook/utils/warning.d.ts +2 -0
  248. package/types/src/singletonHook/utils/warning.d.ts.map +1 -0
  249. package/types/src/splitPane/SplitPane.d.ts +91 -0
  250. package/types/src/splitPane/SplitPane.d.ts.map +1 -0
  251. package/types/src/splitPane/SplitPaneResizer.d.ts +11 -0
  252. package/types/src/splitPane/SplitPaneResizer.d.ts.map +1 -0
  253. package/types/src/splitPane/index.d.ts +3 -0
  254. package/types/src/splitPane/index.d.ts.map +1 -0
  255. package/types/src/theme/TokenTheme.d.ts +196 -0
  256. package/types/src/theme/TokenTheme.d.ts.map +1 -0
  257. package/types/src/theme/TokenThemeProvider.d.ts +97 -0
  258. package/types/src/theme/TokenThemeProvider.d.ts.map +1 -0
  259. package/types/src/theme/buildThemeCSS.d.ts +54 -0
  260. package/types/src/theme/buildThemeCSS.d.ts.map +1 -0
  261. package/types/src/theme/createThemeVars.d.ts +15 -0
  262. package/types/src/theme/createThemeVars.d.ts.map +1 -0
  263. package/types/src/theme/defaultTheme.d.ts +15 -0
  264. package/types/src/theme/defaultTheme.d.ts.map +1 -0
  265. package/types/src/theme/index.d.ts +9 -0
  266. package/types/src/theme/index.d.ts.map +1 -0
  267. package/types/src/theme/resolveTokens.d.ts +21 -0
  268. package/types/src/theme/resolveTokens.d.ts.map +1 -0
  269. package/types/src/theme/themeAttrs.d.ts +32 -0
  270. package/types/src/theme/themeAttrs.d.ts.map +1 -0
  271. package/types/src/theme/useResolvedThemeMode.d.ts +17 -0
  272. package/types/src/theme/useResolvedThemeMode.d.ts.map +1 -0
  273. package/types/src/types/Types.d.ts +71 -0
  274. package/types/src/types/Types.d.ts.map +1 -0
  275. package/types/src/types/index.d.ts +2 -0
  276. package/types/src/types/index.d.ts.map +1 -0
  277. package/types/src/utils/FullScreenPortal.d.ts +6 -0
  278. package/types/src/utils/FullScreenPortal.d.ts.map +1 -0
  279. package/types/src/utils/PinchZoom.d.ts +3 -0
  280. package/types/src/utils/PinchZoom.d.ts.map +1 -0
  281. package/types/src/utils/ReactUtils.d.ts +134 -0
  282. package/types/src/utils/ReactUtils.d.ts.map +1 -0
  283. package/types/src/utils/index.d.ts +4 -0
  284. package/types/src/utils/index.d.ts.map +1 -0
  285. package/types/src/utils/useFullScreen.d.ts +47 -0
  286. package/types/src/utils/useFullScreen.d.ts.map +1 -0
  287. package/browser/cjs/BA9O-cekHrH5qrOm.cjs +0 -6
  288. package/browser/esm/DTq8GPy7DLZm2D6S.mjs +0 -12
  289. package/node/assets/style.css +0 -1
  290. package/node/esm/4mSSJ5fhNdMhHCE6.mjs +0 -12
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export interface AnimationMode {
3
+ mode: 'idle' | 'interrupted';
4
+ interrupt: () => void;
5
+ }
6
+ export declare function useAnimationMode(): AnimationMode;
7
+ export declare function AnimationModeProvider({ children }: {
8
+ children?: ReactNode;
9
+ }): import("react").JSX.Element;
10
+ //# sourceMappingURL=AnimationModeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimationModeContext.d.ts","sourceRoot":"","sources":["../../../../src/animation/AnimationModeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBjG,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAOD,wBAAgB,gBAAgB,kBAE/B;AAGD,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAoB3E"}
@@ -0,0 +1,3 @@
1
+ export * from './AnimationModeContext';
2
+ export * from './useAnimatedMeasure';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,39 @@
1
+ declare type UseMeasureRect = Pick<DOMRectReadOnly, 'x' | 'y' | 'top' | 'left' | 'right' | 'bottom' | 'height' | 'width'>;
2
+ export interface UseAnimatedMeasureOptions {
3
+ /** Threshold in pixels for detecting bounds changes (default: 0.1) */
4
+ threshold?: number;
5
+ /** Number of frames without movement to consider animation stopped (default: 3) */
6
+ stillnessThreshold?: number;
7
+ /** Maximum parent elements to monitor for animations (default: 50) */
8
+ maxHierarchyDepth?: number;
9
+ }
10
+ /**
11
+ * Enhanced version of useMeasure that provides real-time measurements during animations.
12
+ *
13
+ * Use for components that don't sit within the component hierarchy but could be animated.
14
+ * (for examples portal elements; menus, tooltips)
15
+ *
16
+ * Unlike the standard useMeasure hook which relies on ResizeObserver (which doesn't trigger
17
+ * during CSS transform animations), this hook actively monitors element bounds using
18
+ * requestAnimationFrame and CSS animation/transition events.
19
+ *
20
+ * @remarks
21
+ * - Monitors all bounds properties: x, y, width, height, top, left, right, bottom
22
+ * - Detects animations on the element itself and all parent elements
23
+ * - Uses both position polling and event-based detection for optimal performance
24
+ * - Automatically stops monitoring when animations complete to save resources
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const [ref, bounds] = useAnimatedMeasure<HTMLDivElement>();
29
+ *
30
+ * return (
31
+ * <div ref={ref} style={{ transform: 'translateX(100px)' }}>
32
+ * Position: {bounds?.x}, {bounds?.y}
33
+ * </div>
34
+ * );
35
+ * ```
36
+ */
37
+ export declare function useAnimatedMeasure<T extends Element = HTMLDivElement>(options?: UseAnimatedMeasureOptions): readonly [(node: T | null) => void, UseMeasureRect | null];
38
+ export {};
39
+ //# sourceMappingURL=useAnimatedMeasure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedMeasure.d.ts","sourceRoot":"","sources":["../../../../src/animation/useAnimatedMeasure.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;AAkB1H,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,OAAO,GAAG,cAAc,EACnE,OAAO,GAAE,yBAA8B,oBAcA,CAAC,GAAG,IAAI,kCAuHhD"}
@@ -0,0 +1,53 @@
1
+ import { RemoveListener } from '@sheetxl/utils';
2
+ import { CommandScope } from './CommandScope';
3
+ /**
4
+ * Produces "the current anchor" (resolution leaf) for a {@link CommandResolver} and notifies
5
+ * when it changes. The activation strategy, pluggable per container: focus-driven
6
+ * (`FocusActivation`, region-scoped) or code-driven ({@link ManualActivation}).
7
+ */
8
+ export interface ActivationTracker {
9
+ /** The current anchor scope, or `null` before any activation. */
10
+ getAnchor(): CommandScope | null;
11
+ /** Fires when the anchor changes — and, for region trackers, when the region attaches/detaches. */
12
+ subscribe(listener: () => void): RemoveListener;
13
+ /**
14
+ * The DOM region this tracker watches, if any (e.g. a `FocusActivation`'s attached root), or
15
+ * `null`/absent for code-driven trackers ({@link ManualActivation}). A {@link CommandResolver}
16
+ * uses it to attach keystroke handling **on the same element the anchor follows** — keybinds
17
+ * in lockstep with focus, no separate provider. `subscribe` fires when this changes.
18
+ */
19
+ getElement?(): Element | null;
20
+ /**
21
+ * Region trackers (e.g. `FocusActivation`) implement this: start watching `rootElement` as the
22
+ * region of interest, returning the detach. A `CommandAnchorProvider` in `'synthetic'`
23
+ * key-delivery mode bounds its tracker to the seam element through this — the anchor follows
24
+ * focus within exactly the subtree whose unconsumed keys the seam delivers. Absent on
25
+ * code-driven trackers ({@link ManualActivation}).
26
+ */
27
+ attach?(rootElement: Element): RemoveListener;
28
+ }
29
+ /**
30
+ * A code-driven {@link ActivationTracker}: the anchor is set imperatively (e.g. a context
31
+ * menu's clicked-target snapshot on open). Not focus-driven.
32
+ */
33
+ export declare class ManualActivation implements ActivationTracker {
34
+ protected _current: CommandScope | null;
35
+ protected _listeners: Set<() => void>;
36
+ constructor(initial?: CommandScope | null);
37
+ getAnchor(): CommandScope | null;
38
+ setAnchor(scope: CommandScope | null): void;
39
+ subscribe(listener: () => void): RemoveListener;
40
+ }
41
+ /**
42
+ * A **fixed-anchor** {@link ActivationTracker}: always reports the same scope and never notifies. The
43
+ * degenerate "region with no layers" — useful to hand a plain static scope to an API that wants a tracker,
44
+ * so it reads the same as a {@link LayerActivation} stack. (A bare `CommandScope` region does not need one:
45
+ * `attachElement` stores it directly and `resolveAnchorSource` returns it as-is.)
46
+ */
47
+ export declare class ConstantActivation implements ActivationTracker {
48
+ protected readonly _scope: CommandScope | null;
49
+ constructor(_scope: CommandScope | null);
50
+ getAnchor(): CommandScope | null;
51
+ subscribe(): RemoveListener;
52
+ }
53
+ //# sourceMappingURL=ActivationTracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActivationTracker.d.ts","sourceRoot":"","sources":["../../../../src/command/ActivationTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,SAAS,IAAI,YAAY,GAAG,IAAI,CAAC;IACjC,mGAAmG;IACnG,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,cAAc,CAAC;IAChD;;;;;OAKG;IACH,UAAU,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,WAAW,EAAE,OAAO,GAAG,cAAc,CAAC;CAC/C;AAED;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,UAAU,YAAiB,IAAI,EAAI;gBAEjC,OAAO,GAAE,YAAY,GAAG,IAAW;IAI/C,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI;IAM3C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,cAAc;CAIhD;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,iBAAiB;IAC9C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;gBAA3B,MAAM,EAAE,YAAY,GAAG,IAAI;IAC1D,SAAS,IAAI,YAAY,GAAG,IAAI;IAChC,SAAS,IAAI,cAAc;CAC5B"}
@@ -0,0 +1,64 @@
1
+ import { ReactNode } from 'react';
2
+ import { CommandResolver } from './CommandResolver';
3
+ import { CommandScope } from './CommandScope';
4
+ import { ActivationTracker } from './ActivationTracker';
5
+ export declare const CommandResolverContext: import('react').Context<CommandResolver | null>;
6
+ export declare function useCommandResolver(): CommandResolver | null;
7
+ export interface CommandAnchorProviderProps {
8
+ /** This container's activation — its anchor source (region-scoped focus, or manual). */
9
+ tracker: ActivationTracker;
10
+ /** Display cadence (ms); coalesces anchor + contribution changes for this container. */
11
+ debounce?: number;
12
+ /**
13
+ * Keystroke delivery for this container's resolver:
14
+ * - `true` (default): auto-attach **native** keystroke handling to the tracker's region element
15
+ * ({@link CommandResolverOptions.keyBindings}).
16
+ * - `false`: the host delivers keys to the resolver's `dispatchKey` itself — e.g. a grid routing
17
+ * them through its synthetic Stage responder chain, or a toolbar-only container with no
18
+ * keystroke surface at all.
19
+ * - `'synthetic'`: this provider renders the delivery seam itself — a layout-inert
20
+ * (`display:contents`) wrapper whose **synthetic** `onKeyDown` feeds `dispatchKey`. In the one
21
+ * React keystroke bubble it is the outermost handler — the container's "dispatcher of last
22
+ * resort" — so an inner layer's synthetic `stopPropagation` pre-empts it (a native ancestor
23
+ * listener would fire ahead of every React handler and could not be pre-empted; that ordering
24
+ * bug is why this mode exists). The tracker (if it implements
25
+ * {@link ActivationTracker.attach}) is bounded to the same element, keeping the anchor's
26
+ * focus region and the key-delivery region identical.
27
+ */
28
+ keyBindings?: boolean | 'synthetic';
29
+ /**
30
+ * Bound this container's **focus walk** to an element: the tracker only follows focus that lands inside
31
+ * it, so focus elsewhere leaves the anchor where it was (a script pane's toolbar stays live while the
32
+ * user clicks into the grid). The consumer-side counterpart of a scope's
33
+ * {@link CommandScopeProviderProps.elementRef} — same element, different job: that one decides which
34
+ * *commands* a keystroke may reach, this one decides where the *anchor* may move.
35
+ *
36
+ * `'synthetic'` delivery bounds the tracker to its own key seam when this is omitted, keeping the
37
+ * anchor's region and the key-delivery region identical.
38
+ */
39
+ elementRef?: {
40
+ readonly current: Element | null;
41
+ };
42
+ /**
43
+ * The bounded-walk **terminal** — this container's topmost node (e.g. the `sheet` scope for a
44
+ * context menu). Omit ⇒ walk to the true tree root (the studio default). See
45
+ * {@link CommandResolverOptions.root}.
46
+ */
47
+ root?: CommandScope;
48
+ children: ReactNode;
49
+ }
50
+ /**
51
+ * Per-container provider: binds the ambient registry scope to this container's
52
+ * {@link ActivationTracker} as a {@link CommandResolver}, and provides it to descendants.
53
+ * Each container (main toolbar / scripting toolbar / context menu) wraps its own → different
54
+ * anchors on screen at once. Recreates + disposes the resolver when scope/tracker/debounce/root
55
+ * change.
56
+ */
57
+ export declare function CommandAnchorProvider({ tracker, debounce, keyBindings, root, elementRef, children }: CommandAnchorProviderProps): ReactNode;
58
+ /**
59
+ * An execute-by-key bound to the current container's resolver (anchor included). For
60
+ * imperative dispatch — a "fire" button, a keystroke — where you don't hold a resolved
61
+ * command. A rendered button just calls `cmd.execute()` instead.
62
+ */
63
+ export declare function useCommandExecute(): (commandKey: string, args?: any) => Promise<boolean>;
64
+ //# sourceMappingURL=CommandAnchorProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandAnchorProvider.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandAnchorProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3G,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,eAAO,MAAM,sBAAsB,iDAA8C,CAAC;AAElF,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,MAAM,WAAW,0BAA0B;IACzC,wFAAwF;IACxF,OAAO,EAAE,iBAAiB,CAAC;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IACpC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAyC3I;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,CAAC,CAMxF"}
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ import { CommandButtonEntry } from './CommandButtonRegistry';
3
+ /**
4
+ * The registered {@link CommandButtonEntry} for `key` (context registry, singleton fallback),
5
+ * re-rendering the caller on a language switch (via {@link useCommandButtonRegistry}'s
6
+ * subscription) so entry chrome read during render never goes stale.
7
+ */
8
+ export declare function useCommandButtonEntry(key: string): CommandButtonEntry | null;
9
+ export interface CommandButtonEntryLabelProps {
10
+ /** The registered entry whose label to render. */
11
+ entryKey: string;
12
+ /** The panel/surface the label renders in (the entry's `getLabel` scope), if any. */
13
+ groupKey?: string;
14
+ /** Rendered when the entry is not registered (or has no label). */
15
+ fallback?: React.ReactNode;
16
+ }
17
+ /**
18
+ * A registered entry's **label**, self-resolving and language-aware — the text-only counterpart
19
+ * of `CommandButton` for chrome that needs JUST the label (ribbon tabs, menu headers). Give a
20
+ * surface `<CommandButtonEntryLabel entryKey="homeToolbar"/>` instead of a plucked string: the
21
+ * element resolves at ITS OWN render through the (translated) entry and re-renders itself on a
22
+ * language switch, so containers can memoize their structure without baking strings.
23
+ */
24
+ export declare const CommandButtonEntryLabel: React.MemoExoticComponent<(props: CommandButtonEntryLabelProps) => React.JSX.Element>;
25
+ //# sourceMappingURL=CommandButtonEntryLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandButtonEntryLabel.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandButtonEntryLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAE5E;AAED,MAAM,WAAW,4BAA4B;IAC3C,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,oCAAgB,4BAA4B,uBAI9E,CAAC"}
@@ -0,0 +1,159 @@
1
+ import { default as React } from 'react';
2
+ import { CommandButtonProps } from './Types';
3
+ /**
4
+ * The one thing the command-button registry deals in - a **button or a panel** (group). One shape,
5
+ * whether it becomes a plain button, a split button, a popup, or a fully custom control.
6
+ *
7
+ * There is **one reference concept: `key`.** A registered entry *has* a `key` (its id); a member
8
+ * *is* a `key` - a bare string, resolved **registry-first** against that same registry (a registered
9
+ * entry if one exists, otherwise a plain command). The same shape also appears **keyless and inline**
10
+ * as a member (`{ key, state, render, … }` = a reference + overrides, or a keyless nested panel). Keys
11
+ * are a **single namespace**: an entry key must not shadow a command key, so a reference always means
12
+ * exactly one thing. What an entry *becomes*:
13
+ *
14
+ * - `members` - a list; **its presence makes the entry a panel (group)** ({@link isCommandGroup}).
15
+ * - `defaultKey` - a split button's quick action (the command its primary half runs).
16
+ * - `render` - a fully custom control (the escape hatch); omit for the default button / split / popup.
17
+ */
18
+ export interface CommandButtonEntry<STATE = any, CONTEXT = any> {
19
+ /**
20
+ * The **one reference**. On a *registered* entry it is its id (how it is referenced / injected /
21
+ * replaced; {@link ICommandButtonRegistry.register} requires it). On a *member* it is what to
22
+ * resolve, registry-first (a registered entry, else a plain command) - so a bare-string member is
23
+ * shorthand for `{ key }`.
24
+ */
25
+ readonly key?: string;
26
+ /**
27
+ * A split button's **quick action** - the command key its primary ("quick") half runs, next to the
28
+ * `members` dropdown. A command-registry key (distinct from this entry's own `key`); omit for a
29
+ * plain popup (head just opens the list).
30
+ */
31
+ readonly defaultKey?: string;
32
+ /**
33
+ * Render the entry's **label as visible content** on a toolbar button (in addition to any icon /
34
+ * split-toggle checkmark), not just as its tooltip. Toolbar buttons are icon-only by default; set
35
+ * this for the deliberate text buttons (e.g. `Gridlines`, `Workbook View`) and the icon+text ones
36
+ * (e.g. `Text to Columns`). No effect on menu items, which always show their label.
37
+ * @defaultValue false
38
+ */
39
+ readonly showLabel?: boolean;
40
+ /**
41
+ * The ordered list members - each a **key** (`string`, resolved registry-first), a **divider**
42
+ * (`'-'` / `null`), or an **inline** entry. Its presence makes this entry a panel (group).
43
+ */
44
+ readonly members?: (string | '-' | null | CommandButtonEntry)[];
45
+ /** Optional state passed to the resolved command on execute (parameterizes a reused command). */
46
+ readonly state?: STATE;
47
+ /**
48
+ * Optional custom renderer - the **escape hatch**. **Omit** for the default control (a button, a
49
+ * split button, or a popup, per the facets above). **Provide** to fully render it yourself - e.g. a
50
+ * host renders the same command its own way (the studio opens the Monaco pane, a VSCode host a native
51
+ * control), or a toggle group whose head reflects the active member. A **panel** entry's `render`
52
+ * receives the entry's own key as `groupKey` (so it can resolve its members); a **leaf** entry's
53
+ * `render` receives the resolved leaf button props. May render `null` internally to self-hide.
54
+ */
55
+ readonly render?: (props: CommandButtonProps<STATE, CONTEXT>, groupKey?: string) => React.ReactElement;
56
+ /** Label (usually the button / menu text). `groupKey` = the panel it renders in (rarely needed). */
57
+ readonly getLabel?: (groupKey?: string) => React.ReactElement | string;
58
+ /** Description (usually the tooltip). */
59
+ readonly getDescription?: (groupKey?: string) => React.ReactElement | string;
60
+ /**
61
+ * Icon. A string resolves via `DynamicIcon`. Return `null` to render **no** icon (a deliberate
62
+ * blank); return `undefined` - or omit the getter - to let the resolved command supply its own.
63
+ */
64
+ readonly getIcon?: (groupKey?: string) => React.ReactElement | string | null | undefined;
65
+ /**
66
+ * Destinations this entry injects itself into, keyed by destination panel key - each value a
67
+ * {@link Placement} describing *where* in that panel this entry lands. Woven into the destination by
68
+ * {@link ICommandButtonRegistry.resolveMembers}.
69
+ */
70
+ readonly contributions?: Record<string, Placement>;
71
+ }
72
+ export interface ICommandButtonRegistry {
73
+ /**
74
+ * Registers an entry (requires a `key`). Replacing (`replace: true`) an entry with the same key
75
+ * overwrites it.
76
+ *
77
+ * @remarks
78
+ * In dev, warns when an entry key **shadows** the command it wraps (`key === defaultKey`) - entry
79
+ * and command keys are one namespace, so name the panel apart (e.g. `${key}Options`). This is a
80
+ * convention-only check: without visibility into the command registry it can only catch the command
81
+ * an entry names via `defaultKey`, not an arbitrary command key. Suppressed when `replace` is true.
82
+ * @param entry The entry (must have a `key`).
83
+ * @param replace Whether to replace an existing entry with the same key. Default is false.
84
+ */
85
+ register(entry: CommandButtonEntry & {
86
+ key: string;
87
+ }, replace?: boolean): void;
88
+ /**
89
+ * Unregister an item.
90
+ * @param key The unique key for the item.
91
+ */
92
+ unregister(key: string): void;
93
+ /**
94
+ * Gets a registered item's **definition** by key (a plain dictionary lookup).
95
+ * @param key The unique key for the item.
96
+ * @returns The registered item or `null` if not found.
97
+ */
98
+ get(key: string): CommandButtonEntry | null;
99
+ /**
100
+ * Resolves a panel's final **member list**: its own `members` woven with every entry that injects
101
+ * itself into the panel via `contributions`, ordered. Pure with respect to the current registry
102
+ * snapshot. Returns `null` if the panel is not registered.
103
+ *
104
+ * @param groupKey The panel to resolve.
105
+ */
106
+ resolveMembers(groupKey: string): (string | '-' | null | CommandButtonEntry)[] | null;
107
+ /**
108
+ * Monotonic version, bumped on every {@link register} / {@link unregister}. Surfaces snapshot it
109
+ * (with {@link addListener}) so a **dynamically** contributed entry — e.g. a contextual ribbon tab a
110
+ * feature adds while its selection is active — re-resolves reactively, not just at init.
111
+ */
112
+ getVersion(): number;
113
+ /**
114
+ * Subscribe to register/unregister mutations. Returns an unsubscribe. Paired with {@link getVersion}
115
+ * this drives `useCommandButtonRegistry`'s re-render on dynamic contributions.
116
+ */
117
+ addListener(listener: {
118
+ onChange?(): void;
119
+ }): () => void;
120
+ }
121
+ /**
122
+ * Where one contributed {@link CommandButtonEntry} lands inside a destination panel - the value of a
123
+ * single {@link CommandButtonEntry.contributions} entry, keyed there by the destination panel's key.
124
+ *
125
+ * An injection is positioned relative to an `anchor` (an existing member of the destination) or, with
126
+ * no anchor, relative to the panel's edge. Which *side* of that anchor / edge, and the order among
127
+ * injections that share it, both come from {@link order}. Woven into the destination's member list
128
+ * by {@link ICommandButtonRegistry.resolveMembers}.
129
+ */
130
+ export type Placement = {
131
+ /**
132
+ * The key of an existing member in the destination panel to position this injection next to; which
133
+ * *side* is chosen by the sign of {@link order}. Case-insensitive. Omit to target the panel's edge
134
+ * instead (again per `order`'s sign). An anchor not found in the panel falls back to that edge
135
+ * (and warns in dev).
136
+ */
137
+ readonly anchor?: string;
138
+ /**
139
+ * Does double duty: its **sign** picks the side of the `anchor` (or edge) - negative = before /
140
+ * start edge, positive (or `0`) = after / end edge - and its **magnitude** orders injections that
141
+ * share the same anchor / edge. Defaults to `0`. Remaining ties break by registration order.
142
+ */
143
+ readonly order?: number;
144
+ /**
145
+ * Ask the surface to emit a separator adjacent to this injected item (`'before'` / `'after'` /
146
+ * `'both'`). Leading, duplicate, and trailing separators are trimmed at render, so it reads as
147
+ * "start a new group here".
148
+ */
149
+ readonly divider?: 'before' | 'after' | 'both';
150
+ };
151
+ /**
152
+ * Shared default command button registry.
153
+ *
154
+ * @remarks
155
+ * Plugins register their toolbar/menu items here; host surfaces (ribbon toolbars, overflow palettes,
156
+ * context menus) render them via {@link ICommandButtonRegistry.resolveMembers}.
157
+ */
158
+ export declare const DefaultCommandButtonRegistry: ICommandButtonRegistry;
159
+ //# sourceMappingURL=CommandButtonRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandButtonRegistry.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandButtonRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,GAAC,GAAG,EAAE,OAAO,GAAC,GAAG;IACxD;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAEhE,iGAAiG;IACjG,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEvB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,CAAC;IAEvG,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACvE,yCAAyC;IACzC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEzF;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpD;AAGD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/E;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAAC;IAE5C;;;;;;OAMG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,kBAAkB,CAAC,EAAE,GAAG,IAAI,CAAC;IAEtF;;;;OAIG;IACH,UAAU,IAAI,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,IAAI,IAAI,CAAA;KAAE,GAAG,MAAM,IAAI,CAAC;CAC1D;AASD;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CAChD,CAAC;AAuNF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,sBAAoD,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ import { ICommandButtonRegistry } from './CommandButtonRegistry';
3
+ /**
4
+ * Provides an {@link ICommandButtonRegistry} to descendants. When no provider is present the shared
5
+ * {@link DefaultCommandButtonRegistry} singleton is used (see {@link useCommandButtonRegistry}), so
6
+ * this is purely additive - a host may wrap a subtree to override contributions without affecting
7
+ * anyone still reaching for the singleton directly.
8
+ */
9
+ export declare const CommandButtonRegistryContext: import('react').Context<ICommandButtonRegistry | null>;
10
+ /**
11
+ * Returns the {@link ICommandButtonRegistry} from context, falling back to the shared
12
+ * {@link DefaultCommandButtonRegistry} singleton when no {@link CommandButtonRegistryProvider} is
13
+ * mounted above.
14
+ *
15
+ * Subscribes to the language service: registered entries' `getLabel`/`getDescription` resolve
16
+ * through it (see `CommandButtonRegistry`'s translate wrapper), so any component reading entry
17
+ * chrome through this hook re-renders on a language switch — no per-consumer subscription
18
+ * needed. (Command surfaces additionally refresh via `useCommands`' resolver version.)
19
+ */
20
+ export declare function useCommandButtonRegistry(): ICommandButtonRegistry;
21
+ export interface CommandButtonRegistryProviderProps {
22
+ /**
23
+ * The registry to provide to descendants.
24
+ *
25
+ * @defaultValue the shared {@link DefaultCommandButtonRegistry} singleton.
26
+ */
27
+ registry?: ICommandButtonRegistry;
28
+ children: ReactNode;
29
+ }
30
+ /**
31
+ * Provides an {@link ICommandButtonRegistry} to descendants. Optional - descendants default to the
32
+ * shared {@link DefaultCommandButtonRegistry} singleton when this is absent.
33
+ */
34
+ export declare function CommandButtonRegistryProvider({ registry, children }: CommandButtonRegistryProviderProps): ReactNode;
35
+ //# sourceMappingURL=CommandButtonRegistryContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandButtonRegistryContext.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandButtonRegistryContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxF,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGpG;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,wDAAqD,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,CAoBjE;AAED,MAAM,WAAW,kCAAkC;IACjD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,QAAuC,EACvC,QAAQ,EACT,EAAE,kCAAkC,GAAG,SAAS,CAMhD"}
@@ -0,0 +1,155 @@
1
+ import { LanguageTag } from '@sheetxl/utils';
2
+ import { IKeyStroke } from '../types';
3
+ import { ICommandDefinition } from './ICommandDefinition';
4
+ /**
5
+ * Parse a compact VSCode-style shortcut string (`'ctrl+shift+h'`, `'alt+='`, `'ctrl+Semicolon'`)
6
+ * into an {@link IKeyStroke}. Modifiers are the `+`-joined leading tokens (case-insensitive
7
+ * `ctrl|shift|alt|meta`); the LAST token is the key, kept verbatim (our key tokens — `Semicolon`,
8
+ * `F9`, `"` — are not remapped). An unknown leading token is treated as part of the key defensively.
9
+ */
10
+ export declare function parseShortcutString(str: string): IKeyStroke;
11
+ /**
12
+ * Serialize an {@link IKeyStroke} to the compact string form, modifiers in {@link MODIFIER_ORDER}.
13
+ * Inverse of {@link parseShortcutString}. (Used by the migration codemod / any writer.)
14
+ */
15
+ export declare function serializeShortcut(stroke: IKeyStroke): string;
16
+ /**
17
+ * The JSON-serializable **chrome** for one command — the literal subset of
18
+ * {@link ICommandDefinition} (everything except callbacks/state/context, which stay in the
19
+ * `…Dynamic` TS half). This is the per-command record inside a {@link CommandCatalog}, the
20
+ * source of truth for a command's presentation (I18N-DESIGN.md decision 8).
21
+ *
22
+ * Field names are the compact catalog form; {@link chromeToPartial} maps them onto the
23
+ * `ICommandDefinition` names (`desc → description`, `group → groupLabels`). Only literal
24
+ * values live here — a dynamic (function) label such as `selectNamed`'s stays in the dynamic
25
+ * contribution and wins at resolve time (functions always beat the catalog).
26
+ */
27
+ export interface ChromeRecord {
28
+ /** Command label. May contain `{param}` placeholders once the parameterized path is wired. */
29
+ label?: string;
30
+ /** Command description. */
31
+ description?: string;
32
+ /**
33
+ * Per-surface label overrides keyed by groupKey (the flat-pack `cmd.<key>.label@<groupKey>` variants) —
34
+ * e.g. `{ view: 'Row Gridlines', gridlinesOptions: 'Rows' }`. Same field/shape as
35
+ * {@link ICommandDefinition.groupLabels}.
36
+ */
37
+ groupLabels?: Record<string, string>;
38
+ /**
39
+ * Per-surface description overrides keyed by groupKey — the `description` twin of
40
+ * {@link groupLabels}. Same field/shape as {@link ICommandDefinition.groupDescriptions}.
41
+ */
42
+ groupDescriptions?: Record<string, string>;
43
+ /** Icon glyph key (string only — React-element icons stay dynamic/TS). */
44
+ icon?: string;
45
+ /**
46
+ * Per-surface icon overrides keyed by groupKey. Legitimate but **bad hygiene** across scopes
47
+ * (I18N-DESIGN.md decision 8): an icon should normally be identical everywhere a command appears.
48
+ */
49
+ groupIcons?: Record<string, string>;
50
+ /**
51
+ * Keyboard shortcut(s), compact VSCode-style: `'ctrl+shift+h'`, `'alt+='`. An array is a list
52
+ * of alternative bindings. Parsed to {@link IKeyStroke} at load via {@link parseShortcutString}.
53
+ *
54
+ * `null` means **explicitly unbound in this locale** (the usual convention: `undefined` = take
55
+ * the default, `null` = exclude it). A locale pack inherits English shortcuts by *absence*, so
56
+ * `null` is the only way for a locale to drop one — needed when a localized mnemonic claims a
57
+ * chord English gives to some other command (de Bold takes `ctrl+shift+F`, so de `showFormat`
58
+ * must give it up). See `config/i18n-catalog-build.mjs`.
59
+ */
60
+ shortcut?: string | string[] | null;
61
+ /** Accumulated metadata tags (e.g. `'mutator'`, `'quickAction'`). */
62
+ tags?: string[];
63
+ /**
64
+ * Other scopes that BORROW this command (in addition to the file's owner {@link CommandCatalog.scope}).
65
+ * A command lives in its owner's file; `borrow` seeds it into the listed scopes too — e.g. the insert
66
+ * commands are editor-owned with `borrow: ['sheet']`; undo is sheet-owned with `borrow: ['workbook']`.
67
+ * Routing metadata only — not part of the command chrome.
68
+ */
69
+ borrow?: string[];
70
+ /**
71
+ * **Default message parameters** for parameterized (ICU-subset) `label`/`groupLabels`/
72
+ * `description` messages — e.g. `{ "count": 1, "mode": "none" }` for
73
+ * `"{count, plural, one{Insert Row} other{Insert # Rows}}"`. Seeded into the definition so
74
+ * pre-mount surfaces (shortcut dialog, command palette) render the sensible default; a dynamic
75
+ * contributor overrides with live values (`ICommandDefinition.params`). Copied from English by
76
+ * the build (never translated) — messages localize, parameter defaults don't.
77
+ */
78
+ params?: Record<string, unknown>;
79
+ }
80
+ /**
81
+ * A per-`(scope, language)` command catalog — externalized, structured command chrome.
82
+ * Shipped as `<name>.cmd.<tag>.json` (English default `<name>.cmd.en.json`,
83
+ * locales `<name>.cmd.de.json`), one file per owning scope (a source). Each shipped locale file is a
84
+ * COMPLETE pack (the dev-pipeline copies untranslated fields from the default), loaded at runtime via
85
+ * fetch — see {@link fetchCatalog}.
86
+ *
87
+ * `scope` is the {@link CommandRegistry} **name** these commands seed onto (`'sheet'`, `'workbook'`,
88
+ * `'selection'`, `'movable'`, `'editor'`, `'app'`, `'scriptEditor'`, …) — the same name a
89
+ * {@link CommandScope} carries. Because each scope seeds under its own registry name and carries its
90
+ * own localized strings, per-scope localization falls out of the scope-chain fold. Commands can also be
91
+ * BORROWED into other scopes via {@link ChromeRecord.borrow}.
92
+ */
93
+ export interface CommandCatalog {
94
+ /** Optional pointer to the envelope JSON Schema (editor validation). */
95
+ $schema?: string;
96
+ /** The registry scope name these commands OWN (seed onto). */
97
+ scope: string;
98
+ /** Human-readable, localizable display name for {@link scope} (e.g. the shortcut-keys dialog grouping). */
99
+ label?: string;
100
+ /** BCP-47 language tag; `'en'` is the default. */
101
+ tag: LanguageTag;
102
+ /** Envelope format version, for forward-compatible migrations. */
103
+ version: number;
104
+ /** commandKey → chrome. */
105
+ commands: Record<string, ChromeRecord>;
106
+ }
107
+ /** A catalog module (`import()` result) or the catalog itself. */
108
+ export type CommandCatalogModule = ({
109
+ readonly default: CommandCatalog;
110
+ } & Record<string, unknown>) | CommandCatalog;
111
+ /**
112
+ * A package's `locales/manifest.json` — the build-emitted index the loader reads to register every
113
+ * available locale's packs. `locales` lists the available BCP-47 tags (`en` always first); `catalogs`
114
+ * maps each catalog file to the {@link CommandCatalog.scope} it owns + its source id.
115
+ */
116
+ export interface CommandCatalogManifest {
117
+ locales: string[];
118
+ catalogs: {
119
+ file: string;
120
+ scope: string;
121
+ sourceId: string;
122
+ }[];
123
+ }
124
+ /**
125
+ * Narrow a fetched/parsed catalog payload to {@link CommandCatalog}. The single documented cast
126
+ * boundary — the data is generated by the codemod and schema-validated, so it is trusted here.
127
+ */
128
+ export declare function asCommandCatalog(json: unknown): CommandCatalog;
129
+ /**
130
+ * Fetch a catalog JSON by URL (the runtime-fetch model — packs ship as data files in `dist`, not
131
+ * inlined into the code bundle, so command strings stay out of the JS and user-supplied packs can be
132
+ * pointed at their own URL). Typically wrapped in a lazy loader:
133
+ * `register(domain, tag, () => fetchCatalog(new URL('./sheet.cmd.json', import.meta.url)))`.
134
+ */
135
+ export declare function fetchCatalog(url: string | URL): Promise<CommandCatalog>;
136
+ /** Lazy catalog loader — typically `() => import('.../sheet.cmd.de.json')`. */
137
+ export type CommandCatalogLoader = () => Promise<CommandCatalogModule>;
138
+ /**
139
+ * Convert a {@link ChromeRecord} to the `Omit<ICommandDefinition, 'key'>` partial the registry
140
+ * seeds: rename `desc → description` / `group → groupLabels`, drop `undefined` fields, and parse the
141
+ * compact `shortcut` string(s) into {@link IKeyStroke}(s). `params` seeds the message-parameter
142
+ * DEFAULTS (dynamic contributors override with live values).
143
+ *
144
+ * This is the boundary between JSON-imported catalogs and the typed command model.
145
+ */
146
+ export declare function chromeToPartial(rec: ChromeRecord): Omit<ICommandDefinition, 'key'>;
147
+ /**
148
+ * Merge a default (English) chrome record with a locale-override record, per field. Used by the
149
+ * **build/dev pipeline** that emits COMPLETE per-locale packs (English filled where untranslated —
150
+ * I18N-DESIGN.md decision #1), NOT at runtime: the runtime seeds one already-complete pack, no merge.
151
+ * A locale override typically carries only `label`/`desc`/`group`, so unspecified fields fall through
152
+ * to the default; `group` is merged per groupKey.
153
+ */
154
+ export declare function mergeChrome(base: ChromeRecord | undefined, override: ChromeRecord | undefined): ChromeRecord;
155
+ //# sourceMappingURL=CommandCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandCatalog.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM/D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAS3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAK5D;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,2GAA2G;IAC3G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,GAAG,EAAE,WAAW,CAAC;IACjB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACxC;AAED,kEAAkE;AAClE,MAAM,MAAM,oBAAoB,GAC9B,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,cAAc,CAAC;AAEpF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAE9D;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAI7E;AAED,+EAA+E;AAC/E,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAiBlF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,CAiB5G"}
@@ -0,0 +1,7 @@
1
+ import { ResourceKindDefinition } from '@sheetxl/utils';
2
+ /**
3
+ * Adds `.cmd.json` to the `locales` kind the SDK declares — the kind is a namespace, and more than
4
+ * one package may contribute file types to it.
5
+ */
6
+ export declare const COMMAND_RESOURCE_KINDS: readonly ResourceKindDefinition[];
7
+ //# sourceMappingURL=CommandCatalogResource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandCatalogResource.d.ts","sourceRoot":"","sources":["../../../../src/command/CommandCatalogResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAuC7D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,sBAAsB,EAEnE,CAAC"}