@design-edito/tools 0.5.17 → 0.5.18

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 (55) hide show
  1. package/agnostic/colors/index.d.ts +2 -2
  2. package/agnostic/colors/index.js +2 -2
  3. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +13 -13
  4. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +13 -13
  5. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +3 -3
  6. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
  7. package/agnostic/html/index.d.ts +2 -2
  8. package/agnostic/html/index.js +2 -2
  9. package/agnostic/index.d.ts +4 -4
  10. package/agnostic/index.js +4 -4
  11. package/agnostic/misc/index.d.ts +4 -4
  12. package/agnostic/misc/index.js +4 -4
  13. package/agnostic/numbers/index.d.ts +2 -2
  14. package/agnostic/numbers/index.js +2 -2
  15. package/agnostic/objects/index.d.ts +2 -2
  16. package/agnostic/objects/index.js +2 -2
  17. package/agnostic/optim/index.d.ts +1 -1
  18. package/agnostic/optim/index.js +1 -1
  19. package/agnostic/sanitization/index.d.ts +1 -1
  20. package/agnostic/sanitization/index.js +1 -1
  21. package/agnostic/strings/index.d.ts +2 -2
  22. package/agnostic/strings/index.js +2 -2
  23. package/agnostic/subtitles/index.d.ts +1 -1
  24. package/agnostic/subtitles/index.js +1 -1
  25. package/agnostic/time/index.d.ts +3 -3
  26. package/agnostic/time/index.js +3 -3
  27. package/components/Image/index.d.ts +6 -0
  28. package/components/Image/index.js +3 -18
  29. package/components/Video/index.controlled.d.ts +5 -22
  30. package/components/Video/index.controlled.js +28 -42
  31. package/components/Video/index.d.ts +28 -37
  32. package/components/Video/index.js +83 -88
  33. package/components/Video/types.d.ts +26 -0
  34. package/components/Video/types.js +1 -0
  35. package/components/Video/utils.d.ts +38 -1
  36. package/components/Video/utils.js +23 -4
  37. package/components/index.d.ts +5 -5
  38. package/components/index.js +5 -5
  39. package/components/utils/index.d.ts +21 -0
  40. package/components/utils/index.js +40 -0
  41. package/components/utils/viewport-behaviours/index.d.ts +54 -0
  42. package/components/utils/viewport-behaviours/index.js +163 -0
  43. package/components/utils/viewport-behaviours/types.d.ts +109 -0
  44. package/components/utils/viewport-behaviours/types.js +14 -0
  45. package/components/utils/viewport-behaviours/utils.d.ts +26 -0
  46. package/components/utils/viewport-behaviours/utils.js +55 -0
  47. package/node/@aws-s3/storage/file/index.d.ts +1 -1
  48. package/node/@aws-s3/storage/file/index.js +1 -1
  49. package/node/@google-cloud/storage/file/index.d.ts +1 -1
  50. package/node/@google-cloud/storage/file/index.js +1 -1
  51. package/node/images/index.d.ts +1 -1
  52. package/node/images/index.js +1 -1
  53. package/node/images/transform/operations/index.d.ts +2 -2
  54. package/node/images/transform/operations/index.js +2 -2
  55. package/package.json +16 -1
@@ -4,9 +4,9 @@ export * as convert from './convert/index.js'
4
4
  export * as distance from './distance/index.js'
5
5
  export * as grayscale from './grayscale/index.js'
6
6
  export * as lerp from './lerp/index.js'
7
- export * as invert from './invert/index.js'
7
+ export * as luminance from './luminance/index.js'
8
8
  export * as palette from './palette/index.js'
9
9
  export * as rotate from './rotate/index.js'
10
10
  export * as tidy from './tidy/index.js'
11
11
  export * as typechecks from './typechecks/index.js'
12
- export * as luminance from './luminance/index.js'
12
+ export * as invert from './invert/index.js'
@@ -4,9 +4,9 @@ export * as convert from './convert/index.js'
4
4
  export * as distance from './distance/index.js'
5
5
  export * as grayscale from './grayscale/index.js'
6
6
  export * as lerp from './lerp/index.js'
