@design-edito/tools 0.5.11 → 0.5.12

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 (43) hide show
  1. package/agnostic/colors/index.d.ts +1 -1
  2. package/agnostic/colors/index.js +1 -1
  3. package/agnostic/css/index.d.ts +1 -1
  4. package/agnostic/css/index.js +1 -1
  5. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +12 -12
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +12 -12
  7. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +4 -4
  8. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +4 -4
  9. package/agnostic/html/index.d.ts +2 -2
  10. package/agnostic/html/index.js +2 -2
  11. package/agnostic/index.d.ts +3 -3
  12. package/agnostic/index.js +3 -3
  13. package/agnostic/misc/index.d.ts +3 -3
  14. package/agnostic/misc/index.js +3 -3
  15. package/agnostic/misc/logs/index.d.ts +1 -1
  16. package/agnostic/misc/logs/index.js +1 -1
  17. package/agnostic/numbers/index.d.ts +2 -2
  18. package/agnostic/numbers/index.js +2 -2
  19. package/agnostic/objects/index.d.ts +1 -1
  20. package/agnostic/objects/index.js +1 -1
  21. package/agnostic/optim/index.d.ts +1 -1
  22. package/agnostic/optim/index.js +1 -1
  23. package/agnostic/strings/index.d.ts +1 -1
  24. package/agnostic/strings/index.js +1 -1
  25. package/agnostic/time/index.d.ts +2 -2
  26. package/agnostic/time/index.js +2 -2
  27. package/components/Lightbox/index.d.ts +25 -9
  28. package/components/Lightbox/index.js +30 -14
  29. package/components/index.d.ts +2 -2
  30. package/components/index.js +2 -2
  31. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  32. package/node/@google-cloud/storage/directory/index.js +1 -1
  33. package/node/cloud-storage/operations/index.d.ts +1 -1
  34. package/node/cloud-storage/operations/index.js +1 -1
  35. package/node/ftps/directory/index.d.ts +1 -1
  36. package/node/ftps/directory/index.js +1 -1
  37. package/node/index.d.ts +1 -1
  38. package/node/index.js +1 -1
  39. package/node/sftp/file/index.d.ts +1 -1
  40. package/node/sftp/file/index.js +1 -1
  41. package/node/sftp/index.d.ts +1 -1
  42. package/node/sftp/index.js +1 -1
  43. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  export * as channels from './channels/index.js'
2
- export * as convert from './convert/index.js'
3
2
  export * as contrast from './contrast/index.js'
3
+ 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 invert from './invert/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as channels from './channels/index.js'
2
- export * as convert from './convert/index.js'
3
2
  export * as contrast from './contrast/index.js'
3
+ 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 invert from './invert/index.js'
@@ -2,5 +2,5 @@ export * as bem from './bem/index.js'
2
2
  export * as clss from './clss/index.js'
3
3
  export * as generateNiceColor from './generate-nice-color/index.js'
4
4
  export * as isValidCssClassName from './is-valid-css-class-name/index.js'
5
- export * as stylesSet from './styles-set/index.js'
6
5
  export * as scale from './scale/index.js'
6
+ export * as stylesSet from './styles-set/index.js'
@@ -2,5 +2,5 @@ export * as bem from './bem/index.js'
2
2
  export * as clss from './clss/index.js'
3
3
  export * as generateNiceColor from './generate-nice-color/index.js'
4
4
  export * as isValidCssClassName from './is-valid-css-class-name/index.js'
5
- export * as stylesSet from './styles-set/index.js'
6
5
  export * as scale from './scale/index.js'
6
+ export * as stylesSet from './styles-set/index.js'
@@ -1,25 +1,25 @@
1
1
  export * as add from './add/index.js'
2
- export * as addclass from './addclass/index.js'
3
2
  export * as and from './and/index.js'
3
+ export * as addclass from './addclass/index.js'
4
4
  export * as append from './append/index.js'
5
5
  export * as at from './at/index.js'
6
6
  export * as clone from './clone/index.js'
7
7
  export * as call from './call/index.js'
8
8
  export * as deleteproperties from './deleteproperties/index.js'
9
9
  export * as equals from './equals/index.js'
10
- export * as getattribute from './getattribute/index.js'
11
10
  export * as getproperties from './getproperties/index.js'
11
+ export * as getattribute from './getattribute/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
- export * as if from './if/index.js'
15
14
  export * as hjstringify from './hjstringify/index.js'
16
- export * as initialize from './initialize/index.js'
15
+ export * as if from './if/index.js'
17
16
  export * as join from './join/index.js'
18
17
  export * as length from './length/index.js'
18
+ export * as initialize from './initialize/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
- export * as or from './or/index.js'
22
21
  export * as notrailing from './notrailing/index.js'
22
+ export * as or from './or/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
24
  export * as populate from './populate/index.js'
25
25
  export * as print from './print/index.js'
