@redis-ui/components 51.27.0 → 51.28.0

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 (142) hide show
  1. package/dist/CodeBlock/CodeBlock.cjs +29 -14
  2. package/dist/CodeBlock/CodeBlock.js +29 -14
  3. package/dist/CodeBlock/CodeBlock.style.d.ts +4 -3
  4. package/dist/CodeBlock/CodeBlock.types.cjs +7 -0
  5. package/dist/CodeBlock/CodeBlock.types.d.ts +4 -0
  6. package/dist/CodeBlock/CodeBlock.types.js +7 -1
  7. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.cjs +29 -0
  8. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.cjs +34 -0
  9. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.d.ts +25 -0
  10. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.js +32 -0
  11. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.d.ts +6 -0
  12. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.js +29 -0
  13. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.d.ts +10 -0
  14. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.js +1 -0
  15. package/dist/index.cjs +1 -0
  16. package/dist/index.js +2 -2
  17. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.cjs +8 -0
  18. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
  19. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.cjs +7 -0
  20. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
  21. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs +12 -0
  22. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  23. package/dist/node_modules/@babel/runtime/helpers/esm/extends.cjs +17 -0
  24. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  25. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.cjs +6 -0
  26. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
  27. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.cjs +6 -0
  28. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +6 -0
  29. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs +13 -0
  30. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
  31. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs +12 -0
  32. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  33. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs +10 -0
  34. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
  35. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.cjs +14 -0
  36. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  37. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.cjs +9 -0
  38. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  39. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.cjs +16 -0
  40. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  41. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.cjs +11 -0
  42. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
  43. package/dist/node_modules/character-entities-legacy/index.cjs +116 -0
  44. package/dist/node_modules/character-entities-legacy/index.js +116 -0
  45. package/dist/node_modules/character-reference-invalid/index.cjs +38 -0
  46. package/dist/node_modules/character-reference-invalid/index.js +38 -0
  47. package/dist/node_modules/comma-separated-tokens/index.cjs +43 -0
  48. package/dist/node_modules/comma-separated-tokens/index.js +43 -0
  49. package/dist/node_modules/decode-named-character-reference/index.dom.cjs +15 -0
  50. package/dist/node_modules/decode-named-character-reference/index.dom.js +15 -0
  51. package/dist/node_modules/hast-util-parse-selector/lib/index.cjs +76 -0
  52. package/dist/node_modules/hast-util-parse-selector/lib/index.js +76 -0
  53. package/dist/node_modules/hastscript/lib/create-h.cjs +262 -0
  54. package/dist/node_modules/hastscript/lib/create-h.js +262 -0
  55. package/dist/node_modules/hastscript/lib/index.cjs +21 -0
  56. package/dist/node_modules/hastscript/lib/index.js +21 -0
  57. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +49 -0
  58. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +49 -0
  59. package/dist/node_modules/is-alphabetical/index.cjs +14 -0
  60. package/dist/node_modules/is-alphabetical/index.js +14 -0
  61. package/dist/node_modules/is-alphanumerical/index.cjs +15 -0
  62. package/dist/node_modules/is-alphanumerical/index.js +15 -0
  63. package/dist/node_modules/is-decimal/index.cjs +14 -0
  64. package/dist/node_modules/is-decimal/index.js +14 -0
  65. package/dist/node_modules/is-hexadecimal/index.cjs +14 -0
  66. package/dist/node_modules/is-hexadecimal/index.js +14 -0
  67. package/dist/node_modules/parse-entities/lib/index.cjs +232 -0
  68. package/dist/node_modules/parse-entities/lib/index.js +232 -0
  69. package/dist/node_modules/property-information/index.cjs +27 -0
  70. package/dist/node_modules/property-information/index.js +26 -0
  71. package/dist/node_modules/property-information/lib/aria.cjs +60 -0
  72. package/dist/node_modules/property-information/lib/aria.js +61 -0
  73. package/dist/node_modules/property-information/lib/find.cjs +81 -0
  74. package/dist/node_modules/property-information/lib/find.js +81 -0
  75. package/dist/node_modules/property-information/lib/html.cjs +326 -0
  76. package/dist/node_modules/property-information/lib/html.js +326 -0
  77. package/dist/node_modules/property-information/lib/normalize.cjs +15 -0
  78. package/dist/node_modules/property-information/lib/normalize.js +15 -0
  79. package/dist/node_modules/property-information/lib/svg.cjs +564 -0
  80. package/dist/node_modules/property-information/lib/svg.js +564 -0
  81. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +15 -0
  82. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +15 -0
  83. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +14 -0
  84. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
  85. package/dist/node_modules/property-information/lib/util/create.cjs +53 -0
  86. package/dist/node_modules/property-information/lib/util/create.js +53 -0
  87. package/dist/node_modules/property-information/lib/util/defined-info.cjs +49 -0
  88. package/dist/node_modules/property-information/lib/util/defined-info.js +49 -0
  89. package/dist/node_modules/property-information/lib/util/info.cjs +33 -0
  90. package/dist/node_modules/property-information/lib/util/info.js +33 -0
  91. package/dist/node_modules/property-information/lib/util/merge.cjs +26 -0
  92. package/dist/node_modules/property-information/lib/util/merge.js +26 -0
  93. package/dist/node_modules/property-information/lib/util/schema.cjs +27 -0
  94. package/dist/node_modules/property-information/lib/util/schema.js +27 -0
  95. package/dist/node_modules/property-information/lib/util/types.cjs +35 -0
  96. package/dist/node_modules/property-information/lib/util/types.js +24 -0
  97. package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
  98. package/dist/node_modules/property-information/lib/xlink.js +19 -0
  99. package/dist/node_modules/property-information/lib/xml.cjs +14 -0
  100. package/dist/node_modules/property-information/lib/xml.js +15 -0
  101. package/dist/node_modules/property-information/lib/xmlns.cjs +14 -0
  102. package/dist/node_modules/property-information/lib/xmlns.js +14 -0
  103. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.cjs +6 -0
  104. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +6 -0
  105. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.cjs +183 -0
  106. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +181 -0
  107. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.cjs +308 -0
  108. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +306 -0
  109. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs +4 -0
  110. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js +5 -0
  111. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs +4 -0
  112. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js +5 -0
  113. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs +4 -0
  114. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js +5 -0
  115. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs +4 -0
  116. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js +5 -0
  117. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs +12 -0
  118. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.js +12 -0
  119. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs +121 -0
  120. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js +121 -0
  121. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs +147 -0
  122. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js +147 -0
  123. package/dist/node_modules/refractor/lang/bash.cjs +190 -0
  124. package/dist/node_modules/refractor/lang/bash.js +190 -0
  125. package/dist/node_modules/refractor/lang/clike.cjs +37 -0
  126. package/dist/node_modules/refractor/lang/clike.js +37 -0
  127. package/dist/node_modules/refractor/lang/javascript.cjs +122 -0
  128. package/dist/node_modules/refractor/lang/javascript.js +122 -0
  129. package/dist/node_modules/refractor/lang/json.cjs +36 -0
  130. package/dist/node_modules/refractor/lang/json.js +36 -0
  131. package/dist/node_modules/refractor/lang/python.cjs +71 -0
  132. package/dist/node_modules/refractor/lang/python.js +71 -0
  133. package/dist/node_modules/refractor/lang/typescript.cjs +55 -0
  134. package/dist/node_modules/refractor/lang/typescript.js +55 -0
  135. package/dist/node_modules/refractor/lib/core.cjs +214 -0
  136. package/dist/node_modules/refractor/lib/core.js +214 -0
  137. package/dist/node_modules/refractor/lib/prism-core.cjs +595 -0
  138. package/dist/node_modules/refractor/lib/prism-core.js +595 -0
  139. package/dist/node_modules/space-separated-tokens/index.cjs +15 -0
  140. package/dist/node_modules/space-separated-tokens/index.js +15 -0
  141. package/package.json +3 -1
  142. package/skills/redis-ui-components/references/CodeBlock.md +23 -5
