@redis-ui/components 51.26.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 (187) hide show
  1. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +17 -8
  2. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +17 -8
  3. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -1
  4. package/dist/CodeBlock/CodeBlock.cjs +29 -14
  5. package/dist/CodeBlock/CodeBlock.js +29 -14
  6. package/dist/CodeBlock/CodeBlock.style.d.ts +4 -3
  7. package/dist/CodeBlock/CodeBlock.types.cjs +7 -0
  8. package/dist/CodeBlock/CodeBlock.types.d.ts +4 -0
  9. package/dist/CodeBlock/CodeBlock.types.js +7 -1
  10. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.cjs +29 -0
  11. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.cjs +34 -0
  12. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.d.ts +25 -0
  13. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.js +32 -0
  14. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.d.ts +6 -0
  15. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.js +29 -0
  16. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.d.ts +10 -0
  17. package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.js +1 -0
  18. package/dist/Inputs/Input/Input.cjs +9 -2
  19. package/dist/Inputs/Input/Input.d.ts +4 -1
  20. package/dist/Inputs/Input/Input.js +9 -2
  21. package/dist/Inputs/Input/Input.types.d.ts +5 -1
  22. package/dist/Inputs/PasswordInput/components/Compose/Compose.types.d.ts +1 -1
  23. package/dist/Inputs/TextArea/TextArea.cjs +16 -6
  24. package/dist/Inputs/TextArea/TextArea.d.ts +3 -1
  25. package/dist/Inputs/TextArea/TextArea.js +16 -6
  26. package/dist/Inputs/TextArea/TextArea.types.d.ts +4 -1
  27. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.cjs +7 -0
  28. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.d.ts +2 -0
  29. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.js +7 -0
  30. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.cjs +17 -0
  31. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.d.ts +1 -0
  32. package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.js +15 -0
  33. package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.cjs +3 -1
  34. package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.js +4 -2
  35. package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.cjs +8 -1
  36. package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.js +8 -1
  37. package/dist/Inputs/components/Compose/CommonCompose.cjs +23 -18
  38. package/dist/Inputs/components/Compose/CommonCompose.d.ts +1 -1
  39. package/dist/Inputs/components/Compose/CommonCompose.js +24 -19
  40. package/dist/Inputs/components/Compose/CommonCompose.types.d.ts +2 -0
  41. package/dist/Inputs/components/Compose/Compose.style.cjs +7 -0
  42. package/dist/Inputs/components/Compose/Compose.style.js +7 -0
  43. package/dist/Inputs/components/Compose/NumericCompose.types.d.ts +1 -1
  44. package/dist/Inputs/components/CopyButton/CopyButton.cjs +15 -0
  45. package/dist/Inputs/components/CopyButton/CopyButton.d.ts +2 -0
  46. package/dist/Inputs/components/CopyButton/CopyButton.js +15 -0
  47. package/dist/Inputs/components/CopyButton/CopyButton.style.cjs +17 -0
  48. package/dist/Inputs/components/CopyButton/CopyButton.style.d.ts +1 -0
  49. package/dist/Inputs/components/CopyButton/CopyButton.style.js +15 -0
  50. package/dist/Inputs/components/CopyButton/CopyButton.types.d.ts +6 -0
  51. package/dist/Inputs/components/CopyButton/CopyButton.types.js +1 -0
  52. package/dist/Inputs/components/InputTag/InputTag.cjs +3 -1
  53. package/dist/Inputs/components/InputTag/InputTag.js +4 -2
  54. package/dist/Inputs/components/InputTag/InputTag.style.cjs +1 -1
  55. package/dist/Inputs/components/InputTag/InputTag.style.js +1 -1
  56. package/dist/index.cjs +1 -0
  57. package/dist/index.js +2 -2
  58. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.cjs +8 -0
  59. package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
  60. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.cjs +7 -0
  61. package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
  62. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs +12 -0
  63. package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
  64. package/dist/node_modules/@babel/runtime/helpers/esm/extends.cjs +17 -0
  65. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  66. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.cjs +6 -0
  67. package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
  68. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.cjs +6 -0
  69. package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +6 -0
  70. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs +13 -0
  71. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
  72. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs +12 -0
  73. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  74. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs +10 -0
  75. package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
  76. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.cjs +14 -0
  77. package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
  78. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.cjs +9 -0
  79. package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
  80. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.cjs +16 -0
  81. package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
  82. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.cjs +11 -0
  83. package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
  84. package/dist/node_modules/character-entities-legacy/index.cjs +116 -0
  85. package/dist/node_modules/character-entities-legacy/index.js +116 -0
  86. package/dist/node_modules/character-reference-invalid/index.cjs +38 -0
  87. package/dist/node_modules/character-reference-invalid/index.js +38 -0
  88. package/dist/node_modules/comma-separated-tokens/index.cjs +43 -0
  89. package/dist/node_modules/comma-separated-tokens/index.js +43 -0
  90. package/dist/node_modules/decode-named-character-reference/index.dom.cjs +15 -0
  91. package/dist/node_modules/decode-named-character-reference/index.dom.js +15 -0
  92. package/dist/node_modules/hast-util-parse-selector/lib/index.cjs +76 -0
  93. package/dist/node_modules/hast-util-parse-selector/lib/index.js +76 -0
  94. package/dist/node_modules/hastscript/lib/create-h.cjs +262 -0
  95. package/dist/node_modules/hastscript/lib/create-h.js +262 -0
  96. package/dist/node_modules/hastscript/lib/index.cjs +21 -0
  97. package/dist/node_modules/hastscript/lib/index.js +21 -0
  98. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +49 -0
  99. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +49 -0
  100. package/dist/node_modules/is-alphabetical/index.cjs +14 -0
  101. package/dist/node_modules/is-alphabetical/index.js +14 -0
  102. package/dist/node_modules/is-alphanumerical/index.cjs +15 -0
  103. package/dist/node_modules/is-alphanumerical/index.js +15 -0
  104. package/dist/node_modules/is-decimal/index.cjs +14 -0
  105. package/dist/node_modules/is-decimal/index.js +14 -0
  106. package/dist/node_modules/is-hexadecimal/index.cjs +14 -0
  107. package/dist/node_modules/is-hexadecimal/index.js +14 -0
  108. package/dist/node_modules/parse-entities/lib/index.cjs +232 -0
  109. package/dist/node_modules/parse-entities/lib/index.js +232 -0
  110. package/dist/node_modules/property-information/index.cjs +27 -0
  111. package/dist/node_modules/property-information/index.js +26 -0
  112. package/dist/node_modules/property-information/lib/aria.cjs +60 -0
  113. package/dist/node_modules/property-information/lib/aria.js +61 -0
  114. package/dist/node_modules/property-information/lib/find.cjs +81 -0
  115. package/dist/node_modules/property-information/lib/find.js +81 -0
  116. package/dist/node_modules/property-information/lib/html.cjs +326 -0
  117. package/dist/node_modules/property-information/lib/html.js +326 -0
  118. package/dist/node_modules/property-information/lib/normalize.cjs +15 -0
  119. package/dist/node_modules/property-information/lib/normalize.js +15 -0
  120. package/dist/node_modules/property-information/lib/svg.cjs +564 -0
  121. package/dist/node_modules/property-information/lib/svg.js +564 -0
  122. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +15 -0
  123. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +15 -0
  124. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +14 -0
  125. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
  126. package/dist/node_modules/property-information/lib/util/create.cjs +53 -0
  127. package/dist/node_modules/property-information/lib/util/create.js +53 -0
  128. package/dist/node_modules/property-information/lib/util/defined-info.cjs +49 -0
  129. package/dist/node_modules/property-information/lib/util/defined-info.js +49 -0
  130. package/dist/node_modules/property-information/lib/util/info.cjs +33 -0
  131. package/dist/node_modules/property-information/lib/util/info.js +33 -0
  132. package/dist/node_modules/property-information/lib/util/merge.cjs +26 -0
  133. package/dist/node_modules/property-information/lib/util/merge.js +26 -0
  134. package/dist/node_modules/property-information/lib/util/schema.cjs +27 -0
  135. package/dist/node_modules/property-information/lib/util/schema.js +27 -0
  136. package/dist/node_modules/property-information/lib/util/types.cjs +35 -0
  137. package/dist/node_modules/property-information/lib/util/types.js +24 -0
  138. package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
  139. package/dist/node_modules/property-information/lib/xlink.js +19 -0
  140. package/dist/node_modules/property-information/lib/xml.cjs +14 -0
  141. package/dist/node_modules/property-information/lib/xml.js +15 -0
  142. package/dist/node_modules/property-information/lib/xmlns.cjs +14 -0
  143. package/dist/node_modules/property-information/lib/xmlns.js +14 -0
  144. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.cjs +6 -0
  145. package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +6 -0
  146. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.cjs +183 -0
  147. package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +181 -0
  148. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.cjs +308 -0
  149. package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +306 -0
  150. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs +4 -0
  151. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js +5 -0
  152. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs +4 -0
  153. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js +5 -0
  154. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs +4 -0
  155. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js +5 -0
  156. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs +4 -0
  157. package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js +5 -0
  158. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs +12 -0
  159. package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.js +12 -0
  160. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs +121 -0
  161. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js +121 -0
  162. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs +147 -0
  163. package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js +147 -0
  164. package/dist/node_modules/refractor/lang/bash.cjs +190 -0
  165. package/dist/node_modules/refractor/lang/bash.js +190 -0
  166. package/dist/node_modules/refractor/lang/clike.cjs +37 -0
  167. package/dist/node_modules/refractor/lang/clike.js +37 -0
  168. package/dist/node_modules/refractor/lang/javascript.cjs +122 -0
  169. package/dist/node_modules/refractor/lang/javascript.js +122 -0
  170. package/dist/node_modules/refractor/lang/json.cjs +36 -0
  171. package/dist/node_modules/refractor/lang/json.js +36 -0
  172. package/dist/node_modules/refractor/lang/python.cjs +71 -0
  173. package/dist/node_modules/refractor/lang/python.js +71 -0
  174. package/dist/node_modules/refractor/lang/typescript.cjs +55 -0
  175. package/dist/node_modules/refractor/lang/typescript.js +55 -0
  176. package/dist/node_modules/refractor/lib/core.cjs +214 -0
  177. package/dist/node_modules/refractor/lib/core.js +214 -0
  178. package/dist/node_modules/refractor/lib/prism-core.cjs +595 -0
  179. package/dist/node_modules/refractor/lib/prism-core.js +595 -0
  180. package/dist/node_modules/space-separated-tokens/index.cjs +15 -0
  181. package/dist/node_modules/space-separated-tokens/index.js +15 -0
  182. package/package.json +4 -2
  183. package/skills/redis-ui-components/references/CodeBlock.md +23 -5
  184. package/skills/redis-ui-components/references/CopyToClipboardButton.md +23 -1
  185. package/skills/redis-ui-components/references/Input.md +39 -2
  186. package/skills/redis-ui-components/references/SearchInput.md +1 -1
  187. package/skills/redis-ui-components/references/TextArea.md +19 -1
