@sheetxl/utils-react 0.7.27 → 0.7.28-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 (154) 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/7-_IBNtjW6k90P9e.mjs +390 -0
  6. package/browser/esm/BgV0nMxx2V13JMAV.mjs +2171 -0
  7. package/browser/esm/index.mjs +6128 -1806
  8. package/browser/esm/sLI7RooaRwVJN8R1.mjs +139 -0
  9. package/licenses/dependencies.txt +246 -39
  10. package/node/esm/DxhVj6bgjkjclg0J.mjs +139 -0
  11. package/node/esm/index.mjs +5141 -1774
  12. package/node/esm/k3zNlJ7uOn8Nfx4T.mjs +2171 -0
  13. package/package.json +8 -5
  14. package/types/index.d.ts +2 -2043
  15. package/types/src/animation/AnimationModeContext.d.ts +10 -0
  16. package/types/src/animation/index.d.ts +3 -0
  17. package/types/src/animation/useAnimatedMeasure.d.ts +39 -0
  18. package/types/src/command/ActivationTracker.d.ts +53 -0
  19. package/types/src/command/CommandAnchorProvider.d.ts +64 -0
  20. package/types/src/command/CommandButtonEntryLabel.d.ts +25 -0
  21. package/types/src/command/CommandButtonRegistry.d.ts +159 -0
  22. package/types/src/command/CommandButtonRegistryContext.d.ts +35 -0
  23. package/types/src/command/CommandCatalog.d.ts +155 -0
  24. package/types/src/command/CommandCatalogResource.d.ts +7 -0
  25. package/types/src/command/CommandCatalogService.d.ts +61 -0
  26. package/types/src/command/CommandChainContext.d.ts +32 -0
  27. package/types/src/command/CommandFallbackContext.d.ts +30 -0
  28. package/types/src/command/CommandFocusContext.d.ts +21 -0
  29. package/types/src/command/CommandRegistry.d.ts +164 -0
  30. package/types/src/command/CommandRegistryContext.d.ts +16 -0
  31. package/types/src/command/CommandResolver.d.ts +162 -0
  32. package/types/src/command/CommandScope.d.ts +343 -0
  33. package/types/src/command/CommandScopeContext.d.ts +205 -0
  34. package/types/src/command/FocusActivation.d.ts +140 -0
  35. package/types/src/command/ICommand.d.ts +31 -0
  36. package/types/src/command/ICommandDefinition.d.ts +82 -0
  37. package/types/src/command/KeyBindingDispatcher.d.ts +150 -0
  38. package/types/src/command/LayerActivation.d.ts +45 -0
  39. package/types/src/command/Types.d.ts +80 -0
  40. package/types/src/command/createResolvedCommand.d.ts +91 -0
  41. package/types/src/command/index.d.ts +26 -0
  42. package/types/src/command/reduceDefinitions.d.ts +33 -0
  43. package/types/src/command/useCommands.d.ts +22 -0
  44. package/types/src/command/useContributeCommands.d.ts +18 -0
  45. package/types/src/components/FocusKeyNavigation.d.ts +22 -0
  46. package/types/src/components/ITooltip.d.ts +38 -0
  47. package/types/src/components/RoundedTab.d.ts +26 -0
  48. package/types/src/components/index.d.ts +4 -0
  49. package/types/src/error/ErrorPanel.d.ts +14 -0
  50. package/types/src/error/ReactErrorBoundary.d.ts +7 -0
  51. package/types/src/error/UncaughtErrorBoundary.d.ts +5 -0
  52. package/types/src/error/index.d.ts +4 -0
  53. package/types/src/float/FloatPanel.d.ts +57 -0
  54. package/types/src/float/FloatPopper.d.ts +85 -0
  55. package/types/src/float/FloatPopup.d.ts +19 -0
  56. package/types/src/float/FloatProvider.d.ts +60 -0
  57. package/types/src/float/FloatStackContext.d.ts +25 -0
  58. package/types/src/float/FloatTooltip.d.ts +22 -0
  59. package/types/src/float/FloatUtils.d.ts +55 -0
  60. package/types/src/float/_FloatUtils.d.ts +51 -0
  61. package/types/src/float/index.d.ts +9 -0
  62. package/types/src/float/useFloatStack.d.ts +92 -0
  63. package/types/src/hooks/LanguageState.d.ts +15 -0
  64. package/types/src/hooks/index.d.ts +19 -0
  65. package/types/src/hooks/useBoundSyncExternalStore.d.ts +23 -0
  66. package/types/src/hooks/useCallbackRef.d.ts +11 -0
  67. package/types/src/hooks/useDevicePixelRatio.d.ts +37 -0
  68. package/types/src/hooks/useEditMode.d.ts +66 -0
  69. package/types/src/hooks/useGlobalClipboard.d.ts +7 -0
  70. package/types/src/hooks/useId.d.ts +9 -0
  71. package/types/src/hooks/useImperativeElement.d.ts +3 -0
  72. package/types/src/hooks/useLanguage.d.ts +13 -0
  73. package/types/src/hooks/useMouseDownAndHoldListener.d.ts +13 -0
  74. package/types/src/hooks/useNotifier.d.ts +330 -0
  75. package/types/src/hooks/useOnClickOrFocusAway.d.ts +8 -0
  76. package/types/src/hooks/useOptionalBoundSyncExternalStore.d.ts +20 -0
  77. package/types/src/hooks/useOptionalSyncExternalStore.d.ts +18 -0
  78. package/types/src/hooks/useSynchronizedPointerHandler.d.ts +54 -0
  79. package/types/src/hooks/useTextareaCaretRect.d.ts +85 -0
  80. package/types/src/hooks/useTraceUpdate.d.ts +2 -0
  81. package/types/src/hooks/useTranslator.d.ts +32 -0
  82. package/types/src/icons/DynamicIcon.d.ts +17 -0
  83. package/types/src/icons/DynamicIconService.d.ts +39 -0
  84. package/types/src/icons/ErrorIcon.d.ts +6 -0
  85. package/types/src/icons/Types.d.ts +81 -0
  86. package/types/src/icons/WalkingIcon.d.ts +27 -0
  87. package/types/src/icons/_Utils.d.ts +3 -0
  88. package/types/src/icons/index.d.ts +5 -0
  89. package/types/src/icons/packs/Base.d.ts +4 -0
  90. package/types/src/icons/packs/Conditional.d.ts +4 -0
  91. package/types/src/index.d.ts +18 -0
  92. package/types/src/loading/LoadingPanel.d.ts +31 -0
  93. package/types/src/loading/index.d.ts +2 -0
  94. package/types/src/persistence/InMemoryStore.d.ts +12 -0
  95. package/types/src/persistence/LocalStorageStore.d.ts +15 -0
  96. package/types/src/persistence/PersistenceStateProvider.d.ts +3 -0
  97. package/types/src/persistence/Types.d.ts +95 -0
  98. package/types/src/persistence/_Context.d.ts +9 -0
  99. package/types/src/persistence/index.d.ts +6 -0
  100. package/types/src/persistence/usePersistenceState.d.ts +33 -0
  101. package/types/src/react-resizable/Resizable.d.ts +30 -0
  102. package/types/src/react-resizable/ResizableBox.d.ts +18 -0
  103. package/types/src/react-resizable/index.d.ts +11 -0
  104. package/types/src/react-resizable/propTypes.d.ts +56 -0
  105. package/types/src/react-resizable/utils.d.ts +3 -0
  106. package/types/src/scroll/AxisViewport.d.ts +73 -0
  107. package/types/src/scroll/IScrollPane.d.ts +63 -0
  108. package/types/src/scroll/IScrollbar.d.ts +94 -0
  109. package/types/src/scroll/NativeScrollbar.d.ts +7 -0
  110. package/types/src/scroll/ScrollButton.d.ts +29 -0
  111. package/types/src/scroll/ScrollPane.d.ts +4 -0
  112. package/types/src/scroll/Scrollbar.d.ts +4 -0
  113. package/types/src/scroll/TouchThumbContext.d.ts +93 -0
  114. package/types/src/scroll/TouchThumbHandle.d.ts +64 -0
  115. package/types/src/scroll/TrackDrag.d.ts +107 -0
  116. package/types/src/scroll/Utils.d.ts +8 -0
  117. package/types/src/scroll/Viewport.d.ts +285 -0
  118. package/types/src/scroll/VirtualScrollbar.d.ts +49 -0
  119. package/types/src/scroll/index.d.ts +14 -0
  120. package/types/src/scroll/scrollbarTheming.d.ts +27 -0
  121. package/types/src/scroll/useWheelScroll.d.ts +27 -0
  122. package/types/src/scroller/Scroller.d.ts +260 -0
  123. package/types/src/scroller/animate.d.ts +30 -0
  124. package/types/src/scroller/index.d.ts +2 -0
  125. package/types/src/singletonHook/components/SingleItemContainer.d.ts +6 -0
  126. package/types/src/singletonHook/components/SingletonHooksContainer.d.ts +7 -0
  127. package/types/src/singletonHook/index.d.ts +11 -0
  128. package/types/src/singletonHook/singletonHook.d.ts +6 -0
  129. package/types/src/singletonHook/utils/env.d.ts +4 -0
  130. package/types/src/singletonHook/utils/env.native.d.ts +1 -0
  131. package/types/src/singletonHook/utils/warning.d.ts +2 -0
  132. package/types/src/splitPane/SplitPane.d.ts +91 -0
  133. package/types/src/splitPane/SplitPaneResizer.d.ts +11 -0
  134. package/types/src/splitPane/index.d.ts +3 -0
  135. package/types/src/theme/TokenTheme.d.ts +196 -0
  136. package/types/src/theme/TokenThemeProvider.d.ts +97 -0
  137. package/types/src/theme/buildThemeCSS.d.ts +54 -0
  138. package/types/src/theme/createThemeVars.d.ts +15 -0
  139. package/types/src/theme/defaultTheme.d.ts +15 -0
  140. package/types/src/theme/index.d.ts +9 -0
  141. package/types/src/theme/resolveTokens.d.ts +21 -0
  142. package/types/src/theme/themeAttrs.d.ts +32 -0
  143. package/types/src/theme/useResolvedThemeMode.d.ts +17 -0
  144. package/types/src/types/Types.d.ts +71 -0
  145. package/types/src/types/index.d.ts +2 -0
  146. package/types/src/utils/FullScreenPortal.d.ts +6 -0
  147. package/types/src/utils/PinchZoom.d.ts +3 -0
  148. package/types/src/utils/ReactUtils.d.ts +134 -0
  149. package/types/src/utils/index.d.ts +4 -0
  150. package/types/src/utils/useFullScreen.d.ts +47 -0
  151. package/browser/cjs/DJJQOl0dYYJgXfru.cjs +0 -6
  152. package/browser/esm/Bh0xih0ZamA4MXkt.mjs +0 -12
  153. package/node/assets/style.css +0 -1
  154. package/node/esm/DdwriRgF582bPBWP.mjs +0 -12
