@oxy.so/services 13.9.0 → 13.11.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.
@@ -14,6 +14,7 @@ var _RiRefreshLine = require("@oxy.so/bloom/icons/RiRefreshLine");
14
14
  var _loading = require("@oxy.so/bloom/loading");
15
15
  var _theme = require("@oxy.so/bloom/theme");
16
16
  var _typography = require("@oxy.so/bloom/typography");
17
+ var _session = require("@oxy.so/core/session");
17
18
  var _oxyRuntimeContext = require("../context/oxyRuntimeContext.js");
18
19
  var _useI18n = require("../hooks/useI18n.js");
19
20
  var _accountDialogSnapshot = require("../hooks/accountDialogSnapshot.js");
@@ -37,9 +38,15 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
37
38
  * claims the session and `OxyProvider` signs the app in, so the host simply
38
39
  * stops rendering this.
39
40
  *
41
+ * It draws no heading: the host's screen says what is being set up ("Scan to
42
+ * set up this frame") at the size its room needs, and a second, generic title
43
+ * here only repeated it. The code line scales with `size`, so it stays legible
44
+ * beside a QR meant to be read from across a room.
45
+ *
40
46
  * Anti-phishing: the plate encodes `signIn.approvalUrl` and the code line shows
41
- * `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
42
- * of either here. The secret `sessionToken` never leaves the controller.
47
+ * `deviceComparisonCode(signIn.authorizeCode)` (`CE7F-B31F`), the same short
48
+ * code the approval page prints, both PUBLIC; nothing about the application is
49
+ * read out of either here. The secret `sessionToken` never leaves the controller.
43
50
  */
44
51
 
45
52
  /** High-contrast, un-themed on purpose: scan reliability. */const QR_PLATE_BG = '#FFFFFF';
@@ -48,6 +55,14 @@ const QR_FOREGROUND = '#000000';
48
55
  const DEFAULT_QR_SIZE = 280;
49
56
  /** The quiet zone around the symbol, as a fraction of its size. */
50
57
  const PLATE_PADDING_RATIO = 0.06;
58
+ /**
59
+ * The code and its hint, as fractions of the QR's edge: 28 and 13 points at
60
+ * the default 280. The nine characters of `CE7F-B31F` then span about half the
61
+ * symbol, large enough to read from across a room.
62
+ */
63
+ const CODE_SIZE_RATIO = 0.1;
64
+ const CODE_HINT_SIZE_RATIO = 0.046;
65
+ const CODE_HINT_LINE_HEIGHT = 1.4;
51
66
  const OxyDeviceSignIn = ({
52
67
  size = DEFAULT_QR_SIZE
53
68
  }) => {
@@ -121,17 +136,7 @@ const OxyDeviceSignIn = ({
121
136
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
122
137
  style: styles.block,
123
138
  testID: "oxy-device-sign-in",
124
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
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, {
139
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
135
140
  style: [styles.plate, {
136
141
  width: size + padding * 2,
137
142
  height: size + padding * 2,
@@ -142,13 +147,17 @@ const OxyDeviceSignIn = ({
142
147
  style: styles.codeBlock,
143
148
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
144
149
  style: [styles.codeHint, {
145
- color: theme.colors.textSecondary
150
+ color: theme.colors.textSecondary,
151
+ fontSize: Math.round(size * CODE_HINT_SIZE_RATIO),
152
+ lineHeight: Math.round(size * CODE_HINT_SIZE_RATIO * CODE_HINT_LINE_HEIGHT)
146
153
  }],
147
154
  children: t('signin.device.codeHint')
148
155
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_code.Code, {
149
156
  testID: "device-sign-in-code",
150
- style: styles.code,
151
- children: signIn.authorizeCode
157
+ style: {
158
+ fontSize: Math.round(size * CODE_SIZE_RATIO)
159
+ },
160
+ children: (0, _session.deviceComparisonCode)(signIn.authorizeCode)
152
161
  })]
153
162
  }) : null]
154
163
  });
@@ -159,17 +168,6 @@ const styles = _reactNative.StyleSheet.create({
159
168
  alignItems: 'center',
160
169
  gap: 16
161
170
  },
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
171
  plate: {
174
172
  borderRadius: 16,
175
173
  backgroundColor: QR_PLATE_BG,
@@ -181,12 +179,7 @@ const styles = _reactNative.StyleSheet.create({
181
179
  gap: 4
182
180
  },
183
181
  codeHint: {
184
- fontSize: 13,
185
- lineHeight: 18,
186
182
  textAlign: 'center'
187
- },
188
- code: {
189
- fontSize: 14
190
183
  }
191
184
  });
192
185
  //# 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","Text","title","text","caption","textSecondary","width","height","authorizeCode","codeBlock","codeHint","Code","code","exports","StyleSheet","create","alignItems","gap","fontSize","lineHeight","fontWeight","textAlign","borderRadius","justifyContent"],"sourceRoot":"../../../../src","sources":["ui/components/OxyDeviceSignIn.tsx"],"mappings":";;;;;;AAwBA,IAAAA,MAAA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AqC,GAAA,EAAC9C,KAAA,CAAA8E,IAAI;QAACjB,MAAM,EAAC,qBAAqB;QAACI,KAAK,EAAEC,MAAM,CAACa,IAAK;QAAAjB,QAAA,EACnDpC,MAAM,CAACiD;MAAa,CACjB,CAAC;IAAA,CACH,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CAAC;AAACK,OAAA,CAAA/D,eAAA,GAAAA,eAAA;AAEF,MAAMiD,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/Bf,KAAK,EAAE;IACLgB,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDf,KAAK,EAAE;IACLgB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb,CAAC;EACDjB,OAAO,EAAE;IACPc,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdE,SAAS,EAAE;EACb,CAAC;EACD3C,KAAK,EAAE;IACL4C,YAAY,EAAE,EAAE;IAChBrC,eAAe,EAAEvC,WAAW;IAC5BsE,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDd,SAAS,EAAE;IACTO,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDP,QAAQ,EAAE;IACRQ,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdE,SAAS,EAAE;EACb,CAAC;EACDT,IAAI,EAAE;IACJM,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeQrcodeSvg","_interopRequireDefault","_button","_code","_RiCheckboxCircleLine","_RiRefreshLine","_loading","_theme","_typography","_session","_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","deviceComparisonCode","exports","StyleSheet","create","alignItems","gap","borderRadius","justifyContent","textAlign"],"sourceRoot":"../../../../src","sources":["ui/components/OxyDeviceSignIn.tsx"],"mappings":";;;;;;AA8BA,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,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AACA,IAAAa,QAAA,GAAAb,OAAA;AACA,IAAAc,sBAAA,GAAAd,OAAA;AAA0E,IAAAe,WAAA,GAAAf,OAAA;AAAA,SAAAG,uBAAAa,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA3C1E;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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GAAA,EAAC7C,WAAA,CAAAuE,IAAI;QACHP,KAAK,EAAE,CACLC,MAAM,CAACO,QAAQ,EACf;UACEpB,KAAK,EAAElC,KAAK,CAAC8B,MAAM,CAACyB,aAAa;UACjCC,QAAQ,EAAEnC,IAAI,CAACC,KAAK,CAACvB,IAAI,GAAGH,oBAAoB,CAAC;UACjD6D,UAAU,EAAEpC,IAAI,CAACC,KAAK,CAACvB,IAAI,GAAGH,oBAAoB,GAAGC,qBAAqB;QAC5E,CAAC,CACD;QAAA8C,QAAA,EAEDzC,CAAC,CAAC,wBAAwB;MAAC,CACxB,CAAC,eACP,IAAAf,WAAA,CAAAwC,GAAA,EAAClD,KAAA,CAAAiF,IAAI;QACHhB,MAAM,EAAC,qBAAqB;QAC5BI,KAAK,EAAE;UAAEU,QAAQ,EAAEnC,IAAI,CAACC,KAAK,CAACvB,IAAI,GAAGJ,eAAe;QAAE,CAAE;QAAAgD,QAAA,EAEvD,IAAAgB,6BAAoB,EAACpD,MAAM,CAAC4C,aAAa;MAAC,CACvC,CAAC;IAAA,CACH,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CAAC;AAACS,OAAA,CAAA9D,eAAA,GAAAA,eAAA;AAEF,MAAMiD,MAAM,GAAGc,uBAAU,CAACC,MAAM,CAAC;EAC/Bd,KAAK,EAAE;IACLe,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDtC,KAAK,EAAE;IACLuC,YAAY,EAAE,EAAE;IAChBhC,eAAe,EAAE1C,WAAW;IAC5BwE,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE;EAClB,CAAC;EACDd,SAAS,EAAE;IACTW,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDV,QAAQ,EAAE;IACRa,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -18,9 +18,15 @@
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
- * `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
23
- * of either here. The secret `sessionToken` never leaves the controller.
27
+ * `deviceComparisonCode(signIn.authorizeCode)` (`CE7F-B31F`), the same short
28
+ * code the approval page prints, both PUBLIC; nothing about the application is
29
+ * read out of either here. The secret `sessionToken` never leaves the controller.
24
30
  */
