@teamturing/react-native-kit 1.6.5 → 1.6.6
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/commonjs/component/Layout/Layout/LayoutProvider.js +5 -30
- package/lib/commonjs/component/Layout/Layout/LayoutProvider.js.map +1 -1
- package/lib/module/component/Layout/Layout/LayoutProvider.js +7 -32
- package/lib/module/component/Layout/Layout/LayoutProvider.js.map +1 -1
- package/lib/typescript/commonjs/src/component/Layout/Layout/LayoutProvider.d.ts +0 -1
- package/lib/typescript/commonjs/src/component/Layout/Layout/LayoutProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/component/TextField/BaseTextField.d.ts +2 -2
- package/lib/typescript/module/src/component/Layout/Layout/LayoutProvider.d.ts +0 -1
- package/lib/typescript/module/src/component/Layout/Layout/LayoutProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/component/TextField/BaseTextField.d.ts +2 -2
- package/package.json +2 -2
- package/src/component/Layout/Layout/LayoutProvider.tsx +5 -39
|
@@ -11,12 +11,13 @@ var _index = require("../../../hook/index.js");
|
|
|
11
11
|
var _index2 = require("../../../util/index.js");
|
|
12
12
|
var _WindowSizeClass = require("./WindowSizeClass.js");
|
|
13
13
|
var _useDynamicDimensions = require("./useDynamicDimensions.js");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
const [useDynamicLayout, LayoutProvider] = (0, _index2.createCtx)(({
|
|
16
15
|
useSafeAreaInsetsHook = _reactNativeSafeAreaContext.useSafeAreaInsets
|
|
17
|
-
}
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
width: windowWidth,
|
|
19
|
+
height: windowHeight
|
|
20
|
+
} = (0, _reactNative.useWindowDimensions)();
|
|
20
21
|
const windowShortLen = Math.min(windowWidth, windowHeight);
|
|
21
22
|
const windowLongLen = Math.max(windowWidth, windowHeight);
|
|
22
23
|
const _insets = useSafeAreaInsetsHook();
|
|
@@ -41,15 +42,6 @@ const [useDynamicLayout, LayoutProvider] = (0, _index2.createCtx)(({
|
|
|
41
42
|
windowWidthSizeClass,
|
|
42
43
|
windowHeightSizeClass
|
|
43
44
|
});
|
|
44
|
-
const updateScreenSizesBeforeRotation = (0, _react.useCallback)(orientation => {
|
|
45
|
-
if (orientation === 'portrait') {
|
|
46
|
-
setWindowWidth(windowShortLen);
|
|
47
|
-
setWindowHeight(windowLongLen);
|
|
48
|
-
} else if (orientation === 'landscape') {
|
|
49
|
-
setWindowWidth(windowLongLen);
|
|
50
|
-
setWindowHeight(windowShortLen);
|
|
51
|
-
}
|
|
52
|
-
}, [windowLongLen, windowShortLen]);
|
|
53
45
|
const localImageDimensionProps = (0, _index.useStableCallback)((imageWidth, imageHeight, {
|
|
54
46
|
containerWidth
|
|
55
47
|
} = {
|
|
@@ -75,22 +67,6 @@ const [useDynamicLayout, LayoutProvider] = (0, _index2.createCtx)(({
|
|
|
75
67
|
};
|
|
76
68
|
}
|
|
77
69
|
});
|
|
78
|
-
transformChildren(children => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
79
|
-
testID: 'LayoutProvider',
|
|
80
|
-
style: _reactNative.StyleSheet.absoluteFill,
|
|
81
|
-
onLayout: ({
|
|
82
|
-
nativeEvent: {
|
|
83
|
-
layout: {
|
|
84
|
-
width,
|
|
85
|
-
height
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}) => {
|
|
89
|
-
setWindowWidth(Math.ceil(width));
|
|
90
|
-
setWindowHeight(Math.ceil(height));
|
|
91
|
-
},
|
|
92
|
-
children: children
|
|
93
|
-
}));
|
|
94
70
|
return {
|
|
95
71
|
...dimensions,
|
|
96
72
|
screenHeight: windowHeight,
|
|
@@ -98,7 +74,6 @@ const [useDynamicLayout, LayoutProvider] = (0, _index2.createCtx)(({
|
|
|
98
74
|
screenWidthWithPadding: windowWidth - 2 * dimensions.sidePadding,
|
|
99
75
|
screenShortLen: windowShortLen,
|
|
100
76
|
screenLongLen: windowLongLen,
|
|
101
|
-
updateScreenSizesBeforeRotation,
|
|
102
77
|
safeAreaInsets: insets,
|
|
103
78
|
sfTop: insets.top,
|
|
104
79
|
sfLeft: insets.left,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeSafeAreaContext","_index","_index2","_WindowSizeClass","_useDynamicDimensions","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeSafeAreaContext","_index","_index2","_WindowSizeClass","_useDynamicDimensions","useDynamicLayout","LayoutProvider","createCtx","useSafeAreaInsetsHook","useSafeAreaInsets","width","windowWidth","height","windowHeight","useWindowDimensions","windowShortLen","Math","min","windowLongLen","max","_insets","insets","top","ceil","bottom","left","right","windowWidthSizeClass","useMemo","decideWindowWidthSizeClass","windowHeightSizeClass","decideWindowHeightSizeClass","isWindowWidthSizeClassAtLeast","useCallback","sizeClass","isWindowHeightSizeClassAtLeast","isWidthAtLeastMedium","WindowSizeClass","MEDIUM","isWidthAtLeastExpanded","EXPANDED","isHeightAtLeastMedium","isHeightAtLeastExpanded","dimensions","useDynamicDimensions","screenShortLen","safeAreaBottom","screenWidth","localImageDimensionProps","useStableCallback","imageWidth","imageHeight","containerWidth","w","sidePadding","screenHeight","screenWidthWithPadding","screenLongLen","safeAreaInsets","sfTop","sfLeft","sfRight","sfBottom","exports"],"sourceRoot":"../../../../../src","sources":["component/Layout/Layout/LayoutProvider.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AAEO,MAAM,CAACO,gBAAgB,EAAEC,cAAc,CAAC,GAAG,IAAAC,i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AAO;IACL,GAAGP,UAAU;IACbY,YAAY,EAAE1C,YAAY;IAC1BkC,WAAW,EAAEpC,WAAW;IACxB6C,sBAAsB,EAAE7C,WAAW,GAAG,CAAC,GAAGgC,UAAU,CAACW,WAAW;IAChET,cAAc,EAAE9B,cAAc;IAC9B0C,aAAa,EAAEvC,aAAa;IAC5BwC,cAAc,EAAErC,MAAM;IACtBsC,KAAK,EAAEtC,MAAM,CAACC,GAAG;IACjBsC,MAAM,EAAEvC,MAAM,CAACI,IAAI;IACnBoC,OAAO,EAAExC,MAAM,CAACK,KAAK;IACrBoC,QAAQ,EAAEzC,MAAM,CAACG,MAAM;IACvBG,oBAAoB;IACpBG,qBAAqB;IACrBK,8BAA8B;IAC9BC,oBAAoB;IACpBG,sBAAsB;IACtBE,qBAAqB;IACrBC,uBAAuB;IACvBV,6BAA6B;IAC7BgB;EACF,CAAC;AACH,CAAC,EACD,QACF,CAAC;AAACe,OAAA,CAAAzD,cAAA,GAAAA,cAAA;AAAAyD,OAAA,CAAA1D,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useCallback, useMemo
|
|
4
|
-
import {
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import { useWindowDimensions } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { useStableCallback } from "../../../hook/index.js";
|
|
7
7
|
import { createCtx } from "../../../util/index.js";
|
|
8
8
|
import { WindowSizeClass, decideWindowWidthSizeClass, decideWindowHeightSizeClass } from "./WindowSizeClass.js";
|
|
9
9
|
import { useDynamicDimensions } from "./useDynamicDimensions.js";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
export const [useDynamicLayout, LayoutProvider] = createCtx(({
|
|
12
11
|
useSafeAreaInsetsHook = useSafeAreaInsets
|
|
13
|
-
}
|
|
14
|
-
const
|
|
15
|
-
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
width: windowWidth,
|
|
15
|
+
height: windowHeight
|
|
16
|
+
} = useWindowDimensions();
|
|
16
17
|
const windowShortLen = Math.min(windowWidth, windowHeight);
|
|
17
18
|
const windowLongLen = Math.max(windowWidth, windowHeight);
|
|
18
19
|
const _insets = useSafeAreaInsetsHook();
|
|
@@ -37,15 +38,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(({
|
|
|
37
38
|
windowWidthSizeClass,
|
|
38
39
|
windowHeightSizeClass
|
|
39
40
|
});
|
|
40
|
-
const updateScreenSizesBeforeRotation = useCallback(orientation => {
|
|
41
|
-
if (orientation === 'portrait') {
|
|
42
|
-
setWindowWidth(windowShortLen);
|
|
43
|
-
setWindowHeight(windowLongLen);
|
|
44
|
-
} else if (orientation === 'landscape') {
|
|
45
|
-
setWindowWidth(windowLongLen);
|
|
46
|
-
setWindowHeight(windowShortLen);
|
|
47
|
-
}
|
|
48
|
-
}, [windowLongLen, windowShortLen]);
|
|
49
41
|
const localImageDimensionProps = useStableCallback((imageWidth, imageHeight, {
|
|
50
42
|
containerWidth
|
|
51
43
|
} = {
|
|
@@ -71,22 +63,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(({
|
|
|
71
63
|
};
|
|
72
64
|
}
|
|
73
65
|
});
|
|
74
|
-
transformChildren(children => /*#__PURE__*/_jsx(View, {
|
|
75
|
-
testID: 'LayoutProvider',
|
|
76
|
-
style: StyleSheet.absoluteFill,
|
|
77
|
-
onLayout: ({
|
|
78
|
-
nativeEvent: {
|
|
79
|
-
layout: {
|
|
80
|
-
width,
|
|
81
|
-
height
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}) => {
|
|
85
|
-
setWindowWidth(Math.ceil(width));
|
|
86
|
-
setWindowHeight(Math.ceil(height));
|
|
87
|
-
},
|
|
88
|
-
children: children
|
|
89
|
-
}));
|
|
90
66
|
return {
|
|
91
67
|
...dimensions,
|
|
92
68
|
screenHeight: windowHeight,
|
|
@@ -94,7 +70,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(({
|
|
|
94
70
|
screenWidthWithPadding: windowWidth - 2 * dimensions.sidePadding,
|
|
95
71
|
screenShortLen: windowShortLen,
|
|
96
72
|
screenLongLen: windowLongLen,
|
|
97
|
-
updateScreenSizesBeforeRotation,
|
|
98
73
|
safeAreaInsets: insets,
|
|
99
74
|
sfTop: insets.top,
|
|
100
75
|
sfLeft: insets.left,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useWindowDimensions","useSafeAreaInsets","useStableCallback","createCtx","WindowSizeClass","decideWindowWidthSizeClass","decideWindowHeightSizeClass","useDynamicDimensions","useDynamicLayout","LayoutProvider","useSafeAreaInsetsHook","width","windowWidth","height","windowHeight","windowShortLen","Math","min","windowLongLen","max","_insets","insets","top","ceil","bottom","left","right","windowWidthSizeClass","windowHeightSizeClass","isWindowWidthSizeClassAtLeast","sizeClass","isWindowHeightSizeClassAtLeast","isWidthAtLeastMedium","MEDIUM","isWidthAtLeastExpanded","EXPANDED","isHeightAtLeastMedium","isHeightAtLeastExpanded","dimensions","screenShortLen","safeAreaBottom","screenWidth","localImageDimensionProps","imageWidth","imageHeight","containerWidth","w","sidePadding","screenHeight","screenWidthWithPadding","screenLongLen","safeAreaInsets","sfTop","sfLeft","sfRight","sfBottom"],"sourceRoot":"../../../../../src","sources":["component/Layout/Layout/LayoutProvider.tsx"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,iBAAiB,QAAQ,wBAAe;AACjD,SAASC,SAAS,QAAQ,wBAAe;AAEzC,SAASC,eAAe,EAAEC,0BAA0B,EAAEC,2BAA2B,QAAQ,sBAAmB;AAC5G,S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,GAAID;MAC9B,CAAC;IACH;EACF,CACF,CAAC;EAED,OAAO;IACL,GAAGL,UAAU;IACbU,YAAY,EAAElC,YAAY;IAC1B2B,WAAW,EAAE7B,WAAW;IACxBqC,sBAAsB,EAAErC,WAAW,GAAG,CAAC,GAAG0B,UAAU,CAACS,WAAW;IAChER,cAAc,EAAExB,cAAc;IAC9BmC,aAAa,EAAEhC,aAAa;IAC5BiC,cAAc,EAAE9B,MAAM;IACtB+B,KAAK,EAAE/B,MAAM,CAACC,GAAG;IACjB+B,MAAM,EAAEhC,MAAM,CAACI,IAAI;IACnB6B,OAAO,EAAEjC,MAAM,CAACK,KAAK;IACrB6B,QAAQ,EAAElC,MAAM,CAACG,MAAM;IACvBG,oBAAoB;IACpBC,qBAAqB;IACrBG,8BAA8B;IAC9BC,oBAAoB;IACpBE,sBAAsB;IACtBE,qBAAqB;IACrBC,uBAAuB;IACvBR,6BAA6B;IAC7Ba;EACF,CAAC;AACH,CAAC,EACD,QACF,CAAC","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ export declare const useDynamicLayout: () => {
|
|
|
7
7
|
screenWidthWithPadding: number;
|
|
8
8
|
screenShortLen: number;
|
|
9
9
|
screenLongLen: number;
|
|
10
|
-
updateScreenSizesBeforeRotation: (orientation: 'portrait' | 'landscape') => void;
|
|
11
10
|
safeAreaInsets: {
|
|
12
11
|
readonly top: number;
|
|
13
12
|
readonly bottom: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/component/Layout/Layout/LayoutProvider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE,OAAO,EAAE,eAAe,EAA2D,MAAM,mBAAmB,CAAC;AAG7G,eAAO,MAAO,gBAAgB
|
|
1
|
+
{"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/component/Layout/Layout/LayoutProvider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE,OAAO,EAAE,eAAe,EAA2D,MAAM,mBAAmB,CAAC;AAG7G,eAAO,MAAO,gBAAgB;;;;;;;;;;;;;;;;;;gDAwBZ,eAAe;;;;;+CAJf,eAAe;2CAwBb,MAAM,eACL,MAAM;wBACmB,YAAY,GAAG,eAAe,GAAG,MAAM;;;;;;;GA9CrD,cAAc;;;;4FAgG7C,CAAC"}
|
|
@@ -19,8 +19,8 @@ type Props = {
|
|
|
19
19
|
} & Omit<CoreTextFieldProps, 'style'>;
|
|
20
20
|
export declare const BaseTextField: React.ForwardRefExoticComponent<{
|
|
21
21
|
label?: string | undefined;
|
|
22
|
-
leadingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "
|
|
23
|
-
trailingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "
|
|
22
|
+
leadingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "repeat" | "new" | "ai" | "ai_color" | "ai_sad" | "alarm" | "apple_color" | "arrow_down" | "arrow_left" | "arrow_left_circle" | "arrow_left_limit" | "arrow_left_right" | "arrow_right" | "arrow_right_circle" | "arrow_right_limit" | "arrow_up" | "arrow_up_down" | "arrow_up_limit" | "barchart" | "book" | "bookmark" | "bookmark_animation" | "box" | "bus_color" | "calendar_check" | "calendar_check_color" | "calendar_color" | "camera" | "card" | "cards_percent" | "cards_percent_color" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "cart" | "chat_bubble" | "chat_bubble_badge_color" | "chat_bubble_correct" | "chat_bubble_correct_color" | "chat_bubble_dots" | "chat_bubble_question" | "chat_bubble_question_animation" | "chat_bubble_question_color" | "check" | "check_in_circle" | "check_in_circle_color" | "check_in_circle_line" | "chevron_down" | "chevron_down_two" | "chevron_left" | "chevron_right" | "chevron_right_two" | "chevron_up" | "chevron_up_two" | "circles" | "clip" | "close" | "close_in_circle" | "coin" | "contact" | "copy" | "correct" | "coupon" | "crown" | "curriculum" | "curriculum_color" | "delete" | "dots" | "download" | "emoji" | "emoji_plus" | "emoji_plus_dash" | "eng" | "enter" | "equal" | "eraser" | "exclamation_point_in_circle" | "eye_off" | "eye_on" | "face_happy" | "face_sad" | "facebook" | "facebook_color" | "fire" | "fire_color" | "folder" | "frame" | "glasses" | "google_color" | "graph" | "hair" | "headphone" | "heart" | "home" | "infinite" | "info_in_circle" | "instagram" | "kakao_color" | "kor" | "league" | "letter" | "letter_crown_color" | "letter_crown_open_color" | "letter_heart_color" | "letter_heart_open_color" | "line_three" | "lock" | "logo_apple" | "logo_color" | "logo_facebook" | "logo_kakao" | "logo_naver" | "maxsize" | "minsize" | "minus" | "minus_in_circle" | "moneybag" | "moneybag_color" | "more" | "my_bubble" | "naver_color" | "note_color" | "note_pen_color" | "number_five_filled" | "number_five_outlined" | "number_four_filled" | "number_four_outlined" | "number_one_filled" | "number_one_outlined" | "number_three_filled" | "number_three_outlined" | "number_two_filled" | "number_two_outlined" | "out" | "palm_tree_color" | "paper_check" | "paper_pen" | "paper_pen_color" | "paper_two" | "pause" | "pen" | "percent_in_circle" | "pill" | "pill_color" | "pin" | "pin_color_red" | "play" | "plus" | "plus_in_circle" | "point_in_circle" | "point_in_circle_color" | "present" | "present_color" | "problem" | "profile" | "progress_gradient" | "question_mark_in_circle" | "question_mark_in_circle_outlined" | "raffle_color" | "receipt" | "refresh" | "school" | "school_color" | "setting" | "share" | "shield_check" | "siren" | "skipback" | "skipforward" | "sound_off" | "sound_on" | "speaker" | "stackup" | "star" | "star_color" | "store" | "sync" | "test_upload_color" | "thumbdown" | "thumbup" | "thunder" | "ticket" | "ticket_color" | "touch" | "trash" | "treasurebox" | "trophy" | "twinkle" | "undo" | "university" | "user_blocked" | "user_check" | "user_plus" | "user_two" | "video_color" | "vote_color" | "warning" | "wifi" | "workbook" | "workbook_color" | "wrong" | "youtube" | undefined;
|
|
23
|
+
trailingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "repeat" | "new" | "ai" | "ai_color" | "ai_sad" | "alarm" | "apple_color" | "arrow_down" | "arrow_left" | "arrow_left_circle" | "arrow_left_limit" | "arrow_left_right" | "arrow_right" | "arrow_right_circle" | "arrow_right_limit" | "arrow_up" | "arrow_up_down" | "arrow_up_limit" | "barchart" | "book" | "bookmark" | "bookmark_animation" | "box" | "bus_color" | "calendar_check" | "calendar_check_color" | "calendar_color" | "camera" | "card" | "cards_percent" | "cards_percent_color" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "cart" | "chat_bubble" | "chat_bubble_badge_color" | "chat_bubble_correct" | "chat_bubble_correct_color" | "chat_bubble_dots" | "chat_bubble_question" | "chat_bubble_question_animation" | "chat_bubble_question_color" | "check" | "check_in_circle" | "check_in_circle_color" | "check_in_circle_line" | "chevron_down" | "chevron_down_two" | "chevron_left" | "chevron_right" | "chevron_right_two" | "chevron_up" | "chevron_up_two" | "circles" | "clip" | "close" | "close_in_circle" | "coin" | "contact" | "copy" | "correct" | "coupon" | "crown" | "curriculum" | "curriculum_color" | "delete" | "dots" | "download" | "emoji" | "emoji_plus" | "emoji_plus_dash" | "eng" | "enter" | "equal" | "eraser" | "exclamation_point_in_circle" | "eye_off" | "eye_on" | "face_happy" | "face_sad" | "facebook" | "facebook_color" | "fire" | "fire_color" | "folder" | "frame" | "glasses" | "google_color" | "graph" | "hair" | "headphone" | "heart" | "home" | "infinite" | "info_in_circle" | "instagram" | "kakao_color" | "kor" | "league" | "letter" | "letter_crown_color" | "letter_crown_open_color" | "letter_heart_color" | "letter_heart_open_color" | "line_three" | "lock" | "logo_apple" | "logo_color" | "logo_facebook" | "logo_kakao" | "logo_naver" | "maxsize" | "minsize" | "minus" | "minus_in_circle" | "moneybag" | "moneybag_color" | "more" | "my_bubble" | "naver_color" | "note_color" | "note_pen_color" | "number_five_filled" | "number_five_outlined" | "number_four_filled" | "number_four_outlined" | "number_one_filled" | "number_one_outlined" | "number_three_filled" | "number_three_outlined" | "number_two_filled" | "number_two_outlined" | "out" | "palm_tree_color" | "paper_check" | "paper_pen" | "paper_pen_color" | "paper_two" | "pause" | "pen" | "percent_in_circle" | "pill" | "pill_color" | "pin" | "pin_color_red" | "play" | "plus" | "plus_in_circle" | "point_in_circle" | "point_in_circle_color" | "present" | "present_color" | "problem" | "profile" | "progress_gradient" | "question_mark_in_circle" | "question_mark_in_circle_outlined" | "raffle_color" | "receipt" | "refresh" | "school" | "school_color" | "setting" | "share" | "shield_check" | "siren" | "skipback" | "skipforward" | "sound_off" | "sound_on" | "speaker" | "stackup" | "star" | "star_color" | "store" | "sync" | "test_upload_color" | "thumbdown" | "thumbup" | "thunder" | "ticket" | "ticket_color" | "touch" | "trash" | "treasurebox" | "trophy" | "twinkle" | "undo" | "university" | "user_blocked" | "user_check" | "user_plus" | "user_two" | "video_color" | "vote_color" | "warning" | "wifi" | "workbook" | "workbook_color" | "wrong" | "youtube" | undefined;
|
|
24
24
|
trailingIconFill?: ColorValue | undefined;
|
|
25
25
|
trailingElements?: React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
26
26
|
disabled?: boolean | undefined;
|
|
@@ -7,7 +7,6 @@ export declare const useDynamicLayout: () => {
|
|
|
7
7
|
screenWidthWithPadding: number;
|
|
8
8
|
screenShortLen: number;
|
|
9
9
|
screenLongLen: number;
|
|
10
|
-
updateScreenSizesBeforeRotation: (orientation: 'portrait' | 'landscape') => void;
|
|
11
10
|
safeAreaInsets: {
|
|
12
11
|
readonly top: number;
|
|
13
12
|
readonly bottom: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/component/Layout/Layout/LayoutProvider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE,OAAO,EAAE,eAAe,EAA2D,MAAM,mBAAmB,CAAC;AAG7G,eAAO,MAAO,gBAAgB
|
|
1
|
+
{"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/component/Layout/Layout/LayoutProvider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE,OAAO,EAAE,eAAe,EAA2D,MAAM,mBAAmB,CAAC;AAG7G,eAAO,MAAO,gBAAgB;;;;;;;;;;;;;;;;;;gDAwBZ,eAAe;;;;;+CAJf,eAAe;2CAwBb,MAAM,eACL,MAAM;wBACmB,YAAY,GAAG,eAAe,GAAG,MAAM;;;;;;;GA9CrD,cAAc;;;;4FAgG7C,CAAC"}
|
|
@@ -19,8 +19,8 @@ type Props = {
|
|
|
19
19
|
} & Omit<CoreTextFieldProps, 'style'>;
|
|
20
20
|
export declare const BaseTextField: React.ForwardRefExoticComponent<{
|
|
21
21
|
label?: string | undefined;
|
|
22
|
-
leadingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "
|
|
23
|
-
trailingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "
|
|
22
|
+
leadingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "repeat" | "new" | "ai" | "ai_color" | "ai_sad" | "alarm" | "apple_color" | "arrow_down" | "arrow_left" | "arrow_left_circle" | "arrow_left_limit" | "arrow_left_right" | "arrow_right" | "arrow_right_circle" | "arrow_right_limit" | "arrow_up" | "arrow_up_down" | "arrow_up_limit" | "barchart" | "book" | "bookmark" | "bookmark_animation" | "box" | "bus_color" | "calendar_check" | "calendar_check_color" | "calendar_color" | "camera" | "card" | "cards_percent" | "cards_percent_color" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "cart" | "chat_bubble" | "chat_bubble_badge_color" | "chat_bubble_correct" | "chat_bubble_correct_color" | "chat_bubble_dots" | "chat_bubble_question" | "chat_bubble_question_animation" | "chat_bubble_question_color" | "check" | "check_in_circle" | "check_in_circle_color" | "check_in_circle_line" | "chevron_down" | "chevron_down_two" | "chevron_left" | "chevron_right" | "chevron_right_two" | "chevron_up" | "chevron_up_two" | "circles" | "clip" | "close" | "close_in_circle" | "coin" | "contact" | "copy" | "correct" | "coupon" | "crown" | "curriculum" | "curriculum_color" | "delete" | "dots" | "download" | "emoji" | "emoji_plus" | "emoji_plus_dash" | "eng" | "enter" | "equal" | "eraser" | "exclamation_point_in_circle" | "eye_off" | "eye_on" | "face_happy" | "face_sad" | "facebook" | "facebook_color" | "fire" | "fire_color" | "folder" | "frame" | "glasses" | "google_color" | "graph" | "hair" | "headphone" | "heart" | "home" | "infinite" | "info_in_circle" | "instagram" | "kakao_color" | "kor" | "league" | "letter" | "letter_crown_color" | "letter_crown_open_color" | "letter_heart_color" | "letter_heart_open_color" | "line_three" | "lock" | "logo_apple" | "logo_color" | "logo_facebook" | "logo_kakao" | "logo_naver" | "maxsize" | "minsize" | "minus" | "minus_in_circle" | "moneybag" | "moneybag_color" | "more" | "my_bubble" | "naver_color" | "note_color" | "note_pen_color" | "number_five_filled" | "number_five_outlined" | "number_four_filled" | "number_four_outlined" | "number_one_filled" | "number_one_outlined" | "number_three_filled" | "number_three_outlined" | "number_two_filled" | "number_two_outlined" | "out" | "palm_tree_color" | "paper_check" | "paper_pen" | "paper_pen_color" | "paper_two" | "pause" | "pen" | "percent_in_circle" | "pill" | "pill_color" | "pin" | "pin_color_red" | "play" | "plus" | "plus_in_circle" | "point_in_circle" | "point_in_circle_color" | "present" | "present_color" | "problem" | "profile" | "progress_gradient" | "question_mark_in_circle" | "question_mark_in_circle_outlined" | "raffle_color" | "receipt" | "refresh" | "school" | "school_color" | "setting" | "share" | "shield_check" | "siren" | "skipback" | "skipforward" | "sound_off" | "sound_on" | "speaker" | "stackup" | "star" | "star_color" | "store" | "sync" | "test_upload_color" | "thumbdown" | "thumbup" | "thunder" | "ticket" | "ticket_color" | "touch" | "trash" | "treasurebox" | "trophy" | "twinkle" | "undo" | "university" | "user_blocked" | "user_check" | "user_plus" | "user_two" | "video_color" | "vote_color" | "warning" | "wifi" | "workbook" | "workbook_color" | "wrong" | "youtube" | undefined;
|
|
23
|
+
trailingIcon?: "filter" | "scroll" | "link" | "picture" | "search" | "time" | "video" | "top" | "timer" | "document" | "note" | "set" | "repeat" | "new" | "ai" | "ai_color" | "ai_sad" | "alarm" | "apple_color" | "arrow_down" | "arrow_left" | "arrow_left_circle" | "arrow_left_limit" | "arrow_left_right" | "arrow_right" | "arrow_right_circle" | "arrow_right_limit" | "arrow_up" | "arrow_up_down" | "arrow_up_limit" | "barchart" | "book" | "bookmark" | "bookmark_animation" | "box" | "bus_color" | "calendar_check" | "calendar_check_color" | "calendar_color" | "camera" | "card" | "cards_percent" | "cards_percent_color" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "cart" | "chat_bubble" | "chat_bubble_badge_color" | "chat_bubble_correct" | "chat_bubble_correct_color" | "chat_bubble_dots" | "chat_bubble_question" | "chat_bubble_question_animation" | "chat_bubble_question_color" | "check" | "check_in_circle" | "check_in_circle_color" | "check_in_circle_line" | "chevron_down" | "chevron_down_two" | "chevron_left" | "chevron_right" | "chevron_right_two" | "chevron_up" | "chevron_up_two" | "circles" | "clip" | "close" | "close_in_circle" | "coin" | "contact" | "copy" | "correct" | "coupon" | "crown" | "curriculum" | "curriculum_color" | "delete" | "dots" | "download" | "emoji" | "emoji_plus" | "emoji_plus_dash" | "eng" | "enter" | "equal" | "eraser" | "exclamation_point_in_circle" | "eye_off" | "eye_on" | "face_happy" | "face_sad" | "facebook" | "facebook_color" | "fire" | "fire_color" | "folder" | "frame" | "glasses" | "google_color" | "graph" | "hair" | "headphone" | "heart" | "home" | "infinite" | "info_in_circle" | "instagram" | "kakao_color" | "kor" | "league" | "letter" | "letter_crown_color" | "letter_crown_open_color" | "letter_heart_color" | "letter_heart_open_color" | "line_three" | "lock" | "logo_apple" | "logo_color" | "logo_facebook" | "logo_kakao" | "logo_naver" | "maxsize" | "minsize" | "minus" | "minus_in_circle" | "moneybag" | "moneybag_color" | "more" | "my_bubble" | "naver_color" | "note_color" | "note_pen_color" | "number_five_filled" | "number_five_outlined" | "number_four_filled" | "number_four_outlined" | "number_one_filled" | "number_one_outlined" | "number_three_filled" | "number_three_outlined" | "number_two_filled" | "number_two_outlined" | "out" | "palm_tree_color" | "paper_check" | "paper_pen" | "paper_pen_color" | "paper_two" | "pause" | "pen" | "percent_in_circle" | "pill" | "pill_color" | "pin" | "pin_color_red" | "play" | "plus" | "plus_in_circle" | "point_in_circle" | "point_in_circle_color" | "present" | "present_color" | "problem" | "profile" | "progress_gradient" | "question_mark_in_circle" | "question_mark_in_circle_outlined" | "raffle_color" | "receipt" | "refresh" | "school" | "school_color" | "setting" | "share" | "shield_check" | "siren" | "skipback" | "skipforward" | "sound_off" | "sound_on" | "speaker" | "stackup" | "star" | "star_color" | "store" | "sync" | "test_upload_color" | "thumbdown" | "thumbup" | "thunder" | "ticket" | "ticket_color" | "touch" | "trash" | "treasurebox" | "trophy" | "twinkle" | "undo" | "university" | "user_blocked" | "user_check" | "user_plus" | "user_two" | "video_color" | "vote_color" | "warning" | "wifi" | "workbook" | "workbook_color" | "wrong" | "youtube" | undefined;
|
|
24
24
|
trailingIconFill?: ColorValue | undefined;
|
|
25
25
|
trailingElements?: React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
26
26
|
disabled?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-native-kit",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "React Native Common Module for Team Turing",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"example": "yarn workspace @teamturing/react-native-kit-example",
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"bugs": {
|
|
159
159
|
"url": "https://github.com/weareteamturing/bombe/issues"
|
|
160
160
|
},
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "b390162e077a306a5fe39923199fb2d60becb062"
|
|
162
162
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useCallback, useMemo
|
|
2
|
-
import {
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { useWindowDimensions } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
5
|
import { useStableCallback } from '../../../hook';
|
|
@@ -9,12 +9,9 @@ import { WindowSizeClass, decideWindowWidthSizeClass, decideWindowHeightSizeClas
|
|
|
9
9
|
import { useDynamicDimensions } from './useDynamicDimensions';
|
|
10
10
|
|
|
11
11
|
export const [useDynamicLayout, LayoutProvider] = createCtx(
|
|
12
|
-
(
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
) => {
|
|
16
|
-
const [windowWidth, setWindowWidth] = useState(Math.ceil(Dimensions.get('window').width));
|
|
17
|
-
const [windowHeight, setWindowHeight] = useState(Math.ceil(Dimensions.get('window').height));
|
|
12
|
+
({ useSafeAreaInsetsHook = useSafeAreaInsets }: { useSafeAreaInsetsHook?: typeof useSafeAreaInsets }) => {
|
|
13
|
+
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
14
|
+
|
|
18
15
|
const windowShortLen = Math.min(windowWidth, windowHeight);
|
|
19
16
|
const windowLongLen = Math.max(windowWidth, windowHeight);
|
|
20
17
|
const _insets: { top: number; bottom: number; left: number; right: number } = useSafeAreaInsetsHook();
|
|
@@ -53,19 +50,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(
|
|
|
53
50
|
windowHeightSizeClass,
|
|
54
51
|
});
|
|
55
52
|
|
|
56
|
-
const updateScreenSizesBeforeRotation = useCallback(
|
|
57
|
-
(orientation: 'portrait' | 'landscape') => {
|
|
58
|
-
if (orientation === 'portrait') {
|
|
59
|
-
setWindowWidth(windowShortLen);
|
|
60
|
-
setWindowHeight(windowLongLen);
|
|
61
|
-
} else if (orientation === 'landscape') {
|
|
62
|
-
setWindowWidth(windowLongLen);
|
|
63
|
-
setWindowHeight(windowShortLen);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
[windowLongLen, windowShortLen],
|
|
67
|
-
);
|
|
68
|
-
|
|
69
53
|
const localImageDimensionProps = useStableCallback(
|
|
70
54
|
(
|
|
71
55
|
imageWidth: number,
|
|
@@ -96,23 +80,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(
|
|
|
96
80
|
},
|
|
97
81
|
);
|
|
98
82
|
|
|
99
|
-
transformChildren((children) => (
|
|
100
|
-
<View
|
|
101
|
-
testID={'LayoutProvider'}
|
|
102
|
-
style={StyleSheet.absoluteFill}
|
|
103
|
-
onLayout={({
|
|
104
|
-
nativeEvent: {
|
|
105
|
-
layout: { width, height },
|
|
106
|
-
},
|
|
107
|
-
}) => {
|
|
108
|
-
setWindowWidth(Math.ceil(width));
|
|
109
|
-
setWindowHeight(Math.ceil(height));
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
{children}
|
|
113
|
-
</View>
|
|
114
|
-
));
|
|
115
|
-
|
|
116
83
|
return {
|
|
117
84
|
...dimensions,
|
|
118
85
|
screenHeight: windowHeight,
|
|
@@ -120,7 +87,6 @@ export const [useDynamicLayout, LayoutProvider] = createCtx(
|
|
|
120
87
|
screenWidthWithPadding: windowWidth - 2 * dimensions.sidePadding,
|
|
121
88
|
screenShortLen: windowShortLen,
|
|
122
89
|
screenLongLen: windowLongLen,
|
|
123
|
-
updateScreenSizesBeforeRotation,
|
|
124
90
|
safeAreaInsets: insets,
|
|
125
91
|
sfTop: insets.top,
|
|
126
92
|
sfLeft: insets.left,
|