@verajs/ssr 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +510 -373
  2. package/dist/vera/diagnostics.d.ts +20 -0
  3. package/dist/vera/diagnostics.js +98 -0
  4. package/dist/vera/escaping.d.ts +142 -0
  5. package/dist/vera/escaping.js +267 -0
  6. package/dist/vera/events.d.ts +41 -0
  7. package/dist/vera/events.js +162 -0
  8. package/dist/vera/frames.d.ts +38 -0
  9. package/dist/vera/frames.js +195 -0
  10. package/dist/vera/index.d.ts +48 -0
  11. package/dist/vera/index.js +480 -0
  12. package/{types → dist/vera}/nodes.d.ts +397 -300
  13. package/dist/vera/nodes.js +2322 -0
  14. package/dist/vera/parse.d.ts +37 -0
  15. package/dist/vera/parse.js +390 -0
  16. package/dist/vera/reflections.d.ts +566 -0
  17. package/dist/vera/reflections.js +820 -0
  18. package/dist/vera/registry.d.ts +14 -0
  19. package/{src → dist}/vera/registry.js +5 -1
  20. package/dist/vera/report.d.ts +27 -0
  21. package/dist/vera/report.js +56 -0
  22. package/dist/vera/scan.d.ts +37 -0
  23. package/dist/vera/scan.js +143 -0
  24. package/dist/vera/select.d.ts +40 -0
  25. package/dist/vera/select.js +261 -0
  26. package/dist/vera/serializer.d.ts +39 -0
  27. package/dist/vera/serializer.js +1372 -0
  28. package/dist/vera/shim.d.ts +42 -0
  29. package/dist/vera/shim.js +853 -0
  30. package/dist/vera/slots.d.ts +5 -0
  31. package/dist/vera/slots.js +104 -0
  32. package/dist/vera/stylesheets.d.ts +62 -0
  33. package/dist/vera/stylesheets.js +180 -0
  34. package/dist/vera/tokenizer.d.ts +32 -0
  35. package/dist/vera/tokenizer.js +528 -0
  36. package/dist/vera/types.d.ts +117 -0
  37. package/dist/vera/views.d.ts +63 -0
  38. package/dist/vera/views.js +245 -0
  39. package/package.json +12 -13
  40. package/src/vera/escaping.js +0 -135
  41. package/src/vera/events.js +0 -164
  42. package/src/vera/frames.js +0 -102
  43. package/src/vera/index.js +0 -1171
  44. package/src/vera/nodes.js +0 -2270
  45. package/src/vera/parse.js +0 -381
  46. package/src/vera/reflections.js +0 -811
  47. package/src/vera/select.js +0 -234
  48. package/src/vera/serializer.js +0 -928
  49. package/src/vera/shim.js +0 -761
  50. package/src/vera/stylesheets.js +0 -155
  51. package/src/vera/views.js +0 -240
  52. package/types/escaping.d.ts +0 -27
  53. package/types/events.d.ts +0 -4
  54. package/types/frames.d.ts +0 -12
  55. package/types/index.d.ts +0 -13
  56. package/types/parse.d.ts +0 -19
  57. package/types/reflections.d.ts +0 -657
  58. package/types/registry.d.ts +0 -8
  59. package/types/select.d.ts +0 -5
  60. package/types/serializer.d.ts +0 -26
  61. package/types/shim.d.ts +0 -23
  62. package/types/stylesheets.d.ts +0 -53
  63. package/types/views.d.ts +0 -26