@@ -28,25 +28,25 @@ export * as pusheach from './pusheach/index.js'
28
28
  export * as recordtoarray from './recordtoarray/index.js'
29
29
  export * as removeattribute from './removeattribute/index.js'
30
30
  export * as removeclass from './removeclass/index.js'
31
- export * as replace from './replace/index.js'
32
31
  export * as renameproperty from './renameproperty/index.js'
33
- export * as set from './set/index.js'
34
- export * as setattribute from './setattribute/index.js'
32
+ export * as replace from './replace/index.js'
35
33
  export * as select from './select/index.js'
34
+ export * as set from './set/index.js'
36
35
  export * as setproperty from './setproperty/index.js'
37
- export * as sorton from './sorton/index.js'
36
+ export * as setattribute from './setattribute/index.js'
38
37
  export * as split from './split/index.js'
38
+ export * as sorton from './sorton/index.js'
39
39
  export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
41
  export * as toboolean from './toboolean/index.js'
42
42
  export * as toelement from './toelement/index.js'
43
43
  export * as toggleclass from './toggleclass/index.js'
44
- export * as tonodelist from './tonodelist/index.js'
45
- export * as tonumber from './tonumber/index.js'
46
44
  export * as tonull from './tonull/index.js'
47
- export * as torecord from './torecord/index.js'
45
+ export * as tonumber from './tonumber/index.js'
46
+ export * as tonodelist from './tonodelist/index.js'
48
47
  export * as toref from './toref/index.js'
49
48
  export * as tostring from './tostring/index.js'
50
49
  export * as totext from './totext/index.js'
51
50
  export * as transformselected from './transformselected/index.js'
52
51
  export * as trim from './trim/index.js'
52
+ export * as torecord from './torecord/index.js'
@@ -1,25 +1,25 @@
1
1
  export * as add from './add/index.js'
2
- export * as addclass from './addclass/index.js'
3
2
  export * as and from './and/index.js'
3
+ export * as addclass from './addclass/index.js'
4
4
  export * as append from './append/index.js'
5
5
  export * as at from './at/index.js'
6
6
  export * as clone from './clone/index.js'
7
7
  export * as call from './call/index.js'
8
8
  export * as deleteproperties from './deleteproperties/index.js'
9
9
  export * as equals from './equals/index.js'
10
- export * as getattribute from './getattribute/index.js'
11
10
  export * as getproperties from './getproperties/index.js'
11
+ export * as getattribute from './getattribute/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
- export * as if from './if/index.js'
15
14
  export * as hjstringify from './hjstringify/index.js'
16
- export * as initialize from './initialize/index.js'
15
+ export * as if from './if/index.js'
17
16
  export * as join from './join/index.js'
18
17
  export * as length from './length/index.js'
18
+ export * as initialize from './initialize/index.js'
19
19
  export * as map from './map/index.js'
20
20
  export * as negate from './negate/index.js'
21
- export * as or from './or/index.js'
22
21
  export * as notrailing from './notrailing/index.js'
22
+ export * as or from './or/index.js'
23
23
  export * as pickrandom from './pickrandom/index.js'
24
24
  export * as populate from './populate/index.js'
25
25
  export * as print from './print/index.js'
@@ -28,25 +28,25 @@ export * as pusheach from './pusheach/index.js'
28
28
  export * as recordtoarray from './recordtoarray/index.js'
29
29
  export * as removeattribute from './removeattribute/index.js'
30
30
  export * as removeclass from './removeclass/index.js'
31
- export * as replace from './replace/index.js'
32
31
  export * as renameproperty from './renameproperty/index.js'
33
- export * as set from './set/index.js'
34
- export * as setattribute from './setattribute/index.js'
32
+ export * as replace from './replace/index.js'
35
33
  export * as select from './select/index.js'
34
+ export * as set from './set/index.js'
36
35
  export * as setproperty from './setproperty/index.js'
37
- export * as sorton from './sorton/index.js'
36
+ export * as setattribute from './setattribute/index.js'
38
37
  export * as split from './split/index.js'
38
+ export * as sorton from './sorton/index.js'
39
39
  export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
41
  export * as toboolean from './toboolean/index.js'
42
42
  export * as toelement from './toelement/index.js'
43
43
  export * as toggleclass from './toggleclass/index.js'
44
- export * as tonodelist from './tonodelist/index.js'
45
- export * as tonumber from './tonumber/index.js'
46
44
  export * as tonull from './tonull/index.js'
47
- export * as torecord from './torecord/index.js'
45
+ export * as tonumber from './tonumber/index.js'
46
+ export * as tonodelist from './tonodelist/index.js'
48
47
  export * as toref from './toref/index.js'
49
48
  export * as tostring from './tostring/index.js'
50
49
  export * as totext from './totext/index.js'
51
50
  export * as transformselected from './transformselected/index.js'
52
51
  export * as trim from './trim/index.js'
52
+ export * as torecord from './torecord/index.js'
@@ -1,13 +1,13 @@
1
1
  export * as any from './any/index.js'
