@r5n/otp-react-native 0.0.0-stage → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/LICENSE +21 -0
  3. package/README.md +227 -2
  4. package/lib/commonjs/Cell.js +140 -0
  5. package/lib/commonjs/Cell.js.map +1 -0
  6. package/lib/commonjs/OtpInput.js +129 -0
  7. package/lib/commonjs/OtpInput.js.map +1 -0
  8. package/lib/commonjs/accessibility.js +90 -0
  9. package/lib/commonjs/accessibility.js.map +1 -0
  10. package/lib/commonjs/clipboard.js +197 -0
  11. package/lib/commonjs/clipboard.js.map +1 -0
  12. package/lib/commonjs/dev.js +63 -0
  13. package/lib/commonjs/dev.js.map +1 -0
  14. package/lib/commonjs/hiddenInput.js +95 -0
  15. package/lib/commonjs/hiddenInput.js.map +1 -0
  16. package/lib/commonjs/index.js +53 -0
  17. package/lib/commonjs/index.js.map +1 -0
  18. package/lib/commonjs/legacy.js +218 -0
  19. package/lib/commonjs/legacy.js.map +1 -0
  20. package/lib/commonjs/managedProps.js +73 -0
  21. package/lib/commonjs/managedProps.js.map +1 -0
  22. package/lib/commonjs/package.json +1 -0
  23. package/lib/commonjs/types.js +45 -0
  24. package/lib/commonjs/types.js.map +1 -0
  25. package/lib/commonjs/useOtpController.js +70 -0
  26. package/lib/commonjs/useOtpController.js.map +1 -0
  27. package/lib/commonjs/useOtpInput.js +251 -0
  28. package/lib/commonjs/useOtpInput.js.map +1 -0
  29. package/lib/module/Cell.js +103 -0
  30. package/lib/module/Cell.js.map +1 -0
  31. package/lib/module/OtpInput.js +94 -0
  32. package/lib/module/OtpInput.js.map +1 -0
  33. package/lib/module/accessibility.js +49 -0
  34. package/lib/module/accessibility.js.map +1 -0
  35. package/lib/module/clipboard.js +156 -0
  36. package/lib/module/clipboard.js.map +1 -0
  37. package/lib/module/dev.js +22 -0
  38. package/lib/module/dev.js.map +1 -0
  39. package/lib/module/hiddenInput.js +54 -0
  40. package/lib/module/hiddenInput.js.map +1 -0
  41. package/lib/module/index.js +14 -0
  42. package/lib/module/index.js.map +1 -0
  43. package/lib/module/legacy.js +188 -0
  44. package/lib/module/legacy.js.map +1 -0
  45. package/lib/module/managedProps.js +32 -0
  46. package/lib/module/managedProps.js.map +1 -0
  47. package/lib/module/types.js +3 -0
  48. package/lib/module/types.js.map +1 -0
  49. package/lib/module/useOtpController.js +29 -0
  50. package/lib/module/useOtpController.js.map +1 -0
  51. package/lib/module/useOtpInput.js +216 -0
  52. package/lib/module/useOtpInput.js.map +1 -0
  53. package/lib/typescript/commonjs/package.json +1 -0
  54. package/lib/typescript/commonjs/src/Cell.d.ts +39 -0
  55. package/lib/typescript/commonjs/src/Cell.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/OtpInput.d.ts +12 -0
  57. package/lib/typescript/commonjs/src/OtpInput.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/accessibility.d.ts +39 -0
  59. package/lib/typescript/commonjs/src/accessibility.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/clipboard.d.ts +9 -0
  61. package/lib/typescript/commonjs/src/clipboard.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/dev.d.ts +13 -0
  63. package/lib/typescript/commonjs/src/dev.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/src/hiddenInput.d.ts +31 -0
  65. package/lib/typescript/commonjs/src/hiddenInput.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/src/index.d.ts +11 -0
  67. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/legacy.d.ts +78 -0
  69. package/lib/typescript/commonjs/src/legacy.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/src/managedProps.d.ts +5 -0
  71. package/lib/typescript/commonjs/src/managedProps.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/src/types.d.ts +262 -0
  73. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/src/useOtpController.d.ts +28 -0
  75. package/lib/typescript/commonjs/src/useOtpController.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/src/useOtpInput.d.ts +22 -0
  77. package/lib/typescript/commonjs/src/useOtpInput.d.ts.map +1 -0
  78. package/lib/typescript/module/src/Cell.d.ts +39 -0
  79. package/lib/typescript/module/src/Cell.d.ts.map +1 -0
  80. package/lib/typescript/module/src/OtpInput.d.ts +12 -0
  81. package/lib/typescript/module/src/OtpInput.d.ts.map +1 -0
  82. package/lib/typescript/module/src/accessibility.d.ts +39 -0
  83. package/lib/typescript/module/src/accessibility.d.ts.map +1 -0
  84. package/lib/typescript/module/src/clipboard.d.ts +9 -0
  85. package/lib/typescript/module/src/clipboard.d.ts.map +1 -0
  86. package/lib/typescript/module/src/dev.d.ts +13 -0
  87. package/lib/typescript/module/src/dev.d.ts.map +1 -0
  88. package/lib/typescript/module/src/hiddenInput.d.ts +31 -0
  89. package/lib/typescript/module/src/hiddenInput.d.ts.map +1 -0
  90. package/lib/typescript/module/src/index.d.ts +11 -0
  91. package/lib/typescript/module/src/index.d.ts.map +1 -0
  92. package/lib/typescript/module/src/legacy.d.ts +78 -0
  93. package/lib/typescript/module/src/legacy.d.ts.map +1 -0
  94. package/lib/typescript/module/src/managedProps.d.ts +5 -0
  95. package/lib/typescript/module/src/managedProps.d.ts.map +1 -0
  96. package/lib/typescript/module/src/types.d.ts +262 -0
  97. package/lib/typescript/module/src/types.d.ts.map +1 -0
  98. package/lib/typescript/module/src/useOtpController.d.ts +28 -0
  99. package/lib/typescript/module/src/useOtpController.d.ts.map +1 -0
  100. package/lib/typescript/module/src/useOtpInput.d.ts +22 -0
  101. package/lib/typescript/module/src/useOtpInput.d.ts.map +1 -0
  102. package/package.json +93 -4
  103. package/src/Cell.tsx +146 -0
  104. package/src/OtpInput.tsx +120 -0
  105. package/src/accessibility.ts +86 -0
  106. package/src/clipboard.ts +232 -0
  107. package/src/dev.ts +33 -0
  108. package/src/hiddenInput.ts +80 -0
  109. package/src/index.ts +38 -0
  110. package/src/legacy.tsx +320 -0
  111. package/src/managedProps.ts +29 -0
  112. package/src/types.ts +299 -0
  113. package/src/useOtpController.ts +58 -0
  114. package/src/useOtpInput.ts +313 -0
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/OtpInput.tsx
41
+ var exports_OtpInput = {};
42
+ __export(exports_OtpInput, {
43
+ OtpInput: () => OtpInput
44
+ });
45
+ module.exports = __toCommonJS(exports_OtpInput);
46
+ var import_react = require("react");
47
+ var import_react_native = require("react-native");
48
+ var import_Cell = require("./Cell.js");
49
+ var import_dev = require("./dev.js");
50
+ var import_managedProps = require("./managedProps.js");
51
+ var import_useOtpInput = require("./useOtpInput.js");
52
+ var jsx_runtime = require("react/jsx-runtime");
53
+ var styles = import_react_native.StyleSheet.create({
54
+ row: { alignItems: "center", gap: 8 }
55
+ });
56
+ var DEFAULT_PLACEHOLDER_COLOUR = "#8E8E93";
57
+ var OtpInput = import_react.forwardRef(function OtpInput2({
58
+ style,
59
+ cellStyle,
60
+ focusedCellStyle,
61
+ filledCellStyle,
62
+ errorCellStyle,
63
+ cellTextStyle,
64
+ placeholderTextColor = DEFAULT_PLACEHOLDER_COLOUR,
65
+ separatorStyle,
66
+ renderCell,
67
+ renderSeparator,
68
+ cellProps,
69
+ maxFontSizeMultiplier = 2,
70
+ ...options
71
+ }, ref) {
72
+ const otp = import_useOtpInput.useOtpInput(options);
73
+ const { focus, blur, clear, setValue, getValue, isFocused } = otp;
74
+ const inputRef = otp.inputProps.ref;
75
+ import_react.useImperativeHandle(ref, () => ({
76
+ focus,
77
+ blur,
78
+ clear,
79
+ setValue,
80
+ getValue,
81
+ isFocused,
82
+ get input() {
83
+ return inputRef.current;
84
+ }
85
+ }), [focus, blur, clear, setValue, getValue, isFocused, inputRef]);
86
+ const testID = otp.inputProps.testID;
87
+ const dark = import_react_native.useColorScheme() === "dark";
88
+ const blocked = import_dev.forbiddenKeys(cellProps, import_managedProps.CELL_MANAGED_PROPS).join(", ");
89
+ const safeCellProps = import_react.useMemo(() => import_dev.withoutKeys(cellProps, blocked === "" ? [] : blocked.split(", ")), [cellProps, blocked]);
90
+ import_react.useEffect(() => {
91
+ if (!__DEV__ || blocked === "")
92
+ return;
93
+ import_dev.warnOnce(`cellProps:${blocked}`, `cellProps.${blocked.split(", ").join(", cellProps.")} ignored: cells must stay hidden from ` + "touches and screen readers (C:S3-6).");
94
+ }, [blocked]);
95
+ return /* @__PURE__ */ jsx_runtime.jsxs(import_react_native.View, {
96
+ style: [styles.row, otp.rowStyle, style],
97
+ children: [
98
+ otp.cells.map((cell) => /* @__PURE__ */ jsx_runtime.jsxs(import_react.Fragment, {
99
+ children: [
100
+ cell.isFirstInGroup && cell.groupIndex > 0 ? /* @__PURE__ */ jsx_runtime.jsx(import_Cell.Separator, {
101
+ groupIndex: cell.groupIndex - 1,
102
+ style: separatorStyle,
103
+ renderSeparator
104
+ }) : null,
105
+ /* @__PURE__ */ jsx_runtime.jsx(import_Cell.Cell, {
106
+ ...cell,
107
+ testID: testID === undefined ? undefined : `${testID}-cell-${cell.index}`,
108
+ cellStyle,
109
+ filledCellStyle,
110
+ focusedCellStyle,
111
+ errorCellStyle,
112
+ cellTextStyle,
113
+ placeholderTextColor,
114
+ maxFontSizeMultiplier,
115
+ dark,
116
+ renderCell,
117
+ cellProps: safeCellProps
118
+ })
119
+ ]
120
+ }, cell.index)),
121
+ /* @__PURE__ */ jsx_runtime.jsx(import_react_native.TextInput, {
122
+ ...otp.inputProps
123
+ })
124
+ ]
125
+ });
126
+ });
127
+
128
+ //# debugId=5C3F7073C494763F64756E2164756E21
129
+ //# sourceMappingURL=OtpInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/OtpInput.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAPP;AAQ4D,IAA5D;AACgC,IAAhC;AACqD,IAArD;AACmC,IAAnC;AAE4B,IAA5B;AAAA;AAEA,IAAM,SAAS,+BAAW,OAAO;AAAA,EAC/B,KAAK,EAAE,YAAY,UAAU,KAAK,EAAE;AACtC,CAAC;AAED,IAAM,6BAA6B;AAW5B,IAAM,WAAW,wBAAuC,SAAS,SAAQ;AAAA,EAE5E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,uBAAuB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,KACrB;AAAA,GAEL,KACc;AAAA,EACd,MAAM,MAAM,+BAAY,OAAO;AAAA,EAC/B,QAAQ,OAAO,MAAM,OAAO,UAAU,UAAU,cAAc;AAAA,EAE9D,MAAM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AAAA;AAAA,SArBa,KAAK,KAsBlB,CACH;AAAA,sBAED,gBAAC,+BAAD;AAAA,WAAe,IAAI;AAAA,OAAY;AAAA;AAAA,GAC/B;AAAA,CAEL;","debugId":"5C3F7073C494763F64756E2164756E21","names":[]}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/accessibility.ts
41
+ var exports_accessibility = {};
42
+ __export(exports_accessibility, {
43
+ accessibilityValue: () => accessibilityValue,
44
+ announce: () => announce,
45
+ announcementText: () => announcementText,
46
+ defaultLabel: () => defaultLabel,
47
+ useAnnounceOnRise: () => useAnnounceOnRise,
48
+ valueText: () => valueText
49
+ });
50
+ module.exports = __toCommonJS(exports_accessibility);
51
+ var import_react = require("react");
52
+ var import_react_native = require("react-native");
53
+ var DEFAULT_COMPLETE = "Code complete";
54
+ var DEFAULT_ERROR = "Incorrect code";
55
+ var announcementText = (text, fallback) => {
56
+ if (text === undefined)
57
+ return fallback === "complete" ? DEFAULT_COMPLETE : DEFAULT_ERROR;
58
+ return text === false ? "" : text;
59
+ };
60
+ var defaultLabel = ({ length, charset }) => {
61
+ const unit = charset === "numeric" ? "digit" : charset === "alphabetic" ? "letter" : "character";
62
+ return `One-time code, ${length} ${unit}${length === 1 ? "" : "s"}`;
63
+ };
64
+ var valueText = (value, length, masked, error, texts) => {
65
+ const chars = Array.from(value);
66
+ const progress = texts?.progress?.(chars.length, length) ?? `${chars.length} of ${length} entered`;
67
+ const spoken = masked || chars.length === 0 ? progress : `${chars.join(" ")}, ${progress}`;
68
+ return error === "" ? spoken : `${error}, ${spoken}`;
69
+ };
70
+ var accessibilityValue = (value, length, masked, error, texts) => {
71
+ if (import_react_native.Platform.OS !== "android")
72
+ return { text: valueText(value, length, masked, error, texts) };
73
+ return { text: error };
74
+ };
75
+ var announce = (text) => {
76
+ if (text === "")
77
+ return;
78
+ import_react_native.AccessibilityInfo.announceForAccessibilityWithOptions(text, { queue: true });
79
+ };
80
+ var useAnnounceOnRise = (active, text) => {
81
+ const previous = import_react.useRef(active);
82
+ import_react.useEffect(() => {
83
+ if (active && !previous.current)
84
+ announce(text);
85
+ previous.current = active;
86
+ }, [active, text]);
87
+ };
88
+
89
+ //# debugId=42D48DDE6F5B3A2D64756E2164756E21
90
+ //# sourceMappingURL=accessibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/accessibility.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACkC,IAAlC;AAC4C,IAA5C;AAGA,IAAM,mBAAmB;AACzB,IAAM,gBAAgB;AAGf,IAAM,mBAAmB,CAC9B,MACA,aACW;AAAA,EACX,IAAI,SAAS;AAAA,IAAW,OAAO,aAAa,aAAa,mBAAmB;AAAA,EAC5E,OAAO,SAAS,QAAQ,KAAK;AAAA;AAQxB,IAAM,eAAe,GAAG,QAAQ,cAA0C;AAAA,EAC/E,MAAM,OAAO,YAAY,YAAY,UAAU,YAAY,eAAe,WAAW;AAAA,EACrF,OAAO,kBAAkB,UAAU,OAAO,WAAW,IAAI,KAAK;AAAA;AAQzD,IAAM,YAAY,CACvB,OACA,QACA,QACA,OACA,UACW;AAAA,EACX,MAAM,QAAQ,MAAM,KAAK,KAAK;AAAA,EAC9B,MAAM,WACJ,OAAO,WAAW,MAAM,QAAQ,MAAM,KAAK,GAAG,MAAM,aAAa;AAAA,EACnE,MAAM,SAAS,UAAU,MAAM,WAAW,IAAI,WAAW,GAAG,MAAM,KAAK,GAAG,MAAM;AAAA,EAChF,OAAO,UAAU,KAAK,SAAS,GAAG,UAAU;AAAA;AAcvC,IAAM,qBAAqB,CAChC,OACA,QACA,QACA,OACA,UACqB;AAAA,EACrB,IAAI,6BAAS,OAAO;AAAA,IAAW,OAAO,EAAE,MAAM,UAAU,OAAO,QAAQ,QAAQ,OAAO,KAAK,EAAE;AAAA,EAC7F,OAAO,EAAE,MAAM,MAAM;AAAA;AAQhB,IAAM,WAAW,CAAC,SAAuB;AAAA,EAC9C,IAAI,SAAS;AAAA,IAAI;AAAA,EACjB,sCAAkB,oCAAoC,MAAM,EAAE,OAAO,KAAK,CAAC;AAAA;AAItE,IAAM,oBAAoB,CAAC,QAAiB,SAAuB;AAAA,EACxE,MAAM,WAAW,oBAAO,MAAM;AAAA,EAC9B,uBAAU,MAAM;AAAA,IACd,IAAI,UAAU,CAAC,SAAS;AAAA,MAAS,SAAS,IAAI;AAAA,IAC9C,SAAS,UAAU;AAAA,KAClB,CAAC,QAAQ,IAAI,CAAC;AAAA;","debugId":"42D48DDE6F5B3A2D64756E2164756E21","names":[]}
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/clipboard.ts
41
+ var exports_clipboard = {};
42
+ __export(exports_clipboard, {
43
+ useClipboardAutofill: () => useClipboardAutofill
44
+ });
45
+ module.exports = __toCommonJS(exports_clipboard);
46
+ var import_otp_core = require("@r5n/otp-core");
47
+ var import_react = require("react");
48
+ var import_react_native = require("react-native");
49
+ var import_useOtpController = require("./useOtpController.js");
50
+ var usable = (provider) => provider && typeof provider.getString === "function" ? provider : undefined;
51
+ var describe = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
52
+ var readClipboard = async (provider) => {
53
+ if (provider.hasString && !await provider.hasString())
54
+ return "";
55
+ const text = await provider.getString();
56
+ return typeof text === "string" ? text : "";
57
+ };
58
+ var newMemory = () => ({
59
+ baseline: undefined,
60
+ seen: new Set,
61
+ warned: false,
62
+ read: undefined,
63
+ reads: 0
64
+ });
65
+ var READ_TIMEOUT_MS = 5000;
66
+ var FOLLOW_UP_MS = 800;
67
+ var warnOnce = (memory, message) => {
68
+ if (memory.warned)
69
+ return;
70
+ memory.warned = true;
71
+ console.warn(`@r5n/otp-react-native: ${message}`);
72
+ };
73
+ var startClipboardAutofill = (controller, getProvider, intervalMs, memory) => {
74
+ let stopped = false;
75
+ const timeout = Math.max(intervalMs ?? 0, READ_TIMEOUT_MS);
76
+ let followUp;
77
+ const cancelFollowUp = () => {
78
+ if (followUp === undefined)
79
+ return;
80
+ clearTimeout(followUp);
81
+ followUp = undefined;
82
+ };
83
+ const apply = (text) => {
84
+ const { value, isComplete, options } = controller.getSnapshot();
85
+ if (text === memory.baseline || memory.seen.has(text) || isComplete)
86
+ return;
87
+ memory.seen.add(text);
88
+ const code = import_otp_core.extractCode(text, options);
89
+ if (code === null || code === value)
90
+ return;
91
+ try {
92
+ controller.setValue(code);
93
+ } catch (error) {
94
+ setTimeout(() => {
95
+ throw error;
96
+ }, 0);
97
+ }
98
+ };
99
+ const check = (trigger) => {
100
+ if (trigger !== "follow-up")
101
+ cancelFollowUp();
102
+ const provider = getProvider();
103
+ if (stopped || !provider)
104
+ return;
105
+ const { isFocused, isComplete } = controller.getSnapshot();
106
+ if (memory.baseline !== undefined && (!isFocused || isComplete))
107
+ return;
108
+ const now = Date.now();
109
+ if (memory.read !== undefined) {
110
+ if (now - memory.read.startedAt < timeout)
111
+ return;
112
+ if (__DEV__) {
113
+ warnOnce(memory, `a clipboardAutofill read did not settle within ${timeout} ms; its result will be ` + "ignored and a new read starts.");
114
+ }
115
+ }
116
+ memory.reads += 1;
117
+ const id = memory.reads;
118
+ memory.read = { id, startedAt: now };
119
+ readClipboard(provider).then((text) => {
120
+ if (memory.read?.id !== id)
121
+ return;
122
+ memory.read = undefined;
123
+ if (memory.baseline === undefined) {
124
+ memory.baseline = text;
125
+ return;
126
+ }
127
+ if (stopped)
128
+ return;
129
+ const unknown = text === "" && (trigger === "focus" || trigger === "foreground");
130
+ if (!unknown) {
131
+ apply(text);
132
+ return;
133
+ }
134
+ if (!controller.getSnapshot().isFocused)
135
+ return;
136
+ followUp = setTimeout(() => {
137
+ followUp = undefined;
138
+ check("follow-up");
139
+ }, FOLLOW_UP_MS);
140
+ }, (error) => {
141
+ if (memory.read?.id !== id)
142
+ return;
143
+ memory.read = undefined;
144
+ if (__DEV__ && !stopped) {
145
+ warnOnce(memory, `clipboardAutofill could not read the clipboard (${describe(error)}); this check is ` + "skipped and the next one reads again.");
146
+ }
147
+ });
148
+ };
149
+ let wasFocused = controller.getSnapshot().isFocused;
150
+ const unsubscribe = controller.subscribe(() => {
151
+ const { isFocused } = controller.getSnapshot();
152
+ if (isFocused && !wasFocused)
153
+ check("focus");
154
+ if (!isFocused && wasFocused)
155
+ cancelFollowUp();
156
+ wasFocused = isFocused;
157
+ });
158
+ const appState = import_react_native.AppState.addEventListener("change", (state) => {
159
+ if (state === "active")
160
+ check("foreground");
161
+ });
162
+ const windowFocus = import_react_native.Platform.OS === "android" ? import_react_native.AppState.addEventListener("focus", () => check("foreground")) : undefined;
163
+ const timer = intervalMs !== undefined && Number.isFinite(intervalMs) && intervalMs > 0 ? setInterval(() => check("interval"), intervalMs) : undefined;
164
+ check("start");
165
+ return () => {
166
+ stopped = true;
167
+ cancelFollowUp();
168
+ unsubscribe();
169
+ appState.remove();
170
+ windowFocus?.remove();
171
+ if (timer !== undefined)
172
+ clearInterval(timer);
173
+ };
174
+ };
175
+ var useClipboardAutofill = (controller, clipboardAutofill) => {
176
+ const provider = usable(clipboardAutofill);
177
+ const latest = import_react.useRef(provider);
178
+ import_react.useLayoutEffect(() => {
179
+ latest.current = provider;
180
+ });
181
+ const memory = import_react.useRef(undefined);
182
+ const enabled = provider !== undefined;
183
+ const intervalMs = provider?.intervalMs;
184
+ import_react.useEffect(() => {
185
+ if (!enabled) {
186
+ memory.current = undefined;
187
+ return;
188
+ }
189
+ if (import_useOtpController.isDestroyed(controller))
190
+ return;
191
+ memory.current ??= newMemory();
192
+ return startClipboardAutofill(controller, () => latest.current, intervalMs, memory.current);
193
+ }, [controller, enabled, intervalMs]);
194
+ };
195
+
196
+ //# debugId=775776930E80E05764756E2164756E21
197
+ //# sourceMappingURL=clipboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/clipboard.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAgD,IAAhD;AACmD,IAAnD;AACmC,IAAnC;AAE4B,IAA5B;AAEA,IAAM,SAAS,CAAC,aACd,YAAY,OAAO,SAAS,cAAc,aAAa,WAAW;AAEpE,IAAM,WAAW,CAAC,UAChB,iBAAiB,QAAQ,GAAG,MAAM,SAAS,MAAM,YAAY,OAAO,KAAK;AAM3E,IAAM,gBAAgB,OAAO,aAAoD;AAAA,EAC/E,IAAI,SAAS,aAAa,CAAE,MAAM,SAAS,UAAU;AAAA,IAAI,OAAO;AAAA,EAChE,MAAM,OAAO,MAAM,SAAS,UAAU;AAAA,EACtC,OAAO,OAAO,SAAS,WAAW,OAAO;AAAA;AAmB3C,IAAM,YAAY,OAAwB;AAAA,EACxC,UAAU;AAAA,EACV,MAAM,IAAI;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,kBAAkB;AAOxB,IAAM,eAAe;AAMrB,IAAM,WAAW,CAAC,QAAyB,YAA0B;AAAA,EACnE,IAAI,OAAO;AAAA,IAAQ;AAAA,EACnB,OAAO,SAAS;AAAA,EAChB,QAAQ,KAAK,0BAA0B,SAAS;AAAA;AAqBlD,IAAM,yBAAyB,CAC7B,YACA,aACA,YACA,WACiB;AAAA,EACjB,IAAI,UAAU;AAAA,EACd,MAAM,UAAU,KAAK,IAAI,cAAc,GAAG,eAAe;AAAA,EACzD,IAAI;AAAA,EACJ,MAAM,iBAAiB,MAAY;AAAA,IACjC,IAAI,aAAa;AAAA,MAAW;AAAA,IAC5B,aAAa,QAAQ;AAAA,IACrB,WAAW;AAAA;AAAA,EAGb,M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AAA,IACpB,IAAI,UAAU;AAAA,MAAW,cAAc,KAAK;AAAA;AAAA;AASzC,IAAM,uBAAuB,CAClC,YACA,sBACS;AAAA,EACT,MAAM,WAAW,OAAO,iBAAiB;AAAA,EACzC,MAAM,SAAS,oBAAO,QAAQ;AAAA,EAC9B,6BAAgB,MAAM;AAAA,IACpB,OAAO,UAAU;AAAA,GAClB;AAAA,EACD,MAAM,SAAS,oBAAoC,SAAS;AAAA,EAC5D,MAAM,UAAU,aAAa;AAAA,EAC7B,MAAM,aAAa,UAAU;AAAA,EAC7B,uBAAU,MAAM;AAAA,IACd,IAAI,CAAC,SAAS;AAAA,MACZ,OAAO,UAAU;AAAA,MACjB;AAAA,IACF;AAAA,IAEA,IAAI,oCAAY,UAAU;AAAA,MAAG;AAAA,IAC7B,OAAO,YAAY,UAAU;AAAA,IAC7B,OAAO,uBAAuB,YAAY,MAAM,OAAO,SAAS,YAAY,OAAO,OAAO;AAAA,KACzF,CAAC,YAAY,SAAS,UAAU,CAAC;AAAA;","debugId":"775776930E80E05764756E2164756E21","names":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/dev.ts
41
+ var exports_dev = {};
42
+ __export(exports_dev, {
43
+ forbiddenKeys: () => forbiddenKeys,
44
+ warnOnce: () => warnOnce,
45
+ withoutKeys: () => withoutKeys
46
+ });
47
+ module.exports = __toCommonJS(exports_dev);
48
+ var warned = new Set;
49
+ var warnOnce = (key, message) => {
50
+ if (!__DEV__ || warned.has(key))
51
+ return;
52
+ warned.add(key);
53
+ console.warn(`@r5n/otp-react-native: ${message}`);
54
+ };
55
+ var forbiddenKeys = (props, forbidden) => props === undefined ? [] : forbidden.filter((key) => props[key] !== undefined);
56
+ var withoutKeys = (props, keys) => {
57
+ if (props === undefined || keys.length === 0)
58
+ return props;
59
+ return Object.fromEntries(Object.entries(props).filter(([key]) => !keys.includes(key)));
60
+ };
61
+
62
+ //# debugId=DE51AB233D39F08964756E2164756E21
63
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/dev.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,SAAS,IAAI;AAMZ,IAAM,WAAW,CAAC,KAAa,YAA0B;AAAA,EAC9D,IAAI,CAAC,WAAW,OAAO,IAAI,GAAG;AAAA,IAAG;AAAA,EACjC,OAAO,IAAI,GAAG;AAAA,EACd,QAAQ,KAAK,0BAA0B,SAAS;AAAA;AAI3C,IAAM,gBAAgB,CAC3B,OACA,cAEA,UAAU,YACN,CAAC,IACD,UAAU,OAAO,CAAC,QAAS,MAAkC,SAAS,SAAS;AAM9E,IAAM,cAAc,CACzB,OACA,SACkB;AAAA,EAClB,IAAI,UAAU,aAAa,KAAK,WAAW;AAAA,IAAG,OAAO;AAAA,EAErD,OAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,GAAG,CAAC,CAAC;AAAA;","debugId":"DE51AB233D39F08964756E2164756E21","names":[]}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/hiddenInput.ts
41
+ var exports_hiddenInput = {};
42
+ __export(exports_hiddenInput, {
43
+ HIDDEN_INPUT_STYLE: () => HIDDEN_INPUT_STYLE,
44
+ hiddenInputProps: () => hiddenInputProps
45
+ });
46
+ module.exports = __toCommonJS(exports_hiddenInput);
47
+ var import_react_native = require("react-native");
48
+ var HIDDEN_INPUT_STYLE = Object.freeze({
49
+ position: "absolute",
50
+ top: 0,
51
+ right: 0,
52
+ bottom: 0,
53
+ left: 0,
54
+ opacity: 0.02,
55
+ color: "transparent",
56
+ backgroundColor: "transparent",
57
+ fontSize: 1,
58
+ includeFontPadding: false
59
+ });
60
+ var hiddenInputProps = ({
61
+ options,
62
+ autoComplete,
63
+ keyboardType
64
+ }) => {
65
+ const autofill = autoComplete !== "off";
66
+ const shared = {
67
+ autoComplete: autofill ? "one-time-code" : "off",
68
+ keyboardType: keyboardType ?? (options.charset === "numeric" ? "number-pad" : "default"),
69
+ autoCorrect: false,
70
+ spellCheck: false,
71
+ autoCapitalize: options.casing === "upper" ? "characters" : "none",
72
+ allowFontScaling: false,
73
+ enterKeyHint: "done",
74
+ selectionColor: "transparent"
75
+ };
76
+ if (import_react_native.Platform.OS === "ios") {
77
+ return {
78
+ ...shared,
79
+ textContentType: autofill ? "oneTimeCode" : "none",
80
+ smartInsertDelete: false
81
+ };
82
+ }
83
+ if (import_react_native.Platform.OS === "android") {
84
+ return {
85
+ ...shared,
86
+ cursorColor: "transparent",
87
+ disableFullscreenUI: true,
88
+ ...autofill ? {} : { importantForAutofill: "no" }
89
+ };
90
+ }
91
+ return shared;
92
+ };
93
+
94
+ //# debugId=77C438CCF6F493D664756E2164756E21
95
+ //# sourceMappingURL=hiddenInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hiddenInput.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAC8D,IAA9D;AAcO,IAAM,qBAAgC,OAAO,OAAO;AAAA,EACzD,UAAU;AAAA,EACV,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,oBAAoB;AACtB,CAAC;AAgBM,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,MACwC;AAAA,EACxC,MAAM,WAAW,iBAAiB;AAAA,EAClC,MAAM,SAAyB;AAAA,IAE7B,cAAc,WAAW,kBAAkB;AAAA,IAC3C,cAAc,iBAAiB,QAAQ,YAAY,YAAY,eAAe;AAAA,IAC9E,aAAa;AAAA,IACb,YAAY;AAAA,IAGZ,gBAAgB,QAAQ,WAAW,UAAU,eAAe;AAAA,IAC5D,kBAAkB;AAAA,IAClB,cAAc;AAAA,IAEd,gBAAgB;AAAA,EAClB;AAAA,EACA,IAAI,6BAAS,OAAO,OAAO;AAAA,IACzB,OAAO;AAAA,SACF;AAAA,MACH,iBAAiB,WAAW,gBAAgB;AAAA,MAC5C,mBAAmB;AAAA,IACrB;AAAA,EACF;AAAA,EACA,IAAI,6BAAS,OAAO,WAAW;AAAA,IAC7B,OAAO;AAAA,SACF;AAAA,MACH,aAAa;AAAA,MAEb,qBAAqB;AAAA,SACjB,WAAW,CAAC,IAAI,EAAE,sBAAsB,KAAc;AAAA,IAC5D;AAAA,EACF;AAAA,EACA,OAAO;AAAA;","debugId":"77C438CCF6F493D664756E2164756E21","names":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toCommonJS = (from) => {
10
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
+ if (entry)
12
+ return entry;
13
+ entry = __defProp({}, "__esModule", { value: true });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(entry, key))
17
+ __defProp(entry, key, {
18
+ get: __accessProp.bind(from, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ __moduleCache.set(from, entry);
23
+ return entry;
24
+ };
25
+ var __moduleCache;
26
+ var __returnValue = (v) => v;
27
+ function __exportSetter(name, newValue) {
28
+ this[name] = __returnValue.bind(null, newValue);
29
+ }
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, {
33
+ get: all[name],
34
+ enumerable: true,
35
+ configurable: true,
36
+ set: __exportSetter.bind(all, name)
37
+ });
38
+ };
39
+
40
+ // src/index.ts
41
+ var exports_src = {};
42
+ __export(exports_src, {
43
+ OtpInput: () => import_OtpInput.OtpInput,
44
+ default: () => import_legacy.OtpInputs,
45
+ useOtpInput: () => import_useOtpInput.useOtpInput
46
+ });
47
+ module.exports = __toCommonJS(exports_src);
48
+ var import_legacy = require("./legacy.js");
49
+ var import_OtpInput = require("./OtpInput.js");
50
+ var import_useOtpInput = require("./useOtpInput.js");
51
+
52
+ //# debugId=EB4B3E54AF4A2D7E64756E2164756E21
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IALP;AAMyB,IAAzB;AAiB4B,IAA5B;","debugId":"EB4B3E54AF4A2D7E64756E2164756E21","names":[]}