@design-edito/tools 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agnostic/arrays/index.d.ts +1 -1
- package/agnostic/arrays/index.js +1 -1
- package/agnostic/colors/index.d.ts +3 -3
- package/agnostic/colors/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +15 -15
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +15 -15
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +2 -2
- package/agnostic/html/index.d.ts +2 -2
- package/agnostic/html/index.js +2 -2
- package/agnostic/index.d.ts +2 -2
- package/agnostic/index.js +2 -2
- package/agnostic/misc/index.d.ts +2 -2
- package/agnostic/misc/index.js +2 -2
- package/agnostic/objects/index.d.ts +3 -3
- package/agnostic/objects/index.js +3 -3
- package/agnostic/strings/index.d.ts +2 -2
- package/agnostic/strings/index.js +2 -2
- package/agnostic/time/index.d.ts +1 -1
- package/agnostic/time/index.js +1 -1
- package/components/BeforeAfter/index.controlled.d.ts +40 -31
- package/components/BeforeAfter/index.controlled.js +92 -70
- package/components/BeforeAfter/index.d.ts +20 -34
- package/components/BeforeAfter/index.js +40 -45
- package/components/Image/index.d.ts +2 -4
- package/components/Scrllgngn/styles.module.css +10 -0
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/node/@google-cloud/storage/file/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/index.js +1 -1
- package/node/@google-cloud/storage/index.d.ts +1 -1
- package/node/@google-cloud/storage/index.js +1 -1
- package/node/cloud-storage/operations/index.d.ts +1 -1
- package/node/cloud-storage/operations/index.js +1 -1
- package/node/files/index.d.ts +1 -1
- package/node/files/index.js +1 -1
- package/node/images/index.d.ts +1 -1
- package/node/images/index.js +1 -1
- package/node/images/transform/operations/index.d.ts +2 -2
- package/node/images/transform/operations/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as dedupe from './dedupe/index.js'
|
|
2
2
|
export * as findDuplicates from './find-duplicates/index.js'
|
|
3
|
-
export * as make from './make/index.js'
|
|
4
3
|
export * as isArrayOf from './is-array-of/index.js'
|
|
4
|
+
export * as make from './make/index.js'
|
|
5
5
|
export * as randomPick from './random-pick/index.js'
|
|
6
6
|
export * as shuffle from './shuffle/index.js'
|
package/agnostic/arrays/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as dedupe from './dedupe/index.js'
|
|
2
2
|
export * as findDuplicates from './find-duplicates/index.js'
|
|
3
|
-
export * as make from './make/index.js'
|
|
4
3
|
export * as isArrayOf from './is-array-of/index.js'
|
|
4
|
+
export * as make from './make/index.js'
|
|
5
5
|
export * as randomPick from './random-pick/index.js'
|
|
6
6
|
export * as shuffle from './shuffle/index.js'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * as contrast from './contrast/index.js'
|
|
2
1
|
export * as channels from './channels/index.js'
|
|
2
|
+
export * as contrast from './contrast/index.js'
|
|
3
|
+
export * as convert from './convert/index.js'
|
|
3
4
|
export * as distance from './distance/index.js'
|
|
4
|
-
export * as invert from './invert/index.js'
|
|
5
5
|
export * as grayscale from './grayscale/index.js'
|
|
6
|
+
export * as invert from './invert/index.js'
|
|
6
7
|
export * as lerp from './lerp/index.js'
|
|
7
8
|
export * as luminance from './luminance/index.js'
|
|
8
|
-
export * as convert from './convert/index.js'
|
|
9
9
|
export * as palette from './palette/index.js'
|
|
10
10
|
export * as rotate from './rotate/index.js'
|
|
11
11
|
export * as tidy from './tidy/index.js'
|
package/agnostic/colors/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * as contrast from './contrast/index.js'
|
|
2
1
|
export * as channels from './channels/index.js'
|
|
2
|
+
export * as contrast from './contrast/index.js'
|
|
3
|
+
export * as convert from './convert/index.js'
|
|
3
4
|
export * as distance from './distance/index.js'
|
|
4
|
-
export * as invert from './invert/index.js'
|
|
5
5
|
export * as grayscale from './grayscale/index.js'
|
|
6
|
+
export * as invert from './invert/index.js'
|
|
6
7
|
export * as lerp from './lerp/index.js'
|
|
7
8
|
export * as luminance from './luminance/index.js'
|
|
8
|
-
export * as convert from './convert/index.js'
|
|
9
9
|
export * as palette from './palette/index.js'
|
|
10
10
|
export * as rotate from './rotate/index.js'
|
|
11
11
|
export * as tidy from './tidy/index.js'
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
2
|
export * as addclass from './addclass/index.js'
|
|
3
|
-
export * as and from './and/index.js'
|
|
4
3
|
export * as append from './append/index.js'
|
|
4
|
+
export * as and from './and/index.js'
|
|
5
5
|
export * as at from './at/index.js'
|
|
6
6
|
export * as call from './call/index.js'
|
|
7
|
-
export * as clone from './clone/index.js'
|
|
8
7
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
9
|
-
export * as
|
|
8
|
+
export * as clone from './clone/index.js'
|
|
10
9
|
export * as getattribute from './getattribute/index.js'
|
|
11
10
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as hjparse from './hjparse/index.js'
|
|
13
11
|
export * as getproperty from './getproperty/index.js'
|
|
14
12
|
export * as hjstringify from './hjstringify/index.js'
|
|
15
13
|
export * as if from './if/index.js'
|
|
14
|
+
export * as equals from './equals/index.js'
|
|
16
15
|
export * as initialize from './initialize/index.js'
|
|
17
|
-
export * as
|
|
18
|
-
export * as length from './length/index.js'
|
|
16
|
+
export * as hjparse from './hjparse/index.js'
|
|
19
17
|
export * as map from './map/index.js'
|
|
18
|
+
export * as length from './length/index.js'
|
|
20
19
|
export * as negate from './negate/index.js'
|
|
21
20
|
export * as notrailing from './notrailing/index.js'
|
|
22
21
|
export * as or from './or/index.js'
|
|
23
22
|
export * as pickrandom from './pickrandom/index.js'
|
|
24
|
-
export * as
|
|
23
|
+
export * as join from './join/index.js'
|
|
24
|
+
export * as populate from './populate/index.js'
|
|
25
25
|
export * as push from './push/index.js'
|
|
26
|
+
export * as print from './print/index.js'
|
|
26
27
|
export * as pusheach from './pusheach/index.js'
|
|
27
28
|
export * as recordtoarray from './recordtoarray/index.js'
|
|
28
29
|
export * as removeattribute from './removeattribute/index.js'
|
|
29
30
|
export * as removeclass from './removeclass/index.js'
|
|
30
|
-
export * as replace from './replace/index.js'
|
|
31
31
|
export * as renameproperty from './renameproperty/index.js'
|
|
32
|
-
export * as
|
|
33
|
-
export * as populate from './populate/index.js'
|
|
32
|
+
export * as replace from './replace/index.js'
|
|
34
33
|
export * as set from './set/index.js'
|
|
35
34
|
export * as setattribute from './setattribute/index.js'
|
|
36
35
|
export * as setproperty from './setproperty/index.js'
|
|
36
|
+
export * as select from './select/index.js'
|
|
37
37
|
export * as sorton from './sorton/index.js'
|
|
38
38
|
export * as split from './split/index.js'
|
|
39
|
-
export * as
|
|
40
|
-
export * as toboolean from './toboolean/index.js'
|
|
39
|
+
export * as toarray from './toarray/index.js'
|
|
41
40
|
export * as toelement from './toelement/index.js'
|
|
42
|
-
export * as
|
|
41
|
+
export * as toboolean from './toboolean/index.js'
|
|
42
|
+
export * as spread from './spread/index.js'
|
|
43
43
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
44
|
export * as tonull from './tonull/index.js'
|
|
45
|
-
export * as
|
|
45
|
+
export * as tonodelist from './tonodelist/index.js'
|
|
46
46
|
export * as torecord from './torecord/index.js'
|
|
47
47
|
export * as tonumber from './tonumber/index.js'
|
|
48
48
|
export * as toref from './toref/index.js'
|
|
49
|
-
export * as totext from './totext/index.js'
|
|
50
49
|
export * as tostring from './tostring/index.js'
|
|
50
|
+
export * as totext from './totext/index.js'
|
|
51
51
|
export * as transformselected from './transformselected/index.js'
|
|
52
52
|
export * as trim from './trim/index.js'
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
2
|
export * as addclass from './addclass/index.js'
|
|
3
|
-
export * as and from './and/index.js'
|
|
4
3
|
export * as append from './append/index.js'
|
|
4
|
+
export * as and from './and/index.js'
|
|
5
5
|
export * as at from './at/index.js'
|
|
6
6
|
export * as call from './call/index.js'
|
|
7
|
-
export * as clone from './clone/index.js'
|
|
8
7
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
9
|
-
export * as
|
|
8
|
+
export * as clone from './clone/index.js'
|
|
10
9
|
export * as getattribute from './getattribute/index.js'
|
|
11
10
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as hjparse from './hjparse/index.js'
|
|
13
11
|
export * as getproperty from './getproperty/index.js'
|
|
14
12
|
export * as hjstringify from './hjstringify/index.js'
|
|
15
13
|
export * as if from './if/index.js'
|
|
14
|
+
export * as equals from './equals/index.js'
|
|
16
15
|
export * as initialize from './initialize/index.js'
|
|
17
|
-
export * as
|
|
18
|
-
export * as length from './length/index.js'
|
|
16
|
+
export * as hjparse from './hjparse/index.js'
|
|
19
17
|
export * as map from './map/index.js'
|
|
18
|
+
export * as length from './length/index.js'
|
|
20
19
|
export * as negate from './negate/index.js'
|
|
21
20
|
export * as notrailing from './notrailing/index.js'
|
|
22
21
|
export * as or from './or/index.js'
|
|
23
22
|
export * as pickrandom from './pickrandom/index.js'
|
|
24
|
-
export * as
|
|
23
|
+
export * as join from './join/index.js'
|
|
24
|
+
export * as populate from './populate/index.js'
|
|
25
25
|
export * as push from './push/index.js'
|
|
26
|
+
export * as print from './print/index.js'
|
|
26
27
|
export * as pusheach from './pusheach/index.js'
|
|
27
28
|
export * as recordtoarray from './recordtoarray/index.js'
|
|
28
29
|
export * as removeattribute from './removeattribute/index.js'
|
|
29
30
|
export * as removeclass from './removeclass/index.js'
|
|
30
|
-
export * as replace from './replace/index.js'
|
|
31
31
|
export * as renameproperty from './renameproperty/index.js'
|
|
32
|
-
export * as
|
|
33
|
-
export * as populate from './populate/index.js'
|
|
32
|
+
export * as replace from './replace/index.js'
|
|
34
33
|
export * as set from './set/index.js'
|
|
35
34
|
export * as setattribute from './setattribute/index.js'
|
|
36
35
|
export * as setproperty from './setproperty/index.js'
|
|
36
|
+
export * as select from './select/index.js'
|
|
37
37
|
export * as sorton from './sorton/index.js'
|
|
38
38
|
export * as split from './split/index.js'
|
|
39
|
-
export * as
|
|
40
|
-
export * as toboolean from './toboolean/index.js'
|
|
39
|
+
export * as toarray from './toarray/index.js'
|
|
41
40
|
export * as toelement from './toelement/index.js'
|
|
42
|
-
export * as
|
|
41
|
+
export * as toboolean from './toboolean/index.js'
|
|
42
|
+
export * as spread from './spread/index.js'
|
|
43
43
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
44
|
export * as tonull from './tonull/index.js'
|
|
45
|
-
export * as
|
|
45
|
+
export * as tonodelist from './tonodelist/index.js'
|
|
46
46
|
export * as torecord from './torecord/index.js'
|
|
47
47
|
export * as tonumber from './tonumber/index.js'
|
|
48
48
|
export * as toref from './toref/index.js'
|
|
49
|
-
export * as totext from './totext/index.js'
|
|
50
49
|
export * as tostring from './tostring/index.js'
|
|
50
|
+
export * as totext from './totext/index.js'
|
|
51
51
|
export * as transformselected from './transformselected/index.js'
|
|
52
52
|
export * as trim from './trim/index.js'
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * as array from './array/index.js'
|
|
2
1
|
export * as any from './any/index.js'
|
|
3
2
|
export * as boolean from './boolean/index.js'
|
|
4
3
|
export * as element from './element/index.js'
|
|
5
4
|
export * as get from './get/index.js'
|
|
5
|
+
export * as array from './array/index.js'
|
|
6
6
|
export * as guess from './guess/index.js'
|
|
7
7
|
export * as nodelist from './nodelist/index.js'
|
|
8
|
+
export * as null from './null/index.js'
|
|
8
9
|
export * as number from './number/index.js'
|
|
9
10
|
export * as record from './record/index.js'
|
|
10
11
|
export * as ref from './ref/index.js'
|
|
11
|
-
export * as null from './null/index.js'
|
|
12
12
|
export * as string from './string/index.js'
|
|
13
13
|
export * as text from './text/index.js'
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * as array from './array/index.js'
|
|
2
1
|
export * as any from './any/index.js'
|
|
3
2
|
export * as boolean from './boolean/index.js'
|
|
4
3
|
export * as element from './element/index.js'
|
|
5
4
|
export * as get from './get/index.js'
|
|
5
|
+
export * as array from './array/index.js'
|
|
6
6
|
export * as guess from './guess/index.js'
|
|
7
7
|
export * as nodelist from './nodelist/index.js'
|
|
8
|
+
export * as null from './null/index.js'
|
|
8
9
|
export * as number from './number/index.js'
|
|
9
10
|
export * as record from './record/index.js'
|
|
10
11
|
export * as ref from './ref/index.js'
|
|
11
|
-
export * as null from './null/index.js'
|
|
12
12
|
export * as string from './string/index.js'
|
|
13
13
|
export * as text from './text/index.js'
|
package/agnostic/html/index.d.ts
CHANGED
|
@@ -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 getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
3
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
4
|
export * as insertNode from './insert-node/index.js'
|
|
6
5
|
export * as placeholders from './placeholders/index.js'
|
|
6
|
+
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
7
7
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
8
8
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
|
-
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
9
|
export * as watchSelection from './watch-selection/index.js'
|
|
10
|
+
export * as stringToNodes from './string-to-nodes/index.js'
|
package/agnostic/html/index.js
CHANGED
|
@@ -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 getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
3
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
4
|
export * as insertNode from './insert-node/index.js'
|
|
6
5
|
export * as placeholders from './placeholders/index.js'
|
|
6
|
+
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
7
7
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
8
8
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
|
-
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
9
|
export * as watchSelection from './watch-selection/index.js'
|
|
10
|
+
export * as stringToNodes from './string-to-nodes/index.js'
|
package/agnostic/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ 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
4
|
export * as css from './css/index.js'
|
|
5
|
-
export * as errors from './errors/index.js'
|
|
6
5
|
export * as html from './html/index.js'
|
|
6
|
+
export * as errors from './errors/index.js'
|
|
7
7
|
export * as misc from './misc/index.js'
|
|
8
8
|
export * as numbers from './numbers/index.js'
|
|
9
9
|
export * as objects from './objects/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
|
-
export * as random from './random/index.js'
|
|
14
14
|
export * as strings from './strings/index.js'
|
|
15
15
|
export * as time from './time/index.js'
|
|
16
16
|
export * as typescript from './typescript/index.js'
|
package/agnostic/index.js
CHANGED
|
@@ -2,15 +2,15 @@ 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
4
|
export * as css from './css/index.js'
|
|
5
|
-
export * as errors from './errors/index.js'
|
|
6
5
|
export * as html from './html/index.js'
|
|
6
|
+
export * as errors from './errors/index.js'
|
|
7
7
|
export * as misc from './misc/index.js'
|
|
8
8
|
export * as numbers from './numbers/index.js'
|
|
9
9
|
export * as objects from './objects/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
|
-
export * as random from './random/index.js'
|
|
14
14
|
export * as strings from './strings/index.js'
|
|
15
15
|
export * as time from './time/index.js'
|
|
16
16
|
export * as typescript from './typescript/index.js'
|
package/agnostic/misc/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ 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 isNullish from './is-nullish/index.js'
|
|
6
7
|
export * as dataSize from './data-size/index.js'
|
|
7
8
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
8
|
-
export * as isNullish from './is-nullish/index.js'
|
|
9
|
-
export * as logs from './logs/index.js'
|
|
10
9
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
10
|
+
export * as logs from './logs/index.js'
|
|
11
11
|
export * as normalizeExtension from './normalize-extension/index.js'
|
|
12
12
|
export * as outcome from './outcome/index.js'
|
package/agnostic/misc/index.js
CHANGED
|
@@ -3,10 +3,10 @@ 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 isNullish from './is-nullish/index.js'
|
|
6
7
|
export * as dataSize from './data-size/index.js'
|
|
7
8
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
8
|
-
export * as isNullish from './is-nullish/index.js'
|
|
9
|
-
export * as logs from './logs/index.js'
|
|
10
9
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
10
|
+
export * as logs from './logs/index.js'
|
|
11
11
|
export * as normalizeExtension from './normalize-extension/index.js'
|
|
12
12
|
export * as outcome from './outcome/index.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as enums from './enums/index.js'
|
|
2
|
-
export * as flattenGetters from './flatten-getters/index.js'
|
|
3
1
|
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
|
+
export * as enums from './enums/index.js'
|
|
4
3
|
export * as isObject from './is-object/index.js'
|
|
5
4
|
export * as isRecord from './is-record/index.js'
|
|
5
|
+
export * as recordMap from './record-map/index.js'
|
|
6
6
|
export * as recordFormat from './record-format/index.js'
|
|
7
7
|
export * as sortKeys from './sort-keys/index.js'
|
|
8
8
|
export * as validation from './validation/index.js'
|
|
9
|
-
export * as
|
|
9
|
+
export * as flattenGetters from './flatten-getters/index.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * as enums from './enums/index.js'
|
|
2
|
-
export * as flattenGetters from './flatten-getters/index.js'
|
|
3
1
|
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
|
+
export * as enums from './enums/index.js'
|
|
4
3
|
export * as isObject from './is-object/index.js'
|
|
5
4
|
export * as isRecord from './is-record/index.js'
|
|
5
|
+
export * as recordMap from './record-map/index.js'
|
|
6
6
|
export * as recordFormat from './record-format/index.js'
|
|
7
7
|
export * as sortKeys from './sort-keys/index.js'
|
|
8
8
|
export * as validation from './validation/index.js'
|
|
9
|
-
export * as
|
|
9
|
+
export * as flattenGetters from './flatten-getters/index.js'
|
|
@@ -2,7 +2,7 @@ export * as charCodes from './char-codes/index.js'
|
|
|
2
2
|
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
|
-
export * as replaceAll from './replace-all/index.js'
|
|
6
|
-
export * as splitTrim from './split-trim/index.js'
|
|
7
5
|
export * as toAlphanum from './to-alphanum/index.js'
|
|
8
6
|
export * as trim from './trim/index.js'
|
|
7
|
+
export * as splitTrim from './split-trim/index.js'
|
|
8
|
+
export * as replaceAll from './replace-all/index.js'
|
|
@@ -2,7 +2,7 @@ export * as charCodes from './char-codes/index.js'
|
|
|
2
2
|
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
|
-
export * as replaceAll from './replace-all/index.js'
|
|
6
|
-
export * as splitTrim from './split-trim/index.js'
|
|
7
5
|
export * as toAlphanum from './to-alphanum/index.js'
|
|
8
6
|
export * as trim from './trim/index.js'
|
|
7
|
+
export * as splitTrim from './split-trim/index.js'
|
|
8
|
+
export * as replaceAll from './replace-all/index.js'
|
package/agnostic/time/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as dates from './dates/index.js'
|
|
2
1
|
export * as duration from './duration/index.js'
|
|
2
|
+
export * as dates from './dates/index.js'
|
|
3
3
|
export * as timeout from './timeout/index.js'
|
|
4
4
|
export * as transitions from './transitions/index.js'
|
|
5
5
|
export * as wait from './wait/index.js'
|
package/agnostic/time/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as dates from './dates/index.js'
|
|
2
1
|
export * as duration from './duration/index.js'
|
|
2
|
+
export * as dates from './dates/index.js'
|
|
3
3
|
export * as timeout from './timeout/index.js'
|
|
4
4
|
export * as transitions from './transitions/index.js'
|
|
5
5
|
export * as wait from './wait/index.js'
|
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode, type FunctionComponent } from 'react';
|
|
2
2
|
import type { WithClassName } from '../utils/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link BeforeAfterControlled} component.
|
|
5
|
+
*
|
|
6
|
+
* Extends {@link WithClassName} with layout, content, and interaction configuration.
|
|
7
|
+
*
|
|
8
|
+
* @property mode - Layout orientation of the split. Defaults to `'horizontal'`.
|
|
9
|
+
* @property ratio - Position of the divider as a value between `0` and `1`.
|
|
10
|
+
* Values outside this range are clamped automatically. Defaults to `0`.
|
|
11
|
+
* @property before - Content rendered in the first (before) panel.
|
|
12
|
+
* @property after - Content rendered in the second (after) panel.
|
|
13
|
+
* @property actionHandlers - Optional user action callbacks:
|
|
14
|
+
* - `dragged` — called on each pointer move while dragging, with the current
|
|
15
|
+
* x and y ratios relative to the component bounds.
|
|
16
|
+
* - `clicked` — called on pointer release when no drag occurred, with the
|
|
17
|
+
* x and y ratios of the release position.
|
|
18
|
+
* @property className - Additional class name(s) applied to the root element.
|
|
19
|
+
*/
|
|
3
20
|
export type Props = WithClassName<{
|
|
4
|
-
|
|
5
|
-
beforeContent?: React.ReactNode;
|
|
6
|
-
afterContent?: React.ReactNode;
|
|
21
|
+
mode?: 'vertical' | 'horizontal';
|
|
7
22
|
ratio?: number;
|
|
23
|
+
before?: ReactNode;
|
|
24
|
+
after?: ReactNode;
|
|
8
25
|
actionHandlers?: {
|
|
9
|
-
|
|
26
|
+
dragged?: (xRatio: number, yRatio: number) => void;
|
|
27
|
+
clicked?: (xRatio: number, yRatio: number) => void;
|
|
10
28
|
};
|
|
11
|
-
|
|
12
|
-
horizontal?: boolean;
|
|
13
|
-
vertical?: boolean;
|
|
14
|
-
};
|
|
15
|
-
}> & HTMLAttributes<HTMLDivElement>;
|
|
29
|
+
}>;
|
|
16
30
|
/**
|
|
17
|
-
*
|
|
31
|
+
* Controlled before/after comparison component.
|
|
18
32
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @property actionHandlers - Optional pointer (drag) callbacks:
|
|
23
|
-
* - `pointer` — called on pointer events with ratio and element info.
|
|
24
|
-
* @property _modifiers - Orientation modifiers: `horizontal` or `vertical`.
|
|
25
|
-
* @property className - Custom CSS class.
|
|
33
|
+
* Renders two content panels separated by a draggable divider whose position
|
|
34
|
+
* is expressed as a ratio between `0` and `1`. Supports both mouse and touch
|
|
35
|
+
* interactions, distinguishing clicks from drags.
|
|
26
36
|
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* to update the ratio via callbacks.
|
|
37
|
+
* The active ratio is exposed as:
|
|
38
|
+
* - CSS custom properties:
|
|
39
|
+
* - `--{prefix}-ratio`
|
|
40
|
+
* - `--{prefix}-ratio-percent`
|
|
41
|
+
* - A `data-ratio` attribute on the root element.
|
|
33
42
|
*
|
|
34
|
-
* ###
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
43
|
+
* ### CSS modifiers
|
|
44
|
+
* - `horizontal` — applied when `mode` is `'horizontal'`.
|
|
45
|
+
* - `vertical` — applied when `mode` is `'vertical'`.
|
|
37
46
|
*
|
|
38
|
-
* ###
|
|
39
|
-
* - `
|
|
47
|
+
* ### CSS elements
|
|
48
|
+
* - `before`
|
|
49
|
+
* - `after`
|
|
40
50
|
*
|
|
41
51
|
* @param props - Component properties.
|
|
42
52
|
* @see {@link Props}
|
|
43
|
-
* @
|
|
44
|
-
* @returns A div containing used to render "before/after" content, with pointer event handling for ratio updates.
|
|
53
|
+
* @returns A split-panel container with pointer interaction handlers and ratio state applied.
|
|
45
54
|
*/
|
|
46
55
|
export declare const BeforeAfterControlled: FunctionComponent<Props>;
|
|
@@ -1,95 +1,117 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { clss } from '../../agnostic/css/clss/index.js';
|
|
2
|
+
import { useRef } from 'react';
|
|
4
3
|
import { clamp } from '../../agnostic/numbers/clamp/index.js';
|
|
4
|
+
import { round } from '../../agnostic/numbers/round/index.js';
|
|
5
|
+
import { clss } from '../../agnostic/css/clss/index.js';
|
|
5
6
|
import { mergeClassNames } from '../utils/index.js';
|
|
6
7
|
import { beforeAfter as publicClassName } from '../public-classnames.js';
|
|
7
8
|
import cssModule from './styles.module.css';
|
|
8
|
-
import { getRelativePointerCoordinates } from './utils.js';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Controlled before/after comparison component.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @property actionHandlers - Optional pointer (drag) callbacks:
|
|
16
|
-
* - `pointer` — called on pointer events with ratio and element info.
|
|
17
|
-
* @property _modifiers - Orientation modifiers: `horizontal` or `vertical`.
|
|
18
|
-
* @property className - Custom CSS class.
|
|
12
|
+
* Renders two content panels separated by a draggable divider whose position
|
|
13
|
+
* is expressed as a ratio between `0` and `1`. Supports both mouse and touch
|
|
14
|
+
* interactions, distinguishing clicks from drags.
|
|
19
15
|
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* to update the ratio via callbacks.
|
|
16
|
+
* The active ratio is exposed as:
|
|
17
|
+
* - CSS custom properties:
|
|
18
|
+
* - `--{prefix}-ratio`
|
|
19
|
+
* - `--{prefix}-ratio-percent`
|
|
20
|
+
* - A `data-ratio` attribute on the root element.
|
|
26
21
|
*
|
|
27
|
-
* ###
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
22
|
+
* ### CSS modifiers
|
|
23
|
+
* - `horizontal` — applied when `mode` is `'horizontal'`.
|
|
24
|
+
* - `vertical` — applied when `mode` is `'vertical'`.
|
|
30
25
|
*
|
|
31
|
-
* ###
|
|
32
|
-
* - `
|
|
26
|
+
* ### CSS elements
|
|
27
|
+
* - `before`
|
|
28
|
+
* - `after`
|
|
33
29
|
*
|
|
34
30
|
* @param props - Component properties.
|
|
35
31
|
* @see {@link Props}
|
|
36
|
-
* @
|
|
37
|
-
* @returns A div containing used to render "before/after" content, with pointer event handling for ratio updates.
|
|
32
|
+
* @returns A split-panel container with pointer interaction handlers and ratio state applied.
|
|
38
33
|
*/
|
|
39
|
-
export const BeforeAfterControlled = ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const onPointerUpRef = useRef(null);
|
|
43
|
-
const onPointerMoveRef = useRef(null);
|
|
34
|
+
export const BeforeAfterControlled = ({ mode = 'horizontal', ratio = 0, before, after, className, actionHandlers }) => {
|
|
35
|
+
ratio = clamp(ratio, 0, 1);
|
|
36
|
+
// State & refs
|
|
44
37
|
const rootRef = useRef(null);
|
|
45
|
-
const
|
|
46
|
-
|
|
38
|
+
const isPointerDown = useRef(false);
|
|
39
|
+
const hasDragged = useRef(false);
|
|
40
|
+
// Utils
|
|
41
|
+
const getRatios = (clientX, clientY) => {
|
|
42
|
+
const rect = rootRef.current?.getBoundingClientRect();
|
|
43
|
+
if (rect === undefined)
|
|
44
|
+
return null;
|
|
45
|
+
return {
|
|
46
|
+
xRatio: (clientX - rect.left) / rect.width,
|
|
47
|
+
yRatio: (clientY - rect.top) / rect.height
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
// Handlers
|
|
51
|
+
const handleMouseDown = event => {
|
|
52
|
+
isPointerDown.current = true;
|
|
53
|
+
hasDragged.current = false;
|
|
54
|
+
};
|
|
55
|
+
const handleMouseMove = event => {
|
|
56
|
+
if (!isPointerDown.current)
|
|
47
57
|
return;
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
document.removeEventListener('pointermove', onPointerMoveRef.current);
|
|
58
|
+
hasDragged.current = true;
|
|
59
|
+
const ratios = getRatios(event.clientX, event.clientY);
|
|
60
|
+
if (ratios !== null)
|
|
61
|
+
actionHandlers?.dragged?.(ratios.xRatio, ratios.yRatio);
|
|
62
|
+
};
|
|
63
|
+
const handleMouseUp = event => {
|
|
64
|
+
if (!hasDragged.current) {
|
|
65
|
+
const ratios = getRatios(event.clientX, event.clientY);
|
|
66
|
+
if (ratios !== null)
|
|
67
|
+
actionHandlers?.clicked?.(ratios.xRatio, ratios.yRatio);
|
|
59
68
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
const
|
|
64
|
-
|
|
69
|
+
isPointerDown.current = false;
|
|
70
|
+
hasDragged.current = false;
|
|
71
|
+
};
|
|
72
|
+
const handleTouchStart = event => {
|
|
73
|
+
isPointerDown.current = true;
|
|
74
|
+
hasDragged.current = false;
|
|
75
|
+
};
|
|
76
|
+
const handleTouchMove = event => {
|
|
77
|
+
const t = event.touches[0];
|
|
78
|
+
if (t === undefined)
|
|
79
|
+
return;
|
|
80
|
+
if (!isPointerDown.current)
|
|
65
81
|
return;
|
|
82
|
+
hasDragged.current = true;
|
|
83
|
+
const ratios = getRatios(t.clientX, t.clientY);
|
|
84
|
+
if (ratios !== null)
|
|
85
|
+
actionHandlers?.dragged?.(ratios.xRatio, ratios.yRatio);
|
|
86
|
+
};
|
|
87
|
+
const handleTouchEnd = event => {
|
|
88
|
+
if (!hasDragged.current) {
|
|
89
|
+
const t = event.changedTouches[0];
|
|
90
|
+
if (t !== undefined) {
|
|
91
|
+
const ratios = getRatios(t.clientX, t.clientY);
|
|
92
|
+
if (ratios !== null)
|
|
93
|
+
actionHandlers?.clicked?.(ratios.xRatio, ratios.yRatio);
|
|
94
|
+
}
|
|
66
95
|
}
|
|
67
|
-
handleOnPointer(event);
|
|
68
|
-
}, [handleOnPointer]);
|
|
69
|
-
const onPointerUp = useCallback((event) => {
|
|
70
96
|
isPointerDown.current = false;
|
|
71
|
-
|
|
72
|
-
}, [removePointerListeners]);
|
|
73
|
-
const onPointerDown = useCallback((event) => {
|
|
74
|
-
removePointerListeners();
|
|
75
|
-
isPointerDown.current = true;
|
|
76
|
-
handleOnPointer(event.nativeEvent);
|
|
77
|
-
onPointerUpRef.current = onPointerUp;
|
|
78
|
-
onPointerMoveRef.current = onPointerMove;
|
|
79
|
-
document.addEventListener('pointermove', onPointerMoveRef.current);
|
|
80
|
-
document.addEventListener('pointerup', onPointerUpRef.current);
|
|
81
|
-
}, [handleOnPointer, onPointerUp, onPointerMove, removePointerListeners]);
|
|
82
|
-
const outputRatio = ratio !== undefined ? Math.max(0, Math.min(1, ratio)) : 0;
|
|
83
|
-
const rootStyles = {
|
|
84
|
-
[`--${publicClassName}-ratio`]: outputRatio.toFixed(8),
|
|
85
|
-
[`--${publicClassName}-ratio-percent`]: `${(outputRatio * 100).toString()}%`
|
|
97
|
+
hasDragged.current = false;
|
|
86
98
|
};
|
|
99
|
+
// Classes & attributes
|
|
87
100
|
const c = clss(publicClassName, { cssModule });
|
|
88
|
-
const rootClss = mergeClassNames(c(null,
|
|
89
|
-
|
|
90
|
-
'
|
|
91
|
-
};
|
|
101
|
+
const rootClss = mergeClassNames(c(null, {
|
|
102
|
+
horizontal: mode === 'horizontal',
|
|
103
|
+
vertical: mode === 'vertical'
|
|
104
|
+
}), className);
|
|
92
105
|
const beforeClass = c('before');
|
|
93
106
|
const afterClass = c('after');
|
|
94
|
-
|
|
107
|
+
const separatorClass = c('separator');
|
|
108
|
+
const customProps = {
|
|
109
|
+
[`--${publicClassName}-ratio`]: `${round(ratio, 4)}`,
|
|
110
|
+
[`--${publicClassName}-ratio-percent`]: `${round(ratio * 100, 2)}%`
|
|
111
|
+
};
|
|
112
|
+
const dataAttributes = {
|
|
113
|
+
'data-ratio': `${round(ratio, 4)}`
|
|
114
|
+
};
|
|
115
|
+
// Rendering
|
|
116
|
+
return _jsxs("div", { ref: rootRef, className: rootClss, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { ...customProps }, ...dataAttributes, children: [_jsx("div", { className: beforeClass, children: before }), _jsx("div", { className: afterClass, children: after }), _jsx("div", { className: separatorClass })] });
|
|
95
117
|
};
|
|
@@ -3,53 +3,39 @@ import { type Props as ControlledProps } from './index.controlled.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Props for the {@link BeforeAfter} component.
|
|
5
5
|
*
|
|
6
|
-
* Extends {@link ControlledProps}
|
|
7
|
-
*
|
|
6
|
+
* Extends {@link ControlledProps} with uncontrolled defaults and state callbacks.
|
|
7
|
+
* When `ratio` is provided (inherited from {@link ControlledProps}), the component
|
|
8
|
+
* operates in controlled mode and internal state is ignored.
|
|
8
9
|
*
|
|
9
|
-
* @property defaultRatio - Initial
|
|
10
|
-
*
|
|
10
|
+
* @property defaultRatio - Initial divider position in uncontrolled mode, as a value
|
|
11
|
+
* between `0` and `1`. Ignored when `ratio` is provided. Defaults to `0.5`.
|
|
11
12
|
* @property stateHandlers - Optional callbacks invoked when derived state changes:
|
|
12
|
-
* - `
|
|
13
|
+
* - `ratioChanged` — called after the internal ratio has been updated, with the new ratio value.
|
|
13
14
|
*/
|
|
14
15
|
export type Props = ControlledProps & {
|
|
15
16
|
defaultRatio?: number;
|
|
16
|
-
direction?: 'horizontal' | 'vertical';
|
|
17
17
|
stateHandlers?: {
|
|
18
|
-
|
|
18
|
+
ratioChanged?: (ratio: number) => void;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* Extends {@link ControlledProps} with uncontrolled ratio and direction management.
|
|
25
|
-
*
|
|
26
|
-
* @property defaultRatio - Initial ratio value (0 to 1). Used if `ratio` is not provided. Defaults to `0`.
|
|
27
|
-
* @property direction - Slider orientation: `'horizontal'` (default) or `'vertical'`. If horizontal, the ratio is calced as the horizontal pointer position over the element width. If vertical, it's the vertical pointer position over the element height.
|
|
28
|
-
* @property stateHandlers - Optional callbacks invoked when derived state changes:
|
|
29
|
-
* - `ratio` — called with the new ratio whenever it changes.
|
|
30
|
-
*
|
|
31
|
-
* @see {@link ControlledProps}
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Uncontrolled, self-updating before/after slider component. Drives a
|
|
35
|
-
* {@link BeforeAfterControlled} instance with internal ratio state and direction,
|
|
36
|
-
* supporting both controlled and uncontrolled usage.
|
|
37
|
-
*
|
|
38
|
-
* Supports mixed controlled/uncontrolled usage: passing `ratio` disables internal ratio state,
|
|
39
|
-
* but still allows direction and stateHandlers to be used. Passing `defaultRatio` sets the initial ratio.
|
|
22
|
+
* Before/after comparison component with optional controlled and uncontrolled behavior.
|
|
40
23
|
*
|
|
41
|
-
*
|
|
42
|
-
* The
|
|
43
|
-
*
|
|
44
|
-
*
|
|
24
|
+
* Wraps {@link BeforeAfterControlled} and manages internal divider position when
|
|
25
|
+
* operating in uncontrolled mode. The active axis used to derive the ratio from
|
|
26
|
+
* pointer position depends on `mode`: horizontal interactions use the x ratio,
|
|
27
|
+
* vertical interactions use the y ratio.
|
|
45
28
|
*
|
|
46
|
-
*
|
|
47
|
-
* -
|
|
48
|
-
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* - In controlled mode (`ratio` defined), divider position is fully driven by the prop
|
|
31
|
+
* and internal state is never updated.
|
|
32
|
+
* - In uncontrolled mode, internal state is initialized from `defaultRatio` and updated
|
|
33
|
+
* on both drag and click interactions.
|
|
34
|
+
* - `actionHandlers.dragged` and `actionHandlers.clicked` are always forwarded to the
|
|
35
|
+
* underlying controlled component, regardless of mode.
|
|
49
36
|
*
|
|
50
37
|
* @param props - Component properties.
|
|
51
38
|
* @see {@link Props}
|
|
52
|
-
* @
|
|
53
|
-
* @returns A {@link BeforeAfterControlled} with computed ratio and orientation modifiers applied.
|
|
39
|
+
* @returns A {@link BeforeAfterControlled} instance with ratio state managed internally when uncontrolled.
|
|
54
40
|
*/
|
|
55
41
|
export declare const BeforeAfter: FunctionComponent<Props>;
|
|
@@ -1,55 +1,50 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { BeforeAfterControlled } from './index.controlled.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Before/after comparison component with optional controlled and uncontrolled behavior.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Wraps {@link BeforeAfterControlled} and manages internal divider position when
|
|
8
|
+
* operating in uncontrolled mode. The active axis used to derive the ratio from
|
|
9
|
+
* pointer position depends on `mode`: horizontal interactions use the x ratio,
|
|
10
|
+
* vertical interactions use the y ratio.
|
|
8
11
|
*
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Uncontrolled, self-updating before/after slider component. Drives a
|
|
18
|
-
* {@link BeforeAfterControlled} instance with internal ratio state and direction,
|
|
19
|
-
* supporting both controlled and uncontrolled usage.
|
|
20
|
-
*
|
|
21
|
-
* Supports mixed controlled/uncontrolled usage: passing `ratio` disables internal ratio state,
|
|
22
|
-
* but still allows direction and stateHandlers to be used. Passing `defaultRatio` sets the initial ratio.
|
|
23
|
-
*
|
|
24
|
-
* ### Forwarded modifiers to {@link BeforeAfterControlled}
|
|
25
|
-
* The following `_modifiers` are computed and injected automatically:
|
|
26
|
-
* - `horizontal` — `true`.
|
|
27
|
-
* - `vertical` — `true`.
|
|
28
|
-
*
|
|
29
|
-
* ### Forwarded CSS custom properties to {@link BeforeAfterControlled}
|
|
30
|
-
* - `--before-after-ratio` — the current ratio value (0 to 1, fixed to 8 decimals).
|
|
31
|
-
* - `--before-after-ratio-percent` — the current ratio as a percentage (0 to 100).
|
|
12
|
+
* @remarks
|
|
13
|
+
* - In controlled mode (`ratio` defined), divider position is fully driven by the prop
|
|
14
|
+
* and internal state is never updated.
|
|
15
|
+
* - In uncontrolled mode, internal state is initialized from `defaultRatio` and updated
|
|
16
|
+
* on both drag and click interactions.
|
|
17
|
+
* - `actionHandlers.dragged` and `actionHandlers.clicked` are always forwarded to the
|
|
18
|
+
* underlying controlled component, regardless of mode.
|
|
32
19
|
*
|
|
33
20
|
* @param props - Component properties.
|
|
34
21
|
* @see {@link Props}
|
|
35
|
-
* @
|
|
36
|
-
* @returns A {@link BeforeAfterControlled} with computed ratio and orientation modifiers applied.
|
|
22
|
+
* @returns A {@link BeforeAfterControlled} instance with ratio state managed internally when uncontrolled.
|
|
37
23
|
*/
|
|
38
|
-
export const BeforeAfter = ({
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
24
|
+
export const BeforeAfter = ({ mode = 'horizontal', actionHandlers, stateHandlers, ratio, defaultRatio = 0.5, ...controlledProps }) => {
|
|
25
|
+
const [internalRatio, setInternalRatio] = useState(defaultRatio);
|
|
26
|
+
const isControlled = ratio !== undefined;
|
|
27
|
+
const effectiveRatio = isControlled ? ratio : internalRatio;
|
|
28
|
+
const handleDrag = (x, y) => {
|
|
29
|
+
x = 1.02 * x - 0.01;
|
|
30
|
+
y = 1.02 * y - 0.01;
|
|
31
|
+
actionHandlers?.dragged?.(x, y);
|
|
32
|
+
if (!isControlled) {
|
|
33
|
+
setInternalRatio(mode === 'horizontal' ? x : y);
|
|
34
|
+
stateHandlers?.ratioChanged?.(mode === 'horizontal' ? x : y);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleClick = (x, y) => {
|
|
38
|
+
x = 1.02 * x - 0.01;
|
|
39
|
+
y = 1.02 * y - 0.01;
|
|
40
|
+
actionHandlers?.clicked?.(x, y);
|
|
41
|
+
if (!isControlled) {
|
|
42
|
+
setInternalRatio(mode === 'horizontal' ? x : y);
|
|
43
|
+
stateHandlers?.ratioChanged?.(mode === 'horizontal' ? x : y);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return _jsx(BeforeAfterControlled, { ...controlledProps, mode: mode, ratio: effectiveRatio, actionHandlers: {
|
|
47
|
+
dragged: handleDrag,
|
|
48
|
+
clicked: handleClick
|
|
49
|
+
} });
|
|
55
50
|
};
|
|
@@ -5,11 +5,9 @@ import type { WithClassName } from '../utils/types.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Describes a single responsive image source for use in a `<picture>` element.
|
|
7
7
|
*
|
|
8
|
-
* @property srcSet - One or more image URLs with optional width/density descriptors
|
|
9
|
-
* (e.g. `'img@2x.png 2x'`).
|
|
8
|
+
* @property srcSet - One or more image URLs with optional width/density descriptors (e.g. `'img@2x.png 2x'`).
|
|
10
9
|
* @property type - MIME type hint for the source (e.g. `'image/webp'`).
|
|
11
|
-
* @property media - Media condition under which this source is selected
|
|
12
|
-
* (e.g. `'(max-width: 768px)'`).
|
|
10
|
+
* @property media - Media condition under which this source is selected (e.g. `'(max-width: 768px)'`).
|
|
13
11
|
* @property sizes - Sizes attribute forwarded to the `<source>` element.
|
|
14
12
|
*/
|
|
15
13
|
type SourceData = {
|
|
@@ -6,14 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
.back-blocks {
|
|
8
8
|
z-index: 1;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
width: 100%;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
.scrolling-content {
|
|
14
|
+
position: relative;
|
|
12
15
|
z-index: 2;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.front-blocks {
|
|
16
19
|
z-index: 3;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
width: 100%;
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
/* Scrllgngn entering the viewport, blocks not fixed yet */
|
|
@@ -72,3 +77,8 @@ Force stick blocks option
|
|
|
72
77
|
left: 0;
|
|
73
78
|
right: 0;
|
|
74
79
|
}
|
|
80
|
+
|
|
81
|
+
.back-block > :where(*),
|
|
82
|
+
.front-block > :where(*) {
|
|
83
|
+
pointer-events: initial;
|
|
84
|
+
}
|
package/components/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as beforeAfter from './BeforeAfter/index.js'
|
|
2
|
+
export * as disclaimer from './Disclaimer/index.js'
|
|
2
3
|
export * as clippable from './Clippable/index.js'
|
|
3
4
|
export * as drawer from './Drawer/index.js'
|
|
4
5
|
export * as eventListener from './EventListener/index.js'
|
|
5
|
-
export * as disclaimer from './Disclaimer/index.js'
|
|
6
6
|
export * as gallery from './Gallery/index.js'
|
|
7
7
|
export * as iframe from './Iframe/index.js'
|
|
8
8
|
export * as image from './Image/index.js'
|
package/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as beforeAfter from './BeforeAfter/index.js'
|
|
2
|
+
export * as disclaimer from './Disclaimer/index.js'
|
|
2
3
|
export * as clippable from './Clippable/index.js'
|
|
3
4
|
export * as drawer from './Drawer/index.js'
|
|
4
5
|
export * as eventListener from './EventListener/index.js'
|
|
5
|
-
export * as disclaimer from './Disclaimer/index.js'
|
|
6
6
|
export * as gallery from './Gallery/index.js'
|
|
7
7
|
export * as iframe from './Iframe/index.js'
|
|
8
8
|
export * as image from './Image/index.js'
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -8,5 +8,5 @@ export * as move from './move/index.js'
|
|
|
8
8
|
export * as remove from './remove/index.js'
|
|
9
9
|
export * as revokeSignedUrls from './revoke-signed-urls/index.js'
|
|
10
10
|
export * as stat from './stat/index.js'
|
|
11
|
-
export * as upload from './upload/index.js'
|
|
12
11
|
export * as updateMetadata from './update-metadata/index.js'
|
|
12
|
+
export * as upload from './upload/index.js'
|
|
@@ -8,5 +8,5 @@ export * as move from './move/index.js'
|
|
|
8
8
|
export * as remove from './remove/index.js'
|
|
9
9
|
export * as revokeSignedUrls from './revoke-signed-urls/index.js'
|
|
10
10
|
export * as stat from './stat/index.js'
|
|
11
|
-
export * as upload from './upload/index.js'
|
|
12
11
|
export * as updateMetadata from './update-metadata/index.js'
|
|
12
|
+
export * as upload from './upload/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'
|
package/node/files/index.d.ts
CHANGED
package/node/files/index.js
CHANGED
package/node/images/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export * as create from './create/index.js'
|
|
1
2
|
export * as format from './format/index.js'
|
|
2
3
|
export * as metadata from './metadata/index.js'
|
|
3
4
|
export * as transform from './transform/index.js'
|
|
4
5
|
export * as utils from './utils/index.js'
|
|
5
|
-
export * as create from './create/index.js'
|
package/node/images/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export * as create from './create/index.js'
|
|
1
2
|
export * as format from './format/index.js'
|
|
2
3
|
export * as metadata from './metadata/index.js'
|
|
3
4
|
export * as transform from './transform/index.js'
|
|
4
5
|
export * as utils from './utils/index.js'
|
|
5
|
-
export * as create from './create/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as blur from './blur/index.js'
|
|
2
|
-
export * as brighten from './brighten/index.js'
|
|
3
2
|
export * as extend from './extend/index.js'
|
|
3
|
+
export * as brighten from './brighten/index.js'
|
|
4
4
|
export * as extract from './extract/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
6
|
export * as flip from './flip/index.js'
|
|
@@ -8,8 +8,8 @@ export * as flop from './flop/index.js'
|
|
|
8
8
|
export * as hue from './hue/index.js'
|
|
9
9
|
export * as level from './level/index.js'
|
|
10
10
|
export * as lighten from './lighten/index.js'
|
|
11
|
-
export * as normalize from './normalize/index.js'
|
|
12
11
|
export * as overlay from './overlay/index.js'
|
|
12
|
+
export * as normalize from './normalize/index.js'
|
|
13
13
|
export * as resize from './resize/index.js'
|
|
14
14
|
export * as rotate from './rotate/index.js'
|
|
15
15
|
export * as saturate from './saturate/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as blur from './blur/index.js'
|
|
2
|
-
export * as brighten from './brighten/index.js'
|
|
3
2
|
export * as extend from './extend/index.js'
|
|
3
|
+
export * as brighten from './brighten/index.js'
|
|
4
4
|
export * as extract from './extract/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
6
|
export * as flip from './flip/index.js'
|
|
@@ -8,8 +8,8 @@ export * as flop from './flop/index.js'
|
|
|
8
8
|
export * as hue from './hue/index.js'
|
|
9
9
|
export * as level from './level/index.js'
|
|
10
10
|
export * as lighten from './lighten/index.js'
|
|
11
|
-
export * as normalize from './normalize/index.js'
|
|
12
11
|
export * as overlay from './overlay/index.js'
|
|
12
|
+
export * as normalize from './normalize/index.js'
|
|
13
13
|
export * as resize from './resize/index.js'
|
|
14
14
|
export * as rotate from './rotate/index.js'
|
|
15
15
|
export * as saturate from './saturate/index.js'
|