2
- export * as array from './array/index.js'
3
2
  export * as boolean from './boolean/index.js'
3
+ export * as array from './array/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as get from './get/index.js'
6
5
  export * as guess from './guess/index.js'
6
+ export * as get from './get/index.js'
7
7
  export * as nodelist from './nodelist/index.js'
8
8
  export * as null from './null/index.js'
9
9
  export * as record from './record/index.js'
10
- export * as ref from './ref/index.js'
11
- export * as number from './number/index.js'
12
10
  export * as string from './string/index.js'
13
11
  export * as text from './text/index.js'
12
+ export * as ref from './ref/index.js'
13
+ export * as number from './number/index.js'
@@ -1,13 +1,13 @@
1
1
  export * as any from './any/index.js'
2
- export * as array from './array/index.js'
3
2
  export * as boolean from './boolean/index.js'
3
+ export * as array from './array/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as get from './get/index.js'
6
5
  export * as guess from './guess/index.js'
6
+ export * as get from './get/index.js'
7
7
  export * as nodelist from './nodelist/index.js'
8
8
  export * as null from './null/index.js'
9
9
  export * as record from './record/index.js'
10
- export * as ref from './ref/index.js'
11
- export * as number from './number/index.js'
12
10
  export * as string from './string/index.js'
13
11
  export * as text from './text/index.js'
12
+ 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
- export * as getNodeAncestors from './get-node-ancestors/index.js'
3
2
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
3
  export * as hyperJson from './hyper-json/index.js'
4
+ export * as getNodeAncestors from './get-node-ancestors/index.js'
5
5
  export * as insertNode from './insert-node/index.js'
6
6
  export * as replaceInElement from './replace-in-element/index.js'
7
+ export * as placeholders from './placeholders/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 placeholders from './placeholders/index.js'
@@ -1,10 +1,10 @@
1
1
  export * as deepSelect from './deep-select/index.js'
2
- export * as getNodeAncestors from './get-node-ancestors/index.js'
3
2
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
4
3
  export * as hyperJson from './hyper-json/index.js'
4
+ export * as getNodeAncestors from './get-node-ancestors/index.js'
5
5
  export * as insertNode from './insert-node/index.js'
6
6
  export * as replaceInElement from './replace-in-element/index.js'
7
+ export * as placeholders from './placeholders/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 placeholders from './placeholders/index.js'
@@ -4,14 +4,14 @@ export * as colors from './colors/index.js'
4
4
  export * as css from './css/index.js'
5
5
  export * as errors from './errors/index.js'
6
6
  export * as html from './html/index.js'
7
- export * as misc from './misc/index.js'
8
7
  export * as numbers from './numbers/index.js'
9
8
  export * as objects from './objects/index.js'
9
+ export * as misc from './misc/index.js'
10
10
  export * as optim from './optim/index.js'
11
+ export * as random from './random/index.js'
11
12
  export * as regexps from './regexps/index.js'
12
13
  export * as sanitization from './sanitization/index.js'
13
14
  export * as strings from './strings/index.js'
14
- export * as random from './random/index.js'
15
+ export * as subtitles from './subtitles/index.js'
15
16
  export * as time from './time/index.js'
16
17
  export * as typescript from './typescript/index.js'
17
- export * as subtitles from './subtitles/index.js'
package/agnostic/index.js CHANGED
@@ -4,14 +4,14 @@ export * as colors from './colors/index.js'
4
4
  export * as css from './css/index.js'
5
5
  export * as errors from './errors/index.js'
6
6
  export * as html from './html/index.js'
7
- export * as misc from './misc/index.js'
8
7
  export * as numbers from './numbers/index.js'
9
8
  export * as objects from './objects/index.js'
9
+ export * as misc from './misc/index.js'
10
10
  export * as optim from './optim/index.js'
11
+ export * as random from './random/index.js'
11
12
  export * as regexps from './regexps/index.js'
12
13
  export * as sanitization from './sanitization/index.js'
13
14
  export * as strings from './strings/index.js'
14
- export * as random from './random/index.js'
15
+ export * as subtitles from './subtitles/index.js'
15
16
  export * as time from './time/index.js'
16
17
  export * as typescript from './typescript/index.js'
17
- export * as subtitles from './subtitles/index.js'
@@ -1,12 +1,12 @@
1
- export * as cast from './cast/index.js'
2
1
  export * as assert from './assert/index.js'
2
+ export * as cast from './cast/index.js'
3
3
  export * as connection from './connection/index.js'
4
4
  export * as crawler from './crawler/index.js'
5
5
  export * as crossenv from './crossenv/index.js'
6
- export * as isConstructorFunction from './is-constructor-function/index.js'
7
6
  export * as dataSize from './data-size/index.js'
7
+ export * as isConstructorFunction from './is-constructor-function/index.js'
8
8
  export * as isNullish from './is-nullish/index.js'
