@tamagui/react-native-web-internals 2.7.7 → 3.0.0-beta.1093.1
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/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +150 -136
- package/dist/cjs/StyleSheet/compiler/hash.cjs +14 -18
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +20 -24
- package/dist/cjs/StyleSheet/compiler/index.cjs +294 -321
- package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +19 -23
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +31 -35
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +26 -38
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +36 -40
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +107 -111
- package/dist/cjs/StyleSheet/dom/index.cjs +69 -72
- package/dist/cjs/StyleSheet/index.cjs +32 -34
- package/dist/cjs/StyleSheet/preprocess.cjs +73 -94
- package/dist/cjs/StyleSheet/validate.cjs +71 -75
- package/dist/cjs/TextAncestorContext.cjs +14 -18
- package/dist/cjs/colorProps.cjs +24 -28
- package/dist/cjs/index.cjs +48 -50
- package/dist/cjs/modules/AccessibilityUtil/index.cjs +17 -21
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +14 -18
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +45 -49
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +33 -39
- package/dist/cjs/modules/AssetRegistry/index.cjs +17 -19
- package/dist/cjs/modules/ImageLoader/index.cjs +134 -141
- package/dist/cjs/modules/InteractionManager.cjs +211 -219
- package/dist/cjs/modules/Platform/index.cjs +17 -21
- package/dist/cjs/modules/TextInputState/index.cjs +54 -58
- package/dist/cjs/modules/UIManager/index.cjs +45 -51
- package/dist/cjs/modules/canUseDOM.cjs +14 -18
- package/dist/cjs/modules/createDOMProps/index.cjs +284 -359
- package/dist/cjs/modules/createEventHandle/index.cjs +56 -62
- package/dist/cjs/modules/dismissKeyboard/index.cjs +15 -19
- package/dist/cjs/modules/forwardedProps/index.cjs +127 -130
- package/dist/cjs/modules/getBoundingClientRect/index.cjs +21 -25
- package/dist/cjs/modules/invariant.cjs +25 -27
- package/dist/cjs/modules/isSelectionValid/index.cjs +21 -25
- package/dist/cjs/modules/isWebColor/index.cjs +14 -18
- package/dist/cjs/modules/mergeRefs/index.cjs +30 -34
- package/dist/cjs/modules/modality/index.cjs +130 -134
- package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +24 -28
- package/dist/cjs/modules/normalizeColor/index.cjs +27 -31
- package/dist/cjs/modules/pick/index.cjs +21 -27
- package/dist/cjs/modules/processColor/index.cjs +27 -36
- package/dist/cjs/modules/requestIdleCallback/index.cjs +27 -29
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +38 -42
- package/dist/cjs/modules/setValueForStyles/index.cjs +27 -34
- package/dist/cjs/modules/unitlessNumbers/index.cjs +73 -75
- package/dist/cjs/modules/useElementLayout/index.cjs +23 -31
- package/dist/cjs/modules/useEvent/index.cjs +39 -43
- package/dist/cjs/modules/useHover/index.cjs +112 -118
- package/dist/cjs/modules/useLayoutEffect/index.cjs +17 -26
- package/dist/cjs/modules/useLocale/index.cjs +32 -43
- package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +65 -76
- package/dist/cjs/modules/useMergeRefs/index.cjs +18 -29
- package/dist/cjs/modules/usePlatformMethods/index.cjs +23 -30
- package/dist/cjs/modules/useStable/index.cjs +23 -32
- package/dist/cjs/styleTypes.cjs +9 -11
- package/dist/cjs/types.cjs +9 -11
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +137 -119
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/hash.mjs +2 -2
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +7 -6
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/index.mjs +279 -302
- package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +7 -5
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +19 -17
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +14 -20
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +24 -22
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +94 -93
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/index.mjs +57 -54
- package/dist/esm/StyleSheet/dom/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/index.mjs +18 -17
- package/dist/esm/StyleSheet/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/preprocess.mjs +58 -75
- package/dist/esm/StyleSheet/preprocess.mjs.map +1 -1
- package/dist/esm/StyleSheet/validate.mjs +58 -57
- package/dist/esm/StyleSheet/validate.mjs.map +1 -1
- package/dist/esm/TextAncestorContext.mjs +2 -0
- package/dist/esm/TextAncestorContext.mjs.map +1 -1
- package/dist/esm/colorProps.mjs +11 -10
- package/dist/esm/colorProps.mjs.map +1 -1
- package/dist/esm/index.js +22 -15
- package/dist/esm/index.mjs +22 -15
- package/dist/esm/modules/AccessibilityUtil/index.mjs +5 -3
- package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +2 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +33 -31
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +20 -21
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -1
- package/dist/esm/modules/AssetRegistry/index.mjs +3 -2
- package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -1
- package/dist/esm/modules/ImageLoader/index.mjs +120 -124
- package/dist/esm/modules/ImageLoader/index.mjs.map +1 -1
- package/dist/esm/modules/InteractionManager.mjs +199 -201
- package/dist/esm/modules/InteractionManager.mjs.map +1 -1
- package/dist/esm/modules/Platform/index.mjs +4 -3
- package/dist/esm/modules/Platform/index.mjs.map +1 -1
- package/dist/esm/modules/TextInputState/index.mjs +42 -40
- package/dist/esm/modules/TextInputState/index.mjs.map +1 -1
- package/dist/esm/modules/UIManager/index.mjs +33 -33
- package/dist/esm/modules/UIManager/index.mjs.map +1 -1
- package/dist/esm/modules/canUseDOM.mjs +1 -0
- package/dist/esm/modules/canUseDOM.mjs.map +1 -1
- package/dist/esm/modules/createDOMProps/index.mjs +271 -342
- package/dist/esm/modules/createDOMProps/index.mjs.map +1 -1
- package/dist/esm/modules/createEventHandle/index.mjs +44 -44
- package/dist/esm/modules/createEventHandle/index.mjs.map +1 -1
- package/dist/esm/modules/dismissKeyboard/index.mjs +3 -1
- package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -1
- package/dist/esm/modules/forwardedProps/index.mjs +104 -104
- package/dist/esm/modules/forwardedProps/index.mjs.map +1 -1
- package/dist/esm/modules/getBoundingClientRect/index.mjs +8 -7
- package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -1
- package/dist/esm/modules/invariant.mjs +11 -10
- package/dist/esm/modules/invariant.mjs.map +1 -1
- package/dist/esm/modules/isSelectionValid/index.mjs +8 -7
- package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -1
- package/dist/esm/modules/isWebColor/index.mjs +2 -1
- package/dist/esm/modules/isWebColor/index.mjs.map +1 -1
- package/dist/esm/modules/mergeRefs/index.mjs +17 -16
- package/dist/esm/modules/mergeRefs/index.mjs.map +1 -1
- package/dist/esm/modules/modality/index.mjs +115 -115
- package/dist/esm/modules/modality/index.mjs.map +1 -1
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +11 -10
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -1
- package/dist/esm/modules/normalizeColor/index.mjs +15 -13
- package/dist/esm/modules/normalizeColor/index.mjs.map +1 -1
- package/dist/esm/modules/pick/index.mjs +8 -9
- package/dist/esm/modules/pick/index.mjs.map +1 -1
- package/dist/esm/modules/processColor/index.mjs +12 -10
- package/dist/esm/modules/processColor/index.mjs.map +1 -1
- package/dist/esm/modules/requestIdleCallback/index.mjs +14 -12
- package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -1
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +27 -25
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -1
- package/dist/esm/modules/setValueForStyles/index.mjs +15 -16
- package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -1
- package/dist/esm/modules/unitlessNumbers/index.mjs +60 -57
- package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -1
- package/dist/esm/modules/useElementLayout/index.mjs +12 -14
- package/dist/esm/modules/useElementLayout/index.mjs.map +1 -1
- package/dist/esm/modules/useEvent/index.mjs +28 -26
- package/dist/esm/modules/useEvent/index.mjs.map +1 -1
- package/dist/esm/modules/useHover/index.mjs +101 -101
- package/dist/esm/modules/useHover/index.mjs.map +1 -1
- package/dist/esm/modules/useLayoutEffect/index.mjs +2 -0
- package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -1
- package/dist/esm/modules/useLocale/index.mjs +15 -17
- package/dist/esm/modules/useLocale/index.mjs.map +1 -1
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs +52 -58
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -1
- package/dist/esm/modules/useMergeRefs/index.mjs +3 -3
- package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -1
- package/dist/esm/modules/usePlatformMethods/index.mjs +11 -12
- package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
- package/dist/esm/modules/useStable/index.mjs +8 -6
- package/dist/esm/modules/useStable/index.mjs.map +1 -1
- package/dist/esm/styleTypes.mjs +0 -2
- package/dist/esm/types.mjs +0 -2
- package/package.json +10 -10
- package/src/StyleSheet/compiler/index.tsx +2 -5
- package/src/StyleSheet/preprocess.tsx +1 -4
- package/src/modules/createDOMProps/index.tsx +8 -22
- package/src/modules/forwardedProps/index.tsx +0 -1
- package/src/modules/mergeRefs/index.tsx +1 -1
- package/src/modules/pick/index.tsx +2 -4
- package/src/modules/setValueForStyles/dangerousStyleValue.tsx +1 -1
- package/src/modules/setValueForStyles/index.tsx +0 -3
- package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -1
- package/types/StyleSheet/compiler/index.d.ts.map +1 -1
- package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -1
- package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -1
- package/types/StyleSheet/index.d.ts +15 -16
- package/types/StyleSheet/index.d.ts.map +1 -1
- package/types/StyleSheet/preprocess.d.ts +1 -1
- package/types/StyleSheet/preprocess.d.ts.map +1 -1
- package/types/colorProps.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/index.d.ts +6 -5
- package/types/modules/AccessibilityUtil/index.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -1
- package/types/modules/ImageLoader/index.d.ts +1 -1
- package/types/modules/ImageLoader/index.d.ts.map +1 -1
- package/types/modules/InteractionManager.d.ts +3 -3
- package/types/modules/InteractionManager.d.ts.map +1 -1
- package/types/modules/Platform/index.d.ts.map +1 -1
- package/types/modules/TextInputState/index.d.ts.map +1 -1
- package/types/modules/UIManager/index.d.ts +1 -6
- package/types/modules/UIManager/index.d.ts.map +1 -1
- package/types/modules/createDOMProps/index.d.ts.map +1 -1
- package/types/modules/forwardedProps/index.d.ts +70 -74
- package/types/modules/forwardedProps/index.d.ts.map +1 -1
- package/types/modules/getBoundingClientRect/index.d.ts.map +1 -1
- package/types/modules/isWebColor/index.d.ts.map +1 -1
- package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -1
- package/types/modules/normalizeColor/index.d.ts.map +1 -1
- package/types/modules/pick/index.d.ts.map +1 -1
- package/types/modules/processColor/index.d.ts.map +1 -1
- package/types/modules/requestIdleCallback/index.d.ts +3 -1
- package/types/modules/requestIdleCallback/index.d.ts.map +1 -1
- package/types/modules/setValueForStyles/index.d.ts.map +1 -1
- package/types/modules/unitlessNumbers/index.d.ts.map +1 -1
- package/types/modules/useLayoutEffect/index.d.ts +1 -1
- package/types/modules/useLayoutEffect/index.d.ts.map +1 -1
- package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +0 -265
- package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +0 -419
- package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +0 -160
- package/dist/cjs/StyleSheet/__tests__/index-test.cjs +0 -436
- package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +0 -121
- package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +0 -51
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +0 -57
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +0 -46
- package/dist/cjs/modules/Platform/__tests__/index-test.cjs +0 -56
- package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +0 -111
- package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +0 -177
- package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +0 -422
- package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +0 -48
- package/dist/cjs/modules/modality/__tests__/index-test.cjs +0 -59
- package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +0 -38
- package/dist/cjs/modules/processColor/__tests__/index-test.cjs +0 -85
- package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +0 -490
- package/dist/cjs/modules/useHover/__tests__/index-test.cjs +0 -382
- package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +0 -125
- package/dist/cjs/modules/useStable/__tests__/index-test.cjs +0 -122
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +0 -242
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +0 -420
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +0 -137
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/index-test.mjs +0 -413
- package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +0 -122
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs +0 -52
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/hash.mjs.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +0 -34
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +0 -23
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +0 -1
- package/dist/esm/modules/Platform/__tests__/index-test.mjs +0 -33
- package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs +0 -88
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +0 -154
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +0 -399
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +0 -25
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/modality/__tests__/index-test.mjs +0 -60
- package/dist/esm/modules/modality/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +0 -15
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/processColor/__tests__/index-test.mjs +0 -62
- package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs +0 -467
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useHover/__tests__/index-test.mjs +0 -359
- package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +0 -102
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useStable/__tests__/index-test.mjs +0 -99
- package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/styleTypes.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +0 -236
- package/src/StyleSheet/__tests__/compiler-test.tsx +0 -426
- package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +0 -169
- package/src/StyleSheet/__tests__/index-test.tsx +0 -406
- package/src/StyleSheet/__tests__/preprocess-test.tsx +0 -107
- package/src/StyleSheet/__tests__/validate-test.tsx +0 -42
- package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +0 -44
- package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +0 -25
- package/src/modules/Platform/__tests__/index-test.tsx +0 -45
- package/src/modules/UIManager/__tests__/index-test.tsx +0 -87
- package/src/modules/createDOMProps/__tests__/index-test.tsx +0 -138
- package/src/modules/createEventHandle/__tests__/index-test.tsx +0 -459
- package/src/modules/mergeRefs/__tests__/index-test.tsx +0 -32
- package/src/modules/modality/__tests__/index-test.tsx +0 -66
- package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +0 -23
- package/src/modules/processColor/__tests__/index-test.tsx +0 -78
- package/src/modules/useEvent/__tests__/index-test.tsx +0 -511
- package/src/modules/useHover/__tests__/index-test.tsx +0 -342
- package/src/modules/useMergeRefs/__tests__/index-test.tsx +0 -91
- package/src/modules/useStable/__tests__/index-test.tsx +0 -101
|
@@ -1,215 +1,213 @@
|
|
|
1
1
|
import { invariant } from "./invariant.mjs";
|
|
2
2
|
import { requestIdleCallback } from "./requestIdleCallback/index.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
3
|
+
|
|
4
|
+
var EventEmitter = class {
|
|
5
|
+
_registry = {};
|
|
6
|
+
addListener(eventType, listener, context) {
|
|
7
|
+
const registrations = this._allocate(eventType);
|
|
8
|
+
const registration = {
|
|
9
|
+
context,
|
|
10
|
+
listener,
|
|
11
|
+
remove: () => {
|
|
12
|
+
registrations.delete(registration);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
registrations.add(registration);
|
|
16
|
+
return registration;
|
|
17
|
+
}
|
|
18
|
+
emit(eventType, ...args) {
|
|
19
|
+
const registrations = this._registry[eventType];
|
|
20
|
+
if (registrations != null) {
|
|
21
|
+
for (const registration of Array.from(registrations)) {
|
|
22
|
+
registration.listener.apply(registration.context, args);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_allocate(eventType) {
|
|
27
|
+
let registrations = this._registry[eventType];
|
|
28
|
+
if (registrations == null) {
|
|
29
|
+
registrations = /* @__PURE__ */ new Set();
|
|
30
|
+
this._registry[eventType] = registrations;
|
|
31
|
+
}
|
|
32
|
+
return registrations;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var TaskQueue = class {
|
|
36
|
+
_queueStack;
|
|
37
|
+
_onMoreTasks;
|
|
38
|
+
constructor({ onMoreTasks }) {
|
|
39
|
+
this._onMoreTasks = onMoreTasks;
|
|
40
|
+
this._queueStack = [{
|
|
41
|
+
tasks: [],
|
|
42
|
+
popable: true
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
enqueueTasks(tasks) {
|
|
46
|
+
tasks.forEach((task) => this._enqueue(task));
|
|
47
|
+
}
|
|
48
|
+
cancelTasks(tasksToCancel) {
|
|
49
|
+
this._queueStack = this._queueStack.map((queue) => ({
|
|
50
|
+
...queue,
|
|
51
|
+
tasks: queue.tasks.filter((task) => !tasksToCancel.includes(task))
|
|
52
|
+
})).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
|
|
53
|
+
}
|
|
54
|
+
hasTasksToProcess() {
|
|
55
|
+
return this._getCurrentQueue().length > 0;
|
|
56
|
+
}
|
|
57
|
+
processNext() {
|
|
58
|
+
const queue = this._getCurrentQueue();
|
|
59
|
+
if (queue.length) {
|
|
60
|
+
const task = queue.shift();
|
|
61
|
+
try {
|
|
62
|
+
if (typeof task === "object" && task && "gen" in task) {
|
|
63
|
+
this._genPromise(task);
|
|
64
|
+
} else if (typeof task === "object" && task && "run" in task) {
|
|
65
|
+
;
|
|
66
|
+
task.run();
|
|
67
|
+
} else {
|
|
68
|
+
invariant(typeof task === "function", "Expected Function, SimpleTask, or PromiseTask, but got:\n" + JSON.stringify(task, null, 2));
|
|
69
|
+
task();
|
|
70
|
+
}
|
|
71
|
+
} catch (e) {
|
|
72
|
+
if (e instanceof Error) {
|
|
73
|
+
const taskName = task && typeof task === "object" && "name" in task ? task.name : "";
|
|
74
|
+
e.message = "TaskQueue: Error with task " + taskName + ": " + e.message;
|
|
75
|
+
}
|
|
76
|
+
throw e;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
_enqueue(task) {
|
|
81
|
+
this._getCurrentQueue().push(task);
|
|
82
|
+
}
|
|
83
|
+
_getCurrentQueue() {
|
|
84
|
+
const stackIdx = this._queueStack.length - 1;
|
|
85
|
+
const queue = this._queueStack[stackIdx];
|
|
86
|
+
if (queue.popable && queue.tasks.length === 0 && stackIdx > 0) {
|
|
87
|
+
this._queueStack.pop();
|
|
88
|
+
return this._getCurrentQueue();
|
|
89
|
+
} else {
|
|
90
|
+
return queue.tasks;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_genPromise(task) {
|
|
94
|
+
const length = this._queueStack.push({
|
|
95
|
+
tasks: [],
|
|
96
|
+
popable: false
|
|
97
|
+
});
|
|
98
|
+
const stackIdx = length - 1;
|
|
99
|
+
const stackItem = this._queueStack[stackIdx];
|
|
100
|
+
task.gen().then(() => {
|
|
101
|
+
stackItem.popable = true;
|
|
102
|
+
if (this.hasTasksToProcess()) {
|
|
103
|
+
this._onMoreTasks();
|
|
104
|
+
}
|
|
105
|
+
}).catch((ex) => {
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
if (ex instanceof Error) {
|
|
108
|
+
ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;
|
|
109
|
+
}
|
|
110
|
+
throw ex;
|
|
111
|
+
}, 0);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
116
115
|
const _emitter = new EventEmitter();
|
|
117
116
|
const InteractionManager = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
117
|
+
Events: {
|
|
118
|
+
interactionStart: "interactionStart",
|
|
119
|
+
interactionComplete: "interactionComplete"
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Schedule a function to run after all interactions have completed.
|
|
123
|
+
*/
|
|
124
|
+
runAfterInteractions(task) {
|
|
125
|
+
const tasks = [];
|
|
126
|
+
const promise = new Promise((resolve) => {
|
|
127
|
+
_scheduleUpdate();
|
|
128
|
+
if (task) {
|
|
129
|
+
tasks.push(task);
|
|
130
|
+
}
|
|
131
|
+
tasks.push({
|
|
132
|
+
run: resolve,
|
|
133
|
+
name: "resolve " + (task && typeof task === "object" && "name" in task && task.name || "?")
|
|
134
|
+
});
|
|
135
|
+
_taskQueue.enqueueTasks(tasks);
|
|
136
|
+
});
|
|
137
|
+
return {
|
|
138
|
+
then: promise.then.bind(promise),
|
|
139
|
+
done: promise.then.bind(promise),
|
|
140
|
+
cancel: () => {
|
|
141
|
+
_taskQueue.cancelTasks(tasks);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Notify manager that an interaction has started.
|
|
147
|
+
*/
|
|
148
|
+
createInteractionHandle() {
|
|
149
|
+
_scheduleUpdate();
|
|
150
|
+
const handle = ++_inc;
|
|
151
|
+
_addInteractionSet.add(handle);
|
|
152
|
+
return handle;
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Notify manager that an interaction has completed.
|
|
156
|
+
*/
|
|
157
|
+
clearInteractionHandle(handle) {
|
|
158
|
+
invariant(!!handle, "Must provide a handle to clear.");
|
|
159
|
+
_scheduleUpdate();
|
|
160
|
+
_addInteractionSet.delete(handle);
|
|
161
|
+
_deleteInteractionSet.add(handle);
|
|
162
|
+
},
|
|
163
|
+
addListener: _emitter.addListener.bind(_emitter),
|
|
164
|
+
/**
|
|
165
|
+
* Set deadline for task processing
|
|
166
|
+
*/
|
|
167
|
+
setDeadline(deadline) {
|
|
168
|
+
_deadline = deadline;
|
|
169
|
+
}
|
|
171
170
|
};
|
|
172
|
-
const _interactionSet = /* @__PURE__ */new Set();
|
|
173
|
-
const _addInteractionSet = /* @__PURE__ */new Set();
|
|
174
|
-
const _deleteInteractionSet = /* @__PURE__ */new Set();
|
|
175
|
-
const _taskQueue = new TaskQueue({
|
|
176
|
-
onMoreTasks: _scheduleUpdate
|
|
177
|
-
});
|
|
171
|
+
const _interactionSet = /* @__PURE__ */ new Set();
|
|
172
|
+
const _addInteractionSet = /* @__PURE__ */ new Set();
|
|
173
|
+
const _deleteInteractionSet = /* @__PURE__ */ new Set();
|
|
174
|
+
const _taskQueue = new TaskQueue({ onMoreTasks: _scheduleUpdate });
|
|
178
175
|
let _nextUpdateHandle = null;
|
|
179
176
|
let _inc = 0;
|
|
180
177
|
let _deadline = -1;
|
|
181
178
|
function _scheduleUpdate() {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
if (!_nextUpdateHandle) {
|
|
180
|
+
if (_deadline > 0) {
|
|
181
|
+
_nextUpdateHandle = setTimeout(_processUpdate);
|
|
182
|
+
} else {
|
|
183
|
+
_nextUpdateHandle = requestIdleCallback(_processUpdate);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
189
186
|
}
|
|
190
187
|
function _processUpdate() {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
188
|
+
_nextUpdateHandle = null;
|
|
189
|
+
const interactionCount = _interactionSet.size;
|
|
190
|
+
_addInteractionSet.forEach((handle) => _interactionSet.add(handle));
|
|
191
|
+
_deleteInteractionSet.forEach((handle) => _interactionSet.delete(handle));
|
|
192
|
+
const nextInteractionCount = _interactionSet.size;
|
|
193
|
+
if (interactionCount !== 0 && nextInteractionCount === 0) {
|
|
194
|
+
_emitter.emit("interactionComplete");
|
|
195
|
+
} else if (interactionCount === 0 && nextInteractionCount !== 0) {
|
|
196
|
+
_emitter.emit("interactionStart");
|
|
197
|
+
}
|
|
198
|
+
if (nextInteractionCount === 0) {
|
|
199
|
+
const begin = Date.now();
|
|
200
|
+
while (_taskQueue.hasTasksToProcess()) {
|
|
201
|
+
_taskQueue.processNext();
|
|
202
|
+
if (_deadline > 0 && Date.now() - begin >= _deadline) {
|
|
203
|
+
_scheduleUpdate();
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
_addInteractionSet.clear();
|
|
209
|
+
_deleteInteractionSet.clear();
|
|
213
210
|
}
|
|
211
|
+
|
|
214
212
|
export { InteractionManager };
|
|
215
213
|
//# sourceMappingURL=InteractionManager.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["invariant","requestIdleCallback","EventEmitter","_registry","addListener","eventType","listener","context","registrations","_allocate","registration","remove","delete","add","emit","args","Array","from","apply","Set","TaskQueue","_queueStack","_onMoreTasks","constructor","onMoreTasks","tasks","popable","enqueueTasks","forEach","task","_enqueue","cancelTasks","tasksToCancel","map","queue","filter","includes","idx","length","hasTasksToProcess","_getCurrentQueue","processNext","shift","_genPromise","run","JSON","stringify","e","Error","taskName","name","message","push","stackIdx","pop","stackItem","gen","then","catch","ex","setTimeout","_emitter","InteractionManager","Events","interactionStart","interactionComplete","runAfterInteractions","promise","Promise","resolve","_scheduleUpdate","_taskQueue","bind","done","cancel","createInteractionHandle","handle","_inc","_addInteractionSet","clearInteractionHandle","_deleteInteractionSet","setDeadline","deadline","_deadline","_interactionSet","_nextUpdateHandle","_processUpdate","interactionCount","size","nextInteractionCount","begin","Date","now","clear"],"sources":["../../../src/modules/InteractionManager.tsx"],"sourcesContent":[null],"mappings":"AAQA,SAASA,SAAA,QAAiB;AAC1B,SAASC,mBAAA,QAA2B;AAWpC,MAAMC,YAAA,CAAoD;EAChDC,SAAA,GAMJ,CAAC;EAELC,YACEC,SAAA,EACAC,QAAA,EACAC,OAAA,EACmB;IACnB,MAAMC,aAAA,GAAgB,KAAKC,SAAA,CAAUJ,SAAS;IAC9C,MAAMK,YAAA,GAAe;MACnBH,OAAA;MACAD,QAAA;MACAK,MAAA,EAAQA,CAAA,KAAM;QACZH,aAAA,CAAcI,MAAA,CAAOF,YAAY;MACnC;IACF;IACAF,aAAA,CAAcK,GAAA,CAAIH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teractionManager.js","names":[],"sources":["esm/modules/InteractionManager.js"],"sourcesContent":["import { invariant } from \"./invariant\";\nimport { requestIdleCallback } from \"./requestIdleCallback/index\";\nclass EventEmitter {\n _registry = {};\n addListener(eventType, listener, context) {\n const registrations = this._allocate(eventType);\n const registration = {\n context,\n listener,\n remove: () => {\n registrations.delete(registration);\n }\n };\n registrations.add(registration);\n return registration;\n }\n emit(eventType, ...args) {\n const registrations = this._registry[eventType];\n if (registrations != null) {\n for (const registration of Array.from(registrations)) {\n registration.listener.apply(registration.context, args);\n }\n }\n }\n _allocate(eventType) {\n let registrations = this._registry[eventType];\n if (registrations == null) {\n registrations = /* @__PURE__ */ new Set();\n this._registry[eventType] = registrations;\n }\n return registrations;\n }\n}\nclass TaskQueue {\n _queueStack;\n _onMoreTasks;\n constructor({ onMoreTasks }) {\n this._onMoreTasks = onMoreTasks;\n this._queueStack = [{ tasks: [], popable: true }];\n }\n enqueueTasks(tasks) {\n tasks.forEach((task) => this._enqueue(task));\n }\n cancelTasks(tasksToCancel) {\n this._queueStack = this._queueStack.map((queue) => ({\n ...queue,\n tasks: queue.tasks.filter((task) => !tasksToCancel.includes(task))\n })).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);\n }\n hasTasksToProcess() {\n return this._getCurrentQueue().length > 0;\n }\n processNext() {\n const queue = this._getCurrentQueue();\n if (queue.length) {\n const task = queue.shift();\n try {\n if (typeof task === \"object\" && task && \"gen\" in task) {\n this._genPromise(task);\n } else if (typeof task === \"object\" && task && \"run\" in task) {\n ;\n task.run();\n } else {\n invariant(\n typeof task === \"function\",\n \"Expected Function, SimpleTask, or PromiseTask, but got:\\n\" + JSON.stringify(task, null, 2)\n );\n task();\n }\n } catch (e) {\n if (e instanceof Error) {\n const taskName = task && typeof task === \"object\" && \"name\" in task ? task.name : \"\";\n e.message = \"TaskQueue: Error with task \" + taskName + \": \" + e.message;\n }\n throw e;\n }\n }\n }\n _enqueue(task) {\n this._getCurrentQueue().push(task);\n }\n _getCurrentQueue() {\n const stackIdx = this._queueStack.length - 1;\n const queue = this._queueStack[stackIdx];\n if (queue.popable && queue.tasks.length === 0 && stackIdx > 0) {\n this._queueStack.pop();\n return this._getCurrentQueue();\n } else {\n return queue.tasks;\n }\n }\n _genPromise(task) {\n const length = this._queueStack.push({ tasks: [], popable: false });\n const stackIdx = length - 1;\n const stackItem = this._queueStack[stackIdx];\n task.gen().then(() => {\n stackItem.popable = true;\n if (this.hasTasksToProcess()) {\n this._onMoreTasks();\n }\n }).catch((ex) => {\n setTimeout(() => {\n if (ex instanceof Error) {\n ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;\n }\n throw ex;\n }, 0);\n });\n }\n}\nconst _emitter = new EventEmitter();\nconst InteractionManager = {\n Events: {\n interactionStart: \"interactionStart\",\n interactionComplete: \"interactionComplete\"\n },\n /**\n * Schedule a function to run after all interactions have completed.\n */\n runAfterInteractions(task) {\n const tasks = [];\n const promise = new Promise((resolve) => {\n _scheduleUpdate();\n if (task) {\n tasks.push(task);\n }\n tasks.push({\n run: resolve,\n name: \"resolve \" + (task && typeof task === \"object\" && \"name\" in task && task.name || \"?\")\n });\n _taskQueue.enqueueTasks(tasks);\n });\n return {\n then: promise.then.bind(promise),\n done: promise.then.bind(promise),\n cancel: () => {\n _taskQueue.cancelTasks(tasks);\n }\n };\n },\n /**\n * Notify manager that an interaction has started.\n */\n createInteractionHandle() {\n _scheduleUpdate();\n const handle = ++_inc;\n _addInteractionSet.add(handle);\n return handle;\n },\n /**\n * Notify manager that an interaction has completed.\n */\n clearInteractionHandle(handle) {\n invariant(!!handle, \"Must provide a handle to clear.\");\n _scheduleUpdate();\n _addInteractionSet.delete(handle);\n _deleteInteractionSet.add(handle);\n },\n addListener: _emitter.addListener.bind(_emitter),\n /**\n * Set deadline for task processing\n */\n setDeadline(deadline) {\n _deadline = deadline;\n }\n};\nconst _interactionSet = /* @__PURE__ */ new Set();\nconst _addInteractionSet = /* @__PURE__ */ new Set();\nconst _deleteInteractionSet = /* @__PURE__ */ new Set();\nconst _taskQueue = new TaskQueue({ onMoreTasks: _scheduleUpdate });\nlet _nextUpdateHandle = null;\nlet _inc = 0;\nlet _deadline = -1;\nfunction _scheduleUpdate() {\n if (!_nextUpdateHandle) {\n if (_deadline > 0) {\n _nextUpdateHandle = setTimeout(_processUpdate);\n } else {\n _nextUpdateHandle = requestIdleCallback(_processUpdate);\n }\n }\n}\nfunction _processUpdate() {\n _nextUpdateHandle = null;\n const interactionCount = _interactionSet.size;\n _addInteractionSet.forEach((handle) => _interactionSet.add(handle));\n _deleteInteractionSet.forEach((handle) => _interactionSet.delete(handle));\n const nextInteractionCount = _interactionSet.size;\n if (interactionCount !== 0 && nextInteractionCount === 0) {\n _emitter.emit(\"interactionComplete\");\n } else if (interactionCount === 0 && nextInteractionCount !== 0) {\n _emitter.emit(\"interactionStart\");\n }\n if (nextInteractionCount === 0) {\n const begin = Date.now();\n while (_taskQueue.hasTasksToProcess()) {\n _taskQueue.processNext();\n if (_deadline > 0 && Date.now() - begin >= _deadline) {\n _scheduleUpdate();\n break;\n }\n }\n }\n _addInteractionSet.clear();\n _deleteInteractionSet.clear();\n}\nexport {\n InteractionManager\n};\n//# sourceMappingURL=InteractionManager.js.map\n"],"mappings":";;;;AAEA,IAAM,eAAN,MAAmB;CACjB,YAAY,CAAC;CACb,YAAY,WAAW,UAAU,SAAS;EACxC,MAAM,gBAAgB,KAAK,UAAU,SAAS;EAC9C,MAAM,eAAe;GACnB;GACA;GACA,cAAc;IACZ,cAAc,OAAO,YAAY;GACnC;EACF;EACA,cAAc,IAAI,YAAY;EAC9B,OAAO;CACT;CACA,KAAK,WAAW,GAAG,MAAM;EACvB,MAAM,gBAAgB,KAAK,UAAU;EACrC,IAAI,iBAAiB,MAAM;GACzB,KAAK,MAAM,gBAAgB,MAAM,KAAK,aAAa,GAAG;IACpD,aAAa,SAAS,MAAM,aAAa,SAAS,IAAI;GACxD;EACF;CACF;CACA,UAAU,WAAW;EACnB,IAA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MAAM;CACzB,sBAAsB,MAAM;AAC9B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const Platform = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
OS: "web",
|
|
3
|
+
select: (obj) => "web" in obj ? obj.web : obj.default,
|
|
4
|
+
isTesting: process.env.NODE_ENV === "test"
|
|
5
5
|
};
|
|
6
|
+
|
|
6
7
|
export { Platform };
|
|
7
8
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/modules/Platform/index.js"],"sourcesContent":["const Platform = {\n OS: \"web\",\n select: (obj) => \"web\" in obj ? obj.web : obj.default,\n isTesting: process.env.NODE_ENV === \"test\"\n};\nexport {\n Platform\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,MAAM,WAAW;CACf,IAAI;CACJ,SAAS,QAAQ,SAAS,MAAM,IAAI,MAAM,IAAI;CAC9C,WAAW,QAAQ,IAAI,aAAa;AACtC"}
|
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
import { UIManager } from "../UIManager/index.mjs";
|
|
2
|
+
|
|
2
3
|
const TextInputState = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Internal state
|
|
6
|
+
*/
|
|
7
|
+
_currentlyFocusedNode: null,
|
|
8
|
+
/**
|
|
9
|
+
* Returns the ID of the currently focused text field, if one exists
|
|
10
|
+
* If no text field is focused it returns null
|
|
11
|
+
*/
|
|
12
|
+
currentlyFocusedField() {
|
|
13
|
+
if (document.activeElement !== this._currentlyFocusedNode) {
|
|
14
|
+
this._currentlyFocusedNode = null;
|
|
15
|
+
}
|
|
16
|
+
return this._currentlyFocusedNode;
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} TextInputID id of the text field to focus
|
|
20
|
+
* Focuses the specified text field
|
|
21
|
+
* noop if the text field was already focused
|
|
22
|
+
*/
|
|
23
|
+
focusTextInput(textFieldNode) {
|
|
24
|
+
if (textFieldNode !== null) {
|
|
25
|
+
this._currentlyFocusedNode = textFieldNode;
|
|
26
|
+
if (document.activeElement !== textFieldNode) {
|
|
27
|
+
UIManager.focus(textFieldNode);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @param {Object} textFieldNode id of the text field to focus
|
|
33
|
+
* Unfocuses the specified text field
|
|
34
|
+
* noop if it wasn't focused
|
|
35
|
+
*/
|
|
36
|
+
blurTextInput(textFieldNode) {
|
|
37
|
+
if (textFieldNode !== null) {
|
|
38
|
+
this._currentlyFocusedNode = null;
|
|
39
|
+
if (document.activeElement === textFieldNode) {
|
|
40
|
+
UIManager.blur(textFieldNode);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
43
44
|
};
|
|
45
|
+
|
|
44
46
|
export { TextInputState };
|
|
45
47
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/modules/TextInputState/index.js"],"sourcesContent":["import { UIManager } from \"../UIManager\";\nconst TextInputState = {\n /**\n * Internal state\n */\n _currentlyFocusedNode: null,\n /**\n * Returns the ID of the currently focused text field, if one exists\n * If no text field is focused it returns null\n */\n currentlyFocusedField() {\n if (document.activeElement !== this._currentlyFocusedNode) {\n this._currentlyFocusedNode = null;\n }\n return this._currentlyFocusedNode;\n },\n /**\n * @param {Object} TextInputID id of the text field to focus\n * Focuses the specified text field\n * noop if the text field was already focused\n */\n focusTextInput(textFieldNode) {\n if (textFieldNode !== null) {\n this._currentlyFocusedNode = textFieldNode;\n if (document.activeElement !== textFieldNode) {\n UIManager.focus(textFieldNode);\n }\n }\n },\n /**\n * @param {Object} textFieldNode id of the text field to focus\n * Unfocuses the specified text field\n * noop if it wasn't focused\n */\n blurTextInput(textFieldNode) {\n if (textFieldNode !== null) {\n this._currentlyFocusedNode = null;\n if (document.activeElement === textFieldNode) {\n UIManager.blur(textFieldNode);\n }\n }\n }\n};\nexport {\n TextInputState\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,MAAM,iBAAiB;;;;CAIrB,uBAAuB;;;;;CAKvB,wBAAwB;EACtB,IAAI,SAAS,kBAAkB,KAAK,uBAAuB;GACzD,KAAK,wBAAwB;EAC/B;EACA,OAAO,KAAK;CACd;;;;;;CAMA,eAAe,eAAe;EAC5B,IAAI,kBAAkB,MAAM;GAC1B,KAAK,wBAAwB;GAC7B,IAAI,SAAS,kBAAkB,eAAe;IAC5C,UAAU,MAAM,aAAa;GAC/B;EACF;CACF;;;;;;CAMA,cAAc,eAAe;EAC3B,IAAI,kBAAkB,MAAM;GAC1B,KAAK,wBAAwB;GAC7B,IAAI,SAAS,kBAAkB,eAAe;IAC5C,UAAU,KAAK,aAAa;GAC9B;EACF;CACF;AACF"}
|