expo-snowui 1.5.2 → 1.5.3
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/lib/module/component/snow-safe-area.js +33 -4
- package/lib/module/component/snow-safe-area.js.map +1 -1
- package/lib/module/component/wired/snow-modal.js +27 -37
- package/lib/module/component/wired/snow-modal.js.map +1 -1
- package/lib/module/component/wired/snow-overlay.js +6 -14
- package/lib/module/component/wired/snow-overlay.js.map +1 -1
- package/lib/module/context/snow-layer-context.js +43 -89
- package/lib/module/context/snow-layer-context.js.map +1 -1
- package/lib/module/context/snow-navigation-context.js +6 -6
- package/lib/module/context/snow-navigation-context.js.map +1 -1
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/component/snow-safe-area.js +24 -5
- package/src/component/wired/snow-modal.js +39 -45
- package/src/component/wired/snow-overlay.js +8 -18
- package/src/context/snow-layer-context.js +27 -72
- package/src/context/snow-navigation-context.js +6 -6
- package/src/index.tsx +6 -0
|
@@ -6,33 +6,62 @@ import { useStyleContext } from "../context/snow-style-context.js";
|
|
|
6
6
|
import { useFocusContext } from "../context/snow-focus-context.js";
|
|
7
7
|
import { useLayerContext } from "../context/snow-layer-context.js";
|
|
8
8
|
import util from "../util.js";
|
|
9
|
+
import { SnowModal } from "./wired/snow-modal.js";
|
|
10
|
+
import { SnowOverlay } from "./wired/snow-overlay.js";
|
|
9
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
export function SnowSafeArea(props) {
|
|
11
13
|
const {
|
|
12
14
|
SnowStyle
|
|
13
15
|
} = useStyleContext(props);
|
|
14
16
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
modalPayload,
|
|
18
|
+
overlayPayload,
|
|
19
|
+
DEBUG_LAYERS
|
|
17
20
|
} = useLayerContext();
|
|
18
21
|
const {
|
|
19
22
|
setScrollViewRef
|
|
20
23
|
} = useFocusContext();
|
|
21
24
|
const scrollViewRef = React.useRef(null);
|
|
25
|
+
|
|
26
|
+
// This allows modals and overlays to draw on top of the regular app
|
|
27
|
+
// Enabling things like fullscreen video
|
|
28
|
+
// It requires a rendering function instead of computed JSX
|
|
29
|
+
// Otherwise controlled forms inside a modal would not update their state
|
|
30
|
+
let modal = null;
|
|
31
|
+
if (modalPayload) {
|
|
32
|
+
modal = /*#__PURE__*/_jsx(SnowModal, {
|
|
33
|
+
...modalPayload.props,
|
|
34
|
+
render: modalPayload.render
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
let overlay = null;
|
|
38
|
+
if (overlayPayload) {
|
|
39
|
+
overlay = /*#__PURE__*/_jsx(SnowOverlay, {
|
|
40
|
+
...overlayPayload.props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
22
43
|
React.useEffect(() => {
|
|
23
44
|
if (scrollViewRef.current) {
|
|
24
45
|
setScrollViewRef(scrollViewRef);
|
|
25
46
|
}
|
|
26
47
|
}, [scrollViewRef]);
|
|
48
|
+
if (DEBUG_LAYERS) {
|
|
49
|
+
util.prettyLog({
|
|
50
|
+
component: 'safe-area',
|
|
51
|
+
action: 'render',
|
|
52
|
+
modalPayload,
|
|
53
|
+
overlayPayload
|
|
54
|
+
});
|
|
55
|
+
}
|
|
27
56
|
return /*#__PURE__*/_jsxs(View, {
|
|
28
57
|
style: util.blankStyle,
|
|
29
58
|
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
30
59
|
ref: scrollViewRef,
|
|
31
60
|
style: SnowStyle.component.safeArea,
|
|
32
61
|
snowStyle: SnowStyle,
|
|
33
|
-
showsVerticalScrollIndicator: !
|
|
62
|
+
showsVerticalScrollIndicator: !modalPayload,
|
|
34
63
|
children: props.children
|
|
35
|
-
}),
|
|
64
|
+
}), modal, overlay]
|
|
36
65
|
});
|
|
37
66
|
}
|
|
38
67
|
export default SnowSafeArea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ScrollView","View","useStyleContext","useFocusContext","useLayerContext","util","jsx","_jsx","jsxs","_jsxs","SnowSafeArea","props","SnowStyle","
|
|
1
|
+
{"version":3,"names":["React","ScrollView","View","useStyleContext","useFocusContext","useLayerContext","util","SnowModal","SnowOverlay","jsx","_jsx","jsxs","_jsxs","SnowSafeArea","props","SnowStyle","modalPayload","overlayPayload","DEBUG_LAYERS","setScrollViewRef","scrollViewRef","useRef","modal","render","overlay","useEffect","current","prettyLog","component","action","style","blankStyle","children","ref","safeArea","snowStyle","showsVerticalScrollIndicator"],"sourceRoot":"../../../src","sources":["component/snow-safe-area.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,eAAe,QAAQ,kCAA+B;AAC/D,SAASC,eAAe,QAAQ,kCAA+B;AAC/D,SAASC,eAAe,QAAQ,kCAA+B;AAC/D,OAAOC,IAAI,MAAM,YAAS;AAC1B,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SAASC,WAAW,QAAQ,yBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,OAAO,SAASC,YAAYA,CAACC,KAAK,EAAE;EAChC,MAAM;IAAEC;EAAU,CAAC,GAAGZ,eAAe,CAACW,KAAK,CAAC;EAC5C,MAAM;IAAEE,YAAY;IAAEC,cAAc;IAAEC;EAAa,CAAC,GAAGb,eAAe,CAAC,CAAC;EACxE,MAAM;IAAEc;EAAiB,CAAC,GAAGf,eAAe,CAAC,CAAC;EAC9C,MAAMgB,aAAa,GAAGpB,KAAK,CAACqB,MAAM,CAAC,IAAI,CAAC;;EAExC;EACA;EACA;EACA;EACA,IAAIC,KAAK,GAAG,IAAI;EAChB,IAAIN,YAAY,EAAE;IACdM,KAAK,gBAAGZ,IAAA,CAACH,SAAS;MAAA,GAAKS,YAAY,CAACF,KAAK;MAAES,MAAM,EAAEP,YAAY,CAACO;IAAO,CAAE,CAAC;EAC9E;EAEA,IAAIC,OAAO,GAAG,IAAI;EAClB,IAAIP,cAAc,EAAE;IAChBO,OAAO,gBAAGd,IAAA,CAACF,WAAW;MAAA,GAAKS,cAAc,CAACH;IAAK,CAAG,CAAC;EACvD;EAEAd,KAAK,CAACyB,SAAS,CAAC,MAAM;IAClB,IAAIL,aAAa,CAACM,OAAO,EAAE;MACvBP,gBAAgB,CAACC,aAAa,CAAC;IACnC;EACJ,CAAC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,IAAIF,YAAY,EAAE;IACdZ,IAAI,CAACqB,SAAS,CAAC;MAAEC,SAAS,EAAE,WAAW;MAAEC,MAAM,EAAE,QAAQ;MAAEb,YAAY;MAAEC;IAAe,CAAC,CAAC;EAC9F;EAEA,oBACIL,KAAA,CAACV,IAAI;IAAC4B,KAAK,EAAExB,IAAI,CAACyB,UAAW;IAAAC,QAAA,gBACzBtB,IAAA,CAACT,UAAU;MACPgC,GAAG,EAAEb,aAAc;MACnBU,KAAK,EAAEf,SAAS,CAACa,SAAS,CAACM,QAAS;MACpCC,SAAS,EAAEpB,SAAU;MACrBqB,4BAA4B,EAAE,CAACpB,YAAa;MAAAgB,QAAA,EAC3ClB,KAAK,CAACkB;IAAQ,CACP,CAAC,EACZV,KAAK,EACLE,OAAO;EAAA,CACN,CAAC;AAEf;AAEA,eAAeX,YAAY","ignoreList":[]}
|
|
@@ -4,8 +4,6 @@ import React from 'react';
|
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { useFocusContext } from "../../context/snow-focus-context.js";
|
|
6
6
|
import { useInputContext } from "../../context/snow-input-context.js";
|
|
7
|
-
import { useLayerContext } from "../../context/snow-layer-context.js";
|
|
8
|
-
import { useNavigationContext } from "../../context/snow-navigation-context.js";
|
|
9
7
|
import { useStyleContext } from "../../context/snow-style-context.js";
|
|
10
8
|
import SnowFillView from "../snow-fill-view.js";
|
|
11
9
|
import SnowText from "../snow-text.js";
|
|
@@ -22,10 +20,6 @@ const SnowModalW = props => {
|
|
|
22
20
|
pushFocusLayer,
|
|
23
21
|
popFocusLayer
|
|
24
22
|
} = useFocusContext(props);
|
|
25
|
-
const {
|
|
26
|
-
pushModal,
|
|
27
|
-
popModal
|
|
28
|
-
} = useLayerContext(props);
|
|
29
23
|
if (!props.onRequestClose) {
|
|
30
24
|
return /*#__PURE__*/_jsx(SnowText, {
|
|
31
25
|
children: "SnowModal requires an onRequestClose prop"
|
|
@@ -36,15 +30,25 @@ const SnowModalW = props => {
|
|
|
36
30
|
return /*#__PURE__*/_jsx(SnowText, {
|
|
37
31
|
children: "SnowModal requires a focusLayer prop"
|
|
38
32
|
});
|
|
39
|
-
} else {
|
|
40
|
-
React.useEffect(() => {
|
|
41
|
-
pushFocusLayer(`snow-modal-${props.focusLayer}`, true);
|
|
42
|
-
return () => {
|
|
43
|
-
popFocusLayer();
|
|
44
|
-
};
|
|
45
|
-
}, []);
|
|
46
33
|
}
|
|
47
34
|
}
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (props.assignFocus && props.focusLayer) {
|
|
37
|
+
pushFocusLayer(`snow-modal-${props.focusLayer}`, true);
|
|
38
|
+
return () => {
|
|
39
|
+
popFocusLayer();
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}, []);
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
const backListenerKey = addBackListener(() => {
|
|
45
|
+
props.onRequestClose();
|
|
46
|
+
return true;
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
removeBackListener(backListenerKey);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
48
52
|
let style = [SnowStyle.component.modal.prompt];
|
|
49
53
|
if (props.transparent) {
|
|
50
54
|
style.push(SnowStyle.component.modal.transparent);
|
|
@@ -55,47 +59,33 @@ const SnowModalW = props => {
|
|
|
55
59
|
if (props.contentStyle) {
|
|
56
60
|
style.push(props.contentStyle);
|
|
57
61
|
}
|
|
58
|
-
let
|
|
62
|
+
let modalContent = null;
|
|
59
63
|
if (props.wrapper === false) {
|
|
60
|
-
|
|
64
|
+
modalContent = /*#__PURE__*/_jsx(View, {
|
|
61
65
|
navigationBarTranslucent: true,
|
|
62
66
|
statusBarTranslucent: true,
|
|
63
67
|
transparent: props.transparent,
|
|
64
68
|
style: style,
|
|
65
|
-
children: props.
|
|
69
|
+
children: props.render()
|
|
66
70
|
});
|
|
67
71
|
} else {
|
|
68
72
|
let modalStyle = [SnowStyle.component.modal.default, SnowStyle.component.modal.prompt];
|
|
69
73
|
if (props.modalStyle) {
|
|
70
74
|
modalStyle.push(props.modalStyle);
|
|
71
75
|
}
|
|
72
|
-
|
|
73
|
-
scroll: props.scroll,
|
|
74
|
-
children: props.children,
|
|
75
|
-
style: style
|
|
76
|
-
});
|
|
77
|
-
modalView = /*#__PURE__*/_jsx(View, {
|
|
76
|
+
modalContent = /*#__PURE__*/_jsx(View, {
|
|
78
77
|
style: modalStyle,
|
|
79
78
|
navigationBarTranslucent: true,
|
|
80
79
|
statusBarTranslucent: true,
|
|
81
80
|
transparent: props.transparent,
|
|
82
|
-
children:
|
|
81
|
+
children: /*#__PURE__*/_jsx(SnowFillView, {
|
|
82
|
+
scroll: props.scroll,
|
|
83
|
+
style: style,
|
|
84
|
+
children: props.render()
|
|
85
|
+
})
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
|
-
|
|
86
|
-
React.useEffect(() => {
|
|
87
|
-
pushModal(modalView);
|
|
88
|
-
const backListenerKey = addBackListener(() => {
|
|
89
|
-
props.onRequestClose();
|
|
90
|
-
return true;
|
|
91
|
-
});
|
|
92
|
-
return () => {
|
|
93
|
-
removeBackListener(backListenerKey);
|
|
94
|
-
popModal();
|
|
95
|
-
};
|
|
96
|
-
}, []);
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
88
|
+
return modalContent;
|
|
99
89
|
};
|
|
100
90
|
SnowModalW.isSnowFocusWired = true;
|
|
101
91
|
export const SnowModal = SnowModalW;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","useFocusContext","useInputContext","
|
|
1
|
+
{"version":3,"names":["React","View","useFocusContext","useInputContext","useStyleContext","SnowFillView","SnowText","jsx","_jsx","SnowModalW","props","SnowStyle","addBackListener","removeBackListener","pushFocusLayer","popFocusLayer","onRequestClose","children","assignFocus","focusLayer","useEffect","backListenerKey","style","component","modal","prompt","transparent","push","center","contentStyle","modalContent","wrapper","navigationBarTranslucent","statusBarTranslucent","render","modalStyle","default","scroll","isSnowFocusWired","SnowModal"],"sourceRoot":"../../../../src","sources":["component/wired/snow-modal.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,eAAe,QAAQ,qCAAkC;AAClE,SAASC,eAAe,QAAQ,qCAAkC;AAClE,SAASC,eAAe,QAAQ,qCAAkC;AAElE,OAAOC,YAAY,MAAM,sBAAmB;AAC5C,OAAOC,QAAQ,MAAM,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAMC,UAAU,GAAIC,KAAK,IAAK;EAC1B,MAAM;IAAEC;EAAU,CAAC,GAAGP,eAAe,CAACM,KAAK,CAAC;EAC5C,MAAM;IAAEE,eAAe;IAAEC;EAAmB,CAAC,GAAGV,eAAe,CAAC,CAAC;EACjE,MAAM;IAAEW,cAAc;IAAEC;EAAc,CAAC,GAAGb,eAAe,CAACQ,KAAK,CAAC;EAEhE,IAAI,CAACA,KAAK,CAACM,cAAc,EAAE;IACvB,oBAAOR,IAAA,CAACF,QAAQ;MAAAW,QAAA,EAAC;IAAyC,CAAU,CAAC;EACzE;EAEA,IAAIP,KAAK,CAACQ,WAAW,KAAK,KAAK,EAAE;IAC7B,IAAI,CAACR,KAAK,CAACS,UAAU,EAAE;MACnB,oBAAOX,IAAA,CAACF,QAAQ;QAAAW,QAAA,EAAC;MAAoC,CAAU,CAAC;IACpE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T;EACL,CAAC,MAAM;IACH,IAAIC,UAAU,GAAG,CACbxB,SAAS,CAACY,SAAS,CAACC,KAAK,CAACY,OAAO,EACjCzB,SAAS,CAACY,SAAS,CAACC,KAAK,CAACC,MAAM,CACnC;IACD,IAAIf,KAAK,CAACyB,UAAU,EAAE;MAClBA,UAAU,CAACR,IAAI,CAACjB,KAAK,CAACyB,UAAU,CAAC;IACrC;IAEAL,YAAY,gBAEJtB,IAAA,CAACP,IAAI;MACDqB,KAAK,EAAEa,UAAW;MAClBH,wBAAwB;MACxBC,oBAAoB;MACpBP,WAAW,EAAEhB,KAAK,CAACgB,WAAY;MAAAT,QAAA,eAE/BT,IAAA,CAACH,YAAY;QACTgC,MAAM,EAAE3B,KAAK,CAAC2B,MAAO;QACrBf,KAAK,EAAEA,KAAM;QAAAL,QAAA,EACZP,KAAK,CAACwB,MAAM,CAAC;MAAC,CACL;IAAC,CACb,CACT;EACT;EACA,OAAOJ,YAAY;AACvB,CAAC;AAEDrB,UAAU,CAAC6B,gBAAgB,GAAG,IAAI;AAElC,OAAO,MAAMC,SAAS,GAAG9B,UAAU;AAEnC,eAAe8B,SAAS","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import { useStyleContext } from "../../context/snow-style-context.js";
|
|
|
6
6
|
import { useFocusContext } from "../../context/snow-focus-context.js";
|
|
7
7
|
import { useLayerContext } from "../../context/snow-layer-context.js";
|
|
8
8
|
import SnowText from "../snow-text.js";
|
|
9
|
+
import SnowFillView from "../snow-fill-view.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const SnowOverlayW = props => {
|
|
11
12
|
const {
|
|
@@ -18,12 +19,9 @@ const SnowOverlayW = props => {
|
|
|
18
19
|
pushFocusLayer,
|
|
19
20
|
popFocusLayer,
|
|
20
21
|
focusedLayer,
|
|
21
|
-
addFocusMap
|
|
22
|
+
addFocusMap,
|
|
23
|
+
readFocusProps
|
|
22
24
|
} = useFocusContext();
|
|
23
|
-
const {
|
|
24
|
-
pushOverlay,
|
|
25
|
-
popOverlay
|
|
26
|
-
} = useLayerContext(props);
|
|
27
25
|
if (!props.focusLayer) {
|
|
28
26
|
return /*#__PURE__*/_jsx(SnowText, {
|
|
29
27
|
children: "SnowOverlay requires a focusLayer prop"
|
|
@@ -51,23 +49,17 @@ const SnowOverlayW = props => {
|
|
|
51
49
|
if (props.black) {
|
|
52
50
|
style.push(SnowStyle.component.overlay.black);
|
|
53
51
|
}
|
|
54
|
-
|
|
52
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
55
53
|
ref: elementRef,
|
|
56
54
|
...tvRemoteProps,
|
|
55
|
+
...readFocusProps(props),
|
|
57
56
|
style: style,
|
|
58
57
|
activeOpacity: 1 // Without this, the overlay applies a white filter to anything underneath
|
|
59
58
|
,
|
|
60
59
|
onPress: focusPress(elementRef, props.focusKey),
|
|
61
60
|
onLongPress: focusLongPress(elementRef, props.focusKey),
|
|
62
|
-
children:
|
|
61
|
+
children: /*#__PURE__*/_jsx(SnowFillView, {})
|
|
63
62
|
});
|
|
64
|
-
React.useEffect(() => {
|
|
65
|
-
pushOverlay(overlayView);
|
|
66
|
-
return () => {
|
|
67
|
-
popOverlay();
|
|
68
|
-
};
|
|
69
|
-
}, []);
|
|
70
|
-
return null;
|
|
71
63
|
};
|
|
72
64
|
SnowOverlayW.isSnowFocusWired = true;
|
|
73
65
|
export const SnowOverlay = SnowOverlayW;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TouchableOpacity","useStyleContext","useFocusContext","useLayerContext","SnowText","jsx","_jsx","SnowOverlayW","props","SnowStyle","focusLongPress","focusPress","tvRemoteProps","pushFocusLayer","popFocusLayer","focusedLayer","addFocusMap","
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","useStyleContext","useFocusContext","useLayerContext","SnowText","SnowFillView","jsx","_jsx","SnowOverlayW","props","SnowStyle","focusLongPress","focusPress","tvRemoteProps","pushFocusLayer","popFocusLayer","focusedLayer","addFocusMap","readFocusProps","focusLayer","children","isReady","setIsReady","useState","elementRef","useRef","focusLayerName","useEffect","current","focusStart","focusKey","focusDown","focusUp","focusRight","focusLeft","style","component","overlay","touchable","transparent","push","black","ref","activeOpacity","onPress","onLongPress","isSnowFocusWired","SnowOverlay"],"sourceRoot":"../../../../src","sources":["component/wired/snow-overlay.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,eAAe,QAAQ,qCAAkC;AAClE,SAASC,eAAe,QAAQ,qCAAkC;AAClE,SAASC,eAAe,QAAQ,qCAAkC;AAClE,OAAOC,QAAQ,MAAM,iBAAc;AACnC,OAAOC,YAAY,MAAM,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE5C,MAAMC,YAAY,GAAIC,KAAK,IAAK;EAC5B,MAAM;IAAEC;EAAU,CAAC,GAAGT,eAAe,CAACQ,KAAK,CAAC;EAC5C,MAAM;IACFE,cAAc;IACdC,UAAU;IACVC,aAAa;IACbC,cAAc;IACdC,aAAa;IACbC,YAAY;IACZC,WAAW;IACXC;EACJ,CAAC,GAAGhB,eAAe,CAAC,CAAC;EAErB,IAAI,CAACO,KAAK,CAACU,UAAU,EAAE;IACnB,oBAAOZ,IAAA,CAACH,QAAQ;MAAAgB,QAAA,EAAC;IAAsC,CAAU,CAAC;EACtE;EAEA,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGvB,KAAK,CAACwB,QAAQ,CAAC,KAAK,CAAC;EAEnD,MAAMC,UAAU,GAAGzB,KAAK,CAAC0B,MAAM,CAAC,IAAI,CAAC;EACrC,MAAMC,cAAc,GAAG,gBAAgBjB,KAAK,CAACU,UAAU,EAAE;EAEzDpB,KAAK,CAAC4B,SAAS,CAAC,MAAM;IAClBb,cAAc,CAACY,cAAc,EAAE,IAAI,CAAC;IACpCJ,UAAU,CAAC,IAAI,CAAC;IAChB,OAAO,MAAM;MACTP,a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AAW,GAAGvC,YAAY;AAEvC,eAAeuC,WAAW","ignoreList":[]}
|
|
@@ -12,113 +12,67 @@ export function useLayerContext() {
|
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
14
|
export function LayerContextProvider(props) {
|
|
15
|
-
const [
|
|
16
|
-
const [
|
|
17
|
-
const modalRef = React.useRef(null);
|
|
18
|
-
const overlayRef = React.useRef(null);
|
|
15
|
+
const [modalPayload, setModalPayload] = React.useState(null);
|
|
16
|
+
const [overlayPayload, setOverlayPayload] = React.useState(null);
|
|
19
17
|
const DEBUG = props.DEBUG_LAYERS;
|
|
20
|
-
const
|
|
21
|
-
setOverlays(prev => {
|
|
22
|
-
if (DEBUG) {
|
|
23
|
-
prettyLog({
|
|
24
|
-
context: 'layer',
|
|
25
|
-
action: 'pushOverlay',
|
|
26
|
-
prev,
|
|
27
|
-
overlay
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
overlayRef.current = overlay;
|
|
31
|
-
return [...prev, overlay];
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const popOverlay = () => {
|
|
35
|
-
setOverlays(prev => {
|
|
36
|
-
let result = [...prev];
|
|
37
|
-
if (result.length) {
|
|
38
|
-
result.pop();
|
|
39
|
-
overlayRef.current = result?.at(-1);
|
|
40
|
-
} else {
|
|
41
|
-
overlayRef.current = null;
|
|
42
|
-
}
|
|
43
|
-
if (DEBUG) {
|
|
44
|
-
prettyLog({
|
|
45
|
-
context: 'layer',
|
|
46
|
-
action: 'popOverlay',
|
|
47
|
-
prev,
|
|
48
|
-
result
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
let currentOverlay = null;
|
|
55
|
-
if (overlays.length) {
|
|
56
|
-
currentOverlay = modals.at(-1);
|
|
57
|
-
}
|
|
58
|
-
const clearOverlays = () => {
|
|
18
|
+
const enableOverlay = payload => {
|
|
59
19
|
if (DEBUG) {
|
|
60
20
|
prettyLog({
|
|
61
21
|
context: 'layer',
|
|
62
|
-
action: '
|
|
22
|
+
action: 'enableOverlay',
|
|
23
|
+
overlayPayload,
|
|
24
|
+
payload
|
|
63
25
|
});
|
|
64
26
|
}
|
|
65
|
-
|
|
27
|
+
setOverlayPayload(payload);
|
|
66
28
|
};
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
modalRef.current = modal;
|
|
78
|
-
return [...prev, modal];
|
|
79
|
-
});
|
|
29
|
+
const disableOverlay = () => {
|
|
30
|
+
if (DEBUG) {
|
|
31
|
+
prettyLog({
|
|
32
|
+
context: 'layer',
|
|
33
|
+
action: 'disableOverlay',
|
|
34
|
+
overlayPayload
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
setOverlayPayload(null);
|
|
80
38
|
};
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
prettyLog({
|
|
92
|
-
context: 'layer',
|
|
93
|
-
action: 'popModal',
|
|
94
|
-
prev,
|
|
95
|
-
result
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
});
|
|
39
|
+
const showModal = payload => {
|
|
40
|
+
if (DEBUG) {
|
|
41
|
+
prettyLog({
|
|
42
|
+
context: 'layer',
|
|
43
|
+
action: 'showModal',
|
|
44
|
+
modalPayload,
|
|
45
|
+
payload
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
setModalPayload(payload);
|
|
100
49
|
};
|
|
101
|
-
const
|
|
102
|
-
|
|
50
|
+
const hideModal = () => {
|
|
51
|
+
if (DEBUG) {
|
|
52
|
+
prettyLog({
|
|
53
|
+
context: 'layer',
|
|
54
|
+
action: 'hideModal',
|
|
55
|
+
modalPayload
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
setModalPayload(null);
|
|
103
59
|
};
|
|
104
60
|
if (DEBUG === 'verbose') {
|
|
105
61
|
prettyLog({
|
|
106
62
|
context: 'layer',
|
|
107
63
|
action: 'render',
|
|
108
|
-
|
|
109
|
-
|
|
64
|
+
modalPayload,
|
|
65
|
+
overlayPayload
|
|
110
66
|
});
|
|
111
67
|
}
|
|
112
68
|
const context = {
|
|
113
69
|
DEBUG_LAYERS: DEBUG,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
currentModal: modalRef?.current,
|
|
121
|
-
currentOverlay: overlayRef?.current
|
|
70
|
+
enableOverlay,
|
|
71
|
+
disableOverlay,
|
|
72
|
+
overlayPayload,
|
|
73
|
+
showModal,
|
|
74
|
+
hideModal,
|
|
75
|
+
modalPayload
|
|
122
76
|
};
|
|
123
77
|
return /*#__PURE__*/_jsx(LayerContext.Provider, {
|
|
124
78
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","prettyLog","jsx","_jsx","LayerContext","createContext","useLayerContext","value","useContext","Error","LayerContextProvider","props","
|
|
1
|
+
{"version":3,"names":["React","prettyLog","jsx","_jsx","LayerContext","createContext","useLayerContext","value","useContext","Error","LayerContextProvider","props","modalPayload","setModalPayload","useState","overlayPayload","setOverlayPayload","DEBUG","DEBUG_LAYERS","enableOverlay","payload","context","action","disableOverlay","showModal","hideModal","Provider","style","flex","children"],"sourceRoot":"../../../src","sources":["context/snow-layer-context.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,SAAS,QAAQ,YAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAMC,YAAY,gBAAGJ,KAAK,CAACK,aAAa,CAAC,CAAC,CAAC,CAAC;AAE5C,OAAO,SAASC,eAAeA,CAAA,EAAG;EAC9B,IAA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,WAAW;QAAEV;MAAa,CAAC,CAAC;IACtE;IACAC,eAAe,CAAC,IAAI,CAAC;EACzB,CAAC;EAED,IAAII,KAAK,KAAK,SAAS,EAAE;IACrBhB,SAAS,CAAC;MAAEoB,OAAO,EAAE,OAAO;MAAEC,MAAM,EAAE,QAAQ;MAAEV,YAAY;MAAEG;IAAe,CAAC,CAAC;EACnF;EAEA,MAAMM,OAAO,GAAG;IACZH,YAAY,EAAED,KAAK;IACnBE,aAAa;IACbI,cAAc;IACdR,cAAc;IACdS,SAAS;IACTC,SAAS;IACTb;EACJ,CAAC;EACD,oBACIT,IAAA,CAACC,YAAY,CAACsB,QAAQ;IAACC,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAE;IAACrB,KAAK,EAAEc,OAAQ;IAAAQ,QAAA,EACrDlB,KAAK,CAACkB;EAAQ,CACI,CAAC;AAEhC;AAEA,eAAenB,oBAAoB","ignoreList":[]}
|
|
@@ -50,9 +50,9 @@ export function NavigationContextProvider(props) {
|
|
|
50
50
|
isFocusedLayer
|
|
51
51
|
} = useFocusContext();
|
|
52
52
|
const {
|
|
53
|
-
|
|
53
|
+
modalRender
|
|
54
54
|
} = useLayerContext();
|
|
55
|
-
const
|
|
55
|
+
const modalRenderRef = React.useRef();
|
|
56
56
|
const [isReady, setIsReady] = React.useState(false);
|
|
57
57
|
const [pageLookup, setPageLookup] = React.useState({});
|
|
58
58
|
const [initialPath, setInitialPath] = React.useState(null);
|
|
@@ -71,8 +71,8 @@ export function NavigationContextProvider(props) {
|
|
|
71
71
|
}
|
|
72
72
|
}, [navigationHistory]);
|
|
73
73
|
React.useEffect(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
74
|
+
modalRenderRef.current = modalRender;
|
|
75
|
+
}, [modalRender]);
|
|
76
76
|
React.useEffect(() => {
|
|
77
77
|
let lookup = {};
|
|
78
78
|
if (!props.routePaths) {
|
|
@@ -229,10 +229,10 @@ export function NavigationContextProvider(props) {
|
|
|
229
229
|
prettyLog({
|
|
230
230
|
context: 'navigation',
|
|
231
231
|
action: 'backListener',
|
|
232
|
-
modal:
|
|
232
|
+
modal: modalRenderRef.current
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
if (
|
|
235
|
+
if (modalRenderRef.current) {
|
|
236
236
|
// When a modal is shown, prevent default event handlers from exiting the app/page
|
|
237
237
|
return true;
|
|
238
238
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","useFocusContext","useInputContext","useLayerContext","util","prettyLog","SnowText","jsx","_jsx","NavigationContext","createContext","useNavigationContext","value","useContext","Error","NavigationContextProvider","props","DEBUG","DEBUG_NAVIGATION","addBackListener","removeBackListener","pushFocusLayer","popFocusLayer","focusedLayer","isFocusedLayer","
|
|
1
|
+
{"version":3,"names":["React","Platform","View","useFocusContext","useInputContext","useLayerContext","util","prettyLog","SnowText","jsx","_jsx","NavigationContext","createContext","useNavigationContext","value","useContext","Error","NavigationContextProvider","props","DEBUG","DEBUG_NAVIGATION","addBackListener","removeBackListener","pushFocusLayer","popFocusLayer","focusedLayer","isFocusedLayer","modalRender","modalRenderRef","useRef","isReady","setIsReady","useState","pageLookup","setPageLookup","initialPath","setInitialPath","navigationHistory","setNavigationHistory","navigationHistoryRef","useEffect","current","at","routePath","layerName","pathKey","lookup","routePaths","console","log","Object","keys","initialRoutePath","routePages","pageKey","page","initialRoute","initialParams","OS","window","location","pathname","queryToObject","search","routeParams","navPush","isFunc","foundParams","foundPath","foundFunc","func","prev","result","params","history","replaceState","stateToUrl","push","pushState","context","action","navPop","length","pop","navReset","resetPath","resetRoutePath","modal","currentRoute","style","blankStyle","CurrentPage","Provider","flex","children"],"sourceRoot":"../../../src","sources":["context/snow-navigation-context.js"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAE7C,SAASC,eAAe,QAAQ,yBAAsB;AACtD,SAASC,eAAe,QAAQ,yB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AAC;IACd;EACJ,CAAC,EAAE,CAACnD,UAAU,EAAEI,iBAAiB,CAAC,CAAC;EAEnC,IAAI,CAACP,OAAO,EAAE;IACV,IAAIX,KAAK,EAAE;MACPZ,SAAS,CAAC;QAAEwE,OAAO,EAAE,YAAY;QAAEC,MAAM,EAAE,sBAAsB;QAAE7C,WAAW;QAAEF,UAAU;QAAEI,iBAAiB;QAAEZ,YAAY;QAAEP;MAAM,CAAC,CAAC;IACzI;IACA,oBAAOR,IAAA,CAACR,IAAI;MAACuF,KAAK,EAAEnF,IAAI,CAACoF;IAAW,CAAE,CAAC;EAC3C;EAEA,MAAMF,YAAY,GAAGnD,iBAAiB,CAACK,EAAE,CAAC,CAAC,CAAC,CAAC;EAC7C,IAAIiD,WAAW,GAAG1D,UAAU,CAACuD,YAAY,EAAE7C,SAAS,CAAC,EAAEY,IAAI;EAE3D,IAAIpC,KAAK,KAAK,SAAS,EAAE;IACrBZ,SAAS,CAAC;MAAEwE,OAAO,EAAE,YAAY;MAAEC,MAAM,EAAE,QAAQ;MAAEQ,YAAY;MAAEG;IAAY,CAAC,CAAC;EACrF;EAEA,MAAMZ,OAAO,GAAG;IACZ3D,gBAAgB,EAAED,KAAK;IACvBqE,YAAY;IACZG,WAAW;IACX1B,OAAO;IACPgB,MAAM;IACNG,QAAQ;IACR/C;EACJ,CAAC;EAED,oBACI3B,IAAA,CAACC,iBAAiB,CAACiF,QAAQ;IACvBH,KAAK,EAAE;MAAEI,IAAI,EAAE;IAAE,CAAE;IACnB/E,KAAK,EAAEiE,OAAQ;IAAAe,QAAA,EACd5E,KAAK,CAAC4E;EAAQ,CACS,CAAC;AAErC;AAEA,eAAe7E,yBAAyB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -5,6 +5,10 @@ export { SnowApp } from "./snow-app.js";
|
|
|
5
5
|
import { SnowApp } from "./snow-app.js";
|
|
6
6
|
export { useFocusContext } from "./context/snow-focus-context.js";
|
|
7
7
|
import { useFocusContext } from "./context/snow-focus-context.js";
|
|
8
|
+
export { useInputContext } from "./context/snow-input-context.js";
|
|
9
|
+
import { useInputContext } from "./context/snow-input-context.js";
|
|
10
|
+
export { useLayerContext } from "./context/snow-layer-context.js";
|
|
11
|
+
import { useLayerContext } from "./context/snow-layer-context.js";
|
|
8
12
|
export { useNavigationContext } from "./context/snow-navigation-context.js";
|
|
9
13
|
import { useNavigationContext } from "./context/snow-navigation-context.js";
|
|
10
14
|
export { useSnowContext } from "./context/snow-context.js";
|
|
@@ -58,6 +62,8 @@ export * as util from "./util.js";
|
|
|
58
62
|
export default {
|
|
59
63
|
useFocusLayer,
|
|
60
64
|
useFocusContext,
|
|
65
|
+
useInputContext,
|
|
66
|
+
useLayerContext,
|
|
61
67
|
useNavigationContext,
|
|
62
68
|
useSnowContext,
|
|
63
69
|
useStyleContext,
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SnowApp","useFocusContext","useNavigationContext","useSnowContext","useStyleContext","SnowBreak","SnowDropdown","SnowFillView","SnowGrid","SnowHeader","SnowImageButton","SnowImageGrid","SnowInput","SnowLabel","SnowModal","SnowOverlay","SnowRangeSlider","SnowSafeArea","SnowTabs","SnowTarget","SnowTextButton","SnowText","SnowToggle","SnowView","useFocusLayerFunc","name","uncloned","useFocusLayer","util","App","Break","Dropdown","FillView","Grid","Header","ImageButton","ImageGrid","Input","Label","Modal","Overlay","RangeSlider","SafeArea","Tabs","Target","TextButton","Text","Toggle","View"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,OAAO,QAAQ,eAAY;AACpC,SAASA,OAAO,QAAQ,eAAY;AAEpC,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASA,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASA,cAAc,QAA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,0BAAuB;AAChD,SAASC,UAAU,QAAQ,kCAA+B;AAC1D,SAASA,UAAU,QAAQ,kCAA+B;AAC1D,SAASC,QAAQ,QAAQ,gCAA6B;AACtD,SAASA,QAAQ,QAAQ,gCAA6B;AAEtD,MAAMC,iBAAiB,GAAGA,CAACC,IAAY,EAAEC,QAAiB,GAAG,KAAK,KAAK;EACrE,
|
|
1
|
+
{"version":3,"names":["SnowApp","useFocusContext","useInputContext","useLayerContext","useNavigationContext","useSnowContext","useStyleContext","SnowBreak","SnowDropdown","SnowFillView","SnowGrid","SnowHeader","SnowImageButton","SnowImageGrid","SnowInput","SnowLabel","SnowModal","SnowOverlay","SnowRangeSlider","SnowSafeArea","SnowTabs","SnowTarget","SnowTextButton","SnowText","SnowToggle","SnowView","useFocusLayerFunc","name","uncloned","useFocusLayer","util","App","Break","Dropdown","FillView","Grid","Header","ImageButton","ImageGrid","Input","Label","Modal","Overlay","RangeSlider","SafeArea","Tabs","Target","TextButton","Text","Toggle","View"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,SAASA,OAAO,QAAQ,eAAY;AACpC,SAASA,OAAO,QAAQ,eAAY;AAEpC,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASA,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASA,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASA,cAAc,QAAQ,2BAAwB;AACvD,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASA,eAAe,QAAQ,iCAA8B;AAE9D,SAASC,SAAS,QAAQ,2BAAwB;AAClD,SAASA,SAAS,QAAQ,2BAAwB;AAClD,SAASC,YAAY,QAAQ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GAAGA,CAACC,IAAY,EAAEC,QAAiB,GAAG,KAAK,KAAK;EACrE,OAAO3B,eAAe,CAAC,CAAC,CAAC4B,aAAa,CAACF,IAAI,EAAEC,QAAQ,CAAC;AACxD,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGH,iBAAiB;AAE9C,OAAOI,IAAI,MAAM,WAAQ;AACzB,OAAO,KAAKA,IAAI,MAAM,WAAQ;AAE9B,eAAe;EACbD,aAAa;EACb5B,eAAe;EACfC,eAAe;EACfC,eAAe;EACfC,oBAAoB;EACpBC,cAAc;EACdC,eAAe;EACf,GAAGwB,IAAI;EACPC,GAAG,EAAE/B,OAAO;EACZgC,KAAK,EAAEzB,SAAS;EAChB0B,QAAQ,EAAEzB,YAAY;EACtB0B,QAAQ,EAAEzB,YAAY;EACtB0B,IAAI,EAAEzB,QAAQ;EACd0B,MAAM,EAAEzB,UAAU;EAClB0B,WAAW,EAAEzB,eAAe;EAC5B0B,SAAS,EAAEzB,aAAa;EACxB0B,KAAK,EAAEzB,SAAS;EAChB0B,KAAK,EAAEzB,SAAS;EAChB0B,KAAK,EAAEzB,SAAS;EAChB0B,OAAO,EAAEzB,WAAW;EACpB0B,WAAW,EAAEzB,eAAe;EAC5B0B,QAAQ,EAAEzB,YAAY;EACtB0B,IAAI,EAAEzB,QAAQ;EACd0B,MAAM,EAAEzB,UAAU;EAClB0B,UAAU,EAAEzB,cAAc;EAC1B0B,IAAI,EAAEzB,QAAQ;EACd0B,MAAM,EAAEzB,UAAU;EAClB0B,IAAI,EAAEzB;AACR,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { SnowApp } from './snow-app';
|
|
2
2
|
export { useFocusContext } from './context/snow-focus-context';
|
|
3
|
+
export { useInputContext } from './context/snow-input-context';
|
|
4
|
+
export { useLayerContext } from './context/snow-layer-context';
|
|
3
5
|
export { useNavigationContext } from './context/snow-navigation-context';
|
|
4
6
|
export { useSnowContext } from './context/snow-context';
|
|
5
7
|
export { useStyleContext } from './context/snow-style-context';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAG9D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAA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AgC,CAAA;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAOtD,eAAO,MAAM,aAAa,SAJO,MAAM,aAAY,OAAO,QAIZ,CAAA;AAG9C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;;AAE9B,wBA6BC"}
|
package/package.json
CHANGED
|
@@ -4,31 +4,50 @@ import { useStyleContext } from '../context/snow-style-context'
|
|
|
4
4
|
import { useFocusContext } from '../context/snow-focus-context'
|
|
5
5
|
import { useLayerContext } from '../context/snow-layer-context'
|
|
6
6
|
import util from '../util'
|
|
7
|
+
import { SnowModal } from './wired/snow-modal'
|
|
8
|
+
import { SnowOverlay } from './wired/snow-overlay'
|
|
7
9
|
|
|
8
10
|
export function SnowSafeArea(props) {
|
|
9
11
|
const { SnowStyle } = useStyleContext(props)
|
|
10
|
-
const {
|
|
12
|
+
const { modalPayload, overlayPayload, DEBUG_LAYERS } = useLayerContext()
|
|
11
13
|
const { setScrollViewRef } = useFocusContext()
|
|
12
14
|
const scrollViewRef = React.useRef(null)
|
|
13
15
|
|
|
16
|
+
// This allows modals and overlays to draw on top of the regular app
|
|
17
|
+
// Enabling things like fullscreen video
|
|
18
|
+
// It requires a rendering function instead of computed JSX
|
|
19
|
+
// Otherwise controlled forms inside a modal would not update their state
|
|
20
|
+
let modal = null
|
|
21
|
+
if (modalPayload) {
|
|
22
|
+
modal = <SnowModal {...modalPayload.props} render={modalPayload.render} />
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let overlay = null
|
|
26
|
+
if (overlayPayload) {
|
|
27
|
+
overlay = <SnowOverlay {...overlayPayload.props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
14
30
|
React.useEffect(() => {
|
|
15
31
|
if (scrollViewRef.current) {
|
|
16
32
|
setScrollViewRef(scrollViewRef)
|
|
17
33
|
}
|
|
18
34
|
}, [scrollViewRef])
|
|
19
35
|
|
|
36
|
+
if (DEBUG_LAYERS) {
|
|
37
|
+
util.prettyLog({ component: 'safe-area', action: 'render', modalPayload, overlayPayload })
|
|
38
|
+
}
|
|
39
|
+
|
|
20
40
|
return (
|
|
21
41
|
<View style={util.blankStyle}>
|
|
22
42
|
<ScrollView
|
|
23
43
|
ref={scrollViewRef}
|
|
24
44
|
style={SnowStyle.component.safeArea}
|
|
25
45
|
snowStyle={SnowStyle}
|
|
26
|
-
showsVerticalScrollIndicator={!
|
|
27
|
-
>
|
|
46
|
+
showsVerticalScrollIndicator={!modalPayload} >
|
|
28
47
|
{props.children}
|
|
29
48
|
</ScrollView>
|
|
30
|
-
{
|
|
31
|
-
{
|
|
49
|
+
{modal}
|
|
50
|
+
{overlay}
|
|
32
51
|
</View>
|
|
33
52
|
)
|
|
34
53
|
}
|
|
@@ -2,8 +2,6 @@ import React from 'react'
|
|
|
2
2
|
import { View } from 'react-native'
|
|
3
3
|
import { useFocusContext } from '../../context/snow-focus-context'
|
|
4
4
|
import { useInputContext } from '../../context/snow-input-context'
|
|
5
|
-
import { useLayerContext } from '../../context/snow-layer-context'
|
|
6
|
-
import { useNavigationContext } from '../../context/snow-navigation-context'
|
|
7
5
|
import { useStyleContext } from '../../context/snow-style-context'
|
|
8
6
|
|
|
9
7
|
import SnowFillView from '../snow-fill-view'
|
|
@@ -13,7 +11,6 @@ const SnowModalW = (props) => {
|
|
|
13
11
|
const { SnowStyle } = useStyleContext(props)
|
|
14
12
|
const { addBackListener, removeBackListener } = useInputContext()
|
|
15
13
|
const { pushFocusLayer, popFocusLayer } = useFocusContext(props)
|
|
16
|
-
const { pushModal, popModal } = useLayerContext(props)
|
|
17
14
|
|
|
18
15
|
if (!props.onRequestClose) {
|
|
19
16
|
return <SnowText>SnowModal requires an onRequestClose prop</SnowText>
|
|
@@ -23,16 +20,26 @@ const SnowModalW = (props) => {
|
|
|
23
20
|
if (!props.focusLayer) {
|
|
24
21
|
return <SnowText>SnowModal requires a focusLayer prop</SnowText>
|
|
25
22
|
}
|
|
26
|
-
else {
|
|
27
|
-
React.useEffect(() => {
|
|
28
|
-
pushFocusLayer(`snow-modal-${props.focusLayer}`, true)
|
|
29
|
-
return () => {
|
|
30
|
-
popFocusLayer()
|
|
31
|
-
}
|
|
32
|
-
}, [])
|
|
33
|
-
}
|
|
34
23
|
}
|
|
35
24
|
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (props.assignFocus && props.focusLayer) {
|
|
27
|
+
pushFocusLayer(`snow-modal-${props.focusLayer}`, true)
|
|
28
|
+
return () => {
|
|
29
|
+
popFocusLayer()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, [])
|
|
33
|
+
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const backListenerKey = addBackListener(() => {
|
|
36
|
+
props.onRequestClose()
|
|
37
|
+
return true
|
|
38
|
+
})
|
|
39
|
+
return () => {
|
|
40
|
+
removeBackListener(backListenerKey)
|
|
41
|
+
}
|
|
42
|
+
}, [])
|
|
36
43
|
|
|
37
44
|
let style = [SnowStyle.component.modal.prompt]
|
|
38
45
|
if (props.transparent) {
|
|
@@ -44,15 +51,17 @@ const SnowModalW = (props) => {
|
|
|
44
51
|
if (props.contentStyle) {
|
|
45
52
|
style.push(props.contentStyle)
|
|
46
53
|
}
|
|
47
|
-
let
|
|
54
|
+
let modalContent = null
|
|
48
55
|
if (props.wrapper === false) {
|
|
49
|
-
|
|
56
|
+
modalContent = (
|
|
50
57
|
<View
|
|
51
58
|
navigationBarTranslucent
|
|
52
59
|
statusBarTranslucent
|
|
53
60
|
transparent={props.transparent}
|
|
54
61
|
style={style}
|
|
55
|
-
|
|
62
|
+
>
|
|
63
|
+
{props.render()}
|
|
64
|
+
</View>
|
|
56
65
|
)
|
|
57
66
|
} else {
|
|
58
67
|
let modalStyle = [
|
|
@@ -63,38 +72,23 @@ const SnowModalW = (props) => {
|
|
|
63
72
|
modalStyle.push(props.modalStyle)
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</View>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
if (modalView) {
|
|
85
|
-
React.useEffect(() => {
|
|
86
|
-
pushModal(modalView)
|
|
87
|
-
const backListenerKey = addBackListener(() => {
|
|
88
|
-
props.onRequestClose()
|
|
89
|
-
return true
|
|
90
|
-
})
|
|
91
|
-
return () => {
|
|
92
|
-
removeBackListener(backListenerKey)
|
|
93
|
-
popModal()
|
|
94
|
-
}
|
|
95
|
-
}, [])
|
|
75
|
+
modalContent =
|
|
76
|
+
(
|
|
77
|
+
<View
|
|
78
|
+
style={modalStyle}
|
|
79
|
+
navigationBarTranslucent
|
|
80
|
+
statusBarTranslucent
|
|
81
|
+
transparent={props.transparent}
|
|
82
|
+
>
|
|
83
|
+
<SnowFillView
|
|
84
|
+
scroll={props.scroll}
|
|
85
|
+
style={style}>
|
|
86
|
+
{props.render()}
|
|
87
|
+
</SnowFillView>
|
|
88
|
+
</View>
|
|
89
|
+
)
|
|
96
90
|
}
|
|
97
|
-
return
|
|
91
|
+
return modalContent
|
|
98
92
|
}
|
|
99
93
|
|
|
100
94
|
SnowModalW.isSnowFocusWired = true
|
|
@@ -4,6 +4,7 @@ import { useStyleContext } from '../../context/snow-style-context'
|
|
|
4
4
|
import { useFocusContext } from '../../context/snow-focus-context'
|
|
5
5
|
import { useLayerContext } from '../../context/snow-layer-context'
|
|
6
6
|
import SnowText from '../snow-text'
|
|
7
|
+
import SnowFillView from '../snow-fill-view'
|
|
7
8
|
|
|
8
9
|
const SnowOverlayW = (props) => {
|
|
9
10
|
const { SnowStyle } = useStyleContext(props)
|
|
@@ -14,9 +15,9 @@ const SnowOverlayW = (props) => {
|
|
|
14
15
|
pushFocusLayer,
|
|
15
16
|
popFocusLayer,
|
|
16
17
|
focusedLayer,
|
|
17
|
-
addFocusMap
|
|
18
|
+
addFocusMap,
|
|
19
|
+
readFocusProps
|
|
18
20
|
} = useFocusContext()
|
|
19
|
-
const { pushOverlay, popOverlay } = useLayerContext(props)
|
|
20
21
|
|
|
21
22
|
if (!props.focusLayer) {
|
|
22
23
|
return <SnowText>SnowOverlay requires a focusLayer prop</SnowText>
|
|
@@ -51,9 +52,6 @@ const SnowOverlayW = (props) => {
|
|
|
51
52
|
isReady
|
|
52
53
|
]);
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
55
|
let style = [SnowStyle.component.overlay.touchable]
|
|
58
56
|
if (props.transparent) {
|
|
59
57
|
style.push(SnowStyle.component.overlay.transparent)
|
|
@@ -62,26 +60,18 @@ const SnowOverlayW = (props) => {
|
|
|
62
60
|
style.push(SnowStyle.component.overlay.black)
|
|
63
61
|
}
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
return (
|
|
66
64
|
<TouchableOpacity
|
|
67
65
|
ref={elementRef}
|
|
68
66
|
{...tvRemoteProps}
|
|
67
|
+
{...readFocusProps(props)}
|
|
69
68
|
style={style}
|
|
70
69
|
activeOpacity={1} // Without this, the overlay applies a white filter to anything underneath
|
|
71
70
|
onPress={focusPress(elementRef, props.focusKey)}
|
|
72
|
-
onLongPress={focusLongPress(elementRef, props.focusKey)}
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
onLongPress={focusLongPress(elementRef, props.focusKey)}>
|
|
72
|
+
<SnowFillView></SnowFillView>
|
|
73
|
+
</TouchableOpacity>
|
|
75
74
|
)
|
|
76
|
-
|
|
77
|
-
React.useEffect(() => {
|
|
78
|
-
pushOverlay(overlayView)
|
|
79
|
-
return () => {
|
|
80
|
-
popOverlay()
|
|
81
|
-
}
|
|
82
|
-
}, [])
|
|
83
|
-
|
|
84
|
-
return null
|
|
85
75
|
}
|
|
86
76
|
|
|
87
77
|
SnowOverlayW.isSnowFocusWired = true
|
|
@@ -13,96 +13,51 @@ export function useLayerContext() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function LayerContextProvider(props) {
|
|
16
|
-
const [
|
|
17
|
-
const [
|
|
18
|
-
const modalRef = React.useRef(null)
|
|
19
|
-
const overlayRef = React.useRef(null)
|
|
16
|
+
const [modalPayload, setModalPayload] = React.useState(null)
|
|
17
|
+
const [overlayPayload, setOverlayPayload] = React.useState(null)
|
|
20
18
|
|
|
21
19
|
const DEBUG = props.DEBUG_LAYERS
|
|
22
20
|
|
|
23
|
-
const
|
|
24
|
-
setOverlays((prev) => {
|
|
25
|
-
if (DEBUG) {
|
|
26
|
-
prettyLog({ context: 'layer', action: 'pushOverlay', prev, overlay })
|
|
27
|
-
}
|
|
28
|
-
overlayRef.current = overlay
|
|
29
|
-
return [...prev, overlay]
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const popOverlay = () => {
|
|
34
|
-
setOverlays((prev) => {
|
|
35
|
-
let result = [...prev]
|
|
36
|
-
if (result.length) {
|
|
37
|
-
result.pop()
|
|
38
|
-
overlayRef.current = result?.at(-1)
|
|
39
|
-
} else {
|
|
40
|
-
overlayRef.current = null
|
|
41
|
-
}
|
|
42
|
-
if (DEBUG) {
|
|
43
|
-
prettyLog({ context: 'layer', action: 'popOverlay', prev, result })
|
|
44
|
-
}
|
|
45
|
-
return result
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let currentOverlay = null
|
|
50
|
-
if (overlays.length) {
|
|
51
|
-
currentOverlay = modals.at(-1)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const clearOverlays = () => {
|
|
21
|
+
const enableOverlay = (payload) => {
|
|
55
22
|
if (DEBUG) {
|
|
56
|
-
prettyLog({ context: 'layer', action: '
|
|
23
|
+
prettyLog({ context: 'layer', action: 'enableOverlay', overlayPayload, payload })
|
|
57
24
|
}
|
|
58
|
-
|
|
25
|
+
setOverlayPayload(payload)
|
|
59
26
|
}
|
|
60
27
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
modalRef.current = modal
|
|
67
|
-
return [...prev, modal]
|
|
68
|
-
})
|
|
28
|
+
const disableOverlay = () => {
|
|
29
|
+
if (DEBUG) {
|
|
30
|
+
prettyLog({ context: 'layer', action: 'disableOverlay', overlayPayload })
|
|
31
|
+
}
|
|
32
|
+
setOverlayPayload(null)
|
|
69
33
|
}
|
|
70
34
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
modalRef.current = result?.at(-1)
|
|
77
|
-
} else {
|
|
78
|
-
modalRef.current = null
|
|
79
|
-
}
|
|
80
|
-
if (DEBUG) {
|
|
81
|
-
prettyLog({ context: 'layer', action: 'popModal', prev, result })
|
|
82
|
-
}
|
|
83
|
-
return result
|
|
84
|
-
})
|
|
35
|
+
const showModal = (payload) => {
|
|
36
|
+
if (DEBUG) {
|
|
37
|
+
prettyLog({ context: 'layer', action: 'showModal', modalPayload, payload })
|
|
38
|
+
}
|
|
39
|
+
setModalPayload(payload)
|
|
85
40
|
}
|
|
86
41
|
|
|
87
|
-
const
|
|
88
|
-
|
|
42
|
+
const hideModal = () => {
|
|
43
|
+
if (DEBUG) {
|
|
44
|
+
prettyLog({ context: 'layer', action: 'hideModal', modalPayload })
|
|
45
|
+
}
|
|
46
|
+
setModalPayload(null)
|
|
89
47
|
}
|
|
90
48
|
|
|
91
49
|
if (DEBUG === 'verbose') {
|
|
92
|
-
prettyLog({ context: 'layer', action: 'render',
|
|
50
|
+
prettyLog({ context: 'layer', action: 'render', modalPayload, overlayPayload })
|
|
93
51
|
}
|
|
94
52
|
|
|
95
|
-
|
|
96
53
|
const context = {
|
|
97
54
|
DEBUG_LAYERS: DEBUG,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
currentModal: modalRef?.current,
|
|
105
|
-
currentOverlay: overlayRef?.current
|
|
55
|
+
enableOverlay,
|
|
56
|
+
disableOverlay,
|
|
57
|
+
overlayPayload,
|
|
58
|
+
showModal,
|
|
59
|
+
hideModal,
|
|
60
|
+
modalPayload,
|
|
106
61
|
}
|
|
107
62
|
return (
|
|
108
63
|
<LayerContext.Provider style={{ flex: 1 }} value={context}>
|
|
@@ -45,9 +45,9 @@ export function NavigationContextProvider(props) {
|
|
|
45
45
|
|
|
46
46
|
const { addBackListener, removeBackListener } = useInputContext()
|
|
47
47
|
const { pushFocusLayer, popFocusLayer, focusedLayer, isFocusedLayer } = useFocusContext()
|
|
48
|
-
const {
|
|
48
|
+
const { modalRender } = useLayerContext()
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const modalRenderRef = React.useRef()
|
|
51
51
|
|
|
52
52
|
const [isReady, setIsReady] = React.useState(false)
|
|
53
53
|
|
|
@@ -71,8 +71,8 @@ export function NavigationContextProvider(props) {
|
|
|
71
71
|
}, [navigationHistory])
|
|
72
72
|
|
|
73
73
|
React.useEffect(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
74
|
+
modalRenderRef.current = modalRender
|
|
75
|
+
}, [modalRender])
|
|
76
76
|
|
|
77
77
|
React.useEffect(() => {
|
|
78
78
|
let lookup = {}
|
|
@@ -202,9 +202,9 @@ export function NavigationContextProvider(props) {
|
|
|
202
202
|
React.useEffect(() => {
|
|
203
203
|
addBackListener('navigation-context', () => {
|
|
204
204
|
if (DEBUG) {
|
|
205
|
-
prettyLog({ context: 'navigation', action: 'backListener', modal:
|
|
205
|
+
prettyLog({ context: 'navigation', action: 'backListener', modal: modalRenderRef.current })
|
|
206
206
|
}
|
|
207
|
-
if (
|
|
207
|
+
if (modalRenderRef.current) {
|
|
208
208
|
// When a modal is shown, prevent default event handlers from exiting the app/page
|
|
209
209
|
return true
|
|
210
210
|
}
|
package/src/index.tsx
CHANGED
|
@@ -4,6 +4,10 @@ import { SnowApp } from './snow-app'
|
|
|
4
4
|
|
|
5
5
|
export { useFocusContext } from './context/snow-focus-context'
|
|
6
6
|
import { useFocusContext } from './context/snow-focus-context'
|
|
7
|
+
export { useInputContext } from './context/snow-input-context'
|
|
8
|
+
import { useInputContext } from './context/snow-input-context'
|
|
9
|
+
export { useLayerContext } from './context/snow-layer-context'
|
|
10
|
+
import { useLayerContext } from './context/snow-layer-context'
|
|
7
11
|
export { useNavigationContext } from './context/snow-navigation-context'
|
|
8
12
|
import { useNavigationContext } from './context/snow-navigation-context'
|
|
9
13
|
export { useSnowContext } from './context/snow-context'
|
|
@@ -62,6 +66,8 @@ export * as util from './util'
|
|
|
62
66
|
export default {
|
|
63
67
|
useFocusLayer,
|
|
64
68
|
useFocusContext,
|
|
69
|
+
useInputContext,
|
|
70
|
+
useLayerContext,
|
|
65
71
|
useNavigationContext,
|
|
66
72
|
useSnowContext,
|
|
67
73
|
useStyleContext,
|