9
9
  export * as logs from './logs/index.js'
10
10
  export * as loremIpsum from './lorem-ipsum/index.js'
11
- export * as outcome from './outcome/index.js'
12
11
  export * as normalizeExtension from './normalize-extension/index.js'
12
+ export * as outcome from './outcome/index.js'
@@ -1,12 +1,12 @@
1
- export * as cast from './cast/index.js'
2
1
  export * as assert from './assert/index.js'
2
+ export * as cast from './cast/index.js'
3
3
  export * as connection from './connection/index.js'
4
4
  export * as crawler from './crawler/index.js'
5
5
  export * as crossenv from './crossenv/index.js'
6
- export * as isConstructorFunction from './is-constructor-function/index.js'
7
6
  export * as dataSize from './data-size/index.js'
7
+ export * as isConstructorFunction from './is-constructor-function/index.js'
8
8
  export * as isNullish from './is-nullish/index.js'
9
9
  export * as logs from './logs/index.js'
10
10
  export * as loremIpsum from './lorem-ipsum/index.js'
11
- export * as outcome from './outcome/index.js'
12
11
  export * as normalizeExtension from './normalize-extension/index.js'
12
+ export * as outcome from './outcome/index.js'
@@ -1,3 +1,3 @@
1
- export * as makeTextBlock from './make-text-block/index.js'
2
1
  export * as logger from './logger/index.js'
3
2
  export * as styles from './styles/index.js'
3
+ export * as makeTextBlock from './make-text-block/index.js'
@@ -1,3 +1,3 @@
1
- export * as makeTextBlock from './make-text-block/index.js'
2
1
  export * as logger from './logger/index.js'
3
2
  export * as styles from './styles/index.js'
3
+ export * as makeTextBlock from './make-text-block/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as absoluteModulo from './absolute-modulo/index.js'
2
2
  export * as approximateRational from './approximate-rational/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
4
- export * as interpolate from './interpolate/index.js'
5
3
  export * as clamp from './clamp/index.js'
4
+ export * as interpolate from './interpolate/index.js'
5
+ export * as geometricProgressions from './geometric-progressions/index.js'
6
6
  export * as round from './round/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as absoluteModulo from './absolute-modulo/index.js'
2
2
  export * as approximateRational from './approximate-rational/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
4
- export * as interpolate from './interpolate/index.js'
5
3
  export * as clamp from './clamp/index.js'
4
+ export * as interpolate from './interpolate/index.js'
5
+ export * as geometricProgressions from './geometric-progressions/index.js'
6
6
  export * as round from './round/index.js'
@@ -4,6 +4,6 @@ export * as flattenGetters from './flatten-getters/index.js'
4
4
  export * as isObject from './is-object/index.js'
5
5
  export * as isRecord from './is-record/index.js'
6
6
  export * as recordFormat from './record-format/index.js'
7
- export * as sortKeys from './sort-keys/index.js'
8
7
  export * as recordMap from './record-map/index.js'
8
+ export * as sortKeys from './sort-keys/index.js'
9
9
  export * as validation from './validation/index.js'
@@ -4,6 +4,6 @@ export * as flattenGetters from './flatten-getters/index.js'
4
4
  export * as isObject from './is-object/index.js'
5
5
  export * as isRecord from './is-record/index.js'
6
6
  export * as recordFormat from './record-format/index.js'
7
- export * as sortKeys from './sort-keys/index.js'
8
7
  export * as recordMap from './record-map/index.js'
8
+ export * as sortKeys from './sort-keys/index.js'
9
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'
@@ -3,6 +3,6 @@ export * as matches from './matches/index.js'
3
3
  export * as normalizeIndent from './normalize-indent/index.js'
4
4
  export * as parseTable from './parse-table/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
+ export * as splitTrim from './split-trim/index.js'
6
7
  export * as toAlphanum from './to-alphanum/index.js'
7
8
  export * as trim from './trim/index.js'
8
- export * as splitTrim from './split-trim/index.js'
@@ -3,6 +3,6 @@ export * as matches from './matches/index.js'
3
3
  export * as normalizeIndent from './normalize-indent/index.js'
4
4
  export * as parseTable from './parse-table/index.js'
5
5
  export * as replaceAll from './replace-all/index.js'
6
+ export * as splitTrim from './split-trim/index.js'
6
7
  export * as toAlphanum from './to-alphanum/index.js'
7
8
  export * as trim from './trim/index.js'
8
- export * as splitTrim from './split-trim/index.js'
@@ -1,5 +1,5 @@
1
- export * as dates from './dates/index.js'
2
1
  export * as duration from './duration/index.js'
3
2
  export * as timeout from './timeout/index.js'
4
- export * as transitions from './transitions/index.js'
3
+ export * as dates from './dates/index.js'
5
4
  export * as wait from './wait/index.js'