@@ -0,0 +1,260 @@
1
+ export interface ScrollerCallback {
2
+ (left: number, top: number, zoom: number): void;
3
+ }
4
+ export interface ScrollerOptions {
5
+ /** Enable scrolling on x-axis */
6
+ scrollingX?: boolean;
7
+ /** Enable scrolling on y-axis */
8
+ scrollingY?: boolean;
9
+ /** Enable animations for deceleration, snap back, zooming and scrolling */
10
+ animating?: boolean;
11
+ /** duration for animations triggered by scrollTo/zoomTo */
12
+ animationDuration?: number;
13
+ /** Enable bouncing (content can be slowly moved outside and jumps back after releasing) */
14
+ bouncing?: boolean;
15
+ /** Enable locking to the main axis if user moves only slightly on one of them at start */
16
+ locking?: boolean;
17
+ /** Enable pagination mode (switching between full page content panes) */
18
+ paging?: boolean;
19
+ /** Enable snapping of content to a configured pixel grid */
20
+ snapping?: boolean;
21
+ /** Enable zooming of content via API, fingers and mouse wheel */
22
+ zooming?: boolean;
23
+ /** Minimum zoom level */
24
+ minZoom?: number;
25
+ /** Maximum zoom level */
26
+ maxZoom?: number;
27
+ /** Multiply or decrease scrolling speed **/
28
+ speedMultiplier?: number;
29
+ /** Callback that is fired on the later of touch end or deceleration end,
30
+ provided that another scrolling action has not begun. Used to know
31
+ when to fade out a scrollbar. */
32
+ scrollingComplete?: () => void;
33
+ /** This configures the amount of change applied to deceleration when reaching boundaries **/
34
+ penetrationDeceleration?: number;
35
+ /** This configures the amount of change applied to acceleration when reaching boundaries **/
36
+ penetrationAcceleration?: number;
37
+ }
38
+ /**
39
+ * Scroller class for 'virtual' scrolling/zooming.
40
+ */
41
+ export declare class Scroller {
42
+ /** {Boolean} Whether only a single finger is used in touch handling */
43
+ __isSingleTouch: boolean;
44
+ /** {Boolean} Whether a touch event sequence is in progress */
45
+ __isTracking: boolean;
46
+ /** {Boolean} Whether a deceleration animation went to completion. */
47
+ __didDecelerationComplete: boolean;
48
+ /**
49
+ * {Boolean} Whether a gesture zoom/rotate event is in progress. Activates when
50
+ * a gestureStart event happens. This has higher priority than dragging.
51
+ */
52
+ __isGesturing: boolean;
53
+ /**
54
+ * {Boolean} Whether the user has moved by such a distance that we have enabled
55
+ * dragging mode. Hint: It's only enabled after some pixels of movement to
56
+ * not interrupt with clicks etc.
57
+ */
58
+ __isDragging: boolean;
59
+ /**
60
+ * {Boolean} Not touching and dragging anymore, and smoothly animating the
61
+ * touch sequence using deceleration.
62
+ */
63
+ __isDecelerating: number;
64
+ /**
65
+ * {Boolean} Smoothly animating the currently configured change
66
+ */
67
+ __isAnimating: number;
68
+ __interruptedAnimation: boolean;
69
+ __lastScale: number;
70
+ __enableScrollX: boolean;
71
+ __enableScrollY: boolean;
72
+ /** {Integer} Viewport left boundary */
73
+ __clientLeft: number;
74
+ /** {Integer} Viewport right boundary */
75
+ __clientTop: number;
76
+ /** {Integer} Viewport width */
77
+ __clientWidth: number;
78
+ /** {Integer} Viewport height */
79
+ __clientHeight: number;
80
+ /** {Integer} Full content's width */
81
+ __contentWidth: number;
82
+ /** {Integer} Full content's height */
83
+ __contentHeight: number;
84
+ /** {Integer} Snapping width for content */
85
+ __snapWidth: number;
86
+ /** {Integer} Snapping height for content */
87
+ __snapHeight: number;
88
+ /** {Number} Zoom level */
89
+ __zoomLevel: number;
90
+ /** {Number} Scroll position on x-axis */
91
+ __scrollLeft: number;
92
+ /** {Number} Scroll position on y-axis */
93
+ __scrollTop: number;
94
+ /** {Integer} Maximum allowed scroll position on x-axis */
95
+ __maxScrollLeft: number;
96
+ /** {Integer} Maximum allowed scroll position on y-axis */
97
+ __maxScrollTop: number;
98
+ __scheduledLeft: number;
99
+ __scheduledTop: number;
100
+ __scheduledZoom: number;
101
+ /** {Number} Left position of finger at start */
102
+ __lastTouchLeft: number;
103
+ /** {Number} Top position of finger at start */
104
+ __lastTouchTop: number;
105
+ /** {Date} Timestamp of last move of finger. Used to limit tracking range for deceleration speed. */
106
+ __lastTouchMove: number;
107
+ /** {Array} List of positions, uses three indexes for each state: left, top, timestamp */
108
+ __positions: Array<number>;
109
+ __initialTouchLeft: number;
110
+ __initialTouchTop: number;
111
+ __zoomLevelStart: number;
112
+ /** {Integer} Minimum left scroll position during deceleration */
113
+ __minDecelerationScrollLeft: number;
114
+ /** {Integer} Minimum top scroll position during deceleration */
115
+ __minDecelerationScrollTop: number;
116
+ /** {Integer} Maximum left scroll position during deceleration */
117
+ __maxDecelerationScrollLeft: number;
118
+ /** {Integer} Maximum top scroll position during deceleration */
119
+ __maxDecelerationScrollTop: number;
120
+ /** {Number} Current factor to modify horizontal scroll position with on every step */
121
+ __decelerationVelocityX: number;
122
+ /** {Number} Current factor to modify vertical scroll position with on every step */
123
+ __decelerationVelocityY: number;
124
+ __callback: ScrollerCallback;
125
+ __zoomComplete: (() => void) | null;
126
+ options: ScrollerOptions;
127
+ constructor(callback: ScrollerCallback, options: ScrollerOptions);
128
+ /**
129
+ * Configures the dimensions of the client (outer) and content (inner) elements.
130
+ * Requires the available space for the outer element and the outer size of the inner element.
131
+ * All values which are falsy (null or zero etc.) are ignored and the old value is kept.
132
+ *
133
+ * @param clientWidth {Integer ? null} Inner width of outer element
134
+ * @param clientHeight {Integer ? null} Inner height of outer element
135
+ * @param contentWidth {Integer ? null} Outer width of inner element
136
+ * @param contentHeight {Integer ? null} Outer height of inner element
137
+ */
138
+ setDimensions(clientWidth: number, clientHeight: number, contentWidth: number, contentHeight: number): void;
139
+ /**
140
+ * Sets the client coordinates in relation to the document.
141
+ *
142
+ * @param left {Integer ? 0} Left position of outer element
143
+ * @param top {Integer ? 0} Top position of outer element
144
+ */
145
+ setPosition(left: number, top: number): void;
146
+ /**
147
+ * Configures the snapping (when snapping is active)
148
+ *
149
+ * @param width {Integer} Snapping width
150
+ * @param height {Integer} Snapping height
151
+ */
152
+ setSnapSize(width: number, height: number): void;
153
+ /**
154
+ * Returns the scroll position and zooming values
155
+ *
156
+ * @returns `left` and `top` scroll position and `zoom` level
157
+ */
158
+ getValues(): {
159
+ left: number;
160
+ top: number;
161
+ right: number;
162
+ bottom: number;
163
+ zoom: number;
164
+ };
165
+ /**
166
+ * Get point in in content space from scroll coordinates.
167
+ */
168
+ getPoint(scrollLeft: number, scrollTop: number): {
169
+ left: number;
170
+ top: number;
171
+ };
172
+ /**
173
+ * Returns the maximum scroll values
174
+ *
175
+ * @returns `left` and `top` maximum scroll values
176
+ */
177
+ getScrollMax(): {
178
+ left: number;
179
+ top: number;
180
+ };
181
+ /**
182
+ * Zooms to the given level. Supports optional animation. Zooms
183
+ * the center when no coordinates are given.
184
+ *
185
+ * @param level {Number} Level to zoom to
186
+ * @param isAnimated {Boolean ? false} Whether to use animation
187
+ * @param fixedLeft {Number ? undefined} Stationary point's left coordinate (vector in client space)
188
+ * @param fixedTop {Number ? undefined} Stationary point's top coordinate (vector in client space)
189
+ * @param callback {Function ? null} A callback that gets fired when the zoom is complete.
190
+ */
191
+ zoomTo(level: number, isAnimated?: boolean, fixedLeft?: number, fixedTop?: number, callback?: () => void): void;
192
+ /**
193
+ * Zooms the content by the given factor.
194
+ *
195
+ * @param factor {Number} Zoom by given factor
196
+ * @param isAnimated {Boolean ? false} Whether to use animation
197
+ * @param originLeft {Number ? 0} Zoom in at given left coordinate
198
+ * @param originTop {Number ? 0} Zoom in at given top coordinate
199
+ * @param callback {Function ? null} A callback that gets fired when the zoom is complete.
200
+ */
201
+ zoomBy(factor: number, isAnimated?: boolean, originLeft?: number, originTop?: number, callback?: () => void): void;
202
+ /**
203
+ * Scrolls to the given position. Respect limitations and snapping automatically.
204
+ *
205
+ * @param left {Number?null} Horizontal scroll position, keeps current if value is <code>null</code>
206
+ * @param top {Number?null} Vertical scroll position, keeps current if value is <code>null</code>
207
+ * @param isAnimated {Boolean?false} Whether the scrolling should happen using an animation
208
+ * @param zoom {Number} [1.0] Zoom level to go to
209
+ */
210
+ scrollTo(left: number, top: number, isAnimated?: boolean, zoom?: number): void;
211
+ /**
212
+ * Scroll by the given offset
213
+ *
214
+ * @param left {Number ? 0} Scroll x-axis by given offset
215
+ * @param top {Number ? 0} Scroll x-axis by given offset
216
+ * @param isAnimated {Boolean ? false} Whether to animate the given change
217
+ */
218
+ scrollBy(left?: number, top?: number, isAnimated?: boolean): void;
219
+ /**
220
+ * Mouse wheel handler for zooming support
221
+ */
222
+ doMouseZoom(wheelDelta: number, timeStamp: number, pageX: number, pageY: number): void;
223
+ /**
224
+ * Touch start handler for scrolling support
225
+ */
226
+ doTouchStart(touches: TouchList, timeStamp: number | Date): void;
227
+ /**
228
+ * Touch move handler for scrolling support
229
+ * @param {Number} [1.0] scale - ....
230
+ */
231
+ doTouchMove(touches: TouchList, timeStamp: number | Date, scale?: number): void;
232
+ /**
233
+ * Touch end handler for scrolling support
234
+ */
235
+ doTouchEnd(timeStamp: number | Date): void;
236
+ /**
237
+ * Applies the scroll position to the content element
238
+ *
239
+ * @param left {Number} Left scroll position
240
+ * @param top {Number} Top scroll position
241
+ * @param isAnimated {Boolean?false} Whether animation should be used to move to the new coordinates
242
+ */
243
+ protected __publish(left: number, top: number, zoom: number, isAnimated?: boolean): void;
244
+ /**
245
+ * Recomputes scroll minimum values based on client dimensions and content dimensions.
246
+ */
247
+ protected __computeScrollMax(zoomLevel?: number): void;
248
+ /**
249
+ * Called when a touch sequence end and the speed of the finger was high enough
250
+ * to switch into deceleration mode.
251
+ */
252
+ protected __startDeceleration(timeStamp: number): void;
253
+ /**
254
+ * Called on every step of the animation
255
+ *
256
+ * @param render Whether to not render the current step, but keep it in memory only. Used internally only!
257
+ */
258
+ protected __stepThroughDeceleration(render: boolean): void;
259
+ }
260
+ //# sourceMappingURL=Scroller.d.ts.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Stops the given animation.
3
+ *
4
+ * @param id Unique animation ID
5
+ * @returns Whether the animation was stopped (aka, was running before)
6
+ */
7
+ export declare const stop: (id: number) => boolean;
8
+ /**
9
+ * Whether the given animation is still running.
10
+ *
11
+ * @param id Unique animation ID
12
+ * @returns Whether the animation is still running
13
+ */
14
+ export declare const isRunning: (id: number) => boolean;
15
+ /**
16
+ * Start the animation.
17
+ *
18
+ * @param stepCallback {Function} Pointer to function which is executed on every step.
19
+ * Signature of the method should be `function(percent, now, virtual) { return continueWithAnimation; }`
20
+ * @param verifyCallback {Function} Executed before every animation step.
21
+ * Signature of the method should be `function() { return continueWithAnimation; }`
22
+ * @param completedCallback {Function}
23
+ * Signature of the method should be `function(droppedFrames, finishedAnimation, optional wasFinished) {}`
24
+ * @param duration {Integer} Milliseconds to run the animation
25
+ * @param easingMethod {Function} Pointer to easing function
26
+ * Signature of the method should be `function(percent) { return modifiedValue; }`
27
+ * @returns Identifier of animation. Can be used to stop it any time.
28
+ */
29
+ export declare const start: (stepCallback: (percent: number, now: number, virtual?: boolean) => boolean | void, verifyCallback: (id: number) => boolean, completedCallback: (droppedFrames: number, finishedAnimation: number, wasFinished?: boolean) => void, duration?: number, easingMethod?: (percent: number) => number) => number;
30
+ //# sourceMappingURL=animate.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { Scroller } from './Scroller';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const SingleItemContainer: ({ initValue, useHookBody, applyStateChange }: {
2
+ initValue: any;
3
+ useHookBody: () => any;
4
+ applyStateChange: (val: any) => void;
5
+ }) => null;
6
+ //# sourceMappingURL=SingleItemContainer.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export declare const SingletonHooksContainer: ({ automaticContainerInternalUseOnly }: {
3
+ automaticContainerInternalUseOnly?: boolean;
4
+ }) => React.JSX.Element;
5
+ export declare const addHook: (hook: any) => () => void;
6
+ export declare const resetLocalStateForTests: () => void;
7
+ //# sourceMappingURL=SingletonHooksContainer.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { singletonHook } from './singletonHook';
2
+ import { SingletonHooksContainer } from './components/SingletonHooksContainer';
3
+ export { singletonHook, SingletonHooksContainer };
4
+ declare const ReactSingletonHook: {
5
+ singletonHook: <T = any, S = any>(initValue: T, useHookBody: () => S, options?: import('./singletonHook').SingletonHookOptions) => React.SetStateAction<S>;
6
+ SingletonHooksContainer: ({ automaticContainerInternalUseOnly }: {
7
+ automaticContainerInternalUseOnly?: boolean;
8
+ }) => import("react").JSX.Element;
9
+ };
10
+ export default ReactSingletonHook;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface SingletonHookOptions {
3
+ unmountIfNoConsumers?: boolean;
4
+ }
5
+ export declare const singletonHook: <T = any, S = any>(initValue: T, useHookBody: () => S, options?: SingletonHookOptions) => React.SetStateAction<S>;
6
+ //# sourceMappingURL=singletonHook.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ export declare const batch: (cb: () => void) => void;
3
+ export declare const mount: (C: React.ComponentType<any>) => void;
4
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=env.native.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const warning: (message: any) => void;
2
+ //# sourceMappingURL=warning.d.ts.map
@@ -0,0 +1,91 @@
1
+ import { default as React } from 'react';
2
+ import { SplitPaneResizerProps } from './SplitPaneResizer';
3
+ export interface SplitPaneAttributes {
4
+ /**
5
+ * Programmatic api to set the position. Can be either a string with px or %.
6
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
7
+ * @param position - Pixels as `string` or a percent as a `number`.
8
+ */
9
+ setPosition: (position: string | number) => void;
10
+ isSplitPane: () => true;
11
+ }
12
+ export interface ISplitPaneElement extends HTMLDivElement, SplitPaneAttributes {
13
+ }
14
+ export interface SplitPaneProps extends React.HTMLAttributes<HTMLDivElement> {
15
+ /**
16
+ * The elementBefore the divider.
17
+ */
18
+ elementBefore?: React.ReactElement<any>;
19
+ /**
20
+ * The element after the divider.
21
+ */
22
+ elementAfter?: React.ReactElement<any>;
23
+ /**
24
+ * If the fixedPane is set resizing will keep one the sizes.
25
+ *
26
+ * @remarks
27
+ * When set the default position to be interpreted as pixels.
28
+ */
29
+ fixedPane?: 'before' | 'after' | null;
30
+ /**
31
+ * The position. Can be either a string with px or %.
32
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
33
+ */
34
+ position?: number | string;
35
+ /**
36
+ * The minimum size. Can be either a string with px or %.
37
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
38
+ */
39
+ minBefore?: number | string;
40
+ /**
41
+ * The minimum size. Can be either a string with px or %.
42
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
43
+ */
44
+ maxBefore?: number | string;
45
+ /**
46
+ * The minimum size. Can be either a string with px or %.
47
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
48
+ */
49
+ minAfter?: number | string;
50
+ /**
51
+ * The minimum size. Can be either a string with px or %.
52
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
53
+ */
54
+ maxAfter?: number | string;
55
+ /**
56
+ * When the position has been changed.
57
+ * @remarks This is not fired during drag.
58
+ * @param position
59
+ */
60
+ onPositionChange?: (position: {
61
+ pixels: number;
62
+ percent: number;
63
+ }) => void;
64
+ /**
65
+ * Determine the direction of the scrollPane
66
+ */
67
+ splitDirection?: 'row' | 'column';
68
+ disabled?: boolean;
69
+ propsResizer?: SplitPaneResizerProps;
70
+ propsPane?: React.HTMLAttributes<HTMLElement>;
71
+ propsPaneBefore?: React.HTMLAttributes<HTMLElement>;
72
+ propsPaneAfter?: React.HTMLAttributes<HTMLElement>;
73
+ onDragStart?: () => void;
74
+ onDragResize?: (position: number) => void;
75
+ onDragFinish?: (position: number) => void;
76
+ renderResizer?: (props: SplitPaneResizerProps) => React.ReactElement;
77
+ /**
78
+ * A ref that points to the HTMLDivElement.
79
+ */
80
+ ref?: React.Ref<ISplitPaneElement>;
81
+ }
82
+ /**
83
+ * SplitPane
84
+ * A component can have two children and will add a resizer between the two.
85
+ * @remarks
86
+ *
87
+ * Because this component measures the elements (both panes and the resizer) it is important
88
+ * that none of these have margins or paddings. If these are required then use a nested element.
89
+ */
90
+ export declare const SplitPane: React.NamedExoticComponent<Omit<SplitPaneProps, "ref"> & React.RefAttributes<ISplitPaneElement>>;
91
+ //# sourceMappingURL=SplitPane.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface SplitPaneResizerProps extends React.HTMLAttributes<HTMLDivElement>, React.Attributes {
3
+ splitDirection?: 'row' | 'column';
4
+ disabled?: boolean;
5
+ paddingBefore?: number;
6
+ paddingAfter?: number;
7
+ propsHitArea?: React.HTMLAttributes<HTMLDivElement>;
8
+ ref?: React.Ref<HTMLDivElement>;
9
+ }
10
+ export declare const SplitPaneResizer: (props: SplitPaneResizerProps) => React.ReactElement;
11
+ //# sourceMappingURL=SplitPaneResizer.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './SplitPane';
2
+ export * from './SplitPaneResizer';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,196 @@
1
+ /**
2
+ * SheetXL theming — a `TokenTheme` is a **flat set of token values** (one light/dark mode's worth). The type
3
+ * IS the CSS-variable list: each key is exactly the variable name minus the `--sxl-` prefix, so an author
4
+ * never learns a mapping (`'color-base-100'` → `--sxl-color-base-100`, `'font-family'` → `--sxl-font-family`).
5
+ * The generator just prepends `--sxl-`.
6
+ *
7
+ * A **token** is one named entry (a key); a **`TokenTheme`** is a set of their values. There is no "surface" or
8
+ * "mode" object — those are composition: mode is a `themeVars` / `buildThemeCSS` argument, and a surface is
9
+ * a `Partial<TokenTheme>` merged on top (grid/header surfaces live in grid-react — grid additions, not generic).
10
+ *
11
+ * Colors, fonts, and geometry all live here together. Document colors/fonts (`--sxl-sys-color-*`, `--sxl-doc-*`,
12
+ * cell content) are a separate layer, not modeled here.
13
+ *
14
+ * ## The token test
15
+ *
16
+ * A key exists here **iff a host theming system would name that color**. Surfaces, interaction states, and
17
+ * semantic hues pass — MUI names `background.paper` / `action.hover` / `palette.primary`; VS Code names
18
+ * `input.background` / `list.hoverBackground`. *Techniques* and *app regions* fail: "elevation", a wash, a
19
+ * toolbar, a titlebar are style choices an app composes FROM tokens, never tokens themselves. That is what
20
+ * keeps this vocabulary mappable onto any theming system instead of duplicating one. It cuts both ways: an
21
+ * app-level idea (a brighter toolbar, a titlebar that dims when unfocused) is expressed in the app's own
22
+ * styles — apps are free to make such additions; they don't get to grow the vocabulary.
23
+ *
24
+ * ## The four categories, and which `-border` / `-content` goes with each
25
+ *
26
+ * | category | tokens | `-border` | `-content` |
27
+ * | --- | --- | --- | --- |
28
+ * | ground | `base-100/200/300`, `base-content` | yes — `base-border` | yes |
29
+ * | role surfaces | `input`, `elevated` | yes, each its own | no — inherit `base-content` |
30
+ * | interaction states | `base-hover`, `base-selected`, `base-emphasis` | no | `selected`/`emphasis` yes; `hover` no |
31
+ * | semantic hues | `primary`, `info`, `success`, `warning`, `error`, `accent` | no | yes |
32
+ *
33
+ * - **Each opaque surface has its own `-border`.** The ground's is `base-border`; the role surfaces have
34
+ * `input-border` and `elevated-border`. Draw a surface's edge with the one that belongs to it. They are
35
+ * independent values, not shades of each other — a host can give fields a hard edge and the grid a faint
36
+ * one. Interaction states have none: they are translucent, so whatever is under them still shows its edge.
37
+ * - **Fills that change the text color name their own `-content`.** Text is `base-content` by default; paint
38
+ * with `selected`, `emphasis`, or a semantic hue and you take that fill's `-content` for text on it.
39
+ * `hover` and the role surfaces have none, so `base-content` still applies — for `input` and `elevated`
40
+ * that is a contract, and a host must choose fills it stays readable on.
41
+ *
42
+ * (`neutral`, `shadow`, the categorical `series` ramp, fonts, geometry, and `image-background` sit outside
43
+ * the surface/state system — standalone named values.)
44
+ */
45
+ export interface TokenTheme {
46
+ 'color-base-100'?: string;
47
+ 'color-base-200'?: string;
48
+ 'color-base-300'?: string;
49
+ 'color-base-content'?: string;
50
+ /**
51
+ * The **ground's border** — what separates a ground surface from an adjacent one: the seam framing the
52
+ * grid body, the rule above the status bar, the line the sheet tabs notch into.
53
+ *
54
+ * @remarks
55
+ * Distinct from `base-300`, which is the faint gridline and the ramp's third *fill* step. This one carries
56
+ * structure, so it is normally the stronger of the two — set both if the grid's outline should differ from
57
+ * its gridlines.
58
+ *
59
+ * Hosts name this: MUI `palette.divider`, VS Code `panel.border` / `editorGroup.border` / `contrastBorder`.
60
+ * Translucent by default, so it composes over whichever ground it lands on.
61
+ *
62
+ * The seam it draws is **not owned by one component**. Its segments belong to several — the sheet's grid
63
+ * edge, the tab strip's top line and the notch the selected tab cuts into it, the scrollbar and
64
+ * split-resizer dividers, the status bar's rule — and they must read as a single continuous line. Any of
65
+ * them open-coding its own color is what lets the seam drift apart, so each paints from THIS token.
66
+ *
67
+ * A segment rendered from inside another surface (the grid edge, drawn from within the grid) declares
68
+ * `themeSurfaceProps('app', …)` so the token resolves as chrome. That is the ordinary surface mechanism,
69
+ * nothing specific to borders.
70
+ */
71
+ 'color-base-border'?: string;
72
+ 'color-base-hover'?: string;
73
+ /**
74
+ * The **selected** interaction state — the fill for a selected row / column header, list row, tab.
75
+ *
76
+ * @remarks
77
+ * The sibling of {@link TokenTheme['color-base-hover'] color-base-hover}, and it exists for the same
78
+ * reason: selection is an interaction *state*, and `base-100/200/300` is a depth *ramp* with no slot for
79
+ * one. Without it, selection was open-coded at the call site as a fixed `color-mix(primary 20%,
80
+ * transparent)` — a ratio tuned against a light surface, which collapses on a dark one (20% of a mid
81
+ * accent over a near-black header lands within a few units of the header itself). A per-mode token lets
82
+ * each mode carry a ratio that actually reads. Stated relative to `--sxl-color-primary`, so it still
83
+ * follows a host's accent.
84
+ */
85
+ 'color-base-selected'?: string;
86
+ /** Text/iconography on {@link TokenTheme['color-base-selected'] color-base-selected}. */
87
+ 'color-base-selected-content'?: string;
88
+ /**
89
+ * The **emphatic** selection state — a whole row/column selected rather than touched (select-all).
90
+ *
91
+ * @remarks
92
+ * A third state token rather than a reuse of `color-accent`: `accent` is a different *hue role*
93
+ * (decoration — icon accent layers, chart series), and its `-content` means "text on the accent fill",
94
+ * which this is not. Its own pair also fixes a broken guarantee. The call site painted a muted accent
95
+ * (`color-mix(primary 75%, base-100)`) but took `primary-content` for text — and `primary-content` is
96
+ * MUI's `contrastText`, *computed against pure `primary.main`*. The mute silently invalidates it: in
97
+ * light that pairing measures 3.17:1, under AA, where MUI believed it was guaranteeing 4.60:1. Authoring
98
+ * the content per mode against the ACTUAL fill removes the computation from the loop entirely.
99
+ */
100
+ 'color-base-emphasis'?: string;
101
+ /**
102
+ * Text/iconography on {@link TokenTheme['color-base-emphasis'] color-base-emphasis}.
103
+ *
104
+ * @remarks
105
+ * Authored against a *mid-luminance* muted accent, which is what the default fill resolves to in both
106
+ * modes — so both modes want dark-ish text, and neither can be derived from the accent's own contrast
107
+ * pairing. A host whose `primary` is unusually dark or light should state this alongside the fill.
108
+ */
109
+ 'color-base-emphasis-content'?: string;
110
+ /**
111
+ * The **field** surface — the formula bar, the name box, and text inputs. A *role* token, deliberately
112
+ * not a step of the `base-*` ramp: the ramp expresses elevation (a Material idea, where "raised" implies
113
+ * "lighter"), while a flat design language (VS Code, Fluent) gives fields their own named color that is
114
+ * often DARKER than the chrome around them. A host that has such a color sets this; otherwise the app
115
+ * layer derives it from the paper surface and nothing changes.
116
+ */
117
+ 'color-input'?: string;
118
+ /**
119
+ * The field border — what separates {@link TokenTheme['color-input'] color-input} from the surface it sits
120
+ * on. Its own token (not `base-300`) for the same reason: in a flat language the field border is the ONLY
121
+ * thing carrying the field's structure, so it must be settable at full strength and never derived by
122
+ * multiplying a divider's alpha.
123
+ */
124
+ 'color-input-border'?: string;
125
+ /**
126
+ * The fill of a **floating container** — popup panels, menus, popovers: chrome that leaves the layout
127
+ * and covers arbitrary content. A docked region that wants to read as the same surface (the toolbar
128
+ * palette) reads this same token; that is an app style choice, not a second token.
129
+ *
130
+ * @remarks
131
+ * Must be **opaque** — it is applied as `background-color`, which replaces the surface, and there is no
132
+ * guarantee about what it covers.
133
+ *
134
+ * Material gets this for free by washing the paper lighter ({@link TokenTheme['color-elevated-border']}
135
+ * explains why that stops working in a flat host). Stating it as a token lets a host put the step back
136
+ * deliberately, in whichever direction its language wants — lighter on dark, darker on light — instead of
137
+ * inheriting Material's "up is lighter" assumption. Defaults to the paper surface, so unset changes nothing.
138
+ *
139
+ * **One step per kind, not a scale.** There is deliberately no `elevated-2` / `elevated-3`, and no
140
+ * "elevation" token at all — elevation is a *technique*, which fails the token test above. Material needs
141
+ * a numbered ramp because lightness is its ONLY depth signal; once depth is carried by border + shadow
142
+ * those compose on their own (a submenu over a menu still reads), so a second *fill* buys nothing. A
143
+ * region that wants a subtle lift rather than this fill (a titlebar) paints its own wash over whatever it
144
+ * sits on — an app style, not a token.
145
+ */
146
+ 'color-elevated'?: string;
147
+ /**
148
+ * The border on a **raised container** — popup panels, menus, the toolbar palette.
149
+ *
150
+ * @remarks
151
+ * In Material, "raised" is expressed as *lightness*: these surfaces take the `raisedSurface` wash and
152
+ * carry no border. A flat design language expresses it as **border + shadow** with the fill held nearly
153
+ * constant (VS Code's own find widget and menus do exactly this). A host that flattens the wash — see
154
+ * `--sxl-surface-raised` — therefore has to put the structure back somewhere, and this is it.
155
+ * Defaults to `transparent`, so the Material presentation is unchanged unless a host opts in.
156
+ */
157
+ 'color-elevated-border'?: string;
158
+ 'color-accent'?: string;
159
+ 'color-accent-content'?: string;
160
+ 'color-primary'?: string;
161
+ 'color-primary-content'?: string;
162
+ 'color-info'?: string;
163
+ 'color-info-content'?: string;
164
+ 'color-success'?: string;
165
+ 'color-success-content'?: string;
166
+ 'color-warning'?: string;
167
+ 'color-warning-content'?: string;
168
+ 'color-error'?: string;
169
+ 'color-error-content'?: string;
170
+ 'color-neutral'?: string;
171
+ 'color-shadow'?: string;
172
+ 'color-series'?: string[];
173
+ 'font-family'?: string;
174
+ /** Monospace stack for code-ish chrome (the formula signature, argument names, evaluated-run tips). */
175
+ 'font-family-mono'?: string;
176
+ 'font-size'?: string;
177
+ 'font-weight'?: string;
178
+ 'font-style'?: string;
179
+ 'radius-field'?: string;
180
+ 'radius-box'?: string;
181
+ 'border'?: string;
182
+ /**
183
+ * The `background-image` painted behind image-bearing placeholders/frames (charts, shapes, slicers, the
184
+ * column button) — a faint light wash over a dark surface, `none` in light. Mode-driven, so consumers just
185
+ * read `var(--sxl-image-background)` and it follows the surface.
186
+ *
187
+ * @remarks
188
+ * The sibling `--sxl-image-filter` (dark-image invert) is deliberately NOT a token: it carries a runtime
189
+ * preference gate (`enableDarkImages`) that a pure mode-driven token can't express — a descendant grid scope
190
+ * would re-emit and un-gate it. It's a single workbook-root computed var instead (see WorkbookElement).
191
+ */
192
+ 'image-background'?: string;
193
+ }
194
+ /** Light / dark selector — the one axis `themeVars` resolves; a `TokenTheme` is the values for one mode. */
195
+ export type ThemeMode = 'light' | 'dark';
196
+ //# sourceMappingURL=TokenTheme.d.ts.map