@vodafone_de/brix-components 3.0.0 → 3.0.2
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.
- package/dist/BackgroundColor-JObp_2xA.js +14 -0
- package/dist/BorderColor-BummoQ1-.js +24 -0
- package/dist/BorderRadius-ClUShVLu.js +10 -0
- package/dist/BorderWidth-DfOlyKK7.js +16 -0
- package/dist/CornerStyle-JEbGNArR.js +6 -0
- package/dist/FontWeight-CR22KTex.js +8 -0
- package/dist/HeadingSize-CfCRn3Lh.js +12 -0
- package/dist/IconColor-CtC9WUgr.js +10 -0
- package/dist/ObjectColor-BZDBuV8H.js +22 -0
- package/dist/Opacity-smkGiwsf.js +6 -0
- package/dist/SizeTypes-Ck_RdzIf.js +8 -0
- package/dist/Spacing-D0HQH9YJ.js +16 -0
- package/dist/TextBodySize-BcZR9mh2.js +6 -0
- package/dist/TextColor-BXiR5Uq9.js +16 -0
- package/dist/colorUtils-uLZF5UIN.js +94 -0
- package/dist/components/Accordion/index.js +195 -0
- package/dist/components/AccordionGroup/index.js +59 -0
- package/dist/components/Badge/index.js +11 -0
- package/dist/components/Body/index.js +72 -6
- package/dist/components/BottomBar/index.js +79 -0
- package/dist/components/Button/index.js +24 -0
- package/dist/components/ButtonAsLink/index.js +7 -0
- package/dist/components/ButtonGroup/index.js +34 -0
- package/dist/components/Card/index.js +18 -0
- package/dist/components/Carousel/index.js +497 -0
- package/dist/components/Checkbox/index.js +218 -0
- package/dist/components/CheckboxGroup/index.js +58 -0
- package/dist/components/Collapsible/index.js +85 -0
- package/dist/components/ColorSwatch/index.js +87 -0
- package/dist/components/ColorSwatchGroup/index.js +43 -0
- package/dist/components/Container/index.js +76 -0
- package/dist/components/DateInput/index.js +86 -0
- package/dist/components/DemoBox/index.js +21 -0
- package/dist/components/Dialog/index.js +172 -0
- package/dist/components/DiscoveryCard/index.js +130 -0
- package/dist/components/DiscoveryCardGroup/index.js +53 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Fieldset/index.js +41 -0
- package/dist/components/FilterGroup/index.js +148 -0
- package/dist/components/Flex/index.js +17 -0
- package/dist/components/FlexItem/index.js +41 -0
- package/dist/components/FootnoteContent/index.js +39 -0
- package/dist/components/FootnoteLink/index.js +46 -0
- package/dist/components/Form/index.js +20 -0
- package/dist/components/FormElement/index.js +31 -0
- package/dist/components/FormHelperLabel/index.js +21 -0
- package/dist/components/FormHelperMessage/index.js +47 -0
- package/dist/components/FormHelperStatusIcon/index.js +50 -0
- package/dist/components/GoogleMap/index.js +196 -0
- package/dist/components/Grid/index.js +39 -0
- package/dist/components/GridItem/index.js +12 -0
- package/dist/components/Heading/index.js +94 -0
- package/dist/components/HifiIcon/index.js +31 -0
- package/dist/components/Icon/index.js +38 -0
- package/dist/components/IconButton/index.js +85 -0
- package/dist/components/IconSnippet/index.js +112 -0
- package/dist/components/IconSnippet/styled.d.ts +1 -1
- package/dist/components/IconSnippetList/index.js +25 -0
- package/dist/components/Image/index.js +84 -0
- package/dist/components/ImageHeader/index.js +262 -0
- package/dist/components/ImageHeader/styled.d.ts +4 -4
- package/dist/components/InlineLink/index.js +43 -0
- package/dist/components/Input/index.js +55 -0
- package/dist/components/Label/index.js +22 -0
- package/dist/components/Legend/index.js +60 -0
- package/dist/components/Link/index.js +19 -0
- package/dist/components/LinkAsButton/index.js +7 -0
- package/dist/components/LinkList/index.js +64 -0
- package/dist/components/LinkListItem/index.js +316 -0
- package/dist/components/LoadingSpinner/index.js +70 -0
- package/dist/components/Notification/index.js +181 -0
- package/dist/components/Overlay/index.js +33 -0
- package/dist/components/PickerGroup/index.js +282 -0
- package/dist/components/Price/index.js +18 -0
- package/dist/components/ProductCard/index.js +81 -0
- package/dist/components/RadioGroup/index.js +197 -0
- package/dist/components/ResponsiveImage/index.js +89 -0
- package/dist/components/RichText/index.js +7 -0
- package/dist/components/ScreenreaderOnly/index.js +6 -0
- package/dist/components/SearchInput/index.js +140 -0
- package/dist/components/SelectInput/index.js +160 -0
- package/dist/components/Stepper/index.js +205 -0
- package/dist/components/SuggestInput/index.js +387 -0
- package/dist/components/Switch/index.js +169 -0
- package/dist/components/TabularPrice/index.js +8 -0
- package/dist/components/TextList/index.js +10 -0
- package/dist/components/Textarea/index.js +156 -0
- package/dist/components/Tray/index.js +218 -0
- package/dist/easing-Dm-pO8SY.js +6 -0
- package/dist/filterProps-Cewck8OH.js +13 -0
- package/dist/foundations/GlobalStyle/index.js +3 -292
- package/dist/foundations/PatternProps/index.js +1 -0
- package/dist/foundations/media-query/forcedColors/index.js +12 -0
- package/dist/foundations/media-query/reducedMotion/index.js +21 -0
- package/dist/foundations/media-query/viewport/index.js +6 -0
- package/dist/foundations/token/getBackgroundColor/index.js +5 -0
- package/dist/foundations/token/getBodySize/index.js +13 -2
- package/dist/foundations/token/getBorderColor/index.js +5 -0
- package/dist/foundations/token/getBorderRadius/index.js +15 -0
- package/dist/foundations/token/getBorderWidth/index.js +19 -0
- package/dist/foundations/token/getBottomSpacing/index.js +14 -0
- package/dist/foundations/token/getFontWeight/index.js +13 -0
- package/dist/foundations/token/getHeadingSize/index.js +27 -0
- package/dist/foundations/token/getHoverColor/index.js +7 -0
- package/dist/foundations/token/getIconColor/index.js +5 -0
- package/dist/foundations/token/getObjectColor/index.js +5 -0
- package/dist/foundations/token/getOpacity/index.js +11 -0
- package/dist/foundations/token/getPressColor/index.js +7 -0
- package/dist/foundations/token/getSpacing/index.js +5 -0
- package/dist/foundations/token/getTextColor/index.js +5 -0
- package/dist/foundations/token/getTextDecoration/index.js +13 -0
- package/dist/getCssVar-BP6T9pFM.js +6 -0
- package/dist/hooks/useFocusWithin/index.js +36 -0
- package/dist/hooks/useForcedColors/index.js +9 -0
- package/dist/hooks/useMediaQuery/index.js +19 -0
- package/dist/hooks/useReducedMotion/index.js +9 -0
- package/dist/hooks/useThirdPartyConsent/index.js +54 -0
- package/dist/hooks/useViewport/index.js +24 -0
- package/dist/index-BXLT6ke-.js +79 -0
- package/dist/index-C4XnzWFL.js +61 -0
- package/dist/index-CeJsIf3Z.js +208 -0
- package/dist/index-Ck2bCrhT.js +32 -0
- package/dist/index-CzTqNQTT.js +79 -0
- package/dist/index-D6hvbziL.js +167 -0
- package/dist/index-DQhtQZ85.js +24 -0
- package/dist/props-Czq9XX2J.js +6 -0
- package/dist/renderInlineRichTextFromOpenText-CA52y1-B.js +2383 -0
- package/dist/shadow-u158mzuN.js +4 -0
- package/dist/styled-BpvuD699.js +45 -0
- package/dist/styled-CDWclYAa.js +124 -0
- package/dist/styled-CXSdomF5.js +34 -0
- package/dist/styled-CpoX5USb.js +71 -0
- package/dist/styled-DZo6MwrF.js +245 -0
- package/dist/styled-FNJyDkPV.js +165 -0
- package/dist/styled-Wlt68LfQ.js +133 -0
- package/dist/styled-ZpQohvyx.js +29 -0
- package/dist/tags-DI6H1biK.js +29 -0
- package/package.json +1 -2
- package/dist/index-BoPDwZgt.js +0 -18
- package/dist/index-DRj4iUs9.js +0 -117
|
@@ -0,0 +1,2383 @@
|
|
|
1
|
+
import require$$0 from "react";
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
var lib$3 = {};
|
|
6
|
+
var htmlToDom = {};
|
|
7
|
+
var domparser = {};
|
|
8
|
+
var utilities$2 = {};
|
|
9
|
+
var lib$2 = {};
|
|
10
|
+
var lib$1 = {};
|
|
11
|
+
var hasRequiredLib$3;
|
|
12
|
+
function requireLib$3() {
|
|
13
|
+
if (hasRequiredLib$3) return lib$1;
|
|
14
|
+
hasRequiredLib$3 = 1;
|
|
15
|
+
(function(exports) {
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
18
|
+
var ElementType;
|
|
19
|
+
(function(ElementType2) {
|
|
20
|
+
ElementType2["Root"] = "root";
|
|
21
|
+
ElementType2["Text"] = "text";
|
|
22
|
+
ElementType2["Directive"] = "directive";
|
|
23
|
+
ElementType2["Comment"] = "comment";
|
|
24
|
+
ElementType2["Script"] = "script";
|
|
25
|
+
ElementType2["Style"] = "style";
|
|
26
|
+
ElementType2["Tag"] = "tag";
|
|
27
|
+
ElementType2["CDATA"] = "cdata";
|
|
28
|
+
ElementType2["Doctype"] = "doctype";
|
|
29
|
+
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|
|
30
|
+
function isTag(elem) {
|
|
31
|
+
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
32
|
+
}
|
|
33
|
+
exports.isTag = isTag;
|
|
34
|
+
exports.Root = ElementType.Root;
|
|
35
|
+
exports.Text = ElementType.Text;
|
|
36
|
+
exports.Directive = ElementType.Directive;
|
|
37
|
+
exports.Comment = ElementType.Comment;
|
|
38
|
+
exports.Script = ElementType.Script;
|
|
39
|
+
exports.Style = ElementType.Style;
|
|
40
|
+
exports.Tag = ElementType.Tag;
|
|
41
|
+
exports.CDATA = ElementType.CDATA;
|
|
42
|
+
exports.Doctype = ElementType.Doctype;
|
|
43
|
+
})(lib$1);
|
|
44
|
+
return lib$1;
|
|
45
|
+
}
|
|
46
|
+
var node = {};
|
|
47
|
+
var hasRequiredNode;
|
|
48
|
+
function requireNode() {
|
|
49
|
+
if (hasRequiredNode) return node;
|
|
50
|
+
hasRequiredNode = 1;
|
|
51
|
+
var __extends = node && node.__extends || /* @__PURE__ */ function() {
|
|
52
|
+
var extendStatics = function(d, b) {
|
|
53
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
54
|
+
d2.__proto__ = b2;
|
|
55
|
+
} || function(d2, b2) {
|
|
56
|
+
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
57
|
+
};
|
|
58
|
+
return extendStatics(d, b);
|
|
59
|
+
};
|
|
60
|
+
return function(d, b) {
|
|
61
|
+
if (typeof b !== "function" && b !== null)
|
|
62
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
63
|
+
extendStatics(d, b);
|
|
64
|
+
function __() {
|
|
65
|
+
this.constructor = d;
|
|
66
|
+
}
|
|
67
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
68
|
+
};
|
|
69
|
+
}();
|
|
70
|
+
var __assign = node && node.__assign || function() {
|
|
71
|
+
__assign = Object.assign || function(t) {
|
|
72
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
73
|
+
s = arguments[i];
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
}
|
|
77
|
+
return t;
|
|
78
|
+
};
|
|
79
|
+
return __assign.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
Object.defineProperty(node, "__esModule", { value: true });
|
|
82
|
+
node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
|
|
83
|
+
var domelementtype_1 = /* @__PURE__ */ requireLib$3();
|
|
84
|
+
var Node = (
|
|
85
|
+
/** @class */
|
|
86
|
+
function() {
|
|
87
|
+
function Node2() {
|
|
88
|
+
this.parent = null;
|
|
89
|
+
this.prev = null;
|
|
90
|
+
this.next = null;
|
|
91
|
+
this.startIndex = null;
|
|
92
|
+
this.endIndex = null;
|
|
93
|
+
}
|
|
94
|
+
Object.defineProperty(Node2.prototype, "parentNode", {
|
|
95
|
+
// Read-write aliases for properties
|
|
96
|
+
/**
|
|
97
|
+
* Same as {@link parent}.
|
|
98
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
99
|
+
*/
|
|
100
|
+
get: function() {
|
|
101
|
+
return this.parent;
|
|
102
|
+
},
|
|
103
|
+
set: function(parent) {
|
|
104
|
+
this.parent = parent;
|
|
105
|
+
},
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(Node2.prototype, "previousSibling", {
|
|
110
|
+
/**
|
|
111
|
+
* Same as {@link prev}.
|
|
112
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
113
|
+
*/
|
|
114
|
+
get: function() {
|
|
115
|
+
return this.prev;
|
|
116
|
+
},
|
|
117
|
+
set: function(prev) {
|
|
118
|
+
this.prev = prev;
|
|
119
|
+
},
|
|
120
|
+
enumerable: false,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(Node2.prototype, "nextSibling", {
|
|
124
|
+
/**
|
|
125
|
+
* Same as {@link next}.
|
|
126
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
127
|
+
*/
|
|
128
|
+
get: function() {
|
|
129
|
+
return this.next;
|
|
130
|
+
},
|
|
131
|
+
set: function(next) {
|
|
132
|
+
this.next = next;
|
|
133
|
+
},
|
|
134
|
+
enumerable: false,
|
|
135
|
+
configurable: true
|
|
136
|
+
});
|
|
137
|
+
Node2.prototype.cloneNode = function(recursive) {
|
|
138
|
+
if (recursive === void 0) {
|
|
139
|
+
recursive = false;
|
|
140
|
+
}
|
|
141
|
+
return cloneNode(this, recursive);
|
|
142
|
+
};
|
|
143
|
+
return Node2;
|
|
144
|
+
}()
|
|
145
|
+
);
|
|
146
|
+
node.Node = Node;
|
|
147
|
+
var DataNode = (
|
|
148
|
+
/** @class */
|
|
149
|
+
function(_super) {
|
|
150
|
+
__extends(DataNode2, _super);
|
|
151
|
+
function DataNode2(data) {
|
|
152
|
+
var _this = _super.call(this) || this;
|
|
153
|
+
_this.data = data;
|
|
154
|
+
return _this;
|
|
155
|
+
}
|
|
156
|
+
Object.defineProperty(DataNode2.prototype, "nodeValue", {
|
|
157
|
+
/**
|
|
158
|
+
* Same as {@link data}.
|
|
159
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
160
|
+
*/
|
|
161
|
+
get: function() {
|
|
162
|
+
return this.data;
|
|
163
|
+
},
|
|
164
|
+
set: function(data) {
|
|
165
|
+
this.data = data;
|
|
166
|
+
},
|
|
167
|
+
enumerable: false,
|
|
168
|
+
configurable: true
|
|
169
|
+
});
|
|
170
|
+
return DataNode2;
|
|
171
|
+
}(Node)
|
|
172
|
+
);
|
|
173
|
+
node.DataNode = DataNode;
|
|
174
|
+
var Text = (
|
|
175
|
+
/** @class */
|
|
176
|
+
function(_super) {
|
|
177
|
+
__extends(Text2, _super);
|
|
178
|
+
function Text2() {
|
|
179
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
180
|
+
_this.type = domelementtype_1.ElementType.Text;
|
|
181
|
+
return _this;
|
|
182
|
+
}
|
|
183
|
+
Object.defineProperty(Text2.prototype, "nodeType", {
|
|
184
|
+
get: function() {
|
|
185
|
+
return 3;
|
|
186
|
+
},
|
|
187
|
+
enumerable: false,
|
|
188
|
+
configurable: true
|
|
189
|
+
});
|
|
190
|
+
return Text2;
|
|
191
|
+
}(DataNode)
|
|
192
|
+
);
|
|
193
|
+
node.Text = Text;
|
|
194
|
+
var Comment = (
|
|
195
|
+
/** @class */
|
|
196
|
+
function(_super) {
|
|
197
|
+
__extends(Comment2, _super);
|
|
198
|
+
function Comment2() {
|
|
199
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
200
|
+
_this.type = domelementtype_1.ElementType.Comment;
|
|
201
|
+
return _this;
|
|
202
|
+
}
|
|
203
|
+
Object.defineProperty(Comment2.prototype, "nodeType", {
|
|
204
|
+
get: function() {
|
|
205
|
+
return 8;
|
|
206
|
+
},
|
|
207
|
+
enumerable: false,
|
|
208
|
+
configurable: true
|
|
209
|
+
});
|
|
210
|
+
return Comment2;
|
|
211
|
+
}(DataNode)
|
|
212
|
+
);
|
|
213
|
+
node.Comment = Comment;
|
|
214
|
+
var ProcessingInstruction = (
|
|
215
|
+
/** @class */
|
|
216
|
+
function(_super) {
|
|
217
|
+
__extends(ProcessingInstruction2, _super);
|
|
218
|
+
function ProcessingInstruction2(name, data) {
|
|
219
|
+
var _this = _super.call(this, data) || this;
|
|
220
|
+
_this.name = name;
|
|
221
|
+
_this.type = domelementtype_1.ElementType.Directive;
|
|
222
|
+
return _this;
|
|
223
|
+
}
|
|
224
|
+
Object.defineProperty(ProcessingInstruction2.prototype, "nodeType", {
|
|
225
|
+
get: function() {
|
|
226
|
+
return 1;
|
|
227
|
+
},
|
|
228
|
+
enumerable: false,
|
|
229
|
+
configurable: true
|
|
230
|
+
});
|
|
231
|
+
return ProcessingInstruction2;
|
|
232
|
+
}(DataNode)
|
|
233
|
+
);
|
|
234
|
+
node.ProcessingInstruction = ProcessingInstruction;
|
|
235
|
+
var NodeWithChildren = (
|
|
236
|
+
/** @class */
|
|
237
|
+
function(_super) {
|
|
238
|
+
__extends(NodeWithChildren2, _super);
|
|
239
|
+
function NodeWithChildren2(children) {
|
|
240
|
+
var _this = _super.call(this) || this;
|
|
241
|
+
_this.children = children;
|
|
242
|
+
return _this;
|
|
243
|
+
}
|
|
244
|
+
Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
|
|
245
|
+
// Aliases
|
|
246
|
+
/** First child of the node. */
|
|
247
|
+
get: function() {
|
|
248
|
+
var _a;
|
|
249
|
+
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
250
|
+
},
|
|
251
|
+
enumerable: false,
|
|
252
|
+
configurable: true
|
|
253
|
+
});
|
|
254
|
+
Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
|
|
255
|
+
/** Last child of the node. */
|
|
256
|
+
get: function() {
|
|
257
|
+
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
258
|
+
},
|
|
259
|
+
enumerable: false,
|
|
260
|
+
configurable: true
|
|
261
|
+
});
|
|
262
|
+
Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
|
|
263
|
+
/**
|
|
264
|
+
* Same as {@link children}.
|
|
265
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
266
|
+
*/
|
|
267
|
+
get: function() {
|
|
268
|
+
return this.children;
|
|
269
|
+
},
|
|
270
|
+
set: function(children) {
|
|
271
|
+
this.children = children;
|
|
272
|
+
},
|
|
273
|
+
enumerable: false,
|
|
274
|
+
configurable: true
|
|
275
|
+
});
|
|
276
|
+
return NodeWithChildren2;
|
|
277
|
+
}(Node)
|
|
278
|
+
);
|
|
279
|
+
node.NodeWithChildren = NodeWithChildren;
|
|
280
|
+
var CDATA = (
|
|
281
|
+
/** @class */
|
|
282
|
+
function(_super) {
|
|
283
|
+
__extends(CDATA2, _super);
|
|
284
|
+
function CDATA2() {
|
|
285
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
286
|
+
_this.type = domelementtype_1.ElementType.CDATA;
|
|
287
|
+
return _this;
|
|
288
|
+
}
|
|
289
|
+
Object.defineProperty(CDATA2.prototype, "nodeType", {
|
|
290
|
+
get: function() {
|
|
291
|
+
return 4;
|
|
292
|
+
},
|
|
293
|
+
enumerable: false,
|
|
294
|
+
configurable: true
|
|
295
|
+
});
|
|
296
|
+
return CDATA2;
|
|
297
|
+
}(NodeWithChildren)
|
|
298
|
+
);
|
|
299
|
+
node.CDATA = CDATA;
|
|
300
|
+
var Document = (
|
|
301
|
+
/** @class */
|
|
302
|
+
function(_super) {
|
|
303
|
+
__extends(Document2, _super);
|
|
304
|
+
function Document2() {
|
|
305
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
306
|
+
_this.type = domelementtype_1.ElementType.Root;
|
|
307
|
+
return _this;
|
|
308
|
+
}
|
|
309
|
+
Object.defineProperty(Document2.prototype, "nodeType", {
|
|
310
|
+
get: function() {
|
|
311
|
+
return 9;
|
|
312
|
+
},
|
|
313
|
+
enumerable: false,
|
|
314
|
+
configurable: true
|
|
315
|
+
});
|
|
316
|
+
return Document2;
|
|
317
|
+
}(NodeWithChildren)
|
|
318
|
+
);
|
|
319
|
+
node.Document = Document;
|
|
320
|
+
var Element = (
|
|
321
|
+
/** @class */
|
|
322
|
+
function(_super) {
|
|
323
|
+
__extends(Element2, _super);
|
|
324
|
+
function Element2(name, attribs, children, type) {
|
|
325
|
+
if (children === void 0) {
|
|
326
|
+
children = [];
|
|
327
|
+
}
|
|
328
|
+
if (type === void 0) {
|
|
329
|
+
type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
|
|
330
|
+
}
|
|
331
|
+
var _this = _super.call(this, children) || this;
|
|
332
|
+
_this.name = name;
|
|
333
|
+
_this.attribs = attribs;
|
|
334
|
+
_this.type = type;
|
|
335
|
+
return _this;
|
|
336
|
+
}
|
|
337
|
+
Object.defineProperty(Element2.prototype, "nodeType", {
|
|
338
|
+
get: function() {
|
|
339
|
+
return 1;
|
|
340
|
+
},
|
|
341
|
+
enumerable: false,
|
|
342
|
+
configurable: true
|
|
343
|
+
});
|
|
344
|
+
Object.defineProperty(Element2.prototype, "tagName", {
|
|
345
|
+
// DOM Level 1 aliases
|
|
346
|
+
/**
|
|
347
|
+
* Same as {@link name}.
|
|
348
|
+
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
|
349
|
+
*/
|
|
350
|
+
get: function() {
|
|
351
|
+
return this.name;
|
|
352
|
+
},
|
|
353
|
+
set: function(name) {
|
|
354
|
+
this.name = name;
|
|
355
|
+
},
|
|
356
|
+
enumerable: false,
|
|
357
|
+
configurable: true
|
|
358
|
+
});
|
|
359
|
+
Object.defineProperty(Element2.prototype, "attributes", {
|
|
360
|
+
get: function() {
|
|
361
|
+
var _this = this;
|
|
362
|
+
return Object.keys(this.attribs).map(function(name) {
|
|
363
|
+
var _a, _b;
|
|
364
|
+
return {
|
|
365
|
+
name,
|
|
366
|
+
value: _this.attribs[name],
|
|
367
|
+
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
368
|
+
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
},
|
|
372
|
+
enumerable: false,
|
|
373
|
+
configurable: true
|
|
374
|
+
});
|
|
375
|
+
return Element2;
|
|
376
|
+
}(NodeWithChildren)
|
|
377
|
+
);
|
|
378
|
+
node.Element = Element;
|
|
379
|
+
function isTag(node2) {
|
|
380
|
+
return (0, domelementtype_1.isTag)(node2);
|
|
381
|
+
}
|
|
382
|
+
node.isTag = isTag;
|
|
383
|
+
function isCDATA(node2) {
|
|
384
|
+
return node2.type === domelementtype_1.ElementType.CDATA;
|
|
385
|
+
}
|
|
386
|
+
node.isCDATA = isCDATA;
|
|
387
|
+
function isText(node2) {
|
|
388
|
+
return node2.type === domelementtype_1.ElementType.Text;
|
|
389
|
+
}
|
|
390
|
+
node.isText = isText;
|
|
391
|
+
function isComment(node2) {
|
|
392
|
+
return node2.type === domelementtype_1.ElementType.Comment;
|
|
393
|
+
}
|
|
394
|
+
node.isComment = isComment;
|
|
395
|
+
function isDirective(node2) {
|
|
396
|
+
return node2.type === domelementtype_1.ElementType.Directive;
|
|
397
|
+
}
|
|
398
|
+
node.isDirective = isDirective;
|
|
399
|
+
function isDocument(node2) {
|
|
400
|
+
return node2.type === domelementtype_1.ElementType.Root;
|
|
401
|
+
}
|
|
402
|
+
node.isDocument = isDocument;
|
|
403
|
+
function hasChildren(node2) {
|
|
404
|
+
return Object.prototype.hasOwnProperty.call(node2, "children");
|
|
405
|
+
}
|
|
406
|
+
node.hasChildren = hasChildren;
|
|
407
|
+
function cloneNode(node2, recursive) {
|
|
408
|
+
if (recursive === void 0) {
|
|
409
|
+
recursive = false;
|
|
410
|
+
}
|
|
411
|
+
var result;
|
|
412
|
+
if (isText(node2)) {
|
|
413
|
+
result = new Text(node2.data);
|
|
414
|
+
} else if (isComment(node2)) {
|
|
415
|
+
result = new Comment(node2.data);
|
|
416
|
+
} else if (isTag(node2)) {
|
|
417
|
+
var children = recursive ? cloneChildren(node2.children) : [];
|
|
418
|
+
var clone_1 = new Element(node2.name, __assign({}, node2.attribs), children);
|
|
419
|
+
children.forEach(function(child) {
|
|
420
|
+
return child.parent = clone_1;
|
|
421
|
+
});
|
|
422
|
+
if (node2.namespace != null) {
|
|
423
|
+
clone_1.namespace = node2.namespace;
|
|
424
|
+
}
|
|
425
|
+
if (node2["x-attribsNamespace"]) {
|
|
426
|
+
clone_1["x-attribsNamespace"] = __assign({}, node2["x-attribsNamespace"]);
|
|
427
|
+
}
|
|
428
|
+
if (node2["x-attribsPrefix"]) {
|
|
429
|
+
clone_1["x-attribsPrefix"] = __assign({}, node2["x-attribsPrefix"]);
|
|
430
|
+
}
|
|
431
|
+
result = clone_1;
|
|
432
|
+
} else if (isCDATA(node2)) {
|
|
433
|
+
var children = recursive ? cloneChildren(node2.children) : [];
|
|
434
|
+
var clone_2 = new CDATA(children);
|
|
435
|
+
children.forEach(function(child) {
|
|
436
|
+
return child.parent = clone_2;
|
|
437
|
+
});
|
|
438
|
+
result = clone_2;
|
|
439
|
+
} else if (isDocument(node2)) {
|
|
440
|
+
var children = recursive ? cloneChildren(node2.children) : [];
|
|
441
|
+
var clone_3 = new Document(children);
|
|
442
|
+
children.forEach(function(child) {
|
|
443
|
+
return child.parent = clone_3;
|
|
444
|
+
});
|
|
445
|
+
if (node2["x-mode"]) {
|
|
446
|
+
clone_3["x-mode"] = node2["x-mode"];
|
|
447
|
+
}
|
|
448
|
+
result = clone_3;
|
|
449
|
+
} else if (isDirective(node2)) {
|
|
450
|
+
var instruction = new ProcessingInstruction(node2.name, node2.data);
|
|
451
|
+
if (node2["x-name"] != null) {
|
|
452
|
+
instruction["x-name"] = node2["x-name"];
|
|
453
|
+
instruction["x-publicId"] = node2["x-publicId"];
|
|
454
|
+
instruction["x-systemId"] = node2["x-systemId"];
|
|
455
|
+
}
|
|
456
|
+
result = instruction;
|
|
457
|
+
} else {
|
|
458
|
+
throw new Error("Not implemented yet: ".concat(node2.type));
|
|
459
|
+
}
|
|
460
|
+
result.startIndex = node2.startIndex;
|
|
461
|
+
result.endIndex = node2.endIndex;
|
|
462
|
+
if (node2.sourceCodeLocation != null) {
|
|
463
|
+
result.sourceCodeLocation = node2.sourceCodeLocation;
|
|
464
|
+
}
|
|
465
|
+
return result;
|
|
466
|
+
}
|
|
467
|
+
node.cloneNode = cloneNode;
|
|
468
|
+
function cloneChildren(childs) {
|
|
469
|
+
var children = childs.map(function(child) {
|
|
470
|
+
return cloneNode(child, true);
|
|
471
|
+
});
|
|
472
|
+
for (var i = 1; i < children.length; i++) {
|
|
473
|
+
children[i].prev = children[i - 1];
|
|
474
|
+
children[i - 1].next = children[i];
|
|
475
|
+
}
|
|
476
|
+
return children;
|
|
477
|
+
}
|
|
478
|
+
return node;
|
|
479
|
+
}
|
|
480
|
+
var hasRequiredLib$2;
|
|
481
|
+
function requireLib$2() {
|
|
482
|
+
if (hasRequiredLib$2) return lib$2;
|
|
483
|
+
hasRequiredLib$2 = 1;
|
|
484
|
+
(function(exports) {
|
|
485
|
+
var __createBinding = lib$2 && lib$2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
486
|
+
if (k2 === void 0) k2 = k;
|
|
487
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
488
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
489
|
+
desc = { enumerable: true, get: function() {
|
|
490
|
+
return m[k];
|
|
491
|
+
} };
|
|
492
|
+
}
|
|
493
|
+
Object.defineProperty(o, k2, desc);
|
|
494
|
+
} : function(o, m, k, k2) {
|
|
495
|
+
if (k2 === void 0) k2 = k;
|
|
496
|
+
o[k2] = m[k];
|
|
497
|
+
});
|
|
498
|
+
var __exportStar = lib$2 && lib$2.__exportStar || function(m, exports2) {
|
|
499
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
500
|
+
};
|
|
501
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
502
|
+
exports.DomHandler = void 0;
|
|
503
|
+
var domelementtype_1 = /* @__PURE__ */ requireLib$3();
|
|
504
|
+
var node_js_1 = /* @__PURE__ */ requireNode();
|
|
505
|
+
__exportStar(/* @__PURE__ */ requireNode(), exports);
|
|
506
|
+
var defaultOpts = {
|
|
507
|
+
withStartIndices: false,
|
|
508
|
+
withEndIndices: false,
|
|
509
|
+
xmlMode: false
|
|
510
|
+
};
|
|
511
|
+
var DomHandler = (
|
|
512
|
+
/** @class */
|
|
513
|
+
function() {
|
|
514
|
+
function DomHandler2(callback, options, elementCB) {
|
|
515
|
+
this.dom = [];
|
|
516
|
+
this.root = new node_js_1.Document(this.dom);
|
|
517
|
+
this.done = false;
|
|
518
|
+
this.tagStack = [this.root];
|
|
519
|
+
this.lastNode = null;
|
|
520
|
+
this.parser = null;
|
|
521
|
+
if (typeof options === "function") {
|
|
522
|
+
elementCB = options;
|
|
523
|
+
options = defaultOpts;
|
|
524
|
+
}
|
|
525
|
+
if (typeof callback === "object") {
|
|
526
|
+
options = callback;
|
|
527
|
+
callback = void 0;
|
|
528
|
+
}
|
|
529
|
+
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
|
530
|
+
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
|
531
|
+
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
|
532
|
+
}
|
|
533
|
+
DomHandler2.prototype.onparserinit = function(parser) {
|
|
534
|
+
this.parser = parser;
|
|
535
|
+
};
|
|
536
|
+
DomHandler2.prototype.onreset = function() {
|
|
537
|
+
this.dom = [];
|
|
538
|
+
this.root = new node_js_1.Document(this.dom);
|
|
539
|
+
this.done = false;
|
|
540
|
+
this.tagStack = [this.root];
|
|
541
|
+
this.lastNode = null;
|
|
542
|
+
this.parser = null;
|
|
543
|
+
};
|
|
544
|
+
DomHandler2.prototype.onend = function() {
|
|
545
|
+
if (this.done)
|
|
546
|
+
return;
|
|
547
|
+
this.done = true;
|
|
548
|
+
this.parser = null;
|
|
549
|
+
this.handleCallback(null);
|
|
550
|
+
};
|
|
551
|
+
DomHandler2.prototype.onerror = function(error) {
|
|
552
|
+
this.handleCallback(error);
|
|
553
|
+
};
|
|
554
|
+
DomHandler2.prototype.onclosetag = function() {
|
|
555
|
+
this.lastNode = null;
|
|
556
|
+
var elem = this.tagStack.pop();
|
|
557
|
+
if (this.options.withEndIndices) {
|
|
558
|
+
elem.endIndex = this.parser.endIndex;
|
|
559
|
+
}
|
|
560
|
+
if (this.elementCB)
|
|
561
|
+
this.elementCB(elem);
|
|
562
|
+
};
|
|
563
|
+
DomHandler2.prototype.onopentag = function(name, attribs) {
|
|
564
|
+
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
|
|
565
|
+
var element = new node_js_1.Element(name, attribs, void 0, type);
|
|
566
|
+
this.addNode(element);
|
|
567
|
+
this.tagStack.push(element);
|
|
568
|
+
};
|
|
569
|
+
DomHandler2.prototype.ontext = function(data) {
|
|
570
|
+
var lastNode = this.lastNode;
|
|
571
|
+
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
|
572
|
+
lastNode.data += data;
|
|
573
|
+
if (this.options.withEndIndices) {
|
|
574
|
+
lastNode.endIndex = this.parser.endIndex;
|
|
575
|
+
}
|
|
576
|
+
} else {
|
|
577
|
+
var node2 = new node_js_1.Text(data);
|
|
578
|
+
this.addNode(node2);
|
|
579
|
+
this.lastNode = node2;
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
DomHandler2.prototype.oncomment = function(data) {
|
|
583
|
+
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
|
584
|
+
this.lastNode.data += data;
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
var node2 = new node_js_1.Comment(data);
|
|
588
|
+
this.addNode(node2);
|
|
589
|
+
this.lastNode = node2;
|
|
590
|
+
};
|
|
591
|
+
DomHandler2.prototype.oncommentend = function() {
|
|
592
|
+
this.lastNode = null;
|
|
593
|
+
};
|
|
594
|
+
DomHandler2.prototype.oncdatastart = function() {
|
|
595
|
+
var text = new node_js_1.Text("");
|
|
596
|
+
var node2 = new node_js_1.CDATA([text]);
|
|
597
|
+
this.addNode(node2);
|
|
598
|
+
text.parent = node2;
|
|
599
|
+
this.lastNode = text;
|
|
600
|
+
};
|
|
601
|
+
DomHandler2.prototype.oncdataend = function() {
|
|
602
|
+
this.lastNode = null;
|
|
603
|
+
};
|
|
604
|
+
DomHandler2.prototype.onprocessinginstruction = function(name, data) {
|
|
605
|
+
var node2 = new node_js_1.ProcessingInstruction(name, data);
|
|
606
|
+
this.addNode(node2);
|
|
607
|
+
};
|
|
608
|
+
DomHandler2.prototype.handleCallback = function(error) {
|
|
609
|
+
if (typeof this.callback === "function") {
|
|
610
|
+
this.callback(error, this.dom);
|
|
611
|
+
} else if (error) {
|
|
612
|
+
throw error;
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
DomHandler2.prototype.addNode = function(node2) {
|
|
616
|
+
var parent = this.tagStack[this.tagStack.length - 1];
|
|
617
|
+
var previousSibling = parent.children[parent.children.length - 1];
|
|
618
|
+
if (this.options.withStartIndices) {
|
|
619
|
+
node2.startIndex = this.parser.startIndex;
|
|
620
|
+
}
|
|
621
|
+
if (this.options.withEndIndices) {
|
|
622
|
+
node2.endIndex = this.parser.endIndex;
|
|
623
|
+
}
|
|
624
|
+
parent.children.push(node2);
|
|
625
|
+
if (previousSibling) {
|
|
626
|
+
node2.prev = previousSibling;
|
|
627
|
+
previousSibling.next = node2;
|
|
628
|
+
}
|
|
629
|
+
node2.parent = parent;
|
|
630
|
+
this.lastNode = null;
|
|
631
|
+
};
|
|
632
|
+
return DomHandler2;
|
|
633
|
+
}()
|
|
634
|
+
);
|
|
635
|
+
exports.DomHandler = DomHandler;
|
|
636
|
+
exports.default = DomHandler;
|
|
637
|
+
})(lib$2);
|
|
638
|
+
return lib$2;
|
|
639
|
+
}
|
|
640
|
+
var constants = {};
|
|
641
|
+
var hasRequiredConstants;
|
|
642
|
+
function requireConstants() {
|
|
643
|
+
if (hasRequiredConstants) return constants;
|
|
644
|
+
hasRequiredConstants = 1;
|
|
645
|
+
(function(exports) {
|
|
646
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
647
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = exports.CARRIAGE_RETURN_PLACEHOLDER = exports.CARRIAGE_RETURN_REGEX = exports.CARRIAGE_RETURN = exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES = void 0;
|
|
648
|
+
exports.CASE_SENSITIVE_TAG_NAMES = [
|
|
649
|
+
"animateMotion",
|
|
650
|
+
"animateTransform",
|
|
651
|
+
"clipPath",
|
|
652
|
+
"feBlend",
|
|
653
|
+
"feColorMatrix",
|
|
654
|
+
"feComponentTransfer",
|
|
655
|
+
"feComposite",
|
|
656
|
+
"feConvolveMatrix",
|
|
657
|
+
"feDiffuseLighting",
|
|
658
|
+
"feDisplacementMap",
|
|
659
|
+
"feDropShadow",
|
|
660
|
+
"feFlood",
|
|
661
|
+
"feFuncA",
|
|
662
|
+
"feFuncB",
|
|
663
|
+
"feFuncG",
|
|
664
|
+
"feFuncR",
|
|
665
|
+
"feGaussianBlur",
|
|
666
|
+
"feImage",
|
|
667
|
+
"feMerge",
|
|
668
|
+
"feMergeNode",
|
|
669
|
+
"feMorphology",
|
|
670
|
+
"feOffset",
|
|
671
|
+
"fePointLight",
|
|
672
|
+
"feSpecularLighting",
|
|
673
|
+
"feSpotLight",
|
|
674
|
+
"feTile",
|
|
675
|
+
"feTurbulence",
|
|
676
|
+
"foreignObject",
|
|
677
|
+
"linearGradient",
|
|
678
|
+
"radialGradient",
|
|
679
|
+
"textPath"
|
|
680
|
+
];
|
|
681
|
+
exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES.reduce(function(accumulator, tagName) {
|
|
682
|
+
accumulator[tagName.toLowerCase()] = tagName;
|
|
683
|
+
return accumulator;
|
|
684
|
+
}, {});
|
|
685
|
+
exports.CARRIAGE_RETURN = "\r";
|
|
686
|
+
exports.CARRIAGE_RETURN_REGEX = new RegExp(exports.CARRIAGE_RETURN, "g");
|
|
687
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(), "__");
|
|
688
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = new RegExp(exports.CARRIAGE_RETURN_PLACEHOLDER, "g");
|
|
689
|
+
})(constants);
|
|
690
|
+
return constants;
|
|
691
|
+
}
|
|
692
|
+
var hasRequiredUtilities$2;
|
|
693
|
+
function requireUtilities$2() {
|
|
694
|
+
if (hasRequiredUtilities$2) return utilities$2;
|
|
695
|
+
hasRequiredUtilities$2 = 1;
|
|
696
|
+
Object.defineProperty(utilities$2, "__esModule", { value: true });
|
|
697
|
+
utilities$2.formatAttributes = formatAttributes;
|
|
698
|
+
utilities$2.escapeSpecialCharacters = escapeSpecialCharacters;
|
|
699
|
+
utilities$2.revertEscapedCharacters = revertEscapedCharacters;
|
|
700
|
+
utilities$2.formatDOM = formatDOM;
|
|
701
|
+
var domhandler_1 = /* @__PURE__ */ requireLib$2();
|
|
702
|
+
var constants_1 = requireConstants();
|
|
703
|
+
function getCaseSensitiveTagName(tagName) {
|
|
704
|
+
return constants_1.CASE_SENSITIVE_TAG_NAMES_MAP[tagName];
|
|
705
|
+
}
|
|
706
|
+
function formatAttributes(attributes) {
|
|
707
|
+
var map = {};
|
|
708
|
+
var index = 0;
|
|
709
|
+
var attributesLength = attributes.length;
|
|
710
|
+
for (; index < attributesLength; index++) {
|
|
711
|
+
var attribute = attributes[index];
|
|
712
|
+
map[attribute.name] = attribute.value;
|
|
713
|
+
}
|
|
714
|
+
return map;
|
|
715
|
+
}
|
|
716
|
+
function formatTagName(tagName) {
|
|
717
|
+
tagName = tagName.toLowerCase();
|
|
718
|
+
var caseSensitiveTagName = getCaseSensitiveTagName(tagName);
|
|
719
|
+
if (caseSensitiveTagName) {
|
|
720
|
+
return caseSensitiveTagName;
|
|
721
|
+
}
|
|
722
|
+
return tagName;
|
|
723
|
+
}
|
|
724
|
+
function escapeSpecialCharacters(html) {
|
|
725
|
+
return html.replace(constants_1.CARRIAGE_RETURN_REGEX, constants_1.CARRIAGE_RETURN_PLACEHOLDER);
|
|
726
|
+
}
|
|
727
|
+
function revertEscapedCharacters(text) {
|
|
728
|
+
return text.replace(constants_1.CARRIAGE_RETURN_PLACEHOLDER_REGEX, constants_1.CARRIAGE_RETURN);
|
|
729
|
+
}
|
|
730
|
+
function formatDOM(nodes, parent, directive) {
|
|
731
|
+
if (parent === void 0) {
|
|
732
|
+
parent = null;
|
|
733
|
+
}
|
|
734
|
+
var domNodes = [];
|
|
735
|
+
var current;
|
|
736
|
+
var index = 0;
|
|
737
|
+
var nodesLength = nodes.length;
|
|
738
|
+
for (; index < nodesLength; index++) {
|
|
739
|
+
var node2 = nodes[index];
|
|
740
|
+
switch (node2.nodeType) {
|
|
741
|
+
case 1: {
|
|
742
|
+
var tagName = formatTagName(node2.nodeName);
|
|
743
|
+
current = new domhandler_1.Element(tagName, formatAttributes(node2.attributes));
|
|
744
|
+
current.children = formatDOM(
|
|
745
|
+
// template children are on content
|
|
746
|
+
tagName === "template" ? node2.content.childNodes : node2.childNodes,
|
|
747
|
+
current
|
|
748
|
+
);
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
case 3:
|
|
752
|
+
current = new domhandler_1.Text(revertEscapedCharacters(node2.nodeValue));
|
|
753
|
+
break;
|
|
754
|
+
case 8:
|
|
755
|
+
current = new domhandler_1.Comment(node2.nodeValue);
|
|
756
|
+
break;
|
|
757
|
+
default:
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
var prev = domNodes[index - 1] || null;
|
|
761
|
+
if (prev) {
|
|
762
|
+
prev.next = current;
|
|
763
|
+
}
|
|
764
|
+
current.parent = parent;
|
|
765
|
+
current.prev = prev;
|
|
766
|
+
current.next = null;
|
|
767
|
+
domNodes.push(current);
|
|
768
|
+
}
|
|
769
|
+
if (directive) {
|
|
770
|
+
current = new domhandler_1.ProcessingInstruction(directive.substring(0, directive.indexOf(" ")).toLowerCase(), directive);
|
|
771
|
+
current.next = domNodes[0] || null;
|
|
772
|
+
current.parent = parent;
|
|
773
|
+
domNodes.unshift(current);
|
|
774
|
+
if (domNodes[1]) {
|
|
775
|
+
domNodes[1].prev = domNodes[0];
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return domNodes;
|
|
779
|
+
}
|
|
780
|
+
return utilities$2;
|
|
781
|
+
}
|
|
782
|
+
var hasRequiredDomparser;
|
|
783
|
+
function requireDomparser() {
|
|
784
|
+
if (hasRequiredDomparser) return domparser;
|
|
785
|
+
hasRequiredDomparser = 1;
|
|
786
|
+
Object.defineProperty(domparser, "__esModule", { value: true });
|
|
787
|
+
domparser.default = domparser$1;
|
|
788
|
+
var utilities_1 = requireUtilities$2();
|
|
789
|
+
var HTML = "html";
|
|
790
|
+
var HEAD = "head";
|
|
791
|
+
var BODY = "body";
|
|
792
|
+
var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/;
|
|
793
|
+
var HEAD_TAG_REGEX = /<head[^]*>/i;
|
|
794
|
+
var BODY_TAG_REGEX = /<body[^]*>/i;
|
|
795
|
+
var parseFromDocument = function(html, tagName) {
|
|
796
|
+
throw new Error("This browser does not support `document.implementation.createHTMLDocument`");
|
|
797
|
+
};
|
|
798
|
+
var parseFromString = function(html, tagName) {
|
|
799
|
+
throw new Error("This browser does not support `DOMParser.prototype.parseFromString`");
|
|
800
|
+
};
|
|
801
|
+
var DOMParser = typeof window === "object" && window.DOMParser;
|
|
802
|
+
if (typeof DOMParser === "function") {
|
|
803
|
+
var domParser_1 = new DOMParser();
|
|
804
|
+
var mimeType_1 = "text/html";
|
|
805
|
+
parseFromString = function(html, tagName) {
|
|
806
|
+
if (tagName) {
|
|
807
|
+
html = "<".concat(tagName, ">").concat(html, "</").concat(tagName, ">");
|
|
808
|
+
}
|
|
809
|
+
return domParser_1.parseFromString(html, mimeType_1);
|
|
810
|
+
};
|
|
811
|
+
parseFromDocument = parseFromString;
|
|
812
|
+
}
|
|
813
|
+
if (typeof document === "object" && document.implementation) {
|
|
814
|
+
var htmlDocument_1 = document.implementation.createHTMLDocument();
|
|
815
|
+
parseFromDocument = function(html, tagName) {
|
|
816
|
+
if (tagName) {
|
|
817
|
+
var element = htmlDocument_1.documentElement.querySelector(tagName);
|
|
818
|
+
if (element) {
|
|
819
|
+
element.innerHTML = html;
|
|
820
|
+
}
|
|
821
|
+
return htmlDocument_1;
|
|
822
|
+
}
|
|
823
|
+
htmlDocument_1.documentElement.innerHTML = html;
|
|
824
|
+
return htmlDocument_1;
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
var template = typeof document === "object" && document.createElement("template");
|
|
828
|
+
var parseFromTemplate;
|
|
829
|
+
if (template && template.content) {
|
|
830
|
+
parseFromTemplate = function(html) {
|
|
831
|
+
template.innerHTML = html;
|
|
832
|
+
return template.content.childNodes;
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
function domparser$1(html) {
|
|
836
|
+
var _a, _b;
|
|
837
|
+
html = (0, utilities_1.escapeSpecialCharacters)(html);
|
|
838
|
+
var match = html.match(FIRST_TAG_REGEX);
|
|
839
|
+
var firstTagName = match && match[1] ? match[1].toLowerCase() : "";
|
|
840
|
+
switch (firstTagName) {
|
|
841
|
+
case HTML: {
|
|
842
|
+
var doc = parseFromString(html);
|
|
843
|
+
if (!HEAD_TAG_REGEX.test(html)) {
|
|
844
|
+
var element = doc.querySelector(HEAD);
|
|
845
|
+
(_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
|
|
846
|
+
}
|
|
847
|
+
if (!BODY_TAG_REGEX.test(html)) {
|
|
848
|
+
var element = doc.querySelector(BODY);
|
|
849
|
+
(_b = element === null || element === void 0 ? void 0 : element.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(element);
|
|
850
|
+
}
|
|
851
|
+
return doc.querySelectorAll(HTML);
|
|
852
|
+
}
|
|
853
|
+
case HEAD:
|
|
854
|
+
case BODY: {
|
|
855
|
+
var elements = parseFromDocument(html).querySelectorAll(firstTagName);
|
|
856
|
+
if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {
|
|
857
|
+
return elements[0].parentNode.childNodes;
|
|
858
|
+
}
|
|
859
|
+
return elements;
|
|
860
|
+
}
|
|
861
|
+
// low-level tag or text
|
|
862
|
+
default: {
|
|
863
|
+
if (parseFromTemplate) {
|
|
864
|
+
return parseFromTemplate(html);
|
|
865
|
+
}
|
|
866
|
+
var element = parseFromDocument(html, BODY).querySelector(BODY);
|
|
867
|
+
return element.childNodes;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return domparser;
|
|
872
|
+
}
|
|
873
|
+
var hasRequiredHtmlToDom;
|
|
874
|
+
function requireHtmlToDom() {
|
|
875
|
+
if (hasRequiredHtmlToDom) return htmlToDom;
|
|
876
|
+
hasRequiredHtmlToDom = 1;
|
|
877
|
+
var __importDefault = htmlToDom && htmlToDom.__importDefault || function(mod) {
|
|
878
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
879
|
+
};
|
|
880
|
+
Object.defineProperty(htmlToDom, "__esModule", { value: true });
|
|
881
|
+
htmlToDom.default = HTMLDOMParser;
|
|
882
|
+
var domparser_1 = __importDefault(requireDomparser());
|
|
883
|
+
var utilities_1 = requireUtilities$2();
|
|
884
|
+
var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/;
|
|
885
|
+
function HTMLDOMParser(html) {
|
|
886
|
+
if (typeof html !== "string") {
|
|
887
|
+
throw new TypeError("First argument must be a string");
|
|
888
|
+
}
|
|
889
|
+
if (!html) {
|
|
890
|
+
return [];
|
|
891
|
+
}
|
|
892
|
+
var match = html.match(DIRECTIVE_REGEX);
|
|
893
|
+
var directive = match ? match[1] : void 0;
|
|
894
|
+
return (0, utilities_1.formatDOM)((0, domparser_1.default)(html), null, directive);
|
|
895
|
+
}
|
|
896
|
+
return htmlToDom;
|
|
897
|
+
}
|
|
898
|
+
var attributesToProps = {};
|
|
899
|
+
var lib = {};
|
|
900
|
+
var possibleStandardNamesOptimized = {};
|
|
901
|
+
var hasRequiredPossibleStandardNamesOptimized;
|
|
902
|
+
function requirePossibleStandardNamesOptimized() {
|
|
903
|
+
if (hasRequiredPossibleStandardNamesOptimized) return possibleStandardNamesOptimized;
|
|
904
|
+
hasRequiredPossibleStandardNamesOptimized = 1;
|
|
905
|
+
var SAME = 0;
|
|
906
|
+
possibleStandardNamesOptimized.SAME = SAME;
|
|
907
|
+
var CAMELCASE = 1;
|
|
908
|
+
possibleStandardNamesOptimized.CAMELCASE = CAMELCASE;
|
|
909
|
+
possibleStandardNamesOptimized.possibleStandardNames = {
|
|
910
|
+
accept: 0,
|
|
911
|
+
acceptCharset: 1,
|
|
912
|
+
"accept-charset": "acceptCharset",
|
|
913
|
+
accessKey: 1,
|
|
914
|
+
action: 0,
|
|
915
|
+
allowFullScreen: 1,
|
|
916
|
+
alt: 0,
|
|
917
|
+
as: 0,
|
|
918
|
+
async: 0,
|
|
919
|
+
autoCapitalize: 1,
|
|
920
|
+
autoComplete: 1,
|
|
921
|
+
autoCorrect: 1,
|
|
922
|
+
autoFocus: 1,
|
|
923
|
+
autoPlay: 1,
|
|
924
|
+
autoSave: 1,
|
|
925
|
+
capture: 0,
|
|
926
|
+
cellPadding: 1,
|
|
927
|
+
cellSpacing: 1,
|
|
928
|
+
challenge: 0,
|
|
929
|
+
charSet: 1,
|
|
930
|
+
checked: 0,
|
|
931
|
+
children: 0,
|
|
932
|
+
cite: 0,
|
|
933
|
+
class: "className",
|
|
934
|
+
classID: 1,
|
|
935
|
+
className: 1,
|
|
936
|
+
cols: 0,
|
|
937
|
+
colSpan: 1,
|
|
938
|
+
content: 0,
|
|
939
|
+
contentEditable: 1,
|
|
940
|
+
contextMenu: 1,
|
|
941
|
+
controls: 0,
|
|
942
|
+
controlsList: 1,
|
|
943
|
+
coords: 0,
|
|
944
|
+
crossOrigin: 1,
|
|
945
|
+
dangerouslySetInnerHTML: 1,
|
|
946
|
+
data: 0,
|
|
947
|
+
dateTime: 1,
|
|
948
|
+
default: 0,
|
|
949
|
+
defaultChecked: 1,
|
|
950
|
+
defaultValue: 1,
|
|
951
|
+
defer: 0,
|
|
952
|
+
dir: 0,
|
|
953
|
+
disabled: 0,
|
|
954
|
+
disablePictureInPicture: 1,
|
|
955
|
+
disableRemotePlayback: 1,
|
|
956
|
+
download: 0,
|
|
957
|
+
draggable: 0,
|
|
958
|
+
encType: 1,
|
|
959
|
+
enterKeyHint: 1,
|
|
960
|
+
for: "htmlFor",
|
|
961
|
+
form: 0,
|
|
962
|
+
formMethod: 1,
|
|
963
|
+
formAction: 1,
|
|
964
|
+
formEncType: 1,
|
|
965
|
+
formNoValidate: 1,
|
|
966
|
+
formTarget: 1,
|
|
967
|
+
frameBorder: 1,
|
|
968
|
+
headers: 0,
|
|
969
|
+
height: 0,
|
|
970
|
+
hidden: 0,
|
|
971
|
+
high: 0,
|
|
972
|
+
href: 0,
|
|
973
|
+
hrefLang: 1,
|
|
974
|
+
htmlFor: 1,
|
|
975
|
+
httpEquiv: 1,
|
|
976
|
+
"http-equiv": "httpEquiv",
|
|
977
|
+
icon: 0,
|
|
978
|
+
id: 0,
|
|
979
|
+
innerHTML: 1,
|
|
980
|
+
inputMode: 1,
|
|
981
|
+
integrity: 0,
|
|
982
|
+
is: 0,
|
|
983
|
+
itemID: 1,
|
|
984
|
+
itemProp: 1,
|
|
985
|
+
itemRef: 1,
|
|
986
|
+
itemScope: 1,
|
|
987
|
+
itemType: 1,
|
|
988
|
+
keyParams: 1,
|
|
989
|
+
keyType: 1,
|
|
990
|
+
kind: 0,
|
|
991
|
+
label: 0,
|
|
992
|
+
lang: 0,
|
|
993
|
+
list: 0,
|
|
994
|
+
loop: 0,
|
|
995
|
+
low: 0,
|
|
996
|
+
manifest: 0,
|
|
997
|
+
marginWidth: 1,
|
|
998
|
+
marginHeight: 1,
|
|
999
|
+
max: 0,
|
|
1000
|
+
maxLength: 1,
|
|
1001
|
+
media: 0,
|
|
1002
|
+
mediaGroup: 1,
|
|
1003
|
+
method: 0,
|
|
1004
|
+
min: 0,
|
|
1005
|
+
minLength: 1,
|
|
1006
|
+
multiple: 0,
|
|
1007
|
+
muted: 0,
|
|
1008
|
+
name: 0,
|
|
1009
|
+
noModule: 1,
|
|
1010
|
+
nonce: 0,
|
|
1011
|
+
noValidate: 1,
|
|
1012
|
+
open: 0,
|
|
1013
|
+
optimum: 0,
|
|
1014
|
+
pattern: 0,
|
|
1015
|
+
placeholder: 0,
|
|
1016
|
+
playsInline: 1,
|
|
1017
|
+
poster: 0,
|
|
1018
|
+
preload: 0,
|
|
1019
|
+
profile: 0,
|
|
1020
|
+
radioGroup: 1,
|
|
1021
|
+
readOnly: 1,
|
|
1022
|
+
referrerPolicy: 1,
|
|
1023
|
+
rel: 0,
|
|
1024
|
+
required: 0,
|
|
1025
|
+
reversed: 0,
|
|
1026
|
+
role: 0,
|
|
1027
|
+
rows: 0,
|
|
1028
|
+
rowSpan: 1,
|
|
1029
|
+
sandbox: 0,
|
|
1030
|
+
scope: 0,
|
|
1031
|
+
scoped: 0,
|
|
1032
|
+
scrolling: 0,
|
|
1033
|
+
seamless: 0,
|
|
1034
|
+
selected: 0,
|
|
1035
|
+
shape: 0,
|
|
1036
|
+
size: 0,
|
|
1037
|
+
sizes: 0,
|
|
1038
|
+
span: 0,
|
|
1039
|
+
spellCheck: 1,
|
|
1040
|
+
src: 0,
|
|
1041
|
+
srcDoc: 1,
|
|
1042
|
+
srcLang: 1,
|
|
1043
|
+
srcSet: 1,
|
|
1044
|
+
start: 0,
|
|
1045
|
+
step: 0,
|
|
1046
|
+
style: 0,
|
|
1047
|
+
summary: 0,
|
|
1048
|
+
tabIndex: 1,
|
|
1049
|
+
target: 0,
|
|
1050
|
+
title: 0,
|
|
1051
|
+
type: 0,
|
|
1052
|
+
useMap: 1,
|
|
1053
|
+
value: 0,
|
|
1054
|
+
width: 0,
|
|
1055
|
+
wmode: 0,
|
|
1056
|
+
wrap: 0,
|
|
1057
|
+
about: 0,
|
|
1058
|
+
accentHeight: 1,
|
|
1059
|
+
"accent-height": "accentHeight",
|
|
1060
|
+
accumulate: 0,
|
|
1061
|
+
additive: 0,
|
|
1062
|
+
alignmentBaseline: 1,
|
|
1063
|
+
"alignment-baseline": "alignmentBaseline",
|
|
1064
|
+
allowReorder: 1,
|
|
1065
|
+
alphabetic: 0,
|
|
1066
|
+
amplitude: 0,
|
|
1067
|
+
arabicForm: 1,
|
|
1068
|
+
"arabic-form": "arabicForm",
|
|
1069
|
+
ascent: 0,
|
|
1070
|
+
attributeName: 1,
|
|
1071
|
+
attributeType: 1,
|
|
1072
|
+
autoReverse: 1,
|
|
1073
|
+
azimuth: 0,
|
|
1074
|
+
baseFrequency: 1,
|
|
1075
|
+
baselineShift: 1,
|
|
1076
|
+
"baseline-shift": "baselineShift",
|
|
1077
|
+
baseProfile: 1,
|
|
1078
|
+
bbox: 0,
|
|
1079
|
+
begin: 0,
|
|
1080
|
+
bias: 0,
|
|
1081
|
+
by: 0,
|
|
1082
|
+
calcMode: 1,
|
|
1083
|
+
capHeight: 1,
|
|
1084
|
+
"cap-height": "capHeight",
|
|
1085
|
+
clip: 0,
|
|
1086
|
+
clipPath: 1,
|
|
1087
|
+
"clip-path": "clipPath",
|
|
1088
|
+
clipPathUnits: 1,
|
|
1089
|
+
clipRule: 1,
|
|
1090
|
+
"clip-rule": "clipRule",
|
|
1091
|
+
color: 0,
|
|
1092
|
+
colorInterpolation: 1,
|
|
1093
|
+
"color-interpolation": "colorInterpolation",
|
|
1094
|
+
colorInterpolationFilters: 1,
|
|
1095
|
+
"color-interpolation-filters": "colorInterpolationFilters",
|
|
1096
|
+
colorProfile: 1,
|
|
1097
|
+
"color-profile": "colorProfile",
|
|
1098
|
+
colorRendering: 1,
|
|
1099
|
+
"color-rendering": "colorRendering",
|
|
1100
|
+
contentScriptType: 1,
|
|
1101
|
+
contentStyleType: 1,
|
|
1102
|
+
cursor: 0,
|
|
1103
|
+
cx: 0,
|
|
1104
|
+
cy: 0,
|
|
1105
|
+
d: 0,
|
|
1106
|
+
datatype: 0,
|
|
1107
|
+
decelerate: 0,
|
|
1108
|
+
descent: 0,
|
|
1109
|
+
diffuseConstant: 1,
|
|
1110
|
+
direction: 0,
|
|
1111
|
+
display: 0,
|
|
1112
|
+
divisor: 0,
|
|
1113
|
+
dominantBaseline: 1,
|
|
1114
|
+
"dominant-baseline": "dominantBaseline",
|
|
1115
|
+
dur: 0,
|
|
1116
|
+
dx: 0,
|
|
1117
|
+
dy: 0,
|
|
1118
|
+
edgeMode: 1,
|
|
1119
|
+
elevation: 0,
|
|
1120
|
+
enableBackground: 1,
|
|
1121
|
+
"enable-background": "enableBackground",
|
|
1122
|
+
end: 0,
|
|
1123
|
+
exponent: 0,
|
|
1124
|
+
externalResourcesRequired: 1,
|
|
1125
|
+
fill: 0,
|
|
1126
|
+
fillOpacity: 1,
|
|
1127
|
+
"fill-opacity": "fillOpacity",
|
|
1128
|
+
fillRule: 1,
|
|
1129
|
+
"fill-rule": "fillRule",
|
|
1130
|
+
filter: 0,
|
|
1131
|
+
filterRes: 1,
|
|
1132
|
+
filterUnits: 1,
|
|
1133
|
+
floodOpacity: 1,
|
|
1134
|
+
"flood-opacity": "floodOpacity",
|
|
1135
|
+
floodColor: 1,
|
|
1136
|
+
"flood-color": "floodColor",
|
|
1137
|
+
focusable: 0,
|
|
1138
|
+
fontFamily: 1,
|
|
1139
|
+
"font-family": "fontFamily",
|
|
1140
|
+
fontSize: 1,
|
|
1141
|
+
"font-size": "fontSize",
|
|
1142
|
+
fontSizeAdjust: 1,
|
|
1143
|
+
"font-size-adjust": "fontSizeAdjust",
|
|
1144
|
+
fontStretch: 1,
|
|
1145
|
+
"font-stretch": "fontStretch",
|
|
1146
|
+
fontStyle: 1,
|
|
1147
|
+
"font-style": "fontStyle",
|
|
1148
|
+
fontVariant: 1,
|
|
1149
|
+
"font-variant": "fontVariant",
|
|
1150
|
+
fontWeight: 1,
|
|
1151
|
+
"font-weight": "fontWeight",
|
|
1152
|
+
format: 0,
|
|
1153
|
+
from: 0,
|
|
1154
|
+
fx: 0,
|
|
1155
|
+
fy: 0,
|
|
1156
|
+
g1: 0,
|
|
1157
|
+
g2: 0,
|
|
1158
|
+
glyphName: 1,
|
|
1159
|
+
"glyph-name": "glyphName",
|
|
1160
|
+
glyphOrientationHorizontal: 1,
|
|
1161
|
+
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
1162
|
+
glyphOrientationVertical: 1,
|
|
1163
|
+
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
1164
|
+
glyphRef: 1,
|
|
1165
|
+
gradientTransform: 1,
|
|
1166
|
+
gradientUnits: 1,
|
|
1167
|
+
hanging: 0,
|
|
1168
|
+
horizAdvX: 1,
|
|
1169
|
+
"horiz-adv-x": "horizAdvX",
|
|
1170
|
+
horizOriginX: 1,
|
|
1171
|
+
"horiz-origin-x": "horizOriginX",
|
|
1172
|
+
ideographic: 0,
|
|
1173
|
+
imageRendering: 1,
|
|
1174
|
+
"image-rendering": "imageRendering",
|
|
1175
|
+
in2: 0,
|
|
1176
|
+
in: 0,
|
|
1177
|
+
inlist: 0,
|
|
1178
|
+
intercept: 0,
|
|
1179
|
+
k1: 0,
|
|
1180
|
+
k2: 0,
|
|
1181
|
+
k3: 0,
|
|
1182
|
+
k4: 0,
|
|
1183
|
+
k: 0,
|
|
1184
|
+
kernelMatrix: 1,
|
|
1185
|
+
kernelUnitLength: 1,
|
|
1186
|
+
kerning: 0,
|
|
1187
|
+
keyPoints: 1,
|
|
1188
|
+
keySplines: 1,
|
|
1189
|
+
keyTimes: 1,
|
|
1190
|
+
lengthAdjust: 1,
|
|
1191
|
+
letterSpacing: 1,
|
|
1192
|
+
"letter-spacing": "letterSpacing",
|
|
1193
|
+
lightingColor: 1,
|
|
1194
|
+
"lighting-color": "lightingColor",
|
|
1195
|
+
limitingConeAngle: 1,
|
|
1196
|
+
local: 0,
|
|
1197
|
+
markerEnd: 1,
|
|
1198
|
+
"marker-end": "markerEnd",
|
|
1199
|
+
markerHeight: 1,
|
|
1200
|
+
markerMid: 1,
|
|
1201
|
+
"marker-mid": "markerMid",
|
|
1202
|
+
markerStart: 1,
|
|
1203
|
+
"marker-start": "markerStart",
|
|
1204
|
+
markerUnits: 1,
|
|
1205
|
+
markerWidth: 1,
|
|
1206
|
+
mask: 0,
|
|
1207
|
+
maskContentUnits: 1,
|
|
1208
|
+
maskUnits: 1,
|
|
1209
|
+
mathematical: 0,
|
|
1210
|
+
mode: 0,
|
|
1211
|
+
numOctaves: 1,
|
|
1212
|
+
offset: 0,
|
|
1213
|
+
opacity: 0,
|
|
1214
|
+
operator: 0,
|
|
1215
|
+
order: 0,
|
|
1216
|
+
orient: 0,
|
|
1217
|
+
orientation: 0,
|
|
1218
|
+
origin: 0,
|
|
1219
|
+
overflow: 0,
|
|
1220
|
+
overlinePosition: 1,
|
|
1221
|
+
"overline-position": "overlinePosition",
|
|
1222
|
+
overlineThickness: 1,
|
|
1223
|
+
"overline-thickness": "overlineThickness",
|
|
1224
|
+
paintOrder: 1,
|
|
1225
|
+
"paint-order": "paintOrder",
|
|
1226
|
+
panose1: 0,
|
|
1227
|
+
"panose-1": "panose1",
|
|
1228
|
+
pathLength: 1,
|
|
1229
|
+
patternContentUnits: 1,
|
|
1230
|
+
patternTransform: 1,
|
|
1231
|
+
patternUnits: 1,
|
|
1232
|
+
pointerEvents: 1,
|
|
1233
|
+
"pointer-events": "pointerEvents",
|
|
1234
|
+
points: 0,
|
|
1235
|
+
pointsAtX: 1,
|
|
1236
|
+
pointsAtY: 1,
|
|
1237
|
+
pointsAtZ: 1,
|
|
1238
|
+
prefix: 0,
|
|
1239
|
+
preserveAlpha: 1,
|
|
1240
|
+
preserveAspectRatio: 1,
|
|
1241
|
+
primitiveUnits: 1,
|
|
1242
|
+
property: 0,
|
|
1243
|
+
r: 0,
|
|
1244
|
+
radius: 0,
|
|
1245
|
+
refX: 1,
|
|
1246
|
+
refY: 1,
|
|
1247
|
+
renderingIntent: 1,
|
|
1248
|
+
"rendering-intent": "renderingIntent",
|
|
1249
|
+
repeatCount: 1,
|
|
1250
|
+
repeatDur: 1,
|
|
1251
|
+
requiredExtensions: 1,
|
|
1252
|
+
requiredFeatures: 1,
|
|
1253
|
+
resource: 0,
|
|
1254
|
+
restart: 0,
|
|
1255
|
+
result: 0,
|
|
1256
|
+
results: 0,
|
|
1257
|
+
rotate: 0,
|
|
1258
|
+
rx: 0,
|
|
1259
|
+
ry: 0,
|
|
1260
|
+
scale: 0,
|
|
1261
|
+
security: 0,
|
|
1262
|
+
seed: 0,
|
|
1263
|
+
shapeRendering: 1,
|
|
1264
|
+
"shape-rendering": "shapeRendering",
|
|
1265
|
+
slope: 0,
|
|
1266
|
+
spacing: 0,
|
|
1267
|
+
specularConstant: 1,
|
|
1268
|
+
specularExponent: 1,
|
|
1269
|
+
speed: 0,
|
|
1270
|
+
spreadMethod: 1,
|
|
1271
|
+
startOffset: 1,
|
|
1272
|
+
stdDeviation: 1,
|
|
1273
|
+
stemh: 0,
|
|
1274
|
+
stemv: 0,
|
|
1275
|
+
stitchTiles: 1,
|
|
1276
|
+
stopColor: 1,
|
|
1277
|
+
"stop-color": "stopColor",
|
|
1278
|
+
stopOpacity: 1,
|
|
1279
|
+
"stop-opacity": "stopOpacity",
|
|
1280
|
+
strikethroughPosition: 1,
|
|
1281
|
+
"strikethrough-position": "strikethroughPosition",
|
|
1282
|
+
strikethroughThickness: 1,
|
|
1283
|
+
"strikethrough-thickness": "strikethroughThickness",
|
|
1284
|
+
string: 0,
|
|
1285
|
+
stroke: 0,
|
|
1286
|
+
strokeDasharray: 1,
|
|
1287
|
+
"stroke-dasharray": "strokeDasharray",
|
|
1288
|
+
strokeDashoffset: 1,
|
|
1289
|
+
"stroke-dashoffset": "strokeDashoffset",
|
|
1290
|
+
strokeLinecap: 1,
|
|
1291
|
+
"stroke-linecap": "strokeLinecap",
|
|
1292
|
+
strokeLinejoin: 1,
|
|
1293
|
+
"stroke-linejoin": "strokeLinejoin",
|
|
1294
|
+
strokeMiterlimit: 1,
|
|
1295
|
+
"stroke-miterlimit": "strokeMiterlimit",
|
|
1296
|
+
strokeWidth: 1,
|
|
1297
|
+
"stroke-width": "strokeWidth",
|
|
1298
|
+
strokeOpacity: 1,
|
|
1299
|
+
"stroke-opacity": "strokeOpacity",
|
|
1300
|
+
suppressContentEditableWarning: 1,
|
|
1301
|
+
suppressHydrationWarning: 1,
|
|
1302
|
+
surfaceScale: 1,
|
|
1303
|
+
systemLanguage: 1,
|
|
1304
|
+
tableValues: 1,
|
|
1305
|
+
targetX: 1,
|
|
1306
|
+
targetY: 1,
|
|
1307
|
+
textAnchor: 1,
|
|
1308
|
+
"text-anchor": "textAnchor",
|
|
1309
|
+
textDecoration: 1,
|
|
1310
|
+
"text-decoration": "textDecoration",
|
|
1311
|
+
textLength: 1,
|
|
1312
|
+
textRendering: 1,
|
|
1313
|
+
"text-rendering": "textRendering",
|
|
1314
|
+
to: 0,
|
|
1315
|
+
transform: 0,
|
|
1316
|
+
typeof: 0,
|
|
1317
|
+
u1: 0,
|
|
1318
|
+
u2: 0,
|
|
1319
|
+
underlinePosition: 1,
|
|
1320
|
+
"underline-position": "underlinePosition",
|
|
1321
|
+
underlineThickness: 1,
|
|
1322
|
+
"underline-thickness": "underlineThickness",
|
|
1323
|
+
unicode: 0,
|
|
1324
|
+
unicodeBidi: 1,
|
|
1325
|
+
"unicode-bidi": "unicodeBidi",
|
|
1326
|
+
unicodeRange: 1,
|
|
1327
|
+
"unicode-range": "unicodeRange",
|
|
1328
|
+
unitsPerEm: 1,
|
|
1329
|
+
"units-per-em": "unitsPerEm",
|
|
1330
|
+
unselectable: 0,
|
|
1331
|
+
vAlphabetic: 1,
|
|
1332
|
+
"v-alphabetic": "vAlphabetic",
|
|
1333
|
+
values: 0,
|
|
1334
|
+
vectorEffect: 1,
|
|
1335
|
+
"vector-effect": "vectorEffect",
|
|
1336
|
+
version: 0,
|
|
1337
|
+
vertAdvY: 1,
|
|
1338
|
+
"vert-adv-y": "vertAdvY",
|
|
1339
|
+
vertOriginX: 1,
|
|
1340
|
+
"vert-origin-x": "vertOriginX",
|
|
1341
|
+
vertOriginY: 1,
|
|
1342
|
+
"vert-origin-y": "vertOriginY",
|
|
1343
|
+
vHanging: 1,
|
|
1344
|
+
"v-hanging": "vHanging",
|
|
1345
|
+
vIdeographic: 1,
|
|
1346
|
+
"v-ideographic": "vIdeographic",
|
|
1347
|
+
viewBox: 1,
|
|
1348
|
+
viewTarget: 1,
|
|
1349
|
+
visibility: 0,
|
|
1350
|
+
vMathematical: 1,
|
|
1351
|
+
"v-mathematical": "vMathematical",
|
|
1352
|
+
vocab: 0,
|
|
1353
|
+
widths: 0,
|
|
1354
|
+
wordSpacing: 1,
|
|
1355
|
+
"word-spacing": "wordSpacing",
|
|
1356
|
+
writingMode: 1,
|
|
1357
|
+
"writing-mode": "writingMode",
|
|
1358
|
+
x1: 0,
|
|
1359
|
+
x2: 0,
|
|
1360
|
+
x: 0,
|
|
1361
|
+
xChannelSelector: 1,
|
|
1362
|
+
xHeight: 1,
|
|
1363
|
+
"x-height": "xHeight",
|
|
1364
|
+
xlinkActuate: 1,
|
|
1365
|
+
"xlink:actuate": "xlinkActuate",
|
|
1366
|
+
xlinkArcrole: 1,
|
|
1367
|
+
"xlink:arcrole": "xlinkArcrole",
|
|
1368
|
+
xlinkHref: 1,
|
|
1369
|
+
"xlink:href": "xlinkHref",
|
|
1370
|
+
xlinkRole: 1,
|
|
1371
|
+
"xlink:role": "xlinkRole",
|
|
1372
|
+
xlinkShow: 1,
|
|
1373
|
+
"xlink:show": "xlinkShow",
|
|
1374
|
+
xlinkTitle: 1,
|
|
1375
|
+
"xlink:title": "xlinkTitle",
|
|
1376
|
+
xlinkType: 1,
|
|
1377
|
+
"xlink:type": "xlinkType",
|
|
1378
|
+
xmlBase: 1,
|
|
1379
|
+
"xml:base": "xmlBase",
|
|
1380
|
+
xmlLang: 1,
|
|
1381
|
+
"xml:lang": "xmlLang",
|
|
1382
|
+
xmlns: 0,
|
|
1383
|
+
"xml:space": "xmlSpace",
|
|
1384
|
+
xmlnsXlink: 1,
|
|
1385
|
+
"xmlns:xlink": "xmlnsXlink",
|
|
1386
|
+
xmlSpace: 1,
|
|
1387
|
+
y1: 0,
|
|
1388
|
+
y2: 0,
|
|
1389
|
+
y: 0,
|
|
1390
|
+
yChannelSelector: 1,
|
|
1391
|
+
z: 0,
|
|
1392
|
+
zoomAndPan: 1
|
|
1393
|
+
};
|
|
1394
|
+
return possibleStandardNamesOptimized;
|
|
1395
|
+
}
|
|
1396
|
+
var hasRequiredLib$1;
|
|
1397
|
+
function requireLib$1() {
|
|
1398
|
+
if (hasRequiredLib$1) return lib;
|
|
1399
|
+
hasRequiredLib$1 = 1;
|
|
1400
|
+
const RESERVED = 0;
|
|
1401
|
+
const STRING = 1;
|
|
1402
|
+
const BOOLEANISH_STRING = 2;
|
|
1403
|
+
const BOOLEAN = 3;
|
|
1404
|
+
const OVERLOADED_BOOLEAN = 4;
|
|
1405
|
+
const NUMERIC = 5;
|
|
1406
|
+
const POSITIVE_NUMERIC = 6;
|
|
1407
|
+
function getPropertyInfo(name) {
|
|
1408
|
+
return properties.hasOwnProperty(name) ? properties[name] : null;
|
|
1409
|
+
}
|
|
1410
|
+
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
|
|
1411
|
+
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
1412
|
+
this.attributeName = attributeName;
|
|
1413
|
+
this.attributeNamespace = attributeNamespace;
|
|
1414
|
+
this.mustUseProperty = mustUseProperty;
|
|
1415
|
+
this.propertyName = name;
|
|
1416
|
+
this.type = type;
|
|
1417
|
+
this.sanitizeURL = sanitizeURL;
|
|
1418
|
+
this.removeEmptyString = removeEmptyString;
|
|
1419
|
+
}
|
|
1420
|
+
const properties = {};
|
|
1421
|
+
const reservedProps = [
|
|
1422
|
+
"children",
|
|
1423
|
+
"dangerouslySetInnerHTML",
|
|
1424
|
+
// TODO: This prevents the assignment of defaultValue to regular
|
|
1425
|
+
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
1426
|
+
// defaultValue property -- do we need this?
|
|
1427
|
+
"defaultValue",
|
|
1428
|
+
"defaultChecked",
|
|
1429
|
+
"innerHTML",
|
|
1430
|
+
"suppressContentEditableWarning",
|
|
1431
|
+
"suppressHydrationWarning",
|
|
1432
|
+
"style"
|
|
1433
|
+
];
|
|
1434
|
+
reservedProps.forEach((name) => {
|
|
1435
|
+
properties[name] = new PropertyInfoRecord(
|
|
1436
|
+
name,
|
|
1437
|
+
RESERVED,
|
|
1438
|
+
false,
|
|
1439
|
+
// mustUseProperty
|
|
1440
|
+
name,
|
|
1441
|
+
// attributeName
|
|
1442
|
+
null,
|
|
1443
|
+
// attributeNamespace
|
|
1444
|
+
false,
|
|
1445
|
+
// sanitizeURL
|
|
1446
|
+
false
|
|
1447
|
+
// removeEmptyString
|
|
1448
|
+
);
|
|
1449
|
+
});
|
|
1450
|
+
[
|
|
1451
|
+
["acceptCharset", "accept-charset"],
|
|
1452
|
+
["className", "class"],
|
|
1453
|
+
["htmlFor", "for"],
|
|
1454
|
+
["httpEquiv", "http-equiv"]
|
|
1455
|
+
].forEach(([name, attributeName]) => {
|
|
1456
|
+
properties[name] = new PropertyInfoRecord(
|
|
1457
|
+
name,
|
|
1458
|
+
STRING,
|
|
1459
|
+
false,
|
|
1460
|
+
// mustUseProperty
|
|
1461
|
+
attributeName,
|
|
1462
|
+
// attributeName
|
|
1463
|
+
null,
|
|
1464
|
+
// attributeNamespace
|
|
1465
|
+
false,
|
|
1466
|
+
// sanitizeURL
|
|
1467
|
+
false
|
|
1468
|
+
// removeEmptyString
|
|
1469
|
+
);
|
|
1470
|
+
});
|
|
1471
|
+
["contentEditable", "draggable", "spellCheck", "value"].forEach((name) => {
|
|
1472
|
+
properties[name] = new PropertyInfoRecord(
|
|
1473
|
+
name,
|
|
1474
|
+
BOOLEANISH_STRING,
|
|
1475
|
+
false,
|
|
1476
|
+
// mustUseProperty
|
|
1477
|
+
name.toLowerCase(),
|
|
1478
|
+
// attributeName
|
|
1479
|
+
null,
|
|
1480
|
+
// attributeNamespace
|
|
1481
|
+
false,
|
|
1482
|
+
// sanitizeURL
|
|
1483
|
+
false
|
|
1484
|
+
// removeEmptyString
|
|
1485
|
+
);
|
|
1486
|
+
});
|
|
1487
|
+
[
|
|
1488
|
+
"autoReverse",
|
|
1489
|
+
"externalResourcesRequired",
|
|
1490
|
+
"focusable",
|
|
1491
|
+
"preserveAlpha"
|
|
1492
|
+
].forEach((name) => {
|
|
1493
|
+
properties[name] = new PropertyInfoRecord(
|
|
1494
|
+
name,
|
|
1495
|
+
BOOLEANISH_STRING,
|
|
1496
|
+
false,
|
|
1497
|
+
// mustUseProperty
|
|
1498
|
+
name,
|
|
1499
|
+
// attributeName
|
|
1500
|
+
null,
|
|
1501
|
+
// attributeNamespace
|
|
1502
|
+
false,
|
|
1503
|
+
// sanitizeURL
|
|
1504
|
+
false
|
|
1505
|
+
// removeEmptyString
|
|
1506
|
+
);
|
|
1507
|
+
});
|
|
1508
|
+
[
|
|
1509
|
+
"allowFullScreen",
|
|
1510
|
+
"async",
|
|
1511
|
+
// Note: there is a special case that prevents it from being written to the DOM
|
|
1512
|
+
// on the client side because the browsers are inconsistent. Instead we call focus().
|
|
1513
|
+
"autoFocus",
|
|
1514
|
+
"autoPlay",
|
|
1515
|
+
"controls",
|
|
1516
|
+
"default",
|
|
1517
|
+
"defer",
|
|
1518
|
+
"disabled",
|
|
1519
|
+
"disablePictureInPicture",
|
|
1520
|
+
"disableRemotePlayback",
|
|
1521
|
+
"formNoValidate",
|
|
1522
|
+
"hidden",
|
|
1523
|
+
"loop",
|
|
1524
|
+
"noModule",
|
|
1525
|
+
"noValidate",
|
|
1526
|
+
"open",
|
|
1527
|
+
"playsInline",
|
|
1528
|
+
"readOnly",
|
|
1529
|
+
"required",
|
|
1530
|
+
"reversed",
|
|
1531
|
+
"scoped",
|
|
1532
|
+
"seamless",
|
|
1533
|
+
// Microdata
|
|
1534
|
+
"itemScope"
|
|
1535
|
+
].forEach((name) => {
|
|
1536
|
+
properties[name] = new PropertyInfoRecord(
|
|
1537
|
+
name,
|
|
1538
|
+
BOOLEAN,
|
|
1539
|
+
false,
|
|
1540
|
+
// mustUseProperty
|
|
1541
|
+
name.toLowerCase(),
|
|
1542
|
+
// attributeName
|
|
1543
|
+
null,
|
|
1544
|
+
// attributeNamespace
|
|
1545
|
+
false,
|
|
1546
|
+
// sanitizeURL
|
|
1547
|
+
false
|
|
1548
|
+
// removeEmptyString
|
|
1549
|
+
);
|
|
1550
|
+
});
|
|
1551
|
+
[
|
|
1552
|
+
"checked",
|
|
1553
|
+
// Note: `option.selected` is not updated if `select.multiple` is
|
|
1554
|
+
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
1555
|
+
"multiple",
|
|
1556
|
+
"muted",
|
|
1557
|
+
"selected"
|
|
1558
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1559
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1560
|
+
// instead in the assignment below.
|
|
1561
|
+
].forEach((name) => {
|
|
1562
|
+
properties[name] = new PropertyInfoRecord(
|
|
1563
|
+
name,
|
|
1564
|
+
BOOLEAN,
|
|
1565
|
+
true,
|
|
1566
|
+
// mustUseProperty
|
|
1567
|
+
name,
|
|
1568
|
+
// attributeName
|
|
1569
|
+
null,
|
|
1570
|
+
// attributeNamespace
|
|
1571
|
+
false,
|
|
1572
|
+
// sanitizeURL
|
|
1573
|
+
false
|
|
1574
|
+
// removeEmptyString
|
|
1575
|
+
);
|
|
1576
|
+
});
|
|
1577
|
+
[
|
|
1578
|
+
"capture",
|
|
1579
|
+
"download"
|
|
1580
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1581
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1582
|
+
// instead in the assignment below.
|
|
1583
|
+
].forEach((name) => {
|
|
1584
|
+
properties[name] = new PropertyInfoRecord(
|
|
1585
|
+
name,
|
|
1586
|
+
OVERLOADED_BOOLEAN,
|
|
1587
|
+
false,
|
|
1588
|
+
// mustUseProperty
|
|
1589
|
+
name,
|
|
1590
|
+
// attributeName
|
|
1591
|
+
null,
|
|
1592
|
+
// attributeNamespace
|
|
1593
|
+
false,
|
|
1594
|
+
// sanitizeURL
|
|
1595
|
+
false
|
|
1596
|
+
// removeEmptyString
|
|
1597
|
+
);
|
|
1598
|
+
});
|
|
1599
|
+
[
|
|
1600
|
+
"cols",
|
|
1601
|
+
"rows",
|
|
1602
|
+
"size",
|
|
1603
|
+
"span"
|
|
1604
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1605
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1606
|
+
// instead in the assignment below.
|
|
1607
|
+
].forEach((name) => {
|
|
1608
|
+
properties[name] = new PropertyInfoRecord(
|
|
1609
|
+
name,
|
|
1610
|
+
POSITIVE_NUMERIC,
|
|
1611
|
+
false,
|
|
1612
|
+
// mustUseProperty
|
|
1613
|
+
name,
|
|
1614
|
+
// attributeName
|
|
1615
|
+
null,
|
|
1616
|
+
// attributeNamespace
|
|
1617
|
+
false,
|
|
1618
|
+
// sanitizeURL
|
|
1619
|
+
false
|
|
1620
|
+
// removeEmptyString
|
|
1621
|
+
);
|
|
1622
|
+
});
|
|
1623
|
+
["rowSpan", "start"].forEach((name) => {
|
|
1624
|
+
properties[name] = new PropertyInfoRecord(
|
|
1625
|
+
name,
|
|
1626
|
+
NUMERIC,
|
|
1627
|
+
false,
|
|
1628
|
+
// mustUseProperty
|
|
1629
|
+
name.toLowerCase(),
|
|
1630
|
+
// attributeName
|
|
1631
|
+
null,
|
|
1632
|
+
// attributeNamespace
|
|
1633
|
+
false,
|
|
1634
|
+
// sanitizeURL
|
|
1635
|
+
false
|
|
1636
|
+
// removeEmptyString
|
|
1637
|
+
);
|
|
1638
|
+
});
|
|
1639
|
+
const CAMELIZE = /[\-\:]([a-z])/g;
|
|
1640
|
+
const capitalize = (token) => token[1].toUpperCase();
|
|
1641
|
+
[
|
|
1642
|
+
"accent-height",
|
|
1643
|
+
"alignment-baseline",
|
|
1644
|
+
"arabic-form",
|
|
1645
|
+
"baseline-shift",
|
|
1646
|
+
"cap-height",
|
|
1647
|
+
"clip-path",
|
|
1648
|
+
"clip-rule",
|
|
1649
|
+
"color-interpolation",
|
|
1650
|
+
"color-interpolation-filters",
|
|
1651
|
+
"color-profile",
|
|
1652
|
+
"color-rendering",
|
|
1653
|
+
"dominant-baseline",
|
|
1654
|
+
"enable-background",
|
|
1655
|
+
"fill-opacity",
|
|
1656
|
+
"fill-rule",
|
|
1657
|
+
"flood-color",
|
|
1658
|
+
"flood-opacity",
|
|
1659
|
+
"font-family",
|
|
1660
|
+
"font-size",
|
|
1661
|
+
"font-size-adjust",
|
|
1662
|
+
"font-stretch",
|
|
1663
|
+
"font-style",
|
|
1664
|
+
"font-variant",
|
|
1665
|
+
"font-weight",
|
|
1666
|
+
"glyph-name",
|
|
1667
|
+
"glyph-orientation-horizontal",
|
|
1668
|
+
"glyph-orientation-vertical",
|
|
1669
|
+
"horiz-adv-x",
|
|
1670
|
+
"horiz-origin-x",
|
|
1671
|
+
"image-rendering",
|
|
1672
|
+
"letter-spacing",
|
|
1673
|
+
"lighting-color",
|
|
1674
|
+
"marker-end",
|
|
1675
|
+
"marker-mid",
|
|
1676
|
+
"marker-start",
|
|
1677
|
+
"overline-position",
|
|
1678
|
+
"overline-thickness",
|
|
1679
|
+
"paint-order",
|
|
1680
|
+
"panose-1",
|
|
1681
|
+
"pointer-events",
|
|
1682
|
+
"rendering-intent",
|
|
1683
|
+
"shape-rendering",
|
|
1684
|
+
"stop-color",
|
|
1685
|
+
"stop-opacity",
|
|
1686
|
+
"strikethrough-position",
|
|
1687
|
+
"strikethrough-thickness",
|
|
1688
|
+
"stroke-dasharray",
|
|
1689
|
+
"stroke-dashoffset",
|
|
1690
|
+
"stroke-linecap",
|
|
1691
|
+
"stroke-linejoin",
|
|
1692
|
+
"stroke-miterlimit",
|
|
1693
|
+
"stroke-opacity",
|
|
1694
|
+
"stroke-width",
|
|
1695
|
+
"text-anchor",
|
|
1696
|
+
"text-decoration",
|
|
1697
|
+
"text-rendering",
|
|
1698
|
+
"underline-position",
|
|
1699
|
+
"underline-thickness",
|
|
1700
|
+
"unicode-bidi",
|
|
1701
|
+
"unicode-range",
|
|
1702
|
+
"units-per-em",
|
|
1703
|
+
"v-alphabetic",
|
|
1704
|
+
"v-hanging",
|
|
1705
|
+
"v-ideographic",
|
|
1706
|
+
"v-mathematical",
|
|
1707
|
+
"vector-effect",
|
|
1708
|
+
"vert-adv-y",
|
|
1709
|
+
"vert-origin-x",
|
|
1710
|
+
"vert-origin-y",
|
|
1711
|
+
"word-spacing",
|
|
1712
|
+
"writing-mode",
|
|
1713
|
+
"xmlns:xlink",
|
|
1714
|
+
"x-height"
|
|
1715
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1716
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1717
|
+
// instead in the assignment below.
|
|
1718
|
+
].forEach((attributeName) => {
|
|
1719
|
+
const name = attributeName.replace(CAMELIZE, capitalize);
|
|
1720
|
+
properties[name] = new PropertyInfoRecord(
|
|
1721
|
+
name,
|
|
1722
|
+
STRING,
|
|
1723
|
+
false,
|
|
1724
|
+
// mustUseProperty
|
|
1725
|
+
attributeName,
|
|
1726
|
+
null,
|
|
1727
|
+
// attributeNamespace
|
|
1728
|
+
false,
|
|
1729
|
+
// sanitizeURL
|
|
1730
|
+
false
|
|
1731
|
+
// removeEmptyString
|
|
1732
|
+
);
|
|
1733
|
+
});
|
|
1734
|
+
[
|
|
1735
|
+
"xlink:actuate",
|
|
1736
|
+
"xlink:arcrole",
|
|
1737
|
+
"xlink:role",
|
|
1738
|
+
"xlink:show",
|
|
1739
|
+
"xlink:title",
|
|
1740
|
+
"xlink:type"
|
|
1741
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1742
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1743
|
+
// instead in the assignment below.
|
|
1744
|
+
].forEach((attributeName) => {
|
|
1745
|
+
const name = attributeName.replace(CAMELIZE, capitalize);
|
|
1746
|
+
properties[name] = new PropertyInfoRecord(
|
|
1747
|
+
name,
|
|
1748
|
+
STRING,
|
|
1749
|
+
false,
|
|
1750
|
+
// mustUseProperty
|
|
1751
|
+
attributeName,
|
|
1752
|
+
"http://www.w3.org/1999/xlink",
|
|
1753
|
+
false,
|
|
1754
|
+
// sanitizeURL
|
|
1755
|
+
false
|
|
1756
|
+
// removeEmptyString
|
|
1757
|
+
);
|
|
1758
|
+
});
|
|
1759
|
+
[
|
|
1760
|
+
"xml:base",
|
|
1761
|
+
"xml:lang",
|
|
1762
|
+
"xml:space"
|
|
1763
|
+
// NOTE: if you add a camelCased prop to this list,
|
|
1764
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
1765
|
+
// instead in the assignment below.
|
|
1766
|
+
].forEach((attributeName) => {
|
|
1767
|
+
const name = attributeName.replace(CAMELIZE, capitalize);
|
|
1768
|
+
properties[name] = new PropertyInfoRecord(
|
|
1769
|
+
name,
|
|
1770
|
+
STRING,
|
|
1771
|
+
false,
|
|
1772
|
+
// mustUseProperty
|
|
1773
|
+
attributeName,
|
|
1774
|
+
"http://www.w3.org/XML/1998/namespace",
|
|
1775
|
+
false,
|
|
1776
|
+
// sanitizeURL
|
|
1777
|
+
false
|
|
1778
|
+
// removeEmptyString
|
|
1779
|
+
);
|
|
1780
|
+
});
|
|
1781
|
+
["tabIndex", "crossOrigin"].forEach((attributeName) => {
|
|
1782
|
+
properties[attributeName] = new PropertyInfoRecord(
|
|
1783
|
+
attributeName,
|
|
1784
|
+
STRING,
|
|
1785
|
+
false,
|
|
1786
|
+
// mustUseProperty
|
|
1787
|
+
attributeName.toLowerCase(),
|
|
1788
|
+
// attributeName
|
|
1789
|
+
null,
|
|
1790
|
+
// attributeNamespace
|
|
1791
|
+
false,
|
|
1792
|
+
// sanitizeURL
|
|
1793
|
+
false
|
|
1794
|
+
// removeEmptyString
|
|
1795
|
+
);
|
|
1796
|
+
});
|
|
1797
|
+
const xlinkHref = "xlinkHref";
|
|
1798
|
+
properties[xlinkHref] = new PropertyInfoRecord(
|
|
1799
|
+
"xlinkHref",
|
|
1800
|
+
STRING,
|
|
1801
|
+
false,
|
|
1802
|
+
// mustUseProperty
|
|
1803
|
+
"xlink:href",
|
|
1804
|
+
"http://www.w3.org/1999/xlink",
|
|
1805
|
+
true,
|
|
1806
|
+
// sanitizeURL
|
|
1807
|
+
false
|
|
1808
|
+
// removeEmptyString
|
|
1809
|
+
);
|
|
1810
|
+
["src", "href", "action", "formAction"].forEach((attributeName) => {
|
|
1811
|
+
properties[attributeName] = new PropertyInfoRecord(
|
|
1812
|
+
attributeName,
|
|
1813
|
+
STRING,
|
|
1814
|
+
false,
|
|
1815
|
+
// mustUseProperty
|
|
1816
|
+
attributeName.toLowerCase(),
|
|
1817
|
+
// attributeName
|
|
1818
|
+
null,
|
|
1819
|
+
// attributeNamespace
|
|
1820
|
+
true,
|
|
1821
|
+
// sanitizeURL
|
|
1822
|
+
true
|
|
1823
|
+
// removeEmptyString
|
|
1824
|
+
);
|
|
1825
|
+
});
|
|
1826
|
+
const {
|
|
1827
|
+
CAMELCASE,
|
|
1828
|
+
SAME,
|
|
1829
|
+
possibleStandardNames: possibleStandardNamesOptimized2
|
|
1830
|
+
} = requirePossibleStandardNamesOptimized();
|
|
1831
|
+
const ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
1832
|
+
const ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
1833
|
+
const isCustomAttribute = RegExp.prototype.test.bind(
|
|
1834
|
+
// eslint-disable-next-line no-misleading-character-class
|
|
1835
|
+
new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$")
|
|
1836
|
+
);
|
|
1837
|
+
const possibleStandardNames = Object.keys(
|
|
1838
|
+
possibleStandardNamesOptimized2
|
|
1839
|
+
).reduce((accumulator, standardName) => {
|
|
1840
|
+
const propName = possibleStandardNamesOptimized2[standardName];
|
|
1841
|
+
if (propName === SAME) {
|
|
1842
|
+
accumulator[standardName] = standardName;
|
|
1843
|
+
} else if (propName === CAMELCASE) {
|
|
1844
|
+
accumulator[standardName.toLowerCase()] = standardName;
|
|
1845
|
+
} else {
|
|
1846
|
+
accumulator[standardName] = propName;
|
|
1847
|
+
}
|
|
1848
|
+
return accumulator;
|
|
1849
|
+
}, {});
|
|
1850
|
+
lib.BOOLEAN = BOOLEAN;
|
|
1851
|
+
lib.BOOLEANISH_STRING = BOOLEANISH_STRING;
|
|
1852
|
+
lib.NUMERIC = NUMERIC;
|
|
1853
|
+
lib.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
|
|
1854
|
+
lib.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
|
|
1855
|
+
lib.RESERVED = RESERVED;
|
|
1856
|
+
lib.STRING = STRING;
|
|
1857
|
+
lib.getPropertyInfo = getPropertyInfo;
|
|
1858
|
+
lib.isCustomAttribute = isCustomAttribute;
|
|
1859
|
+
lib.possibleStandardNames = possibleStandardNames;
|
|
1860
|
+
return lib;
|
|
1861
|
+
}
|
|
1862
|
+
var utilities$1 = {};
|
|
1863
|
+
var cjs$1 = {};
|
|
1864
|
+
var inlineStyleParser;
|
|
1865
|
+
var hasRequiredInlineStyleParser;
|
|
1866
|
+
function requireInlineStyleParser() {
|
|
1867
|
+
if (hasRequiredInlineStyleParser) return inlineStyleParser;
|
|
1868
|
+
hasRequiredInlineStyleParser = 1;
|
|
1869
|
+
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
1870
|
+
var NEWLINE_REGEX = /\n/g;
|
|
1871
|
+
var WHITESPACE_REGEX = /^\s*/;
|
|
1872
|
+
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
1873
|
+
var COLON_REGEX = /^:\s*/;
|
|
1874
|
+
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
|
1875
|
+
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
1876
|
+
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
1877
|
+
var NEWLINE = "\n";
|
|
1878
|
+
var FORWARD_SLASH = "/";
|
|
1879
|
+
var ASTERISK = "*";
|
|
1880
|
+
var EMPTY_STRING = "";
|
|
1881
|
+
var TYPE_COMMENT = "comment";
|
|
1882
|
+
var TYPE_DECLARATION = "declaration";
|
|
1883
|
+
inlineStyleParser = function(style, options) {
|
|
1884
|
+
if (typeof style !== "string") {
|
|
1885
|
+
throw new TypeError("First argument must be a string");
|
|
1886
|
+
}
|
|
1887
|
+
if (!style) return [];
|
|
1888
|
+
options = options || {};
|
|
1889
|
+
var lineno = 1;
|
|
1890
|
+
var column = 1;
|
|
1891
|
+
function updatePosition(str) {
|
|
1892
|
+
var lines = str.match(NEWLINE_REGEX);
|
|
1893
|
+
if (lines) lineno += lines.length;
|
|
1894
|
+
var i = str.lastIndexOf(NEWLINE);
|
|
1895
|
+
column = ~i ? str.length - i : column + str.length;
|
|
1896
|
+
}
|
|
1897
|
+
function position() {
|
|
1898
|
+
var start = { line: lineno, column };
|
|
1899
|
+
return function(node2) {
|
|
1900
|
+
node2.position = new Position(start);
|
|
1901
|
+
whitespace();
|
|
1902
|
+
return node2;
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
function Position(start) {
|
|
1906
|
+
this.start = start;
|
|
1907
|
+
this.end = { line: lineno, column };
|
|
1908
|
+
this.source = options.source;
|
|
1909
|
+
}
|
|
1910
|
+
Position.prototype.content = style;
|
|
1911
|
+
function error(msg) {
|
|
1912
|
+
var err = new Error(
|
|
1913
|
+
options.source + ":" + lineno + ":" + column + ": " + msg
|
|
1914
|
+
);
|
|
1915
|
+
err.reason = msg;
|
|
1916
|
+
err.filename = options.source;
|
|
1917
|
+
err.line = lineno;
|
|
1918
|
+
err.column = column;
|
|
1919
|
+
err.source = style;
|
|
1920
|
+
if (options.silent) ;
|
|
1921
|
+
else {
|
|
1922
|
+
throw err;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
function match(re) {
|
|
1926
|
+
var m = re.exec(style);
|
|
1927
|
+
if (!m) return;
|
|
1928
|
+
var str = m[0];
|
|
1929
|
+
updatePosition(str);
|
|
1930
|
+
style = style.slice(str.length);
|
|
1931
|
+
return m;
|
|
1932
|
+
}
|
|
1933
|
+
function whitespace() {
|
|
1934
|
+
match(WHITESPACE_REGEX);
|
|
1935
|
+
}
|
|
1936
|
+
function comments(rules) {
|
|
1937
|
+
var c;
|
|
1938
|
+
rules = rules || [];
|
|
1939
|
+
while (c = comment()) {
|
|
1940
|
+
if (c !== false) {
|
|
1941
|
+
rules.push(c);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
return rules;
|
|
1945
|
+
}
|
|
1946
|
+
function comment() {
|
|
1947
|
+
var pos = position();
|
|
1948
|
+
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
|
1949
|
+
var i = 2;
|
|
1950
|
+
while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
|
|
1951
|
+
++i;
|
|
1952
|
+
}
|
|
1953
|
+
i += 2;
|
|
1954
|
+
if (EMPTY_STRING === style.charAt(i - 1)) {
|
|
1955
|
+
return error("End of comment missing");
|
|
1956
|
+
}
|
|
1957
|
+
var str = style.slice(2, i - 2);
|
|
1958
|
+
column += 2;
|
|
1959
|
+
updatePosition(str);
|
|
1960
|
+
style = style.slice(i);
|
|
1961
|
+
column += 2;
|
|
1962
|
+
return pos({
|
|
1963
|
+
type: TYPE_COMMENT,
|
|
1964
|
+
comment: str
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
function declaration() {
|
|
1968
|
+
var pos = position();
|
|
1969
|
+
var prop = match(PROPERTY_REGEX);
|
|
1970
|
+
if (!prop) return;
|
|
1971
|
+
comment();
|
|
1972
|
+
if (!match(COLON_REGEX)) return error("property missing ':'");
|
|
1973
|
+
var val = match(VALUE_REGEX);
|
|
1974
|
+
var ret = pos({
|
|
1975
|
+
type: TYPE_DECLARATION,
|
|
1976
|
+
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
|
1977
|
+
value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
|
|
1978
|
+
});
|
|
1979
|
+
match(SEMICOLON_REGEX);
|
|
1980
|
+
return ret;
|
|
1981
|
+
}
|
|
1982
|
+
function declarations() {
|
|
1983
|
+
var decls = [];
|
|
1984
|
+
comments(decls);
|
|
1985
|
+
var decl;
|
|
1986
|
+
while (decl = declaration()) {
|
|
1987
|
+
if (decl !== false) {
|
|
1988
|
+
decls.push(decl);
|
|
1989
|
+
comments(decls);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
return decls;
|
|
1993
|
+
}
|
|
1994
|
+
whitespace();
|
|
1995
|
+
return declarations();
|
|
1996
|
+
};
|
|
1997
|
+
function trim(str) {
|
|
1998
|
+
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
1999
|
+
}
|
|
2000
|
+
return inlineStyleParser;
|
|
2001
|
+
}
|
|
2002
|
+
var hasRequiredCjs$1;
|
|
2003
|
+
function requireCjs$1() {
|
|
2004
|
+
if (hasRequiredCjs$1) return cjs$1;
|
|
2005
|
+
hasRequiredCjs$1 = 1;
|
|
2006
|
+
var __importDefault = cjs$1 && cjs$1.__importDefault || function(mod) {
|
|
2007
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2008
|
+
};
|
|
2009
|
+
Object.defineProperty(cjs$1, "__esModule", { value: true });
|
|
2010
|
+
cjs$1.default = StyleToObject;
|
|
2011
|
+
var inline_style_parser_1 = __importDefault(requireInlineStyleParser());
|
|
2012
|
+
function StyleToObject(style, iterator) {
|
|
2013
|
+
var styleObject = null;
|
|
2014
|
+
if (!style || typeof style !== "string") {
|
|
2015
|
+
return styleObject;
|
|
2016
|
+
}
|
|
2017
|
+
var declarations = (0, inline_style_parser_1.default)(style);
|
|
2018
|
+
var hasIterator = typeof iterator === "function";
|
|
2019
|
+
declarations.forEach(function(declaration) {
|
|
2020
|
+
if (declaration.type !== "declaration") {
|
|
2021
|
+
return;
|
|
2022
|
+
}
|
|
2023
|
+
var property = declaration.property, value = declaration.value;
|
|
2024
|
+
if (hasIterator) {
|
|
2025
|
+
iterator(property, value, declaration);
|
|
2026
|
+
} else if (value) {
|
|
2027
|
+
styleObject = styleObject || {};
|
|
2028
|
+
styleObject[property] = value;
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
return styleObject;
|
|
2032
|
+
}
|
|
2033
|
+
return cjs$1;
|
|
2034
|
+
}
|
|
2035
|
+
var utilities = {};
|
|
2036
|
+
var hasRequiredUtilities$1;
|
|
2037
|
+
function requireUtilities$1() {
|
|
2038
|
+
if (hasRequiredUtilities$1) return utilities;
|
|
2039
|
+
hasRequiredUtilities$1 = 1;
|
|
2040
|
+
Object.defineProperty(utilities, "__esModule", { value: true });
|
|
2041
|
+
utilities.camelCase = void 0;
|
|
2042
|
+
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;
|
|
2043
|
+
var HYPHEN_REGEX = /-([a-z])/g;
|
|
2044
|
+
var NO_HYPHEN_REGEX = /^[^-]+$/;
|
|
2045
|
+
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
|
|
2046
|
+
var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
|
|
2047
|
+
var skipCamelCase = function(property) {
|
|
2048
|
+
return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
|
|
2049
|
+
};
|
|
2050
|
+
var capitalize = function(match, character) {
|
|
2051
|
+
return character.toUpperCase();
|
|
2052
|
+
};
|
|
2053
|
+
var trimHyphen = function(match, prefix) {
|
|
2054
|
+
return "".concat(prefix, "-");
|
|
2055
|
+
};
|
|
2056
|
+
var camelCase = function(property, options) {
|
|
2057
|
+
if (options === void 0) {
|
|
2058
|
+
options = {};
|
|
2059
|
+
}
|
|
2060
|
+
if (skipCamelCase(property)) {
|
|
2061
|
+
return property;
|
|
2062
|
+
}
|
|
2063
|
+
property = property.toLowerCase();
|
|
2064
|
+
if (options.reactCompat) {
|
|
2065
|
+
property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
|
|
2066
|
+
} else {
|
|
2067
|
+
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
|
|
2068
|
+
}
|
|
2069
|
+
return property.replace(HYPHEN_REGEX, capitalize);
|
|
2070
|
+
};
|
|
2071
|
+
utilities.camelCase = camelCase;
|
|
2072
|
+
return utilities;
|
|
2073
|
+
}
|
|
2074
|
+
var cjs;
|
|
2075
|
+
var hasRequiredCjs;
|
|
2076
|
+
function requireCjs() {
|
|
2077
|
+
if (hasRequiredCjs) return cjs;
|
|
2078
|
+
hasRequiredCjs = 1;
|
|
2079
|
+
var __importDefault = cjs && cjs.__importDefault || function(mod) {
|
|
2080
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2081
|
+
};
|
|
2082
|
+
var style_to_object_1 = __importDefault(requireCjs$1());
|
|
2083
|
+
var utilities_1 = requireUtilities$1();
|
|
2084
|
+
function StyleToJS(style, options) {
|
|
2085
|
+
var output = {};
|
|
2086
|
+
if (!style || typeof style !== "string") {
|
|
2087
|
+
return output;
|
|
2088
|
+
}
|
|
2089
|
+
(0, style_to_object_1.default)(style, function(property, value) {
|
|
2090
|
+
if (property && value) {
|
|
2091
|
+
output[(0, utilities_1.camelCase)(property, options)] = value;
|
|
2092
|
+
}
|
|
2093
|
+
});
|
|
2094
|
+
return output;
|
|
2095
|
+
}
|
|
2096
|
+
StyleToJS.default = StyleToJS;
|
|
2097
|
+
cjs = StyleToJS;
|
|
2098
|
+
return cjs;
|
|
2099
|
+
}
|
|
2100
|
+
var hasRequiredUtilities;
|
|
2101
|
+
function requireUtilities() {
|
|
2102
|
+
if (hasRequiredUtilities) return utilities$1;
|
|
2103
|
+
hasRequiredUtilities = 1;
|
|
2104
|
+
(function(exports) {
|
|
2105
|
+
var __importDefault = utilities$1 && utilities$1.__importDefault || function(mod) {
|
|
2106
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2107
|
+
};
|
|
2108
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2109
|
+
exports.returnFirstArg = exports.canTextBeChildOfNode = exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports.PRESERVE_CUSTOM_ATTRIBUTES = void 0;
|
|
2110
|
+
exports.isCustomComponent = isCustomComponent;
|
|
2111
|
+
exports.setStyleProp = setStyleProp;
|
|
2112
|
+
var react_1 = require$$0;
|
|
2113
|
+
var style_to_js_1 = __importDefault(requireCjs());
|
|
2114
|
+
var RESERVED_SVG_MATHML_ELEMENTS = /* @__PURE__ */ new Set([
|
|
2115
|
+
"annotation-xml",
|
|
2116
|
+
"color-profile",
|
|
2117
|
+
"font-face",
|
|
2118
|
+
"font-face-src",
|
|
2119
|
+
"font-face-uri",
|
|
2120
|
+
"font-face-format",
|
|
2121
|
+
"font-face-name",
|
|
2122
|
+
"missing-glyph"
|
|
2123
|
+
]);
|
|
2124
|
+
function isCustomComponent(tagName, props) {
|
|
2125
|
+
if (!tagName.includes("-")) {
|
|
2126
|
+
return Boolean(props && typeof props.is === "string");
|
|
2127
|
+
}
|
|
2128
|
+
if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) {
|
|
2129
|
+
return false;
|
|
2130
|
+
}
|
|
2131
|
+
return true;
|
|
2132
|
+
}
|
|
2133
|
+
var styleOptions = {
|
|
2134
|
+
reactCompat: true
|
|
2135
|
+
};
|
|
2136
|
+
function setStyleProp(style, props) {
|
|
2137
|
+
if (typeof style !== "string") {
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
if (!style.trim()) {
|
|
2141
|
+
props.style = {};
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
try {
|
|
2145
|
+
props.style = (0, style_to_js_1.default)(style, styleOptions);
|
|
2146
|
+
} catch (error) {
|
|
2147
|
+
props.style = {};
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
exports.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_1.version.split(".")[0]) >= 16;
|
|
2151
|
+
exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = /* @__PURE__ */ new Set([
|
|
2152
|
+
"tr",
|
|
2153
|
+
"tbody",
|
|
2154
|
+
"thead",
|
|
2155
|
+
"tfoot",
|
|
2156
|
+
"colgroup",
|
|
2157
|
+
"table",
|
|
2158
|
+
"head",
|
|
2159
|
+
"html",
|
|
2160
|
+
"frameset"
|
|
2161
|
+
]);
|
|
2162
|
+
var canTextBeChildOfNode = function(node2) {
|
|
2163
|
+
return !exports.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node2.name);
|
|
2164
|
+
};
|
|
2165
|
+
exports.canTextBeChildOfNode = canTextBeChildOfNode;
|
|
2166
|
+
var returnFirstArg = function(arg) {
|
|
2167
|
+
return arg;
|
|
2168
|
+
};
|
|
2169
|
+
exports.returnFirstArg = returnFirstArg;
|
|
2170
|
+
})(utilities$1);
|
|
2171
|
+
return utilities$1;
|
|
2172
|
+
}
|
|
2173
|
+
var hasRequiredAttributesToProps;
|
|
2174
|
+
function requireAttributesToProps() {
|
|
2175
|
+
if (hasRequiredAttributesToProps) return attributesToProps;
|
|
2176
|
+
hasRequiredAttributesToProps = 1;
|
|
2177
|
+
Object.defineProperty(attributesToProps, "__esModule", { value: true });
|
|
2178
|
+
attributesToProps.default = attributesToProps$1;
|
|
2179
|
+
var react_property_1 = requireLib$1();
|
|
2180
|
+
var utilities_1 = requireUtilities();
|
|
2181
|
+
var UNCONTROLLED_COMPONENT_ATTRIBUTES = ["checked", "value"];
|
|
2182
|
+
var UNCONTROLLED_COMPONENT_NAMES = ["input", "select", "textarea"];
|
|
2183
|
+
var valueOnlyInputs = {
|
|
2184
|
+
reset: true,
|
|
2185
|
+
submit: true
|
|
2186
|
+
};
|
|
2187
|
+
function attributesToProps$1(attributes, nodeName) {
|
|
2188
|
+
if (attributes === void 0) {
|
|
2189
|
+
attributes = {};
|
|
2190
|
+
}
|
|
2191
|
+
var props = {};
|
|
2192
|
+
var isInputValueOnly = Boolean(attributes.type && valueOnlyInputs[attributes.type]);
|
|
2193
|
+
for (var attributeName in attributes) {
|
|
2194
|
+
var attributeValue = attributes[attributeName];
|
|
2195
|
+
if ((0, react_property_1.isCustomAttribute)(attributeName)) {
|
|
2196
|
+
props[attributeName] = attributeValue;
|
|
2197
|
+
continue;
|
|
2198
|
+
}
|
|
2199
|
+
var attributeNameLowerCased = attributeName.toLowerCase();
|
|
2200
|
+
var propName = getPropName(attributeNameLowerCased);
|
|
2201
|
+
if (propName) {
|
|
2202
|
+
var propertyInfo = (0, react_property_1.getPropertyInfo)(propName);
|
|
2203
|
+
if (UNCONTROLLED_COMPONENT_ATTRIBUTES.includes(propName) && UNCONTROLLED_COMPONENT_NAMES.includes(nodeName) && !isInputValueOnly) {
|
|
2204
|
+
propName = getPropName("default" + attributeNameLowerCased);
|
|
2205
|
+
}
|
|
2206
|
+
props[propName] = attributeValue;
|
|
2207
|
+
switch (propertyInfo && propertyInfo.type) {
|
|
2208
|
+
case react_property_1.BOOLEAN:
|
|
2209
|
+
props[propName] = true;
|
|
2210
|
+
break;
|
|
2211
|
+
case react_property_1.OVERLOADED_BOOLEAN:
|
|
2212
|
+
if (attributeValue === "") {
|
|
2213
|
+
props[propName] = true;
|
|
2214
|
+
}
|
|
2215
|
+
break;
|
|
2216
|
+
}
|
|
2217
|
+
continue;
|
|
2218
|
+
}
|
|
2219
|
+
if (utilities_1.PRESERVE_CUSTOM_ATTRIBUTES) {
|
|
2220
|
+
props[attributeName] = attributeValue;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
(0, utilities_1.setStyleProp)(attributes.style, props);
|
|
2224
|
+
return props;
|
|
2225
|
+
}
|
|
2226
|
+
function getPropName(attributeName) {
|
|
2227
|
+
return react_property_1.possibleStandardNames[attributeName];
|
|
2228
|
+
}
|
|
2229
|
+
return attributesToProps;
|
|
2230
|
+
}
|
|
2231
|
+
var domToReact = {};
|
|
2232
|
+
var hasRequiredDomToReact;
|
|
2233
|
+
function requireDomToReact() {
|
|
2234
|
+
if (hasRequiredDomToReact) return domToReact;
|
|
2235
|
+
hasRequiredDomToReact = 1;
|
|
2236
|
+
var __importDefault = domToReact && domToReact.__importDefault || function(mod) {
|
|
2237
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2238
|
+
};
|
|
2239
|
+
Object.defineProperty(domToReact, "__esModule", { value: true });
|
|
2240
|
+
domToReact.default = domToReact$1;
|
|
2241
|
+
var react_1 = require$$0;
|
|
2242
|
+
var attributes_to_props_1 = __importDefault(requireAttributesToProps());
|
|
2243
|
+
var utilities_1 = requireUtilities();
|
|
2244
|
+
var React = {
|
|
2245
|
+
cloneElement: react_1.cloneElement,
|
|
2246
|
+
createElement: react_1.createElement,
|
|
2247
|
+
isValidElement: react_1.isValidElement
|
|
2248
|
+
};
|
|
2249
|
+
function domToReact$1(nodes, options) {
|
|
2250
|
+
if (options === void 0) {
|
|
2251
|
+
options = {};
|
|
2252
|
+
}
|
|
2253
|
+
var reactElements = [];
|
|
2254
|
+
var hasReplace = typeof options.replace === "function";
|
|
2255
|
+
var transform = options.transform || utilities_1.returnFirstArg;
|
|
2256
|
+
var _a = options.library || React, cloneElement = _a.cloneElement, createElement = _a.createElement, isValidElement = _a.isValidElement;
|
|
2257
|
+
var nodesLength = nodes.length;
|
|
2258
|
+
for (var index = 0; index < nodesLength; index++) {
|
|
2259
|
+
var node2 = nodes[index];
|
|
2260
|
+
if (hasReplace) {
|
|
2261
|
+
var replaceElement = options.replace(node2, index);
|
|
2262
|
+
if (isValidElement(replaceElement)) {
|
|
2263
|
+
if (nodesLength > 1) {
|
|
2264
|
+
replaceElement = cloneElement(replaceElement, {
|
|
2265
|
+
key: replaceElement.key || index
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
reactElements.push(transform(replaceElement, node2, index));
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (node2.type === "text") {
|
|
2273
|
+
var isWhitespace = !node2.data.trim().length;
|
|
2274
|
+
if (isWhitespace && node2.parent && !(0, utilities_1.canTextBeChildOfNode)(node2.parent)) {
|
|
2275
|
+
continue;
|
|
2276
|
+
}
|
|
2277
|
+
if (options.trim && isWhitespace) {
|
|
2278
|
+
continue;
|
|
2279
|
+
}
|
|
2280
|
+
reactElements.push(transform(node2.data, node2, index));
|
|
2281
|
+
continue;
|
|
2282
|
+
}
|
|
2283
|
+
var element = node2;
|
|
2284
|
+
var props = {};
|
|
2285
|
+
if (skipAttributesToProps(element)) {
|
|
2286
|
+
(0, utilities_1.setStyleProp)(element.attribs.style, element.attribs);
|
|
2287
|
+
props = element.attribs;
|
|
2288
|
+
} else if (element.attribs) {
|
|
2289
|
+
props = (0, attributes_to_props_1.default)(element.attribs, element.name);
|
|
2290
|
+
}
|
|
2291
|
+
var children = void 0;
|
|
2292
|
+
switch (node2.type) {
|
|
2293
|
+
case "script":
|
|
2294
|
+
case "style":
|
|
2295
|
+
if (node2.children[0]) {
|
|
2296
|
+
props.dangerouslySetInnerHTML = {
|
|
2297
|
+
__html: node2.children[0].data
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
break;
|
|
2301
|
+
case "tag":
|
|
2302
|
+
if (node2.name === "textarea" && node2.children[0]) {
|
|
2303
|
+
props.defaultValue = node2.children[0].data;
|
|
2304
|
+
} else if (node2.children && node2.children.length) {
|
|
2305
|
+
children = domToReact$1(node2.children, options);
|
|
2306
|
+
}
|
|
2307
|
+
break;
|
|
2308
|
+
// skip all other cases (e.g., comment)
|
|
2309
|
+
default:
|
|
2310
|
+
continue;
|
|
2311
|
+
}
|
|
2312
|
+
if (nodesLength > 1) {
|
|
2313
|
+
props.key = index;
|
|
2314
|
+
}
|
|
2315
|
+
reactElements.push(transform(createElement(node2.name, props, children), node2, index));
|
|
2316
|
+
}
|
|
2317
|
+
return reactElements.length === 1 ? reactElements[0] : reactElements;
|
|
2318
|
+
}
|
|
2319
|
+
function skipAttributesToProps(node2) {
|
|
2320
|
+
return utilities_1.PRESERVE_CUSTOM_ATTRIBUTES && node2.type === "tag" && (0, utilities_1.isCustomComponent)(node2.name, node2.attribs);
|
|
2321
|
+
}
|
|
2322
|
+
return domToReact;
|
|
2323
|
+
}
|
|
2324
|
+
var hasRequiredLib;
|
|
2325
|
+
function requireLib() {
|
|
2326
|
+
if (hasRequiredLib) return lib$3;
|
|
2327
|
+
hasRequiredLib = 1;
|
|
2328
|
+
(function(exports) {
|
|
2329
|
+
var __importDefault = lib$3 && lib$3.__importDefault || function(mod) {
|
|
2330
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2331
|
+
};
|
|
2332
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2333
|
+
exports.htmlToDOM = exports.domToReact = exports.attributesToProps = exports.Text = exports.ProcessingInstruction = exports.Element = exports.Comment = void 0;
|
|
2334
|
+
exports.default = HTMLReactParser2;
|
|
2335
|
+
var html_dom_parser_1 = __importDefault(requireHtmlToDom());
|
|
2336
|
+
exports.htmlToDOM = html_dom_parser_1.default;
|
|
2337
|
+
var attributes_to_props_1 = __importDefault(requireAttributesToProps());
|
|
2338
|
+
exports.attributesToProps = attributes_to_props_1.default;
|
|
2339
|
+
var dom_to_react_1 = __importDefault(requireDomToReact());
|
|
2340
|
+
exports.domToReact = dom_to_react_1.default;
|
|
2341
|
+
var domhandler_1 = /* @__PURE__ */ requireLib$2();
|
|
2342
|
+
Object.defineProperty(exports, "Comment", { enumerable: true, get: function() {
|
|
2343
|
+
return domhandler_1.Comment;
|
|
2344
|
+
} });
|
|
2345
|
+
Object.defineProperty(exports, "Element", { enumerable: true, get: function() {
|
|
2346
|
+
return domhandler_1.Element;
|
|
2347
|
+
} });
|
|
2348
|
+
Object.defineProperty(exports, "ProcessingInstruction", { enumerable: true, get: function() {
|
|
2349
|
+
return domhandler_1.ProcessingInstruction;
|
|
2350
|
+
} });
|
|
2351
|
+
Object.defineProperty(exports, "Text", { enumerable: true, get: function() {
|
|
2352
|
+
return domhandler_1.Text;
|
|
2353
|
+
} });
|
|
2354
|
+
var domParserOptions = { lowerCaseAttributeNames: false };
|
|
2355
|
+
function HTMLReactParser2(html, options) {
|
|
2356
|
+
if (typeof html !== "string") {
|
|
2357
|
+
throw new TypeError("First argument must be a string");
|
|
2358
|
+
}
|
|
2359
|
+
if (!html) {
|
|
2360
|
+
return [];
|
|
2361
|
+
}
|
|
2362
|
+
return (0, dom_to_react_1.default)((0, html_dom_parser_1.default)(html, (options === null || options === void 0 ? void 0 : options.htmlparser2) || domParserOptions), options);
|
|
2363
|
+
}
|
|
2364
|
+
})(lib$3);
|
|
2365
|
+
return lib$3;
|
|
2366
|
+
}
|
|
2367
|
+
var libExports = requireLib();
|
|
2368
|
+
const HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
|
|
2369
|
+
const parse = HTMLReactParser.default || HTMLReactParser;
|
|
2370
|
+
const renderInlineRichTextFromOpenText = (fromCms) => {
|
|
2371
|
+
if (typeof fromCms === "string") {
|
|
2372
|
+
return parse(fromCms);
|
|
2373
|
+
}
|
|
2374
|
+
if (Array.isArray(fromCms)) {
|
|
2375
|
+
return fromCms.map(renderInlineRichTextFromOpenText);
|
|
2376
|
+
}
|
|
2377
|
+
return fromCms;
|
|
2378
|
+
};
|
|
2379
|
+
export {
|
|
2380
|
+
libExports as l,
|
|
2381
|
+
parse as p,
|
|
2382
|
+
renderInlineRichTextFromOpenText as r
|
|
2383
|
+
};
|