@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
package/types/shim.d.ts DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * Which parts of a URL `location` carries — the one place that knows.
3
- *
4
- * `index.js` kept its own copy for `applyLocation`/`restoreLocation` to walk. They agreed, and
5
- * nothing made them: a part added to one list would be installed and never restored, or restored
6
- * from a property the install never wrote. Same single fact, same reasoning as `RAW_TEXT_ELEMENTS`
7
- * below it — CODE-PRINCIPLES #5.
8
- */
9
- export const LOCATION_PARTS: string[];
10
- export function installShims(): Map<any, any>;
11
- import { escapeHtml } from './escaping.js';
12
- import { escapeStyleText } from './escaping.js';
13
- import { escapeRawText } from './escaping.js';
14
- import { RAW_TEXT_ELEMENTS } from './escaping.js';
15
- import { hoistedStyles } from './stylesheets.js';
16
- import { beginHoisting } from './stylesheets.js';
17
- import { setRenderingTag } from './stylesheets.js';
18
- import { flushFrames } from './frames.js';
19
- import { flushFramesAsync } from './frames.js';
20
- import { registry } from './registry.js';
21
- import { pendingInstances } from './nodes.js';
22
- import { INSTANCE_ATTRIBUTE } from './nodes.js';
23
- export { escapeHtml, escapeStyleText, escapeRawText, RAW_TEXT_ELEMENTS, hoistedStyles, beginHoisting, setRenderingTag, flushFrames, flushFramesAsync, registry, pendingInstances, INSTANCE_ATTRIBUTE };
@@ -1,53 +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
- * `@scope (tag) { … }` styles hoisted by light-DOM components, **keyed by the component that
11
- * hoisted them** — the page shell embeds only the ones on the page it is building.
12
- *
13
- * A flat array here meant `renderToString` returned every style the *process* had ever hoisted, so
14
- * request two shipped request one's CSS and request fifty shipped everyone's. `adoptStyles` hoists
15
- * once per class by design, so it never grew without bound — it simply described the wrong page.
16
- */
17
- export const hoistedStyles: Map<any, any>;
18
- export function setRenderingTag(tag: any): string;
19
- export class StyleSheetShim {
20
- cssText: string;
21
- /**
22
- * **`cssText` is always a string**, because the platform's argument is a `USVString` and it
23
- * parses what it is given. Assigning the caller's value straight through left a number, an array
24
- * or a plain object sitting on `cssText`, which then reached the `<style>` block by concatenation
25
- * — so the wrong text appeared a long way from the call that caused it. Template coercion also
26
- * refuses a symbol with a `TypeError`, which is what every engine does
27
- * (`tests/browser/dom-string-coercion.test.js`).
28
- */
29
- replaceSync(cssText: any): void;
30
- /** The async spelling of the same thing; `adoptStyles` uses `replaceSync`, a component may not. */
31
- replace(cssText: any): Promise<this>;
32
- insertRule(rule: any): number;
33
- /**
34
- * There is no rule *list* — this holds the stylesheet as text, which is all the markup needs —
35
- * so a rule cannot be addressed by index. Deleting one is refused rather than silently ignored.
36
- */
37
- deleteRule(): void;
38
- /** The pre-standard spellings, which are still what some libraries reach for. */
39
- addRule(selector: any, style: any): number;
40
- removeRule(): void;
41
- get cssRules(): never[];
42
- get rules(): never[];
43
- get ownerRule(): null;
44
- get ownerNode(): null;
45
- get parentStyleSheet(): null;
46
- get href(): null;
47
- get title(): null;
48
- get media(): never[];
49
- get type(): string;
50
- disabled: boolean;
51
- }
52
- export function beginHoisting(): void;
53
- export function hoist(cssText: any): void;
package/types/views.d.ts DELETED
@@ -1,26 +0,0 @@
1
- export function datasetView(element: any): {};
2
- export function tokenListView(element: any, attribute: any): {
3
- add: (...names: any[]) => void;
4
- remove: (...names: any[]) => void;
5
- toggle: (name: any, force: any) => any;
6
- /** Replaces in place, and answers `false` without writing when the old token is not there. */
7
- replace: (oldToken: any, newToken: any) => boolean;
8
- contains: (name: any) => any;
9
- /**
10
- * `supports` throws for these two lists in every engine — `class` and `part` define no supported
11
- * tokens, and the spec says a `DOMTokenList` with none raises `TypeError`. Present and throwing
12
- * is the accurate shim; absent would be a `TypeError` too, but the wrong one.
13
- */
14
- supports: () => never;
15
- item: (index: any) => any;
16
- forEach: (callback: any, thisArg: any) => any;
17
- keys: () => any;
18
- values: () => any;
19
- entries: () => any;
20
- /** `String(el.classList)` is the attribute's value, not `[object Object]`. */
21
- toString: () => any;
22
- value: any;
23
- readonly length: any;
24
- [Symbol.iterator]: () => any;
25
- };
26
- export function styleView(element: any): {};