@zipify/wysiwyg 1.1.1 → 1.2.1-1

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 (176) hide show
  1. package/.github/actions/lint-css/action.yaml +1 -3
  2. package/.release-it.json +2 -1
  3. package/dist/cli.js +3 -3
  4. package/dist/wysiwyg.css +24 -25
  5. package/dist/wysiwyg.mjs +641 -618
  6. package/jest.config.js +3 -0
  7. package/lib/components/base/Modal.vue +21 -2
  8. package/lib/components/base/__tests__/Modal.test.js +1 -0
  9. package/lib/components/toolbar/controls/link/LinkControl.vue +22 -10
  10. package/lib/components/toolbar/controls/link/LinkControlHeader.vue +3 -3
  11. package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +8 -8
  12. package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +1 -1
  13. package/lib/components/toolbar/controls/link/composables/useLink.js +10 -6
  14. package/lib/composables/__tests__/__snapshots__/useEditor.test.js.snap +1 -1
  15. package/lib/composables/useEditor.js +4 -3
  16. package/lib/enums/TextSettings.js +2 -0
  17. package/lib/extensions/FontStyle.js +2 -2
  18. package/lib/extensions/FontWeight.js +2 -0
  19. package/lib/extensions/Link.js +13 -15
  20. package/lib/extensions/StylePreset.js +33 -3
  21. package/lib/extensions/TextDecoration.js +6 -12
  22. package/lib/extensions/__tests__/FontFamily.test.js +7 -6
  23. package/lib/extensions/__tests__/FontWeight.test.js +19 -10
  24. package/lib/extensions/__tests__/StylePreset.test.js +52 -2
  25. package/lib/extensions/__tests__/TextDecoration.test.js +11 -40
  26. package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +2 -2
  27. package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +1 -1
  28. package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +1 -1
  29. package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +19 -1
  30. package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +2 -2
  31. package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +17 -1
  32. package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +26 -1
  33. package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +2 -2
  34. package/lib/extensions/__tests__/__snapshots__/Margin.test.js.snap +2 -2
  35. package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +22 -2
  36. package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +3 -46
  37. package/package.json +22 -22
  38. package/lib/components/toolbar/controls/link/LinkControlApply.vue +0 -35
  39. package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +0 -4
  40. package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +0 -620
  41. package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +0 -21
  42. package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +0 -269
  43. package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +0 -4
  44. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +0 -209
  45. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +0 -5186
  46. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +0 -1
  47. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +0 -5155
  48. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +0 -2
  49. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +0 -1
  50. package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +0 -64
  51. package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +0 -35
  52. package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +0 -20
  53. package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +0 -67
  54. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +0 -39
  55. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +0 -36
  56. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +0 -37
  57. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +0 -132
  58. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +0 -37
  59. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +0 -39
  60. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +0 -41
  61. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +0 -3
  62. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +0 -43
  63. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +0 -148
  64. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +0 -190
  65. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +0 -88
  66. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +0 -36
  67. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +0 -43
  68. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +0 -344
  69. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +0 -62
  70. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +0 -61
  71. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +0 -17
  72. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +0 -82
  73. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +0 -21
  74. package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +0 -464
  75. package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +0 -18
  76. package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +0 -21
  77. package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +0 -106
  78. package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +0 -27
  79. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +0 -42
  80. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +0 -209
  81. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +0 -442
  82. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +0 -130
  83. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +0 -472
  84. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +0 -26
  85. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +0 -16
  86. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +0 -26
  87. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +0 -142
  88. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +0 -1244
  89. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +0 -106
  90. package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +0 -190
  91. package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +0 -58
  92. package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +0 -7
  93. package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +0 -16
  94. package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +0 -19
  95. package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +0 -153
  96. package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +0 -805
  97. package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +0 -70
  98. package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +0 -40
  99. package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +0 -22
  100. package/node_modules_lambda/escodegen/node_modules/levn/README.md +0 -196
  101. package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +0 -298
  102. package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +0 -285
  103. package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +0 -22
  104. package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +0 -113
  105. package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +0 -102
  106. package/node_modules_lambda/escodegen/node_modules/levn/package.json +0 -47
  107. package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +0 -56
  108. package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +0 -22
  109. package/node_modules_lambda/escodegen/node_modules/optionator/README.md +0 -238
  110. package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +0 -260
  111. package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +0 -465
  112. package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +0 -54
  113. package/node_modules_lambda/escodegen/node_modules/optionator/package.json +0 -44
  114. package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +0 -99
  115. package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +0 -22
  116. package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +0 -15
  117. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +0 -65
  118. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +0 -686
  119. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +0 -130
  120. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +0 -154
  121. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +0 -92
  122. package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +0 -178
  123. package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +0 -52
  124. package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +0 -301
  125. package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +0 -28
  126. package/node_modules_lambda/escodegen/node_modules/source-map/README.md +0 -742
  127. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +0 -3234
  128. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +0 -3233
  129. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +0 -2
  130. package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +0 -1
  131. package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +0 -121
  132. package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +0 -140
  133. package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +0 -67
  134. package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +0 -111
  135. package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +0 -79
  136. package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +0 -114
  137. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  138. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +0 -425
  139. package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +0 -413
  140. package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +0 -488
  141. package/node_modules_lambda/escodegen/node_modules/source-map/package.json +0 -73
  142. package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +0 -98
  143. package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +0 -8
  144. package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +0 -22
  145. package/node_modules_lambda/escodegen/node_modules/type-check/README.md +0 -210
  146. package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +0 -126
  147. package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +0 -16
  148. package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +0 -196
  149. package/node_modules_lambda/escodegen/node_modules/type-check/package.json +0 -40
  150. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  151. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +0 -212
  152. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +0 -21
  153. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +0 -130
  154. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
  155. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
  156. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +0 -23
  157. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +0 -198
  158. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  159. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  160. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
  161. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  162. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  163. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  164. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  165. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  166. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  167. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  168. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  169. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +0 -197
  170. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +0 -319
  171. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +0 -290
  172. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  173. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +0 -41
  174. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +0 -180
  175. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +0 -109
  176. package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +0 -44
