ngwr 10.2.1 → 11.1.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 +39 -19
- package/action-sheet/styles/_index.scss +4 -1
- package/anchor/styles/_index.scss +6 -5
- package/back-top/styles/_index.scss +6 -1
- package/blur-text/styles/_index.scss +13 -0
- package/button/styles/_index.scss +11 -6
- package/calendar/styles/_index.scss +11 -2
- package/carousel/styles/_index.scss +13 -2
- package/cascader/styles/_index.scss +5 -3
- package/circular-text/styles/_index.scss +2 -0
- package/collapse/styles/_index.scss +1 -1
- package/color-picker/styles/_index.scss +6 -1
- package/command-palette/styles/_index.scss +2 -1
- package/compare/styles/_index.scss +1 -2
- package/context-menu/styles/_index.scss +8 -2
- package/descriptions/styles/_index.scss +2 -2
- package/dialog/styles/_index.scss +7 -0
- package/drawer/styles/_index.scss +20 -1
- package/dropdown/styles/_index.scss +19 -5
- package/empty/styles/_index.scss +10 -0
- package/falling-text/styles/_index.scss +2 -1
- package/fesm2022/ngwr-action-sheet.mjs +13 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +40 -13
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +18 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +2 -2
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +31 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -2
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +30 -9
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +2 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +2 -2
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -4
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs +96 -0
- package/fesm2022/ngwr-button-testing.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +31 -14
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +20 -1
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +377 -0
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +67 -13
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs +534 -0
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +9 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +2 -2
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs +368 -0
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +134 -14
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +58 -8
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +103 -13
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +106 -0
- package/fesm2022/ngwr-config.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +94 -8
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +5 -1
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +11 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter.mjs +54 -8
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +73 -3
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +27 -9
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +89 -0
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngwr-directives.mjs +36 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +22 -5
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs +250 -0
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +10 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +24 -7
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +57 -10
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form-testing.mjs +451 -0
- package/fesm2022/ngwr-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +19 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +19 -5
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +50 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +48 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +23 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +306 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +35 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +36 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +102 -0
- package/fesm2022/ngwr-input-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +47 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +44 -8
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +21 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +33 -6
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +17 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs +516 -0
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-markdown.mjs +1492 -0
- package/fesm2022/ngwr-markdown.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +17 -6
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs +513 -0
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +10 -1
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +22 -7
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +19 -5
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +41 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +389 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +14 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +95 -17
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +316 -0
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +21 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +13 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs +392 -0
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
- package/fesm2022/ngwr-radio.mjs +10 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs +384 -0
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +37 -2
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs +512 -0
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select-testing.mjs +268 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +87 -16
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +2 -2
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +65 -12
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +478 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
- package/fesm2022/ngwr-slider.mjs +57 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +26 -6
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +37 -4
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +12 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +2 -2
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +2 -2
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +70 -9
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +24 -7
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +477 -0
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch-testing.mjs +77 -0
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +9 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +580 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +87 -14
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +617 -0
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tabs.mjs +38 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +238 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +32 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +101 -0
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +2 -2
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +61 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +538 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +45 -14
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +734 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +73 -7
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +5 -3
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +8 -0
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +7 -2
- package/gauge/styles/_index.scss +1 -1
- package/glitch-text/styles/_index.scss +4 -0
- package/i18n/en.json +48 -0
- package/i18n/ru.json +48 -0
- package/image-cropper/styles/_index.scss +13 -1
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +7 -2
- package/knob/styles/_index.scss +8 -1
- package/layout/styles/_index.scss +3 -3
- package/lightbox/styles/_index.scss +10 -2
- package/line-chart/styles/_index.scss +6 -0
- package/llms-full.txt +151 -4
- package/llms.txt +57 -8
- package/loading-bar/styles/_index.scss +1 -2
- package/markdown/styles/_index.scss +296 -0
- package/marquee/styles/_index.scss +12 -0
- package/mcp/api.js +512 -0
- package/mcp/catalog.js +157 -0
- package/mcp/server.js +273 -0
- package/mcp/tools.js +366 -0
- package/meter-group/styles/_index.scss +1 -1
- package/package.json +186 -35
- package/pagination/styles/_index.scss +6 -6
- package/popover/styles/_index.scss +37 -5
- package/rating/styles/_index.scss +10 -0
- package/result/styles/_index.scss +3 -1
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +12 -1
- package/select/styles/_index.scss +32 -10
- package/sidebar/styles/_index.scss +30 -5
- package/slider/styles/_index.scss +15 -0
- package/speed-dial/styles/_index.scss +20 -0
- package/split-text/styles/_index.scss +13 -0
- package/star-border/styles/_index.scss +2 -0
- package/stepper/styles/_index.scss +19 -3
- package/styles/_grid.scss +4 -4
- package/styles.scss +1 -0
- package/switch/styles/_index.scss +5 -3
- package/table/styles/_index.scss +25 -12
- package/tabs/styles/_index.scss +11 -1
- package/textarea/styles/_index.scss +5 -0
- package/theme/styles/_colors.scss +44 -15
- package/theme/styles/_dark.scss +35 -15
- package/theme/styles/_mixins.scss +3 -0
- package/timeline/styles/_index.scss +2 -2
- package/toast/styles/_index.scss +17 -8
- package/toolbar/styles/_index.scss +3 -3
- package/tour/styles/_index.scss +7 -1
- package/tree/styles/_index.scss +9 -5
- package/types/ngwr-action-sheet.d.ts +9 -1
- package/types/ngwr-affix.d.ts +7 -1
- package/types/ngwr-anchor.d.ts +8 -1
- package/types/ngwr-avatar.d.ts +13 -3
- package/types/ngwr-bar-chart.d.ts +16 -0
- package/types/ngwr-burger.d.ts +6 -2
- package/types/ngwr-button-testing.d.ts +85 -0
- package/types/ngwr-button.d.ts +26 -10
- package/types/ngwr-calendar-heatmap.d.ts +16 -2
- package/types/ngwr-calendar.d.ts +10 -0
- package/types/ngwr-carousel-testing.d.ts +257 -0
- package/types/ngwr-carousel.d.ts +20 -4
- package/types/ngwr-cascader-testing.d.ts +392 -0
- package/types/ngwr-checkbox-testing.d.ts +77 -0
- package/types/ngwr-checkbox.d.ts +7 -2
- package/types/ngwr-collapse-testing.d.ts +290 -0
- package/types/ngwr-color-picker.d.ts +20 -11
- package/types/ngwr-command-palette-testing.d.ts +437 -0
- package/types/ngwr-command-palette.d.ts +25 -2
- package/types/ngwr-compare.d.ts +50 -2
- package/types/ngwr-config.d.ts +176 -0
- package/types/ngwr-context-menu-testing.d.ts +401 -0
- package/types/ngwr-context-menu.d.ts +65 -17
- package/types/ngwr-counter.d.ts +6 -1
- package/types/ngwr-date-adapter-luxon.d.ts +26 -0
- package/types/ngwr-date-picker-testing.d.ts +518 -0
- package/types/ngwr-date-picker.d.ts +4 -0
- package/types/ngwr-dialog-testing.d.ts +79 -0
- package/types/ngwr-directives.d.ts +10 -1
- package/types/ngwr-donut-chart.d.ts +8 -1
- package/types/ngwr-drawer-testing.d.ts +196 -0
- package/types/ngwr-dropdown-testing.d.ts +202 -0
- package/types/ngwr-dropdown.d.ts +7 -1
- package/types/ngwr-empty.d.ts +19 -4
- package/types/ngwr-event-calendar.d.ts +26 -1
- package/types/ngwr-file-upload-testing.d.ts +194 -0
- package/types/ngwr-form-testing.d.ts +379 -0
- package/types/ngwr-form.d.ts +17 -0
- package/types/ngwr-gauge.d.ts +13 -1
- package/types/ngwr-image-cropper.d.ts +10 -0
- package/types/ngwr-input-number-testing.d.ts +226 -0
- package/types/ngwr-input-number.d.ts +29 -1
- package/types/ngwr-input-otp-testing.d.ts +299 -0
- package/types/ngwr-input-otp.d.ts +23 -2
- package/types/ngwr-input-testing.d.ts +84 -0
- package/types/ngwr-input.d.ts +20 -6
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-layout.d.ts +1 -0
- package/types/ngwr-lightbox.d.ts +17 -3
- package/types/ngwr-line-chart.d.ts +9 -2
- package/types/ngwr-markdown-testing.d.ts +462 -0
- package/types/ngwr-markdown.d.ts +534 -0
- package/types/ngwr-marquee.d.ts +12 -2
- package/types/ngwr-mention-testing.d.ts +359 -0
- package/types/ngwr-meta.d.ts +4 -2
- package/types/ngwr-meter-group.d.ts +11 -1
- package/types/ngwr-overlay.d.ts +33 -2
- package/types/ngwr-pagination-testing.d.ts +291 -0
- package/types/ngwr-pagination.d.ts +1 -0
- package/types/ngwr-popconfirm-testing.d.ts +235 -0
- package/types/ngwr-popconfirm.d.ts +31 -21
- package/types/ngwr-popover-testing.d.ts +221 -0
- package/types/ngwr-popover.d.ts +9 -0
- package/types/ngwr-pull-to-refresh.d.ts +7 -0
- package/types/ngwr-qr.d.ts +9 -1
- package/types/ngwr-radio-testing.d.ts +296 -0
- package/types/ngwr-radio.d.ts +8 -2
- package/types/ngwr-rating-testing.d.ts +291 -0
- package/types/ngwr-rating.d.ts +23 -0
- package/types/ngwr-segmented-testing.d.ts +401 -0
- package/types/ngwr-select-testing.d.ts +175 -0
- package/types/ngwr-select.d.ts +45 -4
- package/types/ngwr-sidebar.d.ts +17 -2
- package/types/ngwr-slider-testing.d.ts +329 -0
- package/types/ngwr-slider.d.ts +35 -1
- package/types/ngwr-sparkline.d.ts +12 -2
- package/types/ngwr-speed-dial.d.ts +17 -18
- package/types/ngwr-spinner.d.ts +8 -1
- package/types/ngwr-splitter.d.ts +24 -1
- package/types/ngwr-statistic.d.ts +12 -2
- package/types/ngwr-stepper-testing.d.ts +346 -0
- package/types/ngwr-switch-testing.d.ts +66 -0
- package/types/ngwr-switch.d.ts +7 -2
- package/types/ngwr-table-testing.d.ts +423 -0
- package/types/ngwr-table.d.ts +42 -0
- package/types/ngwr-tabs-testing.d.ts +470 -0
- package/types/ngwr-tabs.d.ts +9 -0
- package/types/ngwr-textarea-testing.d.ts +184 -0
- package/types/ngwr-textarea.d.ts +7 -2
- package/types/ngwr-toast-testing.d.ts +80 -0
- package/types/ngwr-tour.d.ts +27 -0
- package/types/ngwr-transfer-testing.d.ts +444 -0
- package/types/ngwr-transfer.d.ts +16 -1
- package/types/ngwr-tree-testing.d.ts +501 -0
- package/types/ngwr-tree.d.ts +33 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-virtual-scroll.d.ts +13 -1
- package/typewriter/styles/_index.scss +1 -1
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +32 -9
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
3
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
*
|
|
8
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
9
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
/** One coloured run inside a highlighted line of code. */
|
|
12
|
+
interface WrHighlightSpan {
|
|
13
|
+
readonly text: string;
|
|
14
|
+
/** Any CSS colour. Omitted spans inherit the code block's own colour. */
|
|
15
|
+
readonly color?: string;
|
|
16
|
+
readonly fontStyle?: 'italic' | 'bold' | 'underline';
|
|
17
|
+
}
|
|
18
|
+
/** One line of highlighted code, left to right. */
|
|
19
|
+
type WrHighlightLine = readonly WrHighlightSpan[];
|
|
20
|
+
/**
|
|
21
|
+
* Turns a fenced code block into coloured spans.
|
|
22
|
+
*
|
|
23
|
+
* **Spans, not an HTML string** — and that is the whole point of this signature.
|
|
24
|
+
* Every other Angular markdown renderer takes highlighted HTML and hands it to
|
|
25
|
+
* `[innerHTML]`, which needs `bypassSecurityTrustHtml` (Angular's own sanitizer
|
|
26
|
+
* strips the inline `style` attributes highlighting is made of, so the trust
|
|
27
|
+
* cannot be skipped). That puts a `dangerouslySetInnerHTML`-shaped hole in the
|
|
28
|
+
* one component whose entire input is untrusted text. Spans close it: `wr-markdown`
|
|
29
|
+
* renders each one as a real element with a bound `[style.color]`, so nothing in
|
|
30
|
+
* the pipeline is ever parsed as HTML and the library keeps its
|
|
31
|
+
* `unsafe-inline`-free CSP story.
|
|
32
|
+
*
|
|
33
|
+
* Return `null` for a language you do not handle — the block then renders as
|
|
34
|
+
* plain text, which is also what happens before an async highlighter resolves.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* // Shiki, whose `codeToTokens` already returns this shape.
|
|
39
|
+
* provideWrMarkdownHighlighter(async (code, language) => {
|
|
40
|
+
* const shiki = await getHighlighter();
|
|
41
|
+
* if (!language || !shiki.getLoadedLanguages().includes(language)) return null;
|
|
42
|
+
* const { tokens } = shiki.codeToTokens(code, { lang: language, theme: 'github-dark' });
|
|
43
|
+
* return tokens.map(line => line.map(t => ({ text: t.content, color: t.color })));
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
type WrMarkdownHighlighter = (code: string, language: string | null) => readonly WrHighlightLine[] | null | Promise<readonly WrHighlightLine[] | null>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @license
|
|
51
|
+
*
|
|
52
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
53
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
54
|
+
*/
|
|
55
|
+
/** Column alignment of a GFM table, `null` when the delimiter row said nothing. */
|
|
56
|
+
type WrMarkdownAlign = 'start' | 'center' | 'end' | null;
|
|
57
|
+
/** A run of inline content — the leaves of a paragraph, heading or table cell. */
|
|
58
|
+
type WrMarkdownInline = {
|
|
59
|
+
readonly kind: 'text';
|
|
60
|
+
readonly value: string;
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: 'code';
|
|
63
|
+
readonly value: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly kind: 'strong';
|
|
66
|
+
readonly children: readonly WrMarkdownInline[];
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'em';
|
|
69
|
+
readonly children: readonly WrMarkdownInline[];
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: 'del';
|
|
72
|
+
readonly children: readonly WrMarkdownInline[];
|
|
73
|
+
} | {
|
|
74
|
+
readonly kind: 'link';
|
|
75
|
+
readonly href: string;
|
|
76
|
+
readonly title: string | null;
|
|
77
|
+
readonly children: readonly WrMarkdownInline[];
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: 'image';
|
|
80
|
+
readonly src: string;
|
|
81
|
+
readonly alt: string;
|
|
82
|
+
readonly title: string | null;
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: 'break';
|
|
85
|
+
};
|
|
86
|
+
/** One `<li>`, including its task-list checkbox state. */
|
|
87
|
+
interface WrMarkdownListItem {
|
|
88
|
+
readonly children: readonly WrMarkdownBlock[];
|
|
89
|
+
/** `true` / `false` for `- [x]` / `- [ ]`, `null` for an ordinary item. */
|
|
90
|
+
readonly checked: boolean | null;
|
|
91
|
+
}
|
|
92
|
+
/** One table cell. */
|
|
93
|
+
interface WrMarkdownCell {
|
|
94
|
+
readonly inlines: readonly WrMarkdownInline[];
|
|
95
|
+
}
|
|
96
|
+
/** A block-level node. `kind` discriminates the union. */
|
|
97
|
+
type WrMarkdownBlock = {
|
|
98
|
+
readonly kind: 'heading';
|
|
99
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
100
|
+
readonly inlines: readonly WrMarkdownInline[];
|
|
101
|
+
/** Slug derived from the text, for anchoring. Empty when the heading has no text. */
|
|
102
|
+
readonly id: string;
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: 'paragraph';
|
|
105
|
+
readonly inlines: readonly WrMarkdownInline[];
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: 'code';
|
|
108
|
+
/** First word of the info string, lowercased. `null` for a bare fence. */
|
|
109
|
+
readonly language: string | null;
|
|
110
|
+
readonly code: string;
|
|
111
|
+
/**
|
|
112
|
+
* `false` while the closing fence has not arrived. Mid-stream that is the
|
|
113
|
+
* normal state, and it is what lets a consumer hold back a "copy" affordance
|
|
114
|
+
* until the block is whole.
|
|
115
|
+
*/
|
|
116
|
+
readonly closed: boolean;
|
|
117
|
+
} | {
|
|
118
|
+
readonly kind: 'quote';
|
|
119
|
+
readonly children: readonly WrMarkdownBlock[];
|
|
120
|
+
} | {
|
|
121
|
+
readonly kind: 'list';
|
|
122
|
+
readonly ordered: boolean;
|
|
123
|
+
/** First number of an ordered list; `1` for bullets. */
|
|
124
|
+
readonly start: number;
|
|
125
|
+
/** A tight list renders its items' paragraphs bare, as CommonMark specifies. */
|
|
126
|
+
readonly tight: boolean;
|
|
127
|
+
readonly items: readonly WrMarkdownListItem[];
|
|
128
|
+
} | {
|
|
129
|
+
readonly kind: 'table';
|
|
130
|
+
readonly head: readonly WrMarkdownCell[];
|
|
131
|
+
readonly rows: readonly (readonly WrMarkdownCell[])[];
|
|
132
|
+
readonly align: readonly WrMarkdownAlign[];
|
|
133
|
+
} | {
|
|
134
|
+
readonly kind: 'rule';
|
|
135
|
+
};
|
|
136
|
+
/** Options for {@link parseMarkdown}. */
|
|
137
|
+
interface WrMarkdownParseOptions {
|
|
138
|
+
/**
|
|
139
|
+
* Treat the source as a prefix of a longer document.
|
|
140
|
+
*
|
|
141
|
+
* An unterminated fence still produces a code block (so code appears as it
|
|
142
|
+
* arrives rather than after the closing fence), and a trailing half-typed
|
|
143
|
+
* `**`, `` ` `` or `[label](htt` is withheld instead of being rendered as
|
|
144
|
+
* literal punctuation that vanishes one chunk later.
|
|
145
|
+
*/
|
|
146
|
+
readonly streaming?: boolean;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Renders markdown — as DOM, not as HTML.
|
|
151
|
+
*
|
|
152
|
+
* Built for streamed model output, and useful for any markdown an app does not
|
|
153
|
+
* write itself: comments, release notes, a README. `[streaming]` makes a partial
|
|
154
|
+
* document render like a whole one (see {@link parseMarkdown}); without it the
|
|
155
|
+
* component is an ordinary renderer.
|
|
156
|
+
*
|
|
157
|
+
* **Raw HTML in the source is escaped, never rendered.** That is a deliberate
|
|
158
|
+
* limit rather than an unfinished feature: the input is untrusted by
|
|
159
|
+
* construction, `[innerHTML]` is how every comparable renderer takes it, and one
|
|
160
|
+
* `<img onerror>` is the whole cost of being wrong. Nothing here is parsed as
|
|
161
|
+
* HTML at any point — every text node is a text node and every `href` goes
|
|
162
|
+
* through Angular's URL sanitizer on top of this component's own scheme check.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```html
|
|
166
|
+
* <wr-markdown [value]="answer()" [streaming]="pending()" copyable />
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @see https://ngwr.dev/reference/components/markdown
|
|
170
|
+
*/
|
|
171
|
+
declare class WrMarkdown {
|
|
172
|
+
private readonly highlight;
|
|
173
|
+
private readonly destroyRef;
|
|
174
|
+
/** The markdown source. */
|
|
175
|
+
readonly value: _angular_core.InputSignal<string>;
|
|
176
|
+
/**
|
|
177
|
+
* The source is a prefix of a longer document.
|
|
178
|
+
*
|
|
179
|
+
* Turns on partial-safe parsing — an open fence renders as code, a half-typed
|
|
180
|
+
* `**bold` renders as bold rather than as asterisks — and marks the host with
|
|
181
|
+
* `.wr-markdown--streaming`, which paints a caret after the last block.
|
|
182
|
+
*
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
readonly streaming: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
186
|
+
/**
|
|
187
|
+
* Show a copy button on finished code blocks.
|
|
188
|
+
*
|
|
189
|
+
* Falls back to `markdown.copyable` from `provideWrConfig()`, then `false`.
|
|
190
|
+
* Only CLOSED blocks get one: mid-stream the code is not all there, and a
|
|
191
|
+
* button that copies half a snippet is worse than no button.
|
|
192
|
+
*/
|
|
193
|
+
readonly copyable: _angular_core.InputSignalWithTransform<boolean | null, BooleanInput>;
|
|
194
|
+
/**
|
|
195
|
+
* Where links open. `_blank` also sets `rel="noopener noreferrer"`, which is
|
|
196
|
+
* not optional — a target without it hands the opener to a page whose URL came
|
|
197
|
+
* from the document being rendered.
|
|
198
|
+
*
|
|
199
|
+
* Falls back to `markdown.linkTarget` from `provideWrConfig()`, then no target.
|
|
200
|
+
*/
|
|
201
|
+
readonly linkTarget: _angular_core.InputSignal<"_blank" | "_self" | null>;
|
|
202
|
+
/**
|
|
203
|
+
* Put a slugged `id` on every heading, so the document can be linked into.
|
|
204
|
+
*
|
|
205
|
+
* @default true
|
|
206
|
+
*/
|
|
207
|
+
readonly headingIds: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
208
|
+
/**
|
|
209
|
+
* Namespace for the generated heading ids, and for the in-document `#fragment`
|
|
210
|
+
* links that point at them.
|
|
211
|
+
*
|
|
212
|
+
* Defaults to `'user-content-'`, which is what GitHub emits for untrusted
|
|
213
|
+
* markdown, and for the same reason: without a namespace a document that
|
|
214
|
+
* happens to contain `# Search` renders `id="search"` and steals it from the
|
|
215
|
+
* page around it. That is not cosmetic — a `<label for="search">` silently
|
|
216
|
+
* stops labelling its input, and `getElementById` starts answering with a
|
|
217
|
+
* heading. Anchors written INSIDE the document keep working, because a bare
|
|
218
|
+
* `#fragment` href gets the same prefix.
|
|
219
|
+
*
|
|
220
|
+
* Set it to `''` for a document you author yourself and want clean anchors for.
|
|
221
|
+
*/
|
|
222
|
+
readonly headingIdPrefix: _angular_core.InputSignal<string>;
|
|
223
|
+
/** Accessible name of the copy button. Falls back to `markdown.copy`, then `'Copy code'`. */
|
|
224
|
+
readonly copyLabel: _angular_core.InputSignal<string | null>;
|
|
225
|
+
/** Announced after a successful copy. Falls back to `markdown.copied`, then `'Copied'`. */
|
|
226
|
+
readonly copiedLabel: _angular_core.InputSignal<string | null>;
|
|
227
|
+
/** Read out for a checked task item. Falls back to `markdown.taskDone`, then `'Done:'`. */
|
|
228
|
+
readonly taskDoneLabel: _angular_core.InputSignal<string | null>;
|
|
229
|
+
/** Read out for an unchecked task item. Falls back to `markdown.taskTodo`, then `'To do:'`. */
|
|
230
|
+
readonly taskTodoLabel: _angular_core.InputSignal<string | null>;
|
|
231
|
+
protected readonly resolvedCopyable: _angular_core.Signal<boolean>;
|
|
232
|
+
protected readonly resolvedLinkTarget: _angular_core.Signal<"_blank" | "_self" | null>;
|
|
233
|
+
protected readonly resolvedCopyLabel: _angular_core.Signal<string>;
|
|
234
|
+
protected readonly resolvedCopiedLabel: _angular_core.Signal<string>;
|
|
235
|
+
protected readonly resolvedTaskDoneLabel: _angular_core.Signal<string>;
|
|
236
|
+
protected readonly resolvedTaskTodoLabel: _angular_core.Signal<string>;
|
|
237
|
+
/**
|
|
238
|
+
* The parsed document, re-derived whenever the source changes.
|
|
239
|
+
*
|
|
240
|
+
* The WHOLE buffer, on every chunk — so a streamed answer costs O(n²) over the
|
|
241
|
+
* stream. That is a deliberate trade rather than an oversight: freezing the
|
|
242
|
+
* blocks before the last blank line would halve it, but a blank line is not a
|
|
243
|
+
* safe boundary in markdown (a list continues across one), and a wrong boundary
|
|
244
|
+
* corrupts the document rather than slowing it down. The constant is small —
|
|
245
|
+
* 300 KB of prose parses in ~120 ms — and `@for`'s `track $index` keeps the
|
|
246
|
+
* DOM cost proportional to what actually changed.
|
|
247
|
+
*/
|
|
248
|
+
protected readonly blocks: _angular_core.Signal<readonly WrMarkdownBlock[]>;
|
|
249
|
+
/** `rel` is bound, not hard-coded, so a same-tab link does not carry a pointless one. */
|
|
250
|
+
protected readonly linkRel: _angular_core.Signal<"noopener noreferrer" | null>;
|
|
251
|
+
/**
|
|
252
|
+
* Which code block last got copied, held by IDENTITY.
|
|
253
|
+
*
|
|
254
|
+
* Keyed on the code string, two blocks containing the same snippet both lit up
|
|
255
|
+
* — and a document that shows the same one-liner twice is ordinary. Block nodes
|
|
256
|
+
* are recreated whenever the source changes, so the confirmation also clears
|
|
257
|
+
* itself on the next chunk, which is the right lifetime for it.
|
|
258
|
+
*/
|
|
259
|
+
private readonly copiedBlock;
|
|
260
|
+
private copiedTimer;
|
|
261
|
+
constructor();
|
|
262
|
+
/**
|
|
263
|
+
* A newline as data rather than as template text.
|
|
264
|
+
*
|
|
265
|
+
* The lines of a highlighted block are separate elements, and what separates
|
|
266
|
+
* them on screen — and in a copy — is a real `\n` inside the `<pre>`. Angular
|
|
267
|
+
* strips whitespace-only text nodes from templates, so the character cannot be
|
|
268
|
+
* typed there; an interpolation of it survives.
|
|
269
|
+
*/
|
|
270
|
+
protected readonly newline: string;
|
|
271
|
+
/** Every code block in the document, nested ones included. */
|
|
272
|
+
private readonly codeBlocks;
|
|
273
|
+
/** Spans for a code block, or `null` to render it as plain text. */
|
|
274
|
+
protected linesOf(code: string, language: string | null): readonly WrHighlightLine[] | null;
|
|
275
|
+
protected isCopied(block: WrMarkdownBlock): boolean;
|
|
276
|
+
protected onCopied(block: WrMarkdownBlock): void;
|
|
277
|
+
/** A heading's id, namespaced, or `null` when there is nothing to link to. */
|
|
278
|
+
protected idOf(id: string): string | null;
|
|
279
|
+
/**
|
|
280
|
+
* A link's destination, with a bare fragment pointed at the namespaced id.
|
|
281
|
+
*
|
|
282
|
+
* Otherwise prefixing the headings would quietly break every `[see](#section)`
|
|
283
|
+
* the document writes about itself.
|
|
284
|
+
*/
|
|
285
|
+
protected hrefOf(href: string): string;
|
|
286
|
+
/**
|
|
287
|
+
* Casts for the recursive templates, and the reason they exist.
|
|
288
|
+
*
|
|
289
|
+
* Block content nests — a quote holds blocks, a list item holds blocks — so the
|
|
290
|
+
* template recurses through `ngTemplateOutlet` into itself. That is the one
|
|
291
|
+
* recursion shape which adds NO elements to the DOM; a recursive component
|
|
292
|
+
* would put a host element between `<ul>` and its `<li>`, which is invalid
|
|
293
|
+
* markup and breaks the list's accessibility tree. The cost is that
|
|
294
|
+
* `ngTemplateOutlet` context arrives as `any`, and `@switch` cannot narrow
|
|
295
|
+
* `any`. Casting it back at the top of each template restores full
|
|
296
|
+
* `strictTemplates` checking inside the loop, where the work happens.
|
|
297
|
+
*/
|
|
298
|
+
protected asBlocks(value: unknown): readonly WrMarkdownBlock[];
|
|
299
|
+
protected asInlines(value: unknown): readonly WrMarkdownInline[];
|
|
300
|
+
protected asItems(value: unknown): readonly WrMarkdownListItem[];
|
|
301
|
+
protected asCells(value: unknown): readonly WrMarkdownCell[];
|
|
302
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrMarkdown, never>;
|
|
303
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrMarkdown, "wr-markdown", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "copyable": { "alias": "copyable"; "required": false; "isSignal": true; }; "linkTarget": { "alias": "linkTarget"; "required": false; "isSignal": true; }; "headingIds": { "alias": "headingIds"; "required": false; "isSignal": true; }; "headingIdPrefix": { "alias": "headingIdPrefix"; "required": false; "isSignal": true; }; "copyLabel": { "alias": "copyLabel"; "required": false; "isSignal": true; }; "copiedLabel": { "alias": "copiedLabel"; "required": false; "isSignal": true; }; "taskDoneLabel": { "alias": "taskDoneLabel"; "required": false; "isSignal": true; }; "taskTodoLabel": { "alias": "taskTodoLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Turns fenced code into coloured spans, once per distinct block.
|
|
308
|
+
*
|
|
309
|
+
* **Two rules hold this together, and both were learned by breaking them.**
|
|
310
|
+
*
|
|
311
|
+
* `request` never READS a signal that it writes. An earlier version kept the
|
|
312
|
+
* answers in a signal and rebuilt it on every store, so the component's `effect` —
|
|
313
|
+
* which calls `request` — depended on the signal `request` wrote, and a document
|
|
314
|
+
* with more code blocks than the cache could hold looped for ever: evict,
|
|
315
|
+
* re-request, write, re-dirty. It did not merely spin, it starved the timers that
|
|
316
|
+
* were supposed to fail the test. The plain `Map` is the source of truth now, and a
|
|
317
|
+
* single `revision` counter is the only reactive part; nothing that writes reads it
|
|
318
|
+
* back.
|
|
319
|
+
*
|
|
320
|
+
* And `linesFor` is a pure read, safe to call while Angular renders. Asking a
|
|
321
|
+
* highlighter for a block means writing when the answer lands, and Angular refuses
|
|
322
|
+
* a signal write during rendering (NG0600) — so the component requests from an
|
|
323
|
+
* `effect`, which runs after the render, and the template only reads.
|
|
324
|
+
*
|
|
325
|
+
* Blocks appear as plain text first and gain colour when the answer arrives. For an
|
|
326
|
+
* async highlighter that is right rather than a compromise: a grammar engine loads
|
|
327
|
+
* WASM, and blocking on it would leave the reader with an empty box instead of
|
|
328
|
+
* their code.
|
|
329
|
+
*/
|
|
330
|
+
declare class WrMarkdownHighlight {
|
|
331
|
+
private readonly highlighter;
|
|
332
|
+
/** Language to code to answer. Insertion order is least-recently-rendered first. */
|
|
333
|
+
private readonly cache;
|
|
334
|
+
/** Bumped whenever an answer lands. Read by the template, never by a writer. */
|
|
335
|
+
private readonly revision;
|
|
336
|
+
private readonly generationSignal;
|
|
337
|
+
/**
|
|
338
|
+
* Bumped ONLY by {@link invalidate}. Read it in the effect that requests, so a
|
|
339
|
+
* consumer can force a re-ask.
|
|
340
|
+
*
|
|
341
|
+
* Separate from `revision` on purpose, and the separation is the whole safety
|
|
342
|
+
* argument. An effect that requests and also depends on the signal that storing
|
|
343
|
+
* an answer writes is the shape that looped for ever here once: past the cache
|
|
344
|
+
* limit, requesting stops being idempotent, so each pass writes, re-dirties the
|
|
345
|
+
* effect, evicts and requests again. Nothing inside `request` touches this one.
|
|
346
|
+
*/
|
|
347
|
+
readonly generation: _angular_core.Signal<number>;
|
|
348
|
+
/** Spans for one block, or `null` for plain text. Safe to call from a template. */
|
|
349
|
+
linesFor(code: string, language: string | null): readonly WrHighlightLine[] | null;
|
|
350
|
+
/**
|
|
351
|
+
* Forget every answer and ask again on the next render.
|
|
352
|
+
*
|
|
353
|
+
* The cache is keyed on `(language, code)` and nothing else, which is right for
|
|
354
|
+
* the streaming case it exists for and wrong for one real situation: a
|
|
355
|
+
* highlighter that returns per-theme colours serves whichever palette was
|
|
356
|
+
* current when a block was first rendered, for ever. There is no theme
|
|
357
|
+
* dimension to key on — the library cannot know what a highlighter's answer
|
|
358
|
+
* depends on — so the honest fix is to let the consumer say when it changed.
|
|
359
|
+
*
|
|
360
|
+
* A highlighter that returns theme-agnostic colours (CSS `light-dark()`, a
|
|
361
|
+
* custom property) needs none of this.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```ts
|
|
365
|
+
* const highlight = inject(WrMarkdownHighlight);
|
|
366
|
+
* effect(() => {
|
|
367
|
+
* theme.current();
|
|
368
|
+
* highlight.invalidate();
|
|
369
|
+
* });
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
invalidate(): void;
|
|
373
|
+
/**
|
|
374
|
+
* Ask for a block to be highlighted. Idempotent, and safe to call for every
|
|
375
|
+
* block on every change — call it from an `effect`, never from a template.
|
|
376
|
+
*/
|
|
377
|
+
request(code: string, language: string | null): void;
|
|
378
|
+
/**
|
|
379
|
+
* Fill in an answer and let the view know.
|
|
380
|
+
*
|
|
381
|
+
* Writes through the entry OBJECT rather than looking its key up again. The entry
|
|
382
|
+
* may have been evicted while the promise was in flight, in which case this
|
|
383
|
+
* writes to something nothing holds — which is the intended outcome. The version
|
|
384
|
+
* that re-inserted by key put entries back behind eviction's back, and the cache
|
|
385
|
+
* grew without a ceiling for exactly the async highlighter its limit exists for.
|
|
386
|
+
*/
|
|
387
|
+
private fill;
|
|
388
|
+
/** `Map` iterates in insertion order, and `linesFor` re-inserts on read. */
|
|
389
|
+
private evict;
|
|
390
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrMarkdownHighlight, never>;
|
|
391
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<WrMarkdownHighlight>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* @license
|
|
396
|
+
*
|
|
397
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
398
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
399
|
+
*/
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Markdown to a node tree. No HTML anywhere in the pipeline.
|
|
403
|
+
*
|
|
404
|
+
* **Why a parser in a component library that has one runtime dependency.** The
|
|
405
|
+
* alternative was `marked` or `markdown-it`, and both produce an HTML string —
|
|
406
|
+
* which then has to reach the DOM through `[innerHTML]`, which means Angular's
|
|
407
|
+
* sanitizer on the hot path of the one component whose input is untrusted by
|
|
408
|
+
* definition, and `bypassSecurityTrustHtml` the moment syntax highlighting is
|
|
409
|
+
* wanted. A node tree renders through ordinary Angular bindings instead: every
|
|
410
|
+
* text node is a text node, every `href` goes through `SecurityContext.URL`, and
|
|
411
|
+
* nothing is ever parsed as HTML. That is worth a parser.
|
|
412
|
+
*
|
|
413
|
+
* The second reason is streaming, which no general-purpose parser is built for.
|
|
414
|
+
* See {@link WrMarkdownParseOptions.streaming}: an open fence has to render as a
|
|
415
|
+
* code block, and a half-typed `**` must not flash on screen as literal
|
|
416
|
+
* asterisks.
|
|
417
|
+
*
|
|
418
|
+
* **The subset, stated rather than discovered.** ATX headings, paragraphs,
|
|
419
|
+
* fenced code, blockquotes, bullet / ordered / task lists (nested), GFM tables,
|
|
420
|
+
* thematic breaks; inline code, strong, emphasis, strikethrough, links, images,
|
|
421
|
+
* autolinks (bracketed and bare), hard breaks, backslash escapes.
|
|
422
|
+
*
|
|
423
|
+
* Deliberately absent, each for a reason:
|
|
424
|
+
*
|
|
425
|
+
* - **Raw HTML is escaped, never rendered.** A markdown renderer whose input is
|
|
426
|
+
* model output or user comments cannot pass `<img onerror>` through and call
|
|
427
|
+
* it a feature. `<div>` in equals `<div>` on screen, as text.
|
|
428
|
+
* - **Indented (four-space) code blocks.** In a document that also has nested
|
|
429
|
+
* lists, indentation is structural, and the ambiguity resolves against the
|
|
430
|
+
* author roughly every time: a wrapped list continuation becomes a code block.
|
|
431
|
+
* Fences are unambiguous, and fences are what generators emit.
|
|
432
|
+
* - **Setext headings** (`===` / `---` under a line). `---` is a thematic break
|
|
433
|
+
* here, always. The dual meaning is a well-known trap and the underline form
|
|
434
|
+
* is essentially unused in generated markdown.
|
|
435
|
+
* - **Reference links, footnotes, definition lists.** They need a second pass
|
|
436
|
+
* over a document that, mid-stream, is not all there yet.
|
|
437
|
+
*
|
|
438
|
+
* Two known deviations, kept rather than fixed, because the cure looked worse than
|
|
439
|
+
* the disease:
|
|
440
|
+
*
|
|
441
|
+
* - **A blank line inside a NESTED list marks the outer list loose too**, so
|
|
442
|
+
* `- a` / ` - b` / blank / ` - c` / `- d` double-spaces the outer items.
|
|
443
|
+
* CommonMark scopes looseness per list; telling the two apart needs to know
|
|
444
|
+
* which level a blank line belongs to, and the indentation alone does not say —
|
|
445
|
+
* content at the item's own indent can belong either to the item or to a
|
|
446
|
+
* sublist's sibling. The visible cost is spacing.
|
|
447
|
+
* - **An unmatched `[` is not linear.** The scan is bounded per opener
|
|
448
|
+
* ({@link MAX_LABEL_LENGTH}) and short-circuits once the source is known to hold
|
|
449
|
+
* no `]` at all, which took `'['.repeat(100000)` from 8s to 0.2s — but a
|
|
450
|
+
* document that is mostly open brackets with a `]` somewhere still pays per
|
|
451
|
+
* opener. Real prose does not have that shape.
|
|
452
|
+
*
|
|
453
|
+
* @param source markdown text
|
|
454
|
+
* @returns block nodes, ready to render
|
|
455
|
+
*/
|
|
456
|
+
declare function parseMarkdown(source: string, options?: WrMarkdownParseOptions): readonly WrMarkdownBlock[];
|
|
457
|
+
/**
|
|
458
|
+
* A URL safe to put in `href` / `src`, or `null` to render the link as plain text.
|
|
459
|
+
*
|
|
460
|
+
* Two layers, and both are wanted. Angular sanitizes `[href]` bindings itself,
|
|
461
|
+
* but its answer to a hostile URL is the string `unsafe:javascript:…` in a live
|
|
462
|
+
* anchor — a link that looks real, is announced as a link, and does nothing.
|
|
463
|
+
* Refusing it here means the label renders as text instead, which is honest.
|
|
464
|
+
*
|
|
465
|
+
* Whitespace and control characters are stripped before the scheme is read,
|
|
466
|
+
* because `java\nscript:` and `java script:` are the same URL to a browser and
|
|
467
|
+
* different strings to a naive check.
|
|
468
|
+
*/
|
|
469
|
+
declare function safeMarkdownUrl(raw: string, kind: 'link' | 'image'): string | null;
|
|
470
|
+
/** Inline markdown to nodes. */
|
|
471
|
+
declare function parseInlines(source: string, options?: WrMarkdownParseOptions): readonly WrMarkdownInline[];
|
|
472
|
+
/** Text content of an inline tree — for `alt` and for heading slugs. */
|
|
473
|
+
declare function plainText(inlines: readonly WrMarkdownInline[]): string;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @license
|
|
477
|
+
*
|
|
478
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
479
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
480
|
+
*/
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Give every `<wr-markdown>` in the app a syntax highlighter.
|
|
484
|
+
*
|
|
485
|
+
* The highlighter returns coloured SPANS, not HTML — see
|
|
486
|
+
* {@link WrMarkdownHighlighter} for why that signature is the one worth having.
|
|
487
|
+
* It may be async, and it may return `null` for languages it does not know; both
|
|
488
|
+
* render the block as plain text, which is also what server-side rendering
|
|
489
|
+
* produces, since a highlighter that resolves after prerender has already
|
|
490
|
+
* finished cannot contribute to the HTML.
|
|
491
|
+
*
|
|
492
|
+
* Pass `{ useFactory }` when the adapter needs to inject something. A highlighter
|
|
493
|
+
* is itself a function, so the factory cannot be detected by shape — hence the
|
|
494
|
+
* wrapper object rather than an overload that would guess.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```ts
|
|
498
|
+
* bootstrapApplication(App, {
|
|
499
|
+
* providers: [
|
|
500
|
+
* provideWrMarkdownHighlighter(shikiSpans),
|
|
501
|
+
*
|
|
502
|
+
* // Or, when the adapter has dependencies of its own:
|
|
503
|
+
* provideWrMarkdownHighlighter({
|
|
504
|
+
* useFactory: () => {
|
|
505
|
+
* const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
506
|
+
* return (code, language) => (isBrowser ? shikiSpans(code, language) : null);
|
|
507
|
+
* },
|
|
508
|
+
* }),
|
|
509
|
+
* ],
|
|
510
|
+
* });
|
|
511
|
+
* ```
|
|
512
|
+
*/
|
|
513
|
+
declare function provideWrMarkdownHighlighter(highlighter: WrMarkdownHighlighter | {
|
|
514
|
+
readonly useFactory: () => WrMarkdownHighlighter;
|
|
515
|
+
}): EnvironmentProviders;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* @license
|
|
519
|
+
*
|
|
520
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
521
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
522
|
+
*/
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* The app's syntax highlighter, or `null` for none.
|
|
526
|
+
*
|
|
527
|
+
* Defaults to `null` on purpose: highlighting means a grammar engine, and one of
|
|
528
|
+
* those in the library's dependency tree would be paid for by every consumer who
|
|
529
|
+
* renders a paragraph of text. Provide it with `provideWrMarkdownHighlighter()`.
|
|
530
|
+
*/
|
|
531
|
+
declare const WR_MARKDOWN_HIGHLIGHTER: InjectionToken<WrMarkdownHighlighter | null>;
|
|
532
|
+
|
|
533
|
+
export { WR_MARKDOWN_HIGHLIGHTER, WrMarkdown, WrMarkdownHighlight, parseInlines, parseMarkdown, plainText, provideWrMarkdownHighlighter, safeMarkdownUrl };
|
|
534
|
+
export type { WrHighlightLine, WrHighlightSpan, WrMarkdownAlign, WrMarkdownBlock, WrMarkdownCell, WrMarkdownHighlighter, WrMarkdownInline, WrMarkdownListItem, WrMarkdownParseOptions };
|
package/types/ngwr-marquee.d.ts
CHANGED
|
@@ -64,8 +64,18 @@ declare class WrMarquee {
|
|
|
64
64
|
readonly fadeOutColor: _angular_core.InputSignal<string>;
|
|
65
65
|
/** Scale individual items up on hover. @default false */
|
|
66
66
|
readonly scaleOnHover: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
67
|
-
/**
|
|
68
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Accessible name for the region. Falls back to `marquee.label`, then
|
|
69
|
+
* `'Marquee'`.
|
|
70
|
+
*/
|
|
71
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
72
|
+
protected readonly resolvedAriaLabel: _angular_core.Signal<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Name used for an item that links somewhere but carries no text of its own.
|
|
75
|
+
* Falls back to `marquee.link`, then `'link'` — a bare `'link'` in English was
|
|
76
|
+
* what a screen reader announced for every unlabelled logo in the strip.
|
|
77
|
+
*/
|
|
78
|
+
protected readonly resolvedLinkLabel: _angular_core.Signal<string>;
|
|
69
79
|
private readonly trackEl;
|
|
70
80
|
private readonly host;
|
|
71
81
|
private readonly destroyRef;
|