5
+ export * as transitions from './transitions/index.js'
@@ -1,5 +1,5 @@
1
- export * as dates from './dates/index.js'
2
1
  export * as duration from './duration/index.js'
3
2
  export * as timeout from './timeout/index.js'
4
- export * as transitions from './transitions/index.js'
3
+ export * as dates from './dates/index.js'
5
4
  export * as wait from './wait/index.js'
5
+ export * as transitions from './transitions/index.js'
@@ -8,11 +8,12 @@ import type { WithClassName } from '../utils/types.js';
8
8
  * one a click on this member opens; the others only matter when another member opens
9
9
  * them. Declaring none makes it a group of its own.
10
10
  * @property closeBtnContent - Content rendered inside the close button.
11
- * @property openBtnContent - Content rendered inside the open button. No content, no
12
- * button: the lightbox is then opened by whatever the consumer wires up.
13
- * @property prevBtnContent - Content rendered inside the previous button, shown only
14
- * when the open group holds more than one member.
15
- * @property nextBtnContent - Content rendered inside the next button, same condition.
11
+ * @property openBtnContent - Content rendered inside the open button. Left empty, the
12
+ * button is still rendered: a stylesheet hides an empty control with `:empty`, and the
13
+ * lightbox is then opened by whatever the consumer wires up.
14
+ * @property prevBtnContent - Content rendered inside the previous button. The button is
15
+ * always rendered; the root's `navigable` modifier says whether it has anywhere to go.
16
+ * @property nextBtnContent - Content rendered inside the next button, same.
16
17
  * @property isOn - Controlled state. When defined, this member is driven by the
17
18
  * parent and the shared registry never opens or closes it.
18
19
  * @property defaultIsOn - Whether the lightbox starts open, in uncontrolled mode.
@@ -22,6 +23,9 @@ import type { WithClassName } from '../utils/types.js';
22
23
  * the open group. Only has an effect on a group of more than one member.
23
24
  * @property exitOnBgClick - When `true`, clicking the backdrop, and not its
24
25
  * content, closes it.
26
+ * @property openOnClick - When `true`, clicking the content opens the lightbox. An
27
+ * affordance layered on the open button, never a replacement for it: a click is
28
+ * mouse and touch only, and the button is what a keyboard reaches.
25
29
  * @property onOpenButtonClicked - Called when the open button is clicked, before the
26
30
  * lightbox reacts, with the state as it was.
27
31
  * @property onCloseButtonClicked - Same, for the close button.
@@ -29,6 +33,8 @@ import type { WithClassName } from '../utils/types.js';
29
33
  * @property onNextButtonClicked - Same, for the next button.
30
34
  * @property onBackgroundClicked - Called when the backdrop is clicked (only
31
35
  * while `exitOnBgClick` is `true`), before the lightbox reacts.
36
+ * @property onContentClicked - Called when the content is clicked while closed (only
37
+ * while `openOnClick` is `true`), before the lightbox reacts.
32
38
  * @property onEscapePressed - Called when `Escape` is pressed while the lightbox is open
33
39
  * (only while `exitOnEscape` is `true`), before the lightbox reacts.
34
40
  * @property onPrevArrowPressed - Called when the left arrow is pressed while the lightbox