@@ -0,0 +1,15 @@
1
+ const require_index = require("../is-decimal/index.cjs");
2
+ const require_index$1 = require("../is-alphabetical/index.cjs");
3
+ //#region ../../node_modules/is-alphanumerical/index.js
4
+ /**
5
+ * Check if the given character code, or the character code at the first
6
+ * character, is alphanumerical.
7
+ *
8
+ * @param {string|number} character
9
+ * @returns {boolean} Whether `character` is alphanumerical.
10
+ */
11
+ function isAlphanumerical(character) {
12
+ return require_index$1.isAlphabetical(character) || require_index.isDecimal(character);
13
+ }
14
+ //#endregion
15
+ exports.isAlphanumerical = isAlphanumerical;
@@ -0,0 +1,15 @@
1
+ import { isDecimal } from "../is-decimal/index.js";
2
+ import { isAlphabetical } from "../is-alphabetical/index.js";
3
+ //#region ../../node_modules/is-alphanumerical/index.js
4
+ /**
5
+ * Check if the given character code, or the character code at the first
6
+ * character, is alphanumerical.
7
+ *
8
+ * @param {string|number} character
9
+ * @returns {boolean} Whether `character` is alphanumerical.
10
+ */
11
+ function isAlphanumerical(character) {
12
+ return isAlphabetical(character) || isDecimal(character);
13
+ }
14
+ //#endregion
15
+ export { isAlphanumerical };
@@ -0,0 +1,14 @@
1
+ //#region ../../node_modules/is-decimal/index.js
2
+ /**
3
+ * Check if the given character code, or the character code at the first
4
+ * character, is decimal.
5
+ *
6
+ * @param {string|number} character
7
+ * @returns {boolean} Whether `character` is a decimal
8
+ */
9
+ function isDecimal(character) {
10
+ const code = typeof character === "string" ? character.charCodeAt(0) : character;
11
+ return code >= 48 && code <= 57;
12
+ }
13
+ //#endregion
14
+ exports.isDecimal = isDecimal;
@@ -0,0 +1,14 @@
1
+ //#region ../../node_modules/is-decimal/index.js
2
+ /**
3
+ * Check if the given character code, or the character code at the first
4
+ * character, is decimal.
5
+ *
6
+ * @param {string|number} character
7
+ * @returns {boolean} Whether `character` is a decimal
8
+ */
9
+ function isDecimal(character) {
10
+ const code = typeof character === "string" ? character.charCodeAt(0) : character;
11
+ return code >= 48 && code <= 57;
12
+ }
13
+ //#endregion
14
+ export { isDecimal };
@@ -0,0 +1,14 @@
1
+ //#region ../../node_modules/is-hexadecimal/index.js
2
+ /**
3
+ * Check if the given character code, or the character code at the first
4
+ * character, is hexadecimal.
5
+ *
6
+ * @param {string|number} character
7
+ * @returns {boolean} Whether `character` is hexadecimal
8
+ */
9
+ function isHexadecimal(character) {
10
+ const code = typeof character === "string" ? character.charCodeAt(0) : character;
11
+ return code >= 97 && code <= 102 || code >= 65 && code <= 70 || code >= 48 && code <= 57;
12
+ }
13
+ //#endregion
14
+ exports.isHexadecimal = isHexadecimal;
@@ -0,0 +1,14 @@
1
+ //#region ../../node_modules/is-hexadecimal/index.js
2
+ /**
3
+ * Check if the given character code, or the character code at the first
4
+ * character, is hexadecimal.
5
+ *
6
+ * @param {string|number} character
7
+ * @returns {boolean} Whether `character` is hexadecimal
8
+ */
9
+ function isHexadecimal(character) {
10
+ const code = typeof character === "string" ? character.charCodeAt(0) : character;
11
+ return code >= 97 && code <= 102 || code >= 65 && code <= 70 || code >= 48 && code <= 57;
12
+ }
13
+ //#endregion
14
+ export { isHexadecimal };
@@ -0,0 +1,232 @@
1
+ const require_index = require("../../character-entities-legacy/index.cjs");
2
+ const require_index$1 = require("../../character-reference-invalid/index.cjs");
3
+ const require_index$2 = require("../../is-decimal/index.cjs");
4
+ const require_index$3 = require("../../is-hexadecimal/index.cjs");
5
+ const require_index$4 = require("../../is-alphanumerical/index.cjs");
6
+ const require_index_dom = require("../../decode-named-character-reference/index.dom.cjs");
7
+ //#region ../../node_modules/parse-entities/lib/index.js
8
+ /**
9
+ * @import {Point} from 'unist'
10
+ * @import {Options} from '../index.js'
11
+ */
12
+ var messages = [
13
+ "",
14
+ "Named character references must be terminated by a semicolon",
15
+ "Numeric character references must be terminated by a semicolon",
16
+ "Named character references cannot be empty",
17
+ "Numeric character references cannot be empty",
18
+ "Named character references must be known",
19
+ "Numeric character references cannot be disallowed",
20
+ "Numeric character references cannot be outside the permissible Unicode range"
21
+ ];
22
+ /**
23
+ * Parse HTML character references.
24
+ *
25
+ * @param {string} value
26
+ * @param {Readonly<Options> | null | undefined} [options]
27
+ */
28
+ function parseEntities(value, options) {
29
+ const settings = options || {};
30
+ const additional = typeof settings.additional === "string" ? settings.additional.charCodeAt(0) : settings.additional;
31
+ /** @type {Array<string>} */
32
+ const result = [];
33
+ let index = 0;
34
+ let lines = -1;
35
+ let queue = "";
36
+ /** @type {Point | undefined} */
37
+ let point;
38
+ /** @type {Array<number>|undefined} */
39
+ let indent;
40
+ if (settings.position) if ("start" in settings.position || "indent" in settings.position) {
41
+ indent = settings.position.indent;
42
+ point = settings.position.start;
43
+ } else point = settings.position;
44
+ let line = (point ? point.line : 0) || 1;
45
+ let column = (point ? point.column : 0) || 1;
46
+ let previous = now();
47
+ /** @type {number|undefined} */
48
+ let character;
49
+ index--;
50
+ while (++index <= value.length) {
51
+ if (character === 10) column = (indent ? indent[lines] : 0) || 1;
52
+ character = value.charCodeAt(index);
53
+ if (character === 38) {
54
+ const following = value.charCodeAt(index + 1);
55
+ if (following === 9 || following === 10 || following === 12 || following === 32 || following === 38 || following === 60 || Number.isNaN(following) || additional && following === additional) {
56
+ queue += String.fromCharCode(character);
57
+ column++;
58
+ continue;
59
+ }
60
+ const start = index + 1;
61
+ let begin = start;
62
+ let end = start;
63
+ /** @type {string} */
64
+ let type;
65
+ if (following === 35) {
66
+ end = ++begin;
67
+ const following = value.charCodeAt(end);
68
+ if (following === 88 || following === 120) {
69
+ type = "hexadecimal";
70
+ end = ++begin;
71
+ } else type = "decimal";
72
+ } else type = "named";
73
+ let characterReferenceCharacters = "";
74
+ let characterReference = "";
75
+ let characters = "";
76
+ const test = type === "named" ? require_index$4.isAlphanumerical : type === "decimal" ? require_index$2.isDecimal : require_index$3.isHexadecimal;
77
+ end--;
78
+ while (++end <= value.length) {
79
+ const following = value.charCodeAt(end);
80
+ if (!test(following)) break;
81
+ characters += String.fromCharCode(following);
82
+ if (type === "named" && require_index.characterEntitiesLegacy.includes(characters)) {
83
+ characterReferenceCharacters = characters;
84
+ characterReference = require_index_dom.decodeNamedCharacterReference(characters);
85
+ }
86
+ }
87
+ let terminated = value.charCodeAt(end) === 59;
88
+ if (terminated) {
89
+ end++;
90
+ const namedReference = type === "named" ? require_index_dom.decodeNamedCharacterReference(characters) : false;
91
+ if (namedReference) {
92
+ characterReferenceCharacters = characters;
93
+ characterReference = namedReference;
94
+ }
95
+ }
96
+ let diff = 1 + end - start;
97
+ let reference = "";
98
+ if (!terminated && settings.nonTerminated === false) {} else if (!characters) {
99
+ if (type !== "named") warning(4, diff);
100
+ } else if (type === "named") {
101
+ if (terminated && !characterReference) warning(5, 1);
102
+ else {
103
+ if (characterReferenceCharacters !== characters) {
104
+ end = begin + characterReferenceCharacters.length;
105
+ diff = 1 + end - begin;
106
+ terminated = false;
107
+ }
108
+ if (!terminated) {
109
+ const reason = characterReferenceCharacters ? 1 : 3;
110
+ if (settings.attribute) {
111
+ const following = value.charCodeAt(end);
112
+ if (following === 61) {
113
+ warning(reason, diff);
114
+ characterReference = "";
115
+ } else if (require_index$4.isAlphanumerical(following)) characterReference = "";
116
+ else warning(reason, diff);
117
+ } else warning(reason, diff);
118
+ }
119
+ }
120
+ reference = characterReference;
121
+ } else {
122
+ if (!terminated) warning(2, diff);
123
+ let referenceCode = Number.parseInt(characters, type === "hexadecimal" ? 16 : 10);
124
+ if (prohibited(referenceCode)) {
125
+ warning(7, diff);
126
+ reference = String.fromCharCode(65533);
127
+ } else if (referenceCode in require_index$1.characterReferenceInvalid) {
128
+ warning(6, diff);
129
+ reference = require_index$1.characterReferenceInvalid[referenceCode];
130
+ } else {
131
+ let output = "";
132
+ if (disallowed(referenceCode)) warning(6, diff);
133
+ if (referenceCode > 65535) {
134
+ referenceCode -= 65536;
135
+ output += String.fromCharCode(referenceCode >>> 10 | 55296);
136
+ referenceCode = 56320 | referenceCode & 1023;
137
+ }
138
+ reference = output + String.fromCharCode(referenceCode);
139
+ }
140
+ }
141
+ if (reference) {
142
+ flush();
143
+ previous = now();
144
+ index = end - 1;
145
+ column += end - start + 1;
146
+ result.push(reference);
147
+ const next = now();
148
+ next.offset++;
149
+ if (settings.reference) settings.reference.call(settings.referenceContext || void 0, reference, {
150
+ start: previous,
151
+ end: next
152
+ }, value.slice(start - 1, end));
153
+ previous = next;
154
+ } else {
155
+ characters = value.slice(start - 1, end);
156
+ queue += characters;
157
+ column += characters.length;
158
+ index = end - 1;
159
+ }
160
+ } else {
161
+ if (character === 10) {
162
+ line++;
163
+ lines++;
164
+ column = 0;
165
+ }
166
+ if (Number.isNaN(character)) flush();
167
+ else {
168
+ queue += String.fromCharCode(character);
169
+ column++;
170
+ }
171
+ }
172
+ }
173
+ return result.join("");
174
+ function now() {
175
+ return {
176
+ line,
177
+ column,
178
+ offset: index + ((point ? point.offset : 0) || 0)
179
+ };
180
+ }
181
+ /**
182
+ * Handle the warning.
183
+ *
184
+ * @param {1|2|3|4|5|6|7} code
185
+ * @param {number} offset
186
+ */
187
+ function warning(code, offset) {
188
+ /** @type {ReturnType<now>} */
189
+ let position;
190
+ if (settings.warning) {
191
+ position = now();
192
+ position.column += offset;
193
+ position.offset += offset;
194
+ settings.warning.call(settings.warningContext || void 0, messages[code], position, code);
195
+ }
196
+ }
197
+ /**
198
+ * Flush `queue` (normal text).
199
+ * Macro invoked before each reference and at the end of `value`.
200
+ * Does nothing when `queue` is empty.
201
+ */
202
+ function flush() {
203
+ if (queue) {
204
+ result.push(queue);
205
+ if (settings.text) settings.text.call(settings.textContext || void 0, queue, {
206
+ start: previous,
207
+ end: now()
208
+ });
209
+ queue = "";
210
+ }
211
+ }
212
+ }
213
+ /**
214
+ * Check if `character` is outside the permissible unicode range.
215
+ *
216
+ * @param {number} code
217
+ * @returns {boolean}
218
+ */
219
+ function prohibited(code) {
220
+ return code >= 55296 && code <= 57343 || code > 1114111;
221
+ }
222
+ /**
223
+ * Check if `character` is disallowed.
224
+ *
225
+ * @param {number} code
226
+ * @returns {boolean}
227
+ */
228
+ function disallowed(code) {
229
+ return code >= 1 && code <= 8 || code === 11 || code >= 13 && code <= 31 || code >= 127 && code <= 159 || code >= 64976 && code <= 65007 || (code & 65535) === 65535 || (code & 65535) === 65534;
230
+ }
231
+ //#endregion
232
+ exports.parseEntities = parseEntities;
@@ -0,0 +1,232 @@
1
+ import { characterEntitiesLegacy } from "../../character-entities-legacy/index.js";
2
+ import { characterReferenceInvalid } from "../../character-reference-invalid/index.js";
3
+ import { isDecimal } from "../../is-decimal/index.js";
4
+ import { isHexadecimal } from "../../is-hexadecimal/index.js";
5
+ import { isAlphanumerical } from "../../is-alphanumerical/index.js";
6
+ import { decodeNamedCharacterReference } from "../../decode-named-character-reference/index.dom.js";
7
+ //#region ../../node_modules/parse-entities/lib/index.js
8
+ /**
9
+ * @import {Point} from 'unist'
10
+ * @import {Options} from '../index.js'
11
+ */
12
+ var messages = [
13
+ "",
14
+ "Named character references must be terminated by a semicolon",
15
+ "Numeric character references must be terminated by a semicolon",
16
+ "Named character references cannot be empty",
17
+ "Numeric character references cannot be empty",
18
+ "Named character references must be known",
19
+ "Numeric character references cannot be disallowed",
20
+ "Numeric character references cannot be outside the permissible Unicode range"
21
+ ];
22
+ /**
23
+ * Parse HTML character references.
24
+ *
25
+ * @param {string} value
26
+ * @param {Readonly<Options> | null | undefined} [options]
27
+ */
28
+ function parseEntities(value, options) {
29
+ const settings = options || {};
30
+ const additional = typeof settings.additional === "string" ? settings.additional.charCodeAt(0) : settings.additional;
31
+ /** @type {Array<string>} */
32
+ const result = [];
33
+ let index = 0;
34
+ let lines = -1;
35
+ let queue = "";
36
+ /** @type {Point | undefined} */
37
+ let point;
38
+ /** @type {Array<number>|undefined} */
39
+ let indent;
40
+ if (settings.position) if ("start" in settings.position || "indent" in settings.position) {
41
+ indent = settings.position.indent;
42
+ point = settings.position.start;
43
+ } else point = settings.position;
44
+ let line = (point ? point.line : 0) || 1;
45
+ let column = (point ? point.column : 0) || 1;
46
+ let previous = now();
47
+ /** @type {number|undefined} */
48
+ let character;
49
+ index--;
50
+ while (++index <= value.length) {
51
+ if (character === 10) column = (indent ? indent[lines] : 0) || 1;
52
+ character = value.charCodeAt(index);
53
+ if (character === 38) {
54
+ const following = value.charCodeAt(index + 1);
55
+ if (following === 9 || following === 10 || following === 12 || following === 32 || following === 38 || following === 60 || Number.isNaN(following) || additional && following === additional) {
56
+ queue += String.fromCharCode(character);
57
+ column++;
58
+ continue;
59
+ }
60
+ const start = index + 1;
61
+ let begin = start;
62
+ let end = start;
63
+ /** @type {string} */
64
+ let type;
65
+ if (following === 35) {
66
+ end = ++begin;
67
+ const following = value.charCodeAt(end);
68
+ if (following === 88 || following === 120) {
69
+ type = "hexadecimal";
70
+ end = ++begin;
71
+ } else type = "decimal";
72
+ } else type = "named";
73
+ let characterReferenceCharacters = "";
74
+ let characterReference = "";
75
+ let characters = "";
76
+ const test = type === "named" ? isAlphanumerical : type === "decimal" ? isDecimal : isHexadecimal;
77
+ end--;
78
+ while (++end <= value.length) {
79
+ const following = value.charCodeAt(end);
80
+ if (!test(following)) break;
81
+ characters += String.fromCharCode(following);
82
+ if (type === "named" && characterEntitiesLegacy.includes(characters)) {
83
+ characterReferenceCharacters = characters;
84
+ characterReference = decodeNamedCharacterReference(characters);
85
+ }
86
+ }
87
+ let terminated = value.charCodeAt(end) === 59;
88
+ if (terminated) {
89
+ end++;
90
+ const namedReference = type === "named" ? decodeNamedCharacterReference(characters) : false;
91
+ if (namedReference) {
92
+ characterReferenceCharacters = characters;
93
+ characterReference = namedReference;
94
+ }
95
+ }
96
+ let diff = 1 + end - start;
97
+ let reference = "";
98
+ if (!terminated && settings.nonTerminated === false) {} else if (!characters) {
99
+ if (type !== "named") warning(4, diff);
100
+ } else if (type === "named") {
101
+ if (terminated && !characterReference) warning(5, 1);
102
+ else {
103
+ if (characterReferenceCharacters !== characters) {
104
+ end = begin + characterReferenceCharacters.length;
105
+ diff = 1 + end - begin;
106
+ terminated = false;
107
+ }
108
+ if (!terminated) {
109
+ const reason = characterReferenceCharacters ? 1 : 3;
110
+ if (settings.attribute) {
111
+ const following = value.charCodeAt(end);
112
+ if (following === 61) {
113
+ warning(reason, diff);
114
+ characterReference = "";
115
+ } else if (isAlphanumerical(following)) characterReference = "";
116
+ else warning(reason, diff);
117
+ } else warning(reason, diff);
118
+ }
119
+ }
120
+ reference = characterReference;
121
+ } else {
122
+ if (!terminated) warning(2, diff);
123
+ let referenceCode = Number.parseInt(characters, type === "hexadecimal" ? 16 : 10);
124
+ if (prohibited(referenceCode)) {
125
+ warning(7, diff);
126
+ reference = String.fromCharCode(65533);
127
+ } else if (referenceCode in characterReferenceInvalid) {
128
+ warning(6, diff);
129
+ reference = characterReferenceInvalid[referenceCode];
130
+ } else {
131
+ let output = "";
132
+ if (disallowed(referenceCode)) warning(6, diff);
133
+ if (referenceCode > 65535) {
134
+ referenceCode -= 65536;
135
+ output += String.fromCharCode(referenceCode >>> 10 | 55296);
136
+ referenceCode = 56320 | referenceCode & 1023;
137
+ }
138
+ reference = output + String.fromCharCode(referenceCode);
139
+ }
140
+ }
141
+ if (reference) {
142
+ flush();
143
+ previous = now();
144
+ index = end - 1;
145
+ column += end - start + 1;
146
+ result.push(reference);
147
+ const next = now();
148
+ next.offset++;
149
+ if (settings.reference) settings.reference.call(settings.referenceContext || void 0, reference, {
150
+ start: previous,
151
+ end: next
152
+ }, value.slice(start - 1, end));
153
+ previous = next;
154
+ } else {
155
+ characters = value.slice(start - 1, end);
156
+ queue += characters;
157
+ column += characters.length;
158
+ index = end - 1;
159
+ }
160
+ } else {
161
+ if (character === 10) {
162
+ line++;
163
+ lines++;
164
+ column = 0;
165
+ }
166
+ if (Number.isNaN(character)) flush();
167
+ else {
168
+ queue += String.fromCharCode(character);
169
+ column++;
170
+ }
171
+ }
172
+ }
173
+ return result.join("");
174
+ function now() {
175
+ return {
176
+ line,
177
+ column,
178
+ offset: index + ((point ? point.offset : 0) || 0)
179
+ };
180
+ }
181
+ /**
182
+ * Handle the warning.
183
+ *
184
+ * @param {1|2|3|4|5|6|7} code
185
+ * @param {number} offset
186
+ */
187
+ function warning(code, offset) {
188
+ /** @type {ReturnType<now>} */
189
+ let position;
190
+ if (settings.warning) {
191
+ position = now();
192
+ position.column += offset;
193
+ position.offset += offset;
194
+ settings.warning.call(settings.warningContext || void 0, messages[code], position, code);
195
+ }
196
+ }
197
+ /**
198
+ * Flush `queue` (normal text).
199
+ * Macro invoked before each reference and at the end of `value`.
200
+ * Does nothing when `queue` is empty.
201
+ */
202
+ function flush() {
203
+ if (queue) {
204
+ result.push(queue);
205
+ if (settings.text) settings.text.call(settings.textContext || void 0, queue, {
206
+ start: previous,
207
+ end: now()
208
+ });
209
+ queue = "";
210
+ }
211
+ }
212
+ }
213
+ /**
214
+ * Check if `character` is outside the permissible unicode range.
215
+ *
216
+ * @param {number} code
217
+ * @returns {boolean}
218
+ */
219
+ function prohibited(code) {
220
+ return code >= 55296 && code <= 57343 || code > 1114111;
221
+ }
222
+ /**
223
+ * Check if `character` is disallowed.
224
+ *
225
+ * @param {number} code
226
+ * @returns {boolean}
227
+ */
228
+ function disallowed(code) {
229
+ return code >= 1 && code <= 8 || code === 11 || code >= 13 && code <= 31 || code >= 127 && code <= 159 || code >= 64976 && code <= 65007 || (code & 65535) === 65535 || (code & 65535) === 65534;
230
+ }
231
+ //#endregion
232
+ export { parseEntities };
@@ -0,0 +1,27 @@
1
+ const require_merge = require("./lib/util/merge.cjs");
2
+ require("./lib/normalize.cjs");
3
+ const require_aria = require("./lib/aria.cjs");
4
+ const require_html = require("./lib/html.cjs");
5
+ const require_svg = require("./lib/svg.cjs");
6
+ const require_xlink = require("./lib/xlink.cjs");
7
+ const require_xmlns = require("./lib/xmlns.cjs");
8
+ const require_xml = require("./lib/xml.cjs");
9
+ require("./lib/find.cjs");
10
+ //#region ../../node_modules/property-information/index.js
11
+ var html = require_merge.merge([
12
+ require_aria.aria,
13
+ require_html.html,
14
+ require_xlink.xlink,
15
+ require_xmlns.xmlns,
16
+ require_xml.xml
17
+ ], "html");
18
+ var svg = require_merge.merge([
19
+ require_aria.aria,
20
+ require_svg.svg,
21
+ require_xlink.xlink,
22
+ require_xmlns.xmlns,
23
+ require_xml.xml
24
+ ], "svg");
25
+ //#endregion
26
+ exports.html = html;
27
+ exports.svg = svg;
@@ -0,0 +1,26 @@
1
+ import { merge } from "./lib/util/merge.js";
2
+ import "./lib/normalize.js";
3
+ import { aria } from "./lib/aria.js";
4
+ import { html as html$1 } from "./lib/html.js";
5
+ import { svg as svg$1 } from "./lib/svg.js";
6
+ import { xlink } from "./lib/xlink.js";
7
+ import { xmlns } from "./lib/xmlns.js";
8
+ import { xml } from "./lib/xml.js";
9
+ import "./lib/find.js";
10
+ //#region ../../node_modules/property-information/index.js
11
+ var html = merge([
12
+ aria,
13
+ html$1,
14
+ xlink,
15
+ xmlns,
16
+ xml
17
+ ], "html");
18
+ var svg = merge([
19
+ aria,
20
+ svg$1,
21
+ xlink,
22
+ xmlns,
23
+ xml
24
+ ], "svg");
25
+ //#endregion
26
+ export { html, svg };
@@ -0,0 +1,60 @@
1
+ const require_types = require("./util/types.cjs");
2
+ //#region ../../node_modules/property-information/lib/aria.js
3
+ var aria = require("./util/create.cjs").create({
4
+ properties: {
5
+ ariaActiveDescendant: null,
6
+ ariaAtomic: require_types.booleanish,
7
+ ariaAutoComplete: null,
8
+ ariaBusy: require_types.booleanish,
9
+ ariaChecked: require_types.booleanish,
10
+ ariaColCount: require_types.number,
11
+ ariaColIndex: require_types.number,
12
+ ariaColSpan: require_types.number,
13
+ ariaControls: require_types.spaceSeparated,
14
+ ariaCurrent: null,
15
+ ariaDescribedBy: require_types.spaceSeparated,
16
+ ariaDetails: null,
17
+ ariaDisabled: require_types.booleanish,
18
+ ariaDropEffect: require_types.spaceSeparated,
19
+ ariaErrorMessage: null,
20
+ ariaExpanded: require_types.booleanish,
21
+ ariaFlowTo: require_types.spaceSeparated,
22
+ ariaGrabbed: require_types.booleanish,
23
+ ariaHasPopup: null,
24
+ ariaHidden: require_types.booleanish,
25
+ ariaInvalid: null,
26
+ ariaKeyShortcuts: null,
27
+ ariaLabel: null,
28
+ ariaLabelledBy: require_types.spaceSeparated,
29
+ ariaLevel: require_types.number,
30
+ ariaLive: null,
31
+ ariaModal: require_types.booleanish,
32
+ ariaMultiLine: require_types.booleanish,
33
+ ariaMultiSelectable: require_types.booleanish,
34
+ ariaOrientation: null,
35
+ ariaOwns: require_types.spaceSeparated,
36
+ ariaPlaceholder: null,
37
+ ariaPosInSet: require_types.number,
38
+ ariaPressed: require_types.booleanish,
39
+ ariaReadOnly: require_types.booleanish,
40
+ ariaRelevant: null,
41
+ ariaRequired: require_types.booleanish,
42
+ ariaRoleDescription: require_types.spaceSeparated,
43
+ ariaRowCount: require_types.number,
44
+ ariaRowIndex: require_types.number,
45
+ ariaRowSpan: require_types.number,
46
+ ariaSelected: require_types.booleanish,
47
+ ariaSetSize: require_types.number,
48
+ ariaSort: null,
49
+ ariaValueMax: require_types.number,
50
+ ariaValueMin: require_types.number,
51
+ ariaValueNow: require_types.number,
52
+ ariaValueText: null,
53
+ role: null
54
+ },
55
+ transform(_, property) {
56
+ return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
57
+ }
58
+ });
59
+ //#endregion
60
+ exports.aria = aria;