@descope/web-components-ui 3.26.4 → 3.27.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/dist/cjs/index.cjs.js +47 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +47 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-email-field.js +1 -1
- package/dist/umd/descope-email-field.js.map +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +2 -2
- package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
- package/dist/umd/descope-new-email.js +2 -2
- package/dist/umd/descope-new-email.js.map +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-password-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +46 -45
- package/src/components/descope-password/PasswordClass.js +2 -0
- package/stories/descope-email-field.stories.js +12 -0
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -18465,6 +18465,20 @@ const asciiPattern =
|
|
|
18465
18465
|
const unicodePattern =
|
|
18466
18466
|
"^[\\p{L}\\p{M}\\p{N}._%+'\\-]+@(?:[\\p{L}\\p{M}\\p{N}](?:[\\p{L}\\p{M}\\p{N}\\-]*[\\p{L}\\p{M}\\p{N}])?\\.)+[\\p{L}\\p{M}][\\p{L}\\p{M}\\p{N}\\-]+$";
|
|
18467
18467
|
|
|
18468
|
+
// The autocomplete grammar is ordered (section-*, shipping/billing, field name, webauthn) and on/off can't be
|
|
18469
|
+
// combined with a field name, so `email` takes the field name's place, before webauthn
|
|
18470
|
+
const emailVerificationAutocomplete = (autocomplete) => {
|
|
18471
|
+
const tokens = (autocomplete || '')
|
|
18472
|
+
.split(/\s+/)
|
|
18473
|
+
.filter(
|
|
18474
|
+
(token) => token && !['username', 'email', 'on', 'off'].includes(token),
|
|
18475
|
+
);
|
|
18476
|
+
const webauthn = tokens.indexOf('webauthn');
|
|
18477
|
+
tokens.splice(webauthn === -1 ? tokens.length : webauthn, 0, 'email');
|
|
18478
|
+
|
|
18479
|
+
return tokens.join(' ');
|
|
18480
|
+
};
|
|
18481
|
+
|
|
18468
18482
|
const componentName$U = getComponentName('email-field');
|
|
18469
18483
|
|
|
18470
18484
|
const defaultAutocomplete = 'username';
|
|
@@ -18513,6 +18527,38 @@ const customMixin$a = (superclass) =>
|
|
|
18513
18527
|
if (!this.validatesFormat) {
|
|
18514
18528
|
this.disableFormatValidation();
|
|
18515
18529
|
}
|
|
18530
|
+
|
|
18531
|
+
if (this.emailVerification) {
|
|
18532
|
+
this.enableEmailVerification();
|
|
18533
|
+
}
|
|
18534
|
+
}
|
|
18535
|
+
|
|
18536
|
+
// Read once, in `init`: descope-wc renders the screen html once
|
|
18537
|
+
get emailVerification() {
|
|
18538
|
+
return this.getAttribute('email-verification') === 'true';
|
|
18539
|
+
}
|
|
18540
|
+
|
|
18541
|
+
// Browser email verification needs the native input to be an email field (autocomplete `email`).
|
|
18542
|
+
// The host keeps its own autocomplete: descope-wc finds the passkey autofill field by an exact
|
|
18543
|
+
// `[autocomplete="webauthn"]` match on it, so changing the host would break passkeys
|
|
18544
|
+
enableEmailVerification() {
|
|
18545
|
+
const { baseElement } = this;
|
|
18546
|
+
const delegate = baseElement._delegateAttribute.bind(baseElement);
|
|
18547
|
+
// vaadin writes the native autocomplete only through here, so it writes ours
|
|
18548
|
+
baseElement._delegateAttribute = (name, value) =>
|
|
18549
|
+
delegate(
|
|
18550
|
+
name,
|
|
18551
|
+
name === 'autocomplete'
|
|
18552
|
+
? emailVerificationAutocomplete(value)
|
|
18553
|
+
: value,
|
|
18554
|
+
);
|
|
18555
|
+
baseElement._delegateAttribute('autocomplete', baseElement.autocomplete);
|
|
18556
|
+
|
|
18557
|
+
// the external input copies the host autocomplete once, when it is created
|
|
18558
|
+
this.externalInput?.setAttribute(
|
|
18559
|
+
'autocomplete',
|
|
18560
|
+
emailVerificationAutocomplete(this.getAttribute('autocomplete')),
|
|
18561
|
+
);
|
|
18516
18562
|
}
|
|
18517
18563
|
|
|
18518
18564
|
enableUnicode() {
|
|
@@ -20878,6 +20924,7 @@ const PasswordClass = compose$1(
|
|
|
20878
20924
|
${useHostExternalPadding(PasswordClass.cssVarList)}
|
|
20879
20925
|
${resetInputCursor('vaadin-password-field')}
|
|
20880
20926
|
${resetInputLabelPosition('vaadin-password-field')}
|
|
20927
|
+
${resetInputAutoFill('vaadin-password-field', PasswordClass.cssVarList)}
|
|
20881
20928
|
|
|
20882
20929
|
vaadin-password-field {
|
|
20883
20930
|
width: 100%;
|