@@ -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;
@@ -0,0 +1,61 @@
1
+ import { booleanish, number, spaceSeparated } from "./util/types.js";
2
+ import { create } from "./util/create.js";
3
+ //#region ../../node_modules/property-information/lib/aria.js
4
+ var aria = create({
5
+ properties: {
6
+ ariaActiveDescendant: null,
7
+ ariaAtomic: booleanish,
8
+ ariaAutoComplete: null,
9
+ ariaBusy: booleanish,
10
+ ariaChecked: booleanish,
11
+ ariaColCount: number,
12
+ ariaColIndex: number,
13
+ ariaColSpan: number,
14
+ ariaControls: spaceSeparated,
15
+ ariaCurrent: null,
16
+ ariaDescribedBy: spaceSeparated,
17
+ ariaDetails: null,
18
+ ariaDisabled: booleanish,
19
+ ariaDropEffect: spaceSeparated,
20
+ ariaErrorMessage: null,
21
+ ariaExpanded: booleanish,
22
+ ariaFlowTo: spaceSeparated,
23
+ ariaGrabbed: booleanish,
24
+ ariaHasPopup: null,
25
+ ariaHidden: booleanish,
26
+ ariaInvalid: null,
27
+ ariaKeyShortcuts: null,
28
+ ariaLabel: null,
29
+ ariaLabelledBy: spaceSeparated,
30
+ ariaLevel: number,
31
+ ariaLive: null,
32
+ ariaModal: booleanish,
33
+ ariaMultiLine: booleanish,
34
+ ariaMultiSelectable: booleanish,
35
+ ariaOrientation: null,
36
+ ariaOwns: spaceSeparated,
37
+ ariaPlaceholder: null,
38
+ ariaPosInSet: number,
39
+ ariaPressed: booleanish,
40
+ ariaReadOnly: booleanish,
41
+ ariaRelevant: null,
42
+ ariaRequired: booleanish,
43
+ ariaRoleDescription: spaceSeparated,
44
+ ariaRowCount: number,
45
+ ariaRowIndex: number,
46
+ ariaRowSpan: number,
47
+ ariaSelected: booleanish,
48
+ ariaSetSize: number,
49
+ ariaSort: null,
50
+ ariaValueMax: number,
51
+ ariaValueMin: number,
52
+ ariaValueNow: number,
53
+ ariaValueText: null,
54
+ role: null
55
+ },
56
+ transform(_, property) {
57
+ return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
58
+ }
59
+ });
60
+ //#endregion
61
+ export { aria };