@descope/web-components-ui 3.27.4 → 3.27.6
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 +94 -10
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/9439.js +1 -1
- package/dist/umd/9439.js.map +1 -1
- package/dist/umd/9582.js +1 -1
- package/dist/umd/9582.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-switch-toggle-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js.map +1 -1
- package/dist/umd/descope-collapsible-container.js +1 -1
- package/dist/umd/descope-collapsible-container.js.map +1 -1
- package/dist/umd/descope-enriched-text.js +1 -1
- package/dist/umd/descope-enriched-text.js.map +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +3 -3
- package/dist/umd/descope-hybrid-field-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-passcode-index-js.js +1 -1
- package/dist/umd/descope-passcode-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-field.js +1 -1
- package/dist/umd/descope-text-field.js.map +1 -1
- package/dist/umd/descope-tooltip.js +1 -1
- package/dist/umd/descope-tooltip.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/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.map +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.map +1 -1
- package/package.json +46 -46
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4222,6 +4222,16 @@ const decodeHTML = (html) => {
|
|
|
4222
4222
|
|
|
4223
4223
|
const componentName$1s = getComponentName('enriched-text');
|
|
4224
4224
|
|
|
4225
|
+
const sanitizeConfig = {
|
|
4226
|
+
ADD_ATTR: ['target'],
|
|
4227
|
+
// Same scheme rule as markdown-it's link check, so custom-scheme links
|
|
4228
|
+
// (myapp://, slack://) keep working; DOMPurify's default list strips them.
|
|
4229
|
+
// `i` because markdown-it lowercases the URL before testing and DOMPurify does not.
|
|
4230
|
+
ALLOWED_URI_REGEXP:
|
|
4231
|
+
/^(?!(?:vbscript|javascript|file|data):)|^data:image\/(?:gif|png|jpeg|webp);/i,
|
|
4232
|
+
FORBID_TAGS: ['form', 'input', 'button', 'textarea', 'select', 'style'],
|
|
4233
|
+
};
|
|
4234
|
+
|
|
4225
4235
|
class EnrichedText extends createBaseClass$1({
|
|
4226
4236
|
componentName: componentName$1s,
|
|
4227
4237
|
baseSelector: ':host > div',
|
|
@@ -4417,8 +4427,10 @@ class EnrichedText extends createBaseClass$1({
|
|
|
4417
4427
|
console.warn('Not parsing invalid markdown token');
|
|
4418
4428
|
}
|
|
4419
4429
|
|
|
4430
|
+
html = DOMPurify.sanitize(html, sanitizeConfig);
|
|
4431
|
+
|
|
4420
4432
|
this.contentNode.innerHTML = html;
|
|
4421
|
-
this.contentNode.
|
|
4433
|
+
this.contentNode.firstElementChild?.setAttribute('part', 'content');
|
|
4422
4434
|
}
|
|
4423
4435
|
|
|
4424
4436
|
onReadOnlyChange(isReadOnly) {
|
|
@@ -9550,7 +9562,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
|
|
|
9550
9562
|
baseSelector: 'slot',
|
|
9551
9563
|
}) {
|
|
9552
9564
|
static get observedAttributes() {
|
|
9553
|
-
return ['collapsed', 'collapsible', 'text'];
|
|
9565
|
+
return ['collapsed', 'collapsible', 'text', 'aria-label'];
|
|
9554
9566
|
}
|
|
9555
9567
|
|
|
9556
9568
|
constructor() {
|
|
@@ -9661,7 +9673,31 @@ class RawCollapsibleContainer extends createBaseClass$1({
|
|
|
9661
9673
|
this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');
|
|
9662
9674
|
}
|
|
9663
9675
|
|
|
9676
|
+
// header acts as a disclosure button only when the container is collapsible
|
|
9677
|
+
updateHeaderA11y() {
|
|
9678
|
+
if (!this.isCollapsible) {
|
|
9679
|
+
['role', 'tabindex', 'aria-expanded', 'aria-label'].forEach((attr) =>
|
|
9680
|
+
this.header.removeAttribute(attr),
|
|
9681
|
+
);
|
|
9682
|
+
return;
|
|
9683
|
+
}
|
|
9684
|
+
this.header.setAttribute('role', 'button');
|
|
9685
|
+
this.header.setAttribute('tabindex', '0');
|
|
9686
|
+
this.header.setAttribute('aria-expanded', String(!this.isCollapsed));
|
|
9687
|
+
// without header text the button has no name, so fall back to a label
|
|
9688
|
+
if (this.getAttribute('text')) {
|
|
9689
|
+
this.header.removeAttribute('aria-label');
|
|
9690
|
+
} else {
|
|
9691
|
+
this.header.setAttribute(
|
|
9692
|
+
'aria-label',
|
|
9693
|
+
this.getAttribute('aria-label') || 'Toggle section',
|
|
9694
|
+
);
|
|
9695
|
+
}
|
|
9696
|
+
}
|
|
9697
|
+
|
|
9664
9698
|
collapse(animated = false) {
|
|
9699
|
+
// keep collapsed content out of the tab order and the a11y tree
|
|
9700
|
+
this.content.inert = true;
|
|
9665
9701
|
const final = () => {
|
|
9666
9702
|
this.content.style.maxHeight = '0px';
|
|
9667
9703
|
};
|
|
@@ -9673,6 +9709,7 @@ class RawCollapsibleContainer extends createBaseClass$1({
|
|
|
9673
9709
|
}
|
|
9674
9710
|
|
|
9675
9711
|
expand(animated = false) {
|
|
9712
|
+
this.content.inert = false;
|
|
9676
9713
|
const final = () => {
|
|
9677
9714
|
this.content.style.maxHeight = '';
|
|
9678
9715
|
};
|
|
@@ -9695,6 +9732,13 @@ class RawCollapsibleContainer extends createBaseClass$1({
|
|
|
9695
9732
|
if (!this.isCollapsible) return;
|
|
9696
9733
|
this.toggle();
|
|
9697
9734
|
});
|
|
9735
|
+
this.header.addEventListener('keydown', (e) => {
|
|
9736
|
+
if (!this.isCollapsible || (e.key !== 'Enter' && e.key !== ' ')) return;
|
|
9737
|
+
e.preventDefault();
|
|
9738
|
+
// the SDK submits the flow on any Enter that reaches the flow root
|
|
9739
|
+
e.stopPropagation();
|
|
9740
|
+
this.toggle();
|
|
9741
|
+
});
|
|
9698
9742
|
forwardAttrs(this, this.textComponent, {
|
|
9699
9743
|
includeAttrs: ['text-align', 'text-variant', 'text-mode'],
|
|
9700
9744
|
mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },
|
|
@@ -9709,8 +9753,14 @@ class RawCollapsibleContainer extends createBaseClass$1({
|
|
|
9709
9753
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
9710
9754
|
if (name === 'text') {
|
|
9711
9755
|
this.updateHeaderText();
|
|
9756
|
+
this.updateHeaderA11y();
|
|
9757
|
+
return;
|
|
9758
|
+
}
|
|
9759
|
+
if (name === 'aria-label') {
|
|
9760
|
+
this.updateHeaderA11y();
|
|
9712
9761
|
return;
|
|
9713
9762
|
}
|
|
9763
|
+
this.updateHeaderA11y();
|
|
9714
9764
|
const collapsed = this.isCollapsed && this.isCollapsible;
|
|
9715
9765
|
if (collapsed) {
|
|
9716
9766
|
this.collapse(this.#isComponentMounted);
|
|
@@ -14878,6 +14928,7 @@ const customMixin$b = (superclass) =>
|
|
|
14878
14928
|
renderCopyToClipboard(shouldRender) {
|
|
14879
14929
|
if (!shouldRender) {
|
|
14880
14930
|
this.icon?.remove();
|
|
14931
|
+
this.copyLiveRegion?.remove();
|
|
14881
14932
|
return;
|
|
14882
14933
|
}
|
|
14883
14934
|
|
|
@@ -14893,20 +14944,53 @@ const customMixin$b = (superclass) =>
|
|
|
14893
14944
|
style: 'cursor: initial',
|
|
14894
14945
|
};
|
|
14895
14946
|
|
|
14947
|
+
const setIconState = (config) => {
|
|
14948
|
+
Object.assign(this.icon, config);
|
|
14949
|
+
this.icon.setAttribute('aria-label', config.title);
|
|
14950
|
+
};
|
|
14951
|
+
|
|
14896
14952
|
this.icon = Object.assign(document.createElement('vaadin-icon'), {
|
|
14897
14953
|
slot: 'suffix',
|
|
14898
|
-
|
|
14954
|
+
tabIndex: 0,
|
|
14899
14955
|
});
|
|
14956
|
+
this.icon.setAttribute('role', 'button');
|
|
14957
|
+
setIconState(iconInitConfig);
|
|
14958
|
+
|
|
14959
|
+
// visually hidden live region, so screen readers announce the copy
|
|
14960
|
+
this.copyLiveRegion = document.createElement('span');
|
|
14961
|
+
this.copyLiveRegion.setAttribute('aria-live', 'polite');
|
|
14962
|
+
this.copyLiveRegion.style.cssText =
|
|
14963
|
+
'position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;';
|
|
14900
14964
|
|
|
14901
14965
|
this.baseElement.appendChild(this.icon);
|
|
14902
|
-
this.
|
|
14903
|
-
navigator.clipboard.writeText(this.value);
|
|
14904
|
-
Object.assign(this.icon, iconCopiedConfig);
|
|
14966
|
+
this.shadowRoot.appendChild(this.copyLiveRegion);
|
|
14905
14967
|
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14968
|
+
let resetTimer;
|
|
14969
|
+
const copy = async () => {
|
|
14970
|
+
try {
|
|
14971
|
+
await navigator.clipboard.writeText(this.value);
|
|
14972
|
+
} catch {
|
|
14973
|
+
return;
|
|
14974
|
+
}
|
|
14975
|
+
setIconState(iconCopiedConfig);
|
|
14976
|
+
this.copyLiveRegion.textContent = 'Copied';
|
|
14977
|
+
|
|
14978
|
+
// we want the icon to go back to the initial state after 3 seconds
|
|
14979
|
+
// a repeated copy restarts the countdown
|
|
14980
|
+
clearTimeout(resetTimer);
|
|
14981
|
+
resetTimer = setTimeout(() => {
|
|
14982
|
+
setIconState(iconInitConfig);
|
|
14983
|
+
this.copyLiveRegion.textContent = '';
|
|
14984
|
+
}, 3000);
|
|
14985
|
+
};
|
|
14986
|
+
|
|
14987
|
+
this.icon.addEventListener('click', copy);
|
|
14988
|
+
this.icon.addEventListener('keydown', (e) => {
|
|
14989
|
+
if (e.key !== 'Enter' && e.key !== ' ') return;
|
|
14990
|
+
e.preventDefault();
|
|
14991
|
+
// the SDK submits the flow on any Enter that reaches the flow root
|
|
14992
|
+
e.stopPropagation();
|
|
14993
|
+
copy();
|
|
14910
14994
|
});
|
|
14911
14995
|
}
|
|
14912
14996
|
|