ngwr 14.8.0 → 14.9.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 +66 -332
- package/alert/styles/_index.scss +10 -0
- package/avatar/styles/_index.scss +18 -7
- package/badge/styles/_index.scss +7 -0
- package/badge/styles/_tag.scss +7 -1
- package/button/styles/_index.scss +6 -0
- package/cascader/styles/_rules.scss +1 -1
- package/checkbox/styles/_index.scss +4 -0
- package/command-palette/styles/_index.scss +1 -1
- package/divider/styles/_index.scss +2 -0
- package/editor/styles/_index.scss +441 -0
- package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +28 -13
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +3 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +4 -4
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +3 -3
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +3 -3
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-confetti.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +21 -21
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +3 -3
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +15 -15
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +6 -6
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +9 -9
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor-testing.mjs +568 -0
- package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
- package/fesm2022/ngwr-editor.mjs +2601 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -0
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +6 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +3 -3
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +3 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form-testing.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +3 -3
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +3 -3
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +6 -6
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +29 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +29 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +29 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +34 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +29 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +29 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +29 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +29 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +29 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +29 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +29 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +29 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +29 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +29 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +29 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +29 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +29 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +29 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +29 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +29 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +29 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +29 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.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-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +3 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +3 -3
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +6 -6
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +798 -17
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +3 -3
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-media.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -21
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-platform.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +12 -12
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -3
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +12 -12
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +6 -6
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +6 -6
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +6 -6
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +3 -3
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +18 -18
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +6 -6
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +9 -9
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +3 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +3 -3
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +7 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.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 +3 -3
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +12 -12
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/form/styles/_index.scss +5 -0
- package/i18n/ar.json +29 -0
- package/i18n/cs.json +29 -0
- package/i18n/de.json +29 -0
- package/i18n/en.json +29 -0
- package/i18n/es.json +29 -0
- package/i18n/fr.json +29 -0
- package/i18n/he.json +29 -0
- package/i18n/hi.json +29 -0
- package/i18n/id.json +29 -0
- package/i18n/it.json +29 -0
- package/i18n/ja.json +29 -0
- package/i18n/ko.json +29 -0
- package/i18n/nl.json +29 -0
- package/i18n/pl.json +29 -0
- package/i18n/pt.json +29 -0
- package/i18n/ru.json +29 -0
- package/i18n/sv.json +29 -0
- package/i18n/tr.json +29 -0
- package/i18n/uk.json +29 -0
- package/i18n/vi.json +29 -0
- package/i18n/zh-TW.json +29 -0
- package/i18n/zh.json +29 -0
- package/input/styles/_index.scss +5 -1
- package/input-otp/styles/_index.scss +5 -5
- package/llms-full.txt +11 -1
- package/llms.txt +188 -132
- package/mcp/providers.js +2 -2
- package/mcp/server.js +1 -1
- package/overlay/styles/_arrow.scss +3 -0
- package/package.json +43 -2
- package/progress/styles/_index.scss +4 -0
- package/radio/styles/_index.scss +4 -1
- package/schematics/use/symbol-map.json +1 -0
- package/select/styles/_index.scss +3 -3
- package/sidebar/styles/_index.scss +10 -0
- package/skeleton/styles/_index.scss +3 -0
- package/skills/ngwr/SKILL.md +5 -5
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +3 -3
- package/styles.scss +1 -0
- package/table/styles/_index.scss +7 -0
- package/textarea/styles/_index.scss +12 -3
- package/theme/styles/_colors.scss +39 -13
- package/theme/styles/_contrast.scss +9 -7
- package/toast/styles/_index.scss +4 -0
- package/tree/styles/_index.scss +1 -1
- package/types/ngwr-badge.d.ts +22 -7
- package/types/ngwr-config.d.ts +12 -0
- package/types/ngwr-editor-testing.d.ts +378 -0
- package/types/ngwr-editor.d.ts +449 -0
- package/types/ngwr-markdown.d.ts +61 -2
- package/types/ngwr-typography.d.ts +4 -0
- package/types/ngwr-version.d.ts +1 -1
- package/typography/styles/_index.scss +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-i18n.mjs","sources":["../../../projects/lib/i18n/i18n-base-catalogs.ts","../../../projects/lib/i18n/i18n-config.ts","../../../projects/lib/i18n/i18n-loader.ts","../../../projects/lib/i18n/i18n.ts","../../../projects/lib/i18n/t.pipe.ts","../../../projects/lib/i18n/t.directive.ts","../../../projects/lib/i18n/loaders/static-loader.ts","../../../projects/lib/i18n/loaders/http-loader.ts","../../../projects/lib/i18n/provide-wr-i18n.ts","../../../projects/lib/i18n/util.ts","../../../projects/lib/i18n/ngwr-i18n.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/** Base catalogs keyed by locale, contributed by {@link provideWrI18nBaseCatalogs}. */\nexport type WrI18nBaseCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/**\n * Catalogs consulted *underneath* whatever the loader returned — the place for\n * ngwr's own built-in strings.\n *\n * A loader **replaces** the catalog for a locale rather than extending it, so an\n * app whose JSON holds only its own keys used to lose every built-in label to\n * its hardcoded English fallback, silently. Registering `wrRu` / `wrEn` here\n * puts them back without the app having to merge anything itself.\n *\n * `multi`, so several features can each contribute; later contributions win on\n * a key collision, and anything the loader returned still wins over all of them.\n *\n * It has to be handed in by the consumer rather than wired up inside\n * `provideWrI18n()`: the catalogs are their own entry points (`ngwr/i18n/ru`)\n * and they already import from `ngwr/i18n`, so importing them back here is a\n * circular entry-point dependency that ng-packagr rejects outright. Passing\n * them in also keeps the locales you don't ship out of your bundle.\n */\nexport const WR_I18N_BASE_CATALOGS = new InjectionToken<readonly WrI18nBaseCatalogs[]>('WR_I18N_BASE_CATALOGS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/** Translation catalog — flat or nested record of strings. */\nexport interface WrI18nCatalog {\n readonly [key: string]: string | WrI18nCatalog;\n}\n\n/** Parameters passed to interpolation — coerced to strings via `String(v)`. */\nexport type WrI18nParams = Readonly<Record<string, unknown>>;\n\n/** Hook called once on every key that resolves to nothing. */\nexport type WrI18nMissingHandler = (key: string, locale: string) => string;\n\n/** User-facing config for {@link provideWrI18n}. */\nexport interface WrI18nConfig {\n /**\n * BCP-47 tag used until the user calls `use()`.\n *\n * Omitted, it is Angular's own `LOCALE_ID` — the app already states its\n * locale there, and ngwr having a second, unrelated default is how a fully\n * Russian app came to render an English calendar inside itself. See\n * {@link WrI18n} for the whole precedence.\n *\n * @default LOCALE_ID\n */\n readonly defaultLocale?: string;\n\n /**\n * Whitelisted locales — `use()` ignores anything outside this list. Omitted,\n * it is `[defaultLocale]`: it used to be a hardcoded `['en']`, so\n * `provideWrI18n({ defaultLocale: 'ru' })` produced a service whose own\n * default locale was not switchable back to.\n *\n * @default [defaultLocale]\n */\n readonly availableLocales?: readonly string[];\n\n /**\n * Storage key for persisting the active locale (via `WrStorage`).\n * Set to `null` to disable persistence. @default 'wr:i18n:locale'\n */\n readonly storageKey?: string | null;\n\n /** Called when a key is missing. Default returns the key itself. */\n readonly missingHandler?: WrI18nMissingHandler;\n}\n\n/** Resolved config — every field non-optional. @internal */\nexport interface WrI18nConfigResolved {\n readonly defaultLocale: string;\n readonly availableLocales: readonly string[];\n readonly storageKey: string | null;\n readonly missingHandler: WrI18nMissingHandler;\n}\n\n/**\n * Everything but the locale, which cannot be a constant: it is resolved from\n * `LOCALE_ID` in an injection context. @internal\n */\nexport const DEFAULT_WR_I18N_CONFIG: Omit<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> = {\n storageKey: 'wr:i18n:locale',\n missingHandler: key => key,\n};\n\n/**\n * Resolve the locale half of the config. Callable only from an injection\n * context, because the seed is `LOCALE_ID`. @internal\n */\nexport function resolveWrI18nLocales(\n config: WrI18nConfig\n): Pick<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> {\n const defaultLocale = config.defaultLocale ?? inject(LOCALE_ID);\n return { defaultLocale, availableLocales: config.availableLocales ?? [defaultLocale] };\n}\n\nexport const WR_I18N_CONFIG = new InjectionToken<WrI18nConfigResolved>('WR_I18N_CONFIG', {\n factory: () => ({ ...DEFAULT_WR_I18N_CONFIG, ...resolveWrI18nLocales({}) }),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { of, type Observable } from 'rxjs';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/**\n * Loads a catalog for a `(locale, scope)` pair. `scope` is `null` for the\n * root catalog. Implementations may return the catalog synchronously\n * (via `of(...)`) for static catalogs or asynchronously (via HTTP) for\n * lazy fetches.\n */\nexport interface WrI18nLoader {\n load(locale: string, scope: string | null): Observable<WrI18nCatalog>;\n}\n\n/**\n * The active loader.\n *\n * Defaults to one that serves an empty catalog, which is what makes\n * `provideWrI18n()` genuinely optional: every ngwr component routes its\n * built-in strings through `useI18nText` / `readI18nText`, those inject\n * `WrI18n` optionally — and because `WrI18n` is `providedIn: 'root'`, an\n * optional inject still CONSTRUCTS it. Without a default here that construction\n * threw `NG0201: No provider found for WR_I18N_LOADER`, so an app that had\n * simply not configured i18n could not render `<wr-alert>` at all.\n *\n * With the empty catalog, every lookup misses, `t()` hands back the key, and\n * the helpers fall through to the component's own English default — the\n * documented no-i18n behaviour.\n */\nexport const WR_I18N_LOADER = new InjectionToken<WrI18nLoader>('WR_I18N_LOADER', {\n providedIn: 'root',\n factory: () => ({ load: () => of({}) }),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Service, type Signal, computed, effect, inject, isDevMode, signal } from '@angular/core';\n\nimport { type Observable, firstValueFrom } from 'rxjs';\n\nimport { WrStorage } from 'ngwr/storage';\n\nimport { WR_I18N_BASE_CATALOGS } from './i18n-base-catalogs';\nimport { WR_I18N_CONFIG, type WrI18nCatalog, type WrI18nParams } from './i18n-config';\nimport { WR_I18N_LOADER } from './i18n-loader';\n\n/** Cache key shape: `<locale>::<scope|''>`. @internal */\nfunction cacheKey(locale: string, scope: string | null): string {\n return `${locale}::${scope ?? ''}`;\n}\n\n/**\n * A locale and the language under it: `'ru-RU'` gives `['ru-RU', 'ru']`.\n *\n * Every lookup and every load walks this, so a catalog registered as `ru`\n * answers an app running `ru-RU`. Without it the two spellings are unrelated\n * strings, and the miss is silent — `t()` returns the key, `useI18nText` reads\n * that as \"missing\" and serves the English fallback, so a fully translated app\n * renders English with nothing logged. It only ever truncates: an `en` lookup\n * never reaches an `en-US` catalog, because a language is not a region.\n *\n * @internal\n */\nfunction localeChain(locale: string): readonly string[] {\n const dash = locale.indexOf('-');\n return dash > 0 ? [locale, locale.slice(0, dash)] : [locale];\n}\n\n/** Walk a dotted path through a catalog tree. Returns string | null. @internal */\nfunction walk(cat: WrI18nCatalog | null, key: string): string | null {\n if (!cat) return null;\n let node: string | WrI18nCatalog | undefined = cat;\n for (const part of key.split('.')) {\n if (node === undefined || typeof node === 'string') return null;\n node = node[part];\n }\n return typeof node === 'string' ? node : null;\n}\n\n/**\n * `{{name}}` interpolation. Missing params resolve to `''`. Exported so\n * helpers in `util.ts` can interpolate the fallback template when no\n * `WrI18n` provider is wired up.\n *\n * @internal\n */\nexport function wrInterpolate(template: string, params: WrI18nParams | undefined): string {\n if (!params) return template;\n return template.replace(/\\{\\{\\s*([\\w.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const v = params[name];\n if (v === undefined || v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n try {\n return JSON.stringify(v);\n } catch {\n return '';\n }\n });\n}\n\n/**\n * Reactive i18n service. Holds:\n *\n * - the active locale as a `Signal<string>`\n * - per-`(locale, scope)` catalogs in a `Map` (loaded once, then cached)\n * - a per-locale signal counter so every `translate()` reading the signal\n * re-evaluates the moment a new catalog finishes loading\n *\n * Translations are looked up scope-first then root, per locale, and the locale\n * itself is tried as the full tag before the bare language underneath it — so\n * an app running `ru-RU` resolves against a catalog registered as `ru`, and a\n * regional catalog is never shadowed by a scope in the base language. For an\n * app that spells its locale one way, which is every app that existed before\n * the chain, the order is exactly what it always was.\n *\n * ## Which locale wins\n *\n * ngwr has three locale inputs and they used to be three unrelated answers — an\n * app that set `LOCALE_ID: 'ru-RU'` correctly still rendered an English\n * calendar, because the date token defaulted to `navigator.language`. The\n * precedence is now stated, highest first:\n *\n * 1. **A subsystem's own explicit option.** `provideWrDateAdapter({ locale })`\n * pins dates; `provideWrI18n({ defaultLocale })` pins the catalog. The most\n * specific statement wins, because it can only have been deliberate.\n * 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that\n * can change without a reload, so it is what a language switcher writes.\n * 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the\n * above when neither was given. One statement, one answer.\n * 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.\n *\n * `navigator.language` is deliberately NOT in that list. It is the browser's\n * preference, not the application's, and reading it made prerendered output and\n * the hydrated page disagree.\n *\n * **What a runtime switch reaches, and what it does not.** `use()` repaints\n * every catalog string. It does not move `LOCALE_ID`, which is a constant, so\n * anything keyed on it — `wrDate` / `wrNumber` / `wrPlural`, `wr-input-number`,\n * `wr-statistic`, `wr-counter` — and anything keyed on `WR_DATE_LOCALE` — the\n * date adapter, and so `wr-calendar` and `wr-date-picker` — stays where it was.\n * `use()` says so once in dev mode rather than leaving it to be discovered.\n *\n * @example\n * ```ts\n * const i18n = inject(WrI18n);\n * i18n.use('ru'); // switch locale\n * i18n.t('cart.checkout'); // → 'Оформить заказ'\n * i18n.t('greeting', { name: 'Ada' }); // → 'Hello, Ada!'\n *\n * effect(() => console.log(i18n.translate('hi')())); // re-runs on locale change\n * ```\n *\n * @see https://ngwr.dev/reference/services/i18n\n */\n@Service()\nexport class WrI18n {\n private readonly config = inject(WR_I18N_CONFIG);\n private readonly loader = inject(WR_I18N_LOADER);\n private readonly storage = inject(WrStorage);\n\n /**\n * Angular's own locale. Read for the dev-mode drift warning only — the\n * resolved default already folded it in through `WR_I18N_CONFIG`. @internal\n */\n private readonly localeId = inject(LOCALE_ID);\n\n /**\n * Catalogs registered via `provideWrI18nBaseCatalogs()` — the floor under the\n * loader's own catalogs, so ngwr's built-in strings survive an app that only\n * ships its own keys. @internal\n */\n private readonly baseCatalogs = inject(WR_I18N_BASE_CATALOGS, { optional: true }) ?? [];\n\n /** Per-(locale,scope) catalogs, populated by `loadCatalog`. @internal */\n private readonly catalogs = new Map<string, WrI18nCatalog>();\n\n /** Bumped after each catalog write so reactive translates recompute. @internal */\n private readonly revision = signal(0);\n\n /** In-flight load promises — dedupes parallel `t()` callers. @internal */\n private readonly inflight = new Map<string, Promise<WrI18nCatalog>>();\n\n /** Registered scopes — auto-loaded whenever the locale changes. @internal */\n private readonly scopes = new Set<string>();\n\n /** Active locale. Writes go through `use()` so storage stays in sync. */\n private readonly _locale = signal<string>(this.initialLocale());\n readonly locale: Signal<string> = this._locale.asReadonly();\n\n constructor() {\n // Eagerly load the root catalog + every registered scope for the\n // current locale. Subsequent locale changes refire the same effect.\n effect(() => {\n const lc = this._locale();\n void this.loadChain(lc, null);\n for (const sc of this.scopes) void this.loadChain(lc, sc);\n });\n }\n\n // Locale\n\n /**\n * Switch active locale. Ignored when not whitelisted.\n *\n * Text only — see the class docs for what a runtime switch cannot reach. The\n * dev-mode warning below is the whole reporting of that limit; without it the\n * failure is a screen showing German labels beside `3/15/2026`, with nothing\n * anywhere saying why.\n */\n use(locale: string): void {\n if (!this.config.availableLocales.includes(locale)) return;\n const previous = this._locale();\n this._locale.set(locale);\n if (this.config.storageKey) this.storage.set(this.config.storageKey, locale);\n if (isDevMode() && previous !== locale) this.warnOnLocaleIdDrift(locale);\n }\n\n /** Available locales — pass-through from config. */\n available(): readonly string[] {\n return this.config.availableLocales;\n }\n\n // Scopes\n\n /**\n * Register a scope so its catalog loads alongside the root one. Idempotent.\n * Returns a promise resolving once the current locale's scope catalog is in\n * the cache — handy for feature `canActivate` guards.\n */\n registerScope(scope: string): Promise<WrI18nCatalog> {\n this.scopes.add(scope);\n const lc = this._locale();\n // Resolve on the exact tag: the promise is what a `canActivate` waits on,\n // and the base-language catalog is only ever a fallback under it.\n const exact = this.loadCatalog(lc, scope);\n void this.loadChain(lc, scope);\n return exact;\n }\n\n // Translate\n\n /**\n * Eager translate — returns the current value or the missing-handler\n * fallback. Does NOT auto-load missing catalogs; combine with the\n * reactive `translate(...)` if you want load-on-demand.\n */\n t(key: string, params?: WrI18nParams, scope?: string): string {\n // Read revision so callers inside computed/effect re-run on updates.\n this.revision();\n const lc = this._locale();\n\n const chain = localeChain(lc);\n let hit: string | null = null;\n for (const candidate of chain) {\n if (scope) hit = walk(this.catalogs.get(cacheKey(candidate, scope)) ?? null, key);\n hit ??= walk(this.catalogs.get(cacheKey(candidate, null)) ?? null, key);\n if (hit !== null) break;\n }\n // Base catalogs are the floor: consulted only once the loader's own catalogs\n // have missed, so an app's keys always win, but ngwr's built-in strings are\n // still there when the app's catalog doesn't carry them.\n hit ??= this.walkBase(chain, key);\n\n if (hit === null) {\n // Fire a background load so a future read can resolve it.\n void this.loadChain(lc, scope ?? null);\n return this.config.missingHandler(key, lc);\n }\n return wrInterpolate(hit, params);\n }\n\n /** Reactive translate — re-evaluates on locale or catalog updates. */\n translate(key: string, params?: WrI18nParams, scope?: string): Signal<string> {\n return computed(() => this.t(key, params, scope));\n }\n\n // Internals\n\n /**\n * Look a key up in the registered base catalogs, later contributions first so\n * a feature can shadow an earlier one.\n */\n private walkBase(chain: readonly string[], key: string): string | null {\n for (const locale of chain) {\n for (let i = this.baseCatalogs.length - 1; i >= 0; i--) {\n const hit = walk(this.baseCatalogs[i][locale] ?? null, key);\n if (hit !== null) return hit;\n }\n }\n return null;\n }\n\n private initialLocale(): string {\n if (this.config.storageKey) {\n const saved = this.storage.get<string>(this.config.storageKey);\n if (saved && this.config.availableLocales.includes(saved)) return saved;\n }\n return this.config.defaultLocale;\n }\n\n /**\n * Load a `(locale, scope)` catalog and, when the locale carries a region, the\n * bare-language one under it. Both go in the cache; `t()` reads them in that\n * order.\n */\n private loadChain(locale: string, scope: string | null): Promise<unknown> {\n return Promise.all(localeChain(locale).map(candidate => this.loadCatalog(candidate, scope)));\n }\n\n /** One warning per service, not one per switch. @internal */\n private warnedLocaleIdDrift = false;\n\n /**\n * Say once, in dev, that a runtime switch moved the text and nothing else.\n *\n * The mismatch is otherwise invisible in the way that costs the most time:\n * the catalog strings all change, which reads as \"the switch worked\", and the\n * dates and numbers beside them are still correct-looking output in the old\n * locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is\n * out of step and a warning that fires when everything agrees is one people\n * learn to ignore. Production builds drop the call entirely via `isDevMode()`\n * tree-shaking.\n */\n private warnOnLocaleIdDrift(locale: string): void {\n if (this.warnedLocaleIdDrift || locale === this.localeId) return;\n this.warnedLocaleIdDrift = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] WrI18n.use('${locale}') switched the catalog, but LOCALE_ID is still '${this.localeId}'. ` +\n `LOCALE_ID is an Angular constant and WR_DATE_LOCALE resolves from it once at bootstrap, so ` +\n `formatted dates and numbers do not follow the switch and stay on '${this.localeId}': the date ` +\n `adapter (and so wr-calendar / wr-date-picker), the wrDate / wrNumber / wrPlural pipes, ` +\n `wr-input-number, wr-statistic, wr-counter, wr-pagination's total and wr-file-upload's sizes. ` +\n `Reload the app with the new LOCALE_ID to move those, or keep runtime switching to text.`\n );\n }\n\n private loadCatalog(locale: string, scope: string | null): Promise<WrI18nCatalog> {\n const ck = cacheKey(locale, scope);\n const cached = this.catalogs.get(ck);\n if (cached) return Promise.resolve(cached);\n\n const pending = this.inflight.get(ck);\n if (pending) return pending;\n\n const stream: Observable<WrI18nCatalog> = this.loader.load(locale, scope);\n const promise = firstValueFrom(stream)\n .then(catalog => {\n this.catalogs.set(ck, catalog);\n this.revision.update(v => v + 1);\n return catalog;\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line no-console -- intentional diagnostic for missing catalog\n console.warn(`[ngwr/i18n] failed to load (${locale}, ${scope ?? 'root'})`, err);\n const empty: WrI18nCatalog = {};\n this.catalogs.set(ck, empty);\n return empty;\n })\n .finally(() => {\n this.inflight.delete(ck);\n });\n\n this.inflight.set(ck, promise);\n return promise;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Translate a key. Impure — re-evaluates on every CD so locale switches\n * and catalog loads propagate without a manual refresh.\n *\n * @example\n * ```html\n * <h1>{{ 'home.title' | wrT }}</h1>\n * <p>{{ 'greeting' | wrT: { name: user().name } }}</p>\n * <button>{{ 'forms.save' | wrT: null : 'checkout' }}</button>\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- intentional: locale + catalog updates must propagate even when args are stable\n@Pipe({ name: 'wrT', pure: false })\nexport class WrTPipe implements PipeTransform {\n private readonly i18n = inject(WrI18n);\n\n transform(key: string, params?: WrI18nParams | null, scope?: string): string {\n return this.i18n.t(key, params ?? undefined, scope);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, ElementRef, computed, effect, inject, input } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Attribute directive that sets `textContent` of its host to the translation\n * of the bound key. Reactive — re-renders on locale + catalog changes.\n *\n * @example\n * ```html\n * <span [wrT]=\"'home.title'\"></span>\n * <span [wrT]=\"'greeting'\" [wrTParams]=\"{ name: user().name }\"></span>\n * <span [wrT]=\"'forms.save'\" wrTScope=\"checkout\"></span>\n * ```\n */\n@Directive({\n selector: '[wrT]',\n})\nexport class WrTDirective {\n /** Translation key. Required. */\n readonly wrT = input.required<string>();\n\n /** Interpolation params for `{{name}}` tokens. */\n readonly wrTParams = input<WrI18nParams | null>(null);\n\n /** Optional scope — scoped lookup first, then root fallback. */\n readonly wrTScope = input<string | null>(null);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly i18n = inject(WrI18n);\n\n private readonly text = computed(() =>\n this.i18n.t(this.wrT(), this.wrTParams() ?? undefined, this.wrTScope() ?? undefined)\n );\n\n constructor() {\n effect(() => {\n this.host.nativeElement.textContent = this.text();\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Observable, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Root catalogs keyed by locale: `{ en: catalog, ru: catalog, … }`. */\nexport type WrI18nStaticCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/** Per-scope catalogs: `{ checkout: { en: catalog, ru: catalog }, … }`. */\nexport type WrI18nStaticScopedCatalogs = Readonly<Record<string, WrI18nStaticCatalogs>>;\n\n/**\n * Loader for catalogs already in memory (imported from JSON or generated).\n *\n * - Pass `catalogs` for the root catalog of every locale.\n * - Pass `scopes` if you ship per-feature catalogs the loader should serve\n * to `WrI18n.registerScope(name)` calls.\n *\n * Missing locale or scope resolves to `{}` — the missing-key handler then\n * decides what to render.\n */\nexport class WrI18nStaticLoader implements WrI18nLoader {\n constructor(\n private readonly catalogs: WrI18nStaticCatalogs,\n private readonly scopes: WrI18nStaticScopedCatalogs = {}\n ) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n if (scope === null) return of(this.catalogs[locale] ?? {});\n return of(this.scopes[scope]?.[locale] ?? {});\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject } from '@angular/core';\n\nimport { type Observable, catchError, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Configuration for {@link WrI18nHttpLoader}. */\nexport interface WrI18nHttpLoaderConfig {\n /**\n * URL template. Tokens:\n * - `{locale}` — required, BCP-47 tag (e.g. `en`).\n * - `{scope}` — optional, scope name. Use the `rootPath` if you need a\n * different path entirely for the root catalog.\n *\n * @example\n * ```ts\n * { path: '/assets/i18n/{locale}.json' } // root only\n * { path: '/assets/i18n/{scope}/{locale}.json',\n * rootPath: '/assets/i18n/{locale}.json' } // root + scopes\n * ```\n */\n readonly path: string;\n /** Path template for the root catalog. Defaults to `path`. */\n readonly rootPath?: string;\n}\n\n/**\n * Loader that fetches catalogs via `HttpClient`. Failures resolve to `{}`\n * (logged once at the service layer) so a missing file never throws into\n * user code.\n */\nexport class WrI18nHttpLoader implements WrI18nLoader {\n private readonly http = inject(HttpClient);\n\n constructor(private readonly config: WrI18nHttpLoaderConfig) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n const template = scope === null ? (this.config.rootPath ?? this.config.path) : this.config.path;\n const url = template.replace('{locale}', locale).replace('{scope}', scope ?? '');\n return this.http.get<WrI18nCatalog>(url).pipe(catchError(() => of<WrI18nCatalog>({})));\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\n\nimport { WR_I18N_BASE_CATALOGS, type WrI18nBaseCatalogs } from './i18n-base-catalogs';\nimport {\n DEFAULT_WR_I18N_CONFIG,\n WR_I18N_CONFIG,\n type WrI18nConfig,\n type WrI18nConfigResolved,\n resolveWrI18nLocales,\n} from './i18n-config';\nimport { WR_I18N_LOADER, type WrI18nLoader } from './i18n-loader';\nimport { WrI18nHttpLoader, type WrI18nHttpLoaderConfig } from './loaders/http-loader';\nimport {\n WrI18nStaticLoader,\n type WrI18nStaticCatalogs,\n type WrI18nStaticScopedCatalogs,\n} from './loaders/static-loader';\n\n/**\n * Configure {@link WrI18n}. Either pass a `loader` directly, or use the\n * `provideWrI18nHttpLoader` / `provideWrI18nStaticLoader` helpers in the\n * same providers array.\n */\nexport interface ProvideWrI18nOptions extends WrI18nConfig {\n readonly loader?: WrI18nLoader;\n}\n\nexport function provideWrI18n(options: ProvideWrI18nOptions = {}): EnvironmentProviders {\n const { loader, ...config } = options;\n\n const providers: Provider[] = [\n {\n provide: WR_I18N_CONFIG,\n // A factory rather than a value: `defaultLocale` falls back to `LOCALE_ID`,\n // which only an injection context can read.\n useFactory: (): WrI18nConfigResolved => ({\n ...DEFAULT_WR_I18N_CONFIG,\n ...config,\n ...resolveWrI18nLocales(config),\n }),\n },\n ];\n if (loader) providers.push({ provide: WR_I18N_LOADER, useValue: loader });\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Provide a static loader — catalogs already in memory.\n *\n * A loader serves only the catalog you pass it, and ngwr registers none of its\n * own. Pass only your own keys here and register ngwr's catalogs with\n * {@link provideWrI18nBaseCatalogs} — not `{ ...wrRu, ...yours }`. A spread is\n * shallow, so any namespace you share with ngwr, e.g. `common`, `validation`,\n * `table`, keeps only the keys of the side spread last, and the other side's\n * keys stop resolving with nothing logged: ngwr's components fall back to their\n * English defaults, and a `wrT` read of a lost key renders the raw key under the\n * default missing handler.\n *\n * @param catalogs Root catalogs keyed by locale.\n * @param scopes Optional per-scope catalogs served to `registerScope(name)`.\n */\nexport function provideWrI18nStaticLoader(\n catalogs: WrI18nStaticCatalogs,\n scopes?: WrI18nStaticScopedCatalogs\n): Provider {\n return { provide: WR_I18N_LOADER, useValue: new WrI18nStaticLoader(catalogs, scopes) };\n}\n\n/**\n * Register catalogs consulted *underneath* the loader — this is how ngwr's own\n * built-in strings survive when you supply your own catalogs.\n *\n * A loader replaces the catalog for a locale instead of extending it, so a JSON\n * file holding only your keys leaves every built-in label on its hardcoded\n * English fallback, with nothing logged. One line fixes it, on either loader:\n *\n * @example\n * ```ts\n * import { wrRu } from 'ngwr/i18n/ru';\n *\n * providers: [\n * provideWrI18n({ defaultLocale: 'ru', availableLocales: ['ru'] }),\n * provideWrI18nBaseCatalogs({ ru: wrRu }),\n * provideWrI18nHttpLoader({ path: '/assets/i18n/{locale}.json' }),\n * ]\n * ```\n *\n * Pass only the locales you ship — the ones you leave out stay out of the\n * bundle. Your own keys always win; this is a floor, not an override.\n *\n * Use it instead of spreading `wrRu` into your own catalog, too: the lookup\n * walks these key by key after the loader's catalog misses, so a namespace both\n * define keeps both halves, where a shallow spread keeps only one.\n */\nexport function provideWrI18nBaseCatalogs(catalogs: WrI18nBaseCatalogs): Provider {\n return { provide: WR_I18N_BASE_CATALOGS, useValue: catalogs, multi: true };\n}\n\n/** Provide an HTTP loader — catalogs fetched from URLs. Requires `provideHttpClient`. */\nexport function provideWrI18nHttpLoader(config: WrI18nHttpLoaderConfig): Provider {\n return { provide: WR_I18N_LOADER, useFactory: () => new WrI18nHttpLoader(config) };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject, signal } from '@angular/core';\n\nimport { WrI18n, wrInterpolate } from './i18n';\nimport type { WrI18nParams } from './i18n-config';\n\n/**\n * Helper for component default text. Returns a reactive string that:\n *\n * 1. Prefers the consumer's override (an `input<string | null>()` value).\n * 2. Falls back to the i18n catalog under `key` — re-renders on locale\n * change so a switcher updates the DOM live.\n * 3. Falls back to `fallback` when no `WrI18n` is provided OR the catalog\n * is missing the key.\n *\n * Components don't need a hard dependency on `provideWrI18n` — without it,\n * the fallback is returned and everything still works.\n *\n * @example\n * ```ts\n * readonly emptyText = input<string | null>(null);\n * protected readonly empty = useI18nText(this.emptyText, 'table.empty', 'No data');\n *\n * // In template: <div>{{ empty() }}</div>\n * ```\n */\nexport function useI18nText(binding: Signal<string | null | undefined>, key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return computed(() => {\n const v = binding();\n return v ?? fallback;\n });\n }\n\n return computed(() => {\n const v = binding();\n if (v !== null && v !== undefined && v !== '') return v;\n const translated = i18n.t(key);\n // Default missing handler returns the key itself — treat that as \"missing\"\n // and use our explicit fallback.\n return translated === key ? fallback : translated;\n });\n}\n\n/**\n * {@link useI18nText} without a binding to forward — for a built-in string the\n * component exposes no override input for. Same reactivity, same fallback\n * rules; the only difference is the missing first argument.\n *\n * It used to return a plain `string`, resolved once at injection time, and\n * that was wrong in the ordinary case rather than an edge one: `WrI18n` writes\n * every loader-backed catalog from `firstValueFrom(...).then(...)`, so even a\n * static loader serving an object literal lands a microtask AFTER the first\n * change-detection pass. Every component built in that pass read an empty\n * catalog and froze its English fallback for the life of the app — in one\n * `<wr-date-picker>` the field said \"Открыть календарь\" and the calendar\n * button beside it \"Open calendar\", off the same key.\n */\nexport function readI18nText(key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) return computed(() => fallback);\n\n return computed(() => {\n const v = i18n.t(key);\n return v === key ? fallback : v;\n });\n}\n\n/** Tiny shim — useful when the caller doesn't have an `input` to forward. */\nexport function nullSignal(): Signal<null> {\n return signal(null).asReadonly();\n}\n\n/**\n * Build a per-call formatter for parametrized labels (e.g. ARIA labels\n * that interpolate a per-row value: `\"Remove {{label}}\"`). Returns a\n * function the template calls with the params for the current item.\n *\n * The returned function:\n * - Re-resolves the i18n catalog on every call (live locale switches just\n * work — re-rendered templates pick up new strings).\n * - Falls back to the literal `fallback` template with the same\n * `{{name}}` syntax when no `WrI18n` provider is present, or when the\n * key is missing.\n *\n * Use this for labels that vary per row. For static labels, prefer\n * {@link useI18nText} or {@link readI18nText}.\n *\n * @example\n * ```ts\n * protected readonly removeChipLabel = useI18nFormatter('select.removeItem', 'Remove {{label}}');\n *\n * // In template:\n * // [attr.aria-label]=\"removeChipLabel({ label: chip.label })\"\n * ```\n */\nexport function useI18nFormatter(key: string, fallback: string): (params?: WrI18nParams) => string {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return (params?: WrI18nParams) => wrInterpolate(fallback, params);\n }\n return (params?: WrI18nParams) => {\n const v = i18n.t(key, params);\n return v === key ? wrInterpolate(fallback, params) : v;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AASH;;;;;;;;;;;;;;;;;AAiBG;MACU,qBAAqB,GAAG,IAAI,cAAc,CAAgC,uBAAuB;;AChC9G;;;;;AAKG;AAyDH;;;AAGG;AACI,MAAM,sBAAsB,GAAqE;AACtG,IAAA,UAAU,EAAE,gBAAgB;AAC5B,IAAA,cAAc,EAAE,GAAG,IAAI,GAAG;;AAG5B;;;AAGG;AACG,SAAU,oBAAoB,CAClC,MAAoB,EAAA;IAEpB,MAA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C;QACrB,OAAO,CAAC,KAAK,GAAG,GAAG,QAAQ,GAAG,CAAC;AACjC,IAAA,CAAC,CAAC;AACJ;AAEA;SACgB,UAAU,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,gBAAgB,CAAC,GAAW,EAAE,QAAgB,EAAA;AAC5D,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,CAAC,MAAqB,KAAK,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC;IACnE;IACA,OAAO,CAAC,MAAqB,KAAI;QAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC;AAC7B,QAAA,OAAO,CAAC,KAAK,GAAG,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;AACxD,IAAA,CAAC;AACH;;AChHA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-i18n.mjs","sources":["../../../projects/lib/i18n/i18n-base-catalogs.ts","../../../projects/lib/i18n/i18n-config.ts","../../../projects/lib/i18n/i18n-loader.ts","../../../projects/lib/i18n/i18n.ts","../../../projects/lib/i18n/t.pipe.ts","../../../projects/lib/i18n/t.directive.ts","../../../projects/lib/i18n/loaders/static-loader.ts","../../../projects/lib/i18n/loaders/http-loader.ts","../../../projects/lib/i18n/provide-wr-i18n.ts","../../../projects/lib/i18n/util.ts","../../../projects/lib/i18n/ngwr-i18n.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/** Base catalogs keyed by locale, contributed by {@link provideWrI18nBaseCatalogs}. */\nexport type WrI18nBaseCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/**\n * Catalogs consulted *underneath* whatever the loader returned — the place for\n * ngwr's own built-in strings.\n *\n * A loader **replaces** the catalog for a locale rather than extending it, so an\n * app whose JSON holds only its own keys used to lose every built-in label to\n * its hardcoded English fallback, silently. Registering `wrRu` / `wrEn` here\n * puts them back without the app having to merge anything itself.\n *\n * `multi`, so several features can each contribute; later contributions win on\n * a key collision, and anything the loader returned still wins over all of them.\n *\n * It has to be handed in by the consumer rather than wired up inside\n * `provideWrI18n()`: the catalogs are their own entry points (`ngwr/i18n/ru`)\n * and they already import from `ngwr/i18n`, so importing them back here is a\n * circular entry-point dependency that ng-packagr rejects outright. Passing\n * them in also keeps the locales you don't ship out of your bundle.\n */\nexport const WR_I18N_BASE_CATALOGS = new InjectionToken<readonly WrI18nBaseCatalogs[]>('WR_I18N_BASE_CATALOGS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/** Translation catalog — flat or nested record of strings. */\nexport interface WrI18nCatalog {\n readonly [key: string]: string | WrI18nCatalog;\n}\n\n/** Parameters passed to interpolation — coerced to strings via `String(v)`. */\nexport type WrI18nParams = Readonly<Record<string, unknown>>;\n\n/** Hook called once on every key that resolves to nothing. */\nexport type WrI18nMissingHandler = (key: string, locale: string) => string;\n\n/** User-facing config for {@link provideWrI18n}. */\nexport interface WrI18nConfig {\n /**\n * BCP-47 tag used until the user calls `use()`.\n *\n * Omitted, it is Angular's own `LOCALE_ID` — the app already states its\n * locale there, and ngwr having a second, unrelated default is how a fully\n * Russian app came to render an English calendar inside itself. See\n * {@link WrI18n} for the whole precedence.\n *\n * @default LOCALE_ID\n */\n readonly defaultLocale?: string;\n\n /**\n * Whitelisted locales — `use()` ignores anything outside this list. Omitted,\n * it is `[defaultLocale]`: it used to be a hardcoded `['en']`, so\n * `provideWrI18n({ defaultLocale: 'ru' })` produced a service whose own\n * default locale was not switchable back to.\n *\n * @default [defaultLocale]\n */\n readonly availableLocales?: readonly string[];\n\n /**\n * Storage key for persisting the active locale (via `WrStorage`).\n * Set to `null` to disable persistence. @default 'wr:i18n:locale'\n */\n readonly storageKey?: string | null;\n\n /** Called when a key is missing. Default returns the key itself. */\n readonly missingHandler?: WrI18nMissingHandler;\n}\n\n/** Resolved config — every field non-optional. @internal */\nexport interface WrI18nConfigResolved {\n readonly defaultLocale: string;\n readonly availableLocales: readonly string[];\n readonly storageKey: string | null;\n readonly missingHandler: WrI18nMissingHandler;\n}\n\n/**\n * Everything but the locale, which cannot be a constant: it is resolved from\n * `LOCALE_ID` in an injection context. @internal\n */\nexport const DEFAULT_WR_I18N_CONFIG: Omit<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> = {\n storageKey: 'wr:i18n:locale',\n missingHandler: key => key,\n};\n\n/**\n * Resolve the locale half of the config. Callable only from an injection\n * context, because the seed is `LOCALE_ID`. @internal\n */\nexport function resolveWrI18nLocales(\n config: WrI18nConfig\n): Pick<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> {\n const defaultLocale = config.defaultLocale ?? inject(LOCALE_ID);\n return { defaultLocale, availableLocales: config.availableLocales ?? [defaultLocale] };\n}\n\nexport const WR_I18N_CONFIG = new InjectionToken<WrI18nConfigResolved>('WR_I18N_CONFIG', {\n factory: () => ({ ...DEFAULT_WR_I18N_CONFIG, ...resolveWrI18nLocales({}) }),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { of, type Observable } from 'rxjs';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/**\n * Loads a catalog for a `(locale, scope)` pair. `scope` is `null` for the\n * root catalog. Implementations may return the catalog synchronously\n * (via `of(...)`) for static catalogs or asynchronously (via HTTP) for\n * lazy fetches.\n */\nexport interface WrI18nLoader {\n load(locale: string, scope: string | null): Observable<WrI18nCatalog>;\n}\n\n/**\n * The active loader.\n *\n * Defaults to one that serves an empty catalog, which is what makes\n * `provideWrI18n()` genuinely optional: every ngwr component routes its\n * built-in strings through `useI18nText` / `readI18nText`, those inject\n * `WrI18n` optionally — and because `WrI18n` is `providedIn: 'root'`, an\n * optional inject still CONSTRUCTS it. Without a default here that construction\n * threw `NG0201: No provider found for WR_I18N_LOADER`, so an app that had\n * simply not configured i18n could not render `<wr-alert>` at all.\n *\n * With the empty catalog, every lookup misses, `t()` hands back the key, and\n * the helpers fall through to the component's own English default — the\n * documented no-i18n behaviour.\n */\nexport const WR_I18N_LOADER = new InjectionToken<WrI18nLoader>('WR_I18N_LOADER', {\n providedIn: 'root',\n factory: () => ({ load: () => of({}) }),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Service, type Signal, computed, effect, inject, isDevMode, signal } from '@angular/core';\n\nimport { type Observable, firstValueFrom } from 'rxjs';\n\nimport { WrStorage } from 'ngwr/storage';\n\nimport { WR_I18N_BASE_CATALOGS } from './i18n-base-catalogs';\nimport { WR_I18N_CONFIG, type WrI18nCatalog, type WrI18nParams } from './i18n-config';\nimport { WR_I18N_LOADER } from './i18n-loader';\n\n/** Cache key shape: `<locale>::<scope|''>`. @internal */\nfunction cacheKey(locale: string, scope: string | null): string {\n return `${locale}::${scope ?? ''}`;\n}\n\n/**\n * A locale and the language under it: `'ru-RU'` gives `['ru-RU', 'ru']`.\n *\n * Every lookup and every load walks this, so a catalog registered as `ru`\n * answers an app running `ru-RU`. Without it the two spellings are unrelated\n * strings, and the miss is silent — `t()` returns the key, `useI18nText` reads\n * that as \"missing\" and serves the English fallback, so a fully translated app\n * renders English with nothing logged. It only ever truncates: an `en` lookup\n * never reaches an `en-US` catalog, because a language is not a region.\n *\n * @internal\n */\nfunction localeChain(locale: string): readonly string[] {\n const dash = locale.indexOf('-');\n return dash > 0 ? [locale, locale.slice(0, dash)] : [locale];\n}\n\n/** Walk a dotted path through a catalog tree. Returns string | null. @internal */\nfunction walk(cat: WrI18nCatalog | null, key: string): string | null {\n if (!cat) return null;\n let node: string | WrI18nCatalog | undefined = cat;\n for (const part of key.split('.')) {\n if (node === undefined || typeof node === 'string') return null;\n node = node[part];\n }\n return typeof node === 'string' ? node : null;\n}\n\n/**\n * `{{name}}` interpolation. Missing params resolve to `''`. Exported so\n * helpers in `util.ts` can interpolate the fallback template when no\n * `WrI18n` provider is wired up.\n *\n * @internal\n */\nexport function wrInterpolate(template: string, params: WrI18nParams | undefined): string {\n if (!params) return template;\n return template.replace(/\\{\\{\\s*([\\w.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const v = params[name];\n if (v === undefined || v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n try {\n return JSON.stringify(v);\n } catch {\n return '';\n }\n });\n}\n\n/**\n * Reactive i18n service. Holds:\n *\n * - the active locale as a `Signal<string>`\n * - per-`(locale, scope)` catalogs in a `Map` (loaded once, then cached)\n * - a per-locale signal counter so every `translate()` reading the signal\n * re-evaluates the moment a new catalog finishes loading\n *\n * Translations are looked up scope-first then root, per locale, and the locale\n * itself is tried as the full tag before the bare language underneath it — so\n * an app running `ru-RU` resolves against a catalog registered as `ru`, and a\n * regional catalog is never shadowed by a scope in the base language. For an\n * app that spells its locale one way, which is every app that existed before\n * the chain, the order is exactly what it always was.\n *\n * ## Which locale wins\n *\n * ngwr has three locale inputs and they used to be three unrelated answers — an\n * app that set `LOCALE_ID: 'ru-RU'` correctly still rendered an English\n * calendar, because the date token defaulted to `navigator.language`. The\n * precedence is now stated, highest first:\n *\n * 1. **A subsystem's own explicit option.** `provideWrDateAdapter({ locale })`\n * pins dates; `provideWrI18n({ defaultLocale })` pins the catalog. The most\n * specific statement wins, because it can only have been deliberate.\n * 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that\n * can change without a reload, so it is what a language switcher writes.\n * 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the\n * above when neither was given. One statement, one answer.\n * 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.\n *\n * `navigator.language` is deliberately NOT in that list. It is the browser's\n * preference, not the application's, and reading it made prerendered output and\n * the hydrated page disagree.\n *\n * **What a runtime switch reaches, and what it does not.** `use()` repaints\n * every catalog string. It does not move `LOCALE_ID`, which is a constant, so\n * anything keyed on it — `wrDate` / `wrNumber` / `wrPlural`, `wr-input-number`,\n * `wr-statistic`, `wr-counter` — and anything keyed on `WR_DATE_LOCALE` — the\n * date adapter, and so `wr-calendar` and `wr-date-picker` — stays where it was.\n * `use()` says so once in dev mode rather than leaving it to be discovered.\n *\n * @example\n * ```ts\n * const i18n = inject(WrI18n);\n * i18n.use('ru'); // switch locale\n * i18n.t('cart.checkout'); // → 'Оформить заказ'\n * i18n.t('greeting', { name: 'Ada' }); // → 'Hello, Ada!'\n *\n * effect(() => console.log(i18n.translate('hi')())); // re-runs on locale change\n * ```\n *\n * @see https://ngwr.dev/reference/services/i18n\n */\n@Service()\nexport class WrI18n {\n private readonly config = inject(WR_I18N_CONFIG);\n private readonly loader = inject(WR_I18N_LOADER);\n private readonly storage = inject(WrStorage);\n\n /**\n * Angular's own locale. Read for the dev-mode drift warning only — the\n * resolved default already folded it in through `WR_I18N_CONFIG`. @internal\n */\n private readonly localeId = inject(LOCALE_ID);\n\n /**\n * Catalogs registered via `provideWrI18nBaseCatalogs()` — the floor under the\n * loader's own catalogs, so ngwr's built-in strings survive an app that only\n * ships its own keys. @internal\n */\n private readonly baseCatalogs = inject(WR_I18N_BASE_CATALOGS, { optional: true }) ?? [];\n\n /** Per-(locale,scope) catalogs, populated by `loadCatalog`. @internal */\n private readonly catalogs = new Map<string, WrI18nCatalog>();\n\n /** Bumped after each catalog write so reactive translates recompute. @internal */\n private readonly revision = signal(0);\n\n /** In-flight load promises — dedupes parallel `t()` callers. @internal */\n private readonly inflight = new Map<string, Promise<WrI18nCatalog>>();\n\n /** Registered scopes — auto-loaded whenever the locale changes. @internal */\n private readonly scopes = new Set<string>();\n\n /** Active locale. Writes go through `use()` so storage stays in sync. */\n private readonly _locale = signal<string>(this.initialLocale());\n readonly locale: Signal<string> = this._locale.asReadonly();\n\n constructor() {\n // Eagerly load the root catalog + every registered scope for the\n // current locale. Subsequent locale changes refire the same effect.\n effect(() => {\n const lc = this._locale();\n void this.loadChain(lc, null);\n for (const sc of this.scopes) void this.loadChain(lc, sc);\n });\n }\n\n // Locale\n\n /**\n * Switch active locale. Ignored when not whitelisted.\n *\n * Text only — see the class docs for what a runtime switch cannot reach. The\n * dev-mode warning below is the whole reporting of that limit; without it the\n * failure is a screen showing German labels beside `3/15/2026`, with nothing\n * anywhere saying why.\n */\n use(locale: string): void {\n if (!this.config.availableLocales.includes(locale)) return;\n const previous = this._locale();\n this._locale.set(locale);\n if (this.config.storageKey) this.storage.set(this.config.storageKey, locale);\n if (isDevMode() && previous !== locale) this.warnOnLocaleIdDrift(locale);\n }\n\n /** Available locales — pass-through from config. */\n available(): readonly string[] {\n return this.config.availableLocales;\n }\n\n // Scopes\n\n /**\n * Register a scope so its catalog loads alongside the root one. Idempotent.\n * Returns a promise resolving once the current locale's scope catalog is in\n * the cache — handy for feature `canActivate` guards.\n */\n registerScope(scope: string): Promise<WrI18nCatalog> {\n this.scopes.add(scope);\n const lc = this._locale();\n // Resolve on the exact tag: the promise is what a `canActivate` waits on,\n // and the base-language catalog is only ever a fallback under it.\n const exact = this.loadCatalog(lc, scope);\n void this.loadChain(lc, scope);\n return exact;\n }\n\n // Translate\n\n /**\n * Eager translate — returns the current value or the missing-handler\n * fallback. Does NOT auto-load missing catalogs; combine with the\n * reactive `translate(...)` if you want load-on-demand.\n */\n t(key: string, params?: WrI18nParams, scope?: string): string {\n // Read revision so callers inside computed/effect re-run on updates.\n this.revision();\n const lc = this._locale();\n\n const chain = localeChain(lc);\n let hit: string | null = null;\n for (const candidate of chain) {\n if (scope) hit = walk(this.catalogs.get(cacheKey(candidate, scope)) ?? null, key);\n hit ??= walk(this.catalogs.get(cacheKey(candidate, null)) ?? null, key);\n if (hit !== null) break;\n }\n // Base catalogs are the floor: consulted only once the loader's own catalogs\n // have missed, so an app's keys always win, but ngwr's built-in strings are\n // still there when the app's catalog doesn't carry them.\n hit ??= this.walkBase(chain, key);\n\n if (hit === null) {\n // Fire a background load so a future read can resolve it.\n void this.loadChain(lc, scope ?? null);\n return this.config.missingHandler(key, lc);\n }\n return wrInterpolate(hit, params);\n }\n\n /** Reactive translate — re-evaluates on locale or catalog updates. */\n translate(key: string, params?: WrI18nParams, scope?: string): Signal<string> {\n return computed(() => this.t(key, params, scope));\n }\n\n // Internals\n\n /**\n * Look a key up in the registered base catalogs, later contributions first so\n * a feature can shadow an earlier one.\n */\n private walkBase(chain: readonly string[], key: string): string | null {\n for (const locale of chain) {\n for (let i = this.baseCatalogs.length - 1; i >= 0; i--) {\n const hit = walk(this.baseCatalogs[i][locale] ?? null, key);\n if (hit !== null) return hit;\n }\n }\n return null;\n }\n\n private initialLocale(): string {\n if (this.config.storageKey) {\n const saved = this.storage.get<string>(this.config.storageKey);\n if (saved && this.config.availableLocales.includes(saved)) return saved;\n }\n return this.config.defaultLocale;\n }\n\n /**\n * Load a `(locale, scope)` catalog and, when the locale carries a region, the\n * bare-language one under it. Both go in the cache; `t()` reads them in that\n * order.\n */\n private loadChain(locale: string, scope: string | null): Promise<unknown> {\n return Promise.all(localeChain(locale).map(candidate => this.loadCatalog(candidate, scope)));\n }\n\n /** One warning per service, not one per switch. @internal */\n private warnedLocaleIdDrift = false;\n\n /**\n * Say once, in dev, that a runtime switch moved the text and nothing else.\n *\n * The mismatch is otherwise invisible in the way that costs the most time:\n * the catalog strings all change, which reads as \"the switch worked\", and the\n * dates and numbers beside them are still correct-looking output in the old\n * locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is\n * out of step and a warning that fires when everything agrees is one people\n * learn to ignore. Production builds drop the call entirely via `isDevMode()`\n * tree-shaking.\n */\n private warnOnLocaleIdDrift(locale: string): void {\n if (this.warnedLocaleIdDrift || locale === this.localeId) return;\n this.warnedLocaleIdDrift = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] WrI18n.use('${locale}') switched the catalog, but LOCALE_ID is still '${this.localeId}'. ` +\n `LOCALE_ID is an Angular constant and WR_DATE_LOCALE resolves from it once at bootstrap, so ` +\n `formatted dates and numbers do not follow the switch and stay on '${this.localeId}': the date ` +\n `adapter (and so wr-calendar / wr-date-picker), the wrDate / wrNumber / wrPlural pipes, ` +\n `wr-input-number, wr-statistic, wr-counter, wr-pagination's total and wr-file-upload's sizes. ` +\n `Reload the app with the new LOCALE_ID to move those, or keep runtime switching to text.`\n );\n }\n\n private loadCatalog(locale: string, scope: string | null): Promise<WrI18nCatalog> {\n const ck = cacheKey(locale, scope);\n const cached = this.catalogs.get(ck);\n if (cached) return Promise.resolve(cached);\n\n const pending = this.inflight.get(ck);\n if (pending) return pending;\n\n const stream: Observable<WrI18nCatalog> = this.loader.load(locale, scope);\n const promise = firstValueFrom(stream)\n .then(catalog => {\n this.catalogs.set(ck, catalog);\n this.revision.update(v => v + 1);\n return catalog;\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line no-console -- intentional diagnostic for missing catalog\n console.warn(`[ngwr/i18n] failed to load (${locale}, ${scope ?? 'root'})`, err);\n const empty: WrI18nCatalog = {};\n this.catalogs.set(ck, empty);\n return empty;\n })\n .finally(() => {\n this.inflight.delete(ck);\n });\n\n this.inflight.set(ck, promise);\n return promise;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Translate a key. Impure — re-evaluates on every CD so locale switches\n * and catalog loads propagate without a manual refresh.\n *\n * @example\n * ```html\n * <h1>{{ 'home.title' | wrT }}</h1>\n * <p>{{ 'greeting' | wrT: { name: user().name } }}</p>\n * <button>{{ 'forms.save' | wrT: null : 'checkout' }}</button>\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- intentional: locale + catalog updates must propagate even when args are stable\n@Pipe({ name: 'wrT', pure: false })\nexport class WrTPipe implements PipeTransform {\n private readonly i18n = inject(WrI18n);\n\n transform(key: string, params?: WrI18nParams | null, scope?: string): string {\n return this.i18n.t(key, params ?? undefined, scope);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, ElementRef, computed, effect, inject, input } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Attribute directive that sets `textContent` of its host to the translation\n * of the bound key. Reactive — re-renders on locale + catalog changes.\n *\n * @example\n * ```html\n * <span [wrT]=\"'home.title'\"></span>\n * <span [wrT]=\"'greeting'\" [wrTParams]=\"{ name: user().name }\"></span>\n * <span [wrT]=\"'forms.save'\" wrTScope=\"checkout\"></span>\n * ```\n */\n@Directive({\n selector: '[wrT]',\n})\nexport class WrTDirective {\n /** Translation key. Required. */\n readonly wrT = input.required<string>();\n\n /** Interpolation params for `{{name}}` tokens. */\n readonly wrTParams = input<WrI18nParams | null>(null);\n\n /** Optional scope — scoped lookup first, then root fallback. */\n readonly wrTScope = input<string | null>(null);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly i18n = inject(WrI18n);\n\n private readonly text = computed(() =>\n this.i18n.t(this.wrT(), this.wrTParams() ?? undefined, this.wrTScope() ?? undefined)\n );\n\n constructor() {\n effect(() => {\n this.host.nativeElement.textContent = this.text();\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Observable, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Root catalogs keyed by locale: `{ en: catalog, ru: catalog, … }`. */\nexport type WrI18nStaticCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/** Per-scope catalogs: `{ checkout: { en: catalog, ru: catalog }, … }`. */\nexport type WrI18nStaticScopedCatalogs = Readonly<Record<string, WrI18nStaticCatalogs>>;\n\n/**\n * Loader for catalogs already in memory (imported from JSON or generated).\n *\n * - Pass `catalogs` for the root catalog of every locale.\n * - Pass `scopes` if you ship per-feature catalogs the loader should serve\n * to `WrI18n.registerScope(name)` calls.\n *\n * Missing locale or scope resolves to `{}` — the missing-key handler then\n * decides what to render.\n */\nexport class WrI18nStaticLoader implements WrI18nLoader {\n constructor(\n private readonly catalogs: WrI18nStaticCatalogs,\n private readonly scopes: WrI18nStaticScopedCatalogs = {}\n ) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n if (scope === null) return of(this.catalogs[locale] ?? {});\n return of(this.scopes[scope]?.[locale] ?? {});\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject } from '@angular/core';\n\nimport { type Observable, catchError, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Configuration for {@link WrI18nHttpLoader}. */\nexport interface WrI18nHttpLoaderConfig {\n /**\n * URL template. Tokens:\n * - `{locale}` — required, BCP-47 tag (e.g. `en`).\n * - `{scope}` — optional, scope name. Use the `rootPath` if you need a\n * different path entirely for the root catalog.\n *\n * @example\n * ```ts\n * { path: '/assets/i18n/{locale}.json' } // root only\n * { path: '/assets/i18n/{scope}/{locale}.json',\n * rootPath: '/assets/i18n/{locale}.json' } // root + scopes\n * ```\n */\n readonly path: string;\n /** Path template for the root catalog. Defaults to `path`. */\n readonly rootPath?: string;\n}\n\n/**\n * Loader that fetches catalogs via `HttpClient`. Failures resolve to `{}`\n * (logged once at the service layer) so a missing file never throws into\n * user code.\n */\nexport class WrI18nHttpLoader implements WrI18nLoader {\n private readonly http = inject(HttpClient);\n\n constructor(private readonly config: WrI18nHttpLoaderConfig) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n const template = scope === null ? (this.config.rootPath ?? this.config.path) : this.config.path;\n const url = template.replace('{locale}', locale).replace('{scope}', scope ?? '');\n return this.http.get<WrI18nCatalog>(url).pipe(catchError(() => of<WrI18nCatalog>({})));\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\n\nimport { WR_I18N_BASE_CATALOGS, type WrI18nBaseCatalogs } from './i18n-base-catalogs';\nimport {\n DEFAULT_WR_I18N_CONFIG,\n WR_I18N_CONFIG,\n type WrI18nConfig,\n type WrI18nConfigResolved,\n resolveWrI18nLocales,\n} from './i18n-config';\nimport { WR_I18N_LOADER, type WrI18nLoader } from './i18n-loader';\nimport { WrI18nHttpLoader, type WrI18nHttpLoaderConfig } from './loaders/http-loader';\nimport {\n WrI18nStaticLoader,\n type WrI18nStaticCatalogs,\n type WrI18nStaticScopedCatalogs,\n} from './loaders/static-loader';\n\n/**\n * Configure {@link WrI18n}. Either pass a `loader` directly, or use the\n * `provideWrI18nHttpLoader` / `provideWrI18nStaticLoader` helpers in the\n * same providers array.\n */\nexport interface ProvideWrI18nOptions extends WrI18nConfig {\n readonly loader?: WrI18nLoader;\n}\n\nexport function provideWrI18n(options: ProvideWrI18nOptions = {}): EnvironmentProviders {\n const { loader, ...config } = options;\n\n const providers: Provider[] = [\n {\n provide: WR_I18N_CONFIG,\n // A factory rather than a value: `defaultLocale` falls back to `LOCALE_ID`,\n // which only an injection context can read.\n useFactory: (): WrI18nConfigResolved => ({\n ...DEFAULT_WR_I18N_CONFIG,\n ...config,\n ...resolveWrI18nLocales(config),\n }),\n },\n ];\n if (loader) providers.push({ provide: WR_I18N_LOADER, useValue: loader });\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Provide a static loader — catalogs already in memory.\n *\n * A loader serves only the catalog you pass it, and ngwr registers none of its\n * own. Pass only your own keys here and register ngwr's catalogs with\n * {@link provideWrI18nBaseCatalogs} — not `{ ...wrRu, ...yours }`. A spread is\n * shallow, so any namespace you share with ngwr, e.g. `common`, `validation`,\n * `table`, keeps only the keys of the side spread last, and the other side's\n * keys stop resolving with nothing logged: ngwr's components fall back to their\n * English defaults, and a `wrT` read of a lost key renders the raw key under the\n * default missing handler.\n *\n * @param catalogs Root catalogs keyed by locale.\n * @param scopes Optional per-scope catalogs served to `registerScope(name)`.\n */\nexport function provideWrI18nStaticLoader(\n catalogs: WrI18nStaticCatalogs,\n scopes?: WrI18nStaticScopedCatalogs\n): Provider {\n return { provide: WR_I18N_LOADER, useValue: new WrI18nStaticLoader(catalogs, scopes) };\n}\n\n/**\n * Register catalogs consulted *underneath* the loader — this is how ngwr's own\n * built-in strings survive when you supply your own catalogs.\n *\n * A loader replaces the catalog for a locale instead of extending it, so a JSON\n * file holding only your keys leaves every built-in label on its hardcoded\n * English fallback, with nothing logged. One line fixes it, on either loader:\n *\n * @example\n * ```ts\n * import { wrRu } from 'ngwr/i18n/ru';\n *\n * providers: [\n * provideWrI18n({ defaultLocale: 'ru', availableLocales: ['ru'] }),\n * provideWrI18nBaseCatalogs({ ru: wrRu }),\n * provideWrI18nHttpLoader({ path: '/assets/i18n/{locale}.json' }),\n * ]\n * ```\n *\n * Pass only the locales you ship — the ones you leave out stay out of the\n * bundle. Your own keys always win; this is a floor, not an override.\n *\n * Use it instead of spreading `wrRu` into your own catalog, too: the lookup\n * walks these key by key after the loader's catalog misses, so a namespace both\n * define keeps both halves, where a shallow spread keeps only one.\n */\nexport function provideWrI18nBaseCatalogs(catalogs: WrI18nBaseCatalogs): Provider {\n return { provide: WR_I18N_BASE_CATALOGS, useValue: catalogs, multi: true };\n}\n\n/** Provide an HTTP loader — catalogs fetched from URLs. Requires `provideHttpClient`. */\nexport function provideWrI18nHttpLoader(config: WrI18nHttpLoaderConfig): Provider {\n return { provide: WR_I18N_LOADER, useFactory: () => new WrI18nHttpLoader(config) };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject, signal } from '@angular/core';\n\nimport { WrI18n, wrInterpolate } from './i18n';\nimport type { WrI18nParams } from './i18n-config';\n\n/**\n * Helper for component default text. Returns a reactive string that:\n *\n * 1. Prefers the consumer's override (an `input<string | null>()` value).\n * 2. Falls back to the i18n catalog under `key` — re-renders on locale\n * change so a switcher updates the DOM live.\n * 3. Falls back to `fallback` when no `WrI18n` is provided OR the catalog\n * is missing the key.\n *\n * Components don't need a hard dependency on `provideWrI18n` — without it,\n * the fallback is returned and everything still works.\n *\n * @example\n * ```ts\n * readonly emptyText = input<string | null>(null);\n * protected readonly empty = useI18nText(this.emptyText, 'table.empty', 'No data');\n *\n * // In template: <div>{{ empty() }}</div>\n * ```\n */\nexport function useI18nText(binding: Signal<string | null | undefined>, key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return computed(() => {\n const v = binding();\n return v ?? fallback;\n });\n }\n\n return computed(() => {\n const v = binding();\n if (v !== null && v !== undefined && v !== '') return v;\n const translated = i18n.t(key);\n // Default missing handler returns the key itself — treat that as \"missing\"\n // and use our explicit fallback.\n return translated === key ? fallback : translated;\n });\n}\n\n/**\n * {@link useI18nText} without a binding to forward — for a built-in string the\n * component exposes no override input for. Same reactivity, same fallback\n * rules; the only difference is the missing first argument.\n *\n * It used to return a plain `string`, resolved once at injection time, and\n * that was wrong in the ordinary case rather than an edge one: `WrI18n` writes\n * every loader-backed catalog from `firstValueFrom(...).then(...)`, so even a\n * static loader serving an object literal lands a microtask AFTER the first\n * change-detection pass. Every component built in that pass read an empty\n * catalog and froze its English fallback for the life of the app — in one\n * `<wr-date-picker>` the field said \"Открыть календарь\" and the calendar\n * button beside it \"Open calendar\", off the same key.\n */\nexport function readI18nText(key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) return computed(() => fallback);\n\n return computed(() => {\n const v = i18n.t(key);\n return v === key ? fallback : v;\n });\n}\n\n/** Tiny shim — useful when the caller doesn't have an `input` to forward. */\nexport function nullSignal(): Signal<null> {\n return signal(null).asReadonly();\n}\n\n/**\n * Build a per-call formatter for parametrized labels (e.g. ARIA labels\n * that interpolate a per-row value: `\"Remove {{label}}\"`). Returns a\n * function the template calls with the params for the current item.\n *\n * The returned function:\n * - Re-resolves the i18n catalog on every call (live locale switches just\n * work — re-rendered templates pick up new strings).\n * - Falls back to the literal `fallback` template with the same\n * `{{name}}` syntax when no `WrI18n` provider is present, or when the\n * key is missing.\n *\n * Use this for labels that vary per row. For static labels, prefer\n * {@link useI18nText} or {@link readI18nText}.\n *\n * @example\n * ```ts\n * protected readonly removeChipLabel = useI18nFormatter('select.removeItem', 'Remove {{label}}');\n *\n * // In template:\n * // [attr.aria-label]=\"removeChipLabel({ label: chip.label })\"\n * ```\n */\nexport function useI18nFormatter(key: string, fallback: string): (params?: WrI18nParams) => string {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return (params?: WrI18nParams) => wrInterpolate(fallback, params);\n }\n return (params?: WrI18nParams) => {\n const v = i18n.t(key, params);\n return v === key ? wrInterpolate(fallback, params) : v;\n };\n}\n","/**\n * Generated bundle index. Do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C;AACJ;AAEA;;;;;;;;;;;;;AAaG;AACG,SAAU,YAAY,CAAC,GAAW,EAAE,QAAgB,EAAA;AACxD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/C,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,QAAQ,CAAC,MAAM,QAAQ,CAAC;IAE1C,OAAO,QAAQ,CAAC,MAAK;QACnB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACrB,OAAO,CAAC,KAAK,GAAG,GAAG,QAAQ,GAAG,CAAC;AACjC,IAAA,CAAC,CAAC;AACJ;AAEA;SACgB,UAAU,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,gBAAgB,CAAC,GAAW,EAAE,QAAgB,EAAA;AAC5D,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,CAAC,MAAqB,KAAK,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC;IACnE;IACA,OAAO,CAAC,MAAqB,KAAI;QAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC;AAC7B,QAAA,OAAO,CAAC,KAAK,GAAG,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;AACxD,IAAA,CAAC;AACH;;AChHA;;AAEG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-icon-adapters-feather.mjs","sources":["../../../projects/lib/icon/adapters/feather/adapter.ts","../../../projects/lib/icon/adapters/feather/public-api.ts","../../../projects/lib/icon/adapters/feather/ngwr-icon-adapters-feather.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from 'ngwr/icon';\n\n/**\n * Default SVG attributes Feather applies to every icon. Kept identical\n * to what `feather.replace()` emits in the browser so visual parity\n * with upstream is preserved.\n */\nconst SVG_ATTRS = [\n 'xmlns=\"http://www.w3.org/2000/svg\"',\n 'width=\"24\"',\n 'height=\"24\"',\n 'viewBox=\"0 0 24 24\"',\n 'fill=\"none\"',\n 'stroke=\"currentColor\"',\n 'stroke-width=\"2\"',\n 'stroke-linecap=\"round\"',\n 'stroke-linejoin=\"round\"',\n 'class=\"wr-icon__svg feather\"',\n].join(' ');\n\n/**\n * Wrap a single Feather icon (inner SVG markup) in a {@link WrIconDef}\n * envelope. Pair with the upstream `icons.json` map.\n *\n * @example\n * ```ts\n * import { feather } from 'ngwr/icon/adapters/feather';\n * // feather-icons ships an inner-SVG-only map under dist/icons.json:\n * // { \"plus\": \"<line .../><line .../>\", \"trash\": \"...\", ... }\n * import featherIcons from 'feather-icons/dist/icons.json';\n *\n * provideWrIcons([feather('plus', featherIcons.plus)]);\n * ```\n *\n * `innerSvg` is **markup**, not text — that is the shape upstream ships and the\n * reason this adapter exists — so it is interpolated into the envelope\n * verbatim. There is no escaping to add here: escaped markup is not markup.\n * A `</svg>` in that input therefore closes the envelope early, and everything\n * after it is a sibling of the icon rather than a child. Nothing executes\n * regardless, because `<wr-icon>` never assigns the result to `innerHTML` — it\n * rebuilds the first `<svg>` root from an allowlist and drops the rest. Feed\n * this a map fetched at runtime and the sanitizer is what stands between it and\n * the app's origin; feed it the `icons.json` from your own node_modules and\n * neither matters.\n */\nfunction feather(name: string, innerSvg: string): WrIconDef {\n return { name, data: `<svg ${SVG_ATTRS}>${innerSvg}</svg>` };\n}\n\n/**\n * Bulk variant — pass a `{ alias: innerSvg }` object. Aliases (the\n * keys) become the registry names so you can use shorter or\n * project-specific names.\n *\n * @example\n * ```ts\n * import { featherIcons } from 'ngwr/icon/adapters/feather';\n * import featherSource from 'feather-icons/dist/icons.json';\n *\n * provideWrIcons(featherIcons({\n * plus: featherSource.plus,\n * trash: featherSource.trash,\n * x: featherSource.x,\n * }));\n * ```\n */\nfunction featherIcons(icons: Record<string, string>): WrIconDef[] {\n return Object.entries(icons).map(([name, innerSvg]) => feather(name, innerSvg));\n}\n\nexport { feather, featherIcons };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { feather, featherIcons } from './adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAIH;;;;AAIG;AACH,MAAM,SAAS,GAAG;IAChB,oCAAoC;IACpC,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,aAAa;IACb,uBAAuB;IACvB,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,8BAA8B;AAC/B,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACH,SAAS,OAAO,CAAC,IAAY,EAAE,QAAgB,EAAA;IAC7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA,KAAA,EAAQ,SAAS,CAAA,CAAA,EAAI,QAAQ,CAAA,MAAA,CAAQ,EAAE;AAC9D;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,YAAY,CAAC,KAA6B,EAAA;IACjD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACjF;;AC3EA;;;;;AAKG;;ACLH;;AAEG
|
|
1
|
+
{"version":3,"file":"ngwr-icon-adapters-feather.mjs","sources":["../../../projects/lib/icon/adapters/feather/adapter.ts","../../../projects/lib/icon/adapters/feather/public-api.ts","../../../projects/lib/icon/adapters/feather/ngwr-icon-adapters-feather.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from 'ngwr/icon';\n\n/**\n * Default SVG attributes Feather applies to every icon. Kept identical\n * to what `feather.replace()` emits in the browser so visual parity\n * with upstream is preserved.\n */\nconst SVG_ATTRS = [\n 'xmlns=\"http://www.w3.org/2000/svg\"',\n 'width=\"24\"',\n 'height=\"24\"',\n 'viewBox=\"0 0 24 24\"',\n 'fill=\"none\"',\n 'stroke=\"currentColor\"',\n 'stroke-width=\"2\"',\n 'stroke-linecap=\"round\"',\n 'stroke-linejoin=\"round\"',\n 'class=\"wr-icon__svg feather\"',\n].join(' ');\n\n/**\n * Wrap a single Feather icon (inner SVG markup) in a {@link WrIconDef}\n * envelope. Pair with the upstream `icons.json` map.\n *\n * @example\n * ```ts\n * import { feather } from 'ngwr/icon/adapters/feather';\n * // feather-icons ships an inner-SVG-only map under dist/icons.json:\n * // { \"plus\": \"<line .../><line .../>\", \"trash\": \"...\", ... }\n * import featherIcons from 'feather-icons/dist/icons.json';\n *\n * provideWrIcons([feather('plus', featherIcons.plus)]);\n * ```\n *\n * `innerSvg` is **markup**, not text — that is the shape upstream ships and the\n * reason this adapter exists — so it is interpolated into the envelope\n * verbatim. There is no escaping to add here: escaped markup is not markup.\n * A `</svg>` in that input therefore closes the envelope early, and everything\n * after it is a sibling of the icon rather than a child. Nothing executes\n * regardless, because `<wr-icon>` never assigns the result to `innerHTML` — it\n * rebuilds the first `<svg>` root from an allowlist and drops the rest. Feed\n * this a map fetched at runtime and the sanitizer is what stands between it and\n * the app's origin; feed it the `icons.json` from your own node_modules and\n * neither matters.\n */\nfunction feather(name: string, innerSvg: string): WrIconDef {\n return { name, data: `<svg ${SVG_ATTRS}>${innerSvg}</svg>` };\n}\n\n/**\n * Bulk variant — pass a `{ alias: innerSvg }` object. Aliases (the\n * keys) become the registry names so you can use shorter or\n * project-specific names.\n *\n * @example\n * ```ts\n * import { featherIcons } from 'ngwr/icon/adapters/feather';\n * import featherSource from 'feather-icons/dist/icons.json';\n *\n * provideWrIcons(featherIcons({\n * plus: featherSource.plus,\n * trash: featherSource.trash,\n * x: featherSource.x,\n * }));\n * ```\n */\nfunction featherIcons(icons: Record<string, string>): WrIconDef[] {\n return Object.entries(icons).map(([name, innerSvg]) => feather(name, innerSvg));\n}\n\nexport { feather, featherIcons };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { feather, featherIcons } from './adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAIH;;;;AAIG;AACH,MAAM,SAAS,GAAG;IAChB,oCAAoC;IACpC,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,aAAa;IACb,uBAAuB;IACvB,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,8BAA8B;AAC/B,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACH,SAAS,OAAO,CAAC,IAAY,EAAE,QAAgB,EAAA;IAC7C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA,KAAA,EAAQ,SAAS,CAAA,CAAA,EAAI,QAAQ,CAAA,MAAA,CAAQ,EAAE;AAC9D;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,YAAY,CAAC,KAA6B,EAAA;IACjD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACjF;;AC3EA;;;;;AAKG;;ACLH;;AAEG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-icon-adapters-lucide.mjs","sources":["../../../projects/lib/icon/adapters/lucide/adapter.ts","../../../projects/lib/icon/adapters/lucide/public-api.ts","../../../projects/lib/icon/adapters/lucide/ngwr-icon-adapters-lucide.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from 'ngwr/icon';\n\n/**\n * Shape of a `lucide` icon export — an array of `[tag, attrs]` tuples\n * representing the inner SVG children. The outer `<svg>` wrapper is\n * added by the adapter when converting to a {@link WrIconDef}.\n */\ntype LucideIconNode = readonly (readonly [string, Record<string, string | number | undefined>])[];\n\n/**\n * Default SVG attributes Lucide applies to every icon. Kept identical\n * to what the `lucide` package's `createElement` would emit so visual\n * parity with upstream is preserved.\n */\nconst SVG_ATTRS = [\n 'xmlns=\"http://www.w3.org/2000/svg\"',\n 'width=\"24\"',\n 'height=\"24\"',\n 'viewBox=\"0 0 24 24\"',\n 'fill=\"none\"',\n 'stroke=\"currentColor\"',\n 'stroke-width=\"2\"',\n 'stroke-linecap=\"round\"',\n 'stroke-linejoin=\"round\"',\n 'class=\"wr-icon__svg lucide\"',\n].join(' ');\n\n/**\n * Wrap a single Lucide icon in the {@link WrIconDef} envelope. Use this\n * when you need fine-grained control over the registered name, or when\n * the bulk {@link lucideIcons} helper isn't a good fit.\n *\n * @example\n * ```ts\n * import { Plus } from 'lucide';\n * import { lucide } from 'ngwr/icon/adapters/lucide';\n *\n * provideWrIcons([lucide('plus', Plus)]);\n * ```\n */\nfunction lucide(name: string, children: LucideIconNode): WrIconDef {\n const inner = children.map(renderChild).join('');\n return { name, data: `<svg ${SVG_ATTRS}>${inner}</svg>` };\n}\n\n/**\n * Wrap a bag of Lucide icons in one shot. Keys become the registered\n * names **verbatim** — exactly what you pass to `<wr-icon name>` — matching\n * the singular `lucide()` helper and the other adapters. Kebab-case by\n * convention, so quote multi-word keys (`'chevron-down'`). Values are the\n * upstream IconNode tuples.\n *\n * Tree-shaking: every `Plus`, `Trash`, … import lives in *your* file\n * — ngwr ships only this wrapper, not the icon data. Unused icons in\n * `lucide` itself get dropped by the bundler.\n *\n * @example\n * ```ts\n * import { Plus, Trash, ChevronDown } from 'lucide';\n * import { lucideIcons } from 'ngwr/icon/adapters/lucide';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWrIcons(lucideIcons({ plus: Plus, trash: Trash, 'chevron-down': ChevronDown })),\n * ],\n * });\n * ```\n */\nfunction lucideIcons(icons: Record<string, LucideIconNode>): WrIconDef[] {\n return Object.entries(icons).map(([name, node]) => lucide(name, node));\n}\n\n/**\n * A tag or attribute name that can only ever be a name.\n *\n * `renderChild` builds markup by concatenation, so a name carrying a quote, a\n * space or an `=` does not become a strangely-named attribute — it closes the\n * one being written and opens whatever comes next, which is how\n * `{ 'href': 'x\" onerror=\"…' }`'s sibling, a hostile KEY, injects a handler\n * through an API whose signature says `Record<string, string | number>`.\n * Escaping cannot help a name: `onerror` is a perfectly valid name and the only\n * honest serialisation of it is `onerror=\"…\"`. So names are constrained and\n * values are escaped, and it is {@link sanitizeIcon} at the render sink that\n * refuses `onerror` itself.\n */\nconst NAME_RE = /^[A-Za-z_][\\w.:-]*$/;\n\n/** The four characters that can leave an attribute value or a tag body. */\nfunction escapeAttribute(value: string | number): string {\n return String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\n}\n\nfunction renderChild([tag, attrs]: readonly [string, Record<string, string | number | undefined>]): string {\n if (!NAME_RE.test(tag)) return '';\n\n const rendered = Object.entries(attrs)\n .filter((entry): entry is [string, string | number] => entry[1] !== undefined && NAME_RE.test(entry[0]))\n .map(([key, value]) => `${key}=\"${escapeAttribute(value)}\"`)\n .join(' ');\n return `<${tag} ${rendered}/>`;\n}\n\nexport { lucide, lucideIcons, type LucideIconNode };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { lucide, lucideIcons, type LucideIconNode } from './adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAWH;;;;AAIG;AACH,MAAM,SAAS,GAAG;IAChB,oCAAoC;IACpC,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,aAAa;IACb,uBAAuB;IACvB,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,6BAA6B;AAC9B,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;;;;;;;;;;AAYG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,QAAwB,EAAA;AACpD,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA,KAAA,EAAQ,SAAS,CAAA,CAAA,EAAI,KAAK,CAAA,MAAA,CAAQ,EAAE;AAC3D;AAEA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACH,SAAS,WAAW,CAAC,KAAqC,EAAA;IACxD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxE;AAEA;;;;;;;;;;;;AAYG;AACH,MAAM,OAAO,GAAG,qBAAqB;AAErC;AACA,SAAS,eAAe,CAAC,KAAsB,EAAA;AAC7C,IAAA,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;AACjH;AAEA,SAAS,WAAW,CAAC,CAAC,GAAG,EAAE,KAAK,CAAiE,EAAA;AAC/F,IAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,EAAE;AAEjC,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK;SAClC,MAAM,CAAC,CAAC,KAAK,KAAyC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtG,SAAA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAA,EAAG,GAAG,CAAA,EAAA,EAAK,eAAe,CAAC,KAAK,CAAC,GAAG;SAC1D,IAAI,CAAC,GAAG,CAAC;AACZ,IAAA,OAAO,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,EAAI,QAAQ,IAAI;AAChC;;AC3GA;;;;;AAKG;;ACLH;;AAEG
|
|
1
|
+
{"version":3,"file":"ngwr-icon-adapters-lucide.mjs","sources":["../../../projects/lib/icon/adapters/lucide/adapter.ts","../../../projects/lib/icon/adapters/lucide/public-api.ts","../../../projects/lib/icon/adapters/lucide/ngwr-icon-adapters-lucide.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from 'ngwr/icon';\n\n/**\n * Shape of a `lucide` icon export — an array of `[tag, attrs]` tuples\n * representing the inner SVG children. The outer `<svg>` wrapper is\n * added by the adapter when converting to a {@link WrIconDef}.\n */\ntype LucideIconNode = readonly (readonly [string, Record<string, string | number | undefined>])[];\n\n/**\n * Default SVG attributes Lucide applies to every icon. Kept identical\n * to what the `lucide` package's `createElement` would emit so visual\n * parity with upstream is preserved.\n */\nconst SVG_ATTRS = [\n 'xmlns=\"http://www.w3.org/2000/svg\"',\n 'width=\"24\"',\n 'height=\"24\"',\n 'viewBox=\"0 0 24 24\"',\n 'fill=\"none\"',\n 'stroke=\"currentColor\"',\n 'stroke-width=\"2\"',\n 'stroke-linecap=\"round\"',\n 'stroke-linejoin=\"round\"',\n 'class=\"wr-icon__svg lucide\"',\n].join(' ');\n\n/**\n * Wrap a single Lucide icon in the {@link WrIconDef} envelope. Use this\n * when you need fine-grained control over the registered name, or when\n * the bulk {@link lucideIcons} helper isn't a good fit.\n *\n * @example\n * ```ts\n * import { Plus } from 'lucide';\n * import { lucide } from 'ngwr/icon/adapters/lucide';\n *\n * provideWrIcons([lucide('plus', Plus)]);\n * ```\n */\nfunction lucide(name: string, children: LucideIconNode): WrIconDef {\n const inner = children.map(renderChild).join('');\n return { name, data: `<svg ${SVG_ATTRS}>${inner}</svg>` };\n}\n\n/**\n * Wrap a bag of Lucide icons in one shot. Keys become the registered\n * names **verbatim** — exactly what you pass to `<wr-icon name>` — matching\n * the singular `lucide()` helper and the other adapters. Kebab-case by\n * convention, so quote multi-word keys (`'chevron-down'`). Values are the\n * upstream IconNode tuples.\n *\n * Tree-shaking: every `Plus`, `Trash`, … import lives in *your* file\n * — ngwr ships only this wrapper, not the icon data. Unused icons in\n * `lucide` itself get dropped by the bundler.\n *\n * @example\n * ```ts\n * import { Plus, Trash, ChevronDown } from 'lucide';\n * import { lucideIcons } from 'ngwr/icon/adapters/lucide';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWrIcons(lucideIcons({ plus: Plus, trash: Trash, 'chevron-down': ChevronDown })),\n * ],\n * });\n * ```\n */\nfunction lucideIcons(icons: Record<string, LucideIconNode>): WrIconDef[] {\n return Object.entries(icons).map(([name, node]) => lucide(name, node));\n}\n\n/**\n * A tag or attribute name that can only ever be a name.\n *\n * `renderChild` builds markup by concatenation, so a name carrying a quote, a\n * space or an `=` does not become a strangely-named attribute — it closes the\n * one being written and opens whatever comes next, which is how\n * `{ 'href': 'x\" onerror=\"…' }`'s sibling, a hostile KEY, injects a handler\n * through an API whose signature says `Record<string, string | number>`.\n * Escaping cannot help a name: `onerror` is a perfectly valid name and the only\n * honest serialisation of it is `onerror=\"…\"`. So names are constrained and\n * values are escaped, and it is {@link sanitizeIcon} at the render sink that\n * refuses `onerror` itself.\n */\nconst NAME_RE = /^[A-Za-z_][\\w.:-]*$/;\n\n/** The four characters that can leave an attribute value or a tag body. */\nfunction escapeAttribute(value: string | number): string {\n return String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"');\n}\n\nfunction renderChild([tag, attrs]: readonly [string, Record<string, string | number | undefined>]): string {\n if (!NAME_RE.test(tag)) return '';\n\n const rendered = Object.entries(attrs)\n .filter((entry): entry is [string, string | number] => entry[1] !== undefined && NAME_RE.test(entry[0]))\n .map(([key, value]) => `${key}=\"${escapeAttribute(value)}\"`)\n .join(' ');\n return `<${tag} ${rendered}/>`;\n}\n\nexport { lucide, lucideIcons, type LucideIconNode };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { lucide, lucideIcons, type LucideIconNode } from './adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAWH;;;;AAIG;AACH,MAAM,SAAS,GAAG;IAChB,oCAAoC;IACpC,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,aAAa;IACb,uBAAuB;IACvB,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,6BAA6B;AAC9B,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;;;;;;;;;;;;AAYG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,QAAwB,EAAA;AACpD,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IA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AAI,GAAG,CAAA,CAAA,EAAI,QAAQ,IAAI;AAChC;;AC3GA;;;;;AAKG;;ACLH;;AAEG;;"}
|
package/fesm2022/ngwr-icon.mjs
CHANGED
|
@@ -54,10 +54,10 @@ class WrIconRegistry {
|
|
|
54
54
|
}
|
|
55
55
|
return map;
|
|
56
56
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
58
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrIconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrIconRegistry });
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrIconRegistry, decorators: [{
|
|
61
61
|
type: Injectable
|
|
62
62
|
}] });
|
|
63
63
|
|
|
@@ -584,10 +584,10 @@ class WrIcon {
|
|
|
584
584
|
`<foreignObject>, <a>, SMIL animation and non-fragment hrefs never reach the DOM.`);
|
|
585
585
|
}
|
|
586
586
|
static reported = new WeakSet();
|
|
587
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
588
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
587
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
588
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: WrIcon, isStandalone: true, selector: "wr-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.data-icon": "name()" }, classAttribute: "wr-icon" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
589
589
|
}
|
|
590
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrIcon, decorators: [{
|
|
591
591
|
type: Component,
|
|
592
592
|
args: [{
|
|
593
593
|
selector: 'wr-icon',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-icon.mjs","sources":["../../../projects/lib/icon/tokens/icon.token.ts","../../../projects/lib/icon/icon-registry.ts","../../../projects/lib/icon/utils/sanitize-icon.ts","../../../projects/lib/icon/utils/validate-icon.ts","../../../projects/lib/icon/icon.ts","../../../projects/lib/icon/providers/provide-wr-icons.ts","../../../projects/lib/icon/svg-icon.ts","../../../projects/lib/icon/ngwr-icon.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrIconDef } from '../interfaces';\n\n/**\n * Multi-provider token for registering icons with the icon registry.\n *\n * Use {@link provideWrIcons} instead of providing this token directly.\n *\n * @internal\n */\nexport const WR_ICONS = new InjectionToken<readonly WrIconDef[][]>('WR_ICONS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, inject } from '@angular/core';\n\nimport type { WrIconDef } from './interfaces';\nimport { WR_ICONS } from './tokens';\n\n/**\n * One link in the icon-registry chain. {@link provideWrIcons} provides an\n * instance alongside its icons, so every injector level that registers icons\n * gets its own link whose parent is the next registering level above it.\n *\n * This exists because Angular does not merge `multi: true` providers across\n * injector levels — an element-level `provideWrIcons()` *replaces* the visible\n * `WR_ICONS` collection rather than adding to it. Reading only the closest\n * contribution silently hid every icon registered further up, which contradicts\n * the \"each call adds to the registry\" contract. Walking the chain restores it\n * for any number of levels.\n *\n * @internal\n */\n@Injectable()\nexport class WrIconRegistry {\n /** The next registering level up, if any. */\n private readonly parent = inject(WrIconRegistry, { skipSelf: true, optional: true });\n\n /** Icons registered at *this* level only. */\n private readonly own = inject(WR_ICONS, { self: true, optional: true }) ?? [];\n\n /**\n * Every icon visible from this level, nearest last so a local registration\n * wins over an identically named one further up.\n */\n resolve(): Map<string, WrIconDef> {\n const map = this.parent?.resolve() ?? new Map<string, WrIconDef>();\n for (const set of this.own) {\n for (const icon of set) map.set(icon.name, icon);\n }\n return map;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\nconst XLINK_NS = 'http://www.w3.org/1999/xlink';\n\n/**\n * SVG elements an icon may be built from.\n *\n * Derived from the real sets rather than guessed: across the 12 459 SVG files\n * under `icon/_svg` (Lucide, Phosphor, Tabler, Heroicons), the whole of\n * `feather-icons`' `icons.json` and every `lucide` IconNode, only eight\n * elements ever appear — `svg`, `path`, `circle`, `line`, `rect`, `polyline`,\n * `polygon`, `ellipse`. The rest of this list is headroom for the icons a\n * consumer draws themselves: grouping, `<defs>` with gradients, a clip path, a\n * mask, a `<title>`, real `<text>`.\n *\n * What is deliberately absent is the entire scripting surface:\n *\n * - `<script>` — obvious, and the one vector `innerHTML` already refused;\n * - `<foreignObject>` — an XHTML escape hatch, so `<img onerror>` inside an\n * otherwise well-formed icon;\n * - `<image>` — its `onerror` fires on any unreachable `href`, which is the\n * cheapest handler to land, and no real icon set uses it;\n * - `<a>` — a `javascript:` href inside a glyph the user is invited to click;\n * - `<animate>` / `<set>` / `<animateTransform>` / `<animateMotion>` — SMIL can\n * retarget another element's `href` at a `javascript:` URL;\n * - `<style>` — arbitrary CSS in the app's origin, including `url()` requests;\n * - `<filter>` and the `fe*` primitives — `<feImage href>` is another external\n * fetch, and no icon set in the corpus filters.\n *\n * @internal\n */\nconst ELEMENTS: ReadonlySet<string> = new Set([\n 'svg',\n 'g',\n 'defs',\n 'symbol',\n 'use',\n 'title',\n 'desc',\n 'path',\n 'circle',\n 'ellipse',\n 'line',\n 'polyline',\n 'polygon',\n 'rect',\n 'text',\n 'tspan',\n 'textPath',\n 'linearGradient',\n 'radialGradient',\n 'stop',\n 'clipPath',\n 'mask',\n 'pattern',\n]);\n\n/**\n * Attributes an icon may carry, allowed on every element it is allowed on.\n *\n * An allowlist rather than a blocklist, so `onload`, `onerror`, `onclick` and\n * every other handler — including ones no browser has shipped yet — are gone by\n * construction rather than by enumeration.\n *\n * `style` is NOT here, and that is a decision rather than an oversight: not one\n * icon in the corpus uses it, and a `style` attribute is arbitrary CSS in the\n * app's origin. Anything a `style` would have done, a presentation attribute\n * does.\n *\n * @internal\n */\nconst ATTRIBUTES: ReadonlySet<string> = new Set([\n // geometry\n 'viewBox',\n 'preserveAspectRatio',\n 'transform',\n 'transform-origin',\n 'd',\n 'pathLength',\n 'cx',\n 'cy',\n 'r',\n 'rx',\n 'ry',\n 'x',\n 'y',\n 'x1',\n 'y1',\n 'x2',\n 'y2',\n 'dx',\n 'dy',\n 'width',\n 'height',\n 'points',\n // paint servers, clips and masks\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n 'offset',\n 'fx',\n 'fy',\n 'fr',\n 'patternUnits',\n 'patternContentUnits',\n 'patternTransform',\n 'maskUnits',\n 'maskContentUnits',\n 'clipPathUnits',\n // presentation\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'stroke',\n 'stroke-width',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-opacity',\n 'opacity',\n 'color',\n 'clip-path',\n 'clip-rule',\n 'mask',\n 'paint-order',\n 'vector-effect',\n 'shape-rendering',\n 'stop-color',\n 'stop-opacity',\n 'display',\n 'visibility',\n 'overflow',\n 'isolation',\n 'mix-blend-mode',\n // text\n 'startOffset',\n 'textLength',\n 'lengthAdjust',\n 'text-anchor',\n 'dominant-baseline',\n 'alignment-baseline',\n 'baseline-shift',\n 'font-family',\n 'font-size',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'letter-spacing',\n 'word-spacing',\n 'writing-mode',\n 'direction',\n // identity, accessibility and document plumbing\n 'id',\n 'class',\n 'role',\n 'aria-hidden',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-roledescription',\n 'focusable',\n 'lang',\n 'version',\n 'baseProfile',\n 'xmlns',\n 'xmlns:xlink',\n 'xml:space',\n 'xml:lang',\n // resolved against ONLY_FRAGMENT below, never free-form\n 'href',\n 'xlink:href',\n]);\n\n/**\n * `href` may point at a fragment in the same document and nowhere else — that\n * is the whole legitimate use inside an icon (`<use href=\"#glyph\">`), and it\n * excludes `javascript:`, `data:` and every remote fetch in one rule.\n */\nconst FRAGMENT_ONLY: ReadonlySet<string> = new Set(['href', 'xlink:href']);\n\n/** A same-document fragment reference: `#id`, and nothing that is not one. */\nconst FRAGMENT_RE = /^#[^\\s]+$/;\n\n/**\n * `url(` inside a presentation attribute is a reference to a paint server, a\n * clip path or a mask. Those are fragment references too; a remote one is at\n * best a request the page did not ask for.\n */\nconst URL_FN_RE = /url\\(/i;\nconst URL_FRAGMENT_RE = /^url\\(\\s*(['\"]?)#[^\\s'\")]+\\1\\s*\\)$/i;\n\n/**\n * Icons are shallow — the deepest in the corpus nests three levels. The cap is\n * there so a hostile registration cannot recurse this function into a stack\n * overflow; content below it is dropped, not truncated silently, because\n * {@link WrIconStripReport} names what went.\n */\nconst MAX_DEPTH = 16;\n\n/**\n * What {@link sanitizeIcon} refused, for the dev-mode warning. Collecting is\n * opt-in so the render path does no bookkeeping in production.\n *\n * @internal\n */\ninterface WrIconStripReport {\n readonly elements: Set<string>;\n readonly attributes: Set<string>;\n}\n\n/**\n * Build a live `<svg>` element out of a registered icon's markup, keeping only\n * what an icon legitimately needs.\n *\n * `<wr-icon>` used to assign `icon.data` to `innerHTML`, which executes an\n * `onload` on the root, an `<image onerror>`, an `<img>` smuggled in after a\n * closed `</svg>`, and anything inside a `<foreignObject>` — with the app's own\n * origin, in a production build. The library already refuses exactly this next\n * door: `<wr-markdown>` escapes raw HTML because its input is untrusted by\n * construction and one `<img onerror>` is the whole cost of being wrong. Icon\n * data arrives from `provideWrIcons()`, which a multi-tenant app or a fetched\n * icon pack fills at runtime, so it is untrusted the same way.\n *\n * Three properties do the work, and none of them is a filter over known-bad\n * strings:\n *\n * 1. **Parsed inert, never inserted.** The markup is parsed into a document\n * with no browsing context, so nothing loads and nothing runs even before it\n * is inspected.\n * 2. **Only the first `<svg>` survives.** An icon IS an SVG element, so\n * everything beside the root is dropped — which is what makes\n * `</svg><img src=x onerror=…>` inert regardless of what the payload says,\n * and it is the same shape as the `feather()` shell escape.\n * 3. **Rebuilt, not filtered.** Every element and attribute that lands in the\n * document is one this file created from an allowlist. Nothing is\n * transferred from the parsed tree, so there is no attribute an unfamiliar\n * payload can smuggle past a matcher.\n *\n * A refused element takes its subtree with it rather than having its children\n * hoisted into its parent. Hoisting would preserve more of a hand-drawn icon\n * wrapped in something unsupported, and it is exactly the kind of cleverness\n * that makes \"what does the output contain\" depend on what the parser saw. The\n * blunt rule is the reviewable one, and the dev-mode warning names what went.\n *\n * `DomSanitizer.sanitize(SecurityContext.HTML, …)` is not an option here, which\n * is worth recording so it is not re-proposed: Angular's HTML allowlist\n * (`VOID_ELEMENTS`, `BLOCK_ELEMENTS`, `INLINE_ELEMENTS`) contains no SVG\n * element at all. Run against real Lucide, Feather and Heroicons icons it does\n * not merely drop presentation attributes — it returns the empty string.\n *\n * @returns the rebuilt element, or `null` when the data holds no `<svg>` root.\n * @internal\n */\nfunction sanitizeIcon(doc: Document, data: string, report?: WrIconStripReport): SVGElement | null {\n const source = parseInert(doc, data);\n return source ? copy(doc, source, report, 0) : null;\n}\n\n/**\n * Parse into a document that cannot run anything.\n *\n * `DOMParser` is the path every browser and the unit-test DOM take: it takes a\n * plain string, so it is not a Trusted Types sink, and its result has no\n * browsing context. It does not exist under SSR — `@angular/platform-server`\n * renders into domino — so the server falls back to a detached `<template>`,\n * whose content is a separate inert document for the same reason. That branch\n * is unreachable in a browser, which is what keeps the innerHTML write out of\n * the only place Trusted Types is enforced.\n *\n * Both parsers were checked to agree on the part that matters: the HTML\n * parser's foreign-content adjustment restores the camel case of `viewBox`,\n * `clipPath`, `linearGradient`, `gradientTransform`, `textPath` and puts\n * `xlink:href` in the xlink namespace.\n */\nfunction parseInert(doc: Document, data: string): Element | null {\n const parser = doc.defaultView?.DOMParser;\n if (parser) return firstSvg(new parser().parseFromString(data, 'text/html').body);\n\n const template = doc.createElement('template');\n template.innerHTML = data;\n return firstSvg(template.content);\n}\n\n/**\n * The first `<svg>` in document order, found by walking rather than by\n * `querySelector`.\n *\n * Two reasons, and the second is the one that matters. A control that decides\n * what may execute should not route that decision through a selector engine —\n * `localName === 'svg'` is a comparison anyone can check, and CSS parsing is a\n * layer with its own history. The first reason is merely that it is faster:\n * jsdom's engine costs 4 ms on a document this size, which the unit suite pays\n * on every rendered icon.\n */\nfunction firstSvg(root: Node): Element | null {\n const children = root.childNodes;\n for (let i = 0, n = children.length; i < n; i++) {\n const child = children[i];\n if (child.nodeType !== 1) continue;\n const element = child as Element;\n if (element.localName === 'svg') return element;\n const nested = firstSvg(element);\n if (nested) return nested;\n }\n return null;\n}\n\n/** Recreate one element, then its allowed children, in the live document. */\nfunction copy(doc: Document, source: Element, report: WrIconStripReport | undefined, depth: number): SVGElement {\n const el = doc.createElementNS(SVG_NS, source.localName);\n\n const attributes = source.attributes;\n for (let i = 0, n = attributes.length; i < n; i++) {\n const { name, value } = attributes[i];\n if (!isAllowedAttribute(name, value)) {\n report?.attributes.add(name);\n continue;\n }\n if (name === 'xlink:href') el.setAttributeNS(XLINK_NS, name, value);\n else el.setAttribute(name, value);\n }\n\n if (depth >= MAX_DEPTH) {\n // Named, not silent — the cap is the one rule here that can bite an icon\n // nobody meant as an attack, and a truncated glyph should say so.\n if (source.childNodes.length > 0) report?.elements.add(`… deeper than ${MAX_DEPTH} levels`);\n return el;\n }\n\n const children = source.childNodes;\n for (let i = 0, n = children.length; i < n; i++) {\n const child = children[i];\n // Text, so `<title>`, `<desc>` and `<text>` keep saying what they said.\n // Comments, CDATA and processing instructions are dropped: an icon has no\n // use for them and a comment is a place to hide a payload from a reader.\n if (child.nodeType === 3) {\n el.appendChild(doc.createTextNode(child.nodeValue ?? ''));\n continue;\n }\n if (child.nodeType !== 1) continue;\n\n const element = child as Element;\n if (!ELEMENTS.has(element.localName)) {\n report?.elements.add(element.localName);\n continue;\n }\n el.appendChild(copy(doc, element, report, depth + 1));\n }\n\n return el;\n}\n\nfunction isAllowedAttribute(name: string, value: string): boolean {\n // `data-*` is a styling and testing hook that can never be behavioural.\n if (name.startsWith('data-')) return true;\n if (!ATTRIBUTES.has(name)) return false;\n if (FRAGMENT_ONLY.has(name)) return FRAGMENT_RE.test(value.trim());\n if (URL_FN_RE.test(value)) return URL_FRAGMENT_RE.test(value.trim());\n return true;\n}\n\nexport { sanitizeIcon, type WrIconStripReport };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from '../interfaces';\n\nconst VIEW_BOX_RE = /<svg\\b[^>]*\\bviewBox\\s*=/i;\nconst SVG_ROOT_RE = /<svg\\b/i;\n\n/**\n * Dev-mode sanity check for a registered icon — a **rendering** check, and\n * explicitly not a security control.\n *\n * It warns about the two things that make an icon come out wrong: no `<svg>`\n * root, and no `viewBox`, which stops the glyph scaling to the host. It reads\n * the string with two regexes and cannot tell a shape from a script — every\n * payload in the icon corpus passes it, because each one does carry an `<svg>`\n * root with a `viewBox`. It also runs only under `isDevMode()`, so it is absent\n * from the build an attacker would meet.\n *\n * What actually keeps hostile markup out of the DOM is {@link sanitizeIcon},\n * which runs on every render in every build: `<wr-icon>` rebuilds the glyph\n * from an allowlist instead of assigning to `innerHTML`. Anything this function\n * would have to reject is already gone by then, and the component says so in\n * dev mode when it drops something.\n *\n * Production builds drop the call entirely via `isDevMode()` tree-shaking.\n *\n * @internal\n */\nexport function validateIcon(icon: WrIconDef): void {\n if (!SVG_ROOT_RE.test(icon.data)) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] Icon \"${icon.name}\" data does not contain an <svg> root element. ` +\n `Custom icons must be valid SVG markup.`\n );\n return;\n }\n\n if (!VIEW_BOX_RE.test(icon.data)) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] Icon \"${icon.name}\" has no viewBox attribute — it won't scale ` +\n `to the host size. Add viewBox=\"0 0 W H\" to the <svg> root.`\n );\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode } from '@angular/core';\n\nimport { WrIconRegistry } from './icon-registry';\nimport type { WrIconDef, WrIconName } from './interfaces';\nimport { type WrIconStripReport, sanitizeIcon } from './utils';\n\n/**\n * Renders a registered SVG icon.\n *\n * Icons must be registered via {@link provideWrIcons} before use —\n * either at the application root or on any ancestor component.\n *\n * @example\n * ```html\n * <wr-icon name=\"home\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/icon\n */\n@Component({\n selector: 'wr-icon',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-icon',\n '[attr.data-icon]': 'name()',\n },\n})\nexport class WrIcon {\n readonly name = input.required<WrIconName>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n\n /**\n * Every icon visible from this position, walked up the whole chain of\n * registering injector levels.\n *\n * Angular's `inject(WR_ICONS)` returns only the **closest** injector's\n * contribution — `multi` providers are not merged across levels — so a\n * component that registers its own icons used to shadow, not extend, what an\n * ancestor registered. {@link WrIconRegistry} is provided once per\n * registering level and links to its parent, so nesting any number of levels\n * now adds up, with the nearest registration winning a name collision.\n *\n * Optional: with no `provideWrIcons()` anywhere the map is simply empty and\n * every name reports as unregistered.\n */\n private readonly iconRegistry = inject(WrIconRegistry, { optional: true });\n\n private readonly registry = computed<ReadonlyMap<WrIconName, WrIconDef>>(\n () => (this.iconRegistry?.resolve() ?? new Map()) as ReadonlyMap<WrIconName, WrIconDef>\n );\n\n private readonly icon = computed(() => this.registry().get(this.name()));\n\n constructor() {\n effect(() => {\n const icon = this.icon();\n const name = this.name();\n\n if (!icon) {\n if (isDevMode()) {\n // Reported, never thrown. An exception here escapes into\n // `runEffectsInView`, which abandons the remaining effects of the\n // whole view — one unknown name would blank every `<wr-icon>` after\n // it while the console blamed only the first. Error level (not\n // `badgeLog`) so it survives a console filtered to errors.\n // eslint-disable-next-line no-console -- misconfiguration must be visible, but must not throw\n console.error(\n `[NGWR] No icon named \"${name}\" is registered. Did you forget to call provideWrIcons()? ` +\n `If the name IS registered, check the injector level: a component-level provideWrIcons() ` +\n `shadows icons registered on an ancestor component.`\n );\n }\n this.clear();\n return;\n }\n\n // Rebuilt from an allowlist rather than assigned to `innerHTML`, which\n // ran an `onload` on the root, an `<image onerror>`, an `<img>` smuggled\n // in after a closed `</svg>` and anything inside a `<foreignObject>` —\n // in production builds, with the app's own origin. `provideWrIcons()`\n // data is untrusted the same way `<wr-markdown>`'s input is: a tenant\n // logo or a fetched icon pack is a normal way to fill it. Building nodes\n // also keeps `<wr-icon>` clear of Trusted Types, which refuses the\n // `innerHTML` write outright.\n const report = isDevMode() ? { elements: new Set<string>(), attributes: new Set<string>() } : undefined;\n const svg = sanitizeIcon(this.doc, icon.data, report);\n\n if (!svg) {\n if (isDevMode()) {\n // eslint-disable-next-line no-console -- misconfiguration must be visible, but must not throw\n console.error(\n `[NGWR] Icon \"${name}\" has no <svg> root element and cannot be rendered. ` +\n `Custom icons must be valid SVG markup.`\n );\n }\n this.clear();\n return;\n }\n\n // Every hand-written inline SVG in the library carries aria-hidden;\n // registered icons went in without it, so a decorative glyph could be\n // announced — usually as a bare \"graphic\" beside the label it decorates.\n // Consumers that need a name put it on the interactive host instead.\n svg.setAttribute('aria-hidden', 'true');\n\n this.clear();\n this.host.nativeElement.appendChild(svg);\n\n if (report) this.reportStripped(name, icon, report);\n });\n }\n\n /**\n * `replaceChildren()` would say this in one call, but domino — the DOM\n * `@angular/platform-server` renders into — does not implement it, and\n * `innerHTML = ''` is the write Trusted Types refuses.\n */\n private clear(): void {\n const el = this.host.nativeElement;\n while (el.firstChild) el.removeChild(el.firstChild);\n }\n\n /**\n * Say what the allowlist removed, once per registered icon.\n *\n * A silently stripped icon is the failure mode this rebuild could introduce:\n * a consumer's own glyph renders blank or wrong and nothing anywhere says\n * why. Keyed on the definition object, so a page with fifty instances of the\n * same icon warns once and an icon nobody renders never warns at all.\n */\n private reportStripped(name: string, icon: WrIconDef, report: WrIconStripReport): void {\n if (WrIcon.reported.has(icon)) return;\n if (report.elements.size === 0 && report.attributes.size === 0) return;\n WrIcon.reported.add(icon);\n\n const removed = [\n report.elements.size ? `elements: ${[...report.elements].join(', ')}` : '',\n report.attributes.size ? `attributes: ${[...report.attributes].join(', ')}` : '',\n ].filter(Boolean);\n\n // eslint-disable-next-line no-console -- a stripped icon must not be silent\n console.warn(\n `[NGWR] Icon \"${name}\" was rendered without part of its markup — ${removed.join('; ')}. ` +\n `Registered icon data is treated as untrusted and rebuilt from an allowlist of SVG ` +\n `shape, paint and text elements, so event handlers, <script>, <style>, <image>, ` +\n `<foreignObject>, <a>, SMIL animation and non-fragment hrefs never reach the DOM.`\n );\n }\n\n private static readonly reported = new WeakSet<WrIconDef>();\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Provider, isDevMode } from '@angular/core';\n\nimport { WrIconRegistry } from '../icon-registry';\nimport type { WrIconDef } from '../interfaces';\nimport { WR_ICONS } from '../tokens';\nimport { validateIcon } from '../utils';\n\n/**\n * Registers a set of icons for use by `<wr-icon>`.\n *\n * Can be called multiple times — each call adds to the registry.\n * Works at both the application root and at the component level,\n * so a feature module or a single component can bring its own icons\n * without polluting the global config.\n *\n * In dev mode, each icon is validated for common issues (missing\n * `viewBox`, malformed root). Validation is dropped from production\n * builds via `isDevMode()` tree-shaking, and it is a rendering check rather\n * than a security one — see {@link validateIcon}.\n *\n * Icon `data` is treated as **untrusted** at render: `<wr-icon>` rebuilds the\n * glyph from an allowlist instead of writing the string to `innerHTML`, so a\n * set fetched at runtime or supplied by a tenant cannot execute in the app's\n * origin. Dev mode names anything the allowlist removed.\n *\n * @example\n * ```ts\n * // App-level registration\n * import { home, user, cog, provideWrIcons } from 'ngwr/icon';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideWrIcons([home, user, cog]),\n * ],\n * };\n * ```\n *\n * @example\n * ```ts\n * // Component-level registration\n * import { logoGithub, logoNpm, provideWrIcons, WrIconDef } from 'ngwr/icon';\n *\n * @Component({\n * selector: 'ngwr-header',\n * imports: [WrIcon],\n * providers: [provideWrIcons([logoGithub, logoNpm])],\n * template: `<wr-icon name=\"logo-github\" />`,\n * })\n * export class HeaderComponent {}\n * ```\n */\nexport function provideWrIcons(icons: WrIconDef[]): Provider[] {\n if (isDevMode()) {\n for (const icon of icons) validateIcon(icon);\n }\n return [\n { provide: WR_ICONS, useValue: icons, multi: true },\n // A registry link per registering level. Angular does not merge `multi`\n // providers across injectors, so without this chain an element-level\n // registration would shadow everything registered above it instead of\n // adding to it.\n WrIconRegistry,\n ];\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from './interfaces';\n\n/**\n * Wrap a raw SVG string in the {@link WrIconDef} envelope. Use this when\n * importing icons from sources that ship full `<svg>` files — Tabler,\n * Phosphor, Heroicons, Iconoir, Radix, Bootstrap Icons, your designer.\n *\n * Pair with a bundler's raw-SVG import (Vite's `?raw`, Webpack's\n * `raw-loader`, esbuild's `--loader:.svg=text`) so the SVG file becomes\n * a string at build time.\n *\n * For sets with a non-SVG shape (Lucide's IconNode tuples, Feather's\n * inner-only SVG), use the dedicated adapter under\n * `ngwr/icon/adapters/<set>` instead.\n *\n * @example\n * ```ts\n * import { svgIcon, provideWrIcons } from 'ngwr/icon';\n * // Vite: the `?raw` suffix returns the file as a string.\n * import plusSvg from '@tabler/icons/icons/plus.svg?raw';\n * import phosphorPlusSvg from '@phosphor-icons/core/assets/regular/plus.svg?raw';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWrIcons([\n * svgIcon('plus', plusSvg),\n * svgIcon('plus-phosphor', phosphorPlusSvg),\n * ]),\n * ],\n * });\n * ```\n *\n * **`svg` is treated as untrusted.** It is a string, so it is a natural place\n * for a tenant's uploaded logo or an icon pack fetched from an API to end up,\n * and `<wr-icon>` used to write it to `innerHTML`. It no longer does: the glyph\n * is rebuilt from an allowlist of SVG shape, paint and text elements, so\n * `<script>`, `<style>`, `<image>`, `<foreignObject>`, `<a>`, SMIL animation,\n * every `on*` handler, `style` attributes and non-fragment `href`s are dropped\n * before anything reaches the DOM. In dev mode the component names what it\n * removed, so a legitimate icon that loses something says so out loud.\n */\nexport function svgIcon(name: string, svg: string): WrIconDef {\n return { name, data: svg };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;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js","sources":["../../../projects/lib/icon/tokens/icon.token.ts","../../../projects/lib/icon/icon-registry.ts","../../../projects/lib/icon/utils/sanitize-icon.ts","../../../projects/lib/icon/utils/validate-icon.ts","../../../projects/lib/icon/icon.ts","../../../projects/lib/icon/providers/provide-wr-icons.ts","../../../projects/lib/icon/svg-icon.ts","../../../projects/lib/icon/ngwr-icon.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrIconDef } from '../interfaces';\n\n/**\n * Multi-provider token for registering icons with the icon registry.\n *\n * Use {@link provideWrIcons} instead of providing this token directly.\n *\n * @internal\n */\nexport const WR_ICONS = new InjectionToken<readonly WrIconDef[][]>('WR_ICONS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, inject } from '@angular/core';\n\nimport type { WrIconDef } from './interfaces';\nimport { WR_ICONS } from './tokens';\n\n/**\n * One link in the icon-registry chain. {@link provideWrIcons} provides an\n * instance alongside its icons, so every injector level that registers icons\n * gets its own link whose parent is the next registering level above it.\n *\n * This exists because Angular does not merge `multi: true` providers across\n * injector levels — an element-level `provideWrIcons()` *replaces* the visible\n * `WR_ICONS` collection rather than adding to it. Reading only the closest\n * contribution silently hid every icon registered further up, which contradicts\n * the \"each call adds to the registry\" contract. Walking the chain restores it\n * for any number of levels.\n *\n * @internal\n */\n@Injectable()\nexport class WrIconRegistry {\n /** The next registering level up, if any. */\n private readonly parent = inject(WrIconRegistry, { skipSelf: true, optional: true });\n\n /** Icons registered at *this* level only. */\n private readonly own = inject(WR_ICONS, { self: true, optional: true }) ?? [];\n\n /**\n * Every icon visible from this level, nearest last so a local registration\n * wins over an identically named one further up.\n */\n resolve(): Map<string, WrIconDef> {\n const map = this.parent?.resolve() ?? new Map<string, WrIconDef>();\n for (const set of this.own) {\n for (const icon of set) map.set(icon.name, icon);\n }\n return map;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\nconst XLINK_NS = 'http://www.w3.org/1999/xlink';\n\n/**\n * SVG elements an icon may be built from.\n *\n * Derived from the real sets rather than guessed: across the 12 459 SVG files\n * under `icon/_svg` (Lucide, Phosphor, Tabler, Heroicons), the whole of\n * `feather-icons`' `icons.json` and every `lucide` IconNode, only eight\n * elements ever appear — `svg`, `path`, `circle`, `line`, `rect`, `polyline`,\n * `polygon`, `ellipse`. The rest of this list is headroom for the icons a\n * consumer draws themselves: grouping, `<defs>` with gradients, a clip path, a\n * mask, a `<title>`, real `<text>`.\n *\n * What is deliberately absent is the entire scripting surface:\n *\n * - `<script>` — obvious, and the one vector `innerHTML` already refused;\n * - `<foreignObject>` — an XHTML escape hatch, so `<img onerror>` inside an\n * otherwise well-formed icon;\n * - `<image>` — its `onerror` fires on any unreachable `href`, which is the\n * cheapest handler to land, and no real icon set uses it;\n * - `<a>` — a `javascript:` href inside a glyph the user is invited to click;\n * - `<animate>` / `<set>` / `<animateTransform>` / `<animateMotion>` — SMIL can\n * retarget another element's `href` at a `javascript:` URL;\n * - `<style>` — arbitrary CSS in the app's origin, including `url()` requests;\n * - `<filter>` and the `fe*` primitives — `<feImage href>` is another external\n * fetch, and no icon set in the corpus filters.\n *\n * @internal\n */\nconst ELEMENTS: ReadonlySet<string> = new Set([\n 'svg',\n 'g',\n 'defs',\n 'symbol',\n 'use',\n 'title',\n 'desc',\n 'path',\n 'circle',\n 'ellipse',\n 'line',\n 'polyline',\n 'polygon',\n 'rect',\n 'text',\n 'tspan',\n 'textPath',\n 'linearGradient',\n 'radialGradient',\n 'stop',\n 'clipPath',\n 'mask',\n 'pattern',\n]);\n\n/**\n * Attributes an icon may carry, allowed on every element it is allowed on.\n *\n * An allowlist rather than a blocklist, so `onload`, `onerror`, `onclick` and\n * every other handler — including ones no browser has shipped yet — are gone by\n * construction rather than by enumeration.\n *\n * `style` is NOT here, and that is a decision rather than an oversight: not one\n * icon in the corpus uses it, and a `style` attribute is arbitrary CSS in the\n * app's origin. Anything a `style` would have done, a presentation attribute\n * does.\n *\n * @internal\n */\nconst ATTRIBUTES: ReadonlySet<string> = new Set([\n // geometry\n 'viewBox',\n 'preserveAspectRatio',\n 'transform',\n 'transform-origin',\n 'd',\n 'pathLength',\n 'cx',\n 'cy',\n 'r',\n 'rx',\n 'ry',\n 'x',\n 'y',\n 'x1',\n 'y1',\n 'x2',\n 'y2',\n 'dx',\n 'dy',\n 'width',\n 'height',\n 'points',\n // paint servers, clips and masks\n 'gradientUnits',\n 'gradientTransform',\n 'spreadMethod',\n 'offset',\n 'fx',\n 'fy',\n 'fr',\n 'patternUnits',\n 'patternContentUnits',\n 'patternTransform',\n 'maskUnits',\n 'maskContentUnits',\n 'clipPathUnits',\n // presentation\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'stroke',\n 'stroke-width',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-opacity',\n 'opacity',\n 'color',\n 'clip-path',\n 'clip-rule',\n 'mask',\n 'paint-order',\n 'vector-effect',\n 'shape-rendering',\n 'stop-color',\n 'stop-opacity',\n 'display',\n 'visibility',\n 'overflow',\n 'isolation',\n 'mix-blend-mode',\n // text\n 'startOffset',\n 'textLength',\n 'lengthAdjust',\n 'text-anchor',\n 'dominant-baseline',\n 'alignment-baseline',\n 'baseline-shift',\n 'font-family',\n 'font-size',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'letter-spacing',\n 'word-spacing',\n 'writing-mode',\n 'direction',\n // identity, accessibility and document plumbing\n 'id',\n 'class',\n 'role',\n 'aria-hidden',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-roledescription',\n 'focusable',\n 'lang',\n 'version',\n 'baseProfile',\n 'xmlns',\n 'xmlns:xlink',\n 'xml:space',\n 'xml:lang',\n // resolved against ONLY_FRAGMENT below, never free-form\n 'href',\n 'xlink:href',\n]);\n\n/**\n * `href` may point at a fragment in the same document and nowhere else — that\n * is the whole legitimate use inside an icon (`<use href=\"#glyph\">`), and it\n * excludes `javascript:`, `data:` and every remote fetch in one rule.\n */\nconst FRAGMENT_ONLY: ReadonlySet<string> = new Set(['href', 'xlink:href']);\n\n/** A same-document fragment reference: `#id`, and nothing that is not one. */\nconst FRAGMENT_RE = /^#[^\\s]+$/;\n\n/**\n * `url(` inside a presentation attribute is a reference to a paint server, a\n * clip path or a mask. Those are fragment references too; a remote one is at\n * best a request the page did not ask for.\n */\nconst URL_FN_RE = /url\\(/i;\nconst URL_FRAGMENT_RE = /^url\\(\\s*(['\"]?)#[^\\s'\")]+\\1\\s*\\)$/i;\n\n/**\n * Icons are shallow — the deepest in the corpus nests three levels. The cap is\n * there so a hostile registration cannot recurse this function into a stack\n * overflow; content below it is dropped, not truncated silently, because\n * {@link WrIconStripReport} names what went.\n */\nconst MAX_DEPTH = 16;\n\n/**\n * What {@link sanitizeIcon} refused, for the dev-mode warning. Collecting is\n * opt-in so the render path does no bookkeeping in production.\n *\n * @internal\n */\ninterface WrIconStripReport {\n readonly elements: Set<string>;\n readonly attributes: Set<string>;\n}\n\n/**\n * Build a live `<svg>` element out of a registered icon's markup, keeping only\n * what an icon legitimately needs.\n *\n * `<wr-icon>` used to assign `icon.data` to `innerHTML`, which executes an\n * `onload` on the root, an `<image onerror>`, an `<img>` smuggled in after a\n * closed `</svg>`, and anything inside a `<foreignObject>` — with the app's own\n * origin, in a production build. The library already refuses exactly this next\n * door: `<wr-markdown>` escapes raw HTML because its input is untrusted by\n * construction and one `<img onerror>` is the whole cost of being wrong. Icon\n * data arrives from `provideWrIcons()`, which a multi-tenant app or a fetched\n * icon pack fills at runtime, so it is untrusted the same way.\n *\n * Three properties do the work, and none of them is a filter over known-bad\n * strings:\n *\n * 1. **Parsed inert, never inserted.** The markup is parsed into a document\n * with no browsing context, so nothing loads and nothing runs even before it\n * is inspected.\n * 2. **Only the first `<svg>` survives.** An icon IS an SVG element, so\n * everything beside the root is dropped — which is what makes\n * `</svg><img src=x onerror=…>` inert regardless of what the payload says,\n * and it is the same shape as the `feather()` shell escape.\n * 3. **Rebuilt, not filtered.** Every element and attribute that lands in the\n * document is one this file created from an allowlist. Nothing is\n * transferred from the parsed tree, so there is no attribute an unfamiliar\n * payload can smuggle past a matcher.\n *\n * A refused element takes its subtree with it rather than having its children\n * hoisted into its parent. Hoisting would preserve more of a hand-drawn icon\n * wrapped in something unsupported, and it is exactly the kind of cleverness\n * that makes \"what does the output contain\" depend on what the parser saw. The\n * blunt rule is the reviewable one, and the dev-mode warning names what went.\n *\n * `DomSanitizer.sanitize(SecurityContext.HTML, …)` is not an option here, which\n * is worth recording so it is not re-proposed: Angular's HTML allowlist\n * (`VOID_ELEMENTS`, `BLOCK_ELEMENTS`, `INLINE_ELEMENTS`) contains no SVG\n * element at all. Run against real Lucide, Feather and Heroicons icons it does\n * not merely drop presentation attributes — it returns the empty string.\n *\n * @returns the rebuilt element, or `null` when the data holds no `<svg>` root.\n * @internal\n */\nfunction sanitizeIcon(doc: Document, data: string, report?: WrIconStripReport): SVGElement | null {\n const source = parseInert(doc, data);\n return source ? copy(doc, source, report, 0) : null;\n}\n\n/**\n * Parse into a document that cannot run anything.\n *\n * `DOMParser` is the path every browser and the unit-test DOM take: it takes a\n * plain string, so it is not a Trusted Types sink, and its result has no\n * browsing context. It does not exist under SSR — `@angular/platform-server`\n * renders into domino — so the server falls back to a detached `<template>`,\n * whose content is a separate inert document for the same reason. That branch\n * is unreachable in a browser, which is what keeps the innerHTML write out of\n * the only place Trusted Types is enforced.\n *\n * Both parsers were checked to agree on the part that matters: the HTML\n * parser's foreign-content adjustment restores the camel case of `viewBox`,\n * `clipPath`, `linearGradient`, `gradientTransform`, `textPath` and puts\n * `xlink:href` in the xlink namespace.\n */\nfunction parseInert(doc: Document, data: string): Element | null {\n const parser = doc.defaultView?.DOMParser;\n if (parser) return firstSvg(new parser().parseFromString(data, 'text/html').body);\n\n const template = doc.createElement('template');\n template.innerHTML = data;\n return firstSvg(template.content);\n}\n\n/**\n * The first `<svg>` in document order, found by walking rather than by\n * `querySelector`.\n *\n * Two reasons, and the second is the one that matters. A control that decides\n * what may execute should not route that decision through a selector engine —\n * `localName === 'svg'` is a comparison anyone can check, and CSS parsing is a\n * layer with its own history. The first reason is merely that it is faster:\n * jsdom's engine costs 4 ms on a document this size, which the unit suite pays\n * on every rendered icon.\n */\nfunction firstSvg(root: Node): Element | null {\n const children = root.childNodes;\n for (let i = 0, n = children.length; i < n; i++) {\n const child = children[i];\n if (child.nodeType !== 1) continue;\n const element = child as Element;\n if (element.localName === 'svg') return element;\n const nested = firstSvg(element);\n if (nested) return nested;\n }\n return null;\n}\n\n/** Recreate one element, then its allowed children, in the live document. */\nfunction copy(doc: Document, source: Element, report: WrIconStripReport | undefined, depth: number): SVGElement {\n const el = doc.createElementNS(SVG_NS, source.localName);\n\n const attributes = source.attributes;\n for (let i = 0, n = attributes.length; i < n; i++) {\n const { name, value } = attributes[i];\n if (!isAllowedAttribute(name, value)) {\n report?.attributes.add(name);\n continue;\n }\n if (name === 'xlink:href') el.setAttributeNS(XLINK_NS, name, value);\n else el.setAttribute(name, value);\n }\n\n if (depth >= MAX_DEPTH) {\n // Named, not silent — the cap is the one rule here that can bite an icon\n // nobody meant as an attack, and a truncated glyph should say so.\n if (source.childNodes.length > 0) report?.elements.add(`… deeper than ${MAX_DEPTH} levels`);\n return el;\n }\n\n const children = source.childNodes;\n for (let i = 0, n = children.length; i < n; i++) {\n const child = children[i];\n // Text, so `<title>`, `<desc>` and `<text>` keep saying what they said.\n // Comments, CDATA and processing instructions are dropped: an icon has no\n // use for them and a comment is a place to hide a payload from a reader.\n if (child.nodeType === 3) {\n el.appendChild(doc.createTextNode(child.nodeValue ?? ''));\n continue;\n }\n if (child.nodeType !== 1) continue;\n\n const element = child as Element;\n if (!ELEMENTS.has(element.localName)) {\n report?.elements.add(element.localName);\n continue;\n }\n el.appendChild(copy(doc, element, report, depth + 1));\n }\n\n return el;\n}\n\nfunction isAllowedAttribute(name: string, value: string): boolean {\n // `data-*` is a styling and testing hook that can never be behavioural.\n if (name.startsWith('data-')) return true;\n if (!ATTRIBUTES.has(name)) return false;\n if (FRAGMENT_ONLY.has(name)) return FRAGMENT_RE.test(value.trim());\n if (URL_FN_RE.test(value)) return URL_FRAGMENT_RE.test(value.trim());\n return true;\n}\n\nexport { sanitizeIcon, type WrIconStripReport };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from '../interfaces';\n\nconst VIEW_BOX_RE = /<svg\\b[^>]*\\bviewBox\\s*=/i;\nconst SVG_ROOT_RE = /<svg\\b/i;\n\n/**\n * Dev-mode sanity check for a registered icon — a **rendering** check, and\n * explicitly not a security control.\n *\n * It warns about the two things that make an icon come out wrong: no `<svg>`\n * root, and no `viewBox`, which stops the glyph scaling to the host. It reads\n * the string with two regexes and cannot tell a shape from a script — every\n * payload in the icon corpus passes it, because each one does carry an `<svg>`\n * root with a `viewBox`. It also runs only under `isDevMode()`, so it is absent\n * from the build an attacker would meet.\n *\n * What actually keeps hostile markup out of the DOM is {@link sanitizeIcon},\n * which runs on every render in every build: `<wr-icon>` rebuilds the glyph\n * from an allowlist instead of assigning to `innerHTML`. Anything this function\n * would have to reject is already gone by then, and the component says so in\n * dev mode when it drops something.\n *\n * Production builds drop the call entirely via `isDevMode()` tree-shaking.\n *\n * @internal\n */\nexport function validateIcon(icon: WrIconDef): void {\n if (!SVG_ROOT_RE.test(icon.data)) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] Icon \"${icon.name}\" data does not contain an <svg> root element. ` +\n `Custom icons must be valid SVG markup.`\n );\n return;\n }\n\n if (!VIEW_BOX_RE.test(icon.data)) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] Icon \"${icon.name}\" has no viewBox attribute — it won't scale ` +\n `to the host size. Add viewBox=\"0 0 W H\" to the <svg> root.`\n );\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode } from '@angular/core';\n\nimport { WrIconRegistry } from './icon-registry';\nimport type { WrIconDef, WrIconName } from './interfaces';\nimport { type WrIconStripReport, sanitizeIcon } from './utils';\n\n/**\n * Renders a registered SVG icon.\n *\n * Icons must be registered via {@link provideWrIcons} before use —\n * either at the application root or on any ancestor component.\n *\n * @example\n * ```html\n * <wr-icon name=\"home\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/icon\n */\n@Component({\n selector: 'wr-icon',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-icon',\n '[attr.data-icon]': 'name()',\n },\n})\nexport class WrIcon {\n readonly name = input.required<WrIconName>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n\n /**\n * Every icon visible from this position, walked up the whole chain of\n * registering injector levels.\n *\n * Angular's `inject(WR_ICONS)` returns only the **closest** injector's\n * contribution — `multi` providers are not merged across levels — so a\n * component that registers its own icons used to shadow, not extend, what an\n * ancestor registered. {@link WrIconRegistry} is provided once per\n * registering level and links to its parent, so nesting any number of levels\n * now adds up, with the nearest registration winning a name collision.\n *\n * Optional: with no `provideWrIcons()` anywhere the map is simply empty and\n * every name reports as unregistered.\n */\n private readonly iconRegistry = inject(WrIconRegistry, { optional: true });\n\n private readonly registry = computed<ReadonlyMap<WrIconName, WrIconDef>>(\n () => (this.iconRegistry?.resolve() ?? new Map()) as ReadonlyMap<WrIconName, WrIconDef>\n );\n\n private readonly icon = computed(() => this.registry().get(this.name()));\n\n constructor() {\n effect(() => {\n const icon = this.icon();\n const name = this.name();\n\n if (!icon) {\n if (isDevMode()) {\n // Reported, never thrown. An exception here escapes into\n // `runEffectsInView`, which abandons the remaining effects of the\n // whole view — one unknown name would blank every `<wr-icon>` after\n // it while the console blamed only the first. Error level (not\n // `badgeLog`) so it survives a console filtered to errors.\n // eslint-disable-next-line no-console -- misconfiguration must be visible, but must not throw\n console.error(\n `[NGWR] No icon named \"${name}\" is registered. Did you forget to call provideWrIcons()? ` +\n `If the name IS registered, check the injector level: a component-level provideWrIcons() ` +\n `shadows icons registered on an ancestor component.`\n );\n }\n this.clear();\n return;\n }\n\n // Rebuilt from an allowlist rather than assigned to `innerHTML`, which\n // ran an `onload` on the root, an `<image onerror>`, an `<img>` smuggled\n // in after a closed `</svg>` and anything inside a `<foreignObject>` —\n // in production builds, with the app's own origin. `provideWrIcons()`\n // data is untrusted the same way `<wr-markdown>`'s input is: a tenant\n // logo or a fetched icon pack is a normal way to fill it. Building nodes\n // also keeps `<wr-icon>` clear of Trusted Types, which refuses the\n // `innerHTML` write outright.\n const report = isDevMode() ? { elements: new Set<string>(), attributes: new Set<string>() } : undefined;\n const svg = sanitizeIcon(this.doc, icon.data, report);\n\n if (!svg) {\n if (isDevMode()) {\n // eslint-disable-next-line no-console -- misconfiguration must be visible, but must not throw\n console.error(\n `[NGWR] Icon \"${name}\" has no <svg> root element and cannot be rendered. ` +\n `Custom icons must be valid SVG markup.`\n );\n }\n this.clear();\n return;\n }\n\n // Every hand-written inline SVG in the library carries aria-hidden;\n // registered icons went in without it, so a decorative glyph could be\n // announced — usually as a bare \"graphic\" beside the label it decorates.\n // Consumers that need a name put it on the interactive host instead.\n svg.setAttribute('aria-hidden', 'true');\n\n this.clear();\n this.host.nativeElement.appendChild(svg);\n\n if (report) this.reportStripped(name, icon, report);\n });\n }\n\n /**\n * `replaceChildren()` would say this in one call, but domino — the DOM\n * `@angular/platform-server` renders into — does not implement it, and\n * `innerHTML = ''` is the write Trusted Types refuses.\n */\n private clear(): void {\n const el = this.host.nativeElement;\n while (el.firstChild) el.removeChild(el.firstChild);\n }\n\n /**\n * Say what the allowlist removed, once per registered icon.\n *\n * A silently stripped icon is the failure mode this rebuild could introduce:\n * a consumer's own glyph renders blank or wrong and nothing anywhere says\n * why. Keyed on the definition object, so a page with fifty instances of the\n * same icon warns once and an icon nobody renders never warns at all.\n */\n private reportStripped(name: string, icon: WrIconDef, report: WrIconStripReport): void {\n if (WrIcon.reported.has(icon)) return;\n if (report.elements.size === 0 && report.attributes.size === 0) return;\n WrIcon.reported.add(icon);\n\n const removed = [\n report.elements.size ? `elements: ${[...report.elements].join(', ')}` : '',\n report.attributes.size ? `attributes: ${[...report.attributes].join(', ')}` : '',\n ].filter(Boolean);\n\n // eslint-disable-next-line no-console -- a stripped icon must not be silent\n console.warn(\n `[NGWR] Icon \"${name}\" was rendered without part of its markup — ${removed.join('; ')}. ` +\n `Registered icon data is treated as untrusted and rebuilt from an allowlist of SVG ` +\n `shape, paint and text elements, so event handlers, <script>, <style>, <image>, ` +\n `<foreignObject>, <a>, SMIL animation and non-fragment hrefs never reach the DOM.`\n );\n }\n\n private static readonly reported = new WeakSet<WrIconDef>();\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Provider, isDevMode } from '@angular/core';\n\nimport { WrIconRegistry } from '../icon-registry';\nimport type { WrIconDef } from '../interfaces';\nimport { WR_ICONS } from '../tokens';\nimport { validateIcon } from '../utils';\n\n/**\n * Registers a set of icons for use by `<wr-icon>`.\n *\n * Can be called multiple times — each call adds to the registry.\n * Works at both the application root and at the component level,\n * so a feature module or a single component can bring its own icons\n * without polluting the global config.\n *\n * In dev mode, each icon is validated for common issues (missing\n * `viewBox`, malformed root). Validation is dropped from production\n * builds via `isDevMode()` tree-shaking, and it is a rendering check rather\n * than a security one — see {@link validateIcon}.\n *\n * Icon `data` is treated as **untrusted** at render: `<wr-icon>` rebuilds the\n * glyph from an allowlist instead of writing the string to `innerHTML`, so a\n * set fetched at runtime or supplied by a tenant cannot execute in the app's\n * origin. Dev mode names anything the allowlist removed.\n *\n * @example\n * ```ts\n * // App-level registration\n * import { home, user, cog, provideWrIcons } from 'ngwr/icon';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideWrIcons([home, user, cog]),\n * ],\n * };\n * ```\n *\n * @example\n * ```ts\n * // Component-level registration\n * import { logoGithub, logoNpm, provideWrIcons, WrIconDef } from 'ngwr/icon';\n *\n * @Component({\n * selector: 'ngwr-header',\n * imports: [WrIcon],\n * providers: [provideWrIcons([logoGithub, logoNpm])],\n * template: `<wr-icon name=\"logo-github\" />`,\n * })\n * export class HeaderComponent {}\n * ```\n */\nexport function provideWrIcons(icons: WrIconDef[]): Provider[] {\n if (isDevMode()) {\n for (const icon of icons) validateIcon(icon);\n }\n return [\n { provide: WR_ICONS, useValue: icons, multi: true },\n // A registry link per registering level. Angular does not merge `multi`\n // providers across injectors, so without this chain an element-level\n // registration would shadow everything registered above it instead of\n // adding to it.\n WrIconRegistry,\n ];\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrIconDef } from './interfaces';\n\n/**\n * Wrap a raw SVG string in the {@link WrIconDef} envelope. Use this when\n * importing icons from sources that ship full `<svg>` files — Tabler,\n * Phosphor, Heroicons, Iconoir, Radix, Bootstrap Icons, your designer.\n *\n * Pair with a bundler's raw-SVG import (Vite's `?raw`, Webpack's\n * `raw-loader`, esbuild's `--loader:.svg=text`) so the SVG file becomes\n * a string at build time.\n *\n * For sets with a non-SVG shape (Lucide's IconNode tuples, Feather's\n * inner-only SVG), use the dedicated adapter under\n * `ngwr/icon/adapters/<set>` instead.\n *\n * @example\n * ```ts\n * import { svgIcon, provideWrIcons } from 'ngwr/icon';\n * // Vite: the `?raw` suffix returns the file as a string.\n * import plusSvg from '@tabler/icons/icons/plus.svg?raw';\n * import phosphorPlusSvg from '@phosphor-icons/core/assets/regular/plus.svg?raw';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWrIcons([\n * svgIcon('plus', plusSvg),\n * svgIcon('plus-phosphor', phosphorPlusSvg),\n * ]),\n * ],\n * });\n * ```\n *\n * **`svg` is treated as untrusted.** It is a string, so it is a natural place\n * for a tenant's uploaded logo or an icon pack fetched from an API to end up,\n * and `<wr-icon>` used to write it to `innerHTML`. It no longer does: the glyph\n * is rebuilt from an allowlist of SVG shape, paint and text elements, so\n * `<script>`, `<style>`, `<image>`, `<foreignObject>`, `<a>`, SMIL animation,\n * every `on*` handler, `style` attributes and non-fragment `href`s are dropped\n * before anything reaches the DOM. In dev mode the component names what it\n * removed, so a legitimate icon that loses something says so out loud.\n */\nexport function svgIcon(name: string, svg: string): WrIconDef {\n return { name, data: svg };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAMH;;;;;;AAMG;AACI,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAyB,UAAU,CAAC;;AClB9E;;;;;AAKG;AAOH;;;;;;;;;;;;;AAaG;MAEU,cAAc,CAAA;;AAER,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AAGnE,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AAE7E;;;AAGG;IACH,OAAO,GAAA;AACL,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,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