ngwr 16.6.0 → 16.7.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/avatar/styles/_index.scss +39 -0
- package/button/styles/_index.scss +45 -2
- package/copy-value/styles/_index.scss +4 -0
- package/dropdown/styles/_index.scss +17 -0
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +4 -3
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +171 -6
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +26 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +5 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
- package/fesm2022/ngwr-charts-core.mjs +6 -6
- package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-meter-group.mjs +3 -3
- package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +7 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +102 -53
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +40 -16
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +19 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +181 -18
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +59 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +6 -5
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +7 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +68 -13
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -16
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +100 -11
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +6 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +6 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +6 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +6 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +6 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +6 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +6 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +6 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +6 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +6 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +6 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +520 -0
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ko.mjs +6 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +6 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +6 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +6 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +6 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +6 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +6 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +6 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +6 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +8 -4
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +16 -15
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +32 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +27 -27
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +7 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +115 -15
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +75 -10
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form.mjs +10 -6
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +232 -7
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +28 -19
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +66 -11
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs +11 -11
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-router.mjs +89 -0
- package/fesm2022/ngwr-table-router.mjs.map +1 -0
- package/fesm2022/ngwr-table-testing.mjs +5 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +268 -42
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +9 -5
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +8 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +60 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +15 -15
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +7 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +30 -2
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +18 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +16 -0
- package/graph/styles/_index.scss +48 -0
- package/i18n/ar.json +4 -2
- package/i18n/cs.json +4 -2
- package/i18n/de.json +4 -2
- package/i18n/en.json +4 -2
- package/i18n/es.json +4 -2
- package/i18n/fr.json +4 -2
- package/i18n/he.json +4 -2
- package/i18n/hi.json +4 -2
- package/i18n/id.json +4 -2
- package/i18n/it.json +4 -2
- package/i18n/ja.json +4 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +4 -2
- package/i18n/nl.json +4 -2
- package/i18n/pl.json +4 -2
- package/i18n/pt.json +4 -2
- package/i18n/ru.json +4 -2
- package/i18n/sv.json +4 -2
- package/i18n/tr.json +4 -2
- package/i18n/uk.json +4 -2
- package/i18n/vi.json +4 -2
- package/i18n/zh-TW.json +4 -2
- package/i18n/zh.json +4 -2
- package/llms-full.txt +29 -18
- package/llms.txt +4 -1
- package/package.json +15 -7
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +4 -2
- package/progress/styles/_index.scss +64 -0
- package/schematics/use/symbol-map.json +5 -0
- package/sidebar/styles/_index.scss +58 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +6 -4
- package/table/styles/_index.scss +121 -32
- package/tabs/styles/_index.scss +9 -0
- package/theme/styles/_focus.scss +3 -1
- package/tour/styles/_index.scss +3 -2
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-button.d.ts +12 -0
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +78 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-directives.d.ts +45 -0
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +29 -0
- package/types/ngwr-file-upload-testing.d.ts +10 -0
- package/types/ngwr-file-upload.d.ts +55 -1
- package/types/ngwr-form.d.ts +3 -1
- package/types/ngwr-graph-testing.d.ts +28 -1
- package/types/ngwr-graph.d.ts +53 -3
- package/types/ngwr-i18n-kk.d.ts +3 -0
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popover.d.ts +39 -0
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-scroll.d.ts +86 -0
- package/types/ngwr-select.d.ts +31 -12
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +184 -6
- package/types/ngwr-tabs-router.d.ts +1 -1
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-utils.d.ts +13 -0
- package/types/ngwr-version.d.ts +1 -1
package/fesm2022/ngwr-i18n.mjs
CHANGED
|
@@ -187,7 +187,7 @@ var WrI18n = class WrI18n {
|
|
|
187
187
|
}
|
|
188
188
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
189
189
|
minVersion: "12.0.0",
|
|
190
|
-
version: "22.
|
|
190
|
+
version: "22.3.0",
|
|
191
191
|
ngImport: i0,
|
|
192
192
|
type: WrI18n,
|
|
193
193
|
deps: [],
|
|
@@ -195,14 +195,14 @@ var WrI18n = class WrI18n {
|
|
|
195
195
|
});
|
|
196
196
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
197
197
|
minVersion: "22.0.0",
|
|
198
|
-
version: "22.
|
|
198
|
+
version: "22.3.0",
|
|
199
199
|
ngImport: i0,
|
|
200
200
|
type: WrI18n
|
|
201
201
|
});
|
|
202
202
|
};
|
|
203
203
|
i0.ɵɵngDeclareClassMetadata({
|
|
204
204
|
minVersion: "12.0.0",
|
|
205
|
-
version: "22.
|
|
205
|
+
version: "22.3.0",
|
|
206
206
|
ngImport: i0,
|
|
207
207
|
type: WrI18n,
|
|
208
208
|
decorators: [{ type: Service }],
|
|
@@ -221,7 +221,7 @@ var WrTPipe = class WrTPipe {
|
|
|
221
221
|
}
|
|
222
222
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
223
223
|
minVersion: "12.0.0",
|
|
224
|
-
version: "22.
|
|
224
|
+
version: "22.3.0",
|
|
225
225
|
ngImport: i0,
|
|
226
226
|
type: WrTPipe,
|
|
227
227
|
deps: [],
|
|
@@ -229,7 +229,7 @@ var WrTPipe = class WrTPipe {
|
|
|
229
229
|
});
|
|
230
230
|
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
231
231
|
minVersion: "14.0.0",
|
|
232
|
-
version: "22.
|
|
232
|
+
version: "22.3.0",
|
|
233
233
|
ngImport: i0,
|
|
234
234
|
type: WrTPipe,
|
|
235
235
|
isStandalone: true,
|
|
@@ -239,7 +239,7 @@ var WrTPipe = class WrTPipe {
|
|
|
239
239
|
};
|
|
240
240
|
i0.ɵɵngDeclareClassMetadata({
|
|
241
241
|
minVersion: "12.0.0",
|
|
242
|
-
version: "22.
|
|
242
|
+
version: "22.3.0",
|
|
243
243
|
ngImport: i0,
|
|
244
244
|
type: WrTPipe,
|
|
245
245
|
decorators: [{
|
|
@@ -274,7 +274,7 @@ var WrTDirective = class WrTDirective {
|
|
|
274
274
|
}
|
|
275
275
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
276
276
|
minVersion: "12.0.0",
|
|
277
|
-
version: "22.
|
|
277
|
+
version: "22.3.0",
|
|
278
278
|
ngImport: i0,
|
|
279
279
|
type: WrTDirective,
|
|
280
280
|
deps: [],
|
|
@@ -282,7 +282,7 @@ var WrTDirective = class WrTDirective {
|
|
|
282
282
|
});
|
|
283
283
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
284
284
|
minVersion: "17.1.0",
|
|
285
|
-
version: "22.
|
|
285
|
+
version: "22.3.0",
|
|
286
286
|
type: WrTDirective,
|
|
287
287
|
isStandalone: true,
|
|
288
288
|
selector: "[wrT]",
|
|
@@ -321,7 +321,7 @@ var WrTDirective = class WrTDirective {
|
|
|
321
321
|
};
|
|
322
322
|
i0.ɵɵngDeclareClassMetadata({
|
|
323
323
|
minVersion: "12.0.0",
|
|
324
|
-
version: "22.
|
|
324
|
+
version: "22.3.0",
|
|
325
325
|
ngImport: i0,
|
|
326
326
|
type: WrTDirective,
|
|
327
327
|
decorators: [{
|
package/fesm2022/ngwr-icon.mjs
CHANGED
|
@@ -31,7 +31,7 @@ var WrIconRegistry = class WrIconRegistry {
|
|
|
31
31
|
}
|
|
32
32
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
33
33
|
minVersion: "12.0.0",
|
|
34
|
-
version: "22.
|
|
34
|
+
version: "22.3.0",
|
|
35
35
|
ngImport: i0,
|
|
36
36
|
type: WrIconRegistry,
|
|
37
37
|
deps: [],
|
|
@@ -39,14 +39,14 @@ var WrIconRegistry = class WrIconRegistry {
|
|
|
39
39
|
});
|
|
40
40
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
41
41
|
minVersion: "12.0.0",
|
|
42
|
-
version: "22.
|
|
42
|
+
version: "22.3.0",
|
|
43
43
|
ngImport: i0,
|
|
44
44
|
type: WrIconRegistry
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
i0.ɵɵngDeclareClassMetadata({
|
|
48
48
|
minVersion: "12.0.0",
|
|
49
|
-
version: "22.
|
|
49
|
+
version: "22.3.0",
|
|
50
50
|
ngImport: i0,
|
|
51
51
|
type: WrIconRegistry,
|
|
52
52
|
decorators: [{ type: Injectable }]
|
|
@@ -318,7 +318,7 @@ var WrIcon = class WrIcon {
|
|
|
318
318
|
static reported = /* @__PURE__ */ new WeakSet();
|
|
319
319
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
320
320
|
minVersion: "12.0.0",
|
|
321
|
-
version: "22.
|
|
321
|
+
version: "22.3.0",
|
|
322
322
|
ngImport: i0,
|
|
323
323
|
type: WrIcon,
|
|
324
324
|
deps: [],
|
|
@@ -326,7 +326,7 @@ var WrIcon = class WrIcon {
|
|
|
326
326
|
});
|
|
327
327
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
328
328
|
minVersion: "17.1.0",
|
|
329
|
-
version: "22.
|
|
329
|
+
version: "22.3.0",
|
|
330
330
|
type: WrIcon,
|
|
331
331
|
isStandalone: true,
|
|
332
332
|
selector: "wr-icon",
|
|
@@ -349,7 +349,7 @@ var WrIcon = class WrIcon {
|
|
|
349
349
|
};
|
|
350
350
|
i0.ɵɵngDeclareClassMetadata({
|
|
351
351
|
minVersion: "12.0.0",
|
|
352
|
-
version: "22.
|
|
352
|
+
version: "22.3.0",
|
|
353
353
|
ngImport: i0,
|
|
354
354
|
type: WrIcon,
|
|
355
355
|
decorators: [{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, isDevMode, output, signal, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
|
-
import { wrCheckStyles, wrClamp, wrRandomId } from "ngwr/utils";
|
|
4
|
+
import { wrCheckStyles, wrClamp, wrFileNameForType, wrRandomId } from "ngwr/utils";
|
|
5
5
|
import { useI18nText } from "ngwr/i18n";
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
|
@@ -376,6 +376,10 @@ var WrImageCropper = class WrImageCropper {
|
|
|
376
376
|
}, type, quality);
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
+
async toFile(name, type = this.outputType(), quality = this.outputQuality()) {
|
|
380
|
+
const blob = await this.toBlob(type, quality);
|
|
381
|
+
return new File([blob], wrFileNameForType(name, blob.type), { type: blob.type });
|
|
382
|
+
}
|
|
379
383
|
toDataUrl(type = this.outputType(), quality = this.outputQuality()) {
|
|
380
384
|
return this.toCanvas().toDataURL(type, quality);
|
|
381
385
|
}
|
|
@@ -415,7 +419,7 @@ var WrImageCropper = class WrImageCropper {
|
|
|
415
419
|
}
|
|
416
420
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
417
421
|
minVersion: "12.0.0",
|
|
418
|
-
version: "22.
|
|
422
|
+
version: "22.3.0",
|
|
419
423
|
ngImport: i0,
|
|
420
424
|
type: WrImageCropper,
|
|
421
425
|
deps: [],
|
|
@@ -423,7 +427,7 @@ var WrImageCropper = class WrImageCropper {
|
|
|
423
427
|
});
|
|
424
428
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
425
429
|
minVersion: "17.0.0",
|
|
426
|
-
version: "22.
|
|
430
|
+
version: "22.3.0",
|
|
427
431
|
type: WrImageCropper,
|
|
428
432
|
isStandalone: true,
|
|
429
433
|
selector: "wr-image-cropper",
|
|
@@ -500,7 +504,7 @@ var WrImageCropper = class WrImageCropper {
|
|
|
500
504
|
};
|
|
501
505
|
i0.ɵɵngDeclareClassMetadata({
|
|
502
506
|
minVersion: "12.0.0",
|
|
503
|
-
version: "22.
|
|
507
|
+
version: "22.3.0",
|
|
504
508
|
ngImport: i0,
|
|
505
509
|
type: WrImageCropper,
|
|
506
510
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-image-cropper.mjs","names":[],"sources":["../../../projects/lib/image-cropper/image-cropper.ts","../../../projects/lib/image-cropper/image-cropper.html"],"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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n type ElementRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n output,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrClamp, wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrCropHandle, WrCropRect, WrImageCropperStatus, WrImageLoadError, WrImageOutputType } from './types';\n\n/**\n * `[maxOutputSize]`'s transform. Anything that is not a positive, finite number —\n * `null`, an empty attribute, `0`, a typo — means \"no cap\" rather than a 1px export:\n * a bad config should cost resolution nobody asked to lose, not the whole image.\n */\nfunction coerceMaxOutputSize(value: unknown): number | null {\n if (value === null || value === undefined || value === '') return null;\n const n = coerceNumberProperty(value, Number.NaN);\n return Number.isFinite(n) && n > 0 ? n : null;\n}\n\n/**\n * Stands in for the consumer input `useI18nText` expects. None of this\n * component's three strings has a `*Label` input behind it — the catalog is the\n * override channel — so they share one empty override.\n */\nconst NO_OVERRIDE = signal<string | null>(null).asReadonly();\n\n/** Keyboard step in display pixels, and what Shift promotes it to. */\nconst KEY_STEP = 1;\nconst KEY_STEP_COARSE = 10;\n\ninterface RectPx {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\ninterface SizePx {\n w: number;\n h: number;\n}\n\n/** Distances, in CSS pixels, past each side of a box. */\ninterface SidesPx {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nconst NO_SIDES: SidesPx = { left: 0, top: 0, right: 0, bottom: 0 };\n\n/**\n * The rect a resize gesture produces: a pure function of the rect the gesture started\n * from and the TOTAL pointer offset, so the same pointer position always gives the same\n * rect however the pointer got there.\n *\n * The anchor never moves. It is the edge or corner opposite the handle — for `se` the\n * top-left corner, for `e` the west edge's line. The old version clamped `x`, `y`, `w`\n * and `h` one at a time after deriving the second axis, so once the derived axis ran\n * into the image edge the rect slid AWAY from its anchor and, past the far bound, off\n * the image entirely.\n *\n * With a ratio the size is the largest along that ratio which fits from the anchor —\n * the smaller of the width-limited and height-limited sizes — and no smaller than both\n * minimums allow. Where the image cannot fit the minimum from this anchor, the bound\n * wins: a crop past the edge of the image is worse than one under the minimum.\n *\n * An edge handle with a ratio also sizes the axis it does not drive, and that axis has\n * the image's WHOLE extent to grow into: the rect stays centred on its old midline where\n * it can and slides along that axis only as far as it must to stay on the image. Capping\n * the size at twice the distance from the midline to the nearer side instead would leave\n * a square crop resting against the top edge unable to widen at all.\n */\nfunction resizeFrom(\n r: RectPx,\n handle: WrCropHandle,\n dx: number,\n dy: number,\n bounds: SizePx,\n min: SizePx,\n ratio: number | null\n): RectPx {\n const east = handle.includes('e');\n const west = handle.includes('w');\n const south = handle.includes('s');\n const north = handle.includes('n');\n const right = r.x + r.w;\n const bottom = r.y + r.h;\n\n if (!ratio || ratio <= 0) {\n let { x, y, w, h } = r;\n if (east) w = wrClamp(r.w + dx, min.w, bounds.w - r.x);\n if (west) {\n w = wrClamp(r.w - dx, min.w, right);\n x = right - w;\n }\n if (south) h = wrClamp(r.h + dy, min.h, bounds.h - r.y);\n if (north) {\n h = wrClamp(r.h - dy, min.h, bottom);\n y = bottom - h;\n }\n return { x, y, w, h };\n }\n\n // Room from the anchor to the image edge on each axis the handle drives; the whole\n // image on an axis it does not.\n const roomW = east ? bounds.w - r.x : west ? right : bounds.w;\n const roomH = south ? bounds.h - r.y : north ? bottom : bounds.h;\n // Corners follow the horizontal delta, as they always have; `n` / `s` the vertical one.\n const wanted = east ? r.w + dx : west ? r.w - dx : (south ? r.h + dy : r.h - dy) * ratio;\n const w = wrClamp(wanted, Math.max(min.w, min.h * ratio), Math.min(roomW, roomH * ratio));\n const h = w / ratio;\n\n return {\n x: east ? r.x : west ? right - w : wrClamp(r.x + r.w / 2 - w / 2, 0, bounds.w - w),\n y: south ? r.y : north ? bottom - h : wrClamp(r.y + r.h / 2 - h / 2, 0, bounds.h - h),\n w,\n h,\n };\n}\n\n/**\n * Image crop UI. Pass `[src]` (URL, `File`, or `Blob`); the user drags\n * the crop window or any of its eight handles. Optionally lock the crop\n * to a fixed `[aspectRatio]`.\n *\n * The crop window is also the one tab stop: arrow keys move it, Alt with an\n * arrow key resizes it, and Shift makes either step ten pixels instead of one.\n *\n * `(cropped)` fires after each drag end — or each run of arrow keys — with a\n * freshly-rendered `Blob` of the cropped region. For one-off reads use\n * `toBlob()` / `toDataUrl()`.\n *\n * A source the browser cannot decode fires `(loadError)` once, sets `status()` to\n * `'failed'` and puts `wr-image-cropper--failed` on the host. The component renders\n * no message of its own for it — what went wrong and what to do next is the host's\n * to say.\n *\n * The image is requested with `crossorigin=\"anonymous\"`, because a canvas will not\n * export pixels from another origin otherwise. A URL on another origin therefore has\n * to be served with `Access-Control-Allow-Origin`; one that is not fails to load and\n * fires `(loadError)`, where it used to show and then refuse every export.\n *\n * @example\n * ```html\n * <wr-image-cropper\n * [src]=\"file\"\n * [aspectRatio]=\"1\"\n * (cropped)=\"onBlob($event)\"\n * (loadError)=\"onUnreadable($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/image-cropper\n */\n@Component({\n selector: 'wr-image-cropper',\n templateUrl: './image-cropper.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-image-cropper',\n '[class.wr-image-cropper--failed]': \"status() === 'failed'\",\n },\n})\nexport class WrImageCropper {\n /** Image source — URL string, `File`, or `Blob`. */\n readonly src = input<string | File | Blob | null>(null);\n\n /** Aspect ratio (width / height). `null` = free. @default null */\n readonly aspectRatio = input<number | null>(null);\n\n /** Minimum crop width in display pixels. @default 32 */\n readonly minWidth = input(32, { transform: (v: unknown): number => Math.max(8, coerceNumberProperty(v, 32)) });\n\n /** Minimum crop height in display pixels. @default 32 */\n readonly minHeight = input(32, { transform: (v: unknown): number => Math.max(8, coerceNumberProperty(v, 32)) });\n\n /** Default output type for `(cropped)`. @default 'image/png' */\n readonly outputType = input<WrImageOutputType>('image/png');\n\n /** JPEG / WebP quality for `(cropped)` in [0, 1]. @default 0.92 */\n readonly outputQuality = input(0.92);\n\n /**\n * Longest side of the exported image, in pixels — for `(cropped)`, `toBlob()` and\n * `toDataUrl()` alike. A crop larger than this is scaled down to fit, keeping its\n * aspect ratio; a smaller one is exported as it is, never upscaled. The crop itself\n * — `cropRect()`, in source pixels — is not affected. `null` (or anything that is\n * not a positive number) exports at the source image's own resolution.\n * @default null\n */\n readonly maxOutputSize = input<number | null>(null, { transform: coerceMaxOutputSize });\n\n /** Emits a Blob after each drag end. */\n readonly cropped = output<Blob>();\n\n /**\n * Fires once when the browser cannot decode the current `src` — a format it does\n * not support, a broken file, a URL that fails. Nothing is rendered for it; show\n * your own message. A new `src` clears the failure.\n */\n readonly loadError = output<WrImageLoadError>();\n\n protected readonly imgEl = viewChild.required<ElementRef<HTMLImageElement>>('img');\n\n /** Resolved object URL for `src` (so File / Blob render in `<img>`). */\n protected readonly emptyText = useI18nText(NO_OVERRIDE, 'imageCropper.empty', 'No image');\n\n /** Accessible name of the crop window — the component's only tab stop. */\n protected readonly resolvedWindowLabel = useI18nText(NO_OVERRIDE, 'imageCropper.window', 'Crop region');\n\n /** The key model, referenced by the window's `aria-describedby`. */\n protected readonly resolvedKeyHelp = useI18nText(\n NO_OVERRIDE,\n 'imageCropper.keyHelp',\n 'Arrow keys move the crop. Hold Alt with an arrow key to resize it, and Shift for larger steps. ' +\n 'The crop is announced as left, top, width and height in image pixels.'\n );\n\n /** Id linking the crop window to the help text. Random rather than counted:\n * the crop UI only exists after a real image load, so it never prerenders. */\n protected readonly helpId = wrRandomId('wr-image-cropper-help');\n\n /** Live-region text — written by the keyboard path only (see `onWindowKeydown`). */\n protected readonly announcement = signal<string>('');\n\n protected readonly objectUrl = signal<string | null>(null);\n\n /** Previous object URL we created — kept off-signal so the resolve\n * effect doesn't depend on its own writes (which would loop). */\n private previousObjectUrl: string | null = null;\n\n /** Natural (source) pixel dimensions. */\n protected readonly natural = signal<{ w: number; h: number }>({ w: 0, h: 0 });\n\n /** Display (rendered) pixel dimensions. */\n protected readonly display = signal<{ w: number; h: number }>({ w: 0, h: 0 });\n\n /** Crop rect in display coordinates. */\n protected readonly cropDisplay = signal<RectPx>({ x: 0, y: 0, w: 0, h: 0 });\n\n /** Watches the rendered image box — see `watchResize`. */\n private resizeObserver: ResizeObserver | null = null;\n\n /** Currently active drag handle. */\n private active: WrCropHandle | null = null;\n private startPointer: { x: number; y: number } = { x: 0, y: 0 };\n private startRect: RectPx = { x: 0, y: 0, w: 0, h: 0 };\n\n /** The element the live drag set pointer capture on, so the end releases that one. */\n private captureTarget: HTMLElement | null = null;\n\n /** The pointer the live drag belongs to. Every other pointer's events are ignored. */\n private pointerId: number | null = null;\n\n /** How far past each side of the crop the live resize was pressed — see `onPointerMove`. */\n private overhang: SidesPx = NO_SIDES;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly statusState = signal<WrImageCropperStatus>('empty');\n\n /**\n * Where the source stands: `'empty'`, `'loading'`, `'loaded'` or `'failed'`. Reset\n * to `'loading'` (or `'empty'`) whenever `src` changes, so a failure never outlives\n * the source that caused it.\n */\n readonly status = this.statusState.asReadonly();\n\n /** Resolved crop rect in natural (source) pixel coordinates. */\n readonly cropRect = computed<WrCropRect>(() => {\n const display = this.display();\n const natural = this.natural();\n const c = this.cropDisplay();\n if (display.w === 0 || display.h === 0) return { x: 0, y: 0, width: 0, height: 0 };\n const sx = natural.w / display.w;\n const sy = natural.h / display.h;\n return {\n x: Math.round(c.x * sx),\n y: Math.round(c.y * sy),\n width: Math.round(c.w * sx),\n height: Math.round(c.h * sy),\n };\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('image-cropper');\n // Resolve the source into a usable URL the <img> can render.\n // We only read `src()` here — `previousObjectUrl` is a plain field, so\n // writing to `objectUrl` doesn't re-trigger this effect (and hang the\n // tab on file upload).\n effect(() => {\n const src = this.src();\n if (this.previousObjectUrl) {\n URL.revokeObjectURL(this.previousObjectUrl);\n this.previousObjectUrl = null;\n }\n // The crop is measured against the image that WAS showing, and `cropRect` is a\n // public signal a consumer can read at any moment. Left in place it kept\n // reporting a rect scaled to the previous image for the whole gap between a new\n // `src` and its load event — long enough to crop the wrong thing.\n this.resetGeometry();\n if (!src) {\n this.objectUrl.set(null);\n this.statusState.set('empty');\n return;\n }\n // A new source starts over: a failure belongs to the source that caused it, and\n // left in place it would mark a perfectly good next image as broken until the\n // browser answered for that one too.\n this.statusState.set('loading');\n if (typeof src === 'string') {\n this.objectUrl.set(src);\n } else {\n const url = URL.createObjectURL(src);\n this.previousObjectUrl = url;\n this.objectUrl.set(url);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.previousObjectUrl) URL.revokeObjectURL(this.previousObjectUrl);\n this.resizeObserver?.disconnect();\n });\n }\n\n // Image load\n\n /**\n * Back to \"nothing measured yet\", which is also what an absent `src` means.\n *\n * `display` is the field that gates everything downstream — the crop UI renders on\n * `display().w > 0` and `cropRect` returns zeros without it — so it is the only one\n * a test can observe. The other two are reset for coherence: the resize observer\n * below also writes `display`, and left alone they would resurrect a crop measured\n * against the previous image (which is why `onResize` refuses to run on a zeroed\n * `display` — see there).\n */\n private resetGeometry(): void {\n this.natural.set({ w: 0, h: 0 });\n this.display.set({ w: 0, h: 0 });\n this.cropDisplay.set({ x: 0, y: 0, w: 0, h: 0 });\n }\n\n protected onImageLoad(): void {\n const img = this.imgEl().nativeElement;\n const rect = img.getBoundingClientRect();\n const display = { w: rect.width, h: rect.height };\n // Some SVGs and odd images report zero natural dimensions — fall back\n // to the rendered size so the crop math stays well-defined.\n const natural = {\n w: img.naturalWidth || display.w,\n h: img.naturalHeight || display.h,\n };\n this.statusState.set('loaded');\n this.natural.set(natural);\n this.display.set(display);\n this.cropDisplay.set(this.initialCrop(display));\n this.watchResize(img);\n }\n\n /**\n * The `<img>` could not decode its source.\n *\n * Before this handler existed a failed decode left the component exactly as it\n * looks while loading — an image with no size, no crop window, nothing emitted —\n * so a host had no way to tell \"still decoding\" from \"never going to\", and a user\n * who picked a `.heic` the browser cannot read saw an empty box and no reason.\n *\n * Once per source: `status` is reset by a new `src` and by nothing else, so a\n * second `error` for the same source says nothing new and is not re-emitted.\n */\n protected onImageError(): void {\n const url = this.objectUrl();\n if (!url || this.statusState() === 'failed') return;\n this.statusState.set('failed');\n this.resetGeometry();\n\n const src = this.src();\n const isBlob = typeof src !== 'string' && src !== null;\n this.loadError.emit({\n url,\n name: typeof File !== 'undefined' && src instanceof File ? src.name : null,\n type: isBlob ? src.type : null,\n size: isBlob ? src.size : null,\n });\n }\n\n /**\n * Keep `display` on the box the image is actually rendered at.\n *\n * The stylesheet sizes the image responsively — `max-width: 100%`,\n * `max-height: 70dvh`, `height: auto` — so the single measurement taken in the\n * `(load)` handler stops being true as soon as the container or the viewport\n * changes. Everything the user sees and touches is in DISPLAY pixels: the crop\n * window's inline `left` / `top` / `width` / `height`, the backdrop cut-out, and\n * the bounds `applyMove` / `applyResize` clamp against. Measured once, a narrowed\n * window leaves the crop painted past the edge of the image and draggable off it.\n *\n * Re-observed per load rather than once, because a new `src` may mount a new\n * `<img>`; the old observation would then be on a detached element.\n */\n private watchResize(el: HTMLImageElement): void {\n if (typeof ResizeObserver === 'undefined') return;\n this.resizeObserver?.disconnect();\n // Re-read the same way `onImageLoad` does rather than take the entry's\n // `contentRect`, so the two measurements can't disagree about the box.\n const ro = new ResizeObserver(() => this.onResize(el));\n ro.observe(el);\n this.resizeObserver = ro;\n }\n\n /**\n * Rescale the crop by however much the image did, so the user keeps the region\n * they picked instead of having it re-centred: `cropRect()` — the source-pixel\n * value a consumer acts on — comes out the same across the resize.\n */\n private onResize(el: HTMLImageElement): void {\n const previous = this.display();\n // Nothing measured yet, or measured and then dropped by `resetGeometry` while a\n // new `src` loads. There is no crop to carry over, and the load will measure.\n if (previous.w === 0 || previous.h === 0) return;\n const rect = el.getBoundingClientRect();\n // A hidden image (a closed tab, `display: none`) reports zeros. Scaling by that\n // would collapse the crop and there would be nothing to scale back from, so hold\n // the last real box until it is shown again.\n if (rect.width === 0 || rect.height === 0) return;\n if (rect.width === previous.w && rect.height === previous.h) return;\n\n const sx = rect.width / previous.w;\n const sy = rect.height / previous.h;\n const c = this.cropDisplay();\n this.display.set({ w: rect.width, h: rect.height });\n this.cropDisplay.set({ x: c.x * sx, y: c.y * sy, w: c.w * sx, h: c.h * sy });\n }\n\n /** Compute a sensible initial crop — centered, respecting aspectRatio. */\n private initialCrop(display: { w: number; h: number }): RectPx {\n const ratio = this.aspectRatio();\n let w = display.w * 0.6;\n let h = display.h * 0.6;\n if (ratio && ratio > 0) {\n const candidate = w / ratio;\n if (candidate > h) w = h * ratio;\n else h = w / ratio;\n }\n return {\n x: (display.w - w) / 2,\n y: (display.h - h) / 2,\n w,\n h,\n };\n }\n\n // Drag handlers\n\n protected readonly handles: readonly WrCropHandle[] = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];\n\n protected onPointerDown(handle: WrCropHandle, event: PointerEvent): void {\n // Any pointerdown used to start a drag, so the right button moved the crop window and\n // a second finger could take over a drag already in progress.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n event.stopPropagation();\n this.active = handle;\n this.pointerId = event.pointerId;\n this.startPointer = { x: event.clientX, y: event.clientY };\n this.startRect = { ...this.cropDisplay() };\n this.captureTarget = event.currentTarget as HTMLElement;\n this.captureTarget.setPointerCapture(event.pointerId);\n this.overhang = handle === 'move' ? NO_SIDES : this.pastCrop(event);\n }\n\n /**\n * A resize ENDS when the pointer leaves the image, exactly as `pointerup` would end it:\n * the move that carried it out is applied — clamped to the image like any other — and\n * then the drag is over. Nothing after that resumes it or changes the crop, pointer\n * back over the image or not, until a new `pointerdown`. A move drag is not affected:\n * its size is fixed, so it simply rests against the edge.\n *\n * The move that leaves is applied rather than dropped because pointer moves are\n * SAMPLES. Dropped, a quick drag toward a corner would stop wherever its last sample\n * inside happened to fall — a single move from a handle to past the image would change\n * nothing at all — and even a slow one would stop a fraction of a pixel short of the\n * edge. A drag that leaves across one edge still ends there: heading for a corner at a\n * slant that crosses the bottom first, the crop's right edge stays where it was then.\n *\n * \"The image\" is the `<img>`'s own box — the bounds `applyMove` / `applyResize` clamp\n * the crop to — with its edges counting as inside, since the crop may reach them. The\n * box is re-measured on every move and compared with `clientX` / `clientY`: both are\n * viewport coordinates, so a scroll mid-drag cannot put them out of step. The moves\n * outside reach this handler at all only because the drag holds pointer capture.\n *\n * One allowance, fixed at `pointerdown`: the box is widened on each side by however far\n * past that side of the CROP the press landed — at most as far as the pressed handle\n * reaches past it. Half of an edge handle, and three quarters of a corner handle, lies\n * outside the crop, so a press there already has the pointer ahead of the edge it drags.\n * Measured without the allowance, that pointer would leave the image while the crop was\n * still short of the image's edge by the same distance, with nothing able to close the\n * gap; and a handle resting on the image's edge, pressed on its outer part, would begin\n * its drag already outside. A press on a handle's inner part widens nothing.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (!this.active || event.pointerId !== this.pointerId) return;\n const dx = event.clientX - this.startPointer.x;\n const dy = event.clientY - this.startPointer.y;\n if (this.active === 'move') {\n this.applyMove(dx, dy);\n return;\n }\n this.applyResize(this.active, dx, dy);\n if (!this.withinImage(event)) this.onPointerUp(event);\n }\n\n /**\n * Ends the drag — for `pointerup`, `pointercancel`, a capture lost to something else,\n * and a resize whose pointer left the image. Once per drag: the capture released here\n * fires `lostpointercapture` afterwards, and by then there is nothing left to end.\n *\n * Only for the pointer that started it. A second finger is refused a drag of its own at\n * `pointerdown`, but its moves and its lifting reach these handlers all the same, and\n * would otherwise drive or end the first finger's drag.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (!this.active || event.pointerId !== this.pointerId) return;\n const target = this.captureTarget;\n this.active = null;\n this.pointerId = null;\n this.captureTarget = null;\n this.overhang = NO_SIDES;\n // Asked first: a capture that is already gone has nothing to release, and releasing\n // one for a pointer that is no longer active throws.\n if (target?.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);\n void this.emitCropped();\n }\n\n /** How far past each side of the crop window the pointer is, in CSS pixels. */\n private pastCrop(event: PointerEvent): SidesPx {\n const box = this.imgEl().nativeElement.getBoundingClientRect();\n const c = this.startRect;\n return {\n left: Math.max(0, box.left + c.x - event.clientX),\n top: Math.max(0, box.top + c.y - event.clientY),\n right: Math.max(0, event.clientX - (box.left + c.x + c.w)),\n bottom: Math.max(0, event.clientY - (box.top + c.y + c.h)),\n };\n }\n\n /** Whether the pointer is on the image, edges and the press's `overhang` included. */\n private withinImage(event: PointerEvent): boolean {\n const box = this.imgEl().nativeElement.getBoundingClientRect();\n const o = this.overhang;\n return (\n event.clientX >= box.left - o.left &&\n event.clientX <= box.right + o.right &&\n event.clientY >= box.top - o.top &&\n event.clientY <= box.bottom + o.bottom\n );\n }\n\n // Keyboard\n\n /** Whether a key has moved the crop since the last `keyup`. */\n private keyboardDirty = false;\n\n /**\n * The component's only keyboard path. Arrow keys move the crop window; Alt\n * with an arrow key resizes it from the east / south edge; Shift makes either\n * one ten display pixels instead of one — the coarse modifier `wr-slider`,\n * `wr-knob` and `wr-splitter` all use, which is why Alt and not Shift carries\n * the mode switch here.\n *\n * Nothing mirrors under `dir=\"rtl\"`: the image is not flipped and the window\n * is placed with a physical `left`, so ArrowLeft moves the crop visually left\n * in both directions.\n *\n * Both branches go through `applyMove` / `applyResize`, so the `aspectRatio`\n * lock, the `minWidth` / `minHeight` floors and the canvas bounds hold for a\n * keystroke exactly as they do for a drag. Those two measure from `startRect`\n * rather than from the live rect, so it is re-seeded per keystroke — a 1px\n * delta against the rect from the first press would make a held arrow stall\n * after one pixel instead of accumulating.\n */\n protected onWindowKeydown(event: KeyboardEvent): void {\n const step = event.shiftKey ? KEY_STEP_COARSE : KEY_STEP;\n let dx = 0;\n let dy = 0;\n switch (event.key) {\n case 'ArrowLeft':\n dx = -step;\n break;\n case 'ArrowRight':\n dx = step;\n break;\n case 'ArrowUp':\n dy = -step;\n break;\n case 'ArrowDown':\n dy = step;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n this.startRect = { ...this.cropDisplay() };\n if (event.altKey) this.applyResize(dx !== 0 ? 'e' : 's', dx, dy);\n else this.applyMove(dx, dy);\n\n this.keyboardDirty = true;\n const c = this.cropRect();\n // Bare numbers on purpose — `resolvedKeyHelp` has already told the reader\n // what the four are, and a sentence here would be a translated string.\n this.announcement.set(`${c.x}, ${c.y}, ${c.width} × ${c.height}`);\n }\n\n /**\n * Emit once per gesture, not once per keystroke. A held arrow repeats its\n * keydown many times a second and each `emitCropped` renders a canvas and\n * encodes a Blob; `keyup` fires once when the run ends, which is the keyboard's\n * equivalent of the `pointerup` the drag path emits on.\n */\n protected onWindowKeyup(): void {\n if (!this.keyboardDirty) return;\n this.keyboardDirty = false;\n void this.emitCropped();\n }\n\n private applyMove(dx: number, dy: number): void {\n const display = this.display();\n const r = this.startRect;\n const next = {\n x: wrClamp(r.x + dx, 0, display.w - r.w),\n y: wrClamp(r.y + dy, 0, display.h - r.h),\n w: r.w,\n h: r.h,\n };\n this.cropDisplay.set(next);\n }\n\n private applyResize(handle: WrCropHandle, dx: number, dy: number): void {\n const min = { w: this.minWidth(), h: this.minHeight() };\n this.cropDisplay.set(resizeFrom(this.startRect, handle, dx, dy, this.display(), min, this.aspectRatio()));\n }\n\n // Public API\n\n /**\n * Render the current crop as a Blob. Rejects while `status()` is anything but\n * `'loaded'`, since there is no image to draw.\n */\n async toBlob(type: WrImageOutputType = this.outputType(), quality: number = this.outputQuality()): Promise<Blob> {\n const canvas = this.toCanvas();\n return new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n blob => {\n if (blob) resolve(blob);\n else reject(new Error('toBlob returned null'));\n },\n type,\n quality\n );\n });\n }\n\n /**\n * Render the current crop as a data URL. Throws while `status()` is anything but\n * `'loaded'`, since there is no image to draw.\n */\n toDataUrl(type: WrImageOutputType = this.outputType(), quality: number = this.outputQuality()): string {\n return this.toCanvas().toDataURL(type, quality);\n }\n\n /** Re-emit the crop without waiting for a drag (e.g. after a programmatic change). */\n async refresh(): Promise<void> {\n await this.emitCropped();\n }\n\n // Internals\n\n /**\n * The exported image's pixel size: the crop in source pixels, scaled down so its\n * longer side fits `maxOutputSize`. `Math.min(1, …)` is the never-upscale rule — a\n * crop already inside the cap keeps its own size, which is also the whole of the\n * uncapped path.\n */\n private outputSize(c: WrCropRect): { width: number; height: number } {\n const cap = this.maxOutputSize();\n const longest = Math.max(c.width, c.height);\n const scale = cap === null || longest === 0 ? 1 : Math.min(1, cap / longest);\n return {\n width: Math.max(1, Math.round(c.width * scale)),\n height: Math.max(1, Math.round(c.height * scale)),\n };\n }\n\n private toCanvas(): HTMLCanvasElement {\n // Without this, no image threw NG0951 from the required `imgEl` query, and a\n // `'failed'` one the canvas's own complaint about a broken image: two internals\n // messages for one plain fact.\n const status = this.status();\n if (status !== 'loaded') {\n throw new Error(`[NGWR] <wr-image-cropper>: there is no loaded image to export (status \"${status}\").`);\n }\n const img = this.imgEl().nativeElement;\n const c = this.cropRect();\n const canvas = document.createElement('canvas');\n const size = this.outputSize(c);\n canvas.width = size.width;\n canvas.height = size.height;\n // The SOURCE rect stays the whole crop and the destination is the canvas, so a\n // capped export is the same region drawn smaller rather than a smaller region.\n const ctx = canvas.getContext('2d');\n if (ctx) ctx.drawImage(img, c.x, c.y, c.width, c.height, 0, 0, canvas.width, canvas.height);\n return canvas;\n }\n\n private async emitCropped(): Promise<void> {\n if (this.status() !== 'loaded') return;\n try {\n const blob = await this.toBlob();\n this.cropped.emit(blob);\n } catch (error) {\n // An image IS loaded, so a failure here is the browser refusing to encode it,\n // and `(cropped)` not firing has to be visible to the developer. It used to be\n // swallowed, which is how a tainted cross-origin canvas went unnoticed.\n if (isDevMode()) {\n // eslint-disable-next-line no-console -- dev-mode diagnostics\n console.warn('[NGWR] <wr-image-cropper>: the crop could not be encoded, so (cropped) did not fire.', error);\n }\n }\n }\n}\n","@if (objectUrl(); as url) {\n <div class=\"wr-image-cropper__canvas\">\n <!--\n `crossorigin` is what lets a URL on another origin be exported at all: an image\n fetched without it taints the canvas `toCanvas` draws into, even when the server\n sends CORS headers, and every export then throws a SecurityError. It is static\n so it is in place before `src` starts the request.\n -->\n <img\n #img\n class=\"wr-image-cropper__image\"\n crossorigin=\"anonymous\"\n [src]=\"url\"\n alt=\"\"\n draggable=\"false\"\n (load)=\"onImageLoad()\"\n (error)=\"onImageError()\"\n />\n\n @if (display().w > 0) {\n <!-- Semi-transparent backdrop with a cut-out for the crop window. -->\n <div\n class=\"wr-image-cropper__backdrop\"\n [style.clip-path]=\"`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 ${cropDisplay().y}px, ${cropDisplay().x}px ${cropDisplay().y}px, ${cropDisplay().x}px ${cropDisplay().y + cropDisplay().h}px, ${cropDisplay().x + cropDisplay().w}px ${cropDisplay().y + cropDisplay().h}px, ${cropDisplay().x + cropDisplay().w}px ${cropDisplay().y}px, 0 ${cropDisplay().y}px)`\"\n ></div>\n\n <!--\n Crop window — drag to move, with eight resize handles, and the ONE\n keyboard control the component has (see `onWindowKeydown`). The eight\n handles stay pointer-only and `aria-hidden`: eight extra tab stops per\n cropper would be hostile. The keys resize from the east and south edges\n only, so a west or north drag comes out as a resize plus a move rather\n than as one gesture.\n\n `role=\"group\"` rather than no role at all, because `aria-label` is\n prohibited on a roleless `<div>` and this needs a name; and rather than\n `role=\"application\"`, which would switch the reader out of its own\n browse mode for the whole subtree — far more than one rectangle is worth.\n -->\n <div\n class=\"wr-image-cropper__window\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"resolvedWindowLabel()\"\n [attr.aria-describedby]=\"helpId\"\n [style.left.px]=\"cropDisplay().x\"\n [style.top.px]=\"cropDisplay().y\"\n [style.width.px]=\"cropDisplay().w\"\n [style.height.px]=\"cropDisplay().h\"\n (pointerdown)=\"onPointerDown('move', $event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (lostpointercapture)=\"onPointerUp($event)\"\n (keydown)=\"onWindowKeydown($event)\"\n (keyup)=\"onWindowKeyup()\"\n >\n @for (h of handles; track h) {\n <span\n aria-hidden=\"true\"\n [class]=\"`wr-image-cropper__handle wr-image-cropper__handle--${h}`\"\n (pointerdown)=\"onPointerDown(h, $event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (lostpointercapture)=\"onPointerUp($event)\"\n ></span>\n }\n </div>\n\n <p class=\"wr-image-cropper__sr-only\" [id]=\"helpId\">{{ resolvedKeyHelp() }}</p>\n\n <!--\n The crop rect in SOURCE pixels, announced after a keyboard change only —\n a pointer drag already gives sighted feedback and would flood the region,\n and the initial crop is not news. Deliberately bare numbers: a sentence\n here would be a translated string the catalog does not carry, and the\n reader has just been told what the four numbers mean by `helpId`.\n -->\n <p class=\"wr-image-cropper__sr-only\" role=\"status\">{{ announcement() }}</p>\n }\n </div>\n} @else {\n <div class=\"wr-image-cropper__empty\">{{ emptyText() }}</div>\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAS,oBAAoB,OAAc;CACzC,IAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI,OAAO;CAClE,MAAM,IAAI,qBAAqB,OAAO,GAAU;CAChD,OAAO,OAAO,SAAS,CAAC,KAAK,IAAI,IAAI,IAAI;AAC3C;AAOA,MAAM,cAAc,OAAsB,IAAI,CAAC,CAAC,WAAU;AAG1D,MAAM,WAAW;AACjB,MAAM,kBAAkB;AAsBxB,MAAM,WAAoB;CAAE,MAAM;CAAG,KAAK;CAAG,OAAO;CAAG,QAAQ;AAAC;AAwBhE,SAAS,WACP,GACA,QACA,IACA,IACA,QACA,KACA,OAAoB;CAEpB,MAAM,OAAO,OAAO,SAAS,GAAG;CAChC,MAAM,OAAO,OAAO,SAAS,GAAG;CAChC,MAAM,QAAQ,OAAO,SAAS,GAAG;CACjC,MAAM,QAAQ,OAAO,SAAS,GAAG;CACjC,MAAM,QAAQ,EAAE,IAAI,EAAE;CACtB,MAAM,SAAS,EAAE,IAAI,EAAE;CAEvB,IAAI,CAAC,SAAS,SAAS,GAAG;EACxB,IAAI,EAAE,GAAG,GAAG,GAAG,MAAM;EACrB,IAAI,MAAM,IAAI,QAAQ,EAAE,IAAI,IAAI,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC;EACrD,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A,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-image-cropper.mjs","names":[],"sources":["../../../projects/lib/image-cropper/image-cropper.ts","../../../projects/lib/image-cropper/image-cropper.html"],"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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n type ElementRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n output,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrClamp, wrFileNameForType, wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrCropHandle, WrCropRect, WrImageCropperStatus, WrImageLoadError, WrImageOutputType } from './types';\n\n/**\n * `[maxOutputSize]`'s transform. Anything that is not a positive, finite number —\n * `null`, an empty attribute, `0`, a typo — means \"no cap\" rather than a 1px export:\n * a bad config should cost resolution nobody asked to lose, not the whole image.\n */\nfunction coerceMaxOutputSize(value: unknown): number | null {\n if (value === null || value === undefined || value === '') return null;\n const n = coerceNumberProperty(value, Number.NaN);\n return Number.isFinite(n) && n > 0 ? n : null;\n}\n\n/**\n * Stands in for the consumer input `useI18nText` expects. None of this\n * component's three strings has a `*Label` input behind it — the catalog is the\n * override channel — so they share one empty override.\n */\nconst NO_OVERRIDE = signal<string | null>(null).asReadonly();\n\n/** Keyboard step in display pixels, and what Shift promotes it to. */\nconst KEY_STEP = 1;\nconst KEY_STEP_COARSE = 10;\n\ninterface RectPx {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\ninterface SizePx {\n w: number;\n h: number;\n}\n\n/** Distances, in CSS pixels, past each side of a box. */\ninterface SidesPx {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nconst NO_SIDES: SidesPx = { left: 0, top: 0, right: 0, bottom: 0 };\n\n/**\n * The rect a resize gesture produces: a pure function of the rect the gesture started\n * from and the TOTAL pointer offset, so the same pointer position always gives the same\n * rect however the pointer got there.\n *\n * The anchor never moves. It is the edge or corner opposite the handle — for `se` the\n * top-left corner, for `e` the west edge's line. The old version clamped `x`, `y`, `w`\n * and `h` one at a time after deriving the second axis, so once the derived axis ran\n * into the image edge the rect slid AWAY from its anchor and, past the far bound, off\n * the image entirely.\n *\n * With a ratio the size is the largest along that ratio which fits from the anchor —\n * the smaller of the width-limited and height-limited sizes — and no smaller than both\n * minimums allow. Where the image cannot fit the minimum from this anchor, the bound\n * wins: a crop past the edge of the image is worse than one under the minimum.\n *\n * An edge handle with a ratio also sizes the axis it does not drive, and that axis has\n * the image's WHOLE extent to grow into: the rect stays centred on its old midline where\n * it can and slides along that axis only as far as it must to stay on the image. Capping\n * the size at twice the distance from the midline to the nearer side instead would leave\n * a square crop resting against the top edge unable to widen at all.\n */\nfunction resizeFrom(\n r: RectPx,\n handle: WrCropHandle,\n dx: number,\n dy: number,\n bounds: SizePx,\n min: SizePx,\n ratio: number | null\n): RectPx {\n const east = handle.includes('e');\n const west = handle.includes('w');\n const south = handle.includes('s');\n const north = handle.includes('n');\n const right = r.x + r.w;\n const bottom = r.y + r.h;\n\n if (!ratio || ratio <= 0) {\n let { x, y, w, h } = r;\n if (east) w = wrClamp(r.w + dx, min.w, bounds.w - r.x);\n if (west) {\n w = wrClamp(r.w - dx, min.w, right);\n x = right - w;\n }\n if (south) h = wrClamp(r.h + dy, min.h, bounds.h - r.y);\n if (north) {\n h = wrClamp(r.h - dy, min.h, bottom);\n y = bottom - h;\n }\n return { x, y, w, h };\n }\n\n // Room from the anchor to the image edge on each axis the handle drives; the whole\n // image on an axis it does not.\n const roomW = east ? bounds.w - r.x : west ? right : bounds.w;\n const roomH = south ? bounds.h - r.y : north ? bottom : bounds.h;\n // Corners follow the horizontal delta, as they always have; `n` / `s` the vertical one.\n const wanted = east ? r.w + dx : west ? r.w - dx : (south ? r.h + dy : r.h - dy) * ratio;\n const w = wrClamp(wanted, Math.max(min.w, min.h * ratio), Math.min(roomW, roomH * ratio));\n const h = w / ratio;\n\n return {\n x: east ? r.x : west ? right - w : wrClamp(r.x + r.w / 2 - w / 2, 0, bounds.w - w),\n y: south ? r.y : north ? bottom - h : wrClamp(r.y + r.h / 2 - h / 2, 0, bounds.h - h),\n w,\n h,\n };\n}\n\n/**\n * Image crop UI. Pass `[src]` (URL, `File`, or `Blob`); the user drags\n * the crop window or any of its eight handles. Optionally lock the crop\n * to a fixed `[aspectRatio]`.\n *\n * The crop window is also the one tab stop: arrow keys move it, Alt with an\n * arrow key resizes it, and Shift makes either step ten pixels instead of one.\n *\n * `(cropped)` fires after each drag end — or each run of arrow keys — with a\n * freshly-rendered `Blob` of the cropped region. For one-off reads use\n * `toBlob()` / `toDataUrl()`.\n *\n * A source the browser cannot decode fires `(loadError)` once, sets `status()` to\n * `'failed'` and puts `wr-image-cropper--failed` on the host. The component renders\n * no message of its own for it — what went wrong and what to do next is the host's\n * to say.\n *\n * The image is requested with `crossorigin=\"anonymous\"`, because a canvas will not\n * export pixels from another origin otherwise. A URL on another origin therefore has\n * to be served with `Access-Control-Allow-Origin`; one that is not fails to load and\n * fires `(loadError)`, where it used to show and then refuse every export.\n *\n * @example\n * ```html\n * <wr-image-cropper\n * [src]=\"file\"\n * [aspectRatio]=\"1\"\n * (cropped)=\"onBlob($event)\"\n * (loadError)=\"onUnreadable($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/image-cropper\n */\n@Component({\n selector: 'wr-image-cropper',\n templateUrl: './image-cropper.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-image-cropper',\n '[class.wr-image-cropper--failed]': \"status() === 'failed'\",\n },\n})\nexport class WrImageCropper {\n /** Image source — URL string, `File`, or `Blob`. */\n readonly src = input<string | File | Blob | null>(null);\n\n /** Aspect ratio (width / height). `null` = free. @default null */\n readonly aspectRatio = input<number | null>(null);\n\n /** Minimum crop width in display pixels. @default 32 */\n readonly minWidth = input(32, { transform: (v: unknown): number => Math.max(8, coerceNumberProperty(v, 32)) });\n\n /** Minimum crop height in display pixels. @default 32 */\n readonly minHeight = input(32, { transform: (v: unknown): number => Math.max(8, coerceNumberProperty(v, 32)) });\n\n /** Default output type for `(cropped)`. @default 'image/png' */\n readonly outputType = input<WrImageOutputType>('image/png');\n\n /** JPEG / WebP quality for `(cropped)` in [0, 1]. @default 0.92 */\n readonly outputQuality = input(0.92);\n\n /**\n * Longest side of the exported image, in pixels — for `(cropped)`, `toBlob()` and\n * `toDataUrl()` alike. A crop larger than this is scaled down to fit, keeping its\n * aspect ratio; a smaller one is exported as it is, never upscaled. The crop itself\n * — `cropRect()`, in source pixels — is not affected. `null` (or anything that is\n * not a positive number) exports at the source image's own resolution.\n * @default null\n */\n readonly maxOutputSize = input<number | null>(null, { transform: coerceMaxOutputSize });\n\n /** Emits a Blob after each drag end. */\n readonly cropped = output<Blob>();\n\n /**\n * Fires once when the browser cannot decode the current `src` — a format it does\n * not support, a broken file, a URL that fails. Nothing is rendered for it; show\n * your own message. A new `src` clears the failure.\n */\n readonly loadError = output<WrImageLoadError>();\n\n protected readonly imgEl = viewChild.required<ElementRef<HTMLImageElement>>('img');\n\n /** Resolved object URL for `src` (so File / Blob render in `<img>`). */\n protected readonly emptyText = useI18nText(NO_OVERRIDE, 'imageCropper.empty', 'No image');\n\n /** Accessible name of the crop window — the component's only tab stop. */\n protected readonly resolvedWindowLabel = useI18nText(NO_OVERRIDE, 'imageCropper.window', 'Crop region');\n\n /** The key model, referenced by the window's `aria-describedby`. */\n protected readonly resolvedKeyHelp = useI18nText(\n NO_OVERRIDE,\n 'imageCropper.keyHelp',\n 'Arrow keys move the crop. Hold Alt with an arrow key to resize it, and Shift for larger steps. ' +\n 'The crop is announced as left, top, width and height in image pixels.'\n );\n\n /** Id linking the crop window to the help text. Random rather than counted:\n * the crop UI only exists after a real image load, so it never prerenders. */\n protected readonly helpId = wrRandomId('wr-image-cropper-help');\n\n /** Live-region text — written by the keyboard path only (see `onWindowKeydown`). */\n protected readonly announcement = signal<string>('');\n\n protected readonly objectUrl = signal<string | null>(null);\n\n /** Previous object URL we created — kept off-signal so the resolve\n * effect doesn't depend on its own writes (which would loop). */\n private previousObjectUrl: string | null = null;\n\n /** Natural (source) pixel dimensions. */\n protected readonly natural = signal<{ w: number; h: number }>({ w: 0, h: 0 });\n\n /** Display (rendered) pixel dimensions. */\n protected readonly display = signal<{ w: number; h: number }>({ w: 0, h: 0 });\n\n /** Crop rect in display coordinates. */\n protected readonly cropDisplay = signal<RectPx>({ x: 0, y: 0, w: 0, h: 0 });\n\n /** Watches the rendered image box — see `watchResize`. */\n private resizeObserver: ResizeObserver | null = null;\n\n /** Currently active drag handle. */\n private active: WrCropHandle | null = null;\n private startPointer: { x: number; y: number } = { x: 0, y: 0 };\n private startRect: RectPx = { x: 0, y: 0, w: 0, h: 0 };\n\n /** The element the live drag set pointer capture on, so the end releases that one. */\n private captureTarget: HTMLElement | null = null;\n\n /** The pointer the live drag belongs to. Every other pointer's events are ignored. */\n private pointerId: number | null = null;\n\n /** How far past each side of the crop the live resize was pressed — see `onPointerMove`. */\n private overhang: SidesPx = NO_SIDES;\n\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly statusState = signal<WrImageCropperStatus>('empty');\n\n /**\n * Where the source stands: `'empty'`, `'loading'`, `'loaded'` or `'failed'`. Reset\n * to `'loading'` (or `'empty'`) whenever `src` changes, so a failure never outlives\n * the source that caused it.\n */\n readonly status = this.statusState.asReadonly();\n\n /** Resolved crop rect in natural (source) pixel coordinates. */\n readonly cropRect = computed<WrCropRect>(() => {\n const display = this.display();\n const natural = this.natural();\n const c = this.cropDisplay();\n if (display.w === 0 || display.h === 0) return { x: 0, y: 0, width: 0, height: 0 };\n const sx = natural.w / display.w;\n const sy = natural.h / display.h;\n return {\n x: Math.round(c.x * sx),\n y: Math.round(c.y * sy),\n width: Math.round(c.w * sx),\n height: Math.round(c.h * sy),\n };\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('image-cropper');\n // Resolve the source into a usable URL the <img> can render.\n // We only read `src()` here — `previousObjectUrl` is a plain field, so\n // writing to `objectUrl` doesn't re-trigger this effect (and hang the\n // tab on file upload).\n effect(() => {\n const src = this.src();\n if (this.previousObjectUrl) {\n URL.revokeObjectURL(this.previousObjectUrl);\n this.previousObjectUrl = null;\n }\n // The crop is measured against the image that WAS showing, and `cropRect` is a\n // public signal a consumer can read at any moment. Left in place it kept\n // reporting a rect scaled to the previous image for the whole gap between a new\n // `src` and its load event — long enough to crop the wrong thing.\n this.resetGeometry();\n if (!src) {\n this.objectUrl.set(null);\n this.statusState.set('empty');\n return;\n }\n // A new source starts over: a failure belongs to the source that caused it, and\n // left in place it would mark a perfectly good next image as broken until the\n // browser answered for that one too.\n this.statusState.set('loading');\n if (typeof src === 'string') {\n this.objectUrl.set(src);\n } else {\n const url = URL.createObjectURL(src);\n this.previousObjectUrl = url;\n this.objectUrl.set(url);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.previousObjectUrl) URL.revokeObjectURL(this.previousObjectUrl);\n this.resizeObserver?.disconnect();\n });\n }\n\n // Image load\n\n /**\n * Back to \"nothing measured yet\", which is also what an absent `src` means.\n *\n * `display` is the field that gates everything downstream — the crop UI renders on\n * `display().w > 0` and `cropRect` returns zeros without it — so it is the only one\n * a test can observe. The other two are reset for coherence: the resize observer\n * below also writes `display`, and left alone they would resurrect a crop measured\n * against the previous image (which is why `onResize` refuses to run on a zeroed\n * `display` — see there).\n */\n private resetGeometry(): void {\n this.natural.set({ w: 0, h: 0 });\n this.display.set({ w: 0, h: 0 });\n this.cropDisplay.set({ x: 0, y: 0, w: 0, h: 0 });\n }\n\n protected onImageLoad(): void {\n const img = this.imgEl().nativeElement;\n const rect = img.getBoundingClientRect();\n const display = { w: rect.width, h: rect.height };\n // Some SVGs and odd images report zero natural dimensions — fall back\n // to the rendered size so the crop math stays well-defined.\n const natural = {\n w: img.naturalWidth || display.w,\n h: img.naturalHeight || display.h,\n };\n this.statusState.set('loaded');\n this.natural.set(natural);\n this.display.set(display);\n this.cropDisplay.set(this.initialCrop(display));\n this.watchResize(img);\n }\n\n /**\n * The `<img>` could not decode its source.\n *\n * Before this handler existed a failed decode left the component exactly as it\n * looks while loading — an image with no size, no crop window, nothing emitted —\n * so a host had no way to tell \"still decoding\" from \"never going to\", and a user\n * who picked a `.heic` the browser cannot read saw an empty box and no reason.\n *\n * Once per source: `status` is reset by a new `src` and by nothing else, so a\n * second `error` for the same source says nothing new and is not re-emitted.\n */\n protected onImageError(): void {\n const url = this.objectUrl();\n if (!url || this.statusState() === 'failed') return;\n this.statusState.set('failed');\n this.resetGeometry();\n\n const src = this.src();\n const isBlob = typeof src !== 'string' && src !== null;\n this.loadError.emit({\n url,\n name: typeof File !== 'undefined' && src instanceof File ? src.name : null,\n type: isBlob ? src.type : null,\n size: isBlob ? src.size : null,\n });\n }\n\n /**\n * Keep `display` on the box the image is actually rendered at.\n *\n * The stylesheet sizes the image responsively — `max-width: 100%`,\n * `max-height: 70dvh`, `height: auto` — so the single measurement taken in the\n * `(load)` handler stops being true as soon as the container or the viewport\n * changes. Everything the user sees and touches is in DISPLAY pixels: the crop\n * window's inline `left` / `top` / `width` / `height`, the backdrop cut-out, and\n * the bounds `applyMove` / `applyResize` clamp against. Measured once, a narrowed\n * window leaves the crop painted past the edge of the image and draggable off it.\n *\n * Re-observed per load rather than once, because a new `src` may mount a new\n * `<img>`; the old observation would then be on a detached element.\n */\n private watchResize(el: HTMLImageElement): void {\n if (typeof ResizeObserver === 'undefined') return;\n this.resizeObserver?.disconnect();\n // Re-read the same way `onImageLoad` does rather than take the entry's\n // `contentRect`, so the two measurements can't disagree about the box.\n const ro = new ResizeObserver(() => this.onResize(el));\n ro.observe(el);\n this.resizeObserver = ro;\n }\n\n /**\n * Rescale the crop by however much the image did, so the user keeps the region\n * they picked instead of having it re-centred: `cropRect()` — the source-pixel\n * value a consumer acts on — comes out the same across the resize.\n */\n private onResize(el: HTMLImageElement): void {\n const previous = this.display();\n // Nothing measured yet, or measured and then dropped by `resetGeometry` while a\n // new `src` loads. There is no crop to carry over, and the load will measure.\n if (previous.w === 0 || previous.h === 0) return;\n const rect = el.getBoundingClientRect();\n // A hidden image (a closed tab, `display: none`) reports zeros. Scaling by that\n // would collapse the crop and there would be nothing to scale back from, so hold\n // the last real box until it is shown again.\n if (rect.width === 0 || rect.height === 0) return;\n if (rect.width === previous.w && rect.height === previous.h) return;\n\n const sx = rect.width / previous.w;\n const sy = rect.height / previous.h;\n const c = this.cropDisplay();\n this.display.set({ w: rect.width, h: rect.height });\n this.cropDisplay.set({ x: c.x * sx, y: c.y * sy, w: c.w * sx, h: c.h * sy });\n }\n\n /** Compute a sensible initial crop — centered, respecting aspectRatio. */\n private initialCrop(display: { w: number; h: number }): RectPx {\n const ratio = this.aspectRatio();\n let w = display.w * 0.6;\n let h = display.h * 0.6;\n if (ratio && ratio > 0) {\n const candidate = w / ratio;\n if (candidate > h) w = h * ratio;\n else h = w / ratio;\n }\n return {\n x: (display.w - w) / 2,\n y: (display.h - h) / 2,\n w,\n h,\n };\n }\n\n // Drag handlers\n\n protected readonly handles: readonly WrCropHandle[] = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];\n\n protected onPointerDown(handle: WrCropHandle, event: PointerEvent): void {\n // Any pointerdown used to start a drag, so the right button moved the crop window and\n // a second finger could take over a drag already in progress.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n event.stopPropagation();\n this.active = handle;\n this.pointerId = event.pointerId;\n this.startPointer = { x: event.clientX, y: event.clientY };\n this.startRect = { ...this.cropDisplay() };\n this.captureTarget = event.currentTarget as HTMLElement;\n this.captureTarget.setPointerCapture(event.pointerId);\n this.overhang = handle === 'move' ? NO_SIDES : this.pastCrop(event);\n }\n\n /**\n * A resize ENDS when the pointer leaves the image, exactly as `pointerup` would end it:\n * the move that carried it out is applied — clamped to the image like any other — and\n * then the drag is over. Nothing after that resumes it or changes the crop, pointer\n * back over the image or not, until a new `pointerdown`. A move drag is not affected:\n * its size is fixed, so it simply rests against the edge.\n *\n * The move that leaves is applied rather than dropped because pointer moves are\n * SAMPLES. Dropped, a quick drag toward a corner would stop wherever its last sample\n * inside happened to fall — a single move from a handle to past the image would change\n * nothing at all — and even a slow one would stop a fraction of a pixel short of the\n * edge. A drag that leaves across one edge still ends there: heading for a corner at a\n * slant that crosses the bottom first, the crop's right edge stays where it was then.\n *\n * \"The image\" is the `<img>`'s own box — the bounds `applyMove` / `applyResize` clamp\n * the crop to — with its edges counting as inside, since the crop may reach them. The\n * box is re-measured on every move and compared with `clientX` / `clientY`: both are\n * viewport coordinates, so a scroll mid-drag cannot put them out of step. The moves\n * outside reach this handler at all only because the drag holds pointer capture.\n *\n * One allowance, fixed at `pointerdown`: the box is widened on each side by however far\n * past that side of the CROP the press landed — at most as far as the pressed handle\n * reaches past it. Half of an edge handle, and three quarters of a corner handle, lies\n * outside the crop, so a press there already has the pointer ahead of the edge it drags.\n * Measured without the allowance, that pointer would leave the image while the crop was\n * still short of the image's edge by the same distance, with nothing able to close the\n * gap; and a handle resting on the image's edge, pressed on its outer part, would begin\n * its drag already outside. A press on a handle's inner part widens nothing.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (!this.active || event.pointerId !== this.pointerId) return;\n const dx = event.clientX - this.startPointer.x;\n const dy = event.clientY - this.startPointer.y;\n if (this.active === 'move') {\n this.applyMove(dx, dy);\n return;\n }\n this.applyResize(this.active, dx, dy);\n if (!this.withinImage(event)) this.onPointerUp(event);\n }\n\n /**\n * Ends the drag — for `pointerup`, `pointercancel`, a capture lost to something else,\n * and a resize whose pointer left the image. Once per drag: the capture released here\n * fires `lostpointercapture` afterwards, and by then there is nothing left to end.\n *\n * Only for the pointer that started it. A second finger is refused a drag of its own at\n * `pointerdown`, but its moves and its lifting reach these handlers all the same, and\n * would otherwise drive or end the first finger's drag.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (!this.active || event.pointerId !== this.pointerId) return;\n const target = this.captureTarget;\n this.active = null;\n this.pointerId = null;\n this.captureTarget = null;\n this.overhang = NO_SIDES;\n // Asked first: a capture that is already gone has nothing to release, and releasing\n // one for a pointer that is no longer active throws.\n if (target?.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);\n void this.emitCropped();\n }\n\n /** How far past each side of the crop window the pointer is, in CSS pixels. */\n private pastCrop(event: PointerEvent): SidesPx {\n const box = this.imgEl().nativeElement.getBoundingClientRect();\n const c = this.startRect;\n return {\n left: Math.max(0, box.left + c.x - event.clientX),\n top: Math.max(0, box.top + c.y - event.clientY),\n right: Math.max(0, event.clientX - (box.left + c.x + c.w)),\n bottom: Math.max(0, event.clientY - (box.top + c.y + c.h)),\n };\n }\n\n /** Whether the pointer is on the image, edges and the press's `overhang` included. */\n private withinImage(event: PointerEvent): boolean {\n const box = this.imgEl().nativeElement.getBoundingClientRect();\n const o = this.overhang;\n return (\n event.clientX >= box.left - o.left &&\n event.clientX <= box.right + o.right &&\n event.clientY >= box.top - o.top &&\n event.clientY <= box.bottom + o.bottom\n );\n }\n\n // Keyboard\n\n /** Whether a key has moved the crop since the last `keyup`. */\n private keyboardDirty = false;\n\n /**\n * The component's only keyboard path. Arrow keys move the crop window; Alt\n * with an arrow key resizes it from the east / south edge; Shift makes either\n * one ten display pixels instead of one — the coarse modifier `wr-slider`,\n * `wr-knob` and `wr-splitter` all use, which is why Alt and not Shift carries\n * the mode switch here.\n *\n * Nothing mirrors under `dir=\"rtl\"`: the image is not flipped and the window\n * is placed with a physical `left`, so ArrowLeft moves the crop visually left\n * in both directions.\n *\n * Both branches go through `applyMove` / `applyResize`, so the `aspectRatio`\n * lock, the `minWidth` / `minHeight` floors and the canvas bounds hold for a\n * keystroke exactly as they do for a drag. Those two measure from `startRect`\n * rather than from the live rect, so it is re-seeded per keystroke — a 1px\n * delta against the rect from the first press would make a held arrow stall\n * after one pixel instead of accumulating.\n */\n protected onWindowKeydown(event: KeyboardEvent): void {\n const step = event.shiftKey ? KEY_STEP_COARSE : KEY_STEP;\n let dx = 0;\n let dy = 0;\n switch (event.key) {\n case 'ArrowLeft':\n dx = -step;\n break;\n case 'ArrowRight':\n dx = step;\n break;\n case 'ArrowUp':\n dy = -step;\n break;\n case 'ArrowDown':\n dy = step;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n this.startRect = { ...this.cropDisplay() };\n if (event.altKey) this.applyResize(dx !== 0 ? 'e' : 's', dx, dy);\n else this.applyMove(dx, dy);\n\n this.keyboardDirty = true;\n const c = this.cropRect();\n // Bare numbers on purpose — `resolvedKeyHelp` has already told the reader\n // what the four are, and a sentence here would be a translated string.\n this.announcement.set(`${c.x}, ${c.y}, ${c.width} × ${c.height}`);\n }\n\n /**\n * Emit once per gesture, not once per keystroke. A held arrow repeats its\n * keydown many times a second and each `emitCropped` renders a canvas and\n * encodes a Blob; `keyup` fires once when the run ends, which is the keyboard's\n * equivalent of the `pointerup` the drag path emits on.\n */\n protected onWindowKeyup(): void {\n if (!this.keyboardDirty) return;\n this.keyboardDirty = false;\n void this.emitCropped();\n }\n\n private applyMove(dx: number, dy: number): void {\n const display = this.display();\n const r = this.startRect;\n const next = {\n x: wrClamp(r.x + dx, 0, display.w - r.w),\n y: wrClamp(r.y + dy, 0, display.h - r.h),\n w: r.w,\n h: r.h,\n };\n this.cropDisplay.set(next);\n }\n\n private applyResize(handle: WrCropHandle, dx: number, dy: number): void {\n const min = { w: this.minWidth(), h: this.minHeight() };\n this.cropDisplay.set(resizeFrom(this.startRect, handle, dx, dy, this.display(), min, this.aspectRatio()));\n }\n\n // Public API\n\n /**\n * Render the current crop as a Blob. Rejects while `status()` is anything but\n * `'loaded'`, since there is no image to draw.\n */\n async toBlob(type: WrImageOutputType = this.outputType(), quality: number = this.outputQuality()): Promise<Blob> {\n const canvas = this.toCanvas();\n return new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n blob => {\n if (blob) resolve(blob);\n else reject(new Error('toBlob returned null'));\n },\n type,\n quality\n );\n });\n }\n\n /**\n * Render the current crop as a `File`. The extension of `name` is replaced by that of\n * the type the browser actually encoded, which can differ from `type`: a browser falls\n * back to PNG for a type it cannot encode. Rejects like `toBlob()`.\n */\n async toFile(\n name: string,\n type: WrImageOutputType = this.outputType(),\n quality: number = this.outputQuality()\n ): Promise<File> {\n const blob = await this.toBlob(type, quality);\n return new File([blob], wrFileNameForType(name, blob.type), { type: blob.type });\n }\n\n /**\n * Render the current crop as a data URL. Throws while `status()` is anything but\n * `'loaded'`, since there is no image to draw.\n */\n toDataUrl(type: WrImageOutputType = this.outputType(), quality: number = this.outputQuality()): string {\n return this.toCanvas().toDataURL(type, quality);\n }\n\n /** Re-emit the crop without waiting for a drag (e.g. after a programmatic change). */\n async refresh(): Promise<void> {\n await this.emitCropped();\n }\n\n // Internals\n\n /**\n * The exported image's pixel size: the crop in source pixels, scaled down so its\n * longer side fits `maxOutputSize`. `Math.min(1, …)` is the never-upscale rule — a\n * crop already inside the cap keeps its own size, which is also the whole of the\n * uncapped path.\n */\n private outputSize(c: WrCropRect): { width: number; height: number } {\n const cap = this.maxOutputSize();\n const longest = Math.max(c.width, c.height);\n const scale = cap === null || longest === 0 ? 1 : Math.min(1, cap / longest);\n return {\n width: Math.max(1, Math.round(c.width * scale)),\n height: Math.max(1, Math.round(c.height * scale)),\n };\n }\n\n private toCanvas(): HTMLCanvasElement {\n // Without this, no image threw NG0951 from the required `imgEl` query, and a\n // `'failed'` one the canvas's own complaint about a broken image: two internals\n // messages for one plain fact.\n const status = this.status();\n if (status !== 'loaded') {\n throw new Error(`[NGWR] <wr-image-cropper>: there is no loaded image to export (status \"${status}\").`);\n }\n const img = this.imgEl().nativeElement;\n const c = this.cropRect();\n const canvas = document.createElement('canvas');\n const size = this.outputSize(c);\n canvas.width = size.width;\n canvas.height = size.height;\n // The SOURCE rect stays the whole crop and the destination is the canvas, so a\n // capped export is the same region drawn smaller rather than a smaller region.\n const ctx = canvas.getContext('2d');\n if (ctx) ctx.drawImage(img, c.x, c.y, c.width, c.height, 0, 0, canvas.width, canvas.height);\n return canvas;\n }\n\n private async emitCropped(): Promise<void> {\n if (this.status() !== 'loaded') return;\n try {\n const blob = await this.toBlob();\n this.cropped.emit(blob);\n } catch (error) {\n // An image IS loaded, so a failure here is the browser refusing to encode it,\n // and `(cropped)` not firing has to be visible to the developer. It used to be\n // swallowed, which is how a tainted cross-origin canvas went unnoticed.\n if (isDevMode()) {\n // eslint-disable-next-line no-console -- dev-mode diagnostics\n console.warn('[NGWR] <wr-image-cropper>: the crop could not be encoded, so (cropped) did not fire.', error);\n }\n }\n }\n}\n","@if (objectUrl(); as url) {\n <div class=\"wr-image-cropper__canvas\">\n <!--\n `crossorigin` is what lets a URL on another origin be exported at all: an image\n fetched without it taints the canvas `toCanvas` draws into, even when the server\n sends CORS headers, and every export then throws a SecurityError. It is static\n so it is in place before `src` starts the request.\n -->\n <img\n #img\n class=\"wr-image-cropper__image\"\n crossorigin=\"anonymous\"\n [src]=\"url\"\n alt=\"\"\n draggable=\"false\"\n (load)=\"onImageLoad()\"\n (error)=\"onImageError()\"\n />\n\n @if (display().w > 0) {\n <!-- Semi-transparent backdrop with a cut-out for the crop window. -->\n <div\n class=\"wr-image-cropper__backdrop\"\n [style.clip-path]=\"`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 ${cropDisplay().y}px, ${cropDisplay().x}px ${cropDisplay().y}px, ${cropDisplay().x}px ${cropDisplay().y + cropDisplay().h}px, ${cropDisplay().x + cropDisplay().w}px ${cropDisplay().y + cropDisplay().h}px, ${cropDisplay().x + cropDisplay().w}px ${cropDisplay().y}px, 0 ${cropDisplay().y}px)`\"\n ></div>\n\n <!--\n Crop window — drag to move, with eight resize handles, and the ONE\n keyboard control the component has (see `onWindowKeydown`). The eight\n handles stay pointer-only and `aria-hidden`: eight extra tab stops per\n cropper would be hostile. The keys resize from the east and south edges\n only, so a west or north drag comes out as a resize plus a move rather\n than as one gesture.\n\n `role=\"group\"` rather than no role at all, because `aria-label` is\n prohibited on a roleless `<div>` and this needs a name; and rather than\n `role=\"application\"`, which would switch the reader out of its own\n browse mode for the whole subtree — far more than one rectangle is worth.\n -->\n <div\n class=\"wr-image-cropper__window\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"resolvedWindowLabel()\"\n [attr.aria-describedby]=\"helpId\"\n [style.left.px]=\"cropDisplay().x\"\n [style.top.px]=\"cropDisplay().y\"\n [style.width.px]=\"cropDisplay().w\"\n [style.height.px]=\"cropDisplay().h\"\n (pointerdown)=\"onPointerDown('move', $event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (lostpointercapture)=\"onPointerUp($event)\"\n (keydown)=\"onWindowKeydown($event)\"\n (keyup)=\"onWindowKeyup()\"\n >\n @for (h of handles; track h) {\n <span\n aria-hidden=\"true\"\n [class]=\"`wr-image-cropper__handle wr-image-cropper__handle--${h}`\"\n (pointerdown)=\"onPointerDown(h, $event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (lostpointercapture)=\"onPointerUp($event)\"\n ></span>\n }\n </div>\n\n <p class=\"wr-image-cropper__sr-only\" [id]=\"helpId\">{{ resolvedKeyHelp() }}</p>\n\n <!--\n The crop rect in SOURCE pixels, announced after a keyboard change only —\n a pointer drag already gives sighted feedback and would flood the region,\n and the initial crop is not news. Deliberately bare numbers: a sentence\n here would be a translated string the catalog does not carry, and the\n reader has just been told what the four numbers mean by `helpId`.\n -->\n <p class=\"wr-image-cropper__sr-only\" role=\"status\">{{ announcement() }}</p>\n }\n </div>\n} @else {\n <div class=\"wr-image-cropper__empty\">{{ emptyText() }}</div>\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAS,oBAAoB,OAAc;CACzC,IAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI,OAAO;CAClE,MAAM,IAAI,qBAAqB,OAAO,GAAU;CAChD,OAAO,OAAO,SAAS,CAAC,KAAK,IAAI,IAAI,IAAI;AAC3C;AAOA,MAAM,cAAc,OAAsB,IAAI,CAAC,CAAC,WAAU;AAG1D,MAAM,WAAW;AACjB,MAAM,kBAAkB;AAsBxB,MAAM,WAAoB;CAAE,MAAM;CAAG,KAAK;CAAG,OAAO;CAAG,QAAQ;AAAC;AAwBhE,SAAS,WACP,GACA,QACA,IACA,IACA,QACA,KACA,OAAoB;CAEpB,MAAM,OAAO,OAAO,SAAS,GAAG;CAChC,MAAM,OAAO,OAAO,SAAS,GAAG;CAChC,MAAM,QAAQ,OAAO,SAAS,GAAG;CACjC,MAAM,QAAQ,OAAO,SAAS,G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AAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -303,7 +303,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
303
303
|
}
|
|
304
304
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
305
305
|
minVersion: "12.0.0",
|
|
306
|
-
version: "22.
|
|
306
|
+
version: "22.3.0",
|
|
307
307
|
ngImport: i0,
|
|
308
308
|
type: WrInputNumber,
|
|
309
309
|
deps: [],
|
|
@@ -311,7 +311,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
311
311
|
});
|
|
312
312
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
313
313
|
minVersion: "17.0.0",
|
|
314
|
-
version: "22.
|
|
314
|
+
version: "22.3.0",
|
|
315
315
|
type: WrInputNumber,
|
|
316
316
|
isStandalone: true,
|
|
317
317
|
selector: "wr-input-number",
|
|
@@ -516,7 +516,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
516
516
|
};
|
|
517
517
|
i0.ɵɵngDeclareClassMetadata({
|
|
518
518
|
minVersion: "12.0.0",
|
|
519
|
-
version: "22.
|
|
519
|
+
version: "22.3.0",
|
|
520
520
|
ngImport: i0,
|
|
521
521
|
type: WrInputNumber,
|
|
522
522
|
decorators: [{
|
|
@@ -196,7 +196,7 @@ var WrInputOtp = class WrInputOtp {
|
|
|
196
196
|
}
|
|
197
197
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
198
198
|
minVersion: "12.0.0",
|
|
199
|
-
version: "22.
|
|
199
|
+
version: "22.3.0",
|
|
200
200
|
ngImport: i0,
|
|
201
201
|
type: WrInputOtp,
|
|
202
202
|
deps: [],
|
|
@@ -204,7 +204,7 @@ var WrInputOtp = class WrInputOtp {
|
|
|
204
204
|
});
|
|
205
205
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
206
206
|
minVersion: "17.0.0",
|
|
207
|
-
version: "22.
|
|
207
|
+
version: "22.3.0",
|
|
208
208
|
type: WrInputOtp,
|
|
209
209
|
isStandalone: true,
|
|
210
210
|
selector: "wr-input-otp",
|
|
@@ -307,7 +307,7 @@ var WrInputOtp = class WrInputOtp {
|
|
|
307
307
|
};
|
|
308
308
|
i0.ɵɵngDeclareClassMetadata({
|
|
309
309
|
minVersion: "12.0.0",
|
|
310
|
-
version: "22.
|
|
310
|
+
version: "22.3.0",
|
|
311
311
|
ngImport: i0,
|
|
312
312
|
type: WrInputOtp,
|
|
313
313
|
decorators: [{
|
package/fesm2022/ngwr-input.mjs
CHANGED
|
@@ -43,7 +43,7 @@ var WrInput = class WrInput {
|
|
|
43
43
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
44
44
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
45
45
|
minVersion: "12.0.0",
|
|
46
|
-
version: "22.
|
|
46
|
+
version: "22.3.0",
|
|
47
47
|
ngImport: i0,
|
|
48
48
|
type: WrInput,
|
|
49
49
|
deps: [],
|
|
@@ -51,7 +51,7 @@ var WrInput = class WrInput {
|
|
|
51
51
|
});
|
|
52
52
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
53
53
|
minVersion: "17.1.0",
|
|
54
|
-
version: "22.
|
|
54
|
+
version: "22.3.0",
|
|
55
55
|
type: WrInput,
|
|
56
56
|
isStandalone: true,
|
|
57
57
|
selector: "input[wrInput], textarea[wrInput]",
|
|
@@ -86,7 +86,7 @@ var WrInput = class WrInput {
|
|
|
86
86
|
};
|
|
87
87
|
i0.ɵɵngDeclareClassMetadata({
|
|
88
88
|
minVersion: "12.0.0",
|
|
89
|
-
version: "22.
|
|
89
|
+
version: "22.3.0",
|
|
90
90
|
ngImport: i0,
|
|
91
91
|
type: WrInput,
|
|
92
92
|
decorators: [{
|
|
@@ -135,7 +135,7 @@ var WrInputPrefix = class WrInputPrefix {
|
|
|
135
135
|
}
|
|
136
136
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
137
137
|
minVersion: "12.0.0",
|
|
138
|
-
version: "22.
|
|
138
|
+
version: "22.3.0",
|
|
139
139
|
ngImport: i0,
|
|
140
140
|
type: WrInputPrefix,
|
|
141
141
|
deps: [],
|
|
@@ -143,7 +143,7 @@ var WrInputPrefix = class WrInputPrefix {
|
|
|
143
143
|
});
|
|
144
144
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
145
145
|
minVersion: "14.0.0",
|
|
146
|
-
version: "22.
|
|
146
|
+
version: "22.3.0",
|
|
147
147
|
type: WrInputPrefix,
|
|
148
148
|
isStandalone: true,
|
|
149
149
|
selector: "[wrInputPrefix]",
|
|
@@ -153,7 +153,7 @@ var WrInputPrefix = class WrInputPrefix {
|
|
|
153
153
|
};
|
|
154
154
|
i0.ɵɵngDeclareClassMetadata({
|
|
155
155
|
minVersion: "12.0.0",
|
|
156
|
-
version: "22.
|
|
156
|
+
version: "22.3.0",
|
|
157
157
|
ngImport: i0,
|
|
158
158
|
type: WrInputPrefix,
|
|
159
159
|
decorators: [{
|
|
@@ -177,7 +177,7 @@ var WrInputSuffix = class WrInputSuffix {
|
|
|
177
177
|
}
|
|
178
178
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
179
179
|
minVersion: "12.0.0",
|
|
180
|
-
version: "22.
|
|
180
|
+
version: "22.3.0",
|
|
181
181
|
ngImport: i0,
|
|
182
182
|
type: WrInputSuffix,
|
|
183
183
|
deps: [],
|
|
@@ -185,7 +185,7 @@ var WrInputSuffix = class WrInputSuffix {
|
|
|
185
185
|
});
|
|
186
186
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
187
187
|
minVersion: "14.0.0",
|
|
188
|
-
version: "22.
|
|
188
|
+
version: "22.3.0",
|
|
189
189
|
type: WrInputSuffix,
|
|
190
190
|
isStandalone: true,
|
|
191
191
|
selector: "[wrInputSuffix]",
|
|
@@ -195,7 +195,7 @@ var WrInputSuffix = class WrInputSuffix {
|
|
|
195
195
|
};
|
|
196
196
|
i0.ɵɵngDeclareClassMetadata({
|
|
197
197
|
minVersion: "12.0.0",
|
|
198
|
-
version: "22.
|
|
198
|
+
version: "22.3.0",
|
|
199
199
|
ngImport: i0,
|
|
200
200
|
type: WrInputSuffix,
|
|
201
201
|
decorators: [{
|
|
@@ -266,7 +266,7 @@ var WrInputGroup = class WrInputGroup {
|
|
|
266
266
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
267
267
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
268
268
|
minVersion: "12.0.0",
|
|
269
|
-
version: "22.
|
|
269
|
+
version: "22.3.0",
|
|
270
270
|
ngImport: i0,
|
|
271
271
|
type: WrInputGroup,
|
|
272
272
|
deps: [],
|
|
@@ -274,7 +274,7 @@ var WrInputGroup = class WrInputGroup {
|
|
|
274
274
|
});
|
|
275
275
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
276
276
|
minVersion: "17.0.0",
|
|
277
|
-
version: "22.
|
|
277
|
+
version: "22.3.0",
|
|
278
278
|
type: WrInputGroup,
|
|
279
279
|
isStandalone: true,
|
|
280
280
|
selector: "wr-input-group",
|
|
@@ -335,7 +335,7 @@ var WrInputGroup = class WrInputGroup {
|
|
|
335
335
|
};
|
|
336
336
|
i0.ɵɵngDeclareClassMetadata({
|
|
337
337
|
minVersion: "12.0.0",
|
|
338
|
-
version: "22.
|
|
338
|
+
version: "22.3.0",
|
|
339
339
|
ngImport: i0,
|
|
340
340
|
type: WrInputGroup,
|
|
341
341
|
decorators: [{
|
|
@@ -424,7 +424,7 @@ var WrPasswordToggle = class WrPasswordToggle {
|
|
|
424
424
|
}
|
|
425
425
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
426
426
|
minVersion: "12.0.0",
|
|
427
|
-
version: "22.
|
|
427
|
+
version: "22.3.0",
|
|
428
428
|
ngImport: i0,
|
|
429
429
|
type: WrPasswordToggle,
|
|
430
430
|
deps: [],
|
|
@@ -432,7 +432,7 @@ var WrPasswordToggle = class WrPasswordToggle {
|
|
|
432
432
|
});
|
|
433
433
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
434
434
|
minVersion: "17.0.0",
|
|
435
|
-
version: "22.
|
|
435
|
+
version: "22.3.0",
|
|
436
436
|
type: WrPasswordToggle,
|
|
437
437
|
isStandalone: true,
|
|
438
438
|
selector: "wr-password-toggle",
|
|
@@ -466,7 +466,7 @@ var WrPasswordToggle = class WrPasswordToggle {
|
|
|
466
466
|
};
|
|
467
467
|
i0.ɵɵngDeclareClassMetadata({
|
|
468
468
|
minVersion: "12.0.0",
|
|
469
|
-
version: "22.
|
|
469
|
+
version: "22.3.0",
|
|
470
470
|
ngImport: i0,
|
|
471
471
|
type: WrPasswordToggle,
|
|
472
472
|
decorators: [{
|
|
@@ -52,7 +52,7 @@ var WrKbd = class WrKbd {
|
|
|
52
52
|
}
|
|
53
53
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
54
54
|
minVersion: "12.0.0",
|
|
55
|
-
version: "22.
|
|
55
|
+
version: "22.3.0",
|
|
56
56
|
ngImport: i0,
|
|
57
57
|
type: WrKbd,
|
|
58
58
|
deps: [],
|
|
@@ -60,7 +60,7 @@ var WrKbd = class WrKbd {
|
|
|
60
60
|
});
|
|
61
61
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
62
62
|
minVersion: "17.0.0",
|
|
63
|
-
version: "22.
|
|
63
|
+
version: "22.3.0",
|
|
64
64
|
type: WrKbd,
|
|
65
65
|
isStandalone: true,
|
|
66
66
|
selector: "wr-kbd",
|
|
@@ -92,7 +92,7 @@ var WrKbd = class WrKbd {
|
|
|
92
92
|
};
|
|
93
93
|
i0.ɵɵngDeclareClassMetadata({
|
|
94
94
|
minVersion: "12.0.0",
|
|
95
|
-
version: "22.
|
|
95
|
+
version: "22.3.0",
|
|
96
96
|
ngImport: i0,
|
|
97
97
|
type: WrKbd,
|
|
98
98
|
decorators: [{
|
package/fesm2022/ngwr-knob.mjs
CHANGED
|
@@ -176,7 +176,7 @@ var WrKnob = class WrKnob {
|
|
|
176
176
|
}
|
|
177
177
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
178
178
|
minVersion: "12.0.0",
|
|
179
|
-
version: "22.
|
|
179
|
+
version: "22.3.0",
|
|
180
180
|
ngImport: i0,
|
|
181
181
|
type: WrKnob,
|
|
182
182
|
deps: [],
|
|
@@ -184,7 +184,7 @@ var WrKnob = class WrKnob {
|
|
|
184
184
|
});
|
|
185
185
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
186
186
|
minVersion: "17.0.0",
|
|
187
|
-
version: "22.
|
|
187
|
+
version: "22.3.0",
|
|
188
188
|
type: WrKnob,
|
|
189
189
|
isStandalone: true,
|
|
190
190
|
selector: "wr-knob",
|
|
@@ -303,7 +303,7 @@ var WrKnob = class WrKnob {
|
|
|
303
303
|
};
|
|
304
304
|
i0.ɵɵngDeclareClassMetadata({
|
|
305
305
|
minVersion: "12.0.0",
|
|
306
|
-
version: "22.
|
|
306
|
+
version: "22.3.0",
|
|
307
307
|
ngImport: i0,
|
|
308
308
|
type: WrKnob,
|
|
309
309
|
decorators: [{
|