@@ -1,106 +0,0 @@
1
- "use strict";
2
- const { utf8Encode, utf8DecodeWithoutBOM } = require("./encoding");
3
- const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require("./percent-encoding");
4
-
5
- function p(char) {
6
- return char.codePointAt(0);
7
- }
8
-
9
- // https://url.spec.whatwg.org/#concept-urlencoded-parser
10
- function parseUrlencoded(input) {
11
- const sequences = strictlySplitByteSequence(input, p("&"));
12
- const output = [];
13
- for (const bytes of sequences) {
14
- if (bytes.length === 0) {
15
- continue;
16
- }
17
-
18
- let name, value;
19
- const indexOfEqual = bytes.indexOf(p("="));
20
-
21
- if (indexOfEqual >= 0) {
22
- name = bytes.slice(0, indexOfEqual);
23
- value = bytes.slice(indexOfEqual + 1);
24
- } else {
25
- name = bytes;
26
- value = new Uint8Array(0);
27
- }
28
-
29
- name = replaceByteInByteSequence(name, 0x2B, 0x20);
30
- value = replaceByteInByteSequence(value, 0x2B, 0x20);
31
-
32
- const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name));
33
- const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value));
34
-
35
- output.push([nameString, valueString]);
36
- }
37
- return output;
38
- }
39
-
40
- // https://url.spec.whatwg.org/#concept-urlencoded-string-parser
41
- function parseUrlencodedString(input) {
42
- return parseUrlencoded(utf8Encode(input));
43
- }
44
-
45
- // https://url.spec.whatwg.org/#concept-urlencoded-serializer
46
- function serializeUrlencoded(tuples, encodingOverride = undefined) {
47
- let encoding = "utf-8";
48
- if (encodingOverride !== undefined) {
49
- // TODO "get the output encoding", i.e. handle encoding labels vs. names.
50
- encoding = encodingOverride;
51
- }
52
-
53
- let output = "";
54
- for (const [i, tuple] of tuples.entries()) {
55
- // TODO: handle encoding override
56
-
57
- const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true);
58
-
59
- let value = tuple[1];
60
- if (tuple.length > 2 && tuple[2] !== undefined) {
61
- if (tuple[2] === "hidden" && name === "_charset_") {
62
- value = encoding;
63
- } else if (tuple[2] === "file") {
64
- // value is a File object
65
- value = value.name;
66
- }
67
- }
68
-
69
- value = utf8PercentEncodeString(value, isURLEncodedPercentEncode, true);
70
-
71
- if (i !== 0) {
72
- output += "&";
73
- }
74
- output += `${name}=${value}`;
75
- }
76
- return output;
77
- }
78
-
79
- function strictlySplitByteSequence(buf, cp) {
80
- const list = [];
81
- let last = 0;
82
- let i = buf.indexOf(cp);
83
- while (i >= 0) {
84
- list.push(buf.slice(last, i));
85
- last = i + 1;
86
- i = buf.indexOf(cp, last);
87
- }
88
- if (last !== buf.length) {
89
- list.push(buf.slice(last));
90
- }
91
- return list;
92
- }
93
-
94
- function replaceByteInByteSequence(buf, from, to) {
95
- let i = buf.indexOf(from);
96
- while (i >= 0) {
97
- buf[i] = to;
98
- i = buf.indexOf(from, i + 1);
99
- }
100
- return buf;
101
- }
102
-
103
- module.exports = {
104
- parseUrlencodedString,
105
- serializeUrlencoded
106
- };
@@ -1,190 +0,0 @@
1
- "use strict";
2
-
3
- // Returns "Type(value) is Object" in ES terminology.
4
- function isObject(value) {
5
- return (typeof value === "object" && value !== null) || typeof value === "function";
6
- }
7
-
8
- const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
9
-
10
- // Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]`
11
- // instead of `[[Get]]` and `[[Set]]` and only allowing objects
12
- function define(target, source) {
13
- for (const key of Reflect.ownKeys(source)) {
14
- const descriptor = Reflect.getOwnPropertyDescriptor(source, key);
15
- if (descriptor && !Reflect.defineProperty(target, key, descriptor)) {
16
- throw new TypeError(`Cannot redefine property: ${String(key)}`);
17
- }
18
- }
19
- }
20
-
21
- function newObjectInRealm(globalObject, object) {
22
- const ctorRegistry = initCtorRegistry(globalObject);
23
- return Object.defineProperties(
24
- Object.create(ctorRegistry["%Object.prototype%"]),
25
- Object.getOwnPropertyDescriptors(object)
26
- );
27
- }
28
-
29
- const wrapperSymbol = Symbol("wrapper");
30
- const implSymbol = Symbol("impl");
31
- const sameObjectCaches = Symbol("SameObject caches");
32
- const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry");
33
-
34
- const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype);
35
-
36
- function initCtorRegistry(globalObject) {
37
- if (hasOwn(globalObject, ctorRegistrySymbol)) {
38
- return globalObject[ctorRegistrySymbol];
39
- }
40
-
41
- const ctorRegistry = Object.create(null);
42
-
43
- // In addition to registering all the WebIDL2JS-generated types in the constructor registry,
44
- // we also register a few intrinsics that we make use of in generated code, since they are not
45
- // easy to grab from the globalObject variable.
46
- ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype;
47
- ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf(
48
- Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]())
49
- );
50
-
51
- try {
52
- ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf(
53
- Object.getPrototypeOf(
54
- globalObject.eval("(async function* () {})").prototype
55
- )
56
- );
57
- } catch {
58
- ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype;
59
- }
60
-
61
- globalObject[ctorRegistrySymbol] = ctorRegistry;
62
- return ctorRegistry;
63
- }
64
-
65
- function getSameObject(wrapper, prop, creator) {
66
- if (!wrapper[sameObjectCaches]) {
67
- wrapper[sameObjectCaches] = Object.create(null);
68
- }
69
-
70
- if (prop in wrapper[sameObjectCaches]) {
71
- return wrapper[sameObjectCaches][prop];
72
- }
73
-
74
- wrapper[sameObjectCaches][prop] = creator();
75
- return wrapper[sameObjectCaches][prop];
76
- }
77
-
78
- function wrapperForImpl(impl) {
79
- return impl ? impl[wrapperSymbol] : null;
80
- }
81
-
82
- function implForWrapper(wrapper) {
83
- return wrapper ? wrapper[implSymbol] : null;
84
- }
85
-
86
- function tryWrapperForImpl(impl) {
87
- const wrapper = wrapperForImpl(impl);
88
- return wrapper ? wrapper : impl;
89
- }
90
-
91
- function tryImplForWrapper(wrapper) {
92
- const impl = implForWrapper(wrapper);
93
- return impl ? impl : wrapper;
94
- }
95
-
96
- const iterInternalSymbol = Symbol("internal");
97
-
98
- function isArrayIndexPropName(P) {
99
- if (typeof P !== "string") {
100
- return false;
101
- }
102
- const i = P >>> 0;
103
- if (i === 2 ** 32 - 1) {
104
- return false;
105
- }
106
- const s = `${i}`;
107
- if (P !== s) {
108
- return false;
109
- }
110
- return true;
111
- }
112
-
113
- const byteLengthGetter =
114
- Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
115
- function isArrayBuffer(value) {
116
- try {
117
- byteLengthGetter.call(value);
118
- return true;
119
- } catch (e) {
120
- return false;
121
- }
122
- }
123
-
124
- function iteratorResult([key, value], kind) {
125
- let result;
126
- switch (kind) {
127
- case "key":
128
- result = key;
129
- break;
130
- case "value":
131
- result = value;
132
- break;
133
- case "key+value":
134
- result = [key, value];
135
- break;
136
- }
137
- return { value: result, done: false };
138
- }
139
-
140
- const supportsPropertyIndex = Symbol("supports property index");
141
- const supportedPropertyIndices = Symbol("supported property indices");
142
- const supportsPropertyName = Symbol("supports property name");
143
- const supportedPropertyNames = Symbol("supported property names");
144
- const indexedGet = Symbol("indexed property get");
145
- const indexedSetNew = Symbol("indexed property set new");
146
- const indexedSetExisting = Symbol("indexed property set existing");
147
- const namedGet = Symbol("named property get");
148
- const namedSetNew = Symbol("named property set new");
149
- const namedSetExisting = Symbol("named property set existing");
150
- const namedDelete = Symbol("named property delete");
151
-
152
- const asyncIteratorNext = Symbol("async iterator get the next iteration result");
153
- const asyncIteratorReturn = Symbol("async iterator return steps");
154
- const asyncIteratorInit = Symbol("async iterator initialization steps");
155
- const asyncIteratorEOI = Symbol("async iterator end of iteration");
156
-
157
- module.exports = exports = {
158
- isObject,
159
- hasOwn,
160
- define,
161
- newObjectInRealm,
162
- wrapperSymbol,
163
- implSymbol,
164
- getSameObject,
165
- ctorRegistrySymbol,
166
- initCtorRegistry,
167
- wrapperForImpl,
168
- implForWrapper,
169
- tryWrapperForImpl,
170
- tryImplForWrapper,
171
- iterInternalSymbol,
172
- isArrayBuffer,
173
- isArrayIndexPropName,
174
- supportsPropertyIndex,
175
- supportedPropertyIndices,
176
- supportsPropertyName,
177
- supportedPropertyNames,
178
- indexedGet,
179
- indexedSetNew,
180
- indexedSetExisting,
181
- namedGet,
182
- namedSetNew,
183
- namedSetExisting,
184
- namedDelete,
185
- asyncIteratorNext,
186
- asyncIteratorReturn,
187
- asyncIteratorInit,
188
- asyncIteratorEOI,
189
- iteratorResult
190
- };
@@ -1,58 +0,0 @@
1
- {
2
- "name": "whatwg-url",
3
- "version": "11.0.0",
4
- "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery",
5
- "main": "index.js",
6
- "files": [
7
- "index.js",
8
- "webidl2js-wrapper.js",
9
- "lib/*.js"
10
- ],
11
- "author": "Sebastian Mayr <github@smayr.name>",
12
- "license": "MIT",
13
- "repository": "jsdom/whatwg-url",
14
- "dependencies": {
15
- "tr46": "^3.0.0",
16
- "webidl-conversions": "^7.0.0"
17
- },
18
- "devDependencies": {
19
- "@domenic/eslint-config": "^1.4.0",
20
- "benchmark": "^2.1.4",
21
- "browserify": "^17.0.0",
22
- "domexception": "^4.0.0",
23
- "eslint": "^7.32.0",
24
- "got": "^11.8.2",
25
- "jest": "^27.2.4",
26
- "webidl2js": "^17.0.0"
27
- },
28
- "engines": {
29
- "node": ">=12"
30
- },
31
- "scripts": {
32
- "coverage": "jest --coverage",
33
- "lint": "eslint .",
34
- "prepare": "node scripts/transform.js",
35
- "pretest": "node scripts/get-latest-platform-tests.js && node scripts/transform.js",
36
- "build-live-viewer": "browserify index.js --standalone whatwgURL > live-viewer/whatwg-url.js",
37
- "test": "jest"
38
- },
39
- "jest": {
40
- "collectCoverageFrom": [
41
- "lib/**/*.js",
42
- "!lib/utils.js"
43
- ],
44
- "coverageDirectory": "coverage",
45
- "coverageReporters": [
46
- "lcov",
47
- "text-summary"
48
- ],
49
- "testEnvironment": "node",
50
- "testMatch": [
51
- "<rootDir>/test/**/*.js"
52
- ],
53
- "testPathIgnorePatterns": [
54
- "^<rootDir>/test/testharness.js$",
55
- "^<rootDir>/test/web-platform-tests/"
56
- ]
57
- }
58
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- const URL = require("./lib/URL");
4
- const URLSearchParams = require("./lib/URLSearchParams");
5
-
6
- exports.URL = URL;
7
- exports.URLSearchParams = URLSearchParams;
@@ -1,16 +0,0 @@
1
- {
2
- "curly": true,
3
- "eqeqeq": true,
4
- "immed": true,
5
- "eqnull": true,
6
- "latedef": true,
7
- "noarg": true,
8
- "noempty": true,
9
- "quotmark": "single",
10
- "undef": true,
11
- "unused": true,
12
- "strict": true,
13
- "trailing": true,
14
-
15
- "node": true
16
- }
@@ -1,19 +0,0 @@
1
- Redistribution and use in source and binary forms, with or without
2
- modification, are permitted provided that the following conditions are met:
3
-
4
- * Redistributions of source code must retain the above copyright
5
- notice, this list of conditions and the following disclaimer.
6
- * Redistributions in binary form must reproduce the above copyright
7
- notice, this list of conditions and the following disclaimer in the
8
- documentation and/or other materials provided with the distribution.
9
-
10
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
11
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
12
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
13
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
14
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
15
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
16
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
17
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,153 +0,0 @@
1
- ### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse)
2
-
3
- Estraverse ([estraverse](http://github.com/estools/estraverse)) is
4
- [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
5
- traversal functions from [esmangle project](http://github.com/estools/esmangle).
6
-
7
- ### Documentation
8
-
9
- You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).
10
-
11
- ### Example Usage
12
-
13
- The following code will output all variables declared at the root of a file.
14
-
15
- ```javascript
16
- estraverse.traverse(ast, {
17
- enter: function (node, parent) {
18
- if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
19
- return estraverse.VisitorOption.Skip;
20
- },
21
- leave: function (node, parent) {
22
- if (node.type == 'VariableDeclarator')
23
- console.log(node.id.name);
24
- }
25
- });
26
- ```
27
-
28
- We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.
29
-
30
- ```javascript
31
- estraverse.traverse(ast, {
32
- enter: function (node) {
33
- this.break();
34
- }
35
- });
36
- ```
37
-
38
- And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.
39
-
40
- ```javascript
41
- result = estraverse.replace(tree, {
42
- enter: function (node) {
43
- // Replace it with replaced.
44
- if (node.type === 'Literal')
45
- return replaced;
46
- }
47
- });
48
- ```
49
-
50
- By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.
51
-
52
- ```javascript
53
- // This tree contains a user-defined `TestExpression` node.
54
- var tree = {
55
- type: 'TestExpression',
56
-
57
- // This 'argument' is the property containing the other **node**.
58
- argument: {
59
- type: 'Literal',
60
- value: 20
61
- },
62
-
63
- // This 'extended' is the property not containing the other **node**.
64
- extended: true
65
- };
66
- estraverse.traverse(tree, {
67
- enter: function (node) { },
68
-
69
- // Extending the existing traversing rules.
70
- keys: {
71
- // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
72
- TestExpression: ['argument']
73
- }
74
- });
75
- ```
76
-
77
- By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.
78
-
79
- ```javascript
80
- // This tree contains a user-defined `TestExpression` node.
81
- var tree = {
82
- type: 'TestExpression',
83
-
84
- // This 'argument' is the property containing the other **node**.
85
- argument: {
86
- type: 'Literal',
87
- value: 20
88
- },
89
-
90
- // This 'extended' is the property not containing the other **node**.
91
- extended: true
92
- };
93
- estraverse.traverse(tree, {
94
- enter: function (node) { },
95
-
96
- // Iterating the child **nodes** of unknown nodes.
97
- fallback: 'iteration'
98
- });
99
- ```
100
-
101
- When `visitor.fallback` is a function, we can determine which keys to visit on each node.
102
-
103
- ```javascript
104
- // This tree contains a user-defined `TestExpression` node.
105
- var tree = {
106
- type: 'TestExpression',
107
-
108
- // This 'argument' is the property containing the other **node**.
109
- argument: {
110
- type: 'Literal',
111
- value: 20
112
- },
113
-
114
- // This 'extended' is the property not containing the other **node**.
115
- extended: true
116
- };
117
- estraverse.traverse(tree, {
118
- enter: function (node) { },
119
-
120
- // Skip the `argument` property of each node
121
- fallback: function(node) {
122
- return Object.keys(node).filter(function(key) {
123
- return key !== 'argument';
124
- });
125
- }
126
- });
127
- ```
128
-
129
- ### License
130
-
131
- Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation)
132
- (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
133
-
134
- Redistribution and use in source and binary forms, with or without
135
- modification, are permitted provided that the following conditions are met:
136
-
137
- * Redistributions of source code must retain the above copyright
138
- notice, this list of conditions and the following disclaimer.
139
-
140
- * Redistributions in binary form must reproduce the above copyright
141
- notice, this list of conditions and the following disclaimer in the
142
- documentation and/or other materials provided with the distribution.
143
-
144
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
145
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
146
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
147
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
148
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
149
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
150
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
151
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
152
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
153
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.