7
- export * as invert from './invert/index.js'
7
+ export * as luminance from './luminance/index.js'
8
8
  export * as palette from './palette/index.js'
9
9
  export * as rotate from './rotate/index.js'
10
10
  export * as tidy from './tidy/index.js'
11
11
  export * as typechecks from './typechecks/index.js'
12
- export * as luminance from './luminance/index.js'
12
+ export * as invert from './invert/index.js'
@@ -1,10 +1,10 @@
1
1
  export * as add from './add/index.js'
2
2
  export * as addclass from './addclass/index.js'
3
3
  export * as and from './and/index.js'
4
- export * as at from './at/index.js'
5
4
  export * as append from './append/index.js'
6
- export * as clone from './clone/index.js'
5
+ export * as at from './at/index.js'
7
6
  export * as call from './call/index.js'
7
+ export * as clone from './clone/index.js'
8
8
  export * as deleteproperties from './deleteproperties/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
@@ -12,41 +12,41 @@ export * as getproperties from './getproperties/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
14
  export * as hjstringify from './hjstringify/index.js'
15
- export * as initialize from './initialize/index.js'
15
+ export * as if from './if/index.js'
16
16
  export * as join from './join/index.js'
17
+ export * as initialize from './initialize/index.js'
17
18
  export * as length from './length/index.js'
18
- export * as if from './if/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
21
  export * as notrailing from './notrailing/index.js'
22
22
  export * as or from './or/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
- export * as populate from './populate/index.js'
25
24
  export * as print from './print/index.js'
25
+ export * as populate from './populate/index.js'
26
+ export * as push from './push/index.js'
26
27
  export * as pusheach from './pusheach/index.js'
27
28
  export * as recordtoarray from './recordtoarray/index.js'
29
+ export * as removeattribute from './removeattribute/index.js'
28
30
  export * as removeclass from './removeclass/index.js'
29
- export * as renameproperty from './renameproperty/index.js'
30
31
  export * as replace from './replace/index.js'
31
- export * as removeattribute from './removeattribute/index.js'
32
- export * as push from './push/index.js'
32
+ export * as renameproperty from './renameproperty/index.js'
33
33
  export * as select from './select/index.js'
34
34
  export * as set from './set/index.js'
35
35
  export * as setattribute from './setattribute/index.js'
36
36
  export * as setproperty from './setproperty/index.js'
37
37
  export * as sorton from './sorton/index.js'
38
- export * as spread from './spread/index.js'
39
38
  export * as split from './split/index.js'
39
+ export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
+ export * as toboolean from './toboolean/index.js'
41
42
  export * as toelement from './toelement/index.js'
43
+ export * as toggleclass from './toggleclass/index.js'
42
44
  export * as tonodelist from './tonodelist/index.js'
43
45
  export * as tonull from './tonull/index.js'
44
- export * as toboolean from './toboolean/index.js'
45
46
  export * as tonumber from './tonumber/index.js'
46
47
  export * as torecord from './torecord/index.js'
47
- export * as toref from './toref/index.js'
48
48
  export * as tostring from './tostring/index.js'
49
- export * as toggleclass from './toggleclass/index.js'
50
- export * as transformselected from './transformselected/index.js'
51
49
  export * as totext from './totext/index.js'
50
+ export * as transformselected from './transformselected/index.js'
52
51
  export * as trim from './trim/index.js'
52
+ export * as toref from './toref/index.js'
@@ -1,10 +1,10 @@
1
1
  export * as add from './add/index.js'
2
2
  export * as addclass from './addclass/index.js'
3
3
  export * as and from './and/index.js'
4
- export * as at from './at/index.js'
5
4
  export * as append from './append/index.js'
6
- export * as clone from './clone/index.js'
5
+ export * as at from './at/index.js'
7
6
  export * as call from './call/index.js'
7
+ export * as clone from './clone/index.js'
8
8
  export * as deleteproperties from './deleteproperties/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
@@ -12,41 +12,41 @@ export * as getproperties from './getproperties/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
14
  export * as hjstringify from './hjstringify/index.js'
15
- export * as initialize from './initialize/index.js'
15
+ export * as if from './if/index.js'
16
16
  export * as join from './join/index.js'
