@descope/web-components-ui 1.0.304 → 1.0.305

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -5,7 +5,7 @@ import '@vaadin/text-field';
5
5
  import '@vaadin/email-field';
6
6
  import '@vaadin/number-field';
7
7
  import '@vaadin/password-field';
8
- import { Remarkable } from 'remarkable';
8
+ import MarkdownIt from 'markdown-it';
9
9
  import '@vaadin/text-area';
10
10
  import '@vaadin/combo-box';
11
11
  import '@vaadin/grid';
@@ -3331,79 +3331,18 @@ const PasswordClass = compose(
3331
3331
 
3332
3332
  customElements.define(componentName$A, PasswordClass);
3333
3333
 
3334
- const ruleSet = {
3335
- custom: ['image'],
3336
- core: [
3337
- 'block',
3338
- 'inline',
3339
- 'abbr', // Parse abbreviation definitions, i.e. `*[abbr]: description`
3340
- 'abbr2', // Enclose abbreviations in <abbr> tags
3341
- 'references',
3342
- 'footnote_tail',
3343
- 'replacements', // Simple typographical replacements
3344
- 'smartquotes', // Convert straight quotation marks to typographic ones
3345
- ],
3346
- inline: [
3347
- 'text',
3348
- 'newline', // Proceess '\n'
3349
- 'backticks', // Parse backticks
3350
- 'del', // Process ~~deleted text~~
3351
- 'emphasis', // Process *this* and _that_
3352
- 'sub', // Process ~subscript~
3353
- 'sup', // Process ^superscript^
3354
- 'links', // Process [links](<to> "stuff")
3355
- 'escape', // Proceess escaped chars and hardbreaks
3356
- 'ins', // Process ++inserted text++
3357
- 'mark', // Process ==highlighted text==
3358
- 'footnote_inline', // Process inline footnotes (^[...])
3359
- 'footnote_ref', // Process footnote references ([^...])
3360
- 'autolink', // Process autolinks '<protocol:...>'
3361
- 'htmltag', // Process html tags
3362
- 'entity', // Process html entity - &#123;, &#xAF;, &quot;, ...
3363
- ],
3364
- block: [
3365
- 'code', // Code block (4 spaces padded)
3366
- 'fences', // fences (``` lang, ~~~ lang)
3367
- 'blockquote', // Block quotes
3368
- 'list',
3369
- 'heading', // heading (#, ##, ...)
3370
- 'paragraph',
3371
- 'hr', // Horizontal rule
3372
- 'footnote', // Process footnote reference list
3373
- 'lheading', // lheading (---, ===)
3374
- 'htmlblock', // HTML block
3375
- 'table', // GFM table, non-standard
3376
- 'deflist', // Definition lists
3377
- ],
3378
- };
3379
-
3380
3334
  const textRuleSet = {
3381
- core: ['block', 'inline'],
3382
- inline: [
3383
- 'text',
3384
- 'newline', // Proceess '\n'
3385
- 'backticks', // Parse backticks
3386
- 'del', // Process ~~deleted text~~
3387
- 'emphasis', // Process *this* and _that_
3388
- 'sub', // Process ~subscript~
3389
- 'sup', // Process ^superscript^
3390
- 'links', // Process [links](<to> "stuff")
3391
- 'escape', // Proceess escaped chars and hardbreaks
3392
- 'ins', // Process ++inserted text++
3393
- 'footnote_inline', // Process inline footnotes (^[...])
3394
- 'footnote_ref', // Process footnote references ([^...])
3395
- 'autolink', // Process autolinks '<protocol:...>'
3396
- ],
3397
- block: [
3398
- 'code', // Code block (4 spaces padded)
3399
- 'fences', // fences (``` lang, ~~~ lang)
3400
- 'blockquote', // Block quotes
3401
- 'list',
3402
- 'heading', // heading (#, ##, ...)
3403
- 'paragraph',
3404
- 'footnote', // Process footnote reference list
3405
- 'htmlblock', // HTML block
3406
- ],
3335
+ components: {
3336
+ core: {
3337
+ rules: ['block', 'inline'],
3338
+ },
3339
+ block: {
3340
+ rules: ['blockquote', 'code', 'heading', 'list', 'paragraph', 'list'],
3341
+ },
3342
+ inline: {
3343
+ rules: ['backticks', 'strikethrough', 'link', 'emphasis', 'strikethrough', 'newline', 'text'],
3344
+ },
3345
+ },
3407
3346
  };
3408
3347
 
3409
3348
  const componentName$z = getComponentName('enriched-text');
@@ -3471,30 +3410,13 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3471
3410
  }
3472
3411
  }
3473
3412
 
3474
- #disableAllRules() {
3475
- if (!this.processor) {
3476
- return;
3477
- }
3478
-
3479
- ruleSet?.core && this.processor.core.ruler.disable(ruleSet.core);
3480
- ruleSet?.inline && this.processor.inline.ruler.disable(ruleSet.inline);
3481
- ruleSet?.block && this.processor.block.ruler.disable(ruleSet.block);
3482
-
3483
- this.processor.renderer.rules.image = () => {
3484
- return '';
3485
- };
3486
- }
3487
-
3488
3413
  #enableCustomRules() {
3489
3414
  if (!this.processor) {
3490
3415
  return;
3491
3416
  }
3492
3417
 
3493
3418
  const customRuleSet = textRuleSet;
3494
-
3495
- customRuleSet?.core && this.processor?.core.ruler.enable(customRuleSet?.core);
3496
- customRuleSet?.inline && this.processor?.inline.ruler.enable(customRuleSet?.inline);
3497
- customRuleSet?.block && this.processor?.block.ruler.enable(customRuleSet?.block);
3419
+ this.processor.configure(customRuleSet || {});
3498
3420
 
3499
3421
  if (customRuleSet?.custom?.includes('image')) {
3500
3422
  this.processor.renderer.rules.image = this.#origImageRenderer;
@@ -3502,13 +3424,11 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3502
3424
  }
3503
3425
 
3504
3426
  #updateProcessorRules() {
3505
- this.#disableAllRules();
3506
3427
  this.#enableCustomRules();
3507
3428
  }
3508
3429
 
3509
3430
  #initProcessor() {
3510
- this.processor = new Remarkable();
3511
- this.#origImageRenderer = this.processor.renderer.rules.image;
3431
+ this.processor = new MarkdownIt();
3512
3432
  this.#updateProcessorRules();
3513
3433
  }
3514
3434
 
@@ -3524,7 +3444,7 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3524
3444
  let html = this.textContent;
3525
3445
 
3526
3446
  try {
3527
- const tokens = this.processor.parse(this.textContent);
3447
+ const tokens = this.processor.parse(this.textContent, { references: undefined });
3528
3448
  html = this.processor.renderer.render(tokens, { breaks: true });
3529
3449
  } catch (e) {
3530
3450
  // eslint-disable-next-line no-console