@design-edito/tools 0.1.45 → 0.1.46

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/agnostic/arrays/random-pick/index.js +6 -6
  2. package/agnostic/css/index.js +14 -14
  3. package/agnostic/errors/index.js +2 -2
  4. package/agnostic/html/hyper-json/cast/index.js +3 -3
  5. package/agnostic/html/hyper-json/index.js +4 -4
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +3 -3
  7. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +3 -3
  8. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +3 -3
  9. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +3 -3
  10. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +3 -3
  11. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +3 -3
  12. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +3 -3
  13. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +3 -3
  14. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +3 -3
  15. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +3 -3
  16. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +3 -3
  17. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +3 -3
  18. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +3 -3
  19. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +3 -3
  20. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +3 -3
  21. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +3 -3
  22. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +3 -3
  23. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +3 -3
  24. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +3 -3
  25. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +3 -3
  26. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +3 -3
  27. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +3 -3
  28. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +3 -3
  29. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +3 -3
  30. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +3 -3
  31. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +3 -3
  32. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -3
  33. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +3 -3
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +3 -3
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +3 -3
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +3 -3
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +3 -3
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -3
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +3 -3
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +3 -3
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +3 -3
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +3 -3
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +3 -3
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +3 -3
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +3 -3
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -3
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +3 -3
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +3 -3
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +3 -3
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +3 -3
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +3 -3
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +3 -3
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +3 -3
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +3 -3
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +3 -3
  56. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +3 -3
  57. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +3 -3
  58. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +3 -3
  59. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +3 -3
  60. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -3
  61. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +3 -3
  62. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +3 -3
  63. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +3 -3
  64. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -3
  65. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +3 -3
  66. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -3
  67. package/agnostic/html/hyper-json/tree/index.d.ts +0 -21
  68. package/agnostic/html/hyper-json/tree/index.js +3 -3
  69. package/agnostic/html/hyper-json/utils/index.js +3 -3
  70. package/agnostic/html/index.js +19 -19
  71. package/agnostic/html/sanitize/index.js +6 -6
  72. package/agnostic/html/selector-to-element/index.js +6 -6
  73. package/agnostic/html/string-to-nodes/index.js +7 -7
  74. package/agnostic/misc/assert/index.js +3 -3
  75. package/agnostic/misc/crossenv/index.js +2 -2
  76. package/agnostic/misc/index.js +15 -15
  77. package/agnostic/misc/lorem-ipsum/index.js +9 -9
  78. package/agnostic/numbers/index.js +3 -3
  79. package/agnostic/objects/index.js +8 -8
  80. package/agnostic/strings/index.js +8 -8
  81. package/agnostic/time/index.js +3 -3
  82. package/chunks/chunk-4HPUOADZ.js +37 -0
  83. package/chunks/chunk-7NO34XJI.js +26 -0
  84. package/chunks/chunk-CK73EBO5.js +35 -0
  85. package/chunks/chunk-CRZMH2K5.js +2369 -0
  86. package/chunks/chunk-FDPPGRBY.js +211 -0
  87. package/chunks/chunk-MQPY7A3O.js +211 -0
  88. package/chunks/chunk-PJDZMLNG.js +127 -0
  89. package/chunks/chunk-TAVCC26N.js +37 -0
  90. package/chunks/chunk-WFED6NDN.js +28 -0
  91. package/chunks/chunk-WJMBLQRX.js +29 -0
  92. package/chunks/chunk-WKW34B3A.js +2369 -0
  93. package/node/files/index.js +3 -3
  94. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  LoremIpsum
3
- } from "../../../chunks/chunk-7DNQ6RM2.js";
4
- import "../../../chunks/chunk-YS6WMSWC.js";
5
- import "../../../chunks/chunk-AQBJ6HNB.js";
6
- import "../../../chunks/chunk-RLAZR3NL.js";
3
+ } from "../../../chunks/chunk-FDPPGRBY.js";
7
4
  import "../../../chunks/chunk-6RGDWX4A.js";
8
5
  import "../../../chunks/chunk-RCO57B6F.js";
6
+ import "../../../chunks/chunk-WJMBLQRX.js";
9
7
  import "../../../chunks/chunk-S32K7POB.js";
10
8
  import "../../../chunks/chunk-D3ERTRDW.js";
11
9
  import "../../../chunks/chunk-75BICI4L.js";
12
10
  import "../../../chunks/chunk-OGBUSUE6.js";
13
- import "../../../chunks/chunk-TIER4TF4.js";
14
- import "../../../chunks/chunk-FR5H2OCV.js";
11
+ import "../../../chunks/chunk-7NO34XJI.js";
12
+ import "../../../chunks/chunk-GGT2PUZH.js";
15
13
  import "../../../chunks/chunk-S2NMAH7K.js";
