@uploadcare/file-uploader 1.5.3-alpha.6 → 1.6.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 (217) hide show
  1. package/README.md +4 -4
  2. package/abstract/ActivityBlock.d.ts +3 -3
  3. package/abstract/ActivityBlock.d.ts.map +1 -1
  4. package/abstract/Block.d.ts +11 -4
  5. package/abstract/Block.d.ts.map +1 -1
  6. package/abstract/Block.js +16 -16
  7. package/abstract/CTX.d.ts +7 -7
  8. package/abstract/CTX.d.ts.map +1 -1
  9. package/abstract/CTX.js +1 -1
  10. package/abstract/LocaleManager.d.ts +3 -3
  11. package/abstract/SecureUploadsManager.d.ts +2 -2
  12. package/abstract/SecureUploadsManager.d.ts.map +1 -1
  13. package/abstract/SolutionBlock.d.ts +2 -2
  14. package/abstract/SolutionBlock.d.ts.map +1 -1
  15. package/abstract/TypedCollection.d.ts +1 -1
  16. package/abstract/TypedCollection.d.ts.map +1 -1
  17. package/abstract/TypedCollection.js +4 -4
  18. package/abstract/TypedData.d.ts +2 -2
  19. package/abstract/TypedData.d.ts.map +1 -1
  20. package/abstract/TypedData.js +4 -4
  21. package/abstract/UploaderBlock.d.ts +9 -6
  22. package/abstract/UploaderBlock.d.ts.map +1 -1
  23. package/abstract/UploaderBlock.js +16 -23
  24. package/abstract/UploaderPublicApi.d.ts +21 -22
  25. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  26. package/abstract/UploaderPublicApi.js +4 -3
  27. package/abstract/ValidationManager.d.ts +3 -3
  28. package/abstract/ValidationManager.d.ts.map +1 -1
  29. package/abstract/a11y.d.ts +2 -2
  30. package/abstract/a11y.d.ts.map +1 -1
  31. package/abstract/buildOutputCollectionState.d.ts +1 -1
  32. package/abstract/buildOutputCollectionState.d.ts.map +1 -1
  33. package/abstract/defineComponents.d.ts.map +1 -1
  34. package/abstract/defineComponents.js +0 -5
  35. package/abstract/l10nProcessor.d.ts.map +1 -1
  36. package/abstract/l10nProcessor.js +3 -3
  37. package/abstract/loadFileUploaderFrom.d.ts.map +1 -1
  38. package/abstract/localeRegistry.d.ts.map +1 -1
  39. package/abstract/sharedConfigKey.d.ts.map +1 -1
  40. package/abstract/uploadEntrySchema.d.ts +4 -2
  41. package/abstract/uploadEntrySchema.d.ts.map +1 -1
  42. package/abstract/uploadEntrySchema.js +2 -1
  43. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  44. package/blocks/CameraSource/CameraSource.js +4 -5
  45. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -1
  46. package/blocks/CloudImageEditor/src/CropFrame.d.ts +11 -11
  47. package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -1
  48. package/blocks/CloudImageEditor/src/CropFrame.js +1 -2
  49. package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts.map +1 -1
  50. package/blocks/CloudImageEditor/src/EditorButtonControl.js +1 -2
  51. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -1
  52. package/blocks/CloudImageEditor/src/EditorFilterControl.js +7 -3
  53. package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +3 -3
  54. package/blocks/CloudImageEditor/src/EditorImageCropper.js +2 -2
  55. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +1 -1
  56. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
  57. package/blocks/CloudImageEditor/src/EditorOperationControl.js +1 -1
  58. package/blocks/CloudImageEditor/src/EditorScroller.d.ts.map +1 -1
  59. package/blocks/CloudImageEditor/src/EditorScroller.js +1 -2
  60. package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -1
  61. package/blocks/CloudImageEditor/src/EditorSlider.js +1 -2
  62. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +1 -1
  63. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -1
  64. package/blocks/CloudImageEditor/src/EditorToolbar.js +3 -4
  65. package/blocks/CloudImageEditor/src/crop-utils.d.ts +14 -14
  66. package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -1
  67. package/blocks/CloudImageEditor/src/css/common.css +2 -2
  68. package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +1 -1
  69. package/blocks/CloudImageEditor/src/elements/button/BtnUi.js +3 -3
  70. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts.map +1 -1
  71. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.js +1 -2
  72. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts.map +1 -1
  73. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.js +2 -3
  74. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts.map +1 -1
  75. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +1 -2
  76. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts +15 -0
  77. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts.map +1 -0
  78. package/blocks/CloudImageEditor/src/lib/FocusVisible.js +33 -0
  79. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +10 -0
  80. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +1 -0
  81. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.js +256 -0
  82. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +1 -1
  83. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +3 -3
  84. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -1
  85. package/blocks/CloudImageEditor/src/state.d.ts +4 -4
  86. package/blocks/CloudImageEditor/src/template.d.ts.map +1 -1
  87. package/blocks/CloudImageEditor/src/template.js +1 -2
  88. package/blocks/CloudImageEditor/src/types.d.ts +2 -2
  89. package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
  90. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +1 -1
  91. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
  92. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +1 -2
  93. package/blocks/Config/Config.d.ts +11 -3
  94. package/blocks/Config/Config.d.ts.map +1 -1
  95. package/blocks/Config/initialConfig.d.ts +1 -1
  96. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  97. package/blocks/Copyright/Copyright.d.ts.map +1 -1
  98. package/blocks/Copyright/Copyright.js +1 -2
  99. package/blocks/DropArea/DropArea.d.ts +2 -2
  100. package/blocks/DropArea/DropArea.d.ts.map +1 -1
  101. package/blocks/DropArea/DropArea.js +4 -4
  102. package/blocks/DropArea/addDropzone.d.ts.map +1 -1
  103. package/blocks/DropArea/getDropItems.d.ts +2 -2
  104. package/blocks/DropArea/getDropItems.d.ts.map +1 -1
  105. package/blocks/ExternalSource/ExternalSource.d.ts +5 -5
  106. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  107. package/blocks/ExternalSource/ExternalSource.js +3 -3
  108. package/blocks/ExternalSource/buildStyles.js +2 -2
  109. package/blocks/ExternalSource/query-string.d.ts.map +1 -1
  110. package/blocks/FileItem/FileItem.d.ts +2 -2
  111. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  112. package/blocks/FileItem/FileItem.js +3 -3
  113. package/blocks/FormInput/FormInput.js +1 -1
  114. package/blocks/Icon/Icon.d.ts +1 -0
  115. package/blocks/Icon/Icon.d.ts.map +1 -1
  116. package/blocks/Icon/Icon.js +4 -2
  117. package/blocks/Img/ImgBase.js +9 -9
  118. package/blocks/Img/ImgConfig.d.ts +2 -2
  119. package/blocks/Img/ImgConfig.d.ts.map +1 -1
  120. package/blocks/Img/ImgConfig.js +3 -3
  121. package/blocks/Img/utils/parseObjectToString.js +1 -1
  122. package/blocks/Modal/Modal.d.ts.map +1 -1
  123. package/blocks/Modal/Modal.js +1 -2
  124. package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -1
  125. package/blocks/ProgressBar/ProgressBar.js +1 -2
  126. package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts.map +1 -1
  127. package/blocks/ProgressBarCommon/ProgressBarCommon.js +1 -2
  128. package/blocks/Range/Range.d.ts +16 -0
  129. package/blocks/Range/Range.d.ts.map +1 -0
  130. package/blocks/Range/Range.js +44 -0
  131. package/blocks/Range/range.css +65 -0
  132. package/blocks/Select/Select.d.ts.map +1 -1
  133. package/blocks/Select/Select.js +9 -14
  134. package/blocks/SimpleBtn/SimpleBtn.d.ts +2 -2
  135. package/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -1
  136. package/blocks/SimpleBtn/SimpleBtn.js +1 -2
  137. package/blocks/SourceBtn/SourceBtn.d.ts +2 -2
  138. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  139. package/blocks/SourceBtn/SourceBtn.js +8 -7
  140. package/blocks/SourceList/SourceList.d.ts.map +1 -1
  141. package/blocks/SourceList/SourceList.js +4 -5
  142. package/blocks/StartFrom/StartFrom.d.ts.map +1 -1
  143. package/blocks/StartFrom/StartFrom.js +1 -2
  144. package/blocks/UploadCtxProvider/EventEmitter.d.ts +19 -19
  145. package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
  146. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +4 -4
  147. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -1
  148. package/blocks/UploadList/UploadList.d.ts +2 -2
  149. package/blocks/UploadList/UploadList.d.ts.map +1 -1
  150. package/blocks/UploadList/UploadList.js +4 -3
  151. package/blocks/UrlSource/UrlSource.d.ts.map +1 -1
  152. package/blocks/UrlSource/UrlSource.js +3 -4
  153. package/blocks/themes/uc-basic/index.css +1 -0
  154. package/blocks/utils/UploadSource.d.ts +27 -1
  155. package/blocks/utils/UploadSource.d.ts.map +1 -1
  156. package/blocks/utils/UploadSource.js +20 -1
  157. package/blocks/utils/debounce.d.ts +1 -3
  158. package/blocks/utils/debounce.d.ts.map +1 -1
  159. package/blocks/utils/throttle.d.ts +1 -3
  160. package/blocks/utils/throttle.d.ts.map +1 -1
  161. package/blocks/utils/userAgent.d.ts +1 -1
  162. package/blocks/utils/userAgent.d.ts.map +1 -1
  163. package/env.d.ts +1 -1
  164. package/env.js +1 -1
  165. package/index.d.ts +2 -1
  166. package/index.js +2 -1
  167. package/index.ssr.d.ts +98 -129
  168. package/index.ssr.d.ts.map +1 -1
  169. package/index.ssr.js +93 -132
  170. package/package.json +8 -12
  171. package/solutions/file-uploader/inline/FileUploaderInline.d.ts +2 -2
  172. package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
  173. package/solutions/file-uploader/inline/FileUploaderInline.js +4 -3
  174. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  175. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +1 -2
  176. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +3 -3
  177. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  178. package/solutions/file-uploader/regular/FileUploaderRegular.js +1 -2
  179. package/types/exported.d.ts +2 -0
  180. package/types/jsx.d.ts +3 -9
  181. package/utils/getPluralForm.d.ts.map +1 -1
  182. package/utils/isSecureTokenExpired.d.ts +1 -1
  183. package/utils/memoize.d.ts.map +1 -1
  184. package/utils/mixinClass.d.ts +1 -3
  185. package/utils/mixinClass.d.ts.map +1 -1
  186. package/utils/prettyBytes.d.ts.map +1 -1
  187. package/utils/template-utils.d.ts.map +1 -1
  188. package/utils/toKebabCase.d.ts.map +1 -1
  189. package/utils/uniqueArray.d.ts.map +1 -1
  190. package/utils/validators/collection/validateCollectionUploadError.d.ts +1 -1
  191. package/utils/validators/collection/validateMultiple.d.ts +1 -1
  192. package/utils/validators/file/validateFileType.d.ts +1 -1
  193. package/utils/validators/file/validateIsImage.d.ts +1 -1
  194. package/utils/validators/file/validateMaxSizeLimit.d.ts +1 -1
  195. package/utils/validators/file/validateUploadError.d.ts +1 -1
  196. package/utils/waitForAttribute.d.ts +6 -12
  197. package/utils/waitForAttribute.d.ts.map +1 -1
  198. package/utils/waitForAttribute.js +8 -38
  199. package/utils/waitForAttribute.test.js +47 -10
  200. package/web/file-uploader.iife.min.js +4 -5
  201. package/web/file-uploader.min.js +4 -5
  202. package/web/uc-basic.min.css +1 -1
  203. package/web/uc-cloud-image-editor.min.css +1 -1
  204. package/web/uc-cloud-image-editor.min.js +4 -5
  205. package/web/uc-file-uploader-inline.min.css +1 -1
  206. package/web/uc-file-uploader-inline.min.js +4 -5
  207. package/web/uc-file-uploader-minimal.min.js +3 -4
  208. package/web/uc-file-uploader-regular.min.css +1 -1
  209. package/web/uc-file-uploader-regular.min.js +4 -5
  210. package/web/uc-img.min.js +3 -4
  211. package/symbiote.js +0 -18
  212. package/utils/withResolvers.d.ts +0 -7
  213. package/utils/withResolvers.d.ts.map +0 -1
  214. package/utils/withResolvers.js +0 -17
  215. package/utils/withResolvers.test.d.ts +0 -2
  216. package/utils/withResolvers.test.d.ts.map +0 -1
  217. package/utils/withResolvers.test.js +0 -27