@@ -50,12 +56,14 @@ export type Props = PropsWithChildren<WithClassName<{
50
56
  defaultIsOn?: boolean;
51
57
  exitOnEscape?: boolean;
52
58
  exitOnBgClick?: boolean;
59
+ openOnClick?: boolean;
53
60
  navOnArrowKeys?: boolean;
54
61
  onOpenButtonClicked?: (isOn: boolean) => void;
55
62
  onCloseButtonClicked?: (isOn: boolean) => void;
56
63
  onPrevButtonClicked?: (isOn: boolean) => void;
57
64
  onNextButtonClicked?: (isOn: boolean) => void;
58
65
  onBackgroundClicked?: (isOn: boolean) => void;
66
+ onContentClicked?: (isOn: boolean) => void;
59
67
  onEscapePressed?: (isOn: boolean) => void;
60
68
  onPrevArrowPressed?: (isOn: boolean) => void;
61
69
  onNextArrowPressed?: (isOn: boolean) => void;
@@ -68,7 +76,11 @@ export type Props = PropsWithChildren<WithClassName<{
68
76
  * ### CSS modifiers
69
77
  * - `on` - this member is open.
70
78
  * - `off` - it is not.
71
- * - `grouped` - it belongs to a group it did not invent, so navigation is possible.
79
+ * - `grouped` - it belongs to a group it did not invent.
80
+ * - `navigable` - that group holds someone else, so the previous and next controls
81
+ * have somewhere to go.
82
+ * - `open-on-click` - the content itself opens the lightbox, so a stylesheet can say
83
+ * so with a cursor. Named after the prop it mirrors, as modifiers are.
72
84
  *
73
85
  * ### CSS elements
74
86
  * - `placeholder` - holds the content's last measured size while it is out of flow.
@@ -93,9 +105,13 @@ export type Props = PropsWithChildren<WithClassName<{
93
105
  * - **A placeholder keeps the layout still.** Its size is the content's last measured
94
106
  * one, read while closed; without it the article would collapse around the hole left
95
107
  * once the backdrop goes out of flow.
96
- * - **[WIP]** A `position: fixed` backdrop is trapped by the first ancestor carrying a
97
- * `transform`, a `filter` or a `contain`, which becomes its containing block. Inside
98
- * a slot, that ancestor is the consumer's own to avoid.
108
+ * - **A `position: fixed` backdrop is contained by the first ancestor carrying a
109
+ * `transform`, a `filter` or a `contain`**, which becomes its containing block. That
110
+ * is wanted, not suffered: where several articles are preloaded side by side and
111
+ * slid through by a transformed container, containment is what keeps an offscreen
112
+ * article's lightbox offscreen. The top layer - `<dialog>` with `showModal()`, or
113
+ * the popover API - would do the opposite, being document-wide and above
114
+ * everything, and paint over whichever article is being read.
99
115
  * - **Groups are held outside React**, in `./store.ts`: a consumer may render each
100
116
  * component in a root of its own, in which case members of a group share no tree
101
117
  * and a context could not reach from one to the other.
@@ -1,7 +1,6 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
3
3
  import { clss } from '../../agnostic/css/clss/index.js';
4
- import { isNotNullish } from '../../agnostic/misc/is-nullish/index.js';
5
4
  import { mergeClassNames, useChangeDispatch } from '../utils/index.js';
6
5
  import { lightbox as publicClassName } from '../public-classnames.js';
7
6
  import { close as closeLightbox, getState, membersOf, open as openLightbox, register, soloGroupOf, step, subscribe, unregister } from './store.js';
@@ -13,7 +12,11 @@ import cssModule from './styles.module.css';
13
12
  * ### CSS modifiers
14
13
  * - `on` - this member is open.
15
14
  * - `off` - it is not.
16
- * - `grouped` - it belongs to a group it did not invent, so navigation is possible.
15
+ * - `grouped` - it belongs to a group it did not invent.
16
+ * - `navigable` - that group holds someone else, so the previous and next controls
17
+ * have somewhere to go.
18
+ * - `open-on-click` - the content itself opens the lightbox, so a stylesheet can say
19
+ * so with a cursor. Named after the prop it mirrors, as modifiers are.
17
20
  *
18
21
  * ### CSS elements
19
22
  * - `placeholder` - holds the content's last measured size while it is out of flow.
@@ -38,9 +41,13 @@ import cssModule from './styles.module.css';
38
41
  * - **A placeholder keeps the layout still.** Its size is the content's last measured
39
42
  * one, read while closed; without it the article would collapse around the hole left
40
43
  * once the backdrop goes out of flow.
41
- * - **[WIP]** A `position: fixed` backdrop is trapped by the first ancestor carrying a
42
- * `transform`, a `filter` or a `contain`, which becomes its containing block. Inside
43
- * a slot, that ancestor is the consumer's own to avoid.
44
+ * - **A `position: fixed` backdrop is contained by the first ancestor carrying a
45
+ * `transform`, a `filter` or a `contain`**, which becomes its containing block. That
46
+ * is wanted, not suffered: where several articles are preloaded side by side and
47
+ * slid through by a transformed container, containment is what keeps an offscreen
48
+ * article's lightbox offscreen. The top layer - `<dialog>` with `showModal()`, or
49
+ * the popover API - would do the opposite, being document-wide and above
50
+ * everything, and paint over whichever article is being read.
44
51
  * - **Groups are held outside React**, in `./store.ts`: a consumer may render each
45
52
  * component in a root of its own, in which case members of a group share no tree
46
53
  * and a context could not reach from one to the other.
@@ -51,7 +58,7 @@ import cssModule from './styles.module.css';
51
58
  * buttons are the consumer stylesheet's business. Without one, the content is moved
52
59
  * to the end of the document and nothing looks like a lightbox.
53
60
  */
54
- export const Lightbox = ({ group, closeBtnContent, openBtnContent, prevBtnContent, nextBtnContent, isOn: isOnProp, defaultIsOn = false, exitOnEscape, exitOnBgClick, navOnArrowKeys, onOpenButtonClicked, onCloseButtonClicked, onPrevButtonClicked, onNextButtonClicked, onBackgroundClicked, onEscapePressed, onPrevArrowPressed, onNextArrowPressed, onIsOnChanged, children, className }) => {
61
+ export const Lightbox = ({ group, closeBtnContent, openBtnContent, prevBtnContent, nextBtnContent, isOn: isOnProp, defaultIsOn = false, exitOnEscape, exitOnBgClick, openOnClick, navOnArrowKeys, onOpenButtonClicked, onCloseButtonClicked, onPrevButtonClicked, onNextButtonClicked, onBackgroundClicked, onContentClicked, onEscapePressed, onPrevArrowPressed, onNextArrowPressed, onIsOnChanged, children, className }) => {
55
62
  // State & refs
56
63
  const id = useId();
57
64
  const rootRef = useRef(null);
@@ -124,6 +131,12 @@ export const Lightbox = ({ group, closeBtnContent, openBtnContent, prevBtnConten
124
131
  onNextButtonClicked?.(isOn);
125
132
  step(1);
126
133
  };
134
+ const handleContentClick = () => {
135
+ if (openOnClick !== true || isOn)
136
+ return;
137
+ onContentClicked?.(isOn);
138
+ requestOpen();
139
+ };
127
140
  const handleBackdropClick = e => {
128
141
  if (exitOnBgClick !== true)
129
142
  return;
@@ -181,13 +194,16 @@ export const Lightbox = ({ group, closeBtnContent, openBtnContent, prevBtnConten
181
194
  const rootClss = mergeClassNames(c(null, {
182
195
  on: isOn,
183
196
  off: !isOn,
184
- grouped: isGrouped
197
+ grouped: isGrouped,
198
+ navigable: siblingsCount > 1,
199
+ 'open-on-click': openOnClick === true && !isOn
185
200
  }), className);
186
201
  const size = sizeRef.current;
187
- // Every child keeps its position in the tree whatever the state: the placeholder and
188
- // the backdrop are always rendered, and the buttons come after the content rather
189
- // than around it. React reconciles by position, so moving `children` from one branch
190
- // to another would unmount and remount them - the very thing this component exists
191
- // to avoid.
192
- return _jsxs("div", { className: rootClss, ref: rootRef, children: [_jsx("div", { className: c('placeholder'), style: isOn && size !== null ? { width: size.width, height: size.height } : undefined }), _jsxs("div", { className: c('backdrop'), onClick: handleBackdropClick, ref: backdropRef, children: [_jsx("div", { className: c('content'), children: children }), isOn && _jsxs(_Fragment, { children: [_jsx("button", { type: 'button', className: c('close-btn'), onClick: handleCloseButtonClick, children: closeBtnContent }), siblingsCount > 1 && _jsxs(_Fragment, { children: [_jsx("button", { type: 'button', className: c('prev-btn'), onClick: handlePrevButtonClick, children: prevBtnContent }), _jsx("button", { type: 'button', className: c('next-btn'), onClick: handleNextButtonClick, children: nextBtnContent })] })] })] }), !isOn && isNotNullish(openBtnContent) && _jsx("button", { type: 'button', className: c('open-btn'), onClick: handleOpenButtonClick, children: openBtnContent })] });
202
+ // Nothing here is conditional. React reconciles by position, so a branch that
203
+ // appears and disappears shifts what follows it - and moving `children` between two
204
+ // positions would unmount and remount them, the very thing this component exists to
205
+ // avoid. Which control is reachable, and when, is the stylesheet's business: the
206
+ // root carries a modifier per state, and `:empty` tells a control with no content
207
+ // from one that has some.
208
+ return _jsxs("div", { className: rootClss, ref: rootRef, children: [_jsx("div", { className: c('placeholder'), style: isOn && size !== null ? { width: size.width, height: size.height } : undefined }), _jsxs("div", { className: c('backdrop'), onClick: handleBackdropClick, ref: backdropRef, children: [_jsx("div", { className: c('content'), onClick: handleContentClick, children: children }), _jsx("button", { type: 'button', className: c('close-btn'), onClick: handleCloseButtonClick, children: closeBtnContent }), _jsx("button", { type: 'button', className: c('prev-btn'), onClick: handlePrevButtonClick, children: prevBtnContent }), _jsx("button", { type: 'button', className: c('next-btn'), onClick: handleNextButtonClick, children: nextBtnContent })] }), _jsx("button", { type: 'button', className: c('open-btn'), onClick: handleOpenButtonClick, children: openBtnContent })] });
193
209
  };
@@ -10,12 +10,12 @@ export * as image from './Image/index.js'
10
10
  export * as input from './Input/index.js'
11
11
  export * as intersectionObserver from './IntersectionObserver/index.js'
12
12
  export * as jsonEditor from './JsonEditor/index.js'
13
- export * as lightbox from './Lightbox/index.js'
14
13
  export * as listLoader from './ListLoader/index.js'
14
+ export * as lightbox from './Lightbox/index.js'
15
15
  export * as overlayer from './Overlayer/index.js'
16
+ export * as scrllgngn from './Scrllgngn/index.js'
16
17
  export * as paginator from './Paginator/index.js'
17
18
  export * as resizeObserver from './ResizeObserver/index.js'
18
- export * as scrllgngn from './Scrllgngn/index.js'
19
19
  export * as scrollListener from './ScrollListener/index.js'
20
20
  export * as select from './Select/index.js'
21
21
  export * as sequencer from './Sequencer/index.js'
@@ -10,12 +10,12 @@ export * as image from './Image/index.js'
10
10
  export * as input from './Input/index.js'
11
11
  export * as intersectionObserver from './IntersectionObserver/index.js'
12
12
  export * as jsonEditor from './JsonEditor/index.js'
13
- export * as lightbox from './Lightbox/index.js'
14
13
  export * as listLoader from './ListLoader/index.js'
14
+ export * as lightbox from './Lightbox/index.js'
15
15
  export * as overlayer from './Overlayer/index.js'
16
+ export * as scrllgngn from './Scrllgngn/index.js'
16
17
  export * as paginator from './Paginator/index.js'
17
18
  export * as resizeObserver from './ResizeObserver/index.js'
18
- export * as scrllgngn from './Scrllgngn/index.js'
19
19
  export * as scrollListener from './ScrollListener/index.js'
20
20
  export * as select from './Select/index.js'
21
21
  export * as sequencer from './Sequencer/index.js'
@@ -1,4 +1,4 @@
1
- export * as copyDir from './copy-dir/index.js'
2
1
  export * as list from './list/index.js'
2
+ export * as copyDir from './copy-dir/index.js'
3
3
  export * as moveDir from './move-dir/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
- export * as copyDir from './copy-dir/index.js'
2
1
  export * as list from './list/index.js'
2
+ export * as copyDir from './copy-dir/index.js'
3
3
  export * as moveDir from './move-dir/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as downloadFile from './download-file/index.js'
3
2
  export * as copyFile from './copy-file/index.js'
3
+ export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
5
  export * as listDir from './list-dir/index.js'
6
6
  export * as moveDir from './move-dir/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as downloadFile from './download-file/index.js'
3
2
  export * as copyFile from './copy-file/index.js'
3
+ export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
5
  export * as listDir from './list-dir/index.js'
6
6
  export * as moveDir from './move-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
2
  export * as list from './list/index.js'
3
- export * as removeDir from './remove-dir/index.js'
4
3
  export * as moveDir from './move-dir/index.js'
4
+ export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
2
  export * as list from './list/index.js'
3
- export * as removeDir from './remove-dir/index.js'
4
3
  export * as moveDir from './move-dir/index.js'
4
+ export * as removeDir from './remove-dir/index.js'
package/node/index.d.ts CHANGED
@@ -2,10 +2,10 @@ export * as awsS3 from './@aws-s3/index.js'
2
2
  export * as designEdito from './@design-edito/index.js'
3
3
  export * as express from './@express/index.js'
4
4
  export * as googleCloud from './@google-cloud/index.js'
5
+ export * as cloudStorage from './cloud-storage/index.js'
5
6
  export * as encryption from './encryption/index.js'
6
7
  export * as files from './files/index.js'
7
8
  export * as ftps from './ftps/index.js'
8
- export * as cloudStorage from './cloud-storage/index.js'
9
9
  export * as images from './images/index.js'
10
10
  export * as process from './process/index.js'
11
11
  export * as sftp from './sftp/index.js'
package/node/index.js CHANGED
@@ -2,10 +2,10 @@ export * as awsS3 from './@aws-s3/index.js'
2
2
  export * as designEdito from './@design-edito/index.js'
3
3
  export * as express from './@express/index.js'
4
4
  export * as googleCloud from './@google-cloud/index.js'
5
+ export * as cloudStorage from './cloud-storage/index.js'
5
6
  export * as encryption from './encryption/index.js'
6
7
  export * as files from './files/index.js'
7
8
  export * as ftps from './ftps/index.js'
8
- export * as cloudStorage from './cloud-storage/index.js'
9
9
  export * as images from './images/index.js'
10
10
  export * as process from './process/index.js'
11
11
  export * as sftp from './sftp/index.js'
@@ -1,7 +1,7 @@
1
1
  export * as copy from './copy/index.js'
2
2
  export * as download from './download/index.js'
3
- export * as exists from './exists/index.js'
4
3
  export * as move from './move/index.js'
4
+ export * as exists from './exists/index.js'
5
5
  export * as remove from './remove/index.js'
6
6
  export * as stat from './stat/index.js'
7
7
  export * as upload from './upload/index.js'
@@ -1,7 +1,7 @@
1
1
  export * as copy from './copy/index.js'
2
2
  export * as download from './download/index.js'
3
- export * as exists from './exists/index.js'
4
3
  export * as move from './move/index.js'
4
+ export * as exists from './exists/index.js'
5
5
  export * as remove from './remove/index.js'
6
6
  export * as stat from './stat/index.js'
7
7
  export * as upload from './upload/index.js'
@@ -1,2 +1,2 @@
1
- export * as file from './file/index.js'
2
1
  export * as directory from './directory/index.js'
2
+ export * as file from './file/index.js'
@@ -1,2 +1,2 @@
1
- export * as file from './file/index.js'
2
1
  export * as directory from './directory/index.js'
2
+ export * as file from './file/index.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",