@oxy.so/services 13.9.0 → 13.10.0
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/ui/components/OxyDeviceSignIn.js +19 -29
- package/lib/commonjs/ui/components/OxyDeviceSignIn.js.map +1 -1
- package/lib/module/ui/components/OxyDeviceSignIn.js +19 -29
- package/lib/module/ui/components/OxyDeviceSignIn.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyDeviceSignIn.d.ts +5 -0
- package/lib/typescript/commonjs/ui/components/OxyDeviceSignIn.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyDeviceSignIn.d.ts +5 -0
- package/lib/typescript/module/ui/components/OxyDeviceSignIn.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/OxyDeviceSignIn.tsx +26 -22
|
@@ -37,6 +37,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
37
37
|
* claims the session and `OxyProvider` signs the app in, so the host simply
|
|
38
38
|
* stops rendering this.
|
|
39
39
|
*
|
|
40
|
+
* It draws no heading: the host's screen says what is being set up ("Scan to
|
|
41
|
+
* set up this frame") at the size its room needs, and a second, generic title
|
|
42
|
+
* here only repeated it. The code line scales with `size`, so it stays legible
|
|
43
|
+
* beside a QR meant to be read from across a room.
|
|
44
|
+
*
|
|
40
45
|
* Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
|
|
41
46
|
* `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
|
|
42
47
|
* of either here. The secret `sessionToken` never leaves the controller.
|
|
@@ -48,6 +53,13 @@ const QR_FOREGROUND = '#000000';
|
|
|
48
53
|
const DEFAULT_QR_SIZE = 280;
|
|
49
54
|
/** The quiet zone around the symbol, as a fraction of its size. */
|
|
50
55
|
const PLATE_PADDING_RATIO = 0.06;
|
|
56
|
+
/**
|
|
57
|
+
* The code and its hint, as fractions of the QR's edge: 14 and 13 points at
|
|
58
|
+
* the default 280, so a 32-character code spans about the symbol's width.
|
|
59
|
+
*/
|
|
60
|
+
const CODE_SIZE_RATIO = 0.05;
|
|
61
|
+
const CODE_HINT_SIZE_RATIO = 0.046;
|
|
62
|
+
const CODE_HINT_LINE_HEIGHT = 1.4;
|
|
51
63
|
const OxyDeviceSignIn = ({
|
|
52
64
|
size = DEFAULT_QR_SIZE
|
|
53
65
|
}) => {
|
|
@@ -121,17 +133,7 @@ const OxyDeviceSignIn = ({
|
|
|
121
133
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
122
134
|
style: styles.block,
|
|
123
135
|
testID: "oxy-device-sign-in",
|
|
124
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
125
|
-
style: [styles.title, {
|
|
126
|
-
color: theme.colors.text
|
|
127
|
-
}],
|
|
128
|
-
children: t('signin.device.title')
|
|
129
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
130
|
-
style: [styles.caption, {
|
|
131
|
-
color: theme.colors.textSecondary
|
|
132
|
-
}],
|
|
133
|
-
children: t('signin.device.caption')
|
|
134
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
135
137
|
style: [styles.plate, {
|
|
136
138
|
width: size + padding * 2,
|
|
137
139
|
height: size + padding * 2,
|
|
@@ -142,12 +144,16 @@ const OxyDeviceSignIn = ({
|
|
|
142
144
|
style: styles.codeBlock,
|
|
143
145
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
144
146
|
style: [styles.codeHint, {
|
|
145
|
-
color: theme.colors.textSecondary
|
|
147
|
+
color: theme.colors.textSecondary,
|
|
148
|
+
fontSize: Math.round(size * CODE_HINT_SIZE_RATIO),
|
|
149
|
+
lineHeight: Math.round(size * CODE_HINT_SIZE_RATIO * CODE_HINT_LINE_HEIGHT)
|
|
146
150
|
}],
|
|
147
151
|
children: t('signin.device.codeHint')
|
|
148
152
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_code.Code, {
|
|
149
153
|
testID: "device-sign-in-code",
|
|
150
|
-
style:
|
|
154
|
+
style: {
|
|
155
|
+
fontSize: Math.round(size * CODE_SIZE_RATIO)
|
|
156
|
+
},
|
|
151
157
|
children: signIn.authorizeCode
|
|
152
158
|
})]
|
|
153
159
|
}) : null]
|
|
@@ -159,17 +165,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
159
165
|
alignItems: 'center',
|
|
160
166
|
gap: 16
|
|
161
167
|
},
|
|
162
|
-
title: {
|
|
163
|
-
fontSize: 28,
|
|
164
|
-
lineHeight: 34,
|
|
165
|
-
fontWeight: '600',
|
|
166
|
-
textAlign: 'center'
|
|
167
|
-
},
|
|
168
|
-
caption: {
|
|
169
|
-
fontSize: 16,
|
|
170
|
-
lineHeight: 22,
|
|
171
|
-
textAlign: 'center'
|
|
172
|
-
},
|
|
173
168
|
plate: {
|
|
174
169
|
borderRadius: 16,
|
|
175
170
|
backgroundColor: QR_PLATE_BG,
|
|
@@ -181,12 +176,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
181
176
|
gap: 4
|
|
182
177
|
},
|
|
183
178
|
codeHint: {
|
|
184
|
-
fontSize: 13,
|
|
185
|
-
lineHeight: 18,
|
|
186
179
|
textAlign: 'center'
|
|
187
|
-
},
|
|
188
|
-
code: {
|
|
189
|
-
fontSize: 14
|
|
190
180
|
}
|
|
191
181
|
});
|
|
192
182
|
//# sourceMappingURL=OxyDeviceSignIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeQrcodeSvg","_interopRequireDefault","_button","_code","_RiCheckboxCircleLine","_RiRefreshLine","_loading","_theme","_typography","_oxyRuntimeContext","_useI18n","_accountDialogSnapshot","_jsxRuntime","e","__esModule","default","QR_PLATE_BG","QR_FOREGROUND","DEFAULT_QR_SIZE","PLATE_PADDING_RATIO","OxyDeviceSignIn","size","theme","useTheme","t","useI18n","accountDialogController","controller","useOxy","signIn","useAccountDialogSnapshot","live","inline","phase","expired","failure","useEffect","current","getSnapshot","startInlineQr","last","cancelSignIn","padding","Math","round","showsCode","approvalUrl","progress","plate","jsx","RiCheckboxCircleLine","fill","colors","success","value","backgroundColor","color","SpinnerIcon","Button","appearance","tone","leadingIcon","RiRefreshLine","onPress","testID","children","jsxs","View","style","styles","block","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeQrcodeSvg","_interopRequireDefault","_button","_code","_RiCheckboxCircleLine","_RiRefreshLine","_loading","_theme","_typography","_oxyRuntimeContext","_useI18n","_accountDialogSnapshot","_jsxRuntime","e","__esModule","default","QR_PLATE_BG","QR_FOREGROUND","DEFAULT_QR_SIZE","PLATE_PADDING_RATIO","CODE_SIZE_RATIO","CODE_HINT_SIZE_RATIO","CODE_HINT_LINE_HEIGHT","OxyDeviceSignIn","size","theme","useTheme","t","useI18n","accountDialogController","controller","useOxy","signIn","useAccountDialogSnapshot","live","inline","phase","expired","failure","useEffect","current","getSnapshot","startInlineQr","last","cancelSignIn","padding","Math","round","showsCode","approvalUrl","progress","plate","jsx","RiCheckboxCircleLine","fill","colors","success","value","backgroundColor","color","SpinnerIcon","Button","appearance","tone","leadingIcon","RiRefreshLine","onPress","testID","children","jsxs","View","style","styles","block","width","height","authorizeCode","codeBlock","Text","codeHint","textSecondary","fontSize","lineHeight","Code","exports","StyleSheet","create","alignItems","gap","borderRadius","justifyContent","textAlign"],"sourceRoot":"../../../../src","sources":["ui/components/OxyDeviceSignIn.tsx"],"mappings":";;;;;;AA6BA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA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MiD,MAAM,GAAGa,uBAAU,CAACC,MAAM,CAAC;EAC/Bb,KAAK,EAAE;IACLc,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDrC,KAAK,EAAE;IACLsC,YAAY,EAAE,EAAE;IAChB/B,eAAe,EAAE1C,WAAW;IAC5BuE,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE;EAClB,CAAC;EACDb,SAAS,EAAE;IACTU,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDT,QAAQ,EAAE;IACRY,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
* claims the session and `OxyProvider` signs the app in, so the host simply
|
|
19
19
|
* stops rendering this.
|
|
20
20
|
*
|
|
21
|
+
* It draws no heading: the host's screen says what is being set up ("Scan to
|
|
22
|
+
* set up this frame") at the size its room needs, and a second, generic title
|
|
23
|
+
* here only repeated it. The code line scales with `size`, so it stays legible
|
|
24
|
+
* beside a QR meant to be read from across a room.
|
|
25
|
+
*
|
|
21
26
|
* Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
|
|
22
27
|
* `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
|
|
23
28
|
* of either here. The secret `sessionToken` never leaves the controller.
|
|
@@ -45,6 +50,13 @@ const QR_FOREGROUND = '#000000';
|
|
|
45
50
|
const DEFAULT_QR_SIZE = 280;
|
|
46
51
|
/** The quiet zone around the symbol, as a fraction of its size. */
|
|
47
52
|
const PLATE_PADDING_RATIO = 0.06;
|
|
53
|
+
/**
|
|
54
|
+
* The code and its hint, as fractions of the QR's edge: 14 and 13 points at
|
|
55
|
+
* the default 280, so a 32-character code spans about the symbol's width.
|
|
56
|
+
*/
|
|
57
|
+
const CODE_SIZE_RATIO = 0.05;
|
|
58
|
+
const CODE_HINT_SIZE_RATIO = 0.046;
|
|
59
|
+
const CODE_HINT_LINE_HEIGHT = 1.4;
|
|
48
60
|
export const OxyDeviceSignIn = ({
|
|
49
61
|
size = DEFAULT_QR_SIZE
|
|
50
62
|
}) => {
|
|
@@ -118,17 +130,7 @@ export const OxyDeviceSignIn = ({
|
|
|
118
130
|
return /*#__PURE__*/_jsxs(View, {
|
|
119
131
|
style: styles.block,
|
|
120
132
|
testID: "oxy-device-sign-in",
|
|
121
|
-
children: [/*#__PURE__*/_jsx(
|
|
122
|
-
style: [styles.title, {
|
|
123
|
-
color: theme.colors.text
|
|
124
|
-
}],
|
|
125
|
-
children: t('signin.device.title')
|
|
126
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
127
|
-
style: [styles.caption, {
|
|
128
|
-
color: theme.colors.textSecondary
|
|
129
|
-
}],
|
|
130
|
-
children: t('signin.device.caption')
|
|
131
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
133
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
132
134
|
style: [styles.plate, {
|
|
133
135
|
width: size + padding * 2,
|
|
134
136
|
height: size + padding * 2,
|
|
@@ -139,12 +141,16 @@ export const OxyDeviceSignIn = ({
|
|
|
139
141
|
style: styles.codeBlock,
|
|
140
142
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
141
143
|
style: [styles.codeHint, {
|
|
142
|
-
color: theme.colors.textSecondary
|
|
144
|
+
color: theme.colors.textSecondary,
|
|
145
|
+
fontSize: Math.round(size * CODE_HINT_SIZE_RATIO),
|
|
146
|
+
lineHeight: Math.round(size * CODE_HINT_SIZE_RATIO * CODE_HINT_LINE_HEIGHT)
|
|
143
147
|
}],
|
|
144
148
|
children: t('signin.device.codeHint')
|
|
145
149
|
}), /*#__PURE__*/_jsx(Code, {
|
|
146
150
|
testID: "device-sign-in-code",
|
|
147
|
-
style:
|
|
151
|
+
style: {
|
|
152
|
+
fontSize: Math.round(size * CODE_SIZE_RATIO)
|
|
153
|
+
},
|
|
148
154
|
children: signIn.authorizeCode
|
|
149
155
|
})]
|
|
150
156
|
}) : null]
|
|
@@ -155,17 +161,6 @@ const styles = StyleSheet.create({
|
|
|
155
161
|
alignItems: 'center',
|
|
156
162
|
gap: 16
|
|
157
163
|
},
|
|
158
|
-
title: {
|
|
159
|
-
fontSize: 28,
|
|
160
|
-
lineHeight: 34,
|
|
161
|
-
fontWeight: '600',
|
|
162
|
-
textAlign: 'center'
|
|
163
|
-
},
|
|
164
|
-
caption: {
|
|
165
|
-
fontSize: 16,
|
|
166
|
-
lineHeight: 22,
|
|
167
|
-
textAlign: 'center'
|
|
168
|
-
},
|
|
169
164
|
plate: {
|
|
170
165
|
borderRadius: 16,
|
|
171
166
|
backgroundColor: QR_PLATE_BG,
|
|
@@ -177,12 +172,7 @@ const styles = StyleSheet.create({
|
|
|
177
172
|
gap: 4
|
|
178
173
|
},
|
|
179
174
|
codeHint: {
|
|
180
|
-
fontSize: 13,
|
|
181
|
-
lineHeight: 18,
|
|
182
175
|
textAlign: 'center'
|
|
183
|
-
},
|
|
184
|
-
code: {
|
|
185
|
-
fontSize: 14
|
|
186
176
|
}
|
|
187
177
|
});
|
|
188
178
|
//# sourceMappingURL=OxyDeviceSignIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","StyleSheet","View","QRCode","Button","Code","RiCheckboxCircleLine","RiRefreshLine","SpinnerIcon","useTheme","Text","useOxy","useI18n","useAccountDialogSnapshot","jsx","_jsx","jsxs","_jsxs","QR_PLATE_BG","QR_FOREGROUND","DEFAULT_QR_SIZE","PLATE_PADDING_RATIO","OxyDeviceSignIn","size","theme","t","accountDialogController","controller","signIn","live","inline","phase","expired","failure","current","getSnapshot","startInlineQr","last","cancelSignIn","padding","Math","round","showsCode","approvalUrl","progress","plate","fill","colors","success","value","backgroundColor","color","appearance","tone","leadingIcon","onPress","testID","children","style","styles","block","
|
|
1
|
+
{"version":3,"names":["useEffect","StyleSheet","View","QRCode","Button","Code","RiCheckboxCircleLine","RiRefreshLine","SpinnerIcon","useTheme","Text","useOxy","useI18n","useAccountDialogSnapshot","jsx","_jsx","jsxs","_jsxs","QR_PLATE_BG","QR_FOREGROUND","DEFAULT_QR_SIZE","PLATE_PADDING_RATIO","CODE_SIZE_RATIO","CODE_HINT_SIZE_RATIO","CODE_HINT_LINE_HEIGHT","OxyDeviceSignIn","size","theme","t","accountDialogController","controller","signIn","live","inline","phase","expired","failure","current","getSnapshot","startInlineQr","last","cancelSignIn","padding","Math","round","showsCode","approvalUrl","progress","plate","fill","colors","success","value","backgroundColor","color","appearance","tone","leadingIcon","onPress","testID","children","style","styles","block","width","height","authorizeCode","codeBlock","codeHint","textSecondary","fontSize","lineHeight","create","alignItems","gap","borderRadius","justifyContent","textAlign"],"sourceRoot":"../../../../src","sources":["ui/components/OxyDeviceSignIn.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,oBAAoB,QAAQ,0CAA0C;AAC/E,SAASC,aAAa,QAAQ,mCAAmC;AACjE,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,IAAI,QAAQ,0BAA0B;AAC/C,SAASC,MAAM,QAAQ,iCAA8B;AACrD,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,wBAAwB,QAAQ,mCAAgC;;AAEzE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,WAAW,GAAG,SAAS;AAC7B,MAAMC,aAAa,GAAG,SAAS;AAC/B;AACA,MAAMC,eAAe,GAAG,GAAG;AAC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;UAAES,QAAQ,EAAE3B,IAAI,CAACC,KAAK,CAAClB,IAAI,GAAGJ,eAAe;QAAE,CAAE;QAAAsC,QAAA,EAEvD7B,MAAM,CAACmC;MAAa,CACjB,CAAC;IAAA,CACH,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CAAC;AAED,MAAMJ,MAAM,GAAG7D,UAAU,CAACuE,MAAM,CAAC;EAC/BT,KAAK,EAAE;IACLU,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACD1B,KAAK,EAAE;IACL2B,YAAY,EAAE,EAAE;IAChBtB,eAAe,EAAEnC,WAAW;IAC5BuD,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE;EAClB,CAAC;EACDT,SAAS,EAAE;IACTM,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDN,QAAQ,EAAE;IACRS,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* claims the session and `OxyProvider` signs the app in, so the host simply
|
|
17
17
|
* stops rendering this.
|
|
18
18
|
*
|
|
19
|
+
* It draws no heading: the host's screen says what is being set up ("Scan to
|
|
20
|
+
* set up this frame") at the size its room needs, and a second, generic title
|
|
21
|
+
* here only repeated it. The code line scales with `size`, so it stays legible
|
|
22
|
+
* beside a QR meant to be read from across a room.
|
|
23
|
+
*
|
|
19
24
|
* Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
|
|
20
25
|
* `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
|
|
21
26
|
* of either here. The secret `sessionToken` never leaves the controller.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4F1D,CAAC"}
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* claims the session and `OxyProvider` signs the app in, so the host simply
|
|
17
17
|
* stops rendering this.
|
|
18
18
|
*
|
|
19
|
+
* It draws no heading: the host's screen says what is being set up ("Scan to
|
|
20
|
+
* set up this frame") at the size its room needs, and a second, generic title
|
|
21
|
+
* here only repeated it. The code line scales with `size`, so it stays legible
|
|
22
|
+
* beside a QR meant to be read from across a room.
|
|
23
|
+
*
|
|
19
24
|
* Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
|
|
20
25
|
* `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
|
|
21
26
|
* of either here. The secret `sessionToken` never leaves the controller.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4F1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
4
|
"description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"@commitlint/config-conventional": "^21.2.0",
|
|
162
162
|
"@expo/app-integrity": "~58.0.2",
|
|
163
163
|
"@expo/vector-icons": "^15.0.3",
|
|
164
|
-
"@oxy.so/core": "7.8.
|
|
164
|
+
"@oxy.so/core": "7.8.1",
|
|
165
165
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
166
166
|
"@react-native-community/netinfo": "^12.0.1",
|
|
167
167
|
"@react-native/babel-preset": "^0.88.0",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* claims the session and `OxyProvider` signs the app in, so the host simply
|
|
17
17
|
* stops rendering this.
|
|
18
18
|
*
|
|
19
|
+
* It draws no heading: the host's screen says what is being set up ("Scan to
|
|
20
|
+
* set up this frame") at the size its room needs, and a second, generic title
|
|
21
|
+
* here only repeated it. The code line scales with `size`, so it stays legible
|
|
22
|
+
* beside a QR meant to be read from across a room.
|
|
23
|
+
*
|
|
19
24
|
* Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
|
|
20
25
|
* `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
|
|
21
26
|
* of either here. The secret `sessionToken` never leaves the controller.
|
|
@@ -43,6 +48,13 @@ const QR_FOREGROUND = '#000000';
|
|
|
43
48
|
const DEFAULT_QR_SIZE = 280;
|
|
44
49
|
/** The quiet zone around the symbol, as a fraction of its size. */
|
|
45
50
|
const PLATE_PADDING_RATIO = 0.06;
|
|
51
|
+
/**
|
|
52
|
+
* The code and its hint, as fractions of the QR's edge: 14 and 13 points at
|
|
53
|
+
* the default 280, so a 32-character code spans about the symbol's width.
|
|
54
|
+
*/
|
|
55
|
+
const CODE_SIZE_RATIO = 0.05;
|
|
56
|
+
const CODE_HINT_SIZE_RATIO = 0.046;
|
|
57
|
+
const CODE_HINT_LINE_HEIGHT = 1.4;
|
|
46
58
|
|
|
47
59
|
export interface OxyDeviceSignInProps {
|
|
48
60
|
/** Edge of the QR symbol in points. Defaults to 280. */
|
|
@@ -112,10 +124,6 @@ export const OxyDeviceSignIn: React.FC<OxyDeviceSignInProps> = ({ size = DEFAULT
|
|
|
112
124
|
|
|
113
125
|
return (
|
|
114
126
|
<View style={styles.block} testID="oxy-device-sign-in">
|
|
115
|
-
<Text style={[styles.title, { color: theme.colors.text }]}>{t('signin.device.title')}</Text>
|
|
116
|
-
<Text style={[styles.caption, { color: theme.colors.textSecondary }]}>
|
|
117
|
-
{t('signin.device.caption')}
|
|
118
|
-
</Text>
|
|
119
127
|
<View
|
|
120
128
|
style={[styles.plate, { width: size + padding * 2, height: size + padding * 2, padding }]}
|
|
121
129
|
>
|
|
@@ -123,10 +131,22 @@ export const OxyDeviceSignIn: React.FC<OxyDeviceSignInProps> = ({ size = DEFAULT
|
|
|
123
131
|
</View>
|
|
124
132
|
{showsCode && signIn.authorizeCode ? (
|
|
125
133
|
<View style={styles.codeBlock}>
|
|
126
|
-
<Text
|
|
134
|
+
<Text
|
|
135
|
+
style={[
|
|
136
|
+
styles.codeHint,
|
|
137
|
+
{
|
|
138
|
+
color: theme.colors.textSecondary,
|
|
139
|
+
fontSize: Math.round(size * CODE_HINT_SIZE_RATIO),
|
|
140
|
+
lineHeight: Math.round(size * CODE_HINT_SIZE_RATIO * CODE_HINT_LINE_HEIGHT),
|
|
141
|
+
},
|
|
142
|
+
]}
|
|
143
|
+
>
|
|
127
144
|
{t('signin.device.codeHint')}
|
|
128
145
|
</Text>
|
|
129
|
-
<Code
|
|
146
|
+
<Code
|
|
147
|
+
testID="device-sign-in-code"
|
|
148
|
+
style={{ fontSize: Math.round(size * CODE_SIZE_RATIO) }}
|
|
149
|
+
>
|
|
130
150
|
{signIn.authorizeCode}
|
|
131
151
|
</Code>
|
|
132
152
|
</View>
|
|
@@ -140,17 +160,6 @@ const styles = StyleSheet.create({
|
|
|
140
160
|
alignItems: 'center',
|
|
141
161
|
gap: 16,
|
|
142
162
|
},
|
|
143
|
-
title: {
|
|
144
|
-
fontSize: 28,
|
|
145
|
-
lineHeight: 34,
|
|
146
|
-
fontWeight: '600',
|
|
147
|
-
textAlign: 'center',
|
|
148
|
-
},
|
|
149
|
-
caption: {
|
|
150
|
-
fontSize: 16,
|
|
151
|
-
lineHeight: 22,
|
|
152
|
-
textAlign: 'center',
|
|
153
|
-
},
|
|
154
163
|
plate: {
|
|
155
164
|
borderRadius: 16,
|
|
156
165
|
backgroundColor: QR_PLATE_BG,
|
|
@@ -162,11 +171,6 @@ const styles = StyleSheet.create({
|
|
|
162
171
|
gap: 4,
|
|
163
172
|
},
|
|
164
173
|
codeHint: {
|
|
165
|
-
fontSize: 13,
|
|
166
|
-
lineHeight: 18,
|
|
167
174
|
textAlign: 'center',
|
|
168
175
|
},
|
|
169
|
-
code: {
|
|
170
|
-
fontSize: 14,
|
|
171
|
-
},
|
|
172
176
|
});
|