ngwr 15.9.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animations/aurora/styles/_index.scss +1 -1
- package/animations/blur-reveal/styles/_index.scss +1 -1
- package/animations/decode/styles/_index.scss +1 -1
- package/animations/dot-grid/styles/_index.scss +1 -1
- package/animations/flow-lines/styles/_index.scss +1 -1
- package/animations/fluid-cursor/styles/_index.scss +1 -1
- package/animations/{core → internal}/styles/_mixins.scss +1 -1
- package/animations/reveal/styles/_index.scss +1 -1
- package/animations/ripple-grid/styles/_index.scss +1 -1
- package/animations/rotate-reveal/styles/_index.scss +1 -1
- package/animations/thread-lines/styles/_index.scss +1 -1
- package/animations/typewriter/styles/_index.scss +1 -1
- package/copy-value/styles/_index.scss +104 -0
- package/date-picker/styles/_index.scss +117 -0
- package/fesm2022/{ngwr-animations-core.mjs → internal-BaQU4t_0.mjs} +6 -49
- package/fesm2022/internal-BaQU4t_0.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +2 -2
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +21 -21
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs +2 -2
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs +5 -5
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs +4 -4
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs +5 -5
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs +7 -7
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs +17 -17
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +12 -12
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs +2 -2
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-marquee.mjs +2 -2
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +7 -7
- package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs +4 -4
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs +5 -5
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +4 -4
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs +2 -2
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs +16 -16
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs +4 -4
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +43 -20
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +13 -13
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +9 -9
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +8 -8
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +11 -11
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +2 -2
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +20 -20
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +2 -2
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +6 -6
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +10 -10
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +2 -2
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +11 -11
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +10 -10
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +4 -4
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +7 -7
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +2 -2
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +2 -2
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +52 -52
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +4 -4
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-comment.mjs +2 -2
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +6 -6
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +4 -4
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +58 -0
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -0
- package/fesm2022/ngwr-copy-value.mjs +196 -0
- package/fesm2022/ngwr-copy-value.mjs.map +1 -0
- package/fesm2022/ngwr-counter.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +217 -40
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +27 -5
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +32 -3
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +116 -1
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +13 -12
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +28 -28
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +5 -5
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +8 -8
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +3 -3
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +22 -22
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +2 -2
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +5 -5
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +11 -11
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +4 -4
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +2 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +28 -28
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +4 -4
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +2 -2
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +2 -2
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +19 -3
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +7 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +3 -5
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +4 -1
- package/fesm2022/ngwr-platform.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +6 -5
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +31 -30
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +2 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +6 -6
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +10 -10
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +15 -5
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +57 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +2 -2
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +13 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +5 -5
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +5 -3
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +6 -4
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +2 -2
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +231 -27
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +2 -2
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +8 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +63 -20
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +7 -7
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +20 -9
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +64 -24
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +98 -55
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +2 -2
- 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-window.mjs +26 -26
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/input-number/styles/_index.scss +6 -0
- package/llms-full.txt +31 -19
- package/llms.txt +37 -19
- package/mcp/providers.js +1 -1
- package/package.json +15 -10
- package/schematics/icon-set/index.js +3 -3
- package/schematics/migrations/v16/index.js +742 -0
- package/schematics/migrations.json +5 -0
- package/schematics/ng-add/index.js +4 -4
- package/schematics/provider/index.js +4 -4
- package/schematics/use/symbol-map.json +2 -0
- package/select/styles/_index.scss +1 -1
- package/skills/ngwr/SKILL.md +6 -4
- package/skills/ngwr/references/catalog.md +4 -2
- package/skills/ngwr/references/setup.md +10 -9
- package/table/styles/_index.scss +85 -29
- package/toast/styles/_index.scss +30 -0
- package/tree/styles/_index.scss +17 -0
- package/types/index-CXbgza47.d.ts +13 -0
- package/types/ngwr-animations-aurora.d.ts +1 -1
- package/types/ngwr-animations-blur-reveal.d.ts +2 -2
- package/types/ngwr-animations-dot-grid.d.ts +1 -2
- package/types/ngwr-animations-flow-lines.d.ts +1 -1
- package/types/ngwr-animations-fluid-cursor.d.ts +1 -1
- package/types/ngwr-animations-reveal.d.ts +4 -8
- package/types/ngwr-animations-ripple-grid.d.ts +1 -1
- package/types/ngwr-animations-spotlight.d.ts +1 -1
- package/types/ngwr-animations-thread-lines.d.ts +1 -1
- package/types/ngwr-animations-tilt.d.ts +1 -1
- package/types/ngwr-avatar.d.ts +2 -2
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-cascader.d.ts +12 -1
- package/types/ngwr-charts-boxplot-chart.d.ts +1 -1
- package/types/ngwr-charts-bullet-chart.d.ts +2 -2
- package/types/ngwr-charts-candlestick-chart.d.ts +1 -1
- package/types/ngwr-charts-core.d.ts +12 -12
- package/types/ngwr-charts-line-chart.d.ts +2 -2
- package/types/ngwr-charts-radar-chart.d.ts +1 -1
- package/types/ngwr-charts-scatter-chart.d.ts +2 -2
- package/types/ngwr-charts-waterfall-chart.d.ts +1 -1
- package/types/ngwr-color-picker.d.ts +12 -12
- package/types/ngwr-copy-value-testing.d.ts +87 -0
- package/types/ngwr-copy-value.d.ts +95 -0
- package/types/ngwr-date-picker-testing.d.ts +3 -3
- package/types/ngwr-date-picker.d.ts +97 -1
- package/types/ngwr-date.d.ts +44 -3
- package/types/ngwr-dialog.d.ts +50 -3
- package/types/ngwr-directives.d.ts +40 -0
- package/types/ngwr-drawer.d.ts +1 -1
- package/types/ngwr-dropdown.d.ts +3 -2
- package/types/ngwr-hotkey.d.ts +5 -5
- package/types/ngwr-i18n.d.ts +3 -3
- package/types/ngwr-icon.d.ts +26 -26
- package/types/ngwr-input-number.d.ts +2 -2
- package/types/ngwr-input.d.ts +8 -8
- package/types/ngwr-load-state.d.ts +6 -6
- package/types/ngwr-meta.d.ts +18 -0
- package/types/ngwr-pipes.d.ts +6 -4
- package/types/ngwr-platform.d.ts +2 -1
- package/types/ngwr-popconfirm.d.ts +3 -2
- package/types/ngwr-popover.d.ts +4 -3
- package/types/ngwr-select.d.ts +33 -18
- package/types/ngwr-slider-testing.d.ts +2 -2
- package/types/ngwr-slider.d.ts +3 -3
- package/types/ngwr-statistic.d.ts +5 -1
- package/types/ngwr-storage.d.ts +1 -1
- package/types/ngwr-table-testing.d.ts +2 -1
- package/types/ngwr-table.d.ts +136 -11
- package/types/ngwr-tabs.d.ts +10 -2
- package/types/ngwr-toast-testing.d.ts +6 -2
- package/types/ngwr-toast.d.ts +33 -5
- package/types/ngwr-transfer.d.ts +5 -0
- package/types/ngwr-tree.d.ts +22 -2
- package/types/ngwr-utils.d.ts +157 -82
- package/types/ngwr-validators.d.ts +4 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr.d.ts +1 -0
- package/types/pointer-tracker-D7fXxLQL.d.ts +24 -0
- package/fesm2022/ngwr-animations-core.mjs.map +0 -1
- package/types/ngwr-animations-core.d.ts +0 -294
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* What an effect does with the hovering pointer a {@link WrPointerTracker} follows.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
interface WrPointerFollower {
|
|
13
|
+
/** The first hovering pointer came in. The host is measured: `rect` is set. */
|
|
14
|
+
enter(): void;
|
|
15
|
+
/**
|
|
16
|
+
* One animation frame, for any number of moves since the last. `clientX`,
|
|
17
|
+
* `clientY` and `rect` hold the latest point and box. `time` is the frame's
|
|
18
|
+
* timestamp, for a follower that eases toward the point over several frames.
|
|
19
|
+
*/
|
|
20
|
+
frame(time: number): void;
|
|
21
|
+
/** The pointer left, or the tracker stopped while it was inside. A pending frame is cancelled first; `rect` is `null`. */
|
|
22
|
+
leave(): void;
|
|
23
|
+
}
|
|
24
|
+
export { WrPointerFollower as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-animations-core.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/core/canvas-backdrop.ts","../../../projects/lib/animations/core/dom.ts","../../../projects/lib/animations/core/noise.ts","../../../projects/lib/animations/core/pointer-tracker.ts","../../../projects/lib/animations/core/stagger.ts","../../../projects/lib/animations/core/public-api.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 { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, ElementRef, Injector, PLATFORM_ID, afterNextRender, effect, inject } from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { clamp, watchColorScheme } from 'ngwr/utils';\n\nclass Backdrop implements WrCanvasBackdrop {\n ctx: CanvasRenderingContext2D | null = null;\n width = 0;\n height = 0;\n running = false;\n\n private platform: WrPlatform | null = null;\n private view: (Window & typeof globalThis) | null = null;\n private inView = false;\n private rafId: number | null = null;\n private resizeRafId: number | null = null;\n private pendingWidth = 0;\n private pendingHeight = 0;\n private lastFrame = 0;\n private resizeObserver: ResizeObserver | null = null;\n private viewObserver: IntersectionObserver | null = null;\n\n constructor(\n private readonly canvas: () => HTMLCanvasElement,\n private readonly scene: WrCanvasBackdropScene\n ) {}\n\n mount(host: HTMLElement, doc: Document, platform: WrPlatform, injector: Injector): void {\n // Nothing drawn under forced colours: the stylesheet hides the host too.\n if (doc.defaultView?.matchMedia?.('(forced-colors: active)').matches) return;\n const canvas = this.canvas();\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n this.ctx = ctx;\n this.platform = platform;\n this.view = doc.defaultView;\n this.scene.colors(canvas);\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(entries => {\n const rect = entries[entries.length - 1]?.contentRect;\n this.scheduleResize(rect?.width ?? host.clientWidth, rect?.height ?? host.clientHeight);\n });\n this.resizeObserver.observe(host);\n } else {\n this.resize(host.clientWidth, host.clientHeight);\n }\n\n if (typeof IntersectionObserver !== 'undefined') {\n this.viewObserver = new IntersectionObserver(entries => {\n this.inView = entries[entries.length - 1]?.isIntersecting ?? false;\n this.sync();\n });\n this.viewObserver.observe(host);\n }\n\n watchColorScheme(\n () => {\n this.scene.colors(canvas);\n if (!this.running) this.draw();\n },\n { injector }\n );\n\n this.scene.mounted?.();\n }\n\n unmount(): void {\n this.running = false;\n this.stopLoop();\n if (this.resizeRafId !== null) cancelAnimationFrame(this.resizeRafId);\n this.resizeRafId = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.ctx = null;\n }\n\n /** Folds a burst of resize notifications into one layout, on the next frame. */\n private scheduleResize(width: number, height: number): void {\n this.pendingWidth = width;\n this.pendingHeight = height;\n if (this.resizeRafId !== null) return;\n this.resizeRafId = requestAnimationFrame(() => {\n this.resizeRafId = null;\n this.resize(this.pendingWidth, this.pendingHeight);\n });\n }\n\n private resize(width: number, height: number): void {\n if (!this.ctx || width <= 0 || height <= 0) return;\n const canvas = this.canvas();\n const dpr = canvasBackdropRatio(width, height, this.view?.devicePixelRatio ?? 1);\n this.width = width;\n this.height = height;\n canvas.width = Math.round(width * dpr);\n canvas.height = Math.round(height * dpr);\n this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n this.scene.layout(width, height);\n this.draw();\n this.sync();\n }\n\n sync(): void {\n const platform = this.platform;\n if (!platform) return;\n const reduced = platform.prefersReducedMotion();\n const allowed = this.ctx !== null && this.width > 0 && this.inView && platform.pageVisible() && !reduced;\n const active = this.scene.active();\n if (!allowed && reduced && active) {\n this.scene.rest();\n this.draw();\n }\n const run = allowed && active;\n if (run === this.running) return;\n this.running = run;\n if (run) {\n this.lastFrame = performance.now();\n this.rafId = requestAnimationFrame(this.frame);\n return;\n }\n this.stopLoop();\n }\n\n draw(): void {\n if (!this.ctx || this.width === 0) return;\n this.scene.draw(this.ctx, this.width, this.height);\n }\n\n private stopLoop(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n private readonly frame = (now: number): void => {\n this.rafId = null;\n if (!this.running) return;\n // A scene with a frame floor waits for it: the early frame is skipped\n // whole, and the one that is drawn gets the time of both.\n const floor = this.scene.frameMs ?? 0;\n if (floor > 0 && now - this.lastFrame + FRAME_FLOOR_SLACK < floor) {\n this.rafId = requestAnimationFrame(this.frame);\n return;\n }\n const dt = clamp(now - this.lastFrame, 0, MAX_FRAME_MS);\n this.lastFrame = now;\n this.scene.advance(dt);\n this.draw();\n if (!this.scene.active()) {\n this.running = false;\n return;\n }\n this.rafId = requestAnimationFrame(this.frame);\n };\n}\n\n/**\n * The device ratio is never followed past this: a third pixel per axis buys\n * nothing a faint backdrop shows.\n *\n * @internal\n */\nexport const MAX_DPR = 2;\n\n/**\n * The backing store's pixel budget. A section stacked on a phone runs to\n * thousands of CSS pixels tall; past this the ratio drops (never below 1), so\n * the canvas stays a few megabytes instead of tens.\n *\n * @internal\n */\nexport const MAX_PIXELS = 4_000_000;\n\n/**\n * A tab that was throttled comes back with one huge frame; a scene moves at\n * most this far at once.\n *\n * @internal\n */\nexport const MAX_FRAME_MS = 50;\n\n/**\n * How much short of its `frameMs` a frame may fall and still be drawn: a 60Hz\n * screen's second frame lands at 33.3ms, not at the 33 a scene asks for, and\n * without the slack it would wait for the third and run at 20fps.\n *\n * @internal\n */\nexport const FRAME_FLOOR_SLACK = 2;\n\n/**\n * The ratio to draw a `width` by `height` box at: the device's, capped at\n * {@link MAX_DPR} and by {@link MAX_PIXELS}, never under one.\n *\n * @internal\n */\nexport function canvasBackdropRatio(width: number, height: number, devicePixelRatio: number): number {\n const budget = Math.sqrt(MAX_PIXELS / (width * height));\n return Math.max(1, Math.min(MAX_DPR, devicePixelRatio, budget));\n}\n\n/**\n * What a canvas backdrop draws and moves. The plumbing around it (sizing,\n * colours, gates, the frame loop) is {@link createCanvasBackdrop}'s.\n *\n * @internal\n */\nexport interface WrCanvasBackdropScene {\n /** Reads the scene's colours against `canvas`, at mount and whenever the colour scheme changes. */\n colors(canvas: HTMLCanvasElement): void;\n /** Lays the scene out for a new CSS size; the backing store and its transform are already set. */\n layout(width: number, height: number): void;\n /** Whether anything is left to move: the loop runs while this holds and the gates allow. */\n active(): boolean;\n /** Moves the scene `dt` ms on, before a frame's draw. */\n advance(dt: number): void;\n /** Paints the scene on `ctx`, in CSS px. */\n draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;\n /** Snaps the scene to its still state, when motion was reduced mid-flight; a draw follows. */\n rest(): void;\n /** Runs once the canvas has a context and is watched, after the first `colors`; for the scene's own listeners. */\n mounted?(): void;\n /**\n * The shortest frame the scene wants, in ms: a frame that comes sooner is\n * skipped and its time rolls into the next. For a scene that never rests,\n * where slow motion needs no more than 30fps; unset, every frame is drawn.\n */\n readonly frameMs?: number;\n}\n\n/**\n * The plumbing side of a canvas backdrop, as the component sees it.\n *\n * @internal\n */\nexport interface WrCanvasBackdrop {\n /** The drawing context while mounted, `null` on the server, under forced colours and after destroy. */\n readonly ctx: CanvasRenderingContext2D | null;\n /** The canvas's CSS size, zero until the first layout. */\n readonly width: number;\n readonly height: number;\n /** Whether the frame loop is on. */\n readonly running: boolean;\n /** Starts or stops the loop after the scene changed: the gates, then `scene.active()`. */\n sync(): void;\n /** Paints the scene once, outside the loop. */\n draw(): void;\n}\n\n/**\n * The plumbing every canvas backdrop needs: one canvas at the device ratio\n * capped at two and by a pixel budget, a `ResizeObserver` folded into one\n * frame, colours re-read when the scheme changes, and a frame loop that runs\n * only while the scene is `active()`, the host is on screen and the document is\n * visible, and that stops on its own at rest; a scene that sets `frameMs` is\n * drawn no more often than that. Under `prefers-reduced-motion:\n * reduce` the loop never runs and a scene caught moving is put to `rest()`;\n * under `forced-colors: active` nothing mounts; on the server nothing happens.\n *\n * Call it in a component's constructor: it injects the host, the platform and\n * the destroy hook, mounts after the first render and cleans up on destroy.\n * `canvas` is read at mount, so a `viewChild` works. The scene's own pointer\n * listeners go in `mounted`, their removal in the component's `DestroyRef`.\n *\n * @internal\n */\nexport function createCanvasBackdrop(canvas: () => HTMLCanvasElement, scene: WrCanvasBackdropScene): WrCanvasBackdrop {\n const backdrop = new Backdrop(canvas, scene);\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return backdrop;\n\n const platform = inject(WrPlatform);\n const doc = inject(DOCUMENT);\n const injector = inject(Injector);\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n effect(() => {\n platform.pageVisible();\n platform.prefersReducedMotion();\n backdrop.sync();\n });\n\n afterNextRender(() => backdrop.mount(host, doc, platform, injector));\n inject(DestroyRef).onDestroy(() => backdrop.unmount());\n\n return backdrop;\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\n/**\n * What a keyboard can reach: the element an effect reads hover and focus on is\n * the host's closest match, so a label inside a button behaves the same for a\n * pointer and for Tab.\n *\n * @internal\n */\nexport const FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex]';\n\n/**\n * An optional CSS selector written as a directive's own value: a bare\n * attribute is the empty string, and means \"the host\".\n *\n * @internal\n */\nexport const optionalSelector = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() !== '' ? value : null;\n\n/**\n * `value` rounded to `digits` decimals, for a number written into the DOM every\n * frame: a transform of `12.34px` repaints the same as one of `12.3400000001px`\n * and is a tenth of the string.\n *\n * @internal\n */\nexport function roundTo(value: number, digits: number): number {\n const factor = 10 ** digits;\n return Math.round(value * factor) / factor;\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\n/** `n` folded into the lattice's 0..255, for any integer. */\nconst wrap = (n: number): number => ((n % 256) + 256) % 256;\nconst fade = (t: number): number => t * t * (3 - 2 * t);\nconst lerp = (a: number, b: number, t: number): number => a + (b - a) * t;\n\n/**\n * Smooth noise in -1..1, continuous in all three arguments.\n *\n * @internal\n */\nexport type WrNoise = (x: number, y: number, z: number) => number;\n\n/**\n * A small generator in 0..1, the same run for the same seed: a linear\n * congruence on 2^32, in plain arithmetic, which stays exact under 2^53.\n *\n * @internal\n */\nexport function seededRandom(seed: number): () => number {\n let state = seed % 4294967296;\n return () => {\n state = (state * 1664525 + 1013904223) % 4294967296;\n return state / 4294967296;\n };\n}\n\n/**\n * Value noise on a lattice shuffled from `seed`: smooth, in -1..1, and the\n * same function every time for the same seed, so a spec can pin a frame. A\n * backdrop that should differ from one page load to the next passes a random\n * seed.\n *\n * @internal\n */\nexport function createNoise(seed: number): WrNoise {\n const random = seededRandom(seed);\n const order = Array.from({ length: 256 }, (_, i) => i);\n for (let i = 255; i > 0; i--) {\n const j = Math.floor(random() * (i + 1));\n [order[i], order[j]] = [order[j], order[i]];\n }\n const perm = new Uint8Array(512);\n const values = new Float32Array(512);\n for (let i = 0; i < 512; i++) {\n perm[i] = order[wrap(i)];\n values[i] = random() * 2 - 1;\n }\n return (x, y, z) => {\n const xi = Math.floor(x);\n const yi = Math.floor(y);\n const zi = Math.floor(z);\n const u = fade(x - xi);\n const v = fade(y - yi);\n const w = fade(z - zi);\n const yw = wrap(yi);\n const zw = wrap(zi);\n const a = perm[wrap(xi)] + yw;\n const b = perm[wrap(xi + 1)] + yw;\n const aa = perm[a] + zw;\n const ab = perm[a + 1] + zw;\n const ba = perm[b] + zw;\n const bb = perm[b + 1] + zw;\n return lerp(\n lerp(lerp(values[aa], values[ba], u), lerp(values[ab], values[bb], u), v),\n lerp(lerp(values[aa + 1], values[ba + 1], u), lerp(values[ab + 1], values[bb + 1], u), v),\n w\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\n/**\n * What an effect does with the hovering pointer a {@link WrPointerTracker} follows.\n *\n * @internal\n */\nexport interface WrPointerFollower {\n /** The first hovering pointer came in. The host is measured: `rect` is set. */\n enter(): void;\n /**\n * One animation frame, for any number of moves since the last. `clientX`,\n * `clientY` and `rect` hold the latest point and box. `time` is the frame's\n * timestamp, for a follower that eases toward the point over several frames.\n */\n frame(time: number): void;\n /** The pointer left, or the tracker stopped while it was inside. A pending frame is cancelled first; `rect` is `null`. */\n leave(): void;\n}\n\n/**\n * The pointer-tracking plumbing shared by the card effects: `[wrSpotlight]`\n * and `[wrTilt]`. It listens on the host for a hovering pointer, hands the\n * follower one `enter`, then one `frame` per animation frame however many\n * moves came in, and one `leave`; the follower paints.\n *\n * The host's rect is read once at enter, and again on a window `scroll` or\n * `resize` while the pointer is inside (the card moved under a still pointer:\n * one more frame is scheduled), never per move. A touch pointer is ignored: it\n * has no hover, and a tap would leave the effect on. A move with no enter\n * before it (the directive attached under a resting pointer) counts as the\n * enter. Nothing here decides about reduced motion, forced colours or the\n * server: the directive does, and simply never calls `start()`.\n *\n * `schedule()` is public so a follower that needs more frames after the\n * pointer left (an ease back to rest) can ask for them: it is not tied to the\n * pointer being inside. `stop()` cancels whatever is pending.\n *\n * @internal\n */\nexport class WrPointerTracker {\n /** The last client point seen. */\n clientX = 0;\n clientY = 0;\n /** The host's border box, measured at enter; `null` while no pointer is inside. */\n rect: DOMRect | null = null;\n\n private listeners: AbortController | null = null;\n /** Window `scroll` and `resize`, alive only while the pointer is inside. */\n private tracking: AbortController | null = null;\n /** The pending frame's id, `0` when none is pending. */\n private frame = 0;\n\n constructor(\n private readonly host: HTMLElement,\n private readonly view: Window,\n private readonly follower: WrPointerFollower\n ) {}\n\n /** Whether a hovering pointer is inside the host. */\n get inside(): boolean {\n return this.rect !== null;\n }\n\n start(): void {\n if (this.listeners) return;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n this.host.addEventListener('pointerenter', event => this.follow(event), options);\n this.host.addEventListener('pointermove', event => this.follow(event), options);\n this.host.addEventListener('pointerleave', () => this.off(), options);\n }\n\n /** Drops every listener and the pending frame; a pointer still inside leaves first. */\n stop(): void {\n this.listeners?.abort();\n this.listeners = null;\n if (this.rect !== null) this.off();\n this.cancel();\n }\n\n /** One frame for any number of calls. */\n schedule(): void {\n if (this.frame !== 0) return;\n this.frame = this.view.requestAnimationFrame(time => {\n this.frame = 0;\n this.follower.frame(time);\n });\n }\n\n private follow(event: PointerEvent): void {\n if (event.pointerType === 'touch') return;\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n if (this.rect === null) this.on();\n this.schedule();\n }\n\n private on(): void {\n this.rect = this.host.getBoundingClientRect();\n this.tracking = new AbortController();\n const options = { signal: this.tracking.signal, passive: true };\n const refresh = (): void => {\n this.rect = this.host.getBoundingClientRect();\n this.schedule();\n };\n this.view.addEventListener('scroll', refresh, { ...options, capture: true });\n this.view.addEventListener('resize', refresh, options);\n this.follower.enter();\n }\n\n private off(): void {\n this.tracking?.abort();\n this.tracking = null;\n this.rect = null;\n this.cancel();\n this.follower.leave();\n }\n\n private cancel(): void {\n if (this.frame === 0) return;\n this.view.cancelAnimationFrame(this.frame);\n this.frame = 0;\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 { numAttr } from 'ngwr/utils';\n\nimport type { WrStaggerBy } from './types';\n\nlet segmenter: Intl.Segmenter | undefined;\n\n/**\n * How far the start of the last piece may sit from the start of the first, in ms.\n *\n * @internal\n */\nexport const STAGGER_SPREAD_MAX = 1200;\n\n/**\n * The gap between two pieces when an effect's `stagger` is not set, in ms.\n *\n * @internal\n */\nexport const STAGGER_GAP: Readonly<Record<WrStaggerBy, number>> = { words: 70, letters: 28 };\n\n/**\n * How much of a host has to be in the viewport before an effect plays: most\n * of it, not the first pixel of a heading peeking in at the bottom edge.\n *\n * @internal\n */\nexport const VIEW_THRESHOLD = 0.6;\n\n/**\n * A run of breaking spaces, captured so `split` keeps it. U+00A0 and the other\n * no-break spaces are not in it: a word pair the author glued together stays one\n * piece, so the lines break exactly where they did before the split.\n *\n * @internal\n */\nexport const BREAKING_SPACES = /([ \\t\\n\\r\\f]+)/;\n\n/**\n * What a reader sees as one character, so an emoji or an accented letter is never cut in two.\n *\n * @internal\n */\nexport function graphemes(text: string): string[] {\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n segmenter ??= new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n return [...segmenter.segment(text)].map(s => s.segment);\n }\n // Code points: a surrogate pair stays whole, a combining mark becomes its own piece.\n return [...text];\n}\n\n/**\n * The gap between the start of one piece and the next, in ms: `stagger` when\n * set, else the mode's, and never more than lets the last of `count` pieces\n * start by {@link STAGGER_SPREAD_MAX}.\n *\n * @internal\n */\nexport function staggerGap(by: WrStaggerBy, count: number, stagger: number | null = null): number {\n return Math.min(Math.max(0, stagger ?? STAGGER_GAP[by]), STAGGER_SPREAD_MAX / Math.max(1, count - 1));\n}\n\n/**\n * An optional count in ms: `null`, `undefined` or an empty attribute means \"the mode's default\".\n *\n * @internal\n */\nexport const optionalMs = (value: unknown): number | null => (value == null || value === '' ? null : numAttr(0)(value));\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\n/**\n * The helpers ngwr's animations share: the grapheme splitter, the stagger gap\n * and its cap, the viewport threshold an effect plays at, the focusable\n * selector hover and focus are read on, the optional-selector transform, the\n * per-frame rounding, the canvas plumbing a backdrop draws through, the\n * seeded noise a field sways with and the pointer tracking the card effects\n * follow. Every export is `@internal` — an entry point of its\n * own so that the effects can all import it without one effect importing\n * another, and not a public API: nothing here carries a stability promise, and\n * an app imports an effect instead.\n */\nexport {\n FRAME_FLOOR_SLACK,\n MAX_DPR,\n MAX_FRAME_MS,\n MAX_PIXELS,\n type WrCanvasBackdrop,\n type WrCanvasBackdropScene,\n canvasBackdropRatio,\n createCanvasBackdrop,\n} from './canvas-backdrop';\nexport { FOCUSABLE, optionalSelector, roundTo } from './dom';\nexport { type WrNoise, createNoise, seededRandom } from './noise';\nexport { type WrPointerFollower, WrPointerTracker } from './pointer-tracker';\nexport {\n BREAKING_SPACES,\n STAGGER_GAP,\n STAGGER_S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KAAK,SAAS,MAAK;CACrB;CAEQ,SAAM;EACZ,IAAI,KAAK,UAAU,GAAG;EACtB,KAAK,KAAK,qBAAqB,KAAK,KAAK;EACzC,KAAK,QAAQ;CACf;AACD;;;;;;;ACtHD,IAAI;AAOJ,MAAa,qBAAqB;AAOlC,MAAa,cAAqD;CAAE,OAAO;CAAI,SAAS;AAAE;AAQ1F,MAAa,iBAAiB;AAS9B,MAAa,kBAAkB;AAO/B,SAAgB,UAAU,MAAY;CACpC,IAAI,OAAO,SAAS,eAAe,eAAe,MAAM;EACtD,cAAc,IAAI,KAAK,UAAU,QAAW,EAAE,aAAa,WAAU,CAAE;EACvE,OAAO,CAAC,GAAG,UAAU,QAAQ,IAAI,CAAC,CAAC,CAAC,KAAI,MAAK,EAAE,OAAO;CACxD;CAEA,OAAO,CAAC,GAAG,IAAI;AACjB;AASA,SAAgB,WAAW,IAAiB,OAAe,UAAyB,MAAI;CACtF,OAAO,KAAK,IAAI,KAAK,IAAI,GAAG,WAAW,YAAY,GAAG,GAAG,qBAAqB,KAAK,IAAI,GAAG,QAAQ,CAAC,CAAC;AACtG;AAOA,MAAa,cAAc,UAAmC,SAAS,QAAQ,UAAU,KAAK,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK"}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* The device ratio is never followed past this: a third pixel per axis buys
|
|
9
|
-
* nothing a faint backdrop shows.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare const MAX_DPR = 2;
|
|
14
|
-
/**
|
|
15
|
-
* The backing store's pixel budget. A section stacked on a phone runs to
|
|
16
|
-
* thousands of CSS pixels tall; past this the ratio drops (never below 1), so
|
|
17
|
-
* the canvas stays a few megabytes instead of tens.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare const MAX_PIXELS = 4000000;
|
|
22
|
-
/**
|
|
23
|
-
* A tab that was throttled comes back with one huge frame; a scene moves at
|
|
24
|
-
* most this far at once.
|
|
25
|
-
*
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export declare const MAX_FRAME_MS = 50;
|
|
29
|
-
/**
|
|
30
|
-
* How much short of its `frameMs` a frame may fall and still be drawn: a 60Hz
|
|
31
|
-
* screen's second frame lands at 33.3ms, not at the 33 a scene asks for, and
|
|
32
|
-
* without the slack it would wait for the third and run at 20fps.
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
export declare const FRAME_FLOOR_SLACK = 2;
|
|
37
|
-
/**
|
|
38
|
-
* The ratio to draw a `width` by `height` box at: the device's, capped at
|
|
39
|
-
* {@link MAX_DPR} and by {@link MAX_PIXELS}, never under one.
|
|
40
|
-
*
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
export declare function canvasBackdropRatio(width: number, height: number, devicePixelRatio: number): number;
|
|
44
|
-
/**
|
|
45
|
-
* What a canvas backdrop draws and moves. The plumbing around it (sizing,
|
|
46
|
-
* colours, gates, the frame loop) is {@link createCanvasBackdrop}'s.
|
|
47
|
-
*
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
interface WrCanvasBackdropScene {
|
|
51
|
-
/** Reads the scene's colours against `canvas`, at mount and whenever the colour scheme changes. */
|
|
52
|
-
colors(canvas: HTMLCanvasElement): void;
|
|
53
|
-
/** Lays the scene out for a new CSS size; the backing store and its transform are already set. */
|
|
54
|
-
layout(width: number, height: number): void;
|
|
55
|
-
/** Whether anything is left to move: the loop runs while this holds and the gates allow. */
|
|
56
|
-
active(): boolean;
|
|
57
|
-
/** Moves the scene `dt` ms on, before a frame's draw. */
|
|
58
|
-
advance(dt: number): void;
|
|
59
|
-
/** Paints the scene on `ctx`, in CSS px. */
|
|
60
|
-
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
61
|
-
/** Snaps the scene to its still state, when motion was reduced mid-flight; a draw follows. */
|
|
62
|
-
rest(): void;
|
|
63
|
-
/** Runs once the canvas has a context and is watched, after the first `colors`; for the scene's own listeners. */
|
|
64
|
-
mounted?(): void;
|
|
65
|
-
/**
|
|
66
|
-
* The shortest frame the scene wants, in ms: a frame that comes sooner is
|
|
67
|
-
* skipped and its time rolls into the next. For a scene that never rests,
|
|
68
|
-
* where slow motion needs no more than 30fps; unset, every frame is drawn.
|
|
69
|
-
*/
|
|
70
|
-
readonly frameMs?: number;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* The plumbing side of a canvas backdrop, as the component sees it.
|
|
74
|
-
*
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
interface WrCanvasBackdrop {
|
|
78
|
-
/** The drawing context while mounted, `null` on the server, under forced colours and after destroy. */
|
|
79
|
-
readonly ctx: CanvasRenderingContext2D | null;
|
|
80
|
-
/** The canvas's CSS size, zero until the first layout. */
|
|
81
|
-
readonly width: number;
|
|
82
|
-
readonly height: number;
|
|
83
|
-
/** Whether the frame loop is on. */
|
|
84
|
-
readonly running: boolean;
|
|
85
|
-
/** Starts or stops the loop after the scene changed: the gates, then `scene.active()`. */
|
|
86
|
-
sync(): void;
|
|
87
|
-
/** Paints the scene once, outside the loop. */
|
|
88
|
-
draw(): void;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* The plumbing every canvas backdrop needs: one canvas at the device ratio
|
|
92
|
-
* capped at two and by a pixel budget, a `ResizeObserver` folded into one
|
|
93
|
-
* frame, colours re-read when the scheme changes, and a frame loop that runs
|
|
94
|
-
* only while the scene is `active()`, the host is on screen and the document is
|
|
95
|
-
* visible, and that stops on its own at rest; a scene that sets `frameMs` is
|
|
96
|
-
* drawn no more often than that. Under `prefers-reduced-motion:
|
|
97
|
-
* reduce` the loop never runs and a scene caught moving is put to `rest()`;
|
|
98
|
-
* under `forced-colors: active` nothing mounts; on the server nothing happens.
|
|
99
|
-
*
|
|
100
|
-
* Call it in a component's constructor: it injects the host, the platform and
|
|
101
|
-
* the destroy hook, mounts after the first render and cleans up on destroy.
|
|
102
|
-
* `canvas` is read at mount, so a `viewChild` works. The scene's own pointer
|
|
103
|
-
* listeners go in `mounted`, their removal in the component's `DestroyRef`.
|
|
104
|
-
*
|
|
105
|
-
* @internal
|
|
106
|
-
*/
|
|
107
|
-
export declare function createCanvasBackdrop(canvas: () => HTMLCanvasElement, scene: WrCanvasBackdropScene): WrCanvasBackdrop;
|
|
108
|
-
/**
|
|
109
|
-
* @license
|
|
110
|
-
*
|
|
111
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
112
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
113
|
-
*/
|
|
114
|
-
/**
|
|
115
|
-
* What a keyboard can reach: the element an effect reads hover and focus on is
|
|
116
|
-
* the host's closest match, so a label inside a button behaves the same for a
|
|
117
|
-
* pointer and for Tab.
|
|
118
|
-
*
|
|
119
|
-
* @internal
|
|
120
|
-
*/
|
|
121
|
-
export declare const FOCUSABLE = "a[href], button, input, select, textarea, summary, [tabindex]";
|
|
122
|
-
/**
|
|
123
|
-
* An optional CSS selector written as a directive's own value: a bare
|
|
124
|
-
* attribute is the empty string, and means "the host".
|
|
125
|
-
*
|
|
126
|
-
* @internal
|
|
127
|
-
*/
|
|
128
|
-
export declare const optionalSelector: (value: unknown) => string | null;
|
|
129
|
-
/**
|
|
130
|
-
* `value` rounded to `digits` decimals, for a number written into the DOM every
|
|
131
|
-
* frame: a transform of `12.34px` repaints the same as one of `12.3400000001px`
|
|
132
|
-
* and is a tenth of the string.
|
|
133
|
-
*
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
export declare function roundTo(value: number, digits: number): number;
|
|
137
|
-
/**
|
|
138
|
-
* @license
|
|
139
|
-
*
|
|
140
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
141
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
142
|
-
*/
|
|
143
|
-
/**
|
|
144
|
-
* Smooth noise in -1..1, continuous in all three arguments.
|
|
145
|
-
*
|
|
146
|
-
* @internal
|
|
147
|
-
*/
|
|
148
|
-
type WrNoise = (x: number, y: number, z: number) => number;
|
|
149
|
-
/**
|
|
150
|
-
* A small generator in 0..1, the same run for the same seed: a linear
|
|
151
|
-
* congruence on 2^32, in plain arithmetic, which stays exact under 2^53.
|
|
152
|
-
*
|
|
153
|
-
* @internal
|
|
154
|
-
*/
|
|
155
|
-
export declare function seededRandom(seed: number): () => number;
|
|
156
|
-
/**
|
|
157
|
-
* Value noise on a lattice shuffled from `seed`: smooth, in -1..1, and the
|
|
158
|
-
* same function every time for the same seed, so a spec can pin a frame. A
|
|
159
|
-
* backdrop that should differ from one page load to the next passes a random
|
|
160
|
-
* seed.
|
|
161
|
-
*
|
|
162
|
-
* @internal
|
|
163
|
-
*/
|
|
164
|
-
export declare function createNoise(seed: number): WrNoise;
|
|
165
|
-
/**
|
|
166
|
-
* @license
|
|
167
|
-
*
|
|
168
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
169
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
170
|
-
*/
|
|
171
|
-
/**
|
|
172
|
-
* What an effect does with the hovering pointer a {@link WrPointerTracker} follows.
|
|
173
|
-
*
|
|
174
|
-
* @internal
|
|
175
|
-
*/
|
|
176
|
-
interface WrPointerFollower {
|
|
177
|
-
/** The first hovering pointer came in. The host is measured: `rect` is set. */
|
|
178
|
-
enter(): void;
|
|
179
|
-
/**
|
|
180
|
-
* One animation frame, for any number of moves since the last. `clientX`,
|
|
181
|
-
* `clientY` and `rect` hold the latest point and box. `time` is the frame's
|
|
182
|
-
* timestamp, for a follower that eases toward the point over several frames.
|
|
183
|
-
*/
|
|
184
|
-
frame(time: number): void;
|
|
185
|
-
/** The pointer left, or the tracker stopped while it was inside. A pending frame is cancelled first; `rect` is `null`. */
|
|
186
|
-
leave(): void;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* The pointer-tracking plumbing shared by the card effects: `[wrSpotlight]`
|
|
190
|
-
* and `[wrTilt]`. It listens on the host for a hovering pointer, hands the
|
|
191
|
-
* follower one `enter`, then one `frame` per animation frame however many
|
|
192
|
-
* moves came in, and one `leave`; the follower paints.
|
|
193
|
-
*
|
|
194
|
-
* The host's rect is read once at enter, and again on a window `scroll` or
|
|
195
|
-
* `resize` while the pointer is inside (the card moved under a still pointer:
|
|
196
|
-
* one more frame is scheduled), never per move. A touch pointer is ignored: it
|
|
197
|
-
* has no hover, and a tap would leave the effect on. A move with no enter
|
|
198
|
-
* before it (the directive attached under a resting pointer) counts as the
|
|
199
|
-
* enter. Nothing here decides about reduced motion, forced colours or the
|
|
200
|
-
* server: the directive does, and simply never calls `start()`.
|
|
201
|
-
*
|
|
202
|
-
* `schedule()` is public so a follower that needs more frames after the
|
|
203
|
-
* pointer left (an ease back to rest) can ask for them: it is not tied to the
|
|
204
|
-
* pointer being inside. `stop()` cancels whatever is pending.
|
|
205
|
-
*
|
|
206
|
-
* @internal
|
|
207
|
-
*/
|
|
208
|
-
export declare class WrPointerTracker {
|
|
209
|
-
private readonly host;
|
|
210
|
-
private readonly view;
|
|
211
|
-
private readonly follower;
|
|
212
|
-
/** The last client point seen. */
|
|
213
|
-
clientX: number;
|
|
214
|
-
clientY: number;
|
|
215
|
-
/** The host's border box, measured at enter; `null` while no pointer is inside. */
|
|
216
|
-
rect: DOMRect | null;
|
|
217
|
-
private listeners;
|
|
218
|
-
/** Window `scroll` and `resize`, alive only while the pointer is inside. */
|
|
219
|
-
private tracking;
|
|
220
|
-
/** The pending frame's id, `0` when none is pending. */
|
|
221
|
-
private frame;
|
|
222
|
-
constructor(host: HTMLElement, view: Window, follower: WrPointerFollower);
|
|
223
|
-
/** Whether a hovering pointer is inside the host. */
|
|
224
|
-
get inside(): boolean;
|
|
225
|
-
start(): void;
|
|
226
|
-
/** Drops every listener and the pending frame; a pointer still inside leaves first. */
|
|
227
|
-
stop(): void;
|
|
228
|
-
/** One frame for any number of calls. */
|
|
229
|
-
schedule(): void;
|
|
230
|
-
private follow;
|
|
231
|
-
private on;
|
|
232
|
-
private off;
|
|
233
|
-
private cancel;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* @license
|
|
237
|
-
*
|
|
238
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
239
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
240
|
-
*/
|
|
241
|
-
/**
|
|
242
|
-
* What one animated piece of a text is: a word, or a grapheme.
|
|
243
|
-
*
|
|
244
|
-
* @internal
|
|
245
|
-
*/
|
|
246
|
-
type WrStaggerBy = 'words' | 'letters';
|
|
247
|
-
/**
|
|
248
|
-
* How far the start of the last piece may sit from the start of the first, in ms.
|
|
249
|
-
*
|
|
250
|
-
* @internal
|
|
251
|
-
*/
|
|
252
|
-
export declare const STAGGER_SPREAD_MAX = 1200;
|
|
253
|
-
/**
|
|
254
|
-
* The gap between two pieces when an effect's `stagger` is not set, in ms.
|
|
255
|
-
*
|
|
256
|
-
* @internal
|
|
257
|
-
*/
|
|
258
|
-
export declare const STAGGER_GAP: Readonly<Record<WrStaggerBy, number>>;
|
|
259
|
-
/**
|
|
260
|
-
* How much of a host has to be in the viewport before an effect plays: most
|
|
261
|
-
* of it, not the first pixel of a heading peeking in at the bottom edge.
|
|
262
|
-
*
|
|
263
|
-
* @internal
|
|
264
|
-
*/
|
|
265
|
-
export declare const VIEW_THRESHOLD = 0.6;
|
|
266
|
-
/**
|
|
267
|
-
* A run of breaking spaces, captured so `split` keeps it. U+00A0 and the other
|
|
268
|
-
* no-break spaces are not in it: a word pair the author glued together stays one
|
|
269
|
-
* piece, so the lines break exactly where they did before the split.
|
|
270
|
-
*
|
|
271
|
-
* @internal
|
|
272
|
-
*/
|
|
273
|
-
export declare const BREAKING_SPACES: RegExp;
|
|
274
|
-
/**
|
|
275
|
-
* What a reader sees as one character, so an emoji or an accented letter is never cut in two.
|
|
276
|
-
*
|
|
277
|
-
* @internal
|
|
278
|
-
*/
|
|
279
|
-
export declare function graphemes(text: string): string[];
|
|
280
|
-
/**
|
|
281
|
-
* The gap between the start of one piece and the next, in ms: `stagger` when
|
|
282
|
-
* set, else the mode's, and never more than lets the last of `count` pieces
|
|
283
|
-
* start by {@link STAGGER_SPREAD_MAX}.
|
|
284
|
-
*
|
|
285
|
-
* @internal
|
|
286
|
-
*/
|
|
287
|
-
export declare function staggerGap(by: WrStaggerBy, count: number, stagger?: number | null): number;
|
|
288
|
-
/**
|
|
289
|
-
* An optional count in ms: `null`, `undefined` or an empty attribute means "the mode's default".
|
|
290
|
-
*
|
|
291
|
-
* @internal
|
|
292
|
-
*/
|
|
293
|
-
export declare const optionalMs: (value: unknown) => number | null;
|
|
294
|
-
export type { WrCanvasBackdrop, WrCanvasBackdropScene, WrNoise, WrPointerFollower, WrStaggerBy };
|