@@ -1,5 +1,4 @@
1
1
  import { Block } from '../../../abstract/Block.js';
2
- import { html } from '../../../symbiote.js';
3
2
  import { COLOR_OPERATIONS_CONFIG } from './toolbar-constants.js';
4
3
 
5
4
  const ControlType = {
@@ -111,7 +110,7 @@ export class EditorSlider extends Block {
111
110
  }
112
111
  }
113
112
 
114
- EditorSlider.template = html`
113
+ EditorSlider.template = /* HTML */ `
115
114
  <uc-slider-ui
116
115
  ref="slider-el"
117
116
  set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;"
@@ -2,7 +2,7 @@ export class EditorToolbar extends Block {
2
2
  init$: {
3
3
  '*sliderEl': null;
4
4
  /** @type {import('./types.js').LoadingOperations} */
5
- '*loadingOperations': import("./types.js").LoadingOperations;
5
+ '*loadingOperations': import('./types.js').LoadingOperations;
6
6
  '*showSlider': boolean;
7
7
  '*currentFilter': string;
8
8
  '*currentOperation': null;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["EditorToolbar.js"],"names":[],"mappings":"AA4DA;IAII;;QAGE,qDAAqD;8BAA1C,OAAO,YAAY,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuDjD,4BAA4B;2BAAhB,UAAU;;;;;;;MAgBvB;IAED,eAAe;IAEf,6BAAsE;IAGxE,eAAe;IACf,uBAKC;IAED;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,4BAoCC;IAED;;;;OAIG;IACH,qBAyBC;IAED;;;OAGG;IACH,4BAKC;IAED,eAAe;IACf,0BAIC;IAED,eAAe;IACf,4BAWC;IALG,oBAGC;IAIL;;;OAGG;IACH,oBAEC;IAED;;MAwBM;CAiFP;;;;sBAlZqB,4BAA4B"}
1
+ {"version":3,"file":"EditorToolbar.d.ts","sourceRoot":"","sources":["EditorToolbar.js"],"names":[],"mappings":"AA2DA;IAII;;QAGE,qDAAqD;8BAA1C,OAAO,YAAY,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuDjD,4BAA4B;2BAAhB,UAAU;;;;;;;MAgBvB;IAED,eAAe;IAEf,6BAAsE;IAGxE,eAAe;IACf,uBAKC;IAED;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,4BAoCC;IAED;;;;OAIG;IACH,qBAyBC;IAED;;;OAGG;IACH,4BAKC;IAED,eAAe;IACf,0BAIC;IAED,eAAe;IACf,4BAWC;IALG,oBAGC;IAIL;;;OAGG;IACH,oBAEC;IAED;;MAwBM;CAiFP;;;;sBAlZqB,4BAA4B"}
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
- import { html } from '../../../symbiote.js';
3
2
  import { debounce } from '../../utils/debounce.js';
4
3
  import { Block } from '../../../abstract/Block.js';
5
4
  import { EditorCropButtonControl } from './EditorCropButtonControl.js';
@@ -38,7 +37,7 @@ function renderTabToggle(id) {
38
37
 
39
38
  /** @param {String} id */
40
39
  function renderTabContent(id) {
41
- return html`
40
+ return /* HTML */ `
42
41
  <uc-presence-toggle
43
42
  id="tab_${id}"
44
43
  class="uc-tab-content"
@@ -340,7 +339,7 @@ export class EditorToolbar extends Block {
340
339
  this.sub('*editorTransformations', (editorTransformations) => {
341
340
  let appliedFilter = editorTransformations?.filter?.name;
342
341
  if (this.$['*currentFilter'] !== appliedFilter) {
343
- this.$['*currentFilter'] = appliedFilter ?? null;
342
+ this.$['*currentFilter'] = appliedFilter;
344
343
  }
345
344
  });
346
345
 
@@ -405,7 +404,7 @@ export class EditorToolbar extends Block {
405
404
  }
406
405
  }
407
406
 
408
- EditorToolbar.template = html`
407
+ EditorToolbar.template = /* HTML */ `
409
408
  <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui>
410
409
  <div class="uc-info-tooltip_container">
411
410
  <div class="uc-info-tooltip_wrapper">
@@ -18,7 +18,7 @@ export function createSvgNode(name: string, attrs?: {
18
18
  * @param {import('./types.js').Direction} direction
19
19
  * @param {number} sizeMultiplier
20
20
  */
21
- export function cornerPath(rect: import("./types.js").Rectangle, direction: import("./types.js").Direction, sizeMultiplier: number): {
21
+ export function cornerPath(rect: import('./types.js').Rectangle, direction: import('./types.js').Direction, sizeMultiplier: number): {
22
22
  d: string;
23
23
  center: number[];
24
24
  };
@@ -27,12 +27,12 @@ export function cornerPath(rect: import("./types.js").Rectangle, direction: impo
27
27
  * @param {Extract<import('./types.js').Direction, 'n' | 's' | 'w' | 'e'>} direction
28
28
  * @param {number} sizeMultiplier
29
29
  */
30
- export function sidePath(rect: import("./types.js").Rectangle, direction: Extract<import("./types.js").Direction, "n" | "s" | "w" | "e">, sizeMultiplier: number): {
30
+ export function sidePath(rect: import('./types.js').Rectangle, direction: Extract<import('./types.js').Direction, 'n' | 's' | 'w' | 'e'>, sizeMultiplier: number): {
31
31
  d: string;
32
32
  center: number[];
33
33
  };
34
34
  /** @param {import('./types.js').Direction} direction */
35
- export function thumbCursor(direction: import("./types.js").Direction): "move" | "ew-resize" | "ns-resize" | "nwse-resize" | "nesw-resize";
35
+ export function thumbCursor(direction: import('./types.js').Direction): "move" | "ew-resize" | "ns-resize" | "nwse-resize" | "nesw-resize";
36
36
  /**
37
37
  * @param {{
38
38
  * rect: import('./types.js').Rectangle;
@@ -41,9 +41,9 @@ export function thumbCursor(direction: import("./types.js").Direction): "move" |
41
41
  * }} options
42
42
  */
43
43
  export function moveRect({ rect, delta: [dx, dy], imageBox }: {
44
- rect: import("./types.js").Rectangle;
44
+ rect: import('./types.js').Rectangle;
45
45
  delta: [number, number];
46
- imageBox: import("./types.js").Rectangle;
46
+ imageBox: import('./types.js').Rectangle;
47
47
  }): {
48
48
  x: number;
49
49
  y: number;
@@ -54,7 +54,7 @@ export function moveRect({ rect, delta: [dx, dy], imageBox }: {
54
54
  * @param {import('./types.js').Rectangle} rect1
55
55
  * @param {import('./types.js').Rectangle} rect2
56
56
  */
57
- export function constraintRect(rect1: import("./types.js").Rectangle, rect2: import("./types.js").Rectangle): {
57
+ export function constraintRect(rect1: import('./types.js').Rectangle, rect2: import('./types.js').Rectangle): {
58
58
  x: number;
59
59
  y: number;
60
60
  width: number;
@@ -70,33 +70,33 @@ export function constraintRect(rect1: import("./types.js").Rectangle, rect2: imp
70
70
  * }} options
71
71
  */
72
72
  export function resizeRect({ direction, ...rest }: {
73
- rect: import("./types.js").Rectangle;
73
+ rect: import('./types.js').Rectangle;
74
74
  delta: [number, number];
75
- direction: import("./types.js").Direction;
75
+ direction: import('./types.js').Direction;
76
76
  aspectRatio?: number;
77
- imageBox: import("./types.js").Rectangle;
77
+ imageBox: import('./types.js').Rectangle;
78
78
  }): import("./types.js").Rectangle;
79
79
  /**
80
80
  * @param {import('./types.js').Rectangle} rect
81
81
  * @param {[Number, Number]} point
82
82
  */
83
- export function rectContainsPoint(rect: import("./types.js").Rectangle, [x, y]: [number, number]): boolean;
83
+ export function rectContainsPoint(rect: import('./types.js').Rectangle, [x, y]: [number, number]): boolean;
84
84
  /**
85
85
  * @param {import('./types.js').Rectangle} rect1
86
86
  * @param {import('./types.js').Rectangle} rect2
87
87
  */
88
- export function isRectInsideRect(rect1: import("./types.js").Rectangle, rect2: import("./types.js").Rectangle): boolean;
88
+ export function isRectInsideRect(rect1: import('./types.js').Rectangle, rect2: import('./types.js').Rectangle): boolean;
89
89
  /**
90
90
  * @param {import('./types.js').Rectangle} rect
91
91
  * @param {number} aspectRatio
92
92
  */
93
- export function isRectMatchesAspectRatio(rect: import("./types.js").Rectangle, aspectRatio: number): boolean;
93
+ export function isRectMatchesAspectRatio(rect: import('./types.js').Rectangle, aspectRatio: number): boolean;
94
94
  /**
95
95
  * @param {import('./types.js').ImageSize} imageSize
96
96
  * @param {Number} angle
97
97
  * @returns {import('./types.js').ImageSize}
98
98
  */
99
- export function rotateSize({ width, height }: import("./types.js").ImageSize, angle: number): import("./types.js").ImageSize;
99
+ export function rotateSize({ width, height }: import('./types.js').ImageSize, angle: number): import('./types.js').ImageSize;
100
100
  /**
101
101
  * @param {number} width
102
102
  * @param {number} height
@@ -112,7 +112,7 @@ export function calculateMaxCenteredCropFrame(width: number, height: number, asp
112
112
  * @param {import('./types.js').Rectangle} rect
113
113
  * @returns {import('./types.js').Rectangle}
114
114
  */
115
- export function roundRect(rect: import("./types.js").Rectangle): import("./types.js").Rectangle;
115
+ export function roundRect(rect: import('./types.js').Rectangle): import('./types.js').Rectangle;
116
116
  /**
117
117
  * @param {Number} value
118
118
  * @param {Number} min
@@ -1 +1 @@
1
- {"version":3,"file":"crop-utils.d.ts","sourceRoot":"","sources":["crop-utils.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,sCAHW,UAAU,SACV;IAAE,CAAC,GAAG,QAAQ,GAAG,eAAe,CAAA;CAAE,QAI5C;AAED;;;;GAIG;AACH,oDAHW;IAAE,CAAC,GAAG,QAAQ,GAAG,eAAe,CAAA;CAAE,GAChC,UAAU,CAMtB;AAED;;;;GAIG;AACH,iCAJW,OAAO,YAAY,EAAE,SAAS,aAC9B,OAAO,YAAY,EAAE,SAAS,kBAC9B,MAAM;;;EA2BhB;AAED;;;;GAIG;AACH,+BAJW,OAAO,YAAY,EAAE,SAAS,aAC9B,OAAO,CAAC,OAAO,YAAY,EAAE,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,kBAC9D,MAAM;;;EA0BhB;AAED,wDAAwD;AACxD,uCADY,OAAO,YAAY,EAAE,SAAS,sEAezC;AAED;;;;;;GAMG;AACH,8DANW;IACV,IAAQ,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IACzC,KAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAY,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;CAC1C;;;;;EAWH;AAED;;;GAGG;AACH,sCAHW,OAAO,YAAY,EAAE,SAAS,SAC9B,OAAO,YAAY,EAAE,SAAS;;;;;EAqBxC;AA8cD;;;;;;;;GAQG;AACH,mDARW;IACV,IAAQ,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IACzC,KAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAa,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IAC9C,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAY,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;CAC1C,kCAuBH;AAED;;;GAGG;AACH,wCAHW,OAAO,YAAY,EAAE,SAAS,UAC9B,gBAAgB,WAI1B;AAED;;;GAGG;AACH,wCAHW,OAAO,YAAY,EAAE,SAAS,SAC9B,OAAO,YAAY,EAAE,SAAS,WASxC;AAED;;;GAGG;AACH,+CAHW,OAAO,YAAY,EAAE,SAAS,eAC9B,MAAM,WAKhB;AAED;;;;GAIG;AACH,8CAJW,OAAO,YAAY,EAAE,SAAS,kBAE5B,OAAO,YAAY,EAAE,SAAS,CAK1C;AAED;;;;GAIG;AACH,qDAJW,MAAM,UACN,MAAM,eACN,MAAM;;;;;EAyBhB;AAED;;;GAGG;AACH,gCAHW,OAAO,YAAY,EAAE,SAAS,GAC5B,OAAO,YAAY,EAAE,SAAS,CAS1C;AAED;;;;;GAKG;AACH,uEAEC"}
1
+ {"version":3,"file":"crop-utils.d.ts","sourceRoot":"","sources":["crop-utils.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,sCAHW,UAAU;;SAKpB;AAED;;;;GAIG;AACH;;IAFa,UAAU,CAMtB;AAED;;;;GAIG;AACH,iCAJW,OAAO,YAAY,EAAE,SAAS,aAC9B,OAAO,YAAY,EAAE,SAAS,kBAC9B,MAAM;;;EA2BhB;AAED;;;;GAIG;AACH,+BAJW,OAAO,YAAY,EAAE,SAAS,aAC9B,QAAQ,OAAO,YAAY,EAAE,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,kBAC9D,MAAM;;;EA0BhB;AAED,wDAAwD;AACxD,uCADY,OAAO,YAAY,EAAE,SAAS,sEAezC;AAED;;;;;;GAMG;AACH,8DANW;IACV,IAAQ,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IACzC,KAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAY,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;CAC1C;;;;;EAWH;AAED;;;GAGG;AACH,sCAHW,OAAO,YAAY,EAAE,SAAS,SAC9B,OAAO,YAAY,EAAE,SAAS;;;;;EAqBxC;AA8cD;;;;;;;;GAQG;AACH,mDARW;IACV,IAAQ,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IACzC,KAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAa,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;IAC9C,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAY,EAAE,OAAO,YAAY,EAAE,SAAS,CAAC;CAC1C,kCAuBH;AAED;;;GAGG;AACH,wCAHW,OAAO,YAAY,EAAE,SAAS,UAC9B,gBAAgB,WAI1B;AAED;;;GAGG;AACH,wCAHW,OAAO,YAAY,EAAE,SAAS,SAC9B,OAAO,YAAY,EAAE,SAAS,WASxC;AAED;;;GAGG;AACH,+CAHW,OAAO,YAAY,EAAE,SAAS,eAC9B,MAAM,WAKhB;AAED;;;;GAIG;AACH,8CAJW,OAAO,YAAY,EAAE,SAAS,kBAE5B,OAAO,YAAY,EAAE,SAAS,CAK1C;AAED;;;;GAIG;AACH,qDAJW,MAAM,UACN,MAAM,eACN,MAAM;;;;;EAyBhB;AAED;;;GAGG;AACH,gCAHW,OAAO,YAAY,EAAE,SAAS,GAC5B,OAAO,YAAY,EAAE,SAAS,CAS1C;AAED;;;;;GAKG;AACH,uEAEC"}
@@ -375,7 +375,7 @@ uc-editor-operation-control > button {
375
375
  height: var(--size-icon);
376
376
  }
377
377
 
378
- uc-editor-filter-control uc-icon.uc-original-icon > svg {
378
+ uc-editor-filter-control > uc-icon.uc-original-icon > svg {
379
379
  width: 100%;
380
380
  height: 100%;
381
381
  }
@@ -455,7 +455,7 @@ uc-editor-filter-control > button .uc-preview {
455
455
  transition: var(--transition-duration-3);
456
456
  }
457
457
 
458
- uc-editor-filter-control .uc-original-icon {
458
+ uc-editor-filter-control > .uc-original-icon {
459
459
  color: var(--color-effect);
460
460
  opacity: 0.3;
461
461
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BtnUi.d.ts","sourceRoot":"","sources":["BtnUi.js"],"names":[],"mappings":"AAIA;IAII,uBAA0B;IAC1B,qBAAwB;IACxB,qBAAwB;IAExB;;;;;;;;MASC;IAWH,mBAOC;IAsCD,sBAQC;CACF;;;;sBArFqB,kCAAkC"}
1
+ {"version":3,"file":"BtnUi.d.ts","sourceRoot":"","sources":["BtnUi.js"],"names":[],"mappings":"AAGA;IAII,uBAA0B;IAC1B,qBAAwB;IACxB,qBAAwB;IAExB;;;;;;;;MASC;IAWH,mBAOC;IAsCD,sBAQC;CACF;;;;sBArFqB,kCAAkC"}
@@ -1,4 +1,3 @@
1
- import { html } from '../../../../../symbiote.js';
2
1
  import { Block } from '../../../../../abstract/Block.js';
3
2
  import { classNames } from '../../lib/classNames.js';
4
3
 
@@ -54,7 +53,7 @@ export class BtnUi extends Block {
54
53
  }
55
54
  });
56
55
 
57
- this.sub('text', () => {
56
+ this.sub('text', (txt) => {
58
57
  this._iconSingle = false;
59
58
  });
60
59
 
@@ -85,9 +84,10 @@ export class BtnUi extends Block {
85
84
  }
86
85
  }
87
86
  }
87
+
88
88
  BtnUi.bindAttributes({ text: 'text', icon: 'icon', reverse: 'reverse', theme: 'theme' });
89
89
 
90
- BtnUi.template = html`
90
+ BtnUi.template = /* HTML */ `
91
91
  <button type="button" set="@role:aria-role; @aria-controls: aria-controls;" l10n="@title:title-prop">
92
92
  <uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon>
93
93
  <div class="uc-text">{{text}}</div>
@@ -1 +1 @@
1
- {"version":3,"file":"LineLoaderUi.d.ts","sourceRoot":"","sources":["LineLoaderUi.js"],"names":[],"mappings":"AAGA;IAII,iBAAoB;IAEpB,sCAMC;IAgBH,eAUC;IAED,cAEC;CACF;;;;sBA7CqB,kCAAkC"}
1
+ {"version":3,"file":"LineLoaderUi.d.ts","sourceRoot":"","sources":["LineLoaderUi.js"],"names":[],"mappings":"AAEA;IAII,iBAAoB;IAEpB,sCAMC;IAgBH,eAUC;IAED,cAEC;CACF;;;;sBA7CqB,kCAAkC"}
@@ -1,4 +1,3 @@
1
- import { html } from '../../../../../symbiote.js';
2
1
  import { Block } from '../../../../../abstract/Block.js';
3
2
 
4
3
  export class LineLoaderUi extends Block {
@@ -46,7 +45,7 @@ export class LineLoaderUi extends Block {
46
45
  }
47
46
  }
48
47
 
49
- LineLoaderUi.template = html`
48
+ LineLoaderUi.template = /* HTML */ `
50
49
  <div class="uc-inner">
51
50
  <div class="uc-line" ref="line-el"></div>
52
51
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"PresenceToggle.d.ts","sourceRoot":"","sources":["PresenceToggle.js"],"names":[],"mappings":"AAkBA;IAII,kBAAqB;IACrB,kCAA0C;IAC1C,iCAAwC;IACxC,8BAAiC;IAqBnC,uBAQC;CAgBF;;;;;;;;;sBArEqB,kCAAkC"}
1
+ {"version":3,"file":"PresenceToggle.d.ts","sourceRoot":"","sources":["PresenceToggle.js"],"names":[],"mappings":"AAiBA;IAII,kBAAqB;IACrB,kCAA0C;IAC1C,iCAAwC;IACxC,8BAAiC;IAqBnC,uBAQC;CAgBF;;;;;;;;;sBApEqB,kCAAkC"}
@@ -1,6 +1,5 @@
1
- import { html } from '../../../../../symbiote.js';
2
- import { Block } from '../../../../../abstract/Block.js';
3
1
  import { applyClassNames } from '../../lib/classNames.js';
2
+ import { Block } from '../../../../../abstract/Block.js';
4
3
 
5
4
  /**
6
5
  * @typedef {Object} Style
@@ -69,4 +68,4 @@ export class PresenceToggle extends Block {
69
68
  }, 0);
70
69
  }
71
70
  }
72
- PresenceToggle.template = html` <slot></slot> `;
71
+ PresenceToggle.template = /* HTML */ `<slot></slot> `;
@@ -1 +1 @@
1
- {"version":3,"file":"SliderUi.d.ts","sourceRoot":"","sources":["SliderUi.js"],"names":[],"mappings":"AAGA;IACE,WAiBE;IA6BE,WAAiB;IAenB,sCAIE;IAGF,+BAAgG;IAyBlG,+BAWC;IAED,iCAgBC;IAED,qBAmCC;IALC,uCAA2B;IAI3B,iBAAwB;CAO3B;;;;sBAxKqB,kCAAkC"}
1
+ {"version":3,"file":"SliderUi.d.ts","sourceRoot":"","sources":["SliderUi.js"],"names":[],"mappings":"AAEA;IACE,WAiBE;IA6BE,WAAiB;IAenB,sCAIE;IAGF,+BAAgG;IAyBlG,+BAWC;IAED,iCAgBC;IAED,qBAmCC;IALC,uCAA2B;IAI3B,iBAAwB;CAO3B;;;;sBAxKqB,kCAAkC"}
@@ -1,4 +1,3 @@
1
- import { html } from '../../../../../symbiote.js';
2
1
  import { Block } from '../../../../../abstract/Block.js';
3
2
 
4
3
  export class SliderUi extends Block {
@@ -168,7 +167,7 @@ export class SliderUi extends Block {
168
167
  this._observer?.disconnect();
169
168
  }
170
169
  }
171
- SliderUi.template = html`
170
+ SliderUi.template = /* HTML */ `
172
171
  <div class="uc-steps" ref="steps-el"></div>
173
172
  <div ref="thumb-el" class="uc-thumb"></div>
174
173
  <input
@@ -0,0 +1,15 @@
1
+ export class FocusVisible {
2
+ /**
3
+ * @param {boolean} focusVisible
4
+ * @param {HTMLElement} element
5
+ */
6
+ static handleFocusVisible(focusVisible: boolean, element: HTMLElement): void;
7
+ /** @param {ShadowRoot | Document} scope */
8
+ static register(scope: ShadowRoot | Document): void;
9
+ /** @param {Document | ShadowRoot} scope */
10
+ static unregister(scope: Document | ShadowRoot): void;
11
+ }
12
+ export namespace FocusVisible {
13
+ let _destructors: WeakMap<WeakKey, any>;
14
+ }
15
+ //# sourceMappingURL=FocusVisible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocusVisible.d.ts","sourceRoot":"","sources":["FocusVisible.js"],"names":[],"mappings":"AAEA;IACE;;;OAGG;IACH,wCAHW,OAAO,WACP,WAAW,QASrB;IAED,2CAA2C;IAC3C,uBADY,UAAU,GAAG,QAAQ,QAGhC;IAED,2CAA2C;IAC3C,yBADY,QAAQ,GAAG,UAAU,QAQhC;CACF"}
@@ -0,0 +1,33 @@
1
+ import { applyFocusVisiblePolyfill } from './applyFocusVisiblePolyfill.js';
2
+
3
+ export class FocusVisible {
4
+ /**
5
+ * @param {boolean} focusVisible
6
+ * @param {HTMLElement} element
7
+ */
8
+ static handleFocusVisible(focusVisible, element) {
9
+ if (focusVisible) {
10
+ let customOutline = element.style.getPropertyValue('--focus-visible-outline');
11
+ element.style.outline = customOutline || '2px solid var(--color-focus-ring)';
12
+ } else {
13
+ element.style.outline = 'none';
14
+ }
15
+ }
16
+
17
+ /** @param {ShadowRoot | Document} scope */
18
+ static register(scope) {
19
+ FocusVisible._destructors.set(scope, applyFocusVisiblePolyfill(scope, FocusVisible.handleFocusVisible));
20
+ }
21
+
22
+ /** @param {Document | ShadowRoot} scope */
23
+ static unregister(scope) {
24
+ if (!FocusVisible._destructors.has(scope)) {
25
+ return;
26
+ }
27
+ let removeFocusVisiblePolyfill = FocusVisible._destructors.get(scope);
28
+ removeFocusVisiblePolyfill();
29
+ FocusVisible._destructors.delete(scope);
30
+ }
31
+ }
32
+
33
+ FocusVisible._destructors = new WeakMap();
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Applies the :focus-visible polyfill at the given scope. A scope, in this case, is either the top-level Document or a
3
+ * Shadow Root.
4
+ *
5
+ * @param {Document | ShadowRoot} scope
6
+ * @param {(focusVisible: boolean, el: EventTarget) => void} [callback]
7
+ * @see https://github.com/WICG/focus-visible
8
+ */
9
+ export function applyFocusVisiblePolyfill(scope: Document | ShadowRoot, callback?: ((focusVisible: boolean, el: EventTarget) => void) | undefined): () => void;
10
+ //# sourceMappingURL=applyFocusVisiblePolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyFocusVisiblePolyfill.d.ts","sourceRoot":"","sources":["applyFocusVisiblePolyfill.js"],"names":[],"mappings":"AAgDA;;;;;;;GAOG;AACH,iDAJW,QAAQ,GAAG,UAAU,6BACN,OAAO,MAAM,WAAW,KAAK,IAAI,2BA0M1D"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Helper function for legacy browsers and iframes which sometimes focus on elements like document, body, and
3
+ * non-interactive SVG.
4
+ *
5
+ * @param {EventTarget} el
6
+ */
7
+ function isValidFocusTarget(el) {
8
+ if (
9
+ el &&
10
+ el !== document &&
11
+ /** @type {Element} */ (el).nodeName !== 'HTML' &&
12
+ /** @type {Element} */ (el).nodeName !== 'BODY' &&
13
+ 'classList' in el &&
14
+ 'contains' in /** @type {Element} */ (el).classList
15
+ ) {
16
+ return true;
17
+ }
18
+ return false;
19
+ }
20
+
21
+ /**
22
+ * Computes whether the given element should automatically trigger the `focus-visible` class being added, i.e., whether
23
+ * it should always match `:focus-visible` when focused.
24
+ *
25
+ * @param {EventTarget} el
26
+ * @returns {boolean}
27
+ */
28
+ function focusTriggersKeyboardModality(el) {
29
+ let { tagName } = /** @type {Element} */ (el);
30
+
31
+ if (tagName === 'INPUT' && !(/** @type {HTMLInputElement} */ (el).readOnly)) {
32
+ return true;
33
+ }
34
+
35
+ if (tagName === 'TEXTAREA' && !(/** @type {HTMLTextAreaElement} */ (el).readOnly)) {
36
+ return true;
37
+ }
38
+
39
+ if (/** @type {HTMLElement} */ (el).isContentEditable) {
40
+ return true;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ let hadKeyboardEvent = true;
47
+ let hadFocusVisibleRecently = false;
48
+
49
+ /**
50
+ * Applies the :focus-visible polyfill at the given scope. A scope, in this case, is either the top-level Document or a
51
+ * Shadow Root.
52
+ *
53
+ * @param {Document | ShadowRoot} scope
54
+ * @param {(focusVisible: boolean, el: EventTarget) => void} [callback]
55
+ * @see https://github.com/WICG/focus-visible
56
+ */
57
+ export function applyFocusVisiblePolyfill(scope, callback) {
58
+ let hadFocusVisibleRecentlyTimeout = null;
59
+
60
+ /**
61
+ * Add the `focus-visible` class to the given element if the author did not add it.
62
+ *
63
+ * @param {EventTarget} el
64
+ */
65
+ function addFocusVisibleClass(el) {
66
+ /** @type {Element} */ (el).setAttribute('focus-visible', '');
67
+ callback(true, el);
68
+ }
69
+
70
+ /**
71
+ * Remove the `focus-visible` class from the given element if the author did not originally add it.
72
+ *
73
+ * @param {EventTarget} el
74
+ */
75
+ function removeFocusVisibleClass(el) {
76
+ if (!(/** @type {Element} */ (el).hasAttribute('focus-visible'))) {
77
+ return;
78
+ }
79
+ /** @type {Element} */ (el).removeAttribute('focus-visible');
80
+ callback(false, el);
81
+ }
82
+
83
+ /**
84
+ * If the most recent user interaction was via the keyboard, and the keypress did not include a meta, alt/option, or
85
+ * control key, then the keyboard's modality. Otherwise, the modality is not the keyboard.Apply `focus-visible` to any
86
+ * current active element and keep track of our keyboard modality state with `hadKeyboardEvent`.
87
+ *
88
+ * @param {KeyboardEvent} e
89
+ */
90
+ function onKeyDown(e) {
91
+ if (e.metaKey || e.altKey || e.ctrlKey) {
92
+ return;
93
+ }
94
+
95
+ if (isValidFocusTarget(scope.activeElement)) {
96
+ addFocusVisibleClass(scope.activeElement);
97
+ }
98
+
99
+ hadKeyboardEvent = true;
100
+ }
101
+
102
+ /**
103
+ * If at any point a user clicks with a pointing device, ensure that we change the modality away from the keyboard.
104
+ * This avoids the situation where a user presses a key on an already focused element, and then clicks on a different
105
+ * element focusing it with a pointing device while we still think we're in keyboard modality.
106
+ *
107
+ * @param {Event} e
108
+ */
109
+ function onPointerDown(e) {
110
+ hadKeyboardEvent = false;
111
+ }
112
+
113
+ /**
114
+ * On `focus`, add the `focus-visible` class to the target if: - the target received focus as a result of keyboard
115
+ * navigation or - the event target is an element that will likely require interaction via the keyboard (e.g., a text
116
+ * box).
117
+ *
118
+ * @param {Event} e
119
+ */
120
+ function onFocus(e) {
121
+ // Prevent IE from focusing the document or HTML element.
122
+ if (!isValidFocusTarget(e.target)) {
123
+ return;
124
+ }
125
+
126
+ if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
127
+ addFocusVisibleClass(e.target);
128
+ }
129
+ }
130
+
131
+ /**
132
+ * On `blur`, remove the `focus-visible` class from the target.
133
+ *
134
+ * @param {Event} e
135
+ */
136
+ function onBlur(e) {
137
+ if (!isValidFocusTarget(e.target)) {
138
+ return;
139
+ }
140
+
141
+ if (/** @type {Element} */ (e.target).hasAttribute('focus-visible')) {
142
+ // To detect a tab/window switch, we look for a blur event followed
143
+ // rapidly by a visibility change.
144
+ // If we don't see a visibility change within 100ms, it's probably a
145
+ // regular focus change.
146
+ hadFocusVisibleRecently = true;
147
+ window.clearTimeout(hadFocusVisibleRecentlyTimeout);
148
+ hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {
149
+ hadFocusVisibleRecently = false;
150
+ }, 100);
151
+ removeFocusVisibleClass(e.target);
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Add a group of listeners to detect usage of any pointing devices. These listeners will be added when the polyfill
157
+ * first loads and anytime the window is blurred so that they are active when the window regains focus.
158
+ */
159
+ function addInitialPointerMoveListeners() {
160
+ /* eslint-disable no-use-before-define */
161
+ document.addEventListener('mousemove', onInitialPointerMove);
162
+ document.addEventListener('mousedown', onInitialPointerMove);
163
+ document.addEventListener('mouseup', onInitialPointerMove);
164
+ document.addEventListener('pointermove', onInitialPointerMove);
165
+ document.addEventListener('pointerdown', onInitialPointerMove);
166
+ document.addEventListener('pointerup', onInitialPointerMove);
167
+ document.addEventListener('touchmove', onInitialPointerMove);
168
+ document.addEventListener('touchstart', onInitialPointerMove);
169
+ document.addEventListener('touchend', onInitialPointerMove);
170
+ /* eslint-enable no-use-before-define */
171
+ }
172
+
173
+ function removeInitialPointerMoveListeners() {
174
+ /* eslint-disable no-use-before-define */
175
+ document.removeEventListener('mousemove', onInitialPointerMove);
176
+ document.removeEventListener('mousedown', onInitialPointerMove);
177
+ document.removeEventListener('mouseup', onInitialPointerMove);
178
+ document.removeEventListener('pointermove', onInitialPointerMove);
179
+ document.removeEventListener('pointerdown', onInitialPointerMove);
180
+ document.removeEventListener('pointerup', onInitialPointerMove);
181
+ document.removeEventListener('touchmove', onInitialPointerMove);
182
+ document.removeEventListener('touchstart', onInitialPointerMove);
183
+ document.removeEventListener('touchend', onInitialPointerMove);
184
+ /* eslint-enable no-use-before-define */
185
+ }
186
+
187
+ /**
188
+ * If the user changes tabs, keep track of whether or not the previously focused element had .focus-visible.
189
+ *
190
+ * @param {Event} e
191
+ */
192
+ function onVisibilityChange(e) {
193
+ if (document.visibilityState === 'hidden') {
194
+ // If the tab becomes active again, the browser will handle calling focus
195
+ // on the element (Safari actually calls it twice).
196
+ // If this tab change caused a blur on an element with focus-visible,
197
+ // re-apply the class when the user switches back to the tab.
198
+ if (hadFocusVisibleRecently) {
199
+ hadKeyboardEvent = true;
200
+ }
201
+ addInitialPointerMoveListeners();
202
+ }
203
+ }
204
+
205
+ /**
206
+ * When the polyfill first loads, assume the user is in keyboard modality. If any event is received from a pointing
207
+ * device (e.g., mouse, pointer, touch), turn off keyboard modality. This accounts for situations where focus enters
208
+ * the page from the URL bar.
209
+ *
210
+ * @param {Event} e
211
+ */
212
+ function onInitialPointerMove(e) {
213
+ // Work around a Safari quirk that fires a mousemove on <html> whenever the
214
+ // window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
215
+ if (
216
+ /** @type {Element} */ (e.target).nodeName &&
217
+ /** @type {Element} */ (e.target).nodeName.toLowerCase() === 'html'
218
+ ) {
219
+ return;
220
+ }
221
+
222
+ hadKeyboardEvent = false;
223
+ removeInitialPointerMoveListeners();
224
+ }
225
+
226
+ // We are interested in changes at the global scope only for some kinds of states.
227
+ // For example, global pointer input, global key presses, and global
228
+ // visibility change should affect the state at every scope:
229
+ document.addEventListener('keydown', onKeyDown, true);
230
+ document.addEventListener('mousedown', onPointerDown, true);
231
+ document.addEventListener('pointerdown', onPointerDown, true);
232
+ document.addEventListener('touchstart', onPointerDown, true);
233
+ document.addEventListener('visibilitychange', onVisibilityChange, true);
234
+
235
+ addInitialPointerMoveListeners();
236
+
237
+ // We specifically care about state changes in the local scope for focus and blur.
238
+ // This is because focus/blur events that originate from within a
239
+ // shadow root are not re-dispatched from the host element if it was already
240
+ // the active element in its own scope:
241
+ scope.addEventListener('focus', onFocus, true);
242
+ scope.addEventListener('blur', onBlur, true);
243
+
244
+ return () => {
245
+ removeInitialPointerMoveListeners();
246
+
247
+ document.removeEventListener('keydown', onKeyDown, true);
248
+ document.removeEventListener('mousedown', onPointerDown, true);
249
+ document.removeEventListener('pointerdown', onPointerDown, true);
250
+ document.removeEventListener('touchstart', onPointerDown, true);
251
+ document.removeEventListener('visibilitychange', onVisibilityChange, true);
252
+
253
+ scope.removeEventListener('focus', onFocus, true);
254
+ scope.removeEventListener('blur', onBlur, true);
255
+ };
256
+ }
@@ -1,2 +1,2 @@
1
- export function parseCropPreset(cropPreset: import("../../../../types/exported.d.ts").ConfigType["cropPreset"]): import("../types.js").CropAspectRatio[] | undefined;
1
+ export function parseCropPreset(cropPreset: import('../../../../types/exported.d.ts').ConfigType['cropPreset']): import("../types.js").CropAspectRatio[] | undefined;
2
2
  //# sourceMappingURL=parseCropPreset.d.ts.map
@@ -2,13 +2,13 @@
2
2
  * @param {import('../types').Transformations} transformations
3
3
  * @returns {string}
4
4
  */
5
- export function transformationsToOperations(transformations: import("../types").Transformations): string;
5
+ export function transformationsToOperations(transformations: import('../types').Transformations): string;
6
6
  /**
7
7
  * @param {string[]} operations
8
8
  * @returns {import('../types.js').Transformations}
9
9
  */
10
- export function operationsToTransformations(operations: string[]): import("../types.js").Transformations;
10
+ export function operationsToTransformations(operations: string[]): import('../types.js').Transformations;
11
11
  /** @type {Record<keyof import('../types').Transformations, unknown>} */
12
- export const OPERATIONS_DEFAULTS: Record<keyof import("../types").Transformations, unknown>;
12
+ export const OPERATIONS_DEFAULTS: Record<keyof import('../types').Transformations, unknown>;
13
13
  export const COMMON_OPERATIONS: string;
14
14
  //# sourceMappingURL=transformationUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformationUtils.d.ts","sourceRoot":"","sources":["transformationUtils.js"],"names":[],"mappings":"AAsEA;;;GAGG;AACH,6DAHW,OAAO,UAAU,EAAE,eAAe,GAChC,MAAM,CAalB;AAoDD;;;GAGG;AACH,wDAHW,MAAM,EAAE,GACN,OAAO,aAAa,EAAE,eAAe,CA2BjD;AAlKD,wEAAwE;AACxE,kCADW,MAAM,CAAC,MAAM,OAAO,UAAU,EAAE,eAAe,EAAE,OAAO,CAAC,CAejE;AAoEH,uCAAqF"}
1
+ {"version":3,"file":"transformationUtils.d.ts","sourceRoot":"","sources":["transformationUtils.js"],"names":[],"mappings":"AAsEA;;;GAGG;AACH,6DAHW,OAAO,UAAU,EAAE,eAAe,GAChC,MAAM,CAalB;AAoDD;;;GAGG;AACH,wDAHW,MAAM,EAAE,GACN,OAAO,aAAa,EAAE,eAAe,CA2BjD;AAlKD,wEAAwE;AACxE,kCADW,OAAO,MAAM,OAAO,UAAU,EAAE,eAAe,EAAE,OAAO,CAAC,CAejE;AAoEH,uCAAqF"}