17
+ export * as initialize from './initialize/index.js'
17
18
  export * as length from './length/index.js'
18
- export * as if from './if/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
21
  export * as notrailing from './notrailing/index.js'
22
22
  export * as or from './or/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
- export * as populate from './populate/index.js'
25
24
  export * as print from './print/index.js'
25
+ export * as populate from './populate/index.js'
26
+ export * as push from './push/index.js'
26
27
  export * as pusheach from './pusheach/index.js'
27
28
  export * as recordtoarray from './recordtoarray/index.js'
29
+ export * as removeattribute from './removeattribute/index.js'
28
30
  export * as removeclass from './removeclass/index.js'
29
- export * as renameproperty from './renameproperty/index.js'
30
31
  export * as replace from './replace/index.js'
31
- export * as removeattribute from './removeattribute/index.js'
32
- export * as push from './push/index.js'
32
+ export * as renameproperty from './renameproperty/index.js'
33
33
  export * as select from './select/index.js'
34
34
  export * as set from './set/index.js'
35
35
  export * as setattribute from './setattribute/index.js'
36
36
  export * as setproperty from './setproperty/index.js'
37
37
  export * as sorton from './sorton/index.js'
38
- export * as spread from './spread/index.js'
39
38
  export * as split from './split/index.js'
39
+ export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
+ export * as toboolean from './toboolean/index.js'
41
42
  export * as toelement from './toelement/index.js'
43
+ export * as toggleclass from './toggleclass/index.js'
42
44
  export * as tonodelist from './tonodelist/index.js'
43
45
  export * as tonull from './tonull/index.js'
44
- export * as toboolean from './toboolean/index.js'
45
46
  export * as tonumber from './tonumber/index.js'
46
47
  export * as torecord from './torecord/index.js'
47
- export * as toref from './toref/index.js'
48
48
  export * as tostring from './tostring/index.js'
49
- export * as toggleclass from './toggleclass/index.js'
50
- export * as transformselected from './transformselected/index.js'
51
49
  export * as totext from './totext/index.js'
50
+ export * as transformselected from './transformselected/index.js'
52
51
  export * as trim from './trim/index.js'
52
+ export * as toref from './toref/index.js'
@@ -2,12 +2,12 @@ export * as any from './any/index.js'
2
2
  export * as array from './array/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as guess from './guess/index.js'
6
- export * as nodelist from './nodelist/index.js'
7
5
  export * as get from './get/index.js'
6
+ export * as nodelist from './nodelist/index.js'
8
7
  export * as null from './null/index.js'
8
+ export * as number from './number/index.js'
9
+ export * as guess from './guess/index.js'
9
10
  export * as record from './record/index.js'
10
11
  export * as string from './string/index.js'
11
12
  export * as text from './text/index.js'
12
13
  export * as ref from './ref/index.js'
13
- export * as number from './number/index.js'
@@ -2,12 +2,12 @@ export * as any from './any/index.js'
2
2
  export * as array from './array/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as guess from './guess/index.js'
6
- export * as nodelist from './nodelist/index.js'
7
5
  export * as get from './get/index.js'
6
+ export * as nodelist from './nodelist/index.js'
8
7
  export * as null from './null/index.js'
8
+ export * as number from './number/index.js'
9
+ export * as guess from './guess/index.js'
9
10
  export * as record from './record/index.js'
10
11
  export * as string from './string/index.js'
11
12
  export * as text from './text/index.js'
12
13
  export * as ref from './ref/index.js'
13
- export * as number from './number/index.js'
@@ -1,10 +1,10 @@
1
1
  export * as deepSelect from './deep-select/index.js'
2
2
  export * as getNodeAncestors from './get-node-ancestors/index.js'
3
+ export * as hyperJson from './hyper-json/index.js'
3
4
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
- export * as placeholders from './placeholders/index.js'
5
5
  export * as insertNode from './insert-node/index.js'
6
+ export * as placeholders from './placeholders/index.js'
6
7
  export * as replaceInElement from './replace-in-element/index.js'
7
8
  export * as selectorToElement from './selector-to-element/index.js'
8
9
  export * as stringToNodes from './string-to-nodes/index.js'
9
10
  export * as watchSelection from './watch-selection/index.js'
