@descope/web-components-ui 1.107.0 → 1.109.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 +1520 -1376
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1482 -1337
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/2739.js +1 -1
- package/dist/umd/2739.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js.map +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js.map +1 -1
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.map +1 -1
- package/dist/umd/descope-grid-index-js.js +1 -1
- package/dist/umd/descope-grid-index-js.js.map +1 -1
- package/dist/umd/descope-hcaptcha-index-js.js +2 -0
- package/dist/umd/descope-hcaptcha-index-js.js.map +1 -0
- package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
- package/dist/umd/descope-multi-select-combo-box-index-js.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-number-field-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js.map +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-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/descope-radio-group-index-js.js +1 -1
- package/dist/umd/descope-radio-group-index-js.js.map +1 -1
- package/dist/umd/descope-scopes-list-index-js.js +1 -1
- package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js +1 -1
- package/dist/umd/descope-security-questions-setup-index-js.js.map +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
- package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js.map +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
- package/package.json +17 -17
- package/src/components/descope-hcaptcha/HcaptchaClass.js +137 -0
- package/src/components/descope-hcaptcha/index.js +5 -0
- package/src/helpers/themeHelpers/resetHelpers.js +0 -3
- package/src/index.cjs.js +1 -0
- package/src/index.js +1 -0
- package/src/theme/components/hcaptcha.js +14 -0
- package/src/theme/components/index.js +2 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@descope/web-components-ui",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.109.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/cjs/index.cjs.js",
|
6
6
|
"module": "dist/index.esm.js",
|
@@ -75,22 +75,22 @@
|
|
75
75
|
"libphonenumber-js": "^1.11.12",
|
76
76
|
"lodash.debounce": "4.0.8",
|
77
77
|
"lodash.merge": "4.6.2",
|
78
|
-
"@descope-ui/common": "0.0.
|
79
|
-
"@descope-ui/descope-button": "0.0.
|
80
|
-
"@descope-ui/descope-image": "0.0.
|
81
|
-
"@descope-ui/descope-icon": "0.0.
|
82
|
-
"@descope-ui/descope-text": "0.0.
|
83
|
-
"@descope-ui/descope-avatar": "0.0.
|
84
|
-
"@descope-ui/descope-combo-box": "0.1.
|
85
|
-
"@descope-ui/descope-autocomplete-field": "0.0.
|
86
|
-
"@descope-ui/descope-address-field": "0.0.
|
87
|
-
"@descope-ui/descope-timer": "0.0.
|
88
|
-
"@descope-ui/descope-timer-button": "0.0.
|
89
|
-
"@descope-ui/descope-password-strength": "0.0.
|
90
|
-
"@descope-ui/descope-collapsible-container": "0.0.
|
91
|
-
"@descope-ui/descope-recovery-codes": "0.0.
|
92
|
-
"@descope-ui/descope-link": "0.0.
|
93
|
-
"@descope-ui/descope-enriched-text": "0.0.
|
78
|
+
"@descope-ui/common": "0.0.17",
|
79
|
+
"@descope-ui/descope-button": "0.0.16",
|
80
|
+
"@descope-ui/descope-image": "0.0.9",
|
81
|
+
"@descope-ui/descope-icon": "0.0.15",
|
82
|
+
"@descope-ui/descope-text": "0.0.18",
|
83
|
+
"@descope-ui/descope-avatar": "0.0.18",
|
84
|
+
"@descope-ui/descope-combo-box": "0.1.8",
|
85
|
+
"@descope-ui/descope-autocomplete-field": "0.0.21",
|
86
|
+
"@descope-ui/descope-address-field": "0.0.20",
|
87
|
+
"@descope-ui/descope-timer": "0.0.15",
|
88
|
+
"@descope-ui/descope-timer-button": "0.0.17",
|
89
|
+
"@descope-ui/descope-password-strength": "0.0.12",
|
90
|
+
"@descope-ui/descope-collapsible-container": "0.0.16",
|
91
|
+
"@descope-ui/descope-recovery-codes": "0.0.5",
|
92
|
+
"@descope-ui/descope-link": "0.0.2",
|
93
|
+
"@descope-ui/descope-enriched-text": "0.0.2"
|
94
94
|
},
|
95
95
|
"overrides": {
|
96
96
|
"@vaadin/avatar": "24.3.4",
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import { injectStyle, observeChildren } from '@descope-ui/common/components-helpers';
|
2
|
+
import { draggableMixin, createStyleMixin, componentNameValidationMixin } from '../../mixins';
|
3
|
+
import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';
|
4
|
+
import { compose } from '../../helpers';
|
5
|
+
import { getComponentName } from '../../helpers/componentHelpers';
|
6
|
+
|
7
|
+
export const componentName = getComponentName('hcaptcha');
|
8
|
+
|
9
|
+
const observedAttributes = ['enabled', 'site-key'];
|
10
|
+
|
11
|
+
const BaseInputClass = createBaseInputClass({ componentName, baseSelector: ':host > div' });
|
12
|
+
class RawHcaptcha extends BaseInputClass {
|
13
|
+
static get observedAttributes() {
|
14
|
+
return observedAttributes.concat(BaseInputClass.observedAttributes || []);
|
15
|
+
}
|
16
|
+
|
17
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
18
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
19
|
+
if (oldValue !== newValue) {
|
20
|
+
if (attrName === 'enabled') {
|
21
|
+
this.toggleCaptchaEles(newValue === 'true');
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
constructor() {
|
27
|
+
super();
|
28
|
+
|
29
|
+
this.attachShadow({ mode: 'open' }).innerHTML = `
|
30
|
+
<div class="badge">
|
31
|
+
<span id="hcaptcha"></span>
|
32
|
+
<input id="hcaptcha-input" type="hidden" name="hcaptcha" required />
|
33
|
+
<img src="https://imgs.descope.com/connectors/templates/hcaptcha/hcaptcha-big.png" alt="hcaptcha"/>
|
34
|
+
</div>
|
35
|
+
<slot></slot>
|
36
|
+
`;
|
37
|
+
|
38
|
+
injectStyle(
|
39
|
+
`
|
40
|
+
:host {
|
41
|
+
display: inline-flex;
|
42
|
+
}
|
43
|
+
:host > div:not(.hidden) {
|
44
|
+
display: flex;
|
45
|
+
}
|
46
|
+
:host #hcaptcha-input {
|
47
|
+
display: none;
|
48
|
+
}
|
49
|
+
:host #hcaptcha .hcaptcha-logo {
|
50
|
+
height: 100%;
|
51
|
+
}
|
52
|
+
:host #hcaptcha {
|
53
|
+
width: 100%;
|
54
|
+
height: 100%;
|
55
|
+
}
|
56
|
+
:host img {
|
57
|
+
max-width: 100%;
|
58
|
+
max-height: 100%;
|
59
|
+
object-fit: contain;
|
60
|
+
}
|
61
|
+
.hidden {
|
62
|
+
display: none;
|
63
|
+
}
|
64
|
+
`,
|
65
|
+
this
|
66
|
+
);
|
67
|
+
|
68
|
+
this.captchaEle = this.shadowRoot.querySelector('#hcaptcha');
|
69
|
+
this.mockCaptchaEle = this.shadowRoot.querySelector('img');
|
70
|
+
this.badge = this.shadowRoot.querySelector('.badge');
|
71
|
+
this.inputElement = this.shadowRoot.querySelector('input');
|
72
|
+
}
|
73
|
+
|
74
|
+
init() {
|
75
|
+
super.init?.();
|
76
|
+
|
77
|
+
observeChildren(this, this.updatePreview.bind(this));
|
78
|
+
// avoid any possible conflicts with the inner input elements
|
79
|
+
this.inputElement.getValidity = null;
|
80
|
+
this.inputElement.checkValidity = null;
|
81
|
+
}
|
82
|
+
|
83
|
+
toggleCaptchaEles(enabled) {
|
84
|
+
if (enabled) {
|
85
|
+
this.captchaEle.style.display = '';
|
86
|
+
this.mockCaptchaEle.style.display = 'none';
|
87
|
+
} else {
|
88
|
+
this.captchaEle.style.display = 'none';
|
89
|
+
this.mockCaptchaEle.style.display = '';
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
updatePreview() {
|
94
|
+
this.toggleCaptchaEles(this.enabled);
|
95
|
+
}
|
96
|
+
|
97
|
+
getValidity() {
|
98
|
+
if (!this.inputElement.value) {
|
99
|
+
return { valueMissing: true };
|
100
|
+
}
|
101
|
+
|
102
|
+
return {};
|
103
|
+
}
|
104
|
+
|
105
|
+
checkValidity() {
|
106
|
+
return !!this.inputElement.value;
|
107
|
+
}
|
108
|
+
|
109
|
+
get siteKey() {
|
110
|
+
return this.getAttribute('site-key');
|
111
|
+
}
|
112
|
+
|
113
|
+
get enabled() {
|
114
|
+
return this.getAttribute('enabled') === 'true';
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
export const HcaptchaClass = compose(
|
119
|
+
createStyleMixin({
|
120
|
+
mappings: {
|
121
|
+
hostWidth: [{ selector: () => ':host', property: 'width' }],
|
122
|
+
hostDirection: { property: 'direction' },
|
123
|
+
verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],
|
124
|
+
horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],
|
125
|
+
maxHeight: [
|
126
|
+
{ selector: '>img', property: 'height' },
|
127
|
+
{ selector: '>#hcaptcha', property: 'height' },
|
128
|
+
],
|
129
|
+
maxWidth: [
|
130
|
+
{ selector: '>img', property: 'max-width' },
|
131
|
+
{ selector: '>hcaptcha', property: 'max-width' },
|
132
|
+
],
|
133
|
+
},
|
134
|
+
}),
|
135
|
+
draggableMixin,
|
136
|
+
componentNameValidationMixin
|
137
|
+
)(RawHcaptcha);
|
@@ -132,9 +132,6 @@ export const inputFloatingLabelStyle = () => {
|
|
132
132
|
:host([label-type="floating"]) {
|
133
133
|
position: relative;
|
134
134
|
}
|
135
|
-
:host([label-type="floating"][has-label]) [slot="label"] {
|
136
|
-
padding: 0;
|
137
|
-
}
|
138
135
|
:host([label-type="floating"][has-label]) > ::part(label) {
|
139
136
|
z-index: 1;
|
140
137
|
padding: 0;
|
package/src/index.cjs.js
CHANGED
@@ -52,5 +52,6 @@ export { SecurityQuestionsSetupClass } from './components/descope-security-quest
|
|
52
52
|
export { SecurityQuestionsVerifyClass } from './components/descope-security-questions-verify/SecurityQuestionsVerifyClass';
|
53
53
|
export { HybridFieldClass } from './components/descope-hybrid-field/HybridFieldClass';
|
54
54
|
export { AlertClass } from './components/descope-alert/AlertClass';
|
55
|
+
export { HcaptchaClass } from './components/descope-hcaptcha/HcaptchaClass';
|
55
56
|
|
56
57
|
/* INJECT_COMPONENTS */
|
package/src/index.js
CHANGED
@@ -42,6 +42,7 @@ export * from './components/descope-security-questions-setup';
|
|
42
42
|
export * from './components/descope-security-questions-verify';
|
43
43
|
export * from './components/descope-hybrid-field';
|
44
44
|
export * from './components/descope-alert';
|
45
|
+
export * from './components/descope-hcaptcha';
|
45
46
|
|
46
47
|
export {
|
47
48
|
globalsThemeToStyle,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { HcaptchaClass } from '../../components/descope-hcaptcha/HcaptchaClass';
|
2
|
+
|
3
|
+
const vars = HcaptchaClass.cssVarList;
|
4
|
+
|
5
|
+
const hcaptcha = {
|
6
|
+
enabled: {
|
7
|
+
false: {
|
8
|
+
[vars.maxHeight]: '70px',
|
9
|
+
},
|
10
|
+
},
|
11
|
+
};
|
12
|
+
|
13
|
+
export default hcaptcha;
|
14
|
+
export { vars };
|
@@ -52,6 +52,7 @@ import * as securityQuestionsSetup from './securityQuestionsSetup';
|
|
52
52
|
import * as securityQuestionsVerify from './securityQuestionsVerify';
|
53
53
|
import * as hybridField from './hybridField';
|
54
54
|
import * as alert from './alert';
|
55
|
+
import * as hcaptcha from './hcaptcha';
|
55
56
|
import * as autocompleteField from '@descope-ui/descope-autocomplete-field/theme';
|
56
57
|
import * as addressField from '@descope-ui/descope-address-field/theme';
|
57
58
|
import * as timer from '@descope-ui/descope-timer/theme';
|
@@ -123,6 +124,7 @@ const components = {
|
|
123
124
|
passwordStrength,
|
124
125
|
collapsibleContainer,
|
125
126
|
recoveryCodes,
|
127
|
+
hcaptcha,
|
126
128
|
};
|
127
129
|
|
128
130
|
const theme = Object.keys(components).reduce(
|