16
- import "../../../chunks/chunk-LV2VMOWR.js";
17
14
  import "../../../chunks/chunk-RLJOYG64.js";
18
- import "../../../chunks/chunk-WH6BPDAC.js";
19
- import "../../../chunks/chunk-QHLQVR3E.js";
15
+ import "../../../chunks/chunk-LV2VMOWR.js";
16
+ import "../../../chunks/chunk-2KT7AKRW.js";
20
17
  import "../../../chunks/chunk-FENXVJYO.js";
18
+ import "../../../chunks/chunk-QHLQVR3E.js";
19
+ import "../../../chunks/chunk-YS6WMSWC.js";
20
+ import "../../../chunks/chunk-RLAZR3NL.js";
21
21
  export {
22
22
  LoremIpsum
23
23
  };
@@ -1,6 +1,3 @@
1
- import {
2
- absoluteModulo
3
- } from "../../chunks/chunk-DNIOWD7K.js";
4
1
  import {
5
2
  interpolate
6
3
  } from "../../chunks/chunk-BJAYUP7M.js";
@@ -14,6 +11,9 @@ import {
14
11
  import {
15
12
  clamp
16
13
  } from "../../chunks/chunk-OSAXBA7G.js";
14
+ import {
15
+ absoluteModulo
16
+ } from "../../chunks/chunk-DNIOWD7K.js";
17
17
 
18
18
  // src/agnostic/numbers/index.ts
19
19
  var Numbers;
@@ -1,9 +1,9 @@
1
- import {
2
- Validation
3
- } from "../../chunks/chunk-FPEW3A27.js";
4
1
  import {
5
2
  Enums
6
3
  } from "../../chunks/chunk-WOAYU6LB.js";
4
+ import {
5
+ recordMap
6
+ } from "../../chunks/chunk-XNF5MLCQ.js";
7
7
  import "../../chunks/chunk-E6MSDKON.js";
8
8
  import {
9
9
  flattenGetters
@@ -11,6 +11,9 @@ import {
11
11
  import {
12
12
  deepGetProperty
13
13
  } from "../../chunks/chunk-SKMCIFS3.js";
14
+ import {
15
+ isRecord
16
+ } from "../../chunks/chunk-YDIBNEGA.js";
14
17
  import {
15
18
  isNonNullObject,
16
19
  isObject
@@ -19,11 +22,8 @@ import {
19
22
  recordFormat
20
23
  } from "../../chunks/chunk-YP64J65L.js";
21
24
  import {
22
- recordMap
23
- } from "../../chunks/chunk-XNF5MLCQ.js";
24
- import {
25
- isRecord
26
- } from "../../chunks/chunk-YDIBNEGA.js";
25
+ Validation
26
+ } from "../../chunks/chunk-FPEW3A27.js";
27
27
  import "../../chunks/chunk-SNJJII7A.js";
28
28
  import "../../chunks/chunk-QXAJXTXV.js";
29
29
  import "../../chunks/chunk-HC6ZOHCS.js";
@@ -1,24 +1,24 @@
1
- import {
2
- toAlphanum
3
- } from "../../chunks/chunk-COVPTTAD.js";
4
1
  import {
5
2
  trimEnd,
6
3
  trimStart
7
4
  } from "../../chunks/chunk-6XL25OZX.js";
5
+ import {
6
+ normalizeIndent
7
+ } from "../../chunks/chunk-JQXNEJAP.js";
8
+ import {
9
+ CharCodes
10
+ } from "../../chunks/chunk-34U4HX4V.js";
8
11
  import {
9
12
  matches,
10
13
  matchesEvery,
11
14
  matchesSome
12
15
  } from "../../chunks/chunk-LQFKUNVQ.js";
13
- import {
14
- CharCodes
15
- } from "../../chunks/chunk-34U4HX4V.js";
16
16
  import {
17
17
  replaceAll
18
18
  } from "../../chunks/chunk-ZTDVUXPR.js";
19
19
  import {
20
- normalizeIndent
21
- } from "../../chunks/chunk-JQXNEJAP.js";
20
+ toAlphanum
21
+ } from "../../chunks/chunk-COVPTTAD.js";
22
22
 
23
23
  // src/agnostic/strings/index.ts
24
24
  var Strings;
@@ -1,12 +1,12 @@
1
+ import {
2
+ Transitions
3
+ } from "../../chunks/chunk-ENMBK6H7.js";
1
4
  import {
2
5
  Duration
3
6
  } from "../../chunks/chunk-6NYUQXJT.js";
4
7
  import {
5
8
  timeout
6
9
  } from "../../chunks/chunk-Z7ZDDBV5.js";
7
- import {
8
- Transitions
9
- } from "../../chunks/chunk-ENMBK6H7.js";
10
10
  import {
11
11
  wait
12
12
  } from "../../chunks/chunk-4CIS3R7T.js";
@@ -0,0 +1,37 @@
1
+ import {
2
+ Cast,
3
+ Tree,
4
+ Utils
5
+ } from "./chunk-CRZMH2K5.js";
6
+ import {
7
+ Serialize
8
+ } from "./chunk-SXRWMH3U.js";
9
+ import {
10
+ SmartTags
11
+ } from "./chunk-UT2J62LH.js";
12
+ import {
13
+ Transformer
14
+ } from "./chunk-BKO7GLC2.js";
15
+ import {
16
+ Method
17
+ } from "./chunk-RW7VAKJW.js";
18
+ import {
19
+ Types
20
+ } from "./chunk-XEQ2PBT2.js";
21
+
22
+ // src/agnostic/html/hyper-json/index.ts
23
+ var HyperJson;
24
+ ((HyperJson2) => {
25
+ HyperJson2.Cast = Cast;
26
+ HyperJson2.Method = Method;
27
+ HyperJson2.Serialize = Serialize;
28
+ HyperJson2.SmartTags = SmartTags;
29
+ HyperJson2.Transformer = Transformer;
30
+ HyperJson2.Tree = Tree;
31
+ HyperJson2.Types = Types;
32
+ HyperJson2.Utils = Utils;
33
+ })(HyperJson || (HyperJson = {}));
34
+
35
+ export {
36
+ HyperJson
37
+ };
@@ -0,0 +1,26 @@
1
+ import {
2
+ Crossenv
3
+ } from "./chunk-GGT2PUZH.js";
4
+ import {
5
+ Errors
6
+ } from "./chunk-2KT7AKRW.js";
7
+
8
+ // src/shared/errors/index.ts
9
+ var register = Errors.Register.from({
10
+ ["no-window-document-on-runtime" /* NO_DOCUMENT */]: {
11
+ message: `Runtime '${Crossenv.detectRuntime()}' does not provide a Document object, cannot complete.`,
12
+ detailsMaker: () => void 0
13
+ },
14
+ ["no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */]: {
15
+ message: `Please provide a Document object since none are found on runtime '${Crossenv.detectRuntime()}'`,
16
+ detailsMaker: (tips) => tips
17
+ },
18
+ ["impossible-to-pick-in-array" /* IMPOSSIBLE_TO_PICK_IN_ARRAY */]: {
19
+ message: "Impossible to pick",
20
+ detailsMaker: (array) => array.length === 0 ? "Array cannot be empty" : "Too many exclusions"
21
+ }
22
+ });
23
+
24
+ export {
25
+ register
26
+ };
@@ -0,0 +1,35 @@
1
+ import {
2
+ register
3
+ } from "./chunk-7NO34XJI.js";
4
+
5
+ // src/agnostic/html/selector-to-element/index.ts
6
+ function selectorToElement(selector, documentObj) {
7
+ const actualDocument = documentObj ?? window.document;
8
+ if (actualDocument === null) throw register.getError("no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */, "The optional second parameter expects a Document object");
9
+ const tagRegexp = /^[A-Za-z]+/;
10
+ const idRegexp = /#[A-Za-z]+[\w\-\:]*/;
11
+ const classRegexp = /\.[A-Za-z]+[\w\-]*/;
12
+ const attributeRegexp = /\[[A-Za-z]+[\w\-]*(="[\w\-]+")?\]/;
13
+ const matchedTags = selector.match(tagRegexp) ?? [];
14
+ const matchedIds = selector.match(idRegexp) ?? [];
15
+ const matchedClasses = selector.match(classRegexp) ?? [];
16
+ const matchedAttrs = selector.match(attributeRegexp) ?? [];
17
+ const tag = matchedTags[matchedTags.length - 1] ?? "div";
18
+ const id = matchedIds[matchedIds.length - 1] ?? null;
19
+ const classes = matchedClasses.map((matchedClass) => matchedClass.replace(/^\./, ""));
20
+ const attributes = matchedAttrs.map((matchedAttr) => matchedAttr.replace(/^\[/, "").replace(/\]$/, "").split("="));
21
+ const element = actualDocument.createElement(tag);
22
+ if (id !== null) {
23
+ element.id = id;
24
+ }
25
+ element.classList.add(...classes);
26
+ attributes.forEach(([name, value = ""]) => {
27
+ if (name === void 0) return;
28
+ element.setAttribute(name, value);
29
+ });
30
+ return element;
31
+ }
32
+
33
+ export {
34
+ selectorToElement
35
+ };