10
- export * as hyperJson from './hyper-json/index.js'
@@ -1,10 +1,10 @@
1
1
  export * as deepSelect from './deep-select/index.js'
2
2
  export * as getNodeAncestors from './get-node-ancestors/index.js'
3
+ export * as hyperJson from './hyper-json/index.js'
3
4
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
- export * as placeholders from './placeholders/index.js'
5
5
  export * as insertNode from './insert-node/index.js'
6
+ export * as placeholders from './placeholders/index.js'
6
7
  export * as replaceInElement from './replace-in-element/index.js'
7
8
  export * as selectorToElement from './selector-to-element/index.js'
8
9
  export * as stringToNodes from './string-to-nodes/index.js'
9
10
  export * as watchSelection from './watch-selection/index.js'
10
- export * as hyperJson from './hyper-json/index.js'
@@ -1,17 +1,17 @@
1
1
  export * as arrays from './arrays/index.js'
2
2
  export * as booleans from './booleans/index.js'
3
3
  export * as colors from './colors/index.js'
4
- export * as css from './css/index.js'
5
4
  export * as errors from './errors/index.js'
6
5
  export * as html from './html/index.js'
6
+ export * as css from './css/index.js'
7
7
  export * as misc from './misc/index.js'
8
- export * as objects from './objects/index.js'
9
- export * as optim from './optim/index.js'
10
8
  export * as numbers from './numbers/index.js'
9
+ export * as optim from './optim/index.js'
10
+ export * as objects from './objects/index.js'
11
11
  export * as random from './random/index.js'
12
- export * as regexps from './regexps/index.js'
13
12
  export * as sanitization from './sanitization/index.js'
14
13
  export * as strings from './strings/index.js'
14
+ export * as regexps from './regexps/index.js'
15
15
  export * as subtitles from './subtitles/index.js'
16
16
  export * as time from './time/index.js'
17
17
  export * as typescript from './typescript/index.js'
package/agnostic/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  export * as arrays from './arrays/index.js'
2
2
  export * as booleans from './booleans/index.js'
3
3
  export * as colors from './colors/index.js'
4
- export * as css from './css/index.js'
5
4
  export * as errors from './errors/index.js'
6
5
  export * as html from './html/index.js'
6
+ export * as css from './css/index.js'
7
7
  export * as misc from './misc/index.js'
8
- export * as objects from './objects/index.js'
9
- export * as optim from './optim/index.js'
10
8
  export * as numbers from './numbers/index.js'
9
+ export * as optim from './optim/index.js'
10
+ export * as objects from './objects/index.js'
11
11
  export * as random from './random/index.js'
12
- export * as regexps from './regexps/index.js'
13
12
  export * as sanitization from './sanitization/index.js'
14
13
  export * as strings from './strings/index.js'
14
+ export * as regexps from './regexps/index.js'
15
15
  export * as subtitles from './subtitles/index.js'
16
16
  export * as time from './time/index.js'
17
17
  export * as typescript from './typescript/index.js'
@@ -1,12 +1,12 @@
1
- export * as assert from './assert/index.js'
2
1
  export * as cast from './cast/index.js'
3
- export * as connection from './connection/index.js'
2
+ export * as assert from './assert/index.js'
4
3
  export * as crawler from './crawler/index.js'
4
+ export * as connection from './connection/index.js'
5
5
  export * as crossenv from './crossenv/index.js'
6
+ export * as dataSize from './data-size/index.js'
7
+ export * as isNullish from './is-nullish/index.js'
6
8
  export * as isConstructorFunction from './is-constructor-function/index.js'
7
9
  export * as logs from './logs/index.js'
8
10
  export * as loremIpsum from './lorem-ipsum/index.js'
9
11
  export * as normalizeExtension from './normalize-extension/index.js'
10
12
  export * as outcome from './outcome/index.js'
11
- export * as dataSize from './data-size/index.js'
12
- export * as isNullish from './is-nullish/index.js'
@@ -1,12 +1,12 @@
1
- export * as assert from './assert/index.js'
2
1
  export * as cast from './cast/index.js'
3
- export * as connection from './connection/index.js'
2
+ export * as assert from './assert/index.js'
4
3
  export * as crawler from './crawler/index.js'
