ngwr 13.0.0 → 14.0.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/README.md +13 -6
- package/color-picker/styles/_index.scss +43 -5
- package/fesm2022/ngwr-alert.mjs +5 -5
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +11 -1
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +13 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +12 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +14 -3
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +4 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +15 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +51 -5
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +20 -1
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs +23 -7
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +89 -10
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +27 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +13 -3
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +101 -33
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +10 -2
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -13
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +480 -79
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +22 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +5 -2
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +30 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +24 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +8 -3
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +1 -1
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +52 -12
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +21 -4
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +9 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +63 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +28 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +150 -22
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs +11 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +474 -37
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +21 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +14 -7
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +20 -2
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs +73 -0
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -0
- package/fesm2022/ngwr-loading-bar.mjs +21 -32
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +63 -11
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +104 -14
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +36 -7
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +11 -10
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +65 -30
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +3 -2
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +2 -1
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +38 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +93 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +10 -3
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +2 -1
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +35 -4
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +35 -12
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +158 -0
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -0
- package/fesm2022/ngwr-tabs-testing.mjs +13 -11
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +104 -12
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +20 -1
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +1 -1
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +2 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +18 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +143 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs +10 -2
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +4 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/en.json +33 -6
- package/i18n/ru.json +33 -6
- package/llms-full.txt +20 -11
- package/llms.txt +47 -16
- package/mcp/catalog.js +3 -3
- package/mcp/providers.js +11 -0
- package/package.json +11 -3
- package/schematics/migrations/v13/index.js +101 -0
- package/schematics/migrations/v14/index.js +422 -0
- package/schematics/migrations.json +10 -0
- package/schematics/page/templates.js +1 -1
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/SKILL.md +4 -1
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +4 -0
- package/stepper/styles/_index.scss +19 -1
- package/textarea/styles/_index.scss +14 -6
- package/toast/styles/_index.scss +12 -4
- package/types/ngwr-alert.d.ts +3 -3
- package/types/ngwr-blur-text.d.ts +8 -0
- package/types/ngwr-breadcrumbs.d.ts +1 -0
- package/types/ngwr-button.d.ts +2 -2
- package/types/ngwr-calendar-testing.d.ts +21 -4
- package/types/ngwr-calendar.d.ts +37 -0
- package/types/ngwr-circular-text.d.ts +9 -0
- package/types/ngwr-collapse.d.ts +19 -15
- package/types/ngwr-color-picker-testing.d.ts +10 -4
- package/types/ngwr-color-picker.d.ts +70 -2
- package/types/ngwr-command-palette.d.ts +14 -0
- package/types/ngwr-context-menu.d.ts +1 -1
- package/types/ngwr-date-adapters-fns.d.ts +71 -29
- package/types/ngwr-date-picker-testing.d.ts +206 -185
- package/types/ngwr-date-picker.d.ts +7 -0
- package/types/ngwr-date.d.ts +143 -13
- package/types/ngwr-drag-drop.d.ts +19 -0
- package/types/ngwr-dropdown.d.ts +1 -1
- package/types/ngwr-event-calendar-testing.d.ts +12 -9
- package/types/ngwr-file-upload.d.ts +31 -3
- package/types/ngwr-fuzzy-text.d.ts +5 -0
- package/types/ngwr-i18n.d.ts +89 -7
- package/types/ngwr-icon-adapters-feather.d.ts +11 -0
- package/types/ngwr-icon.d.ts +42 -1
- package/types/ngwr-input-number.d.ts +1 -1
- package/types/ngwr-input-otp.d.ts +3 -0
- package/types/ngwr-input.d.ts +11 -4
- package/types/ngwr-knob-testing.d.ts +8 -4
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-loading-bar-router.d.ts +35 -0
- package/types/ngwr-loading-bar.d.ts +19 -9
- package/types/ngwr-mention.d.ts +13 -0
- package/types/ngwr-pagination-testing.d.ts +11 -10
- package/types/ngwr-pagination.d.ts +39 -10
- package/types/ngwr-popconfirm.d.ts +1 -1
- package/types/ngwr-popover.d.ts +1 -1
- package/types/ngwr-select.d.ts +65 -10
- package/types/ngwr-shiny-text.d.ts +1 -0
- package/types/ngwr-splitter-testing.d.ts +9 -4
- package/types/ngwr-squircle.d.ts +1 -1
- package/types/ngwr-statistic.d.ts +22 -2
- package/types/ngwr-table.d.ts +24 -5
- package/types/ngwr-tabs-router.d.ts +67 -0
- package/types/ngwr-tabs-testing.d.ts +12 -10
- package/types/ngwr-tabs.d.ts +103 -6
- package/types/ngwr-textarea.d.ts +9 -0
- package/types/ngwr-tree.d.ts +7 -0
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window-testing.d.ts +11 -3
- package/types/ngwr-window.d.ts +11 -4
- package/window/styles/_index.scss +1 -1
|
@@ -455,11 +455,44 @@ const ESCAPABLE = /[!-/:-@[-`{-~]/;
|
|
|
455
455
|
const SCHEME_RE = /^([a-z][a-z0-9+.-]*):/i;
|
|
456
456
|
const ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel', 'ftp']);
|
|
457
457
|
const DATA_IMAGE_RE = /^data:image\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=]+$/i;
|
|
458
|
-
|
|
458
|
+
// `[^<>\s]` and not `[^>\s]`: CommonMark defines autolink content as
|
|
459
|
+
// `[^<>\x00-\x20]*`, so `<` ends it by spec — and admitting it is what made this
|
|
460
|
+
// quadratic. On `<http://a<http://a<…` the scheme matches, the class swallows the
|
|
461
|
+
// rest of the document looking for `>`, then backtracks a character at a time, once
|
|
462
|
+
// per `<`. 160 KB took 1.7 s. `ANGLE_DEST_RE` and `EMAIL_AUTOLINK_RE` beside it
|
|
463
|
+
// already exclude `<`; this one was the outlier. The only input that now parses
|
|
464
|
+
// differently is `<http://a<b>`, which no other parser reads as a link either.
|
|
465
|
+
const AUTOLINK_RE = /^<((?:https?|mailto|tel):[^<>\s]+)>/i;
|
|
459
466
|
/** `<destination>` — markdown's way of putting a space in a URL. */
|
|
460
467
|
const ANGLE_DEST_RE = /^<([^<>]*)>(?:\s+["'(](.*)["')])?$/;
|
|
461
468
|
/** CommonMark's own cap on a link label, which is also what bounds the scan. */
|
|
462
469
|
const MAX_LABEL_LENGTH = 999;
|
|
470
|
+
/**
|
|
471
|
+
* How deep parentheses may nest inside `[a](…)` before the destination is refused
|
|
472
|
+
* outright — counted from the `(` that opens it, so 31 nested pairs inside.
|
|
473
|
+
*
|
|
474
|
+
* This is a bound on WORK, not on taste, and it is the only thing standing
|
|
475
|
+
* between a paragraph and a frozen tab. The destination scan walks forward for a
|
|
476
|
+
* balancing `)`, and an unclosed destination sends it to the end of the line; one
|
|
477
|
+
* `[a](x` costs nothing, but `'[a](x'.repeat(16384)` — 80 KB on a single line —
|
|
478
|
+
* makes every one of the 16384 openers walk the whole remainder, which measured
|
|
479
|
+
* 936 ms at 80 KB and 3.9 s at 160 KB, synchronously inside a `computed` during
|
|
480
|
+
* change detection. A `~4x` cost per doubling of the input: quadratic, on a
|
|
481
|
+
* component whose documented input is a comment or a model's output.
|
|
482
|
+
*
|
|
483
|
+
* The cap fixes it because a scan can only keep going by NOT finding its closer,
|
|
484
|
+
* and every later `[…](` it walks past contributes an unmatched `(` of its own —
|
|
485
|
+
* so after 32 of them the scan stops, no opener's walk can cover more than the
|
|
486
|
+
* next 32 openers, and the total is linear in the document. (A `)` that would
|
|
487
|
+
* bring the count back down is the closer, and ends the scan anyway.) The number
|
|
488
|
+
* is cmark's: `manual_scan_link_url` refuses at the same depth, for the same
|
|
489
|
+
* reason.
|
|
490
|
+
*
|
|
491
|
+
* What it costs: a destination with 32 or more nested `(` is no longer a link and
|
|
492
|
+
* renders as text. No URL looks like that — the deep end of the real world is a
|
|
493
|
+
* Wikipedia `..._(disambiguation)`, which is one pair.
|
|
494
|
+
*/
|
|
495
|
+
const MAX_DESTINATION_NESTING = 32;
|
|
463
496
|
const BARE_URL_RE = /^https?:\/\/[^\s<>[\]()]*(?:\([^\s<>()]*\)[^\s<>[\]()]*)*/i;
|
|
464
497
|
const EMAIL_AUTOLINK_RE = /^<([^\s@<>]+@[^\s@<>.]+\.[^\s@<>]+)>/;
|
|
465
498
|
/**
|
|
@@ -538,13 +571,26 @@ function inlines(source, depth, outer) {
|
|
|
538
571
|
}
|
|
539
572
|
}
|
|
540
573
|
if (char === '\n') {
|
|
541
|
-
// Two trailing spaces are markdown's hard break
|
|
542
|
-
//
|
|
543
|
-
//
|
|
544
|
-
//
|
|
545
|
-
//
|
|
546
|
-
//
|
|
547
|
-
|
|
574
|
+
// Two trailing spaces are markdown's hard break, and the question is asked
|
|
575
|
+
// of the SOURCE rather than of `text` — twice now, this one line has been
|
|
576
|
+
// where paragraph parsing went quadratic.
|
|
577
|
+
//
|
|
578
|
+
// `/[ ]{2,}$/.test(text)` was the first version: no start anchor, so it
|
|
579
|
+
// retries from every position of the accumulated paragraph. A CPU profile
|
|
580
|
+
// of a 161 KB document put 3306 ms of 3378 ms of total self-time in it.
|
|
581
|
+
// `text.endsWith(' ')` replaced it and is quadratic for a different
|
|
582
|
+
// reason: `text` is built by `+=`, so it is a rope, and every read of its
|
|
583
|
+
// tail flattens the whole thing — 160,000 short lines cost 1980 ms of
|
|
584
|
+
// copying against 7 ms for the same loop without the test. Ordinary prose
|
|
585
|
+
// reaches that shape; nothing has to be malformed.
|
|
586
|
+
//
|
|
587
|
+
// Reading `source` instead answers the same question in constant time, and
|
|
588
|
+
// it IS the same question: while `text` is non-empty its last character is
|
|
589
|
+
// always `source[i - 1]` (every branch that appends appends exactly the
|
|
590
|
+
// character it consumed), and when it is empty the preceding characters
|
|
591
|
+
// belong to a construct that just closed — none of which can end in a
|
|
592
|
+
// space, since a closing fence, `)`, `>` or emphasis marker is never one.
|
|
593
|
+
const hard = source[i - 1] === ' ' && source[i - 2] === ' ';
|
|
548
594
|
if (hard) {
|
|
549
595
|
text = text.replace(/[ ]+$/, '');
|
|
550
596
|
flush();
|
|
@@ -675,12 +721,13 @@ function codeSpanValue(raw) {
|
|
|
675
721
|
/**
|
|
676
722
|
* `[label](href "title")` starting at `source[at] === '['`.
|
|
677
723
|
*
|
|
678
|
-
*
|
|
724
|
+
* Three bounds, all load-bearing. The label scan stops at
|
|
679
725
|
* {@link MAX_LABEL_LENGTH}, which is CommonMark's own limit, and a scan that
|
|
680
726
|
* reaches the end of the source without meeting a single `]` records the fact in
|
|
681
727
|
* the context — from then on every later `[` answers in constant time. Without
|
|
682
728
|
* that, `'['.repeat(100000)` spent 8 seconds on the main thread, inside a
|
|
683
|
-
* `computed`.
|
|
729
|
+
* `computed`. The third is {@link MAX_DESTINATION_NESTING}, on the destination
|
|
730
|
+
* scan, and it is the one that makes the whole function linear.
|
|
684
731
|
*/
|
|
685
732
|
function matchLink(source, at, ctx) {
|
|
686
733
|
if (at >= ctx.noBracket.from)
|
|
@@ -738,8 +785,13 @@ function matchLink(source, at, ctx) {
|
|
|
738
785
|
i++;
|
|
739
786
|
continue;
|
|
740
787
|
}
|
|
741
|
-
if (char === '(')
|
|
788
|
+
if (char === '(') {
|
|
742
789
|
parens++;
|
|
790
|
+
// Giving up HERE is what makes the scan linear rather than quadratic — see
|
|
791
|
+
// {@link MAX_DESTINATION_NESTING}.
|
|
792
|
+
if (parens > MAX_DESTINATION_NESTING)
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
743
795
|
if (char === ')') {
|
|
744
796
|
parens--;
|
|
745
797
|
if (parens === 0) {
|