@design-edito/tools 0.5.36 → 0.5.38
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/colors/index.d.ts +1 -1
- package/agnostic/colors/index.js +1 -1
- package/agnostic/css/index.d.ts +1 -1
- package/agnostic/css/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +1 -1
- package/agnostic/html/index.d.ts +2 -2
- package/agnostic/html/index.js +2 -2
- package/agnostic/misc/index.d.ts +2 -2
- package/agnostic/misc/index.js +2 -2
- package/agnostic/strings/index.d.ts +3 -3
- package/agnostic/strings/index.js +3 -3
- package/agnostic/time/index.d.ts +2 -2
- package/agnostic/time/index.js +2 -2
- package/components/UIModule/index.d.ts +14 -9
- package/components/UIModule/index.js +17 -12
- package/components/index.d.ts +2 -2
- package/components/index.js +2 -2
- package/node/@aws-s3/storage/directory/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/index.js +1 -1
- package/node/@aws-s3/storage/file/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/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/encryption/@aes-256-gcm/index.d.ts +1 -1
- package/node/encryption/@aes-256-gcm/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/node/index.d.ts +1 -1
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
|
-
export * as contrast from './contrast/index.js'
|
|
3
2
|
export * as convert from './convert/index.js'
|
|
3
|
+
export * as contrast from './contrast/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'
|
package/agnostic/colors/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as channels from './channels/index.js'
|
|
2
|
-
export * as contrast from './contrast/index.js'
|
|
3
2
|
export * as convert from './convert/index.js'
|
|
3
|
+
export * as contrast from './contrast/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'
|
package/agnostic/css/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export * as bem from './bem/index.js'
|
|
1
2
|
export * as clss from './clss/index.js'
|
|
2
3
|
export * as generateNiceColor from './generate-nice-color/index.js'
|
|
3
4
|
export * as isValidCssClassName from './is-valid-css-class-name/index.js'
|
|
4
5
|
export * as scale from './scale/index.js'
|
|
5
6
|
export * as stylesSet from './styles-set/index.js'
|
|
6
|
-
export * as bem from './bem/index.js'
|
package/agnostic/css/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export * as bem from './bem/index.js'
|
|
1
2
|
export * as clss from './clss/index.js'
|
|
2
3
|
export * as generateNiceColor from './generate-nice-color/index.js'
|
|
3
4
|
export * as isValidCssClassName from './is-valid-css-class-name/index.js'
|
|
4
5
|
export * as scale from './scale/index.js'
|
|
5
6
|
export * as stylesSet from './styles-set/index.js'
|
|
6
|
-
export * as bem from './bem/index.js'
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
|
+
export * as and from './and/index.js'
|
|
2
3
|
export * as addclass from './addclass/index.js'
|
|
3
4
|
export * as append from './append/index.js'
|
|
4
5
|
export * as at from './at/index.js'
|
|
5
6
|
export * as call from './call/index.js'
|
|
6
|
-
export * as and from './and/index.js'
|
|
7
7
|
export * as clone from './clone/index.js'
|
|
8
|
-
export * as equals from './equals/index.js'
|
|
9
8
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
10
|
-
export * as
|
|
9
|
+
export * as equals from './equals/index.js'
|
|
11
10
|
export * as getattribute from './getattribute/index.js'
|
|
11
|
+
export * as getproperties from './getproperties/index.js'
|
|
12
12
|
export * as getproperty from './getproperty/index.js'
|
|
13
|
-
export * as if from './if/index.js'
|
|
14
13
|
export * as hjparse from './hjparse/index.js'
|
|
15
14
|
export * as hjstringify from './hjstringify/index.js'
|
|
16
|
-
export * as
|
|
15
|
+
export * as if from './if/index.js'
|
|
17
16
|
export * as join from './join/index.js'
|
|
17
|
+
export * as initialize from './initialize/index.js'
|
|
18
18
|
export * as length from './length/index.js'
|
|
19
19
|
export * as map from './map/index.js'
|
|
20
20
|
export * as negate from './negate/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
|
+
export * as or from './or/index.js'
|
|
22
23
|
export * as pickrandom from './pickrandom/index.js'
|
|
23
24
|
export * as populate from './populate/index.js'
|
|
24
25
|
export * as print from './print/index.js'
|
|
25
26
|
export * as push from './push/index.js'
|
|
26
|
-
export * as recordtoarray from './recordtoarray/index.js'
|
|
27
27
|
export * as pusheach from './pusheach/index.js'
|
|
28
|
-
export * as or from './or/index.js'
|
|
29
28
|
export * as removeattribute from './removeattribute/index.js'
|
|
30
|
-
export * as
|
|
29
|
+
export * as recordtoarray from './recordtoarray/index.js'
|
|
31
30
|
export * as removeclass from './removeclass/index.js'
|
|
31
|
+
export * as renameproperty from './renameproperty/index.js'
|
|
32
32
|
export * as replace from './replace/index.js'
|
|
33
33
|
export * as select from './select/index.js'
|
|
34
34
|
export * as set from './set/index.js'
|
|
35
35
|
export * as setattribute from './setattribute/index.js'
|
|
36
36
|
export * as setproperty from './setproperty/index.js'
|
|
37
37
|
export * as sorton from './sorton/index.js'
|
|
38
|
+
export * as split from './split/index.js'
|
|
38
39
|
export * as spread from './spread/index.js'
|
|
39
40
|
export * as toarray from './toarray/index.js'
|
|
40
41
|
export * as toboolean from './toboolean/index.js'
|
|
41
|
-
export * as split from './split/index.js'
|
|
42
42
|
export * as toelement from './toelement/index.js'
|
|
43
43
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
44
|
export * as tonodelist from './tonodelist/index.js'
|
|
45
|
+
export * as tonull from './tonull/index.js'
|
|
45
46
|
export * as tonumber from './tonumber/index.js'
|
|
46
47
|
export * as torecord from './torecord/index.js'
|
|
47
|
-
export * as tonull from './tonull/index.js'
|
|
48
48
|
export * as tostring from './tostring/index.js'
|
|
49
|
-
export * as toref from './toref/index.js'
|
|
50
|
-
export * as transformselected from './transformselected/index.js'
|
|
51
49
|
export * as totext from './totext/index.js'
|
|
50
|
+
export * as transformselected from './transformselected/index.js'
|
|
52
51
|
export * as trim from './trim/index.js'
|
|
52
|
+
export * as toref from './toref/index.js'
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
|
+
export * as and from './and/index.js'
|
|
2
3
|
export * as addclass from './addclass/index.js'
|
|
3
4
|
export * as append from './append/index.js'
|
|
4
5
|
export * as at from './at/index.js'
|
|
5
6
|
export * as call from './call/index.js'
|
|
6
|
-
export * as and from './and/index.js'
|
|
7
7
|
export * as clone from './clone/index.js'
|
|
8
|
-
export * as equals from './equals/index.js'
|
|
9
8
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
10
|
-
export * as
|
|
9
|
+
export * as equals from './equals/index.js'
|
|
11
10
|
export * as getattribute from './getattribute/index.js'
|
|
11
|
+
export * as getproperties from './getproperties/index.js'
|
|
12
12
|
export * as getproperty from './getproperty/index.js'
|
|
13
|
-
export * as if from './if/index.js'
|
|
14
13
|
export * as hjparse from './hjparse/index.js'
|
|
15
14
|
export * as hjstringify from './hjstringify/index.js'
|
|
16
|
-
export * as
|
|
15
|
+
export * as if from './if/index.js'
|
|
17
16
|
export * as join from './join/index.js'
|
|
17
|
+
export * as initialize from './initialize/index.js'
|
|
18
18
|
export * as length from './length/index.js'
|
|
19
19
|
export * as map from './map/index.js'
|
|
20
20
|
export * as negate from './negate/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
|
+
export * as or from './or/index.js'
|
|
22
23
|
export * as pickrandom from './pickrandom/index.js'
|
|
23
24
|
export * as populate from './populate/index.js'
|
|
24
25
|
export * as print from './print/index.js'
|
|
25
26
|
export * as push from './push/index.js'
|
|
26
|
-
export * as recordtoarray from './recordtoarray/index.js'
|
|
27
27
|
export * as pusheach from './pusheach/index.js'
|
|
28
|
-
export * as or from './or/index.js'
|
|
29
28
|
export * as removeattribute from './removeattribute/index.js'
|
|
30
|
-
export * as
|
|
29
|
+
export * as recordtoarray from './recordtoarray/index.js'
|
|
31
30
|
export * as removeclass from './removeclass/index.js'
|
|
31
|
+
export * as renameproperty from './renameproperty/index.js'
|
|
32
32
|
export * as replace from './replace/index.js'
|
|
33
33
|
export * as select from './select/index.js'
|
|
34
34
|
export * as set from './set/index.js'
|
|
35
35
|
export * as setattribute from './setattribute/index.js'
|
|
36
36
|
export * as setproperty from './setproperty/index.js'
|
|
37
37
|
export * as sorton from './sorton/index.js'
|
|
38
|
+
export * as split from './split/index.js'
|
|
38
39
|
export * as spread from './spread/index.js'
|
|
39
40
|
export * as toarray from './toarray/index.js'
|
|
40
41
|
export * as toboolean from './toboolean/index.js'
|
|
41
|
-
export * as split from './split/index.js'
|
|
42
42
|
export * as toelement from './toelement/index.js'
|
|
43
43
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
44
|
export * as tonodelist from './tonodelist/index.js'
|
|
45
|
+
export * as tonull from './tonull/index.js'
|
|
45
46
|
export * as tonumber from './tonumber/index.js'
|
|
46
47
|
export * as torecord from './torecord/index.js'
|
|
47
|
-
export * as tonull from './tonull/index.js'
|
|
48
48
|
export * as tostring from './tostring/index.js'
|
|
49
|
-
export * as toref from './toref/index.js'
|
|
50
|
-
export * as transformselected from './transformselected/index.js'
|
|
51
49
|
export * as totext from './totext/index.js'
|
|
50
|
+
export * as transformselected from './transformselected/index.js'
|
|
52
51
|
export * as trim from './trim/index.js'
|
|
52
|
+
export * as toref from './toref/index.js'
|
|
@@ -7,7 +7,7 @@ export * as guess from './guess/index.js'
|
|
|
7
7
|
export * as nodelist from './nodelist/index.js'
|
|
8
8
|
export * as null from './null/index.js'
|
|
9
9
|
export * as number from './number/index.js'
|
|
10
|
-
export * as ref from './ref/index.js'
|
|
11
10
|
export * as record from './record/index.js'
|
|
11
|
+
export * as ref from './ref/index.js'
|
|
12
12
|
export * as string from './string/index.js'
|
|
13
13
|
export * as text from './text/index.js'
|
|
@@ -7,7 +7,7 @@ export * as guess from './guess/index.js'
|
|
|
7
7
|
export * as nodelist from './nodelist/index.js'
|
|
8
8
|
export * as null from './null/index.js'
|
|
9
9
|
export * as number from './number/index.js'
|
|
10
|
-
export * as ref from './ref/index.js'
|
|
11
10
|
export * as record from './record/index.js'
|
|
11
|
+
export * as ref from './ref/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
|
@@ -3,8 +3,8 @@ export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
|
3
3
|
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
4
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
5
|
export * as insertNode from './insert-node/index.js'
|
|
6
|
-
export * as selectorToElement from './selector-to-element/index.js'
|
|
7
6
|
export * as placeholders from './placeholders/index.js'
|
|
8
|
-
export * as
|
|
7
|
+
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
8
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
9
|
+
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
10
|
export * as watchSelection from './watch-selection/index.js'
|
package/agnostic/html/index.js
CHANGED
|
@@ -3,8 +3,8 @@ export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
|
3
3
|
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
4
4
|
export * as hyperJson from './hyper-json/index.js'
|
|
5
5
|
export * as insertNode from './insert-node/index.js'
|
|
6
|
-
export * as selectorToElement from './selector-to-element/index.js'
|
|
7
6
|
export * as placeholders from './placeholders/index.js'
|
|
8
|
-
export * as
|
|
7
|
+
export * as selectorToElement from './selector-to-element/index.js'
|
|
9
8
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
9
|
+
export * as stringToNodes from './string-to-nodes/index.js'
|
|
10
10
|
export * as watchSelection from './watch-selection/index.js'
|
package/agnostic/misc/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as assert from './assert/index.js'
|
|
2
2
|
export * as cast from './cast/index.js'
|
|
3
3
|
export * as connection from './connection/index.js'
|
|
4
|
-
export * as crossenv from './crossenv/index.js'
|
|
5
4
|
export * as crawler from './crawler/index.js'
|
|
5
|
+
export * as crossenv from './crossenv/index.js'
|
|
6
6
|
export * as dataSize from './data-size/index.js'
|
|
7
7
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
8
|
-
export * as logs from './logs/index.js'
|
|
9
8
|
export * as isNullish from './is-nullish/index.js'
|
|
9
|
+
export * as logs from './logs/index.js'
|
|
10
10
|
export * as loremIpsum from './lorem-ipsum/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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * as assert from './assert/index.js'
|
|
2
2
|
export * as cast from './cast/index.js'
|
|
3
3
|
export * as connection from './connection/index.js'
|
|
4
|
-
export * as crossenv from './crossenv/index.js'
|
|
5
4
|
export * as crawler from './crawler/index.js'
|
|
5
|
+
export * as crossenv from './crossenv/index.js'
|
|
6
6
|
export * as dataSize from './data-size/index.js'
|
|
7
7
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
8
|
-
export * as logs from './logs/index.js'
|
|
9
8
|
export * as isNullish from './is-nullish/index.js'
|
|
9
|
+
export * as logs from './logs/index.js'
|
|
10
10
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
11
11
|
export * as normalizeExtension from './normalize-extension/index.js'
|
|
12
12
|
export * as outcome from './outcome/index.js'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * as matches from './matches/index.js'
|
|
2
|
-
export * as parseTable from './parse-table/index.js'
|
|
3
1
|
export * as charCodes from './char-codes/index.js'
|
|
2
|
+
export * as matches from './matches/index.js'
|
|
4
3
|
export * as normalizeIndent from './normalize-indent/index.js'
|
|
4
|
+
export * as parseTable from './parse-table/index.js'
|
|
5
5
|
export * as replaceAll from './replace-all/index.js'
|
|
6
|
-
export * as toAlphanum from './to-alphanum/index.js'
|
|
7
6
|
export * as splitTrim from './split-trim/index.js'
|
|
7
|
+
export * as toAlphanum from './to-alphanum/index.js'
|
|
8
8
|
export * as trim from './trim/index.js'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * as matches from './matches/index.js'
|
|
2
|
-
export * as parseTable from './parse-table/index.js'
|
|
3
1
|
export * as charCodes from './char-codes/index.js'
|
|
2
|
+
export * as matches from './matches/index.js'
|
|
4
3
|
export * as normalizeIndent from './normalize-indent/index.js'
|
|
4
|
+
export * as parseTable from './parse-table/index.js'
|
|
5
5
|
export * as replaceAll from './replace-all/index.js'
|
|
6
|
-
export * as toAlphanum from './to-alphanum/index.js'
|
|
7
6
|
export * as splitTrim from './split-trim/index.js'
|
|
7
|
+
export * as toAlphanum from './to-alphanum/index.js'
|
|
8
8
|
export * as trim from './trim/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'
|
|
3
|
-
export * as transitions from './transitions/index.js'
|
|
4
2
|
export * as timeout from './timeout/index.js'
|
|
3
|
+
export * as transitions from './transitions/index.js'
|
|
5
4
|
export * as wait from './wait/index.js'
|
|
5
|
+
export * as dates from './dates/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'
|
|
3
|
-
export * as transitions from './transitions/index.js'
|
|
4
2
|
export * as timeout from './timeout/index.js'
|
|
3
|
+
export * as transitions from './transitions/index.js'
|
|
5
4
|
export * as wait from './wait/index.js'
|
|
5
|
+
export * as dates from './dates/index.js'
|
|
@@ -11,7 +11,9 @@ import type { WithClassName } from '../utils/types.js';
|
|
|
11
11
|
* error state.
|
|
12
12
|
* @property postInit - Optional. Called once, right after the element returned by
|
|
13
13
|
* `init` has been appended. First point at which the module holds an attached
|
|
14
|
-
* element: layout can be measured and ancestors reached.
|
|
14
|
+
* element: layout can be measured and ancestors reached. **May return a teardown
|
|
15
|
+
* function**, run at unmount before `destroy` — which lets whatever it set up stay in
|
|
16
|
+
* its own closure instead of being filed somewhere `destroy` can find it again.
|
|
15
17
|
* @property update - Optional. Called when the `props` object changes identity,
|
|
16
18
|
* once the module is live. Compared by reference, not by value — a consumer passing
|
|
17
19
|
* an inline object gets one call per render, one passing a stable reference gets one
|
|
@@ -19,16 +21,18 @@ import type { WithClassName } from '../utils/types.js';
|
|
|
19
21
|
* @property destroy - Optional. Called when the component unmounts or `src` changes.
|
|
20
22
|
* Receives the `Element` previously returned by `init`. Use it to tear down event
|
|
21
23
|
* listeners, timers, or third-party instances.
|
|
22
|
-
* @property css - Optional
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* @property css - Optional stylesheet, injected in a `<style>` and wrapped in
|
|
25
|
+
* `.<publicClassName>#<id> { … }` so it reaches this instance and nothing else.
|
|
26
|
+
* **Write rules, not bare declarations**: a declaration would land on the host, which
|
|
27
|
+
* the module does not own — the consumer styles it, and the two would fight. Rules are
|
|
28
|
+
* resolved by CSS nesting, so they need only name what `init` built.
|
|
25
29
|
*/
|
|
26
30
|
type ModuleData = {
|
|
27
31
|
init: (props: Record<string, unknown>) => Element;
|
|
28
|
-
postInit?: (target: Element, props: Record<string, unknown>) => void;
|
|
32
|
+
postInit?: (target: Element, props: Record<string, unknown>) => void | (() => void);
|
|
29
33
|
update?: (target: Element, props: Record<string, unknown>) => void;
|
|
30
34
|
destroy?: (target: Element) => void;
|
|
31
|
-
css?: string
|
|
35
|
+
css?: string;
|
|
32
36
|
};
|
|
33
37
|
/**
|
|
34
38
|
* Props for the {@link UIModule} component.
|
|
@@ -69,7 +73,8 @@ export type Props = WithClassName<{
|
|
|
69
73
|
* ### Lifecycle
|
|
70
74
|
* `init(props)` builds the element, **detached**. It is appended, then `postInit`
|
|
71
75
|
* runs on it attached. `update` follows each change of the `props` object's
|
|
72
|
-
* identity
|
|
76
|
+
* identity. At unmount, or when `src` changes, the teardown `postInit` returned runs
|
|
77
|
+
* first, then `destroy`.
|
|
73
78
|
*
|
|
74
79
|
* ### CSS modifiers
|
|
75
80
|
* Reflecting the current load lifecycle:
|
|
@@ -82,13 +87,13 @@ export type Props = WithClassName<{
|
|
|
82
87
|
*
|
|
83
88
|
* ### Root element attributes
|
|
84
89
|
* - `id` — a stable generated id, assigned once on mount and used to scope the
|
|
85
|
-
* module's `css`
|
|
90
|
+
* module's `css` to this specific instance.
|
|
86
91
|
*
|
|
87
92
|
* @param props - Component properties.
|
|
88
93
|
* @see {@link Props}
|
|
89
94
|
* @see {@link ModuleData}
|
|
90
95
|
* @returns A host `<div>` into which the module's root `Element` is appended,
|
|
91
|
-
* along with
|
|
96
|
+
* along with the `<style>` the module exported, if any.
|
|
92
97
|
*/
|
|
93
98
|
export declare const UIModule: FunctionComponent<Props>;
|
|
94
99
|
export {};
|
|
@@ -20,7 +20,8 @@ import cssModule from './styles.module.css';
|
|
|
20
20
|
* ### Lifecycle
|
|
21
21
|
* `init(props)` builds the element, **detached**. It is appended, then `postInit`
|
|
22
22
|
* runs on it attached. `update` follows each change of the `props` object's
|
|
23
|
-
* identity
|
|
23
|
+
* identity. At unmount, or when `src` changes, the teardown `postInit` returned runs
|
|
24
|
+
* first, then `destroy`.
|
|
24
25
|
*
|
|
25
26
|
* ### CSS modifiers
|
|
26
27
|
* Reflecting the current load lifecycle:
|
|
@@ -33,13 +34,13 @@ import cssModule from './styles.module.css';
|
|
|
33
34
|
*
|
|
34
35
|
* ### Root element attributes
|
|
35
36
|
* - `id` — a stable generated id, assigned once on mount and used to scope the
|
|
36
|
-
* module's `css`
|
|
37
|
+
* module's `css` to this specific instance.
|
|
37
38
|
*
|
|
38
39
|
* @param props - Component properties.
|
|
39
40
|
* @see {@link Props}
|
|
40
41
|
* @see {@link ModuleData}
|
|
41
42
|
* @returns A host `<div>` into which the module's root `Element` is appended,
|
|
42
|
-
* along with
|
|
43
|
+
* along with the `<style>` the module exported, if any.
|
|
43
44
|
*/
|
|
44
45
|
export const UIModule = ({ src, props, onIdGenerated, onIsLoadingChanged, onLoadedModuleChanged, onModuleTargetChanged, className }) => {
|
|
45
46
|
// State & refs
|
|
@@ -79,12 +80,8 @@ export const UIModule = ({ src, props, onIdGenerated, onIsLoadingChanged, onLoad
|
|
|
79
80
|
return setLoadedModule(new Error('Module exported member `destroy` must be a function'));
|
|
80
81
|
if ('postInit' in data && typeof data.postInit !== 'function')
|
|
81
82
|
return setLoadedModule(new Error('Module exported member `postInit` must be a function'));
|
|
82
|
-
if ('css' in data)
|
|
83
|
-
|
|
84
|
-
return setLoadedModule(new Error('Module exported member `css` must be an array of strings'));
|
|
85
|
-
if (data.css.some(entry => typeof entry !== 'string'))
|
|
86
|
-
return setLoadedModule(new Error('Module exported member `css` must be an array of strings'));
|
|
87
|
-
}
|
|
83
|
+
if ('css' in data && typeof data.css !== 'string')
|
|
84
|
+
return setLoadedModule(new Error('Module exported member `css` must be a string'));
|
|
88
85
|
if ('update' in data && typeof data.update !== 'function')
|
|
89
86
|
return setLoadedModule(new Error('Module exported member `update` must be a function'));
|
|
90
87
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- shape fully validated by the checks above
|
|
@@ -113,6 +110,9 @@ export const UIModule = ({ src, props, onIdGenerated, onIsLoadingChanged, onLoad
|
|
|
113
110
|
const liveInstance = liveInstanceRef.current;
|
|
114
111
|
if (liveInstance === null)
|
|
115
112
|
return;
|
|
113
|
+
// The teardown `postInit` handed back first: it undoes what `postInit` did, so it
|
|
114
|
+
// runs in reverse order of construction.
|
|
115
|
+
liveInstance.cleanup?.();
|
|
116
116
|
liveInstance.module.destroy?.(liveInstance.target);
|
|
117
117
|
liveInstanceRef.current = null;
|
|
118
118
|
};
|
|
@@ -132,7 +132,12 @@ export const UIModule = ({ src, props, onIdGenerated, onIsLoadingChanged, onLoad
|
|
|
132
132
|
if (rootRef.current === null)
|
|
133
133
|
return;
|
|
134
134
|
rootRef.current.appendChild(moduleTarget);
|
|
135
|
-
liveInstanceRef.current
|
|
135
|
+
const liveInstance = liveInstanceRef.current;
|
|
136
|
+
if (liveInstance === null)
|
|
137
|
+
return;
|
|
138
|
+
const cleanup = liveInstance.module.postInit?.(moduleTarget, propsRef.current ?? {});
|
|
139
|
+
if (typeof cleanup === 'function')
|
|
140
|
+
liveInstance.cleanup = cleanup;
|
|
136
141
|
}, [moduleTarget]);
|
|
137
142
|
// Fx. dep. `props` - hand a props change to a module that is already live. Compared
|
|
138
143
|
// by reference: the component knows nothing of the values, so it leaves the call to
|
|
@@ -153,6 +158,6 @@ export const UIModule = ({ src, props, onIdGenerated, onIsLoadingChanged, onLoad
|
|
|
153
158
|
'loaded': !isLoading && loadedModule !== null && !hasErrored,
|
|
154
159
|
'initialized': moduleTarget !== null
|
|
155
160
|
}), className);
|
|
156
|
-
const moduleCss = hasErrored || loadedModule === null ?
|
|
157
|
-
return _jsx("div", { className: rootClss, ref: rootRef, id: id, children: moduleCss
|
|
161
|
+
const moduleCss = hasErrored || loadedModule === null ? undefined : loadedModule.css;
|
|
162
|
+
return _jsx("div", { className: rootClss, ref: rootRef, id: id, children: moduleCss !== undefined && _jsx("style", { children: `.${publicClassName}#${id} { ${moduleCss} }` }) });
|
|
158
163
|
};
|
package/components/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as beforeAfter from './BeforeAfter/index.js'
|
|
2
|
-
export * as button from './Button/index.js'
|
|
3
2
|
export * as clippable from './Clippable/index.js'
|
|
3
|
+
export * as button from './Button/index.js'
|
|
4
4
|
export * as disclaimer from './Disclaimer/index.js'
|
|
5
5
|
export * as drawer from './Drawer/index.js'
|
|
6
6
|
export * as eventListener from './EventListener/index.js'
|
|
@@ -11,8 +11,8 @@ 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
13
|
export * as lightbox from './Lightbox/index.js'
|
|
14
|
-
export * as listLoader from './ListLoader/index.js'
|
|
15
14
|
export * as overlayer from './Overlayer/index.js'
|
|
15
|
+
export * as listLoader from './ListLoader/index.js'
|
|
16
16
|
export * as paginator from './Paginator/index.js'
|
|
17
17
|
export * as resizeObserver from './ResizeObserver/index.js'
|
|
18
18
|
export * as scrllgngn from './Scrllgngn/index.js'
|
package/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as beforeAfter from './BeforeAfter/index.js'
|
|
2
|
-
export * as button from './Button/index.js'
|
|
3
2
|
export * as clippable from './Clippable/index.js'
|
|
3
|
+
export * as button from './Button/index.js'
|
|
4
4
|
export * as disclaimer from './Disclaimer/index.js'
|
|
5
5
|
export * as drawer from './Drawer/index.js'
|
|
6
6
|
export * as eventListener from './EventListener/index.js'
|
|
@@ -11,8 +11,8 @@ 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
13
|
export * as lightbox from './Lightbox/index.js'
|
|
14
|
-
export * as listLoader from './ListLoader/index.js'
|
|
15
14
|
export * as overlayer from './Overlayer/index.js'
|
|
15
|
+
export * as listLoader from './ListLoader/index.js'
|
|
16
16
|
export * as paginator from './Paginator/index.js'
|
|
17
17
|
export * as resizeObserver from './ResizeObserver/index.js'
|
|
18
18
|
export * as scrllgngn from './Scrllgngn/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'
|
|
@@ -5,7 +5,7 @@ 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'
|
|
7
7
|
export * as moveFile from './move-file/index.js'
|
|
8
|
-
export * as removeDir from './remove-dir/index.js'
|
|
9
8
|
export * as removeFile from './remove-file/index.js'
|
|
9
|
+
export * as removeDir from './remove-dir/index.js'
|
|
10
10
|
export * as statFile from './stat-file/index.js'
|
|
11
11
|
export * as uploadFile from './upload-file/index.js'
|
|
@@ -5,7 +5,7 @@ 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'
|
|
7
7
|
export * as moveFile from './move-file/index.js'
|
|
8
|
-
export * as removeDir from './remove-dir/index.js'
|
|
9
8
|
export * as removeFile from './remove-file/index.js'
|
|
9
|
+
export * as removeDir from './remove-dir/index.js'
|
|
10
10
|
export * as statFile from './stat-file/index.js'
|
|
11
11
|
export * as uploadFile from './upload-file/index.js'
|
package/node/images/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as create from './create/index.js'
|
|
2
|
-
export * as metadata from './metadata/index.js'
|
|
3
2
|
export * as format from './format/index.js'
|
|
3
|
+
export * as metadata from './metadata/index.js'
|
|
4
4
|
export * as transform from './transform/index.js'
|
|
5
5
|
export * as utils from './utils/index.js'
|
package/node/images/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as create from './create/index.js'
|
|
2
|
-
export * as metadata from './metadata/index.js'
|
|
3
2
|
export * as format from './format/index.js'
|
|
3
|
+
export * as metadata from './metadata/index.js'
|
|
4
4
|
export * as transform from './transform/index.js'
|
|
5
5
|
export * as utils from './utils/index.js'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * as brighten from './brighten/index.js'
|
|
2
1
|
export * as blur from './blur/index.js'
|
|
2
|
+
export * as brighten from './brighten/index.js'
|
|
3
3
|
export * as extend from './extend/index.js'
|
|
4
4
|
export * as extract from './extract/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
|
-
export * as flop from './flop/index.js'
|
|
7
6
|
export * as flip from './flip/index.js'
|
|
7
|
+
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'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * as brighten from './brighten/index.js'
|
|
2
1
|
export * as blur from './blur/index.js'
|
|
2
|
+
export * as brighten from './brighten/index.js'
|
|
3
3
|
export * as extend from './extend/index.js'
|
|
4
4
|
export * as extract from './extract/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
|
-
export * as flop from './flop/index.js'
|
|
7
6
|
export * as flip from './flip/index.js'
|
|
7
|
+
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'
|
package/node/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as designEdito from './@design-edito/index.js'
|
|
2
1
|
export * as awsS3 from './@aws-s3/index.js'
|
|
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
5
|
export * as cloudStorage from './cloud-storage/index.js'
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * as designEdito from './@design-edito/index.js'
|
|
2
1
|
export * as awsS3 from './@aws-s3/index.js'
|
|
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
5
|
export * as cloudStorage from './cloud-storage/index.js'
|