4
+ export * as connection from './connection/index.js'
5
5
  export * as crossenv from './crossenv/index.js'
6
+ export * as dataSize from './data-size/index.js'
7
+ export * as isNullish from './is-nullish/index.js'
6
8
  export * as isConstructorFunction from './is-constructor-function/index.js'
7
9
  export * as logs from './logs/index.js'
8
10
  export * as loremIpsum from './lorem-ipsum/index.js'
9
11
  export * as normalizeExtension from './normalize-extension/index.js'
10
12
  export * as outcome from './outcome/index.js'
11
- export * as dataSize from './data-size/index.js'
12
- export * as isNullish from './is-nullish/index.js'
@@ -1,6 +1,6 @@
1
- export * as clamp from './clamp/index.js'
2
1
  export * as absoluteModulo from './absolute-modulo/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
2
+ export * as clamp from './clamp/index.js'
4
3
  export * as approximateRational from './approximate-rational/index.js'
4
+ export * as geometricProgressions from './geometric-progressions/index.js'
5
5
  export * as round from './round/index.js'
6
6
  export * as interpolate from './interpolate/index.js'
@@ -1,6 +1,6 @@
1
- export * as clamp from './clamp/index.js'
2
1
  export * as absoluteModulo from './absolute-modulo/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
2
+ export * as clamp from './clamp/index.js'
4
3
  export * as approximateRational from './approximate-rational/index.js'
4
+ export * as geometricProgressions from './geometric-progressions/index.js'
5
5
  export * as round from './round/index.js'
6
6
  export * as interpolate from './interpolate/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
2
  export * as enums from './enums/index.js'
3
3
  export * as flattenGetters from './flatten-getters/index.js'
4
+ export * as isObject from './is-object/index.js'
4
5
  export * as isRecord from './is-record/index.js'
5
6
  export * as recordFormat from './record-format/index.js'
6
- export * as isObject from './is-object/index.js'
7
7
  export * as sortKeys from './sort-keys/index.js'
8
- export * as validation from './validation/index.js'
9
8
  export * as recordMap from './record-map/index.js'
9
+ export * as validation from './validation/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
2
  export * as enums from './enums/index.js'
3
3
  export * as flattenGetters from './flatten-getters/index.js'
4
+ export * as isObject from './is-object/index.js'
4
5
  export * as isRecord from './is-record/index.js'
5
6
  export * as recordFormat from './record-format/index.js'
6
- export * as isObject from './is-object/index.js'
7
7
  export * as sortKeys from './sort-keys/index.js'
8
- export * as validation from './validation/index.js'
9
8
  export * as recordMap from './record-map/index.js'
9
+ export * as validation from './validation/index.js'
@@ -1,2 +1,2 @@
1
- export * as throttleDebounce from './throttle-debounce/index.js'
2
1
  export * as memoize from './memoize/index.js'
2
+ export * as throttleDebounce from './throttle-debounce/index.js'
@@ -1,2 +1,2 @@
1
- export * as throttleDebounce from './throttle-debounce/index.js'
2
1
  export * as memoize from './memoize/index.js'
2
+ export * as throttleDebounce from './throttle-debounce/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as fileName from './file-name/index.js'
2
- export * as html from './html/index.js'
3
2
  export * as path from './path/index.js'
4
3
  export * as userInput from './user-input/index.js'
4
+ export * as html from './html/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as fileName from './file-name/index.js'
2
- export * as html from './html/index.js'
3
2
  export * as path from './path/index.js'
4
3
  export * as userInput from './user-input/index.js'
4
+ export * as html from './html/index.js'
@@ -1,8 +1,8 @@
1
+ export * as charCodes from './char-codes/index.js'
1
2
  export * as matches from './matches/index.js'
2
3
  export * as normalizeIndent from './normalize-indent/index.js'
3
4
  export * as parseTable from './parse-table/index.js'
4
- export * as splitTrim from './split-trim/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
- export * as charCodes from './char-codes/index.js'
6
+ export * as splitTrim from './split-trim/index.js'
7
7
  export * as toAlphanum from './to-alphanum/index.js'
8
8
  export * as trim from './trim/index.js'
