@descope/web-components-ui 1.0.297 → 1.0.299
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 +32 -24
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +33 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/text-components-descope-enriched-text-index-js.js +1 -0
- package/package.json +1 -1
- package/src/components/text-components/{descope-markdown-content/MarkdownContentClass.js → descope-enriched-text/EnrichedTextClass.js} +26 -18
- package/src/components/text-components/descope-enriched-text/index.js +5 -0
- package/src/index.cjs.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/theme/components/{markdownContent.js → enrichedText.js} +4 -4
- package/src/theme/components/index.js +2 -2
- package/dist/umd/text-components-descope-markdown-content-index-js.js +0 -1
- package/src/components/text-components/descope-markdown-content/index.js +0 -5
- /package/src/components/text-components/{descope-markdown-content → descope-enriched-text}/helpers.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { NumberFieldClass } from './components/descope-number-field';
|
|
|
25
25
|
export { PasscodeClass } from './components/descope-passcode';
|
|
26
26
|
export { PasswordClass } from './components/descope-password';
|
|
27
27
|
export { TextClass } from './components/text-components/descope-text';
|
|
28
|
-
export {
|
|
28
|
+
export { EnrichedTextClass } from './components/text-components/descope-enriched-text';
|
|
29
29
|
export { TextAreaClass } from './components/descope-text-area';
|
|
30
30
|
export { TextFieldClass } from './components/descope-text-field';
|
|
31
31
|
export { ImageClass } from './components/descope-image';
|
package/dist/index.esm.js
CHANGED
|
@@ -3385,14 +3385,14 @@ const onClipboardCopy = (e) => {
|
|
|
3385
3385
|
e.preventDefault();
|
|
3386
3386
|
};
|
|
3387
3387
|
|
|
3388
|
-
const componentName$z = getComponentName('
|
|
3388
|
+
const componentName$z = getComponentName('enriched-text');
|
|
3389
3389
|
|
|
3390
|
-
const
|
|
3390
|
+
const BaseEnrichedTextClass = createBaseTextClass(componentName$z);
|
|
3391
3391
|
|
|
3392
|
-
const
|
|
3393
|
-
class
|
|
3392
|
+
const EnrichedTextMixin = (superclass) =>
|
|
3393
|
+
class EnrichedTextMixinClass extends superclass {
|
|
3394
3394
|
static get observedAttributes() {
|
|
3395
|
-
return ['disabled-rules', 'line-break'];
|
|
3395
|
+
return ['disabled-rules', 'line-break', 'readonly'];
|
|
3396
3396
|
}
|
|
3397
3397
|
|
|
3398
3398
|
get lineBreak() {
|
|
@@ -3405,7 +3405,7 @@ const markdownContentMixin = (superclass) =>
|
|
|
3405
3405
|
|
|
3406
3406
|
init() {
|
|
3407
3407
|
super.init();
|
|
3408
|
-
this.#
|
|
3408
|
+
this.#initProcessor();
|
|
3409
3409
|
this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
|
|
3410
3410
|
}
|
|
3411
3411
|
|
|
@@ -3414,28 +3414,32 @@ const markdownContentMixin = (superclass) =>
|
|
|
3414
3414
|
|
|
3415
3415
|
if (attrName === 'disabled-rules') {
|
|
3416
3416
|
if (newValue !== oldValue) {
|
|
3417
|
-
this.#
|
|
3417
|
+
this.#initProcessor(newValue);
|
|
3418
3418
|
this.#parseChildren();
|
|
3419
3419
|
}
|
|
3420
3420
|
}
|
|
3421
|
+
|
|
3422
|
+
if (attrName === 'readonly') {
|
|
3423
|
+
this.onReadOnlyChange(newValue !== null);
|
|
3424
|
+
}
|
|
3421
3425
|
}
|
|
3422
3426
|
|
|
3423
|
-
#
|
|
3424
|
-
this.
|
|
3427
|
+
#initProcessor() {
|
|
3428
|
+
this.processor = markdownit({ breaks: this.lineBreak }).disable(this.disabledRules);
|
|
3425
3429
|
}
|
|
3426
3430
|
|
|
3427
3431
|
#parseChildren() {
|
|
3428
3432
|
const node = this.textSlot.assignedNodes({ flatten: true })?.[0];
|
|
3429
3433
|
|
|
3430
3434
|
if (node && node.nodeType === Node.TEXT_NODE) {
|
|
3431
|
-
const tokens = this.
|
|
3432
|
-
const result = this.
|
|
3435
|
+
const tokens = this.processor.parse(node.textContent, { references: undefined });
|
|
3436
|
+
const result = this.processor.renderer.render(enrichTokens(tokens), {
|
|
3433
3437
|
breaks: this.lineBreak,
|
|
3434
3438
|
});
|
|
3435
3439
|
|
|
3436
3440
|
if (result !== node.textContent) {
|
|
3437
3441
|
const span = document.createElement('div');
|
|
3438
|
-
span.classList.add('
|
|
3442
|
+
span.classList.add('enriched-text');
|
|
3439
3443
|
// eslint-disable-next-line no-use-before-define
|
|
3440
3444
|
span.innerHTML = `${getStyleReset()}${result}`;
|
|
3441
3445
|
span.addEventListener('copy', onClipboardCopy);
|
|
@@ -3443,9 +3447,13 @@ const markdownContentMixin = (superclass) =>
|
|
|
3443
3447
|
}
|
|
3444
3448
|
}
|
|
3445
3449
|
}
|
|
3450
|
+
|
|
3451
|
+
onReadOnlyChange(val) {
|
|
3452
|
+
this.setAttribute('inert', val);
|
|
3453
|
+
}
|
|
3446
3454
|
};
|
|
3447
3455
|
|
|
3448
|
-
const
|
|
3456
|
+
const EnrichedTextClass = compose(
|
|
3449
3457
|
createStyleMixin({
|
|
3450
3458
|
mappings: {
|
|
3451
3459
|
hostWidth: { selector: () => ':host', property: 'width' },
|
|
@@ -3461,22 +3469,22 @@ const MarkdownContentClass = compose(
|
|
|
3461
3469
|
}),
|
|
3462
3470
|
draggableMixin,
|
|
3463
3471
|
componentNameValidationMixin,
|
|
3464
|
-
|
|
3472
|
+
EnrichedTextMixin,
|
|
3465
3473
|
hideWhenEmptyMixin
|
|
3466
|
-
)(
|
|
3474
|
+
)(BaseEnrichedTextClass);
|
|
3467
3475
|
|
|
3468
3476
|
function getStyleReset() {
|
|
3469
3477
|
return `
|
|
3470
3478
|
<style>
|
|
3471
|
-
.
|
|
3472
|
-
.
|
|
3473
|
-
margin-bottom: var(${
|
|
3479
|
+
.enriched-text > * { margin:0 }
|
|
3480
|
+
.enriched-text > *:not(:only-child):not(:last-child) {
|
|
3481
|
+
margin-bottom: var(${EnrichedTextClass.cssVarList.textLineHeight})
|
|
3474
3482
|
}
|
|
3475
3483
|
</style>
|
|
3476
3484
|
`;
|
|
3477
3485
|
}
|
|
3478
3486
|
|
|
3479
|
-
customElements.define(componentName$z,
|
|
3487
|
+
customElements.define(componentName$z, EnrichedTextClass);
|
|
3480
3488
|
|
|
3481
3489
|
const componentName$y = getComponentName('text-area');
|
|
3482
3490
|
|
|
@@ -11537,9 +11545,9 @@ var text$1 = /*#__PURE__*/Object.freeze({
|
|
|
11537
11545
|
});
|
|
11538
11546
|
|
|
11539
11547
|
const globalRefs$i = getThemeRefs(globals);
|
|
11540
|
-
const vars$q =
|
|
11548
|
+
const vars$q = EnrichedTextClass.cssVarList;
|
|
11541
11549
|
|
|
11542
|
-
const
|
|
11550
|
+
const EnrichedText = {
|
|
11543
11551
|
[vars$q.hostDirection]: globalRefs$i.direction,
|
|
11544
11552
|
|
|
11545
11553
|
[vars$q.fontSize]: globalRefs$i.typography.body1.size,
|
|
@@ -11614,9 +11622,9 @@ const markdownContent = {
|
|
|
11614
11622
|
},
|
|
11615
11623
|
};
|
|
11616
11624
|
|
|
11617
|
-
var
|
|
11625
|
+
var EnrichedText$1 = /*#__PURE__*/Object.freeze({
|
|
11618
11626
|
__proto__: null,
|
|
11619
|
-
default:
|
|
11627
|
+
default: EnrichedText,
|
|
11620
11628
|
vars: vars$q
|
|
11621
11629
|
});
|
|
11622
11630
|
|
|
@@ -12567,7 +12575,7 @@ const components = {
|
|
|
12567
12575
|
totpImage,
|
|
12568
12576
|
notpImage,
|
|
12569
12577
|
text: text$1,
|
|
12570
|
-
|
|
12578
|
+
EnrichedText: EnrichedText$1,
|
|
12571
12579
|
link: link$1,
|
|
12572
12580
|
divider: divider$1,
|
|
12573
12581
|
passcode: passcode$1,
|
|
@@ -12652,5 +12660,5 @@ const darkTheme = merge({}, defaultTheme, {
|
|
|
12652
12660
|
},
|
|
12653
12661
|
});
|
|
12654
12662
|
|
|
12655
|
-
export { AvatarClass, BadgeClass, ButtonClass, ButtonMultiSelectionGroupClass, ButtonSelectionGroupClass, CheckboxClass, ComboBoxClass, ContainerClass, DividerClass, EmailFieldClass, GridClass, ImageClass, LinkClass, LoaderLinearClass, LoaderRadialClass, LogoClass, MappingsFieldClass,
|
|
12663
|
+
export { AvatarClass, BadgeClass, ButtonClass, ButtonMultiSelectionGroupClass, ButtonSelectionGroupClass, CheckboxClass, ComboBoxClass, ContainerClass, DividerClass, EmailFieldClass, EnrichedTextClass, GridClass, ImageClass, LinkClass, LoaderLinearClass, LoaderRadialClass, LogoClass, MappingsFieldClass, ModalClass, MultiSelectComboBoxClass, NewPasswordClass, NotificationClass, NotpImageClass, NumberFieldClass, PasscodeClass, PasswordClass, PhoneFieldClass, PhoneFieldInputBoxClass, PolicyValidationClass, RecaptchaClass, SamlGroupMappingsClass, SwitchToggleClass, TextAreaClass, TextClass, TextFieldClass, TotpImageClass, UploadFileClass, UserAttributeClass, UserAuthMethodClass, componentsThemeManager, createComponentsTheme, darkTheme, defaultTheme, genColor, globalsThemeToStyle, themeToStyle, themeVars };
|
|
12656
12664
|
//# sourceMappingURL=index.esm.js.map
|