@design-edito/tools 0.4.12 → 0.4.14

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 (50) hide show
  1. package/agnostic/css/index.d.ts +2 -2
  2. package/agnostic/css/index.js +2 -2
  3. package/agnostic/html/deep-select/index.js +3 -3
  4. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +10 -10
  5. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +10 -10
  6. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +2 -2
  7. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +2 -2
  8. package/agnostic/html/index.d.ts +2 -2
  9. package/agnostic/html/index.js +2 -2
  10. package/agnostic/index.d.ts +2 -2
  11. package/agnostic/index.js +2 -2
  12. package/agnostic/misc/crossenv/index.d.ts +1 -1
  13. package/agnostic/misc/crossenv/index.js +1 -1
  14. package/agnostic/misc/index.d.ts +1 -1
  15. package/agnostic/misc/index.js +1 -1
  16. package/agnostic/misc/logs/index.d.ts +1 -1
  17. package/agnostic/misc/logs/index.js +1 -1
  18. package/agnostic/numbers/index.d.ts +2 -2
  19. package/agnostic/numbers/index.js +2 -2
  20. package/agnostic/objects/index.d.ts +3 -3
  21. package/agnostic/objects/index.js +3 -3
  22. package/agnostic/optim/index.d.ts +1 -1
  23. package/agnostic/optim/index.js +1 -1
  24. package/agnostic/sanitization/index.d.ts +1 -1
  25. package/agnostic/sanitization/index.js +1 -1
  26. package/agnostic/strings/index.d.ts +2 -2
  27. package/agnostic/strings/index.js +2 -2
  28. package/agnostic/time/index.d.ts +1 -1
  29. package/agnostic/time/index.js +1 -1
  30. package/components/Clippable/index.d.ts +49 -0
  31. package/components/Clippable/index.js +72 -0
  32. package/components/Clippable/styles.module.css +0 -0
  33. package/components/Iframe/index.d.ts +48 -0
  34. package/components/Iframe/index.js +43 -0
  35. package/components/Iframe/styles.module.css +0 -0
  36. package/components/index.d.ts +3 -1
  37. package/components/index.js +3 -1
  38. package/components/public-classnames.d.ts +2 -0
  39. package/components/public-classnames.js +2 -0
  40. package/node/@aws-s3/storage/directory/index.d.ts +1 -1
  41. package/node/@aws-s3/storage/directory/index.js +1 -1
  42. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  43. package/node/@google-cloud/storage/directory/index.js +1 -1
  44. package/node/@google-cloud/storage/file/index.d.ts +1 -1
  45. package/node/@google-cloud/storage/file/index.js +1 -1
  46. package/node/cloud-storage/operations/index.d.ts +2 -2
  47. package/node/cloud-storage/operations/index.js +2 -2
  48. package/node/sftp/directory/index.d.ts +1 -1
  49. package/node/sftp/directory/index.js +1 -1
  50. package/package.json +34 -18
@@ -1,6 +1,6 @@
1
+ export * as bem from './bem/index.js'
1
2
  export * as clss from './clss/index.js'
2
- export * as generateNiceColor from './generate-nice-color/index.js'
3
3
  export * as isValidCssClassName from './is-valid-css-class-name/index.js'
4
4
  export * as scale from './scale/index.js'
5
- export * as bem from './bem/index.js'
6
5
  export * as stylesSet from './styles-set/index.js'
6
+ export * as generateNiceColor from './generate-nice-color/index.js'
@@ -1,6 +1,6 @@
1
+ export * as bem from './bem/index.js'
1
2
  export * as clss from './clss/index.js'
2
- export * as generateNiceColor from './generate-nice-color/index.js'
3
3
  export * as isValidCssClassName from './is-valid-css-class-name/index.js'
4
4
  export * as scale from './scale/index.js'
5
- export * as bem from './bem/index.js'
6
5
  export * as stylesSet from './styles-set/index.js'