@@ -1,8 +1,8 @@
1
+ export * as charCodes from './char-codes/index.js'
1
2
  export * as matches from './matches/index.js'
2
3
  export * as normalizeIndent from './normalize-indent/index.js'
3
4
  export * as parseTable from './parse-table/index.js'
4
- export * as splitTrim from './split-trim/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
- export * as charCodes from './char-codes/index.js'
6
+ export * as splitTrim from './split-trim/index.js'
7
7
  export * as toAlphanum from './to-alphanum/index.js'
8
8
  export * as trim from './trim/index.js'
@@ -1,2 +1,2 @@
1
- export * as parseSrt from './parse-srt/index.js'
2
1
  export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
2
+ export * as parseSrt from './parse-srt/index.js'
@@ -1,2 +1,2 @@
1
- export * as parseSrt from './parse-srt/index.js'
2
1
  export * as srtTimecodeToMs from './srt-timecode-to-ms/index.js'
2
+ export * as parseSrt from './parse-srt/index.js'
@@ -1,5 +1,5 @@
1
- export * as duration from './duration/index.js'
2
- export * as dates from './dates/index.js'
3
1
  export * as timeout from './timeout/index.js'
4
- export * as wait from './wait/index.js'
5
2
  export * as transitions from './transitions/index.js'
3
+ export * as wait from './wait/index.js'
4
+ export * as dates from './dates/index.js'
5
+ export * as duration from './duration/index.js'
@@ -1,5 +1,5 @@
1
- export * as duration from './duration/index.js'
2
- export * as dates from './dates/index.js'
3
1
  export * as timeout from './timeout/index.js'
4
- export * as wait from './wait/index.js'
5
2
  export * as transitions from './transitions/index.js'
3
+ export * as wait from './wait/index.js'
4
+ export * as dates from './dates/index.js'
5
+ export * as duration from './duration/index.js'
@@ -7,6 +7,12 @@ import type { WithClassName } from '../utils/types.js';
7
7
  * @property type - MIME type hint for the source (e.g. `'image/webp'`).
8
8
  * @property media - Media condition under which this source is selected (e.g. `'(max-width: 768px)'`).
9
9
  * @property sizes - Sizes attribute forwarded to the `<source>` element.
10
+ *
11
+ * **A picture source is not a video source.** `Video` keeps a shape of its own: a
12
+ * `<source>` inside a `<video>` carries `src` and nothing else useful, where this one
13
+ * carries `srcSet`, `media` and `sizes`, and neither element accepts the other's
14
+ * attributes. What the two do share is how a list of them is read — see
15
+ * `parseSourceList` in `components/utils`, whose `stringKey` is exactly that difference.
10
16
  */
