@protontech/autofill 0.0.33835493 → 0.0.35481761
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/features/feature.d.ts +13 -2
- package/features/feature.js +37 -17
- package/features/feature.spec.js +56 -3
- package/features/v1/abstract.field.d.ts +8377 -406
- package/features/v1/abstract.field.js +23 -23
- package/features/v1/abstract.form.d.ts +3428 -626
- package/features/v1/abstract.form.js +198 -199
- package/features/v1/field.email.d.ts +3421 -0
- package/features/v1/field.email.js +7 -7
- package/features/v1/field.otp.d.ts +71178 -0
- package/features/v1/field.otp.js +42 -42
- package/features/v1/field.password.d.ts +99166 -0
- package/features/v1/field.password.js +42 -42
- package/features/v1/field.username-hidden.d.ts +908 -0
- package/features/v1/field.username-hidden.js +7 -7
- package/features/v1/field.username.d.ts +42382 -0
- package/features/v1/field.username.js +11 -11
- package/features/v1/fields.sorted.gen.d.ts +1441 -0
- package/features/v1/fields.sorted.gen.js +344 -0
- package/features/v1/forms.sorted.gen.d.ts +734 -0
- package/features/v1/forms.sorted.gen.js +334 -0
- package/features/v1/index.d.ts +964 -84
- package/features/v1/index.js +9 -15
- package/features/v1/index.spec.js +34 -20
- package/models/perceptron/params/login-model.json +91 -91
- package/models/perceptron/params/new-password-model.json +21 -21
- package/models/perceptron/params/otp-model.json +29 -29
- package/models/perceptron/params/password-change-model.json +72 -72
- package/models/perceptron/params/password-model.json +23 -23
- package/models/perceptron/params/recovery-model.json +81 -81
- package/models/perceptron/params/register-model.json +99 -99
- package/models/perceptron/params/username-hidden-model.json +10 -10
- package/models/perceptron/params/username-model.json +7 -7
- package/models/random_forest/params/otp-model.json +306 -366
- package/package.json +3 -3
- package/rules/v1/index.js +2 -2
- package/scripts/gen-sorted-features.d.ts +1 -0
- package/scripts/gen-sorted-features.js +128 -0
- package/types/index.d.ts +2 -1
- package/utils/fathom.d.ts +1 -2
- package/utils/fathom.js +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { kEmailSelector } from "@protontech/autofill/constants/selectors";
|
|
2
2
|
import { feature, flattenFeatures } from "@protontech/autofill/features/feature";
|
|
3
|
-
import { formFeaturesComputer } from "@protontech/autofill/features/v1/
|
|
3
|
+
import { formFeaturesComputer } from "@protontech/autofill/features/v1/forms.sorted.gen";
|
|
4
4
|
import { any } from "@protontech/autofill/utils/combinators";
|
|
5
5
|
import { matchCCFieldCandidate } from "@protontech/autofill/utils/credit-card";
|
|
6
6
|
import { getFieldHaystacks } from "@protontech/autofill/utils/extract";
|
|
@@ -21,36 +21,36 @@ export const disabled = feature("disabled", { field }, (p) => p.field.disabled);
|
|
|
21
21
|
export const tabIndex = feature("tabIndex", { field }, (p) => p.field.tabIndex);
|
|
22
22
|
export const placeholder = feature("placeholder", { field }, (p) => p.field.placeholder);
|
|
23
23
|
export const typeValid = feature("typeValid", { fieldType: type }, (p) => p.type !== "hidden");
|
|
24
|
-
const parentFormFnode = feature("parentFormFnode", {}, (_, fnode) => getParentFormFnode(fnode));
|
|
25
|
-
const parentFormFeatures = feature("parentFormFeatures", { parentFormFnode }, (p) => {
|
|
24
|
+
export const parentFormFnode = feature("parentFormFnode", {}, (_, fnode) => getParentFormFnode(fnode));
|
|
25
|
+
export const parentFormFeatures = feature("parentFormFeatures", { parentFormFnode }, (p) => {
|
|
26
26
|
const parent = p.parentFormFnode;
|
|
27
27
|
if (parent && !parent.hasNoteFor("form"))
|
|
28
28
|
parent.setNoteFor("form", formFeaturesComputer.compute(parent));
|
|
29
29
|
return parent === null || parent === void 0 ? void 0 : parent.noteFor("form");
|
|
30
30
|
});
|
|
31
|
-
const parentFormInputIterator = feature("parentFormInputIterator", { parentFormFeatures }, (p) => { var _a, _b; return (_b = (_a = p.parentFormFeatures) === null || _a === void 0 ? void 0 : _a.
|
|
32
|
-
const formClassification = feature("formClassification", { parentFormFnode }, (p) => getFormClassification(p.parentFormFnode));
|
|
33
|
-
const isFormLogin = feature("isFormLogin", { formClassification }, (p) => p.formClassification.login);
|
|
34
|
-
const isFormRegister = feature("isFormRegister", { formClassification }, (p) => p.formClassification.register);
|
|
35
|
-
const isFormPasswordChange = feature("isFormPasswordChange", { formClassification }, (p) => p.formClassification.passwordChange);
|
|
36
|
-
const isFormRecovery = feature("isFormRecovery", { formClassification }, (p) => p.formClassification.recovery);
|
|
37
|
-
const isFormNoop = feature("isFormNoop", { formClassification }, (p) => p.formClassification.noop);
|
|
38
|
-
const autocomplete = feature("autocomplete", { field }, (p) => { var _a; return (_a = p.field.getAttribute("autocomplete")) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase(); });
|
|
39
|
-
const visible = feature("visible", { typeValid, field }, (p) => (p.typeValid ? isVisibleField(p.field) && isVisible(p.field, { opacity: false }) : false));
|
|
40
|
-
const flagHiddenFieldsSideEffect = feature("flagHiddenFieldsSideEffect", { typeValid, visible, field }, (p) => {
|
|
31
|
+
export const parentFormInputIterator = feature("parentFormInputIterator", { parentFormFeatures }, (p) => { var _a, _b; return (_b = (_a = p.parentFormFeatures) === null || _a === void 0 ? void 0 : _a.inputIterator) !== null && _b !== void 0 ? _b : null; });
|
|
32
|
+
export const formClassification = feature("formClassification", { parentFormFnode }, (p) => getFormClassification(p.parentFormFnode));
|
|
33
|
+
export const isFormLogin = feature("isFormLogin", { formClassification }, (p) => p.formClassification.login);
|
|
34
|
+
export const isFormRegister = feature("isFormRegister", { formClassification }, (p) => p.formClassification.register);
|
|
35
|
+
export const isFormPasswordChange = feature("isFormPasswordChange", { formClassification }, (p) => p.formClassification.passwordChange);
|
|
36
|
+
export const isFormRecovery = feature("isFormRecovery", { formClassification }, (p) => p.formClassification.recovery);
|
|
37
|
+
export const isFormNoop = feature("isFormNoop", { formClassification }, (p) => p.formClassification.noop);
|
|
38
|
+
export const autocomplete = feature("autocomplete", { field }, (p) => { var _a; return (_a = p.field.getAttribute("autocomplete")) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase(); });
|
|
39
|
+
export const visible = feature("visible", { typeValid, field }, (p) => (p.typeValid ? isVisibleField(p.field) && isVisible(p.field, { opacity: false }) : false));
|
|
40
|
+
export const flagHiddenFieldsSideEffect = feature("flagHiddenFieldsSideEffect", { typeValid, visible, field }, (p) => {
|
|
41
41
|
if (p.typeValid)
|
|
42
42
|
(p.visible ? removeHiddenFlag : flagAsHidden)(p.field);
|
|
43
43
|
});
|
|
44
|
-
const fieldHaystacks = feature("fieldHaystacks", { field }, (p) => getFieldHaystacks(p.field));
|
|
45
|
-
const attrs = feature("attrs", { fieldHaystacks }, (p) => p.fieldHaystacks.fieldAttrs);
|
|
46
|
-
const text = feature("text", { fieldHaystacks }, (p) => p.fieldHaystacks.fieldText);
|
|
47
|
-
const label = feature("label", { fieldHaystacks }, (p) => p.fieldHaystacks.labelText);
|
|
48
|
-
const searchField = feature("searchField", { visible, attrs, text, flagHiddenFieldsSideEffect }, (p) => p.visible && any(matchSearchAction)(p.attrs.concat(p.text)));
|
|
49
|
-
const isCC = feature("isCC", { field, visible }, (p) => matchCCFieldCandidate(p.field, { visible: p.visible }));
|
|
50
|
-
const isIdentity = feature("isIdentity", { isCC, field, visible, formClassification, searchField, fieldType: type }, (p) => !p.isCC && matchIdentityField(p.field, { visible: p.visible, form: p.formClassification, searchField: p.searchField, type: p.type }));
|
|
51
|
-
const prevInput = feature("prevInput", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.prev(p.field, "INPUT")) !== null && _b !== void 0 ? _b : null) : null); });
|
|
52
|
-
const prevField = feature("prevField", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.prev(p.field)) !== null && _b !== void 0 ? _b : null) : null); });
|
|
53
|
-
const nextField = feature("nextField", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.next(p.field)) !== null && _b !== void 0 ? _b : null) : null); });
|
|
44
|
+
export const fieldHaystacks = feature("fieldHaystacks", { field }, (p) => getFieldHaystacks(p.field));
|
|
45
|
+
export const attrs = feature("attrs", { fieldHaystacks }, (p) => p.fieldHaystacks.fieldAttrs);
|
|
46
|
+
export const text = feature("text", { fieldHaystacks }, (p) => p.fieldHaystacks.fieldText);
|
|
47
|
+
export const label = feature("label", { fieldHaystacks }, (p) => p.fieldHaystacks.labelText);
|
|
48
|
+
export const searchField = feature("searchField", { visible, attrs, text, flagHiddenFieldsSideEffect }, (p) => p.visible && any(matchSearchAction)(p.attrs.concat(p.text)));
|
|
49
|
+
export const isCC = feature("isCC", { field, visible }, (p) => matchCCFieldCandidate(p.field, { visible: p.visible }));
|
|
50
|
+
export const isIdentity = feature("isIdentity", { isCC, field, visible, formClassification, searchField, fieldType: type }, (p) => !p.isCC && matchIdentityField(p.field, { visible: p.visible, form: p.formClassification, searchField: p.searchField, type: p.type }));
|
|
51
|
+
export const prevInput = feature("prevInput", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.prev(p.field, "INPUT")) !== null && _b !== void 0 ? _b : null) : null); });
|
|
52
|
+
export const prevField = feature("prevField", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.prev(p.field)) !== null && _b !== void 0 ? _b : null) : null); });
|
|
53
|
+
export const nextField = feature("nextField", { typeValid, parentFormInputIterator, field }, (p) => { var _a, _b; return (p.typeValid ? ((_b = (_a = p.parentFormInputIterator) === null || _a === void 0 ? void 0 : _a.next(p.field)) !== null && _b !== void 0 ? _b : null) : null); });
|
|
54
54
|
export const fieldFeatures = flattenFeatures({
|
|
55
55
|
attrs,
|
|
56
56
|
autocomplete,
|