6
+ export * as generateNiceColor from './generate-nice-color/index.js'
@@ -36,10 +36,10 @@ export const deepSelect = async (selector, options) => {
36
36
  const traverse = async (root) => {
37
37
  const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
38
38
  let node = walker.currentNode;
39
- while (node instanceof Element) {
40
- if (node !== root && node.matches(selector))
39
+ while (node !== null) {
40
+ if (node !== root && node instanceof Element && node.matches(selector))
41
41
  results.push(node);
42
- if (node.shadowRoot !== null)
42
+ if (node instanceof Element && node.shadowRoot !== null)
43
43
  await traverse(node.shadowRoot);
44
44
  nodeCount++;
45
45
  if (nodeCount % chunkSize === 0)
@@ -1,42 +1,42 @@
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'
4
3
  export * as append from './append/index.js'
5
- export * as call from './call/index.js'
6
4
  export * as at from './at/index.js'
5
+ export * as call from './call/index.js'
7
6
  export * as clone from './clone/index.js'
8
7
  export * as deleteproperties from './deleteproperties/index.js'
8
+ export * as addclass from './addclass/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
11
11
  export * as getproperties from './getproperties/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
- export * as hjstringify from './hjstringify/index.js'
14
+ export * as initialize from './initialize/index.js'
15
15
  export * as if from './if/index.js'
16
16
  export * as join from './join/index.js'
17
- export * as initialize from './initialize/index.js'
18
17
  export * as length from './length/index.js'
19
18
  export * as map from './map/index.js'
19
+ export * as negate from './negate/index.js'
20
20
  export * as notrailing from './notrailing/index.js'
21
21
  export * as or from './or/index.js'
22
+ export * as hjstringify from './hjstringify/index.js'
22
23
  export * as pickrandom from './pickrandom/index.js'
23
- export * as negate from './negate/index.js'
24
24
  export * as populate from './populate/index.js'
25
25
  export * as print from './print/index.js'
26
26
  export * as push from './push/index.js'
27
27
  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
- export * as renameproperty from './renameproperty/index.js'
31
30
  export * as removeclass from './removeclass/index.js'
32
- export * as replace from './replace/index.js'
31
+ export * as renameproperty from './renameproperty/index.js'
33
32
  export * as select from './select/index.js'
33
+ export * as replace from './replace/index.js'
34
+ export * as set from './set/index.js'
34
35
  export * as setattribute from './setattribute/index.js'
35
36
  export * as setproperty from './setproperty/index.js'
36
- export * as set from './set/index.js'
37
37
  export * as sorton from './sorton/index.js'
38
- export * as spread from './spread/index.js'
39
38
  export * as split from './split/index.js'
39
+ export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
41
  export * as toboolean from './toboolean/index.js'
42
42
  export * as toelement from './toelement/index.js'
@@ -45,8 +45,8 @@ export * as tonodelist from './tonodelist/index.js'
45
45
  export * as tonull from './tonull/index.js'
46
46
  export * as tonumber from './tonumber/index.js'
47
47
  export * as torecord from './torecord/index.js'
48
- export * as toref from './toref/index.js'
49
48
  export * as tostring from './tostring/index.js'
49
+ export * as toref from './toref/index.js'
50
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,42 +1,42 @@
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'
4
3
  export * as append from './append/index.js'
5
- export * as call from './call/index.js'
6
4
  export * as at from './at/index.js'
5
+ export * as call from './call/index.js'
7
6
  export * as clone from './clone/index.js'
8
7
  export * as deleteproperties from './deleteproperties/index.js'
8
+ export * as addclass from './addclass/index.js'
9
9
  export * as equals from './equals/index.js'
10
10
  export * as getattribute from './getattribute/index.js'
11
11
  export * as getproperties from './getproperties/index.js'
12
12
  export * as getproperty from './getproperty/index.js'
13
13
  export * as hjparse from './hjparse/index.js'
14
- export * as hjstringify from './hjstringify/index.js'
14
+ export * as initialize from './initialize/index.js'
15
15
  export * as if from './if/index.js'
16
16
  export * as join from './join/index.js'
17
- export * as initialize from './initialize/index.js'
18
17
  export * as length from './length/index.js'
19
18
  export * as map from './map/index.js'
19
+ export * as negate from './negate/index.js'
20
20
  export * as notrailing from './notrailing/index.js'
21
21
  export * as or from './or/index.js'
22
+ export * as hjstringify from './hjstringify/index.js'
22
23
  export * as pickrandom from './pickrandom/index.js'
23
- export * as negate from './negate/index.js'
24
24
  export * as populate from './populate/index.js'
25
25
  export * as print from './print/index.js'
26
26
  export * as push from './push/index.js'
27
27
  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
- export * as renameproperty from './renameproperty/index.js'
31
30
  export * as removeclass from './removeclass/index.js'
32
- export * as replace from './replace/index.js'
31
+ export * as renameproperty from './renameproperty/index.js'
33
32
  export * as select from './select/index.js'
33
+ export * as replace from './replace/index.js'
34
+ export * as set from './set/index.js'
34
35
  export * as setattribute from './setattribute/index.js'
35
36
  export * as setproperty from './setproperty/index.js'
36
- export * as set from './set/index.js'
37
37
  export * as sorton from './sorton/index.js'
38
- export * as spread from './spread/index.js'
39
38
  export * as split from './split/index.js'
39
+ export * as spread from './spread/index.js'
40
40
  export * as toarray from './toarray/index.js'
41
41
  export * as toboolean from './toboolean/index.js'
42
42
  export * as toelement from './toelement/index.js'
@@ -45,8 +45,8 @@ export * as tonodelist from './tonodelist/index.js'
45
45
  export * as tonull from './tonull/index.js'
46
46
  export * as tonumber from './tonumber/index.js'
47
47
  export * as torecord from './torecord/index.js'
48
- export * as toref from './toref/index.js'
49
48
  export * as tostring from './tostring/index.js'
49
+ export * as toref from './toref/index.js'
50
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'
@@ -2,12 +2,12 @@ export * as any from './any/index.js'
2
2
  export * as array from './array/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as get from './get/index.js'
6
5
  export * as guess from './guess/index.js'
7
6
  export * as nodelist from './nodelist/index.js'
8
- export * as null from './null/index.js'
9
7
  export * as number from './number/index.js'
8
+ export * as get from './get/index.js'
10
9
  export * as record from './record/index.js'
11
10
  export * as ref from './ref/index.js'
12
11
  export * as string from './string/index.js'
13
12
  export * as text from './text/index.js'
13
+ export * as null from './null/index.js'
@@ -2,12 +2,12 @@ export * as any from './any/index.js'
2
2
  export * as array from './array/index.js'
3
3
  export * as boolean from './boolean/index.js'
4
4
  export * as element from './element/index.js'
5
- export * as get from './get/index.js'
6
5
  export * as guess from './guess/index.js'
7
6
  export * as nodelist from './nodelist/index.js'
8
- export * as null from './null/index.js'
9
7
  export * as number from './number/index.js'
8
+ export * as get from './get/index.js'
10
9
  export * as record from './record/index.js'
11
10
  export * as ref from './ref/index.js'
12
11
  export * as string from './string/index.js'
13
12
  export * as text from './text/index.js'
13
+ export * as null from './null/index.js'
@@ -1,10 +1,10 @@
1
+ export * as deepSelect from './deep-select/index.js'
1
2
  export * as getNodeAncestors from './get-node-ancestors/index.js'
2
3
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
3
4
  export * as hyperJson from './hyper-json/index.js'
4
5
  export * as insertNode from './insert-node/index.js'
5
6
  export * as placeholders from './placeholders/index.js'
6
- export * as replaceInElement from './replace-in-element/index.js'
7
7
  export * as selectorToElement from './selector-to-element/index.js'
8
- export * as deepSelect from './deep-select/index.js'
9
8
  export * as stringToNodes from './string-to-nodes/index.js'
10
9
  export * as watchSelection from './watch-selection/index.js'
10
+ export * as replaceInElement from './replace-in-element/index.js'
@@ -1,10 +1,10 @@
1
+ export * as deepSelect from './deep-select/index.js'
1
2
  export * as getNodeAncestors from './get-node-ancestors/index.js'
2
3
  export * as getPositionInsideParent from './get-position-inside-parent/index.js'
3
4
  export * as hyperJson from './hyper-json/index.js'
4
5
  export * as insertNode from './insert-node/index.js'
5
6
  export * as placeholders from './placeholders/index.js'
6
- export * as replaceInElement from './replace-in-element/index.js'
7
7
  export * as selectorToElement from './selector-to-element/index.js'
8
- export * as deepSelect from './deep-select/index.js'
9
8
  export * as stringToNodes from './string-to-nodes/index.js'
10
9
  export * as watchSelection from './watch-selection/index.js'
10
+ export * as replaceInElement from './replace-in-element/index.js'
@@ -1,12 +1,12 @@
1
1
  export * as arrays from './arrays/index.js'
2
+ export * as booleans from './booleans/index.js'
2
3
  export * as colors from './colors/index.js'
3
4
  export * as css from './css/index.js'
4
5
  export * as errors from './errors/index.js'
5
- export * as misc from './misc/index.js'
6
6
  export * as html from './html/index.js'
7
+ export * as misc from './misc/index.js'
7
8
  export * as numbers from './numbers/index.js'
8
9
  export * as objects from './objects/index.js'
9
- export * as booleans from './booleans/index.js'
10
10
  export * as optim from './optim/index.js'
11
11
  export * as random from './random/index.js'
12
12
  export * as regexps from './regexps/index.js'
package/agnostic/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export * as arrays from './arrays/index.js'
2
+ export * as booleans from './booleans/index.js'
2
3
  export * as colors from './colors/index.js'
3
4
  export * as css from './css/index.js'
4
5
  export * as errors from './errors/index.js'
5
- export * as misc from './misc/index.js'
6
6
  export * as html from './html/index.js'
7
+ export * as misc from './misc/index.js'
7
8
  export * as numbers from './numbers/index.js'
8
9
  export * as objects from './objects/index.js'
9
- export * as booleans from './booleans/index.js'
10
10
  export * as optim from './optim/index.js'
11
11
  export * as random from './random/index.js'
12
12
  export * as regexps from './regexps/index.js'
@@ -1,2 +1,2 @@
1
- export * as detectRuntime from './detect-runtime/index.js'
2
1
  export * as window from './window/index.js'
2
+ export * as detectRuntime from './detect-runtime/index.js'
@@ -1,2 +1,2 @@
1
- export * as detectRuntime from './detect-runtime/index.js'
2
1
  export * as window from './window/index.js'
2
+ export * as detectRuntime from './detect-runtime/index.js'
@@ -7,6 +7,6 @@ export * as dataSize from './data-size/index.js'
7
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
- export * as loremIpsum from './lorem-ipsum/index.js'
11
10
  export * as normalizeExtension from './normalize-extension/index.js'
12
11
  export * as outcome from './outcome/index.js'
12
+ export * as loremIpsum from './lorem-ipsum/index.js'
@@ -7,6 +7,6 @@ export * as dataSize from './data-size/index.js'
7
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
- export * as loremIpsum from './lorem-ipsum/index.js'
11
10
  export * as normalizeExtension from './normalize-extension/index.js'
12
11
  export * as outcome from './outcome/index.js'
12
+ export * as loremIpsum from './lorem-ipsum/index.js'
@@ -1,3 +1,3 @@
1
1
  export * as logger from './logger/index.js'
2
- export * as makeTextBlock from './make-text-block/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
1
  export * as logger from './logger/index.js'
2
- export * as makeTextBlock from './make-text-block/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 approximateRational from './approximate-rational/index.js'
2
2
  export * as absoluteModulo from './absolute-modulo/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
4
3
  export * as clamp from './clamp/index.js'
5
- export * as round from './round/index.js'
4
+ export * as geometricProgressions from './geometric-progressions/index.js'
6
5
  export * as interpolate from './interpolate/index.js'
6
+ export * as round from './round/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as approximateRational from './approximate-rational/index.js'
2
2
  export * as absoluteModulo from './absolute-modulo/index.js'
3
- export * as geometricProgressions from './geometric-progressions/index.js'
4
3
  export * as clamp from './clamp/index.js'
5
- export * as round from './round/index.js'
4
+ export * as geometricProgressions from './geometric-progressions/index.js'
6
5
  export * as interpolate from './interpolate/index.js'
6
+ export * as round from './round/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as enums from './enums/index.js'
3
2
  export * as flattenGetters from './flatten-getters/index.js'
3
+ export * as isRecord from './is-record/index.js'
4
4
  export * as isObject from './is-object/index.js'
5
5
  export * as recordFormat from './record-format/index.js'
6
- export * as isRecord from './is-record/index.js'
7
- export * as recordMap from './record-map/index.js'
8
6
  export * as sortKeys from './sort-keys/index.js'
7
+ export * as recordMap from './record-map/index.js'
9
8
  export * as validation from './validation/index.js'
9
+ export * as enums from './enums/index.js'
@@ -1,9 +1,9 @@
1
1
  export * as deepGetProperty from './deep-get-property/index.js'
2
- export * as enums from './enums/index.js'
3
2
  export * as flattenGetters from './flatten-getters/index.js'
3
+ export * as isRecord from './is-record/index.js'
4
4
  export * as isObject from './is-object/index.js'
5
5
  export * as recordFormat from './record-format/index.js'
6
- export * as isRecord from './is-record/index.js'
7
- export * as recordMap from './record-map/index.js'
8
6
  export * as sortKeys from './sort-keys/index.js'
7
+ export * as recordMap from './record-map/index.js'
9
8
  export * as validation from './validation/index.js'
9
+ export * as enums from './enums/index.js'
@@ -1,2 +1,2 @@
1
- export * as memoize from './memoize/index.js'
2
1
  export * as throttleDebounce from './throttle-debounce/index.js'
2
+ export * as memoize from './memoize/index.js'
@@ -1,2 +1,2 @@
1
- export * as memoize from './memoize/index.js'
2
1
  export * as throttleDebounce from './throttle-debounce/index.js'
2
+ export * as memoize from './memoize/index.js'
@@ -1,4 +1,4 @@
1
- export * as fileName from './file-name/index.js'
2
1
  export * as html from './html/index.js'
3
2
  export * as path from './path/index.js'
3
+ export * as fileName from './file-name/index.js'
4
4
  export * as userInput from './user-input/index.js'
@@ -1,4 +1,4 @@
1
- export * as fileName from './file-name/index.js'
2
1
  export * as html from './html/index.js'
3
2
  export * as path from './path/index.js'
3
+ export * as fileName from './file-name/index.js'
4
4
  export * as userInput from './user-input/index.js'
@@ -1,8 +1,8 @@
1
1
  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
- export * as replaceAll from './replace-all/index.js'
5
- export * as toAlphanum from './to-alphanum/index.js'
6
4
  export * as parseTable from './parse-table/index.js'
5
+ export * as replaceAll from './replace-all/index.js'
7
6
  export * as splitTrim from './split-trim/index.js'
8
7
  export * as trim from './trim/index.js'
8
+ export * as toAlphanum from './to-alphanum/index.js'
@@ -1,8 +1,8 @@
1
1
  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
- export * as replaceAll from './replace-all/index.js'
5
- export * as toAlphanum from './to-alphanum/index.js'
6
4
  export * as parseTable from './parse-table/index.js'
5
+ export * as replaceAll from './replace-all/index.js'
7
6
  export * as splitTrim from './split-trim/index.js'
8
7
  export * as trim from './trim/index.js'
8
+ export * as toAlphanum from './to-alphanum/index.js'
@@ -1,5 +1,5 @@
1
1
  export * as dates from './dates/index.js'
2
2
  export * as duration from './duration/index.js'
3
- export * as timeout from './timeout/index.js'
4
3
  export * as transitions from './transitions/index.js'
4
+ export * as timeout from './timeout/index.js'
5
5
  export * as wait from './wait/index.js'
@@ -1,5 +1,5 @@
1
1
  export * as dates from './dates/index.js'
2
2
  export * as duration from './duration/index.js'
3
- export * as timeout from './timeout/index.js'
4
3
  export * as transitions from './transitions/index.js'
4
+ export * as timeout from './timeout/index.js'
5
5
  export * as wait from './wait/index.js'
@@ -0,0 +1,49 @@
1
+ import { type PropsWithChildren, type FunctionComponent, type MouseEvent } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /**
4
+ * Props for the {@link Clippable} component.
5
+ *
6
+ * Extends {@link WithClassName} with clipboard-related configuration and callbacks.
7
+ *
8
+ * @property toClip - Content written to the clipboard. When omitted, the current
9
+ * content container's `innerHTML` is used. A function may be provided to transform
10
+ * the current content before it is written.
11
+ * @property actionHandlers - Optional user action callbacks:
12
+ * - `clicked` — called when the copy button is clicked, before clipboard content is resolved.
13
+ * @property stateHandlers - Optional callbacks invoked when derived state changes:
14
+ * - `clipped` — called after content has been successfully written to the clipboard.
15
+ * @property className - Additional class name(s) applied to the root element.
16
+ * @property children - Content rendered inside the copyable container.
17
+ */
18
+ export type Props = PropsWithChildren<WithClassName<{
19
+ toClip?: string | ((curr: string | undefined) => string | undefined);
20
+ actionHandlers?: {
21
+ clicked?: (e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, rawContent: string | undefined) => void;
22
+ };
23
+ stateHandlers?: {
24
+ clipped?: (content: string) => void;
25
+ };
26
+ }>>;
27
+ /**
28
+ * Clipboard-enabled container component.
29
+ *
30
+ * Renders arbitrary content alongside a copy control. When activated,
31
+ * the component writes HTML content to the clipboard using the
32
+ * `text/html` MIME type.
33
+ *
34
+ * Supports content overriding and transformation through the `toClip`
35
+ * prop, as well as action and state callbacks.
36
+ *
37
+ * ### CSS modifiers
38
+ * The following modifiers are applied automatically:
39
+ * - `clipped` — `true` during the 3 seconds following a successful clipboard write.
40
+ *
41
+ * ### CSS elements
42
+ * - `copy`
43
+ * - `content`
44
+ *
45
+ * @param props - Component properties.
46
+ * @see {@link Props}
47
+ * @returns A copy-enabled content container with clipboard state modifiers applied.
48
+ */
49
+ export declare const Clippable: FunctionComponent<Props>;
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState } from 'react';
3
+ import { clss } from '../../agnostic/css/clss/index.js';
4
+ import { mergeClassNames } from '../utils/index.js';
5
+ import { clippable as publicClassName } from '../public-classnames.js';
6
+ import cssModule from './styles.module.css';
7
+ /**
8
+ * Clipboard-enabled container component.
9
+ *
10
+ * Renders arbitrary content alongside a copy control. When activated,
11
+ * the component writes HTML content to the clipboard using the
12
+ * `text/html` MIME type.
13
+ *
14
+ * Supports content overriding and transformation through the `toClip`
15
+ * prop, as well as action and state callbacks.
16
+ *
17
+ * ### CSS modifiers
18
+ * The following modifiers are applied automatically:
19
+ * - `clipped` — `true` during the 3 seconds following a successful clipboard write.
20
+ *
21
+ * ### CSS elements
22
+ * - `copy`
23
+ * - `content`
24
+ *
25
+ * @param props - Component properties.
26
+ * @see {@link Props}
27
+ * @returns A copy-enabled content container with clipboard state modifiers applied.
28
+ */
29
+ export const Clippable = ({ className, children, toClip, actionHandlers, stateHandlers }) => {
30
+ // State & refs
31
+ const [beenRecentlyClipped, setBeenRecentlyClipped] = useState(false);
32
+ const contentRef = useRef(null);
33
+ const clippedTimeoutRef = useRef(null);
34
+ // User action handlers
35
+ const handleCopyClick = async (e) => {
36
+ const rawhHtml = contentRef.current?.innerHTML;
37
+ actionHandlers?.clicked?.(e, rawhHtml);
38
+ const html = typeof toClip === 'string'
39
+ ? toClip
40
+ : typeof toClip === 'function'
41
+ ? toClip(rawhHtml)
42
+ : rawhHtml;
43
+ if (html === undefined)
44
+ return;
45
+ try {
46
+ await navigator.clipboard.write([
47
+ new ClipboardItem({
48
+ 'text/html': new Blob([html], { type: 'text/html' }),
49
+ 'text/plain': new Blob([html], { type: 'text/plain' })
50
+ })
51
+ ]);
52
+ }
53
+ catch (err) {
54
+ console.error(err);
55
+ }
56
+ stateHandlers?.clipped?.(html);
57
+ setBeenRecentlyClipped(true);
58
+ if (clippedTimeoutRef.current !== null)
59
+ clearTimeout(clippedTimeoutRef.current);
60
+ clippedTimeoutRef.current = setTimeout(() => {
61
+ setBeenRecentlyClipped(false);
62
+ }, 3000);
63
+ };
64
+ // Rendering
65
+ const c = clss(publicClassName, { cssModule });
66
+ const rootClss = mergeClassNames(c(null, {
67
+ clipped: beenRecentlyClipped
68
+ }), className);
69
+ const copyClss = c('copy');
70
+ const contentClss = c('content');
71
+ return _jsxs("div", { className: rootClss, children: [_jsx("button", { type: 'button', className: copyClss, onClick: e => { void handleCopyClick(e); } }), _jsx("div", { ref: contentRef, className: contentClss, children: children })] });
72
+ };
File without changes
@@ -0,0 +1,48 @@
1
+ import { type FunctionComponent, type IframeHTMLAttributes, type PropsWithChildren } from 'react';
2
+ import type { WithClassName } from '../utils/types.js';
3
+ /**
4
+ * Props for the {@link Iframe} component.
5
+ *
6
+ * Extends native {@link IframeHTMLAttributes} with optional class name support.
7
+ *
8
+ * @property className - Additional class name(s) applied to the root element.
9
+ * @property children - React content rendered as the iframe document body.
10
+ * @property srcDoc - Raw HTML string used as iframe content when `children` is not provided.
11
+ *
12
+ * @remarks
13
+ * This component behaves as a hybrid between a native `<iframe>` and a React renderer.
14
+ *
15
+ * Rendering priority:
16
+ * - `children` takes precedence over `srcDoc` when provided.
17
+ * - If `children` is `null` or `undefined`, `srcDoc` is used directly.
18
+ *
19
+ * When `children` is provided, it is converted to static HTML using
20
+ * `renderToStaticMarkup` and injected into a complete HTML document:
21
+ * `<!doctype html><html><body>...</body></html>`.
22
+ */
23
+ export type Props = PropsWithChildren<WithClassName<Record<never, never>>> & Omit<IframeHTMLAttributes<HTMLIFrameElement>, 'children'>;
24
+ /**
25
+ * Iframe component with React-to-HTML rendering support.
26
+ *
27
+ * Renders either:
28
+ * - A raw HTML string via the `srcDoc` attribute, or
29
+ * - A ReactNode rendered into static HTML via `renderToStaticMarkup`.
30
+ *
31
+ * ### Rendering strategy
32
+ * 1. If `children` is defined (non-nullish), it is rendered to static HTML
33
+ * and used as iframe content.
34
+ * 2. Otherwise, `srcDoc` is used as-is.
35
+ *
36
+ * The resulting content is wrapped in a minimal HTML document:
37
+ * `<!doctype html><html><body>...</body></html>`.
38
+ *
39
+ * ### Notes
40
+ * - The iframe content is static (no hydration, no client-side React inside iframe).
41
+ * - `children` overrides `srcDoc`.
42
+ * - Useful for embedding server-rendered UI fragments or documentation blocks.
43
+ *
44
+ * @param props - Component properties.
45
+ * @see {@link Props}
46
+ * @returns A styled iframe element with computed HTML document content.
47
+ */
48
+ export declare const Iframe: FunctionComponent<Props>;
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { renderToStaticMarkup } from 'react-dom/server';
4
+ import { clss } from '../../agnostic/css/clss/index.js';
5
+ import { mergeClassNames } from '../utils/index.js';
6
+ import { iframe as publicClassName } from '../public-classnames.js';
7
+ import cssModule from './styles.module.css';
8
+ import { isNotNullish } from '../../agnostic/misc/is-nullish/index.js';
9
+ /**
10
+ * Iframe component with React-to-HTML rendering support.
11
+ *
12
+ * Renders either:
13
+ * - A raw HTML string via the `srcDoc` attribute, or
14
+ * - A ReactNode rendered into static HTML via `renderToStaticMarkup`.
15
+ *
16
+ * ### Rendering strategy
17
+ * 1. If `children` is defined (non-nullish), it is rendered to static HTML
18
+ * and used as iframe content.
19
+ * 2. Otherwise, `srcDoc` is used as-is.
20
+ *
21
+ * The resulting content is wrapped in a minimal HTML document:
22
+ * `<!doctype html><html><body>...</body></html>`.
23
+ *
24
+ * ### Notes
25
+ * - The iframe content is static (no hydration, no client-side React inside iframe).
26
+ * - `children` overrides `srcDoc`.
27
+ * - Useful for embedding server-rendered UI fragments or documentation blocks.
28
+ *
29
+ * @param props - Component properties.
30
+ * @see {@link Props}
31
+ * @returns A styled iframe element with computed HTML document content.
32
+ */
33
+ export const Iframe = ({ className, children, srcDoc, ...iframeProps }) => {
34
+ const c = clss(publicClassName, { cssModule });
35
+ const rootClss = mergeClassNames(c(), className);
36
+ const html = useMemo(() => {
37
+ const body = isNotNullish(children)
38
+ ? renderToStaticMarkup(children)
39
+ : srcDoc;
40
+ return `<!doctype html><html><body>${body}</body></html>`;
41
+ }, [children, srcDoc]);
42
+ return _jsx("iframe", { ...iframeProps, className: rootClss, srcDoc: html });
43
+ };
File without changes
@@ -1,10 +1,12 @@
1
1
  export * as beforeAfter from './BeforeAfter/index.js'
2
+ export * as clippable from './Clippable/index.js'
2
3
  export * as disclaimer from './Disclaimer/index.js'
3
4
  export * as drawer from './Drawer/index.js'
4
5
  export * as eventListener from './EventListener/index.js'
5
6
  export * as gallery from './Gallery/index.js'
6
- export * as image from './Image/index.js'
7
+ export * as iframe from './Iframe/index.js'
7
8
  export * as intersectionObserver from './IntersectionObserver/index.js'
9
+ export * as image from './Image/index.js'
8
10
  export * as overlayer from './Overlayer/index.js'
9
11
  export * as paginator from './Paginator/index.js'
10
12
  export * as resizeObserver from './ResizeObserver/index.js'
@@ -1,10 +1,12 @@
1
1
  export * as beforeAfter from './BeforeAfter/index.js'
2
+ export * as clippable from './Clippable/index.js'
2
3
  export * as disclaimer from './Disclaimer/index.js'
3
4
  export * as drawer from './Drawer/index.js'
4
5
  export * as eventListener from './EventListener/index.js'
5
6
  export * as gallery from './Gallery/index.js'
6
- export * as image from './Image/index.js'
7
+ export * as iframe from './Iframe/index.js'
7
8
  export * as intersectionObserver from './IntersectionObserver/index.js'
9
+ export * as image from './Image/index.js'
8
10
  export * as overlayer from './Overlayer/index.js'
9
11
  export * as paginator from './Paginator/index.js'
10
12
  export * as resizeObserver from './ResizeObserver/index.js'
@@ -1,8 +1,10 @@
1
1
  export declare const beforeAfter = "dsed-before-after";
2
+ export declare const clippable = "dsed-clippable";
2
3
  export declare const disclaimer = "dsed-disclaimer";
3
4
  export declare const drawer = "dsed-drawer";
4
5
  export declare const eventListener = "dsed-event-listener";
5
6
  export declare const gallery = "dsed-gallery";
7
+ export declare const iframe = "dsed-iframe";
6
8
  export declare const image = "dsed-image";
7
9
  export declare const intersectionObserver = "dsed-intersection-observer";
8
10
  export declare const overlayer = "dsed-overlayer";
@@ -1,8 +1,10 @@
1
1
  export const beforeAfter = 'dsed-before-after';
2
+ export const clippable = 'dsed-clippable';
2
3
  export const disclaimer = 'dsed-disclaimer';
3
4
  export const drawer = 'dsed-drawer';
4
5
  export const eventListener = 'dsed-event-listener';
5
6
  export const gallery = 'dsed-gallery';
7
+ export const iframe = 'dsed-iframe';
6
8
  export const image = 'dsed-image';
7
9
  export const intersectionObserver = 'dsed-intersection-observer';
8
10
  export const overlayer = 'dsed-overlayer';
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as list from './list/index.js'
3
2
  export * as moveDir from './move-dir/index.js'
3
+ export * as list from './list/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as list from './list/index.js'
3
2
  export * as moveDir from './move-dir/index.js'
3
+ export * as list from './list/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as list from './list/index.js'
3
2
  export * as moveDir from './move-dir/index.js'
3
+ export * as list from './list/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as list from './list/index.js'
3
2
  export * as moveDir from './move-dir/index.js'
3
+ export * as list from './list/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,3 +1,4 @@
1
+ export * as copy from './copy/index.js'
1
2
  export * as download from './download/index.js'
2
3
  export * as exists from './exists/index.js'
3
4
  export * as generateSignedUrl from './generate-signed-url/index.js'
@@ -9,4 +10,3 @@ export * as revokeSignedUrls from './revoke-signed-urls/index.js'
9
10
  export * as stat from './stat/index.js'
10
11
  export * as updateMetadata from './update-metadata/index.js'
11
12
  export * as upload from './upload/index.js'
12
- export * as copy from './copy/index.js'
@@ -1,3 +1,4 @@
1
+ export * as copy from './copy/index.js'
1
2
  export * as download from './download/index.js'
2
3
  export * as exists from './exists/index.js'
3
4
  export * as generateSignedUrl from './generate-signed-url/index.js'
@@ -9,4 +10,3 @@ export * as revokeSignedUrls from './revoke-signed-urls/index.js'
9
10
  export * as stat from './stat/index.js'
10
11
  export * as updateMetadata from './update-metadata/index.js'
11
12
  export * as upload from './upload/index.js'
12
- export * as copy from './copy/index.js'
@@ -2,10 +2,10 @@ export * as copyDir from './copy-dir/index.js'
2
2
  export * as copyFile from './copy-file/index.js'
3
3
  export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
- export * as listDir from './list-dir/index.js'
6
5
  export * as moveDir from './move-dir/index.js'
6
+ export * as listDir from './list-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'
@@ -2,10 +2,10 @@ export * as copyDir from './copy-dir/index.js'
2
2
  export * as copyFile from './copy-file/index.js'
3
3
  export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
- export * as listDir from './list-dir/index.js'
6
5
  export * as moveDir from './move-dir/index.js'
6
+ export * as listDir from './list-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'
@@ -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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.4.12",
3
+ "version": "0.4.14",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -1360,6 +1360,13 @@
1360
1360
  "./components/BeforeAfter/index.js": {
1361
1361
  "import": "./components/BeforeAfter/index.js"
1362
1362
  },
1363
+ "./components/Clippable": {
1364
+ "import": "./components/Clippable/index.js",
1365
+ "types": "./components/Clippable/index.d.ts"
1366
+ },
1367
+ "./components/Clippable/index.js": {
1368
+ "import": "./components/Clippable/index.js"
1369
+ },
1363
1370
  "./components/Disclaimer": {
1364
1371
  "import": "./components/Disclaimer/index.js",
1365
1372
  "types": "./components/Disclaimer/index.d.ts"
@@ -1388,6 +1395,13 @@
1388
1395
  "./components/Gallery/index.js": {
1389
1396
  "import": "./components/Gallery/index.js"
1390
1397
  },
1398
+ "./components/Iframe": {
1399
+ "import": "./components/Iframe/index.js",
1400
+ "types": "./components/Iframe/index.d.ts"
1401
+ },
1402
+ "./components/Iframe/index.js": {
1403
+ "import": "./components/Iframe/index.js"
1404
+ },
1391
1405
  "./components/Image": {
1392
1406
  "import": "./components/Image/index.js",
1393
1407
  "types": "./components/Image/index.d.ts"
@@ -2332,25 +2346,27 @@
2332
2346
  }
2333
2347
  },
2334
2348
  "dependencies": {
2335
- "@aws-sdk/client-s3": "^3.999.0",
2336
- "@aws-sdk/lib-storage": "^3.1008.0",
2349
+ "@aws-sdk/client-s3": "^3.1066.0",
2350
+ "@aws-sdk/lib-storage": "^3.1066.0",
2337
2351
  "@google-cloud/storage": "^7.19.0",
2338
- "@inquirer/prompts": "^8.3.0",
2352
+ "@inquirer/prompts": "^8.5.2",
2339
2353
  "ansi-regex": "^6.2.2",
2340
2354
  "archiver": "^7.0.1",
2341
2355
  "basic-ftp": "^5.1.0",
2342
2356
  "chalk": "^5.6.2",
2343
2357
  "express": "^5.2.1",
2358
+ "i": "^0.3.7",
2344
2359
  "multer": "^2.0.0",
2345
- "preact-render-to-string": "^6.6.6",
2360
+ "npm": "^11.16.0",
2361
+ "preact-render-to-string": "^6.7.0",
2346
2362
  "quantize": "^1.0.2",
2347
- "react": "^19.2.4",
2348
- "react-dom": "^19.2.4",
2363
+ "react": "^19.2.7",
2364
+ "react-dom": "^19.2.7",
2349
2365
  "sharp": "^0.34.5",
2350
2366
  "ssh2": "^1.17.0",
2351
- "ssh2-sftp-client": "^12.1.0",
2367
+ "ssh2-sftp-client": "^12.1.1",
2352
2368
  "xss": "^1.0.15",
2353
- "zod": "^4.3.6"
2369
+ "zod": "^4.4.3"
2354
2370
  },
2355
2371
  "devDependencies": {
2356
2372
  "@preact/preset-vite": "^2.10.3",
@@ -2359,12 +2375,12 @@
2359
2375
  "@testing-library/react": "^16.3.2",
2360
2376
  "@types/archiver": "^7.0.0",
2361
2377
  "@types/express": "^5.0.6",
2362
- "@types/jsdom": "^28.0.0",
2378
+ "@types/jsdom": "^28.0.3",
2363
2379
  "@types/multer": "^2.1.0",
2364
- "@types/node": "^25.5.0",
2380
+ "@types/node": "^25.9.3",
2365
2381
  "@types/prompts": "^2.4.9",
2366
2382
  "@types/quantize": "^1.0.2",
2367
- "@types/react": "^19.2.14",
2383
+ "@types/react": "^19.2.17",
2368
2384
  "@types/react-dom": "^19.2.3",
2369
2385
  "@types/semver": "^7.7.1",
2370
2386
  "@types/sharp": "^0.31.1",
@@ -2374,21 +2390,21 @@
2374
2390
  "@vitejs/plugin-react": "^5.1.3",
2375
2391
  "change-case": "^5.4.4",
2376
2392
  "chokidar-cli": "^3.0.0",
2377
- "concurrently": "^9.2.1",
2378
- "esbuild": "^0.27.4",
2393
+ "concurrently": "^10.0.3",
2394
+ "esbuild": "^0.28.0",
2379
2395
  "eslint": "^8.44.0",
2380
2396
  "eslint-config-standard-with-typescript": "^43.0.1",
2381
2397
  "eslint-plugin-import": "^2.32.0",
2382
2398
  "eslint-plugin-n": "^16.2.0",
2383
2399
  "eslint-plugin-promise": "^6.1.1",
2384
- "jsdom": "^28.1.0",
2400
+ "jsdom": "^29.1.1",
2385
2401
  "prompts": "^2.4.2",
2386
- "puppeteer": "^24.39.0",
2387
- "semver": "^7.7.4",
2402
+ "puppeteer": "^25.1.0",
2403
+ "semver": "^7.8.4",
2388
2404
  "simple-git": "^3.33.0",
2389
2405
  "standard": "^17.1.2",
2390
2406
  "typescript": "^5.3.3",
2391
2407
  "vite": "^6.4.1",
2392
- "vitest": "^4.1.0"
2408
+ "vitest": "^4.1.8"
2393
2409
  }
2394
2410
  }