@@ -1,155 +0,0 @@
1
- /**
2
- * `CSSStyleSheet`, and the collection of styles a render hoists out of the components it touched.
3
- *
4
- * A component's CSS reaches the page two ways — a `<style>` element in its shadow root, serialized
5
- * with it, or a constructed sheet adopted into the document, which has no markup of its own. The
6
- * second is what `hoistedStyles` holds, keyed by the tag that was rendering when it was adopted, so
7
- * a page assembled from several islands can ship each component's CSS exactly once.
8
- */
9
-
10
- /**
11
- * `@scope (tag) { … }` styles hoisted by light-DOM components, **keyed by the component that
12
- * hoisted them** — the page shell embeds only the ones on the page it is building.
13
- *
14
- * A flat array here meant `renderToString` returned every style the *process* had ever hoisted, so
15
- * request two shipped request one's CSS and request fifty shipped everyone's. `adoptStyles` hoists
16
- * once per class by design, so it never grew without bound — it simply described the wrong page.
17
- */
18
- export const hoistedStyles = new Map();
19
-
20
- /**
21
- * Which component is rendering right now, so a hoist can be attributed to it.
22
- *
23
- * Sound because a render is synchronous end to end: `renderComponent` sets this, calls
24
- * `connectedCallback`, and reads the result, with no `await` anywhere in between. The only `await`
25
- * in the module is the `import()` that happens before any of this.
26
- */
27
- let renderingTag = '';
28
-
29
- export const setRenderingTag = (tag) => {
30
- const previous = renderingTag;
31
- renderingTag = tag;
32
- return previous;
33
- };
34
-
35
- export class StyleSheetShim {
36
- constructor() {
37
- this.cssText = '';
38
- }
39
- /**
40
- * **`cssText` is always a string**, because the platform's argument is a `USVString` and it
41
- * parses what it is given. Assigning the caller's value straight through left a number, an array
42
- * or a plain object sitting on `cssText`, which then reached the `<style>` block by concatenation
43
- * — so the wrong text appeared a long way from the call that caused it. Template coercion also
44
- * refuses a symbol with a `TypeError`, which is what every engine does
45
- * (`tests/browser/dom-string-coercion.test.js`).
46
- */
47
- replaceSync(cssText) {
48
- this.cssText = `${cssText}`;
49
- }
50
- /** The async spelling of the same thing; `adoptStyles` uses `replaceSync`, a component may not. */
51
- async replace(cssText) {
52
- this.replaceSync(cssText);
53
- return this;
54
- }
55
- insertRule(rule) {
56
- this.cssText += rule;
57
- return 0;
58
- }
59
- /**
60
- * There is no rule *list* — this holds the stylesheet as text, which is all the markup needs —
61
- * so a rule cannot be addressed by index. Deleting one is refused rather than silently ignored.
62
- */
63
- deleteRule() {
64
- throw new Error('ssr: CSSStyleSheet.deleteRule needs a parsed rule list; this sheet is text');
65
- }
66
- /** The pre-standard spellings, which are still what some libraries reach for. */
67
- addRule(selector, style) {
68
- this.insertRule(`${selector} { ${style ?? ''} }`);
69
- return -1;
70
- }
71
- removeRule() {
72
- this.deleteRule();
73
- }
74
- get cssRules() {
75
- return [];
76
- }
77
- get rules() {
78
- return this.cssRules;
79
- }
80
- get ownerRule() {
81
- return null;
82
- }
83
- get ownerNode() {
84
- return null;
85
- }
86
- get parentStyleSheet() {
87
- return null;
88
- }
89
- get href() {
90
- return null;
91
- }
92
- get title() {
93
- return null;
94
- }
95
- get media() {
96
- return [];
97
- }
98
- get type() {
99
- return 'text/css';
100
- }
101
- disabled = false;
102
- }
103
-
104
- /**
105
- * Which tags have been hoisted into during the render currently in progress.
106
- *
107
- * `@verajs/styles` hoists a light-DOM component's CSS **once per class, ever** — the second instance
108
- * adds nothing — so a tag's sheets are established by whichever render reached it first and have to
109
- * persist for every render after. That is why `hoistedStyles` is not simply cleared per render.
110
- *
111
- * A component that appends its own `<style>` on every render instead of using `static styles` had no
112
- * such guard, so its sheets accumulated **per process**: `hoistedStyles` grew without bound, and
113
- * because a render returns everything recorded against the tags it touched, request thirty shipped
114
- * thirty-four rules — thirty-three of them belonging to earlier requests. Other people's CSS in this
115
- * response, growing forever.
116
- */
117
- const hoistedThisRender = new Set();
118
-
119
- /** Called at the start of each render, so the once-per-class rule is enforced across requests. */
120
- export const beginHoisting = () => hoistedThisRender.clear();
121
-
122
- /** Records a hoisted sheet against whichever component is mid-render. */
123
- /** Warned once per tag, so a component hoisting per render says it once rather than every time. */
124
- const warnedAboutDrift = /* @__PURE__ */ new Set();
125
-
126
- export const hoist = (cssText) => {
127
- const sheets = hoistedStyles.get(renderingTag);
128
- /**
129
- * A tag established elsewhere keeps what it had: appending here would be a second hoist for a
130
- * class that has already been hoisted, which is the thing the rule forbids.
131
- */
132
- if (sheets && !hoistedThisRender.has(renderingTag)) {
133
- /**
134
- * **Silence here was the sharp edge.** A component whose CSS depends on the request — a theme,
135
- * a colour from a prop — has that variation dropped: whichever render arrived first set this
136
- * tag's sheets for the life of the process, and every later request quietly serves those. The
137
- * rule is deliberate and stays, because a per-class sheet emitted per instance is what it exists
138
- * to prevent. What was wrong was that nothing said so.
139
- */
140
- if (!sheets.includes(cssText) && !warnedAboutDrift.has(renderingTag)) {
141
- warnedAboutDrift.add(renderingTag);
142
- console.warn(
143
- `[vera] ssr: <${renderingTag}> hoisted different CSS than it did on an earlier render, and ` +
144
- `the new stylesheet was dropped. A tag's styles are established once per class for the ` +
145
- `life of the process, so CSS that varies per request cannot be hoisted — put the varying ` +
146
- `part in an inline style or a custom property instead.`
147
- );
148
- }
149
- return;
150
- }
151
- hoistedThisRender.add(renderingTag);
152
- const list = sheets ?? [];
153
- if (!list.includes(cssText)) list.push(cssText);
154
- hoistedStyles.set(renderingTag, list);
155
- };
package/src/vera/views.js DELETED
@@ -1,240 +0,0 @@
1
- /**
2
- * The element properties that are a *view of an attribute* — `dataset`, `style`, `classList`, `part`.
3
- *
4
- * Each returns an object whose every write goes through to the attribute it reflects, because a
5
- * plain object would accept `this.dataset.x = 'y'` and lose it. Shared from here rather than written
6
- * per class: `classList` and `part` are one token list over two attribute names, and having them as
7
- * two copies is how the shims drifted apart the first time.
8
- */
9
-
10
- /** `backgroundColor` -> `background-color`, for the `style` and `dataset` views below. */
11
- const dashed = (name) => name.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase());
12
-
13
- /**
14
- * `dataset` and `style` are **views over an attribute**, not stores of their own: an assignment that
15
- * does not reach the markup is an assignment the server loses. Written as proxies over the element
16
- * so `this.dataset.userId = '7'` and `this.style.color = 'red'` end up in the tag, which is what
17
- * they do in a browser.
18
- */
19
- export const datasetView = (element) =>
20
- new Proxy(
21
- {},
22
- {
23
- get: (_, key) => element.getAttribute(`data-${dashed(String(key))}`) ?? undefined,
24
- set: (_, key, value) => (element.setAttribute(`data-${dashed(String(key))}`, value), true),
25
- deleteProperty: (_, key) => (element.removeAttribute(`data-${dashed(String(key))}`), true),
26
- has: (_, key) => element.hasAttribute(`data-${dashed(String(key))}`),
27
- }
28
- );
29
-
30
- /**
31
- * A `DOMTokenList` over a space-separated attribute — `class` for `classList`, `part` for `part`.
32
- *
33
- * Shared because they are the same thing: `classList` was written first and `part` would have been
34
- * a second copy of it, which is how `ElementShim` and `ShadowRootShim` came to disagree.
35
- */
36
- export const tokenListView = (element, attribute) => {
37
- const tokens = () => (element.getAttribute(attribute) ?? '').split(/\s+/).filter(Boolean);
38
- /**
39
- * **Emptying an attribute is not removing it.** A browser leaves `class=""` behind when the last
40
- * token goes, and only leaves the attribute absent when it was never there to begin with. Removing
41
- * it outright made the server's markup differ from the client's for an element that had ever
42
- * carried a class, which is the whole class of difference this package exists not to produce.
43
- */
44
- const write = (list) => {
45
- if (list.length) element.setAttribute(attribute, list.join(' '));
46
- else if (element.hasAttribute(attribute)) element.setAttribute(attribute, '');
47
- };
48
- /**
49
- * A token has to be a token. A browser throws on an empty string and on one containing whitespace,
50
- * with those two names, and it is worth throwing here for the same reason `connectedCallback` is
51
- * refused when it is `async`: code that cannot work in the browser should not quietly work here.
52
- */
53
- const check = (...names) => {
54
- for (const name of names) {
55
- if (name === '') throw new DOMException('The token provided must not be empty.', 'SyntaxError');
56
- if (/\s/.test(String(name)))
57
- throw new DOMException(
58
- `The token provided ('${name}') contains HTML space characters, which are not valid in tokens.`,
59
- 'InvalidCharacterError'
60
- );
61
- }
62
- };
63
- const list = {
64
- add: (...names) => {
65
- check(...names);
66
- const current = tokens();
67
- for (const name of names) if (!current.includes(name)) current.push(name);
68
- write(current);
69
- },
70
- remove: (...names) => {
71
- check(...names);
72
- write(tokens().filter((token) => !names.includes(token)));
73
- },
74
- toggle: (name, force) => {
75
- check(name);
76
- const current = tokens();
77
- const wanted = force ?? !current.includes(name);
78
- write(
79
- wanted ? [...current.filter((token) => token !== name), name] : current.filter((token) => token !== name)
80
- );
81
- return wanted;
82
- },
83
- /** Replaces in place, and answers `false` without writing when the old token is not there. */
84
- replace: (oldToken, newToken) => {
85
- check(oldToken, newToken);
86
- const current = tokens();
87
- const at = current.indexOf(oldToken);
88
- if (at === -1) return false;
89
- current[at] = newToken;
90
- write(current.filter((token, index) => current.indexOf(token) === index));
91
- return true;
92
- },
93
- contains: (name) => tokens().includes(name),
94
- /**
95
- * `supports` throws for these two lists in every engine — `class` and `part` define no supported
96
- * tokens, and the spec says a `DOMTokenList` with none raises `TypeError`. Present and throwing
97
- * is the accurate shim; absent would be a `TypeError` too, but the wrong one.
98
- */
99
- supports: () => {
100
- throw new TypeError('supports() is not applicable to this attribute.');
101
- },
102
- item: (index) => tokens()[index] ?? null,
103
- forEach: (callback, thisArg) => tokens().forEach(callback, thisArg),
104
- keys: () => tokens().keys(),
105
- values: () => tokens().values(),
106
- entries: () => tokens().entries(),
107
- /** `String(el.classList)` is the attribute's value, not `[object Object]`. */
108
- toString: () => element.getAttribute(attribute) ?? '',
109
- get value() {
110
- return element.getAttribute(attribute) ?? '';
111
- },
112
- set value(text) {
113
- element.setAttribute(attribute, String(text));
114
- },
115
- get length() {
116
- return tokens().length;
117
- },
118
- [Symbol.iterator]: () => tokens()[Symbol.iterator](),
119
- };
120
- /** `list[0]` is indexed access on a real `DOMTokenList`, which a plain object cannot answer. */
121
- return new Proxy(list, {
122
- get: (target, key, receiver) =>
123
- typeof key === 'string' && /^\d+$/.test(key) ? tokens()[Number(key)] : Reflect.get(target, key, receiver),
124
- has: (target, key) => (typeof key === 'string' && /^\d+$/.test(key) ? Number(key) < tokens().length : key in target),
125
- });
126
- };
127
-
128
- /**
129
- * The declarations in a `style` attribute, split on the semicolons that actually separate them.
130
- *
131
- * **A plain `split(';')` corrupts a value that contains one**, and the common case is not exotic:
132
- * `background: url("data:image/svg+xml;base64,…")` is how an inline SVG is written, and splitting it
133
- * produced `background: url("data:image/svg+xml` as one declaration and `base64,…")` as another —
134
- * so the *markup* came out as `background: url("data:x; color: red;`, an unterminated `url(` with
135
- * the rest of the declaration eaten. A quoted `;` in `content` did the same.
136
- *
137
- * Quotes and parentheses both nest a semicolon, and CSS allows one inside either.
138
- */
139
- const declarations = (text) => {
140
- const out = [];
141
- let start = 0;
142
- let depth = 0;
143
- let quote = '';
144
- for (let at = 0; at < text.length; at++) {
145
- const ch = text[at];
146
- if (quote) {
147
- if (ch === '\\') at++;
148
- else if (ch === quote) quote = '';
149
- } else if (ch === '"' || ch === "'") quote = ch;
150
- else if (ch === '(') depth++;
151
- else if (ch === ')' && depth > 0) depth--;
152
- else if (ch === ';' && depth === 0) {
153
- out.push(text.slice(start, at));
154
- start = at + 1;
155
- }
156
- }
157
- out.push(text.slice(start));
158
- return out;
159
- };
160
-
161
- export const styleView = (element) => {
162
- /** `[name, value, priority]` per declaration, in source order. */
163
- const read = () => {
164
- /**
165
- * A loop rather than `map().filter(Boolean)`: the filter does not narrow, so the entries reach
166
- * `new Map` typed as `(any[] | null)[]` and `checkJs` rejects them. Building the map directly
167
- * says the same thing without a cast.
168
- */
169
- const rules = new Map();
170
- for (const rule of declarations(element.getAttribute('style') ?? '')) {
171
- const at = rule.indexOf(':');
172
- if (at === -1) continue;
173
- const name = rule.slice(0, at).trim();
174
- let value = rule.slice(at + 1).trim();
175
- let priority = '';
176
- const important = /\s*!\s*important$/i.exec(value);
177
- if (important) {
178
- value = value.slice(0, important.index).trim();
179
- priority = 'important';
180
- }
181
- if (name && value) rules.set(name, { value, priority });
182
- }
183
- return rules;
184
- };
185
- /**
186
- * Each declaration ends in a semicolon, including the last, because that is what a browser writes
187
- * into the attribute when you set a property — `style.color = 'red'` gives `style="color: red;"`.
188
- * Dropping the final one made every component that styles itself disagree with the client on its
189
- * own host attribute.
190
- *
191
- * An emptied `style` stays as `style=""` rather than being removed, for the reason the token list
192
- * above does the same: a browser removes the declarations, not the attribute.
193
- */
194
- const write = (rules) => {
195
- const text = [...rules]
196
- .map(([name, { value, priority }]) => `${name}: ${value}${priority ? ' !important' : ''};`)
197
- .join(' ');
198
- if (text) element.setAttribute('style', text);
199
- else if (element.hasAttribute('style')) element.setAttribute('style', '');
200
- };
201
- /** A custom property keeps its name verbatim; everything else is camel-cased in JS and dashed in CSS. */
202
- const cssName = (key) => (key.startsWith('--') ? key : dashed(key));
203
- const methods = {
204
- setProperty: (name, value, priority = '') =>
205
- write(read().set(cssName(String(name)), { value: String(value), priority: priority ? 'important' : '' })),
206
- removeProperty: (name) => {
207
- const rules = read();
208
- const key = cssName(String(name));
209
- const previous = rules.get(key)?.value ?? '';
210
- rules.delete(key);
211
- write(rules);
212
- return previous;
213
- },
214
- getPropertyValue: (name) => read().get(cssName(String(name)))?.value ?? '',
215
- getPropertyPriority: (name) => read().get(cssName(String(name)))?.priority ?? '',
216
- item: (index) => [...read().keys()][index] ?? '',
217
- };
218
- return new Proxy(
219
- {},
220
- {
221
- get: (_, key) => {
222
- if (key === 'cssText') return element.getAttribute('style') ?? '';
223
- if (key === 'length') return read().size;
224
- if (key in methods) return methods[key];
225
- if (typeof key === 'string' && /^\d+$/.test(key)) return methods.item(Number(key));
226
- return read().get(cssName(String(key)))?.value ?? '';
227
- },
228
- set: (_, key, value) => {
229
- /** Round-tripped rather than stored verbatim, so `cssText = 'color: red'` normalises the way a browser does. */
230
- if (key === 'cssText') {
231
- element.setAttribute('style', String(value));
232
- write(read());
233
- } else if (value === '' || value == null) methods.removeProperty(String(key));
234
- else write(read().set(cssName(String(key)), { value: String(value), priority: '' }));
235
- return true;
236
- },
237
- has: (_, key) => key === 'cssText' || key === 'length' || key in methods || read().has(cssName(String(key))),
238
- }
239
- );
240
- };
@@ -1,27 +0,0 @@
1
- export function escapeHtml(value: any): string;
2
- export function escapeStyleText(value: any): string;
3
- export function escapeRawText(value: any, tag: any): string;
4
- /**
5
- * Elements whose content is text rather than markup. Setting `textContent` on one of these stores
6
- * the text as written: inside `<style>` or `<script>` a character reference is **not** decoded, so
7
- * escaping there does not protect anything and does corrupt the content.
8
- */
9
- /**
10
- * Elements a parser reads the children of as text.
11
- *
12
- * `iframe` and `noscript` were absent, so this DOM built a tree no browser builds:
13
- * `<noscript><img src="x"></noscript>` parsed to an element here and `querySelectorAll('noscript img')`
14
- * answered **1** where every engine answers 0, because the content is a text node.
15
- *
16
- * Measured across Chromium, Firefox and WebKit rather than read off a spec — and jsdom is not the
17
- * oracle for this one. It parses with scripting *disabled*, so it agrees with the old list about
18
- * `noscript` and all three real engines disagree with both.
19
- */
20
- export const RAW_TEXT_ELEMENTS: Set<string>;
21
- /**
22
- * Elements that have no end tag. Writing one is not merely redundant — a parser reads `</br>` as
23
- * *another* `<br>`, so `appendChild(createElement('br'))` served `<br></br>` and rendered two line
24
- * breaks where the client has one. The same content assigned as a markup string was already correct,
25
- * so the two paths disagreed with each other as well as with the browser.
26
- */
27
- export const VOID_ELEMENTS: Set<string>;
package/types/events.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export function pathFrom(node: any, composed: boolean): any[];
2
- export function addListener(node: any, type: any, callback: any, options: any): void;
3
- export function removeListener(node: any, type: any, callback: any, options: any): void;
4
- export function dispatch(node: any, event: any): boolean;
package/types/frames.d.ts DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * `requestAnimationFrame` on a machine that has no frames.
3
- *
4
- * A server render is one shot: nothing scheduled after the markup is built can reach it. Callbacks
5
- * are queued here and drained by `flushFrames` once a component's `connectedCallback` has returned,
6
- * which is where a browser would run them — deferring is what makes a component's own ordering hold,
7
- * and draining *repeatedly* is what makes the markup match where the client settles.
8
- */
9
- /** Callbacks awaiting a frame that will not arrive on its own. See `flushFrames`. */
10
- export const frames: any[];
11
- export function flushFrames(report: any): void;
12
- export function flushFramesAsync(report: any): Promise<void>;
package/types/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export function renderToString(url: any, options?: object): Promise<{
2
- html: string;
3
- styles: string;
4
- title: string;
5
- }>;
6
- export function renderToStringAsync(url: any, options?: object): Promise<{
7
- html: string;
8
- styles: string;
9
- title: string;
10
- }>;
11
- import { registry } from './shim.js';
12
- import { serializeTemplate } from './serializer.js';
13
- export { registry, serializeTemplate };
package/types/parse.d.ts DELETED
@@ -1,19 +0,0 @@
1
- export function decode(text: any): any;
2
- /**
3
- * **The attribute-name charset, owned here and shared.** Everything a start tag can carry as a
4
- * name: anything that is not whitespace, `/`, `>`, `=`, a quote, or `<`. Deliberately WIDE — every
5
- * real engine accepts `a.b`, `a(b)`, `a|b` and `a?b` (recorded in the repo's conventions), so a
6
- * narrower charset does not reject those names, it MIS-PARSES them.
7
- *
8
- * Exported because `index.js` scans the same grammar when it rebuilds a nested component from the
9
- * open tag this module wrote. It kept its own `[\w:-]+` copy, which split `data-a.b="v"` into
10
- * `data-a=""` and `b="v"` — the child then read the wrong attributes, server-side only (arc-2
11
- * run 2). Same fact, two spellings, one of them wrong: CODE-PRINCIPLES #5, and the same fix
12
- * `RAW_TEXT_ELEMENTS` already got in this package.
13
- */
14
- export const ATTRIBUTE_NAME: "[^\\s/>=\"'<]+";
15
- export function parseFragment(markup: string, create: {
16
- element: (name: string) => any;
17
- text: (data: string) => any;
18
- comment: (data: string) => any;
19
- }): Array<any> | null;