25
31
 
26
32
  import { useEffect } from 'react';
@@ -33,6 +39,7 @@ import { RiRefreshLine } from '@oxy.so/bloom/icons/RiRefreshLine';
33
39
  import { SpinnerIcon } from '@oxy.so/bloom/loading';
34
40
  import { useTheme } from '@oxy.so/bloom/theme';
35
41
  import { Text } from '@oxy.so/bloom/typography';
42
+ import { deviceComparisonCode } from '@oxy.so/core/session';
36
43
  import { useOxy } from "../context/oxyRuntimeContext.js";
37
44
  import { useI18n } from "../hooks/useI18n.js";
38
45
  import { useAccountDialogSnapshot } from "../hooks/accountDialogSnapshot.js";
@@ -45,6 +52,14 @@ const QR_FOREGROUND = '#000000';
45
52
  const DEFAULT_QR_SIZE = 280;
46
53
  /** The quiet zone around the symbol, as a fraction of its size. */
47
54
  const PLATE_PADDING_RATIO = 0.06;
55
+ /**
56
+ * The code and its hint, as fractions of the QR's edge: 28 and 13 points at
57
+ * the default 280. The nine characters of `CE7F-B31F` then span about half the
58
+ * symbol, large enough to read from across a room.
59
+ */
60
+ const CODE_SIZE_RATIO = 0.1;
61
+ const CODE_HINT_SIZE_RATIO = 0.046;
62
+ const CODE_HINT_LINE_HEIGHT = 1.4;
48
63
  export const OxyDeviceSignIn = ({
49
64
  size = DEFAULT_QR_SIZE
50
65
  }) => {
@@ -118,17 +133,7 @@ export const OxyDeviceSignIn = ({
118
133
  return /*#__PURE__*/_jsxs(View, {
119
134
  style: styles.block,
120
135
  testID: "oxy-device-sign-in",
121
- children: [/*#__PURE__*/_jsx(Text, {
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, {
136
+ children: [/*#__PURE__*/_jsx(View, {
132
137
  style: [styles.plate, {
133
138
  width: size + padding * 2,
134
139
  height: size + padding * 2,
@@ -139,13 +144,17 @@ export const OxyDeviceSignIn = ({
139
144
  style: styles.codeBlock,
140
145
  children: [/*#__PURE__*/_jsx(Text, {
141
146
  style: [styles.codeHint, {
142
- 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)
143
150
  }],
144
151
  children: t('signin.device.codeHint')
145
152
  }), /*#__PURE__*/_jsx(Code, {
146
153
  testID: "device-sign-in-code",
147
- style: styles.code,
148
- children: signIn.authorizeCode
154
+ style: {
155
+ fontSize: Math.round(size * CODE_SIZE_RATIO)
156
+ },
157
+ children: deviceComparisonCode(signIn.authorizeCode)
149
158
  })]
150
159
  }) : null]
151
160
  });
@@ -155,17 +164,6 @@ const styles = StyleSheet.create({
155
164
  alignItems: 'center',
156
165
  gap: 16
157
166
  },
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
167
  plate: {
170
168
  borderRadius: 16,
171
169
  backgroundColor: QR_PLATE_BG,
@@ -177,12 +175,7 @@ const styles = StyleSheet.create({
177
175
  gap: 4
178
176
  },
179
177
  codeHint: {
180
- fontSize: 13,
181
- lineHeight: 18,
182
178
  textAlign: 'center'
183
- },
184
- code: {
185
- fontSize: 14
186
179
  }
187
180
  });
188
181
  //# 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","title","text","caption","textSecondary","width","height","authorizeCode","codeBlock","codeHint","code","create","alignItems","gap","fontSize","lineHeight","fontWeight","textAlign","borderRadius","justifyContent"],"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;;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;;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gBAC5B1C,IAAA,CAACL,IAAI;QAACgD,KAAK,EAAE,CAACC,MAAM,CAACU,QAAQ,EAAE;UAAElB,KAAK,EAAE3B,KAAK,CAACuB,MAAM,CAACiB;QAAc,CAAC,CAAE;QAAAP,QAAA,EACnEhC,CAAC,CAAC,wBAAwB;MAAC,CACxB,CAAC,eACPV,IAAA,CAACV,IAAI;QAACmD,MAAM,EAAC,qBAAqB;QAACE,KAAK,EAAEC,MAAM,CAACW,IAAK;QAAAb,QAAA,EACnD7B,MAAM,CAACuC;MAAa,CACjB,CAAC;IAAA,CACH,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CAAC;AAED,MAAMR,MAAM,GAAG1D,UAAU,CAACsE,MAAM,CAAC;EAC/BX,KAAK,EAAE;IACLY,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDZ,KAAK,EAAE;IACLa,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb,CAAC;EACDd,OAAO,EAAE;IACPW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdE,SAAS,EAAE;EACb,CAAC;EACDhC,KAAK,EAAE;IACLiC,YAAY,EAAE,EAAE;IAChB5B,eAAe,EAAEhC,WAAW;IAC5BsD,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDX,SAAS,EAAE;IACTI,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDJ,QAAQ,EAAE;IACRK,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdE,SAAS,EAAE;EACb,CAAC;EACDP,IAAI,EAAE;IACJI,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","StyleSheet","View","QRCode","Button","Code","RiCheckboxCircleLine","RiRefreshLine","SpinnerIcon","useTheme","Text","deviceComparisonCode","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;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,oBAAoB,QAAQ,sBAAsB;AAC3D,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;AAC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,CAAC,eACPb,IAAA,CAACX,IAAI;QACHuD,MAAM,EAAC,qBAAqB;QAC5BE,KAAK,EAAE;UAAES,QAAQ,EAAE3B,IAAI,CAACC,KAAK,CAAClB,IAAI,GAAGJ,eAAe;QAAE,CAAE;QAAAsC,QAAA,EAEvDlD,oBAAoB,CAACqB,MAAM,CAACmC,aAAa;MAAC,CACvC,CAAC;IAAA,CACH,CAAC,GACL,IAAI;EAAA,CACJ,CAAC;AAEX,CAAC;AAED,MAAMJ,MAAM,GAAG9D,UAAU,CAACwE,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,9 +16,15 @@
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
- * `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
21
- * of either here. The secret `sessionToken` never leaves the controller.
25
+ * `deviceComparisonCode(signIn.authorizeCode)` (`CE7F-B31F`), the same short
26
+ * code the approval page prints, both PUBLIC; nothing about the application is
27
+ * read out of either here. The secret `sessionToken` never leaves the controller.
22
28
  */
23
29
  import type React from 'react';
24
30
  export interface OxyDeviceSignInProps {
@@ -1 +1 @@
1
- {"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoF1D,CAAC"}
1
+ {"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgC/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,9 +16,15 @@
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
- * `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
21
- * of either here. The secret `sessionToken` never leaves the controller.
25
+ * `deviceComparisonCode(signIn.authorizeCode)` (`CE7F-B31F`), the same short
26
+ * code the approval page prints, both PUBLIC; nothing about the application is
27
+ * read out of either here. The secret `sessionToken` never leaves the controller.
22
28
  */
23
29
  import type React from 'react';
24
30
  export interface OxyDeviceSignInProps {
@@ -1 +1 @@
1
- {"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoF1D,CAAC"}
1
+ {"version":3,"file":"OxyDeviceSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyDeviceSignIn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgC/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.9.0",
3
+ "version": "13.11.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.0",
164
+ "@oxy.so/core": "7.9.0",
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",
@@ -211,13 +211,13 @@
211
211
  "expo-video": "~58.0.12"
212
212
  },
213
213
  "//@oxy.so/bloom": "Bloom 11.1.0 adds the shared grouped sections, usage card, subscription plans, frame appearance and overlay navigation APIs used by this SDK. First-party Bloom peers remain open above this tested minimum.",
214
- "//@oxy.so/core": "Core 7.8.0 supplies the device sign-in request's `approvalUrl` and the `signin.device.*` strings `OxyDeviceSignIn` shows; 7.7.0 supplies the bounded native asset file adapter and phase progress installed by OxyProvider; 7.6.0 forwards guest locale and first-touch campaign metadata through signup; 7.3.0 supplies `users.lookupMany`, with which the account members screen fails (and retries) a profile read whose chunk failed instead of caching those members as handle-less; 7.2.0 supplies `assets.cachedUrl`, with which `useFileDownloadUrl` answers an already-resolved URL in its first render; 6.16.0 supplies `requireServerVerdict` and `onHolderRejected`, with which the cold boot checks a session it painted from the cache; 6.13.0 supplies the `accounts.settings.*` strings (picture, categories) the account settings speak in every language; 6.12.0 supplies `fileManagement.contentLost` and the `lost` file status a lost file is listed with; 6.11.0 supplies the `follow.errors.*` strings the follow error codes are worded with; 6.4.0 the `follow.*` strings the follow buttons read for every verb and language; 6.1.0 the `oxy.auth.email.{startChange,change,remove}` and `oxy.auth.password.remove` the sign-in & security panels call. Keep one Core instance per app; raise this floor with the root catalogue when new runtime APIs are required.",
214
+ "//@oxy.so/core": "Core 7.9.0 supplies `deviceComparisonCode`, the short code `OxyDeviceSignIn` prints; 7.8.0 supplies the device sign-in request's `approvalUrl` and the `signin.device.*` strings `OxyDeviceSignIn` shows; 7.7.0 supplies the bounded native asset file adapter and phase progress installed by OxyProvider; 7.6.0 forwards guest locale and first-touch campaign metadata through signup; 7.3.0 supplies `users.lookupMany`, with which the account members screen fails (and retries) a profile read whose chunk failed instead of caching those members as handle-less; 7.2.0 supplies `assets.cachedUrl`, with which `useFileDownloadUrl` answers an already-resolved URL in its first render; 6.16.0 supplies `requireServerVerdict` and `onHolderRejected`, with which the cold boot checks a session it painted from the cache; 6.13.0 supplies the `accounts.settings.*` strings (picture, categories) the account settings speak in every language; 6.12.0 supplies `fileManagement.contentLost` and the `lost` file status a lost file is listed with; 6.11.0 supplies the `follow.errors.*` strings the follow error codes are worded with; 6.4.0 the `follow.*` strings the follow buttons read for every verb and language; 6.1.0 the `oxy.auth.email.{startChange,change,remove}` and `oxy.auth.password.remove` the sign-in & security panels call. Keep one Core instance per app; raise this floor with the root catalogue when new runtime APIs are required.",
215
215
  "//react-native": "React Native 0.81 to 0.88, React 19.1+ and Expo SDK 54 to 58. The floors are the Expo SDK 54 stack (react-native 0.81.6, react 19.1.4, react-native-web 0.21.4, expo 54.0.38 and the module versions its bundledNativeModules.json pins), which compat/expo-54 installs as an external consumer and checks on every CI run (`bun check.mjs`): every peer here admits that stack, services' published src typechecks against its types, and <OxyProvider> mounts and settles its cold boot on iOS (React Native 0.81), web (react-native-web 0.21) and react-native-macos 0.81 with the native modules macOS lacks absent. Astro, Oxy's browser, runs react-native-macos 0.81 (0.83 is its latest release), which is why the floor is not 0.85. The SDK 56 floors these replaced were the versions current when the ranges were first written, not measurements.",
216
216
  "peerDependencies": {
217
217
  "@expo/app-integrity": ">=0.1.10 <59.0.0",
218
218
  "@expo/vector-icons": "^15.0.3",
219
219
  "@oxy.so/bloom": ">=11.1.0",
220
- "@oxy.so/core": "^7.8.0",
220
+ "@oxy.so/core": "^7.9.0",
221
221
  "@react-native-async-storage/async-storage": "^2.0.0",
222
222
  "@react-native-community/netinfo": ">=11.4.1 <13.0.0",
223
223
  "@tanstack/query-async-storage-persister": "^5.101",
@@ -16,9 +16,15 @@
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
- * `signIn.authorizeCode`, both PUBLIC; nothing about the application is read out
21
- * of either here. The secret `sessionToken` never leaves the controller.
25
+ * `deviceComparisonCode(signIn.authorizeCode)` (`CE7F-B31F`), the same short
26
+ * code the approval page prints, both PUBLIC; nothing about the application is
27
+ * read out of either here. The secret `sessionToken` never leaves the controller.
22
28
  */
23
29
 
24
30
  import type React from 'react';
@@ -32,6 +38,7 @@ import { RiRefreshLine } from '@oxy.so/bloom/icons/RiRefreshLine';
32
38
  import { SpinnerIcon } from '@oxy.so/bloom/loading';
33
39
  import { useTheme } from '@oxy.so/bloom/theme';
34
40
  import { Text } from '@oxy.so/bloom/typography';
41
+ import { deviceComparisonCode } from '@oxy.so/core/session';
35
42
  import { useOxy } from '../context/oxyRuntimeContext';
36
43
  import { useI18n } from '../hooks/useI18n';
37
44
  import { useAccountDialogSnapshot } from '../hooks/accountDialogSnapshot';
@@ -43,6 +50,14 @@ const QR_FOREGROUND = '#000000';
43
50
  const DEFAULT_QR_SIZE = 280;
44
51
  /** The quiet zone around the symbol, as a fraction of its size. */
45
52
  const PLATE_PADDING_RATIO = 0.06;
53
+ /**
54
+ * The code and its hint, as fractions of the QR's edge: 28 and 13 points at
55
+ * the default 280. The nine characters of `CE7F-B31F` then span about half the
56
+ * symbol, large enough to read from across a room.
57
+ */
58
+ const CODE_SIZE_RATIO = 0.1;
59
+ const CODE_HINT_SIZE_RATIO = 0.046;
60
+ const CODE_HINT_LINE_HEIGHT = 1.4;
46
61
 
47
62
  export interface OxyDeviceSignInProps {
48
63
  /** Edge of the QR symbol in points. Defaults to 280. */
@@ -112,10 +127,6 @@ export const OxyDeviceSignIn: React.FC<OxyDeviceSignInProps> = ({ size = DEFAULT
112
127
 
113
128
  return (
114
129
  <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
130
  <View
120
131
  style={[styles.plate, { width: size + padding * 2, height: size + padding * 2, padding }]}
121
132
  >
@@ -123,11 +134,23 @@ export const OxyDeviceSignIn: React.FC<OxyDeviceSignInProps> = ({ size = DEFAULT
123
134
  </View>
124
135
  {showsCode && signIn.authorizeCode ? (
125
136
  <View style={styles.codeBlock}>
126
- <Text style={[styles.codeHint, { color: theme.colors.textSecondary }]}>
137
+ <Text
138
+ style={[
139
+ styles.codeHint,
140
+ {
141
+ color: theme.colors.textSecondary,
142
+ fontSize: Math.round(size * CODE_HINT_SIZE_RATIO),
143
+ lineHeight: Math.round(size * CODE_HINT_SIZE_RATIO * CODE_HINT_LINE_HEIGHT),
144
+ },
145
+ ]}
146
+ >
127
147
  {t('signin.device.codeHint')}
128
148
  </Text>
129
- <Code testID="device-sign-in-code" style={styles.code}>
130
- {signIn.authorizeCode}
149
+ <Code
150
+ testID="device-sign-in-code"
151
+ style={{ fontSize: Math.round(size * CODE_SIZE_RATIO) }}
152
+ >
153
+ {deviceComparisonCode(signIn.authorizeCode)}
131
154
  </Code>
132
155
  </View>
133
156
  ) : null}
@@ -140,17 +163,6 @@ const styles = StyleSheet.create({
140
163
  alignItems: 'center',
141
164
  gap: 16,
142
165
  },
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
166
  plate: {
155
167
  borderRadius: 16,
156
168
  backgroundColor: QR_PLATE_BG,
@@ -162,11 +174,6 @@ const styles = StyleSheet.create({
162
174
  gap: 4,
163
175
  },
164
176
  codeHint: {
165
- fontSize: 13,
166
- lineHeight: 18,
167
177
  textAlign: 'center',
168
178
  },
169
- code: {
170
- fontSize: 14,
171
- },
172
179
  });