11
17
  type SourceData = {
12
18
  srcSet?: string;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { clss } from '../../agnostic/css/clss/index.js';
4
- import { mergeClassNames } from '../utils/index.js';
4
+ import { mergeClassNames, parseSourceList } from '../utils/index.js';
5
5
  import { image as publicClassName } from '../public-classnames.js';
6
6
  import cssModule from './styles.module.css';
7
7
  /**
@@ -19,27 +19,12 @@ import cssModule from './styles.module.css';
19
19
  */
20
20
  export const Image = ({ sources, className, ...intrinsicImgAttributes }) => {
21
21
  // State
22
- const parsedSources = useMemo(() => {
23
- if (sources === undefined)
24
- return [];
25
- if (typeof sources === 'string')
26
- return [{ srcSet: sources }];
27
- if (Array.isArray(sources)) {
28
- if (sources.length === 0)
29
- return [];
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- first element sampled just above; array is expected to be homogeneous
31
- if (typeof sources[0] === 'string')
32
- return sources.map(srcSet => ({ srcSet }));
33
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- first element was checked not to be a string just above; array is expected to be homogeneous
34
- return sources;
35
- }
36
- return [];
37
- }, [sources]);
22
+ const parsedSources = useMemo(() => parseSourceList(sources, 'srcSet'), [sources]);
38
23
  // Rendering
39
24
  const c = clss(publicClassName, { cssModule });
40
25
  const rootClss = mergeClassNames(c(), className);
41
26
  const pictureClss = c('picture');
42
27
  const imgClss = c('image');
43
- const pictureContent = _jsxs("picture", { className: pictureClss, children: [parsedSources.map((source, index) => _jsx("source", { srcSet: typeof source === 'string' ? source : source.srcSet, type: typeof source === 'string' ? undefined : source.type, media: typeof source === 'string' ? undefined : source.media, sizes: typeof source === 'string' ? undefined : source.sizes }, index)), _jsx("img", { className: imgClss, ...intrinsicImgAttributes })] });
28
+ const pictureContent = _jsxs("picture", { className: pictureClss, children: [parsedSources.map((source, index) => _jsx("source", { srcSet: source.srcSet, type: source.type, media: source.media, sizes: source.sizes }, index)), _jsx("img", { className: imgClss, ...intrinsicImgAttributes })] });
44
29
  return _jsx("figure", { className: rootClss, children: pictureContent });
45
30
  };
@@ -1,32 +1,13 @@
1
- import { type FunctionComponent, type PropsWithChildren, type Ref, type VideoHTMLAttributes } from 'react';
1
+ import { type FunctionComponent, type PropsWithChildren, type Ref, type RefObject, type VideoHTMLAttributes } from 'react';
2
2
  import type { WithClassName } from '../utils/types.js';
3
3
  import { type Props as SubsProps } from '../Subtitles/index.js';
4
+ import { type SourceData, type TrackData } from './utils.js';
4
5
  /**
5
6
  * Describes a single video source.
6
7
  *
7
8
  * @property src - URL of the video file.
8
9
  * @property type - MIME type of the source (e.g. `'video/mp4'`).
9
10
  */
10
- type SourceData = {
11
- src?: string;
12
- type?: string;
13
- };
14
- /**
15
- * Describes a single text track (subtitles, captions, chapters, etc.).
16
- *
17
- * @property src - URL of the track file.
18
- * @property kind - Track type, maps directly to the `<track>` `kind` attribute.
19
- * @property srclang - Language of the track content (e.g. `'fr'`, `'en'`).
20
- * @property label - Human-readable label shown in the browser's track selector.
21
- * @property default - When `true`, marks this track as the default selection.
22
- */
23
- type TrackData = {
24
- src?: string;
25
- kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
26
- srclang?: string;
27
- label?: string;
28
- default?: boolean;
29
- };
30
11
  /**
31
12
  * Props for the ControlledVideo component.
32
13
  *
@@ -114,6 +95,8 @@ type TrackData = {
114
95
  */
115
96
  export type Props = PropsWithChildren<WithClassName<{
116
97
  rootRef?: Ref<HTMLElement>;
98
+ videoRef?: RefObject<HTMLVideoElement | null>;
99
+ togglePlayOnClick?: boolean;
117
100
  sources?: string | string[] | SourceData[];
118
101
  tracks?: string | string[] | TrackData[];
119
102
  subtitles?: SubsProps;
@@ -140,6 +123,7 @@ export type Props = PropsWithChildren<WithClassName<{
140
123
  onFullscreenButtonClicked?: (e: React.MouseEvent<HTMLButtonElement>, isFullscreen: boolean, video: HTMLVideoElement | null) => void;
141
124
  onSubtitlesButtonClicked?: (e: React.MouseEvent<HTMLButtonElement>, isSubtitlesOn: boolean, video: HTMLVideoElement | null) => void;
142
125
  onTimelineClicked?: (e: React.MouseEvent<HTMLDivElement>, targetTime: number, currentTime: number, video: HTMLVideoElement | null) => void;
126
+ onVideoClicked?: (e: React.MouseEvent<HTMLVideoElement>, isPlaying: boolean, video: HTMLVideoElement | null) => void;
143
127
  onIsPlayingChanged?: (isPlaying: boolean) => void;
144
128
  onIsFullscreenChanged?: (isFullscreen: boolean) => void;
145
129
  onIsLoudChanged?: (isLoud: boolean) => void;
@@ -194,4 +178,3 @@ export type Props = PropsWithChildren<WithClassName<{
194
178
  * subtitles.
195
179
  */
196
180
  export declare const ControlledVideo: FunctionComponent<Props>;
197
- export {};