ngwr 16.8.0 → 16.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/descriptions/styles/_index.scss +91 -0
  2. package/fesm2022/ngwr-anchor.mjs +48 -10
  3. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  4. package/fesm2022/ngwr-carousel.mjs +3 -2
  5. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  6. package/fesm2022/ngwr-compare.mjs +4 -0
  7. package/fesm2022/ngwr-compare.mjs.map +1 -1
  8. package/fesm2022/ngwr-cookie.mjs +6 -3
  9. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  10. package/fesm2022/ngwr-date-stamp-testing.mjs +3 -0
  11. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
  12. package/fesm2022/ngwr-date-stamp.mjs +81 -4
  13. package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
  14. package/fesm2022/ngwr-date.mjs +16 -2
  15. package/fesm2022/ngwr-date.mjs.map +1 -1
  16. package/fesm2022/ngwr-density.mjs +4 -3
  17. package/fesm2022/ngwr-density.mjs.map +1 -1
  18. package/fesm2022/ngwr-descriptions.mjs +77 -20
  19. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  20. package/fesm2022/ngwr-directives.mjs +12 -0
  21. package/fesm2022/ngwr-directives.mjs.map +1 -1
  22. package/fesm2022/ngwr-editor.mjs +1 -0
  23. package/fesm2022/ngwr-editor.mjs.map +1 -1
  24. package/fesm2022/ngwr-file-upload.mjs +2 -3
  25. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  26. package/fesm2022/ngwr-form.mjs.map +1 -1
  27. package/fesm2022/ngwr-hotkey.mjs +10 -5
  28. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  29. package/fesm2022/ngwr-i18n-ar.mjs +9 -3
  30. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  31. package/fesm2022/ngwr-i18n-cs.mjs +9 -3
  32. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  33. package/fesm2022/ngwr-i18n-de.mjs +9 -3
  34. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  35. package/fesm2022/ngwr-i18n-en.mjs +9 -3
  36. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  37. package/fesm2022/ngwr-i18n-es.mjs +9 -3
  38. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  39. package/fesm2022/ngwr-i18n-fr.mjs +9 -3
  40. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  41. package/fesm2022/ngwr-i18n-he.mjs +9 -3
  42. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  43. package/fesm2022/ngwr-i18n-hi.mjs +9 -3
  44. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  45. package/fesm2022/ngwr-i18n-id.mjs +9 -3
  46. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  47. package/fesm2022/ngwr-i18n-it.mjs +9 -3
  48. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  49. package/fesm2022/ngwr-i18n-ja.mjs +9 -3
  50. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  51. package/fesm2022/ngwr-i18n-kk.mjs +9 -3
  52. package/fesm2022/ngwr-i18n-kk.mjs.map +1 -1
  53. package/fesm2022/ngwr-i18n-ko.mjs +9 -3
  54. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  55. package/fesm2022/ngwr-i18n-nl.mjs +9 -3
  56. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  57. package/fesm2022/ngwr-i18n-pl.mjs +9 -3
  58. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  59. package/fesm2022/ngwr-i18n-pt.mjs +9 -3
  60. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  61. package/fesm2022/ngwr-i18n-ru.mjs +9 -3
  62. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  63. package/fesm2022/ngwr-i18n-sv.mjs +9 -3
  64. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  65. package/fesm2022/ngwr-i18n-tr.mjs +9 -3
  66. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  67. package/fesm2022/ngwr-i18n-uk.mjs +9 -3
  68. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  69. package/fesm2022/ngwr-i18n-vi.mjs +9 -3
  70. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  71. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -3
  72. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  73. package/fesm2022/ngwr-i18n-zh.mjs +9 -3
  74. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n.mjs +7 -6
  76. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  77. package/fesm2022/ngwr-image-cropper-testing.mjs +33 -0
  78. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  79. package/fesm2022/ngwr-image-cropper.mjs +536 -30
  80. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  81. package/fesm2022/ngwr-knob.mjs +5 -0
  82. package/fesm2022/ngwr-knob.mjs.map +1 -1
  83. package/fesm2022/ngwr-mention.mjs +2 -0
  84. package/fesm2022/ngwr-mention.mjs.map +1 -1
  85. package/fesm2022/ngwr-meta.mjs +43 -8
  86. package/fesm2022/ngwr-meta.mjs.map +1 -1
  87. package/fesm2022/ngwr-pagination.mjs +1 -1
  88. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  89. package/fesm2022/ngwr-pipes.mjs +160 -8
  90. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  91. package/fesm2022/ngwr-qr.mjs +65 -7
  92. package/fesm2022/ngwr-qr.mjs.map +1 -1
  93. package/fesm2022/ngwr-schema-form.mjs +2 -2
  94. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  95. package/fesm2022/ngwr-scroll.mjs +1 -2
  96. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  97. package/fesm2022/ngwr-speed-dial.mjs +30 -1
  98. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  99. package/fesm2022/ngwr-statistic.mjs +1 -1
  100. package/fesm2022/ngwr-stepper-testing.mjs +7 -1
  101. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-stepper.mjs +55 -4
  103. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  104. package/fesm2022/ngwr-timeline.mjs +4 -0
  105. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  106. package/fesm2022/ngwr-toolbar.mjs +171 -16
  107. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  108. package/fesm2022/ngwr-transfer.mjs +3 -2
  109. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  110. package/fesm2022/ngwr-tree.mjs +1 -1
  111. package/fesm2022/ngwr-utils.mjs +46 -8
  112. package/fesm2022/ngwr-utils.mjs.map +1 -1
  113. package/fesm2022/ngwr-version.mjs +1 -1
  114. package/fesm2022/ngwr-version.mjs.map +1 -1
  115. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  116. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  117. package/i18n/ar.json +9 -3
  118. package/i18n/cs.json +9 -3
  119. package/i18n/de.json +9 -3
  120. package/i18n/en.json +9 -3
  121. package/i18n/es.json +9 -3
  122. package/i18n/fr.json +9 -3
  123. package/i18n/he.json +9 -3
  124. package/i18n/hi.json +9 -3
  125. package/i18n/id.json +9 -3
  126. package/i18n/it.json +9 -3
  127. package/i18n/ja.json +9 -3
  128. package/i18n/kk.json +9 -3
  129. package/i18n/ko.json +9 -3
  130. package/i18n/nl.json +9 -3
  131. package/i18n/pl.json +9 -3
  132. package/i18n/pt.json +9 -3
  133. package/i18n/ru.json +9 -3
  134. package/i18n/sv.json +9 -3
  135. package/i18n/tr.json +9 -3
  136. package/i18n/uk.json +9 -3
  137. package/i18n/vi.json +9 -3
  138. package/i18n/zh-TW.json +9 -3
  139. package/i18n/zh.json +9 -3
  140. package/image-cropper/styles/_index.scss +30 -1
  141. package/llms-full.txt +5 -5
  142. package/package.json +1 -1
  143. package/schematics/use/symbol-map.json +1 -0
  144. package/skills/ngwr/SKILL.md +2 -2
  145. package/stepper/styles/_index.scss +33 -0
  146. package/types/ngwr-anchor.d.ts +14 -1
  147. package/types/ngwr-date-stamp-testing.d.ts +2 -0
  148. package/types/ngwr-date-stamp.d.ts +41 -2
  149. package/types/ngwr-date.d.ts +3 -1
  150. package/types/ngwr-descriptions.d.ts +33 -5
  151. package/types/ngwr-directives.d.ts +1 -0
  152. package/types/ngwr-form.d.ts +4 -0
  153. package/types/ngwr-hotkey.d.ts +2 -0
  154. package/types/ngwr-image-cropper-testing.d.ts +33 -1
  155. package/types/ngwr-image-cropper.d.ts +214 -6
  156. package/types/ngwr-meta.d.ts +13 -1
  157. package/types/ngwr-pipes.d.ts +125 -1
  158. package/types/ngwr-qr.d.ts +17 -0
  159. package/types/ngwr-speed-dial.d.ts +10 -0
  160. package/types/ngwr-stepper-testing.d.ts +10 -0
  161. package/types/ngwr-stepper.d.ts +47 -1
  162. package/types/ngwr-toolbar.d.ts +27 -0
  163. package/types/ngwr-transfer.d.ts +2 -0
  164. package/types/ngwr-utils.d.ts +61 -2
  165. package/types/ngwr-version.d.ts +1 -1
@@ -2,7 +2,8 @@ import * as i0 from "@angular/core";
2
2
  /**
3
3
  * Read-only labeled key / value list. Project `<wr-description-item>`
4
4
  * children. `title` is optional. Default layout stacks vertically; set
5
- * `[inline]="true"` for label-left / value-right rows.
5
+ * `[inline]="true"` for label-left / value-right rows, and `columns` for a
6
+ * grid of several items per row.
6
7
  *
7
8
  * @example
8
9
  * ```html
@@ -24,12 +25,20 @@ export declare class WrDescriptions {
24
25
  /** Add visible borders around each row. @default false */
25
26
  readonly bordered: import("@angular/core").InputSignalWithTransform<boolean, any>;
26
27
  /**
27
- * Reflow `inline` rows back to a stacked layout when the box itself is
28
- * narrow (a container query on its own width, not the viewport — so it
29
- * adapts inside a narrow card or side panel). Makes the box fill its
30
- * container's width. @default false
28
+ * Reflow `inline` rows back to a stacked layout, and a `columns` grid back
29
+ * to one column, when the box itself is narrow (a container query on its
30
+ * own width, not the viewport — so it adapts inside a narrow card or side
31
+ * panel). Makes the box fill its container's width. @default false
31
32
  */
32
33
  readonly responsive: import("@angular/core").InputSignalWithTransform<boolean, any>;
34
+ /**
35
+ * How many items a row holds, as equal columns. An item takes more of them
36
+ * with its `span`.
37
+ *
38
+ * @default 1
39
+ */
40
+ readonly columns: import("@angular/core").InputSignalWithTransform<number, unknown>;
41
+ protected readonly grid: import("@angular/core").Signal<boolean>;
33
42
  protected readonly classes: import("@angular/core").Signal<string>;
34
43
  static ɵfac: i0.ɵɵFactoryDeclaration<WrDescriptions, never>;
35
44
  static ɵcmp: i0.ɵɵComponentDeclaration<WrDescriptions, "wr-descriptions", never, {
@@ -53,6 +62,11 @@ export declare class WrDescriptions {
53
62
  "required": false;
54
63
  "isSignal": true;
55
64
  };
65
+ "columns": {
66
+ "alias": "columns";
67
+ "required": false;
68
+ "isSignal": true;
69
+ };
56
70
  }, {}, never, ["*"], true, never>;
57
71
  }
58
72
  /**
@@ -60,12 +74,21 @@ export declare class WrDescriptions {
60
74
  * `label` input; the value is the projected content.
61
75
  */
62
76
  export declare class WrDescriptionItem {
77
+ private readonly list;
63
78
  constructor();
64
79
  /**
65
80
  * The term shown beside the projected value — "Email", "Created". Keep it a
66
81
  * noun: it is read as the name of the value, not as a sentence.
67
82
  */
68
83
  readonly label: import("@angular/core").InputSignal<string>;
84
+ /**
85
+ * Columns the item takes in a list with `columns`. A number above the
86
+ * list's `columns` takes the whole row.
87
+ *
88
+ * @default 1
89
+ */
90
+ readonly span: import("@angular/core").InputSignalWithTransform<number, unknown>;
91
+ protected readonly track: import("@angular/core").Signal<number | null>;
69
92
  static ɵfac: i0.ɵɵFactoryDeclaration<WrDescriptionItem, never>;
70
93
  static ɵcmp: i0.ɵɵComponentDeclaration<WrDescriptionItem, "wr-description-item", never, {
71
94
  "label": {
@@ -73,5 +96,10 @@ export declare class WrDescriptionItem {
73
96
  "required": false;
74
97
  "isSignal": true;
75
98
  };
99
+ "span": {
100
+ "alias": "span";
101
+ "required": false;
102
+ "isSignal": true;
103
+ };
76
104
  }, {}, never, ["*"], true, never>;
77
105
  }
@@ -53,6 +53,7 @@ export declare class WrAutosize {
53
53
  readonly maxRows: import("@angular/core").InputSignalWithTransform<number, unknown>;
54
54
  private readonly el;
55
55
  private readonly isBrowser;
56
+ private readonly destroyRef;
56
57
  private lastValue;
57
58
  constructor();
58
59
  /** @internal */
@@ -586,6 +586,10 @@ interface WrFieldSpec {
586
586
  readonly multiple?: boolean;
587
587
  /** For `file`: the native `accept` list, e.g. `'image/*,.pdf'`. */
588
588
  readonly accept?: string;
589
+ /** For `file`: the most bytes one file may have. A larger file is refused. Unset or `0` is no limit. */
590
+ readonly maxSize?: number;
591
+ /** For `file` with `multiple`: the most files the field holds. A file past it is refused. Unset or `0` is no limit. */
592
+ readonly maxFiles?: number;
589
593
  /**
590
594
  * For `array`: the value a new item starts as. It is what draws the Add
591
595
  * button, and an array with no `item` is a fixed list whose items can only be
@@ -12,6 +12,8 @@ import { WrKey } from "ngwr/utils";
12
12
  * Modifiers: `ctrl`, `alt`, `shift`, `meta`, `cmd` (alias for `meta`),
13
13
  * `mod` (auto: `cmd` on macOS, `ctrl` elsewhere). Last token is the key.
14
14
  *
15
+ * The plus key is a trailing `+` or `plus`: `'mod++'`, `'mod+plus'`.
16
+ *
15
17
  * Examples: `'ctrl+k'`, `'cmd+shift+p'`, `'escape'`, `'mod+/'`, `'ArrowDown'`.
16
18
  */
17
19
  type WrHotkeySpec = string;
@@ -1,5 +1,5 @@
1
1
  import { BaseHarnessFilters, ComponentHarness, HarnessPredicate, TestKey } from "@angular/cdk/testing";
2
- import { WrCropHandle } from "ngwr/image-cropper";
2
+ import { WrCropHandle, WrImageRotation } from "ngwr/image-cropper";
3
3
  /** Narrows which `<wr-image-cropper>` a harness query matches. */
4
4
  interface WrImageCropperHarnessFilters extends BaseHarnessFilters {
5
5
  /**
@@ -52,6 +52,11 @@ interface WrCropWindowBox {
52
52
  * Object.defineProperty(img, 'naturalHeight', { value: 800 });
53
53
  * ```
54
54
  *
55
+ * Zoom and rotation are keys on the crop window too, so {@link zoomIn},
56
+ * {@link zoomOut} and {@link rotate} are real, and {@link getZoom} and
57
+ * {@link getRotation} read the transform the component writes on the picture. The
58
+ * wheel, the pinch and the pan are pointer geometry, and are not here.
59
+ *
55
60
  * **There is nothing to click.** The cropper renders no buttons: the result
56
61
  * arrives on the `(cropped)` output, which emits a `Blob` after each drag end or
57
62
  * each run of arrow keys, and a consumer who wants a one-off read calls `toBlob()` /
@@ -159,6 +164,28 @@ export declare class WrImageCropperHarness extends ComponentHarness {
159
164
  alt?: boolean;
160
165
  shift?: boolean;
161
166
  }): Promise<void>;
167
+ /**
168
+ * How far the image is zoomed, `1` to `4`.
169
+ *
170
+ * Read off the transform the component writes on the picture, like
171
+ * {@link getCropBox} off the window's inline pixels: the `zoom` model itself is
172
+ * component API, outside what a harness reaches.
173
+ */
174
+ getZoom(): Promise<number>;
175
+ /** How far the image is turned, in degrees clockwise. Read like {@link getZoom}. */
176
+ getRotation(): Promise<WrImageRotation>;
177
+ /** Press `+` on the crop window: one zoom step in, around the middle of the window. */
178
+ zoomIn(): Promise<void>;
179
+ /** Press `-` on the crop window: one zoom step out. */
180
+ zoomOut(): Promise<void>;
181
+ /**
182
+ * Press `R` on the crop window, or Shift with `R` for `'ccw'`: a quarter turn.
183
+ *
184
+ * A turned image has no measured box in a unit test, so the stage becomes the
185
+ * box it had, swapped and scaled to fit inside itself. {@link getCropBox} is in
186
+ * that stage's pixels.
187
+ */
188
+ rotate(direction?: 'cw' | 'ccw'): Promise<void>;
162
189
  /** The crop window's accessible name. Comes from the catalog. */
163
190
  getCropWindowLabel(): Promise<string | null>;
164
191
  /**
@@ -172,6 +199,11 @@ export declare class WrImageCropperHarness extends ComponentHarness {
172
199
  * would still pass that one.
173
200
  */
174
201
  getAnnouncement(): Promise<string>;
202
+ /**
203
+ * The picture's zoom and rotation, from its `transform`. jsdom answers with the
204
+ * list the component wrote; a browser answers with the matrix it resolved to.
205
+ */
206
+ private viewTransform;
175
207
  private requireReady;
176
208
  }
177
209
  export type { WrCropArrow, WrCropWindowBox, WrImageCropperHarnessFilters };
@@ -15,6 +15,8 @@ interface WrCropRect {
15
15
  }
16
16
  /** Possible drag handles on the crop overlay. */
17
17
  type WrCropHandle = 'move' | 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
18
+ /** How far the image is turned, in degrees clockwise: quarter turns only. */
19
+ type WrImageRotation = 0 | 90 | 180 | 270;
18
20
  /** Supported output MIME types for {@link WrImageCropper.toBlob}. */
19
21
  type WrImageOutputType = 'image/png' | 'image/jpeg' | 'image/webp';
20
22
  /**
@@ -70,6 +72,12 @@ interface RectPx {
70
72
  * The crop window is also the one tab stop: arrow keys move it, Alt with an
71
73
  * arrow key resizes it, and Shift makes either step ten pixels instead of one.
72
74
  *
75
+ * `[(zoom)]` enlarges the image under the crop window and `[(rotation)]` (or `rotate()`)
76
+ * turns it by quarter turns. The wheel zooms around the pointer, two fingers pinch, and
77
+ * `+`, `-` and `R` do the same from the keyboard. A zoomed image is panned by dragging
78
+ * outside the crop window, or by pushing the window against an edge with the arrow keys.
79
+ * There is no toolbar: build one from `zoom`, `rotation` and `rotate()`.
80
+ *
73
81
  * `(cropped)` fires after each drag end — or each run of arrow keys — with a
74
82
  * freshly-rendered `Blob` of the cropped region. For one-off reads use
75
83
  * `toBlob()` / `toDataUrl()`.
@@ -118,7 +126,21 @@ export declare class WrImageCropper {
118
126
  * @default null
119
127
  */
120
128
  readonly maxOutputSize: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
121
- /** Emits a Blob after each drag end. */
129
+ /**
130
+ * How much the image is enlarged under the crop window, from `1` (the whole image
131
+ * fitted to the stage) to `4`. The window keeps its place and covers less of the
132
+ * source. A value outside the range is read as the nearest end.
133
+ * @default 1
134
+ */
135
+ readonly zoom: import("@angular/core").ModelSignal<number>;
136
+ /**
137
+ * Clockwise quarter turns of the image, in degrees. At `90` and `270` the stage takes
138
+ * the turned image's shape. The crop window turns with the image and is then refitted
139
+ * to `aspectRatio`. The export is the turned image.
140
+ * @default 0
141
+ */
142
+ readonly rotation: import("@angular/core").ModelSignal<WrImageRotation>;
143
+ /** Emits a Blob after each drag end, and after `zoom` or `rotation` settles. */
122
144
  readonly cropped: import("@angular/core").OutputEmitterRef<Blob>;
123
145
  /**
124
146
  * Fires once when the browser cannot decode the current `src` — a format it does
@@ -127,12 +149,25 @@ export declare class WrImageCropper {
127
149
  */
128
150
  readonly loadError: import("@angular/core").OutputEmitterRef<WrImageLoadError>;
129
151
  protected readonly imgEl: import("@angular/core").Signal<ElementRef<HTMLImageElement>>;
152
+ /**
153
+ * A blank `<canvas>` with the source's dimensions, swapped while the image is turned.
154
+ * Once the image has been measured it holds the stage open in the image's place, so the
155
+ * stylesheet fits it to the container exactly as it fitted the image, and the image is
156
+ * free to be zoomed, panned and turned over it. A canvas because it has a natural size
157
+ * the moment it is rendered: nothing to fetch, to wait for, or for a content security
158
+ * policy to refuse. Never drawn on, so it holds no pixels.
159
+ */
160
+ private readonly sizerEl;
130
161
  /** Resolved object URL for `src` (so File / Blob render in `<img>`). */
131
162
  protected readonly emptyText: import("@angular/core").Signal<string>;
132
163
  /** Accessible name of the crop window — the component's only tab stop. */
133
164
  protected readonly resolvedWindowLabel: import("@angular/core").Signal<string>;
134
165
  /** The key model, referenced by the window's `aria-describedby`. */
135
166
  protected readonly resolvedKeyHelp: import("@angular/core").Signal<string>;
167
+ /** The second half of the key model: the zoom and rotation keys. */
168
+ protected readonly resolvedTransformHelp: import("@angular/core").Signal<string>;
169
+ private readonly zoomedText;
170
+ private readonly rotatedText;
136
171
  /** Id linking the crop window to the help text. Random rather than counted:
137
172
  * the crop UI only exists after a real image load, so it never prerenders. */
138
173
  protected readonly helpId: string;
@@ -147,19 +182,74 @@ export declare class WrImageCropper {
147
182
  w: number;
148
183
  h: number;
149
184
  }>;
150
- /** Display (rendered) pixel dimensions. */
185
+ /**
186
+ * The stage: the box the image fills at zoom 1, turned as `rotation` says, in display
187
+ * pixels. The crop is clamped to it, and a zoomed image always covers it.
188
+ */
151
189
  protected readonly display: import("@angular/core").WritableSignal<{
152
190
  w: number;
153
191
  h: number;
154
192
  }>;
155
- /** Crop rect in display coordinates. */
193
+ /** Crop rect in display coordinates, measured from the stage's top-left corner. */
156
194
  protected readonly cropDisplay: import("@angular/core").WritableSignal<RectPx>;
195
+ /** `zoom` as the component uses it: a finite number in [1, 4]. */
196
+ protected readonly zoomLevel: import("@angular/core").Signal<number>;
197
+ /** `rotation` as it was asked for: one of the four quarter turns. */
198
+ private readonly angle;
199
+ /**
200
+ * The rotation the geometry is laid out for. It follows `angle` through `turnTo`, which
201
+ * moves the stage, the crop and the pan with it in one step, so everything that reads
202
+ * the geometry reads this: a crop laid out for one rotation is never paired with another.
203
+ */
204
+ private readonly laidAngle;
205
+ /** Whether the image lies on its side, so its width runs down the stage. */
206
+ protected readonly turned: import("@angular/core").Signal<boolean>;
207
+ /** The point of the turned image under the middle of the stage: see `panFor`. */
208
+ private readonly center;
209
+ private readonly pan;
210
+ /** Whether the image has a measured stage, and so has left the layout to the sizer. */
211
+ protected readonly measured: import("@angular/core").Signal<boolean>;
212
+ /** Whether the turned sizer measured nothing, as in a test or a hidden container. */
213
+ private readonly unmeasured;
214
+ /**
215
+ * The stage's size written by hand, for a turned image whose sizer has no box to take
216
+ * it from. Only then: written while the sizer can be measured, it would cap the very
217
+ * box being measured.
218
+ */
219
+ protected readonly stageBox: import("@angular/core").Signal<{
220
+ w: number;
221
+ h: number;
222
+ } | null>;
223
+ /**
224
+ * How the `<img>` is laid over the stage once it is measured: its own size at zoom 1,
225
+ * and the transform that zooms, pans and turns it. The one decoded image is both what
226
+ * the user sees and what `toCanvas` draws, so the two cannot differ.
227
+ */
228
+ protected readonly view: import("@angular/core").Signal<{
229
+ w: number;
230
+ h: number;
231
+ transform: string;
232
+ } | null>;
157
233
  /** Watches the rendered image box — see `watchResize`. */
158
234
  private resizeObserver;
159
- /** Currently active drag handle. */
235
+ /** Currently active drag: a handle, the window, or the image itself. */
160
236
  private active;
161
237
  private startPointer;
238
+ /** Where the live drag's pointer was last seen: what a drag is rebased to in `onResize`. */
239
+ private lastPointer;
162
240
  private startRect;
241
+ /** Where the image sat when a pan drag began. */
242
+ private startPan;
243
+ /** Every pointer that is down on the stage, by id: two of them make a pinch. */
244
+ private readonly pointers;
245
+ /**
246
+ * The live pinch: the two pointers it belongs to, the distance between them and the
247
+ * zoom when it began.
248
+ */
249
+ private pinch;
250
+ private emitTimer;
251
+ /** Counts `(cropped)` renders, so one overtaken by a newer one is dropped: see `emitCropped`. */
252
+ private emitRun;
163
253
  /** The element the live drag set pointer capture on, so the end releases that one. */
164
254
  private captureTarget;
165
255
  /** The pointer the live drag belongs to. Every other pointer's events are ignored. */
@@ -167,6 +257,7 @@ export declare class WrImageCropper {
167
257
  /** How far past each side of the crop the live resize was pressed — see `onPointerMove`. */
168
258
  private overhang;
169
259
  private readonly destroyRef;
260
+ private readonly injector;
170
261
  private readonly statusState;
171
262
  /**
172
263
  * Where the source stands: `'empty'`, `'loading'`, `'loaded'` or `'failed'`. Reset
@@ -174,8 +265,22 @@ export declare class WrImageCropper {
174
265
  * the source that caused it.
175
266
  */
176
267
  readonly status: import("@angular/core").Signal<WrImageCropperStatus>;
177
- /** Resolved crop rect in natural (source) pixel coordinates. */
268
+ /**
269
+ * Resolved crop rect in natural (source) pixel coordinates: the region of the source
270
+ * as it is stored, before `rotation()` turns it. At `90` and `270` its width is
271
+ * therefore the crop window's height.
272
+ *
273
+ * The window's EDGES are carried back to the source and rounded there, and the size is
274
+ * what lies between them. Rounding an origin and a size separately can add up to a
275
+ * pixel past the image, and rounding in turned coordinates can shift the region by one
276
+ * on the way back.
277
+ */
178
278
  readonly cropRect: import("@angular/core").Signal<WrCropRect>;
279
+ /**
280
+ * The same region in the pixels of the image as the user sees it, turned: what the
281
+ * export's size and the announcement are made from.
282
+ */
283
+ private readonly turnedRect;
179
284
  constructor();
180
285
  /**
181
286
  * Back to "nothing measured yet", which is also what an absent `src` means.
@@ -222,6 +327,30 @@ export declare class WrImageCropper {
222
327
  * value a consumer acts on — comes out the same across the resize.
223
328
  */
224
329
  private onResize;
330
+ /**
331
+ * Measure the stage once the template has put the right element in the layout, and
332
+ * watch the sizer from then on: it is rendered only after the image has loaded.
333
+ */
334
+ private measureAfterRender;
335
+ /**
336
+ * The stage for a turned image before anything has measured one: the box swapped and
337
+ * scaled to fit inside the box it had. Whatever let that box be as wide and as tall as
338
+ * it is lets this one be too, so it never overflows; the sizer then finds the room the
339
+ * turned shape really has.
340
+ */
341
+ private turnedGuess;
342
+ /**
343
+ * Lay the geometry out for a new `rotation`. The crop and the visible part of the image
344
+ * are carried as fractions of the image and turned with it, a quarter turn at a time, so
345
+ * the window stays over the pixels it was over. A locked `aspectRatio` is turned on its
346
+ * side by that, and `refit` restores it the way it does when the ratio itself changes.
347
+ *
348
+ * Answers whether it turned anything. Called by the effect that follows `rotation`, and
349
+ * by `rotate()` at once, so a read straight after it sees the turned geometry.
350
+ */
351
+ private turnTo;
352
+ /** Shrink the crop window to `ratio`, around its centre. Answers whether it had to. */
353
+ private refit;
225
354
  /** Compute a sensible initial crop — centered, respecting aspectRatio. */
226
355
  private initialCrop;
227
356
  protected readonly handles: readonly WrCropHandle[];
@@ -266,6 +395,61 @@ export declare class WrImageCropper {
266
395
  * would otherwise drive or end the first finger's drag.
267
396
  */
268
397
  protected onPointerUp(event: PointerEvent): void;
398
+ /** Clears the live drag and lets go of its pointer capture. */
399
+ private endDrag;
400
+ /**
401
+ * Remember a pointer that went down on the stage. A primary pointer is the first one of
402
+ * its type down by definition, so whatever of that type is still listed was never seen
403
+ * lifting (it left the stage first) and is dropped rather than left to pair up into a
404
+ * pinch. Only of that type: a mouse is primary too, and pressing it must not end a pinch
405
+ * two fingers are still holding.
406
+ */
407
+ private track;
408
+ /**
409
+ * A press that the crop window did not take: one on the dimmed image around it, or a
410
+ * second finger anywhere, which the window refuses and lets bubble here.
411
+ *
412
+ * The dimmed image is where a pan starts, which is what keeps the window's own drag and
413
+ * its handles as they were. A second finger turns whatever the first was doing into a
414
+ * pinch. The first finger's drag is dropped without letting go of its pointer capture:
415
+ * the capture is what keeps its moves arriving once it slides off the stage.
416
+ */
417
+ protected onStagePointerDown(event: PointerEvent): void;
418
+ /** Every pointer's moves bubble here, the crop window's included; only a pan or a pinch acts on them. */
419
+ protected onStagePointerMove(event: PointerEvent): void;
420
+ protected onStagePointerUp(event: PointerEvent): void;
421
+ /**
422
+ * The wheel zooms around the pointer. The listener is on the stage, so a wheel anywhere
423
+ * else scrolls the page as usual, and so does one here once the zoom is at the end the
424
+ * wheel is pushing towards: the default is prevented only when the zoom moved.
425
+ */
426
+ protected onWheel(event: WheelEvent): void;
427
+ /**
428
+ * The stage's top-left corner in the viewport: the sizer's, which holds the stage open.
429
+ * A unit test has no layout and gives the image a box instead, so a sizer with no box
430
+ * hands the question to the image.
431
+ */
432
+ private stageOrigin;
433
+ /** A viewport point in stage coordinates. */
434
+ private onStage;
435
+ /**
436
+ * Set `zoom`, keeping the image point under `at` where it is. Answers whether it changed.
437
+ *
438
+ * The pan goes first. `zoom` is a model and emits inside `set()`, so a listener that
439
+ * reads the crop there must find the pan that belongs to the zoom it was just told.
440
+ */
441
+ private zoomAt;
442
+ /**
443
+ * Move the image's top-left corner to `(x, y)` on the stage, as near as the stage
444
+ * allows at `zoom`: the current one, or the one about to be set.
445
+ */
446
+ private setPan;
447
+ /** Drop whatever the pointers were doing: a turn re-lays everything they measure from. */
448
+ private endGesture;
449
+ /** Render `(cropped)` once `zoom` and `rotation` have stopped changing. */
450
+ private scheduleEmit;
451
+ /** The stage's box in the viewport: its corner, and its own size. */
452
+ private stageRect;
269
453
  /** How far past each side of the crop window the pointer is, in CSS pixels. */
270
454
  private pastCrop;
271
455
  /** Whether the pointer is on the image, edges and the press's `overhang` included. */
@@ -291,6 +475,13 @@ export declare class WrImageCropper {
291
475
  * after one pixel instead of accumulating.
292
476
  */
293
477
  protected onWindowKeydown(event: KeyboardEvent): void;
478
+ /**
479
+ * The keys that are not arrows: `+` (or `=`, the same key unshifted) and `-` zoom
480
+ * around the middle of the crop window, `R` turns the image clockwise and Shift with
481
+ * `R` the other way. Nothing with Ctrl, Meta or Alt held, which are the browser's own
482
+ * zoom and reload. `(cropped)` follows from the models changing, not from `keyup`.
483
+ */
484
+ private onTransformKey;
294
485
  /**
295
486
  * Emit once per gesture, not once per keystroke. A held arrow repeats its
296
487
  * keydown many times a second and each `emitCropped` renders a canvas and
@@ -316,6 +507,11 @@ export declare class WrImageCropper {
316
507
  * `'loaded'`, since there is no image to draw.
317
508
  */
318
509
  toDataUrl(type?: WrImageOutputType, quality?: number): string;
510
+ /**
511
+ * Turn the image a quarter turn: clockwise, or counter-clockwise with `'ccw'`. The same
512
+ * as writing the next value to `rotation`.
513
+ */
514
+ rotate(direction?: 'cw' | 'ccw'): void;
319
515
  /** Re-emit the crop without waiting for a drag (e.g. after a programmatic change). */
320
516
  refresh(): Promise<void>;
321
517
  /**
@@ -364,9 +560,21 @@ export declare class WrImageCropper {
364
560
  "required": false;
365
561
  "isSignal": true;
366
562
  };
563
+ "zoom": {
564
+ "alias": "zoom";
565
+ "required": false;
566
+ "isSignal": true;
567
+ };
568
+ "rotation": {
569
+ "alias": "rotation";
570
+ "required": false;
571
+ "isSignal": true;
572
+ };
367
573
  }, {
574
+ "zoom": "zoomChange";
575
+ "rotation": "rotationChange";
368
576
  "cropped": "cropped";
369
577
  "loadError": "loadError";
370
578
  }, never, never, true, never>;
371
579
  }
372
- export type { WrCropHandle, WrCropRect, WrImageCropperStatus, WrImageLoadError, WrImageOutputType };
580
+ export type { WrCropHandle, WrCropRect, WrImageCropperStatus, WrImageLoadError, WrImageOutputType, WrImageRotation };
@@ -67,7 +67,9 @@ interface WrMetaHandle {
67
67
  * The title and the canonical link are diffed against the last applied
68
68
  * snapshot and only rewritten when they actually change; the `<meta>` tags
69
69
  * are re-resolved by selector on every apply, so an existing tag is updated
70
- * in place rather than duplicated.
70
+ * in place rather than duplicated. A tag the document carried (index.html,
71
+ * server markup) is never removed unless this service wrote it, and goes back
72
+ * to its original content when the service stops setting it.
71
73
  *
72
74
  * @example
73
75
  * ```ts
@@ -111,6 +113,8 @@ export declare class WrMeta {
111
113
  * only if the document still reads `written`.
112
114
  */
113
115
  private borrowed;
116
+ /** Per tag selector, the content found before this service first wrote it, or null when there was none. */
117
+ private readonly tagsBeforeFirstWrite;
114
118
  constructor();
115
119
  /** Snapshot of the resolved metadata currently in the DOM. */
116
120
  current(): Readonly<WrMetaConfig>;
@@ -150,6 +154,14 @@ export declare class WrMeta {
150
154
  private diffMeta;
151
155
  private updateName;
152
156
  private updateProp;
157
+ /**
158
+ * A tag this service never wrote is left alone, and one it wrote goes back to
159
+ * what the document carried before the first write (or is removed if it
160
+ * carried none), the way the title does.
161
+ */
162
+ private writeTag;
163
+ /** Puts a tag back to the content it overrode, or removes it when it overrode none. */
164
+ private unmark;
153
165
  private diffLink;
154
166
  static ɵfac: i0.ɵɵFactoryDeclaration<WrMeta, never>;
155
167
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;