@sheetxl/utils-react 0.8.0-beta.17 → 0.8.0-beta.19
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.
- package/browser/esm/{acZl3_ZdNxn-qA0L.mjs → Bcqe_8um4_cRECAw.mjs} +1 -1
- package/browser/esm/{B-Ev_UDxssXX20MR.mjs → OxtTAi408Mk_-MV2.mjs} +2 -2
- package/browser/esm/index.mjs +961 -850
- package/browser/esm/q48pBRd6tnqnhaoj.mjs +100 -0
- package/node/esm/{DYrEG6X_7odolmFV.mjs → CMJ_8SopdnIIgif-.mjs} +1 -1
- package/node/esm/CtpAJ3_rL0eHTsak.mjs +100 -0
- package/node/esm/index.mjs +1573 -1458
- package/package.json +2 -2
- package/types/src/command/CommandButtonRegistry.d.ts +3 -1
- package/types/src/float/_FloatTheme.d.ts +17 -0
- package/types/src/hooks/useVisualViewportRect.d.ts +2 -1
- package/types/src/icons/packs/Base.json.d.ts +119 -4
- package/types/src/persistence/Types.d.ts +4 -2
- package/types/src/theme/useResolvedThemeMode.d.ts +22 -4
- package/types/src/virtualKeyboard/KeyboardAccessory.d.ts +73 -0
- package/types/src/virtualKeyboard/VirtualKeyboard.d.ts +8 -2
- package/types/src/virtualKeyboard/_keyboardApi.d.ts +13 -0
- package/types/src/virtualKeyboard/index.d.ts +2 -0
- package/types/src/virtualKeyboard/useKeyboardResize.d.ts +41 -0
- package/browser/esm/D6KbCA02qP-TsUhv.mjs +0 -100
- package/node/esm/CCgcNfDzn5WUi4My.mjs +0 -100
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.19",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@floating-ui/react-dom": "^2.1.9",
|
|
43
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
43
|
+
"@sheetxl/utils": "^0.8.0-beta.19",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"prop-types": "^15.8.1",
|
|
@@ -81,10 +81,12 @@ export interface ICommandButtonRegistry {
|
|
|
81
81
|
* an entry names via `defaultKey`, not an arbitrary command key. Suppressed when `replace` is true.
|
|
82
82
|
* @param entry The entry (must have a `key`).
|
|
83
83
|
* @param replace Whether to replace an existing entry with the same key. Default is false.
|
|
84
|
+
* @returns A function that removes this registration. It does nothing once the key is unregistered
|
|
85
|
+
* or registered again by someone else.
|
|
84
86
|
*/
|
|
85
87
|
register(entry: CommandButtonEntry & {
|
|
86
88
|
key: string;
|
|
87
|
-
}, replace?: boolean): void;
|
|
89
|
+
}, replace?: boolean): () => void;
|
|
88
90
|
/**
|
|
89
91
|
* Unregister an item.
|
|
90
92
|
* @param key The unique key for the item.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ThemeAttrs } from '../theme';
|
|
2
|
+
import { FloatThemeScope } from './FloatUtils';
|
|
3
|
+
/**
|
|
4
|
+
* The nearest `data-sxl-theme-mode` / `-surface` above an element. Read as an **external store**, not at
|
|
5
|
+
* render: the attrs live on an ANCESTOR's DOM, stamped in the same commit that re-renders the caller, so a
|
|
6
|
+
* render-time read sees the previous theme and nothing re-renders the caller afterwards. The store is
|
|
7
|
+
* re-checked after commit and on any later attribute change.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useElementThemeAttrs: (el: Element | null) => ThemeAttrs;
|
|
10
|
+
/**
|
|
11
|
+
* The theme an element portaled out of its themed subtree opens with (THEMING-DESIGN §7): the nearest
|
|
12
|
+
* `FloatProvider`'s theme scope, with the nearest `TokenThemeProvider` folded in — a React-inherited context
|
|
13
|
+
* that crosses the portal even though the cascade can't. Its scope class makes an `isolate`d provider's
|
|
14
|
+
* `@scope`d rules apply on the portal root, and its pinned mode is the fallback mode.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useFloatThemeScope: () => FloatThemeScope | undefined;
|
|
17
|
+
//# sourceMappingURL=_FloatTheme.d.ts.map
|
|
@@ -18,7 +18,8 @@ export interface VisualViewportRect {
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const getVisualViewportRect: () => VisualViewportRect | null;
|
|
20
20
|
/**
|
|
21
|
-
* Listen for the visual viewport resizing or scrolling
|
|
21
|
+
* Listen for the visual viewport resizing or scrolling, and for the browser reporting a change in a
|
|
22
|
+
* keyboard that overlays the page (which leaves the visual viewport as it is).
|
|
22
23
|
*
|
|
23
24
|
* @returns Stops listening.
|
|
24
25
|
*/
|
|
@@ -36,6 +36,18 @@ declare const _default: {
|
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
|
+
"Anomalies": {
|
|
40
|
+
"svg": [
|
|
41
|
+
{
|
|
42
|
+
"d": "m 9.330289,5.4950546 a 0.34209685,0.34209685 0 0 0 -0.042756,0.010668 0.34209685,0.34209685 0 0 0 -0.1282737,0.064138 0.34209685,0.34209685 0 0 0 -0.021373,0.010668 0.34209685,0.34209685 0 0 0 0,0.010668 0.34209685,0.34209685 0 0 0 -0.042756,0.042756 0.34209685,0.34209685 0 0 0 0,0.010668 0.34209685,0.34209685 0 0 0 -0.021373,0.021374 0.34209685,0.34209685 0 0 0 0,0.010668 0.34209685,0.34209685 0 0 0 -0.053442,0.1175843 0.34209685,0.34209685 0 0 0 0,0.010668 L 7,11 5.5889916,6.7669814 A 0.34209685,0.34209685 0 0 0 4.9583136,6.7242257 L 3.6862682,9.26831 H 2.5211177 a 0.34209685,0.34209685 0 0 0 -0.03207,0 0.34243825,0.34243825 0 1 0 0.03207,0.684125 h 1.2079081 a 0.34209685,0.34209685 0 0 0 0.4382679,-0.1282737 0.34209685,0.34209685 0 0 0 0.021373,-0.042755 0.34209685,0.34209685 0 0 0 0.010687,-0.010602 0.34209685,0.34209685 0 0 0 0,-0.010612 l 0.010687,-0.021205 a 0.34209685,0.34209685 0 0 0 0.010687,-0.032153 l 0.9727397,-1.9454772 1.453766,4.3506269 a 0.34209685,0.34209685 0 0 0 0.6413683,0.0212 L 9.3409773,6.8525849 11.094048,12.11181 a 0.34209685,0.34209685 0 0 0 0.641368,0.0212 l 1.721002,-4.3078695 0.673436,1.7744508 a 0.34243823,0.34243823 0 0 0 0.08551,0.224495 0.34209685,0.34209685 0 0 0 0.04276,0.053433 0.34243823,0.34243823 0 0 0 0.02137,0.021205 0.34209685,0.34209685 0 0 0 0.01068,0 0.34243823,0.34243823 0 0 0 0.02138,0.010612 0.34209685,0.34209685 0 0 0 0.299311,0.042765 h 1.250666 a 0.34209685,0.34209685 0 1 0 0,-0.6841259 H 14.728464 L 13.787791,6.755966 A 0.34209685,0.34209685 0 0 0 13.157113,6.7452983 L 11.446801,11.010385 9.7044192,5.7725577 a 0.34209685,0.34209685 0 0 0 -0.010682,-0.03205 0.34209685,0.34209685 0 0 0 -0.010691,-0.032051 0.34209685,0.34209685 0 0 0 -0.032065,-0.064138 0.34209685,0.34209685 0 0 0 -0.042756,-0.042756 0.34209685,0.34209685 0 0 0 -0.032069,-0.03205 0.34209685,0.34209685 0 0 0 -0.021374,-0.010668 0.34209685,0.34209685 0 0 0 -0.032069,-0.021383 0.34209685,0.34209685 0 0 0 -0.096205,-0.03205 0.34209685,0.34209685 0 0 0 -0.096205,-0.010668 z",
|
|
43
|
+
"className": "fill primary"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"d": "m 9.1445313,1.9277344 c 3.9843487,0 7.2167967,3.2324477 7.2167967,7.2167969 0,1.7875897 -0.654646,3.4321647 -1.742187,4.6972657 l -0.203125,0.236328 0.642578,0.615234 h 0.916015 l 5.464844,5.476563 -1.269531,1.269531 -5.476563,-5.464844 v -0.916015 l -0.615234,-0.642578 -0.234375,0.203125 c -1.265123,1.087569 -2.911633,1.742187 -4.6992187,1.742187 -3.9843492,0 -7.2167969,-3.232448 -7.2167969,-7.2167967 0,-3.9843492 3.2324477,-7.2167969 7.2167969,-7.2167969 z m 0,1.6660156 c -3.07113,0 -5.5507813,2.4796513 -5.5507813,5.5507813 0,3.0711297 2.4797193,5.5488277 5.5507813,5.5488277 3.0710627,0 5.5488277,-2.477765 5.5488277,-5.5488277 0,-3.071062 -2.477698,-5.5507813 -5.5488277,-5.5507813 z",
|
|
47
|
+
"className": "fill"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
39
51
|
"ArrowBack": {
|
|
40
52
|
"svg": [
|
|
41
53
|
{
|
|
@@ -616,6 +628,54 @@ declare const _default: {
|
|
|
616
628
|
}
|
|
617
629
|
]
|
|
618
630
|
},
|
|
631
|
+
"CommentManage": {
|
|
632
|
+
"svg": [
|
|
633
|
+
{
|
|
634
|
+
"d": "M 1.5175781 3.8789062 C 0.74071622 3.8789062 0.109375 4.5102039 0.109375 5.2871094 L 0.109375 14.169922 C 0.109375 14.94661 0.7406726 15.578125 1.5175781 15.578125 L 1.7792969 15.578125 L 1.7792969 19.78125 C 1.7792969 19.79583 1.7821231 19.808036 1.7832031 19.822266 C 1.7847231 19.844816 1.7850225 19.866802 1.7890625 19.888672 C 1.7927625 19.908342 1.7990995 19.928606 1.8046875 19.947266 C 1.8101475 19.966246 1.8151176 19.983653 1.8222656 20.001953 C 1.8295656 20.020603 1.838493 20.038671 1.8476562 20.056641 C 1.8564962 20.073601 1.864494 20.091142 1.875 20.107422 C 1.886182 20.124712 1.8992254 20.1405 1.9121094 20.15625 C 1.9238034 20.171 1.9343826 20.185319 1.9472656 20.199219 C 1.9637056 20.216179 1.9834731 20.232627 2.0019531 20.248047 C 2.0119911 20.255947 2.02057 20.265628 2.03125 20.273438 C 2.03397 20.27533 2.0363225 20.275344 2.0390625 20.277344 C 2.0495345 20.284644 2.0612576 20.292228 2.0722656 20.298828 C 2.0929496 20.311548 2.1130676 20.322021 2.1347656 20.332031 C 2.1464596 20.337131 2.159669 20.343096 2.171875 20.347656 C 2.195603 20.356656 2.2179575 20.363051 2.2421875 20.369141 C 2.2533795 20.371941 2.2658118 20.374753 2.2773438 20.376953 C 2.313791 20.383653 2.3501089 20.388672 2.3867188 20.388672 C 2.432482 20.388672 2.4769831 20.382607 2.5195312 20.373047 C 2.5312252 20.370347 2.5412144 20.366661 2.5527344 20.363281 C 2.5839236 20.354281 2.6136039 20.343468 2.6425781 20.330078 C 2.6566501 20.323378 2.6703718 20.316384 2.6835938 20.308594 C 2.708847 20.294184 2.7329724 20.277406 2.7558594 20.259766 C 2.7687434 20.249746 2.7810988 20.241319 2.7929688 20.230469 C 2.817546 20.208099 2.8406441 20.18254 2.8613281 20.15625 C 2.8668881 20.14915 2.873475 20.144339 2.8789062 20.136719 L 6.1699219 15.578125 L 11.460938 15.578125 L 12.0625 15.578125 L 12.0625 14.363281 L 5.859375 14.363281 C 5.846665 14.363281 5.8346366 14.365988 5.8222656 14.367188 C 5.7975136 14.36878 5.774416 14.3705 5.75 14.375 C 5.732196 14.3783 5.7142176 14.384012 5.6972656 14.388672 C 5.6765816 14.394172 5.656725 14.400423 5.6367188 14.408203 C 5.6197668 14.415003 5.6041556 14.423351 5.5878906 14.431641 C 5.5689086 14.441341 5.549218 14.449578 5.53125 14.460938 C 5.515988 14.47095 5.5026812 14.482941 5.4882812 14.494141 C 5.471504 14.507031 5.4547031 14.520066 5.4394531 14.535156 C 5.4248791 14.549236 5.4114855 14.564488 5.3984375 14.580078 C 5.3879655 14.592458 5.3770175 14.602014 5.3671875 14.615234 L 2.9941406 17.902344 L 2.9941406 14.970703 C 2.9941406 14.635063 2.7223557 14.363281 2.3867188 14.363281 L 1.5175781 14.363281 C 1.4106149 14.363281 1.3242187 14.276536 1.3242188 14.169922 L 1.3242188 5.2890625 C 1.3242188 5.1820993 1.4106078 5.09375 1.5175781 5.09375 L 16.277344 5.09375 C 16.384308 5.09375 16.472656 5.1819242 16.472656 5.2890625 L 16.472656 10.392578 L 17.6875 10.392578 L 17.6875 7.8398438 L 17.6875 5.2871094 C 17.6875 4.5102465 17.054248 3.8789063 16.277344 3.8789062 L 1.5175781 3.8789062 z ",
|
|
635
|
+
"className": "fill"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"d": "m 15.386715,9.0817687 c 0,-1.056852 -0.86001,-1.916861 -1.917397,-1.916861 -1.056851,0 -1.916862,0.859831 -1.916862,1.916861 0,1.0570293 0.859833,1.9172173 1.916862,1.9172173 1.057387,0 1.917397,-0.860188 1.917397,-1.9172173 z m -1.917219,0.668565 c -0.368602,0 -0.668208,-0.29997 -0.668208,-0.668565 0,-0.368594 0.299624,-0.668209 0.668208,-0.668209 0.368777,0 0.668744,0.299624 0.668744,0.668209 -1.67e-4,0.368602 -0.300145,0.668565 -0.668744,0.668565 z M 8.8865838,7.1650867 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.9168592,-0.86001 1.9168592,-1.9172163 0,-1.05685 -0.8598292,-1.91686 -1.9168592,-1.91686 z m 0,2.58547 c -0.368605,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299623,-0.668208 0.66821,-0.668208 0.368583,0 0.668207,0.299624 0.668207,0.668208 0,0.368586 -0.299798,0.668565 -0.668207,0.668565 z m -4.583006,-2.58547 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.916862,-0.86001 1.916862,-1.9172163 0,-1.05685 -0.859832,-1.91686 -1.916862,-1.91686 z m 0,2.58547 c -0.368602,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299626,-0.668208 0.66821,-0.668208 0.368603,0 0.668208,0.299624 0.668208,0.668208 0,0.368586 -0.299973,0.668565 -0.668208,0.668565 z",
|
|
639
|
+
"className": "fill"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"d": "m 17.974211,17.405668 c 0.681611,0.0058 1.364585,-0.01175 2.045334,0.009 0.415169,0.06249 0.53006,0.676198 0.171308,0.889376 -0.276707,0.141539 -0.600757,0.05677 -0.901083,0.07988 -0.470451,-0.0056 -0.942245,0.01152 -1.411839,-0.009 -0.416532,-0.06317 -0.525285,-0.67409 -0.171308,-0.889377 0.07801,-0.05411 0.173272,-0.0804 0.267588,-0.07988 z m -0.481286,-1.372846 c -0.0128,-0.346431 0.343637,-0.531708 0.648481,-0.48442 0.626863,0.0058 1.255088,-0.01175 1.881095,0.009 0.416532,0.06317 0.525285,0.674088 0.171308,0.889375 -0.276707,0.141539 -0.600757,0.05677 -0.901082,0.07988 -0.470219,-0.0056 -0.941779,0.01152 -1.411138,-0.009 -0.225402,-0.04099 -0.395479,-0.258696 -0.388664,-0.484837 z m -0.849789,0 c 0.02648,0.414379 -0.544763,0.669276 -0.82647,0.351701 -0.32395,-0.29175 -0.05019,-0.904773 0.39126,-0.833903 0.240139,0.01825 0.442209,0.241235 0.43521,0.482202 z m -0.488598,2.352207 c -0.446776,0.02542 -0.655381,-0.609097 -0.305816,-0.869406 0.311597,-0.285351 0.857219,0.02324 0.787838,0.434018 -0.01825,0.240105 -0.241006,0.442369 -0.482022,0.435388 z m -1.1866,-5.25849 c -0.829939,-0.03181 -1.549401,0.760208 -1.464118,1.581447 0.0044,1.633289 -0.0087,3.267072 0.0066,4.900048 0.05321,0.783308 0.824151,1.399107 1.598211,1.314819 1.948735,-0.0044 3.897965,0.0087 5.846386,-0.0066 0.783287,-0.05326 1.399212,-0.824093 1.314846,-1.598227 -0.0044,-1.625468 0.0087,-3.251429 -0.0066,-4.876584 -0.05321,-0.783312 -0.824151,-1.399112 -1.598211,-1.314822 -1.899037,0 -3.798075,0 -5.697113,0 z",
|
|
643
|
+
"className": "fill primary"
|
|
644
|
+
}
|
|
645
|
+
]
|
|
646
|
+
},
|
|
647
|
+
"CommentNext": {
|
|
648
|
+
"svg": [
|
|
649
|
+
{
|
|
650
|
+
"d": "M 1.5175781 3.8789062 C 0.74071622 3.8789062 0.109375 4.5102039 0.109375 5.2871094 L 0.109375 14.169922 C 0.109375 14.94661 0.7406726 15.578125 1.5175781 15.578125 L 1.7792969 15.578125 L 1.7792969 19.78125 C 1.7792969 19.79583 1.7821231 19.808036 1.7832031 19.822266 C 1.7847231 19.844816 1.7850225 19.866802 1.7890625 19.888672 C 1.7927625 19.908342 1.7990995 19.928606 1.8046875 19.947266 C 1.8101475 19.966246 1.8151176 19.983653 1.8222656 20.001953 C 1.8295656 20.020603 1.838493 20.038671 1.8476562 20.056641 C 1.8564962 20.073601 1.864494 20.091142 1.875 20.107422 C 1.886182 20.124712 1.8992254 20.1405 1.9121094 20.15625 C 1.9238034 20.171 1.9343826 20.185319 1.9472656 20.199219 C 1.9637056 20.216179 1.9834731 20.232627 2.0019531 20.248047 C 2.0119911 20.255947 2.02057 20.265628 2.03125 20.273438 C 2.03397 20.27533 2.0363225 20.275344 2.0390625 20.277344 C 2.0495345 20.284644 2.0612576 20.292228 2.0722656 20.298828 C 2.0929496 20.311548 2.1130676 20.322021 2.1347656 20.332031 C 2.1464596 20.337131 2.159669 20.343096 2.171875 20.347656 C 2.195603 20.356656 2.2179575 20.363051 2.2421875 20.369141 C 2.2533795 20.371941 2.2658118 20.374753 2.2773438 20.376953 C 2.313791 20.383653 2.3501089 20.388672 2.3867188 20.388672 C 2.432482 20.388672 2.4769831 20.382607 2.5195312 20.373047 C 2.5312252 20.370347 2.5412144 20.366661 2.5527344 20.363281 C 2.5839236 20.354281 2.6136039 20.343468 2.6425781 20.330078 C 2.6566501 20.323378 2.6703718 20.316384 2.6835938 20.308594 C 2.708847 20.294184 2.7329724 20.277406 2.7558594 20.259766 C 2.7687434 20.249746 2.7810988 20.241319 2.7929688 20.230469 C 2.817546 20.208099 2.8406441 20.18254 2.8613281 20.15625 C 2.8668881 20.14915 2.873475 20.144339 2.8789062 20.136719 L 6.1699219 15.578125 L 11.460938 15.578125 L 12.0625 15.578125 L 12.0625 14.363281 L 5.859375 14.363281 C 5.846665 14.363281 5.8346366 14.365988 5.8222656 14.367188 C 5.7975136 14.36878 5.774416 14.3705 5.75 14.375 C 5.732196 14.3783 5.7142176 14.384012 5.6972656 14.388672 C 5.6765816 14.394172 5.656725 14.400423 5.6367188 14.408203 C 5.6197668 14.415003 5.6041556 14.423351 5.5878906 14.431641 C 5.5689086 14.441341 5.549218 14.449578 5.53125 14.460938 C 5.515988 14.47095 5.5026812 14.482941 5.4882812 14.494141 C 5.471504 14.507031 5.4547031 14.520066 5.4394531 14.535156 C 5.4248791 14.549236 5.4114855 14.564488 5.3984375 14.580078 C 5.3879655 14.592458 5.3770175 14.602014 5.3671875 14.615234 L 2.9941406 17.902344 L 2.9941406 14.970703 C 2.9941406 14.635063 2.7223557 14.363281 2.3867188 14.363281 L 1.5175781 14.363281 C 1.4106149 14.363281 1.3242187 14.276536 1.3242188 14.169922 L 1.3242188 5.2890625 C 1.3242188 5.1820993 1.4106078 5.09375 1.5175781 5.09375 L 16.277344 5.09375 C 16.384308 5.09375 16.472656 5.1819242 16.472656 5.2890625 L 16.472656 10.392578 L 17.6875 10.392578 L 17.6875 7.8398438 L 17.6875 5.2871094 C 17.6875 4.5102465 17.054248 3.8789063 16.277344 3.8789062 L 1.5175781 3.8789062 z ",
|
|
651
|
+
"className": "fill"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"d": "m 15.386715,9.0817687 c 0,-1.056852 -0.86001,-1.916861 -1.917397,-1.916861 -1.056851,0 -1.916862,0.859831 -1.916862,1.916861 0,1.0570293 0.859833,1.9172173 1.916862,1.9172173 1.057387,0 1.917397,-0.860188 1.917397,-1.9172173 z m -1.917219,0.668565 c -0.368602,0 -0.668208,-0.29997 -0.668208,-0.668565 0,-0.368594 0.299624,-0.668209 0.668208,-0.668209 0.368777,0 0.668744,0.299624 0.668744,0.668209 -1.67e-4,0.368602 -0.300145,0.668565 -0.668744,0.668565 z M 8.8865838,7.1650867 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.9168592,-0.86001 1.9168592,-1.9172163 0,-1.05685 -0.8598292,-1.91686 -1.9168592,-1.91686 z m 0,2.58547 c -0.368605,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299623,-0.668208 0.66821,-0.668208 0.368583,0 0.668207,0.299624 0.668207,0.668208 0,0.368586 -0.299798,0.668565 -0.668207,0.668565 z m -4.583006,-2.58547 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.916862,-0.86001 1.916862,-1.9172163 0,-1.05685 -0.859832,-1.91686 -1.916862,-1.91686 z m 0,2.58547 c -0.368602,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299626,-0.668208 0.66821,-0.668208 0.368603,0 0.668208,0.299624 0.668208,0.668208 0,0.368586 -0.299973,0.668565 -0.668208,0.668565 z",
|
|
655
|
+
"className": "fill"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"d": "m 13.297149,16.852053 h 6.678822 l -3.067758,-3.067757 0.779286,-0.7738 4.390352,4.39035 -4.390352,4.390352 -0.773798,-0.7738 3.06227,-3.067757 h -6.678822 z",
|
|
659
|
+
"className": "fill primary"
|
|
660
|
+
}
|
|
661
|
+
]
|
|
662
|
+
},
|
|
663
|
+
"CommentPrevious": {
|
|
664
|
+
"svg": [
|
|
665
|
+
{
|
|
666
|
+
"d": "M 1.5175781 3.8789062 C 0.74071622 3.8789062 0.109375 4.5102039 0.109375 5.2871094 L 0.109375 14.169922 C 0.109375 14.94661 0.7406726 15.578125 1.5175781 15.578125 L 1.7792969 15.578125 L 1.7792969 19.78125 C 1.7792969 19.79583 1.7821231 19.808036 1.7832031 19.822266 C 1.7847231 19.844816 1.7850225 19.866802 1.7890625 19.888672 C 1.7927625 19.908342 1.7990995 19.928606 1.8046875 19.947266 C 1.8101475 19.966246 1.8151176 19.983653 1.8222656 20.001953 C 1.8295656 20.020603 1.838493 20.038671 1.8476562 20.056641 C 1.8564962 20.073601 1.864494 20.091142 1.875 20.107422 C 1.886182 20.124712 1.8992254 20.1405 1.9121094 20.15625 C 1.9238034 20.171 1.9343826 20.185319 1.9472656 20.199219 C 1.9637056 20.216179 1.9834731 20.232627 2.0019531 20.248047 C 2.0119911 20.255947 2.02057 20.265628 2.03125 20.273438 C 2.03397 20.27533 2.0363225 20.275344 2.0390625 20.277344 C 2.0495345 20.284644 2.0612576 20.292228 2.0722656 20.298828 C 2.0929496 20.311548 2.1130676 20.322021 2.1347656 20.332031 C 2.1464596 20.337131 2.159669 20.343096 2.171875 20.347656 C 2.195603 20.356656 2.2179575 20.363051 2.2421875 20.369141 C 2.2533795 20.371941 2.2658118 20.374753 2.2773438 20.376953 C 2.313791 20.383653 2.3501089 20.388672 2.3867188 20.388672 C 2.432482 20.388672 2.4769831 20.382607 2.5195312 20.373047 C 2.5312252 20.370347 2.5412144 20.366661 2.5527344 20.363281 C 2.5839236 20.354281 2.6136039 20.343468 2.6425781 20.330078 C 2.6566501 20.323378 2.6703718 20.316384 2.6835938 20.308594 C 2.708847 20.294184 2.7329724 20.277406 2.7558594 20.259766 C 2.7687434 20.249746 2.7810988 20.241319 2.7929688 20.230469 C 2.817546 20.208099 2.8406441 20.18254 2.8613281 20.15625 C 2.8668881 20.14915 2.873475 20.144339 2.8789062 20.136719 L 6.1699219 15.578125 L 11.460938 15.578125 L 12.0625 15.578125 L 12.0625 14.363281 L 5.859375 14.363281 C 5.846665 14.363281 5.8346366 14.365988 5.8222656 14.367188 C 5.7975136 14.36878 5.774416 14.3705 5.75 14.375 C 5.732196 14.3783 5.7142176 14.384012 5.6972656 14.388672 C 5.6765816 14.394172 5.656725 14.400423 5.6367188 14.408203 C 5.6197668 14.415003 5.6041556 14.423351 5.5878906 14.431641 C 5.5689086 14.441341 5.549218 14.449578 5.53125 14.460938 C 5.515988 14.47095 5.5026812 14.482941 5.4882812 14.494141 C 5.471504 14.507031 5.4547031 14.520066 5.4394531 14.535156 C 5.4248791 14.549236 5.4114855 14.564488 5.3984375 14.580078 C 5.3879655 14.592458 5.3770175 14.602014 5.3671875 14.615234 L 2.9941406 17.902344 L 2.9941406 14.970703 C 2.9941406 14.635063 2.7223557 14.363281 2.3867188 14.363281 L 1.5175781 14.363281 C 1.4106149 14.363281 1.3242187 14.276536 1.3242188 14.169922 L 1.3242188 5.2890625 C 1.3242188 5.1820993 1.4106078 5.09375 1.5175781 5.09375 L 16.277344 5.09375 C 16.384308 5.09375 16.472656 5.1819242 16.472656 5.2890625 L 16.472656 10.392578 L 17.6875 10.392578 L 17.6875 7.8398438 L 17.6875 5.2871094 C 17.6875 4.5102465 17.054248 3.8789063 16.277344 3.8789062 L 1.5175781 3.8789062 z ",
|
|
667
|
+
"className": "fill"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"d": "m 15.386715,9.0817687 c 0,-1.056852 -0.86001,-1.916861 -1.917397,-1.916861 -1.056851,0 -1.916862,0.859831 -1.916862,1.916861 0,1.0570293 0.859833,1.9172173 1.916862,1.9172173 1.057387,0 1.917397,-0.860188 1.917397,-1.9172173 z m -1.917219,0.668565 c -0.368602,0 -0.668208,-0.29997 -0.668208,-0.668565 0,-0.368594 0.299624,-0.668209 0.668208,-0.668209 0.368777,0 0.668744,0.299624 0.668744,0.668209 -1.67e-4,0.368602 -0.300145,0.668565 -0.668744,0.668565 z M 8.8865838,7.1650867 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.9168592,-0.86001 1.9168592,-1.9172163 0,-1.05685 -0.8598292,-1.91686 -1.9168592,-1.91686 z m 0,2.58547 c -0.368605,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299623,-0.668208 0.66821,-0.668208 0.368583,0 0.668207,0.299624 0.668207,0.668208 0,0.368586 -0.299798,0.668565 -0.668207,0.668565 z m -4.583006,-2.58547 c -1.056852,0 -1.916862,0.85983 -1.916862,1.91686 0,1.0570293 0.859832,1.9172163 1.916862,1.9172163 1.05703,0 1.916862,-0.86001 1.916862,-1.9172163 0,-1.05685 -0.859832,-1.91686 -1.916862,-1.91686 z m 0,2.58547 c -0.368602,0 -0.66821,-0.299971 -0.66821,-0.668565 0,-0.368595 0.299626,-0.668208 0.66821,-0.668208 0.368603,0 0.668208,0.299624 0.668208,0.668208 0,0.368586 -0.299973,0.668565 -0.668208,0.668565 z",
|
|
671
|
+
"className": "fill"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"d": "m 22.077851,16.852053 h -6.678822 l 3.067758,-3.067757 -0.779286,-0.7738 -4.390352,4.39035 4.390352,4.390352 0.773798,-0.7738 -3.06227,-3.067757 h 6.678822 z",
|
|
675
|
+
"className": "fill primary"
|
|
676
|
+
}
|
|
677
|
+
]
|
|
678
|
+
},
|
|
619
679
|
"NoteInsert": {
|
|
620
680
|
"svg": [
|
|
621
681
|
{
|
|
@@ -2019,6 +2079,46 @@ declare const _default: {
|
|
|
2019
2079
|
}
|
|
2020
2080
|
]
|
|
2021
2081
|
},
|
|
2082
|
+
"SparklineColumn": {
|
|
2083
|
+
"svg": [
|
|
2084
|
+
{
|
|
2085
|
+
"d": "M3 4h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm.5 1.5v13h17v-13z",
|
|
2086
|
+
"className": "fill"
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
"d": "M5 12h2v5H5zm4-4h2v9H9zm4 5h2v4h-2zm4-6h2v10h-2z",
|
|
2090
|
+
"className": "fill primary"
|
|
2091
|
+
}
|
|
2092
|
+
]
|
|
2093
|
+
},
|
|
2094
|
+
"SparklineLine": {
|
|
2095
|
+
"svg": [
|
|
2096
|
+
{
|
|
2097
|
+
"d": "M3 4h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm.5 1.5v13h17v-13z",
|
|
2098
|
+
"className": "fill"
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
"d": "M5.2 15.6 9.1 9.4l4 3.9 5-5.6 1.2 1-6.1 6.8-3.9-3.8-2.9 4.7z",
|
|
2102
|
+
"className": "fill primary"
|
|
2103
|
+
}
|
|
2104
|
+
]
|
|
2105
|
+
},
|
|
2106
|
+
"SparklineWinLoss": {
|
|
2107
|
+
"svg": [
|
|
2108
|
+
{
|
|
2109
|
+
"d": "M3 4h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm.5 1.5v13h17v-13z",
|
|
2110
|
+
"className": "fill"
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
"d": "M5 7h2v4.5H5zm8 0h2v4.5h-2z",
|
|
2114
|
+
"className": "fill primary"
|
|
2115
|
+
},
|
|
2116
|
+
{
|
|
2117
|
+
"d": "M9 12.5h2V17H9zm8 0h2V17h-2z",
|
|
2118
|
+
"className": "fill error"
|
|
2119
|
+
}
|
|
2120
|
+
]
|
|
2121
|
+
},
|
|
2022
2122
|
"Ungroup": {
|
|
2023
2123
|
"svg": [
|
|
2024
2124
|
{
|
|
@@ -2584,6 +2684,18 @@ declare const _default: {
|
|
|
2584
2684
|
}
|
|
2585
2685
|
]
|
|
2586
2686
|
},
|
|
2687
|
+
"Pivot": {
|
|
2688
|
+
"svg": [
|
|
2689
|
+
{
|
|
2690
|
+
"d": "M 2.9414062 1.1894531 C 1.9844673 1.1894531 1.1894531 1.9844673 1.1894531 2.9414062 L 1.1894531 21.058594 C 1.1894531 22.015532 1.9844673 22.810547 2.9414062 22.810547 L 21.058594 22.810547 C 22.015532 22.810547 22.810547 22.015532 22.810547 21.058594 L 22.810547 2.9414062 C 22.810547 1.9844673 22.015532 1.1894531 21.058594 1.1894531 L 2.9414062 1.1894531 z M 2.7519531 2.7519531 L 8.3066406 2.7519531 L 8.3066406 8.3066406 L 2.7519531 8.3066406 L 2.7519531 2.7519531 z M 9.2226562 2.7519531 L 14.777344 2.7519531 L 15.693359 2.7519531 L 21.248047 2.7519531 L 21.248047 8.3066406 L 15.693359 8.3066406 L 14.777344 8.3066406 L 9.2226562 8.3066406 L 9.2226562 2.7519531 z M 2.7519531 9.2226562 L 8.3066406 9.2226562 L 8.3242188 9.2226562 L 8.3242188 21.246094 L 8.3066406 21.246094 L 8.3066406 21.248047 L 2.7519531 21.248047 L 2.7519531 21.246094 L 2.7519531 15.693359 L 2.7519531 14.777344 L 2.7519531 9.2226562 z M 9.2226562 9.2226562 L 14.777344 9.2226562 L 15.693359 9.2226562 L 21.248047 9.2226562 L 21.248047 14.777344 L 21.248047 15.693359 L 21.248047 21.248047 L 15.693359 21.248047 L 14.777344 21.248047 L 9.2226562 21.248047 L 9.2226562 15.693359 L 9.2226562 14.777344 L 9.2226562 9.2226562 z ",
|
|
2691
|
+
"className": "fill"
|
|
2692
|
+
},
|
|
2693
|
+
{
|
|
2694
|
+
"d": "m 18.138182,10.533825 1.875869,3.249128 h -0.935185 v 4.27636 C 19.078866,18.579254 18.658124,19 18.13818,19 h -4.27636 v 0.935183 l -3.249126,-1.875868 3.249126,-1.875869 v 0.935182 h 3.335676 v -3.335674 h -0.935184 z",
|
|
2695
|
+
"className": "fill primary"
|
|
2696
|
+
}
|
|
2697
|
+
]
|
|
2698
|
+
},
|
|
2587
2699
|
"PresetStyles": {
|
|
2588
2700
|
"svg": [
|
|
2589
2701
|
{
|
|
@@ -3439,12 +3551,15 @@ declare const _default: {
|
|
|
3439
3551
|
"WorkbookStatistics": {
|
|
3440
3552
|
"svg": [
|
|
3441
3553
|
{
|
|
3442
|
-
"d": "
|
|
3443
|
-
"className": "fill"
|
|
3444
|
-
|
|
3554
|
+
"d": "M 6.015625 0.64257812 C 4.3851032 0.64456112 3.0644 1.9833947 3.0625 3.6328125 L 3.0625 20.619141 C 3.0721 21.436598 3.4035782 22.215629 3.984375 22.783203 C 4.5651718 23.351722 5.3476825 23.660978 6.1542969 23.642578 L 9.3320312 23.642578 L 9.3320312 23.648438 L 10 23.648438 L 10 22.09375 L 6.1542969 22.09375 C 5.3342845 22.12378 4.6396367 21.485335 4.5917969 20.65625 L 4.59375 20.65625 C 4.60145 19.865919 5.2358507 19.226509 6.0175781 19.224609 L 9.3320312 19.224609 L 9.3320312 19.230469 L 10 19.230469 L 10 17.675781 L 6.0136719 17.675781 C 5.5161079 17.677681 5.0280989 17.804739 4.5917969 18.046875 L 4.5917969 3.6328125 C 4.5927519 2.8386141 5.2290785 2.1943264 6.0136719 2.1933594 L 9.3320312 2.1933594 L 9.3320312 2.1992188 L 19.240234 2.1992188 L 19.240234 13 L 20.769531 13 C 20.770057 8.1671265 20.770805 1.4441993 20.771484 1.4238281 C 20.771484 1.2185035 20.690404 1.0222349 20.546875 0.87695312 C 20.403359 0.73167542 20.208706 0.65039063 20.005859 0.65039062 L 15.154297 0.65039062 L 15.154297 0.64257812 L 6.015625 0.64257812 z ",
|
|
3555
|
+
"className": "fill"
|
|
3556
|
+
},
|
|
3557
|
+
{
|
|
3558
|
+
"d": "M 9.359375,5 C 8.892257,5 8.5,5.392257 8.5,5.859375 v 2.28125 C 8.5,8.6077426 8.892257,9 9.359375,9 h 5.28125 C 15.107743,9 15.5,8.6077426 15.5,8.140625 V 5.859375 C 15.5,5.392257 15.107743,5 14.640625,5 Z M 9.5,6 h 5 v 2 h -5 z",
|
|
3559
|
+
"className": "fill"
|
|
3445
3560
|
},
|
|
3446
3561
|
{
|
|
3447
|
-
"d": "
|
|
3562
|
+
"d": "m 11,14 h 1.485714 v 9.320878 H 11 Z m 2.857142,0 h 3.657144 v 1.398131 h -3.657144 z m 2.285714,0 h 1.37143 v 5.359505 h -1.37143 z m -2.285714,3.961374 h 3.657144 v 1.398131 h -3.657144 z m 0,0 h 1.371428 v 5.359504 h -1.371428 z m 0,3.961373 h 3.657144 v 1.398131 H 13.857142 Z M 19.342857,14 h 3.657142 v 1.398131 h -3.657142 z m 2.285714,0 h 1.371428 v 9.320878 h -1.371428 z m -1.6,3.961374 h 2.971428 v 1.398131 h -2.971428 z m -0.685714,3.961373 h 3.657142 v 1.398131 h -3.657142 z",
|
|
3448
3563
|
"className": "fill primary"
|
|
3449
3564
|
}
|
|
3450
3565
|
]
|
|
@@ -58,9 +58,11 @@ export type PersistentStateOptions<T = any> = {
|
|
|
58
58
|
export type PersistentStateSetter<T> = (next: T | ((prev: T) => T)) => void;
|
|
59
59
|
export type PersistentStateProviderProps = {
|
|
60
60
|
/**
|
|
61
|
-
* Storage backend to use
|
|
61
|
+
* Storage backend to use.
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue an in-memory store, also used when there is no `window`
|
|
62
64
|
*/
|
|
63
|
-
store
|
|
65
|
+
store?: PersistenceStore;
|
|
64
66
|
/**
|
|
65
67
|
* Namespace prefix for all keys
|
|
66
68
|
*
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { ThemeMode } from './TokenTheme';
|
|
2
|
-
type Source = 'prop' | 'class' | 'media';
|
|
2
|
+
type Source = 'prop' | 'class' | 'media' | 'fallback';
|
|
3
|
+
/**
|
|
4
|
+
* What {@link useResolvedThemeMode} uses when neither an explicit mode nor a `dark`/`light` class on
|
|
5
|
+
* `<html>`/`<body>` decides: `'system'` follows `prefers-color-scheme`; a {@link ThemeMode} is used as is.
|
|
6
|
+
*/
|
|
7
|
+
export type ThemeModeFallback = 'system' | ThemeMode;
|
|
8
|
+
/**
|
|
9
|
+
* The {@link ThemeModeFallback} for every {@link useResolvedThemeMode} below it that does not pass its own.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Defaults to `'light'`: a component embedded in a page cannot know whether the page follows the OS, and
|
|
13
|
+
* most pages are light, so it stays light unless the host says otherwise. An app shell that owns the whole
|
|
14
|
+
* surface (Studio) provides `'system'`. Provided once per tree so every layer that resolves the mode
|
|
15
|
+
* independently (workbook, sheet, charts, floats) agrees.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ThemeModeFallbackContext: import('react').Context<ThemeModeFallback>;
|
|
3
18
|
interface UseThemeOptions {
|
|
4
19
|
mode?: ThemeMode;
|
|
20
|
+
/** Overrides {@link ThemeModeFallbackContext} for this call. */
|
|
21
|
+
fallback?: ThemeModeFallback;
|
|
5
22
|
}
|
|
6
23
|
/**
|
|
7
24
|
* Resolves the effective light/dark mode from (in priority order) an explicit `mode`, a `dark`/`light`
|
|
8
|
-
* class on `<html>`/`<body>`, then `prefers-color-scheme
|
|
9
|
-
* both the neutral `@sheetxl/react` layer and the MUI studio
|
|
10
|
-
* (no drift). Re-resolves on class mutations
|
|
25
|
+
* class on `<html>`/`<body>`, then the {@link ThemeModeFallback} (`prefers-color-scheme` when `'system'`).
|
|
26
|
+
* Framework-neutral (DOM only) — lives here so both the neutral `@sheetxl/react` layer and the MUI studio
|
|
27
|
+
* resolve the SAME preference the same way (no drift). Re-resolves on class mutations (and media changes
|
|
28
|
+
* when following the system) when no explicit `mode` is given.
|
|
11
29
|
*/
|
|
12
30
|
export declare function useResolvedThemeMode(options?: UseThemeOptions): {
|
|
13
31
|
themeMode: ThemeMode;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The top edge of the {@link KeyboardAccessory} showing on the keyboard, in client px (the coordinates
|
|
4
|
+
* `getBoundingClientRect` reads), or `null` while none shows. Content under that line is covered: the
|
|
5
|
+
* keyboard and the accessory both sit below it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getKeyboardAccessoryTop: () => number | null;
|
|
8
|
+
/**
|
|
9
|
+
* Listen for {@link getKeyboardAccessoryTop} changing: an accessory settling on the keyboard, moving
|
|
10
|
+
* with it, or going away.
|
|
11
|
+
*
|
|
12
|
+
* @returns Stops listening.
|
|
13
|
+
*/
|
|
14
|
+
export declare const subscribeKeyboardAccessoryTop: (listener: () => void) => (() => void);
|
|
15
|
+
/**
|
|
16
|
+
* Props for {@link KeyboardAccessory}.
|
|
17
|
+
*/
|
|
18
|
+
export interface KeyboardAccessoryProps {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the content rides the top of the virtual keyboard. While `false` it stays mounted but
|
|
21
|
+
* hidden, so a field inside keeps its focus and its keyboard across the change.
|
|
22
|
+
*/
|
|
23
|
+
floating: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The element the accessory stands in for, in the page: its theme mode and surface are carried onto
|
|
26
|
+
* the accessory when no float provider supplies a theme.
|
|
27
|
+
*/
|
|
28
|
+
anchor?: Element | null;
|
|
29
|
+
/**
|
|
30
|
+
* Called as the accessory shows and hides, after it has settled: an in-page twin fades the other
|
|
31
|
+
* way, so the content looks to have moved.
|
|
32
|
+
*/
|
|
33
|
+
onShownChange?: (shown: boolean) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Called when the keyboard goes away while floating (the Android back gesture, the keyboard's own
|
|
36
|
+
* hide key, Safari's Done), so the owner can end what the keyboard was for.
|
|
37
|
+
*/
|
|
38
|
+
onKeyboardClose?: () => void;
|
|
39
|
+
className?: string;
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Content that rides the top of the virtual keyboard: a bar of a page-level portal, placed from the
|
|
45
|
+
* visual viewport (the part of the page the keyboard leaves visible).
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* CSS cannot pin anything to the visual viewport (`position: fixed` pins to the layout viewport, which
|
|
49
|
+
* the keyboard does not shrink on iOS, nor on Chrome by default), and script placement runs a frame
|
|
50
|
+
* behind the browser's own scroll, zoom and address-bar animation. So:
|
|
51
|
+
*
|
|
52
|
+
* - **Hidden while anything moves.** A visual viewport resize or scroll, or a page scroll, hides it at
|
|
53
|
+
* once; once nothing has moved for a moment it is placed on the keyboard and fades in.
|
|
54
|
+
* - **Parked at the top of the visible area while hidden.** A focused field the browser sees under the
|
|
55
|
+
* keyboard's edge makes it pan the page to reveal it, and mid-pan the visual viewport's readings do
|
|
56
|
+
* not match the screen. Parked at the top, the field is always in view.
|
|
57
|
+
* - **Undoes pinch zoom**, so it stays the size of the screen.
|
|
58
|
+
* - **Placed by the browser where it can.** Where the browser offers the VirtualKeyboard API (Chromium,
|
|
59
|
+
* in a secure context), the keyboard overlays the page while the accessory floats, and the accessory
|
|
60
|
+
* sits on `env(keyboard-inset-height)`. The visual viewport is wrong in one state there: Chrome
|
|
61
|
+
* bringing its address bar back as the keyboard rises on a scrolled page reports the visible area as
|
|
62
|
+
* if the bar were still hidden, which would put the accessory behind the keyboard. Elsewhere (iOS
|
|
63
|
+
* Safari, Firefox) it is placed from the visual viewport.
|
|
64
|
+
*
|
|
65
|
+
* Its top edge is published through {@link getKeyboardAccessoryTop} while it shows. It never scrolls
|
|
66
|
+
* the page.
|
|
67
|
+
*
|
|
68
|
+
* Inside an iframe the visual viewport is the iframe's, so the accessory rides the iframe's bottom.
|
|
69
|
+
* A floating or split keyboard, or a hardware one, does not shrink the visual viewport: the accessory
|
|
70
|
+
* sits at the bottom of the visible area, and no keyboard close is reported.
|
|
71
|
+
*/
|
|
72
|
+
export declare const KeyboardAccessory: React.ForwardRefExoticComponent<KeyboardAccessoryProps & React.RefAttributes<HTMLDivElement>>;
|
|
73
|
+
//# sourceMappingURL=KeyboardAccessory.d.ts.map
|
|
@@ -89,9 +89,15 @@ export interface VirtualKeyboardStore extends VirtualKeyboardHandler {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Whether a virtual keyboard is up, read from the visual viewport (the part of the page the keyboard
|
|
92
|
-
* leaves visible). Pinch zoom shrinks the visual viewport too, so its scale is undone first.
|
|
92
|
+
* leaves visible). Pinch zoom shrinks the visual viewport too, so its scale is undone first. While a
|
|
93
|
+
* keyboard overlays the page (the browser's VirtualKeyboard API with `overlaysContent`, as a
|
|
94
|
+
* `KeyboardAccessory` sets it), the browser's own report of the keyboard is read instead.
|
|
95
|
+
*
|
|
96
|
+
* @param baseline The layout height to measure against, in px. Defaults to `window.innerHeight`; pass
|
|
97
|
+
* the height read before the keyboard rose where the page may shrink with it (a host whose viewport
|
|
98
|
+
* asks for `interactive-widget=resizes-content`).
|
|
93
99
|
*/
|
|
94
|
-
export declare const isVirtualKeyboardUp: () => boolean;
|
|
100
|
+
export declare const isVirtualKeyboardUp: (baseline?: number) => boolean;
|
|
95
101
|
/**
|
|
96
102
|
* Create an isolated virtual keyboard store.
|
|
97
103
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser's VirtualKeyboard API (`navigator.virtualKeyboard`): Chromium only, and only in a secure
|
|
3
|
+
* context (HTTPS, or localhost). With `overlaysContent` on, the keyboard covers the page instead of
|
|
4
|
+
* shrinking the visual viewport, and the browser reports its rectangle (and the CSS
|
|
5
|
+
* `env(keyboard-inset-*)` values) itself.
|
|
6
|
+
*/
|
|
7
|
+
export interface VirtualKeyboardApi extends EventTarget {
|
|
8
|
+
overlaysContent: boolean;
|
|
9
|
+
readonly boundingRect: DOMRectReadOnly;
|
|
10
|
+
}
|
|
11
|
+
/** The browser's VirtualKeyboard API, or `null` where it is unavailable. */
|
|
12
|
+
export declare const getVirtualKeyboardApi: () => VirtualKeyboardApi | null;
|
|
13
|
+
//# sourceMappingURL=_keyboardApi.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a host makes room for the virtual keyboard.
|
|
3
|
+
*
|
|
4
|
+
* - `'float'`: the host stays as it is and never scrolls the page; what is being typed into rides
|
|
5
|
+
* the top of the keyboard in a {@link KeyboardAccessory}. For a host that is part of a page.
|
|
6
|
+
* - `'resize'`: the host shrinks to the part of the screen the keyboard leaves
|
|
7
|
+
* ({@link useKeyboardResize}), so everything in it stays in view above the keyboard. For a host that
|
|
8
|
+
* is the page; in a page that scrolls it would fight the page.
|
|
9
|
+
* - `'none'`: nothing; the host or the browser manages the keyboard.
|
|
10
|
+
*/
|
|
11
|
+
export type VirtualKeyboardMode = 'float' | 'resize' | 'none';
|
|
12
|
+
/** The room a host that is the page gives up to the virtual keyboard. See {@link useKeyboardResize}. */
|
|
13
|
+
export interface KeyboardResize {
|
|
14
|
+
/** The height the host gives up to the keyboard, in px; `0` while the keyboard is down. */
|
|
15
|
+
inset: number;
|
|
16
|
+
/** How far the host moves down to stay in the visible part of the page, in px. */
|
|
17
|
+
offsetTop: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The room a host that is the page makes for the virtual keyboard (the `'resize'`
|
|
21
|
+
* {@link VirtualKeyboardMode}): it shrinks to the part of the screen the keyboard leaves. Apply the
|
|
22
|
+
* result to the host's own box, e.g. `height: calc(100% - ${inset}px)` and
|
|
23
|
+
* `transform: translateY(${offsetTop}px)`.
|
|
24
|
+
*
|
|
25
|
+
* @param enabled Measure only while `true`; a host in another mode pays nothing.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* iOS Safari keeps the layout viewport at full height and scrolls the page instead; the visual
|
|
29
|
+
* viewport is the one signal that reflects the keyboard on every platform. While the keyboard is up
|
|
30
|
+
* the host gives up its height (layout minus visual), rides the visual viewport's offset so it stays
|
|
31
|
+
* put while Safari scrolls the layout under it, and the page is scrolled back to the top as the
|
|
32
|
+
* keyboard changes and once as it goes. Only the keyboard counts: the address bar showing or hiding
|
|
33
|
+
* and a pinch zoom leave the host alone.
|
|
34
|
+
*
|
|
35
|
+
* Meant for a host that fills a page that does not scroll. There, Chrome's address bar never hides,
|
|
36
|
+
* so the visual viewport's readings stay right; on a page that scrolls, use the `'float'` mode.
|
|
37
|
+
*
|
|
38
|
+
* Re-renders with the visual viewport while enabled.
|
|
39
|
+
*/
|
|
40
|
+
export declare const useKeyboardResize: (enabled: boolean) => KeyboardResize;
|
|
41
|
+
//# sourceMappingURL=useKeyboardResize.d.ts.map
|