full site update
This commit is contained in:
383
node_modules/ultrahtml/CHANGELOG.md
generated
vendored
Normal file
383
node_modules/ultrahtml/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,383 @@
|
||||
# ultrahtml
|
||||
|
||||
## 1.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 124e573: Adds a new `transformSync` function, a synchronous alternative to the `transform` function. This can be used when there are no `async` transformer functions.
|
||||
|
||||
```js
|
||||
import { transformSync, html } from "ultrahtml";
|
||||
import swap from "ultrahtml/transformers/swap";
|
||||
|
||||
const output = transformSync(`<h1>Hello world!</h1>`, [
|
||||
swap({
|
||||
h1: "h2",
|
||||
}),
|
||||
]);
|
||||
|
||||
console.log(output); // <h2>Hello world!</h2>
|
||||
```
|
||||
|
||||
- f0a1da3: Adds a new `unblockElements` option to the `sanitize` transformer. This option makes it easier to remove all or most HTML from a string without dropping child content.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- f0a1da3: Fixes sanitization of nested elements.
|
||||
|
||||
For example, the following code:
|
||||
|
||||
```js
|
||||
const output = await transform("<h1>Hello <strong>world!</strong></h1>", [
|
||||
sanitize({ blockElements: ["h1", "strong"] }),
|
||||
]);
|
||||
```
|
||||
|
||||
produced the following output before this fix:
|
||||
|
||||
```html
|
||||
Hello <strong>world!</strong>
|
||||
```
|
||||
|
||||
and now correctly produces:
|
||||
|
||||
```html
|
||||
Hello world!
|
||||
```
|
||||
|
||||
- e8aee16: Improve parser performance for attributes
|
||||
- 8388fe7: Updates internal dependency on `esbuild`
|
||||
|
||||
## 1.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ebc97e0: upgrades `dts-bundle-generator` to `9.2.1`, fixing an issue with `.d.ts`
|
||||
generation which led methods prefixed with two underscores to be
|
||||
incorrectly made private in the generated declaration file.
|
||||
|
||||
## 1.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 244be0a: Update `parsel-js` to latest
|
||||
|
||||
## 1.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a989b5a: Bundle type definitions in `.d.ts` files
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 7c93190: Add support for static media queries to `ultrahtml/transformers/inline`.
|
||||
|
||||
You may now pass an `env` value to the transformer, for example:
|
||||
|
||||
```js
|
||||
import { transform } from "ultrahtml";
|
||||
import inline from "ultrahtml/transformers/inline";
|
||||
|
||||
const output = await transform(input, [
|
||||
// Acts as if the screen is 960px wide and 1280px tall
|
||||
inline({ env: { width: 960, height: 1280 } }),
|
||||
]);
|
||||
```
|
||||
|
||||
## 1.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 8bbaeef: Allow elements inside of `<svg>` to be self-closing for compactness
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5715bc3: Fix `sanitize` transformer behavior when only using `allowElements`
|
||||
|
||||
## 1.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 0556b19: Add `renderSync` export
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3362aa2: Add `main` entrypoint
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 7792f5d: Add `useObjectSyntax` option to inline transformer. Note that this option is currently not compatible with `transform`
|
||||
|
||||
## 1.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- d910619: Remove `resolveAsset` option from `inline` transformer, making it synchronous again.
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c5799aa: Update attribute handling to account for attributes with newlines
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- d7cb17d: Fix another edge case with text inside script/styles
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c7a1ef6: Fix edge case with `<script>` parsing
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b136e51: Fix unhandled edge case with `sanitize` transformer
|
||||
- dce0b68: Fix style and script elements having their contents parsed as HTML
|
||||
|
||||
## 1.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 95c0f73: `ultrahtml` is a complete markup toolkit with a tiny footprint. Parse, transform, and render HTML on the server, in the browser, with or without a build step.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
The signature of `transform` has been updated. Rather than applying sanitization and component swapping by default, these have been split out to individual `ultrahtml/transformers` that can be applied modularly.
|
||||
|
||||
In `ultrahtml@0.x`, `transform` accepted an options object with `sanitize` and `components`. Other transformations would need to be applied outside of this flow.
|
||||
|
||||
```js
|
||||
import { transform } from "ultrahtml";
|
||||
|
||||
await transform(markup, {
|
||||
components: { h1: "h2" },
|
||||
sanitize: { allowElements: ["h1", "h2", "h3"] },
|
||||
});
|
||||
```
|
||||
|
||||
In `ultrahtml@1.x`, `transform` accepts an array of transformers to apply. The `sanitize` and `components` options can be handled with the built-in transformers named `sanitize` and `swap`.
|
||||
|
||||
```js
|
||||
import { transform } from "ultrahtml";
|
||||
import swap from "ultrahtml/transformers/swap";
|
||||
import sanitize from "ultrahtml/transformers/sanitize";
|
||||
|
||||
await transform(markup, [
|
||||
swap({ h1: "h2" }),
|
||||
sanitize({ allowElements: ["h1", "h2", "h3"] }),
|
||||
]);
|
||||
```
|
||||
|
||||
## New Features
|
||||
|
||||
### JSX Runtime
|
||||
|
||||
`ultrahtml` now comes with `h` and `Fragment` functions for JSX, as well as a `jsx-runtime` export.
|
||||
|
||||
### Tranformers
|
||||
|
||||
Transformers are AST transformations that can be applied to any `ultrahtml` Node. Usually these are applied to entire documents.
|
||||
|
||||
**New** `inline` transformer inlines CSS from `<style>` blocks directly to matching elements.
|
||||
|
||||
**New** `scope` transformer scopes CSS from `<style>` blocks to the elements in a given document or component.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4699020: Update JSX runtime child handling
|
||||
- da119c1: Fix transformer definitions
|
||||
- d29a0e2: Add `resolveAsset` option to the `inline` transformer
|
||||
- 401b13a: Fix JSX runtime types
|
||||
- 44a771e: Update list of void HTML tags
|
||||
|
||||
## 1.0.0-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- d29a0e2: Add `resolveAsset` option to the `inline` transformer
|
||||
|
||||
## 1.0.0-next.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4699020: Update JSX runtime child handling
|
||||
|
||||
## 1.0.0-next.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 401b13a: Fix JSX runtime types
|
||||
|
||||
## 1.0.0-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- da119c1: Fix transformer definitions
|
||||
|
||||
## 1.0.0-next.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 95c0f73: `ultrahtml` is a complete markup toolkit with a tiny footprint. Parse, transform, and render HTML on the server, in the browser, with or without a build step.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
The signature of `transform` has been updated. Rather than applying sanitization and component swapping by default, these have been split out to individual `ultrahtml/transformers` that can be applied modularly.
|
||||
|
||||
In `ultrahtml@0.x`, `transform` accepted an options object with `sanitize` and `components`. Other transformations would need to be applied outside of this flow.
|
||||
|
||||
```js
|
||||
import { transform } from "ultrahtml";
|
||||
|
||||
await transform(markup, {
|
||||
components: { h1: "h2" },
|
||||
sanitize: { allowElements: ["h1", "h2", "h3"] },
|
||||
});
|
||||
```
|
||||
|
||||
In `ultrahtml@1.x`, `transform` accepts an array of transformers to apply. The `sanitize` and `components` options can be handled with the built-in transformers named `sanitize` and `swap`.
|
||||
|
||||
```js
|
||||
import { transform } from "ultrahtml";
|
||||
import swap from "ultrahtml/transformers/swap";
|
||||
import sanitize from "ultrahtml/transformers/sanitize";
|
||||
|
||||
await transform(markup, [
|
||||
swap({ h1: "h2" }),
|
||||
sanitize({ allowElements: ["h1", "h2", "h3"] }),
|
||||
]);
|
||||
```
|
||||
|
||||
## New Features
|
||||
|
||||
### JSX Runtime
|
||||
|
||||
`ultrahtml` now comes with `h` and `Fragment` functions for JSX, as well as a `jsx-runtime` export.
|
||||
|
||||
### Tranformers
|
||||
|
||||
Transformers are AST transformations that can be applied to any `ultrahtml` Node. Usually these are applied to entire documents.
|
||||
|
||||
**New** `inline` transformer inlines CSS from `<style>` blocks directly to matching elements.
|
||||
|
||||
**New** `scope` transformer scopes CSS from `<style>` blocks to the elements in a given document or component.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 83c2e35: Improve declarations for node types
|
||||
|
||||
## 0.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3b8fb6e: Remove bundledDependencies field
|
||||
|
||||
## 0.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 74010dd: Bundle parsel-js to avoid ESM/CJS issues
|
||||
- d7b514d: Fix CJS compat issue (again)
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a105c5e: Fix CJS compat issue
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 2de70f3: Add `ultrahtml/selector` module which exports `querySelector`, `querySelectorAll`, and `matches` functions.
|
||||
|
||||
To use `querySelectorAll`, pass the root `Node` as the first argument and any valid CSS selector as the second argument. Note that if a CSS selector you need is not yet implemented, you are invited to [open an issue](https://github.com/natemoo-re/ultrahtml/issues).
|
||||
|
||||
```js
|
||||
import { parse } from "ultrahtml";
|
||||
import { querySelectorAll, matches } from "ultrahtml/selector";
|
||||
|
||||
const doc = parse(`
|
||||
<html>
|
||||
<head>
|
||||
<title>Demo</title>
|
||||
/head>
|
||||
<body>
|
||||
<h1>Hello world!</h1>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
const h1 = querySelector(doc, "h1");
|
||||
const match = matches(h1, "h1");
|
||||
```
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 037711f: Update types
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 97b297f: Add `walkSync` export
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 123f7ea: Fix custom elements transform.
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 758bbba: Improve documentation
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 2f92e93: Export node types
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 517e24d: Fix edge cases with text node detection, refactor for compactness
|
||||
|
||||
## 0.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 23771a3: Fix `walk` function definition
|
||||
|
||||
## 0.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4d082b3: Ensure types are included
|
||||
|
||||
## 0.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e0e8a2b: Add `__unsafeHTML` export
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- f6e3a71: Support async components
|
35
node_modules/ultrahtml/LICENSE
generated
vendored
Normal file
35
node_modules/ultrahtml/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
MIT License Copyright (c) 2022 Nate Moore
|
||||
|
||||
Permission is hereby granted, free of
|
||||
charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
(including the next paragraph) shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
Portions of this code were borrowed from https://github.com/developit/htmlParser
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Jason Miller
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
119
node_modules/ultrahtml/README.md
generated
vendored
Normal file
119
node_modules/ultrahtml/README.md
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# `ultrahtml`
|
||||
|
||||
A 1.75kB library for enhancing `html`. `ultrahtml` has zero dependencies and is compatible with any JavaScript runtime.
|
||||
|
||||
### Features
|
||||
|
||||
- Tiny, fault-tolerant and friendly HTML-like parser. Works with HTML, Astro, Vue, Svelte, and any other HTML-like syntax.
|
||||
- Built-in AST `walk` utility
|
||||
- Built-in `transform` utility for easy output manipulation
|
||||
- Automatic but configurable sanitization, see [Sanitization](#sanitization)
|
||||
- Handy `html` template utility
|
||||
- `querySelector` and `querySelectorAll` support using `ultrahtml/selector`
|
||||
|
||||
#### `walk`
|
||||
|
||||
The `walk` function provides full control over the AST. It can be used to scan for text, elements, components, or any other validation you might want to do.
|
||||
|
||||
> **Note** > `walk` is `async` and **must** be `await`ed. Use `walkSync` if it is guaranteed there are no `async` components in the tree.
|
||||
|
||||
```js
|
||||
import { parse, walk, ELEMENT_NODE } from "ultrahtml";
|
||||
|
||||
const ast = parse(`<h1>Hello world!</h1>`);
|
||||
await walk(ast, async (node) => {
|
||||
if (node.type === ELEMENT_NODE && node.name === "script") {
|
||||
throw new Error("Found a script!");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### `walkSync`
|
||||
|
||||
The `walkSync` function is identical to the `walk` function, but is synchronous. This should only be used when it is guaranteed there are no `async` components in the tree.
|
||||
|
||||
```js
|
||||
import { parse, walkSync, ELEMENT_NODE } from "ultrahtml";
|
||||
|
||||
const ast = parse(`<h1>Hello world!</h1>`);
|
||||
walkSync(ast, (node) => {
|
||||
if (node.type === ELEMENT_NODE && node.name === "script") {
|
||||
throw new Error("Found a script!");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### `render`
|
||||
|
||||
The `render` function allows you to serialize an AST back into a string.
|
||||
|
||||
> **Note**
|
||||
> By default, `render` will sanitize your markup, removing any `script` tags. Pass `{ sanitize: false }` to disable this behavior.
|
||||
|
||||
```js
|
||||
import { parse, render } from "ultrahtml";
|
||||
|
||||
const ast = parse(`<h1>Hello world!</h1>`);
|
||||
const output = await render(ast);
|
||||
```
|
||||
|
||||
#### `transform`
|
||||
|
||||
The `transform` function provides a straight-forward way to modify any markup. Sanitize content, swap in-place elements/Components, and more using a set of built-in transformers, or write your own custom transformer.
|
||||
|
||||
```js
|
||||
import { transform, html } from "ultrahtml";
|
||||
import swap from "ultrahtml/transformers/swap";
|
||||
import sanitize from "ultrahtml/transformers/sanitize";
|
||||
|
||||
const output = await transform(`<h1>Hello world!</h1>`, [
|
||||
swap({
|
||||
h1: "h2",
|
||||
h3: (props, children) => html`<h2 class="ultra">${children}</h2>`,
|
||||
}),
|
||||
sanitize({ allowElements: ["h1", "h2", "h3"] }),
|
||||
]);
|
||||
|
||||
console.log(output); // <h2>Hello world!</h2>
|
||||
```
|
||||
|
||||
#### `transformSync`
|
||||
|
||||
The `transformSync` function is identical to the `transform` function, but is synchronous. This should only be used when it is guaranteed there are no `async` functions in the transformers.
|
||||
|
||||
```js
|
||||
import { transformSync, html } from "ultrahtml";
|
||||
import swap from "ultrahtml/transformers/swap";
|
||||
import sanitize from "ultrahtml/transformers/sanitize";
|
||||
|
||||
const output = transformSync(`<h1>Hello world!</h1>`, [
|
||||
swap({
|
||||
h1: "h2",
|
||||
h3: (props, children) => html`<h2 class="ultra">${children}</h2>`,
|
||||
}),
|
||||
sanitize({ allowElements: ["h1", "h2", "h3"] }),
|
||||
]);
|
||||
|
||||
console.log(output); // <h2>Hello world!</h2>
|
||||
```
|
||||
|
||||
#### Sanitization
|
||||
|
||||
`ultrahtml/transformers/sanitize` implements an extension of the [HTML Sanitizer API](https://developer.mozilla.org/en-US/docs/Web/API/Sanitizer/Sanitizer).
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
| ------------------- | -------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| allowElements | `string[]` | `undefined` | An array of strings indicating elements that the sanitizer should not remove. All elements not in the array will be dropped. |
|
||||
| blockElements | `string[]` | `undefined` | An array of strings indicating elements that the sanitizer should remove, but keep their child elements. |
|
||||
| unblockElements | `string[]` | `undefined` | An array of strings indicating elements that the sanitizer should not remove. All elements not in the array will be removed, but keep their child content. |
|
||||
| dropElements | `string[]` | `["script"]` | An array of strings indicating elements (including nested elements) that the sanitizer should remove. |
|
||||
| allowAttributes | `Record<string, string[]>` | `undefined` | An object where each key is the attribute name and the value is an Array of allowed tag names. Matching attributes will not be removed. All attributes that are not in the array will be dropped. |
|
||||
| dropAttributes | `Record<string, string[]>` | `undefined` | An object where each key is the attribute name and the value is an Array of dropped tag names. Matching attributes will be removed. |
|
||||
| allowComponents | `boolean` | `false` | A boolean value set to false (default) to remove components and their children. If set to true, components will be subject to built-in and custom configuration checks (and will be retained or dropped based on those checks). |
|
||||
| allowCustomElements | `boolean` | `false` | A boolean value set to false (default) to remove custom elements and their children. If set to true, custom elements will be subject to built-in and custom configuration checks (and will be retained or dropped based on those checks). |
|
||||
| allowComments | `boolean` | `false` | A boolean value set to false (default) to remove HTML comments. Set to true in order to keep comments. |
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
- [Jason Miller](https://twitter.com/_developit)'s [`htmlParser`](https://github.com/developit/htmlParser) provided a great, lightweight base for this parser
|
||||
- [Titus Wormer](https://twitter.com/wooorm)'s [`mdx`](https://mdxjs.com) for inspiration
|
87
node_modules/ultrahtml/dist/index.d.ts
generated
vendored
Normal file
87
node_modules/ultrahtml/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
export type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
export interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
export interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
export interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
export interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
export interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
export declare const DOCUMENT_NODE = 0;
|
||||
export declare const ELEMENT_NODE = 1;
|
||||
export declare const TEXT_NODE = 2;
|
||||
export declare const COMMENT_NODE = 3;
|
||||
export declare const DOCTYPE_NODE = 4;
|
||||
export declare function h(type: any, props?: null | Record<string, any>, ...children: any[]): ElementNode;
|
||||
export declare const Fragment: unique symbol;
|
||||
export declare function parse(input: string | ReturnType<typeof html>): any;
|
||||
export interface Visitor {
|
||||
(node: Node$1, parent?: Node$1, index?: number): void | Promise<void>;
|
||||
}
|
||||
export interface VisitorSync {
|
||||
(node: Node$1, parent?: Node$1, index?: number): void;
|
||||
}
|
||||
export declare const RenderFn: unique symbol;
|
||||
export declare function __unsafeHTML(str: string): {
|
||||
value: string;
|
||||
};
|
||||
export declare function __unsafeRenderFn(node: ElementNode, fn: (props: Record<string, any>, ...children: Node$1[]) => Node$1): ElementNode;
|
||||
export declare function attrs(attributes: Record<string, string>): {
|
||||
value: string;
|
||||
};
|
||||
export declare function html(tmpl: TemplateStringsArray, ...vals: any[]): {
|
||||
value: string;
|
||||
};
|
||||
export declare function walk(node: Node$1, callback: Visitor): Promise<void>;
|
||||
export declare function walkSync(node: Node$1, callback: VisitorSync): void;
|
||||
export declare function renderSync(node: Node$1): string;
|
||||
export declare function render(node: Node$1): Promise<string>;
|
||||
interface Transformer$1 {
|
||||
(node: Node$1): Node$1 | Promise<Node$1>;
|
||||
}
|
||||
export interface TransformerSync {
|
||||
(node: Node$1): Node$1;
|
||||
}
|
||||
export declare function transform(markup: string | Node$1, transformers?: Transformer$1[]): Promise<string>;
|
||||
export declare function transformSync(markup: string | Node$1, transformers?: TransformerSync[]): string;
|
||||
|
||||
export {
|
||||
Location$1 as Location,
|
||||
Node$1 as Node,
|
||||
Transformer$1 as Transformer,
|
||||
};
|
||||
|
||||
export {};
|
1
node_modules/ultrahtml/dist/index.js
generated
vendored
Normal file
1
node_modules/ultrahtml/dist/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/ultrahtml/dist/index.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
57
node_modules/ultrahtml/dist/jsx-runtime/index.d.ts
generated
vendored
Normal file
57
node_modules/ultrahtml/dist/jsx-runtime/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
export declare const Fragment: unique symbol;
|
||||
declare function createVNode(type: any, { children, ...attributes }: Record<string, any>, key: string, __self: string, __source: string): ElementNode;
|
||||
|
||||
export {
|
||||
createVNode as jsx,
|
||||
createVNode as jsxDEV,
|
||||
createVNode as jsxs,
|
||||
};
|
||||
|
||||
export {};
|
1
node_modules/ultrahtml/dist/jsx-runtime/index.js
generated
vendored
Normal file
1
node_modules/ultrahtml/dist/jsx-runtime/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{TEXT_NODE as a}from"../index.js";import{ELEMENT_NODE as s,Fragment as d,__unsafeRenderFn as f}from"../index.js";function g(n,{children:e,...o},i,m,u){let t={type:s,name:typeof n=="function"?n.name:n,attributes:o,children:(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?{type:a,value:r}:r),parent:void 0,loc:[]};return typeof n=="function"&&f(t,n),t}export{d as Fragment,g as jsx,g as jsxDEV,g as jsxs};
|
7
node_modules/ultrahtml/dist/jsx-runtime/index.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/jsx-runtime/index.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../src/jsx-runtime/index.ts"],
|
||||
"sourcesContent": ["import { ElementNode, Node, TEXT_NODE } from '../index.js';\nimport { ELEMENT_NODE, Fragment, __unsafeRenderFn } from '../index.js';\n\nfunction createVNode(\n\ttype: any,\n\t{ children, ...attributes }: Record<string, any>,\n\tkey: string,\n\t__self: string,\n\t__source: string,\n) {\n\tconst vnode: ElementNode = {\n\t\ttype: ELEMENT_NODE,\n\t\tname: typeof type === 'function' ? type.name : type,\n\t\tattributes,\n\t\tchildren: (Array.isArray(children) ? children : [children]).map((child) => {\n\t\t\tif (typeof child === 'string') {\n\t\t\t\treturn {\n\t\t\t\t\ttype: TEXT_NODE,\n\t\t\t\t\tvalue: child,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn child;\n\t\t}),\n\t\tparent: undefined as any,\n\t\tloc: [] as any,\n\t};\n\n\tif (typeof type === 'function') {\n\t\t__unsafeRenderFn(vnode, type);\n\t}\n\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n};\n"],
|
||||
"mappings": "AAAA,OAA4B,aAAAA,MAAiB,cAC7C,OAAS,gBAAAC,EAAc,YAAAC,EAAU,oBAAAC,MAAwB,cAEzD,SAASC,EACRC,EACA,CAAE,SAAAC,EAAU,GAAGC,CAAW,EAC1BC,EACAC,EACAC,EACC,CACD,IAAMC,EAAqB,CAC1B,KAAMV,EACN,KAAM,OAAOI,GAAS,WAAaA,EAAK,KAAOA,EAC/C,WAAAE,EACA,UAAW,MAAM,QAAQD,CAAQ,EAAIA,EAAW,CAACA,CAAQ,GAAG,IAAKM,GAC5D,OAAOA,GAAU,SACb,CACN,KAAMZ,EACN,MAAOY,CACR,EAEMA,CACP,EACD,OAAQ,OACR,IAAK,CAAC,CACP,EAEA,OAAI,OAAOP,GAAS,YACnBF,EAAiBQ,EAAON,CAAI,EAGtBM,CACR",
|
||||
"names": ["TEXT_NODE", "ELEMENT_NODE", "Fragment", "__unsafeRenderFn", "createVNode", "type", "children", "attributes", "key", "__self", "__source", "vnode", "child"]
|
||||
}
|
57
node_modules/ultrahtml/dist/selector.d.ts
generated
vendored
Normal file
57
node_modules/ultrahtml/dist/selector.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
export declare function specificity(selector: string): number;
|
||||
export declare function matches(node: Node$1, selector: string): boolean;
|
||||
export declare function querySelector(node: Node$1, selector: string): Node$1;
|
||||
export declare function querySelectorAll(node: Node$1, selector: string): Node$1[];
|
||||
|
||||
export {
|
||||
querySelectorAll as default,
|
||||
};
|
||||
|
||||
export {};
|
1
node_modules/ultrahtml/dist/selector.js
generated
vendored
Normal file
1
node_modules/ultrahtml/dist/selector.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/ultrahtml/dist/selector.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/selector.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
100
node_modules/ultrahtml/dist/transformers/inline.d.ts
generated
vendored
Normal file
100
node_modules/ultrahtml/dist/transformers/inline.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
type Integer = number;
|
||||
type Environment = {
|
||||
mediaType: "screen" | "print" | "not-screen-or-print";
|
||||
anyHover: "none" | "hover";
|
||||
anyPointer: "none" | "coarse" | "fine";
|
||||
colorGamut: "not-srgb" | "srgb-but-not-p3" | "p3-but-not-rec2020" | "rec2020";
|
||||
grid: "bitmap" | "grid";
|
||||
hover: "none" | "hover";
|
||||
overflowBlock: "none" | "scroll" | "paged";
|
||||
overflowInline: "none" | "scroll";
|
||||
pointer: "none" | "coarse" | "fine";
|
||||
scan: "interlace" | "progressive";
|
||||
update: "none" | "slow" | "fast";
|
||||
widthPx: Integer;
|
||||
heightPx: Integer;
|
||||
deviceWidthPx: Integer;
|
||||
deviceHeightPx: Integer;
|
||||
colorBits: Integer;
|
||||
monochromeBits: "not-monochrome" | Integer;
|
||||
colorIndex: "none" | Integer;
|
||||
dppx: Integer;
|
||||
displayMode: "fullscreen" | "standalone" | "minimal-ui" | "browser";
|
||||
dynamicRange: "not-hdr" | "hdr";
|
||||
environmentBlending: "opaque" | "additive" | "subtractive";
|
||||
forcedColors: "none" | "active";
|
||||
invertedColors: "none" | "inverted";
|
||||
navControls: "none" | "back";
|
||||
prefersColorScheme: "no-preference" | "light" | "dark";
|
||||
prefersContrast: "no-preference" | "less" | "more" | "custom";
|
||||
prefersReducedData: "no-preference" | "reduce";
|
||||
prefersReducedMotion: "no-preference" | "reduce";
|
||||
prefersReducedTransparency: "no-preference" | "reduce";
|
||||
scripting: "none" | "initial-only" | "enabled";
|
||||
videoColorGamut: "not-srgb" | "srgb-but-not-p3" | "p3-but-not-rec2020" | "rec2020";
|
||||
videoDynamicRange: "not-hdr" | "hdr";
|
||||
horizontalViewportSegments: Integer;
|
||||
verticalViewportSegments: Integer;
|
||||
};
|
||||
export interface InlineOptions {
|
||||
/** Emit `style` attributes as objects rather than strings. */
|
||||
useObjectSyntax: boolean;
|
||||
env: Partial<Environment> & {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
declare function inline(opts?: Partial<InlineOptions>): (doc: Node$1) => Node$1;
|
||||
|
||||
export {
|
||||
inline as default,
|
||||
};
|
||||
|
||||
export {};
|
7
node_modules/ultrahtml/dist/transformers/inline.js
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/transformers/inline.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/ultrahtml/dist/transformers/inline.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/transformers/inline.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
74
node_modules/ultrahtml/dist/transformers/sanitize.d.ts
generated
vendored
Normal file
74
node_modules/ultrahtml/dist/transformers/sanitize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
export interface SanitizeOptions {
|
||||
/** An Array of strings indicating elements that the sanitizer should not remove. All elements not in the array will be dropped. */
|
||||
allowElements?: string[];
|
||||
/** An Array of strings indicating elements that the sanitizer should not remove. All elements not in the array will be removed while keeping their child content. */
|
||||
unblockElements?: string[];
|
||||
/** An Array of strings indicating elements that the sanitizer should remove, but keeping their child elements. */
|
||||
blockElements?: string[];
|
||||
/** An Array of strings indicating elements (including nested elements) that the sanitizer should remove. */
|
||||
dropElements?: string[];
|
||||
/** An Object where each key is the attribute name and the value is an Array of allowed tag names. Matching attributes will not be removed. All attributes that are not in the array will be dropped. */
|
||||
allowAttributes?: Record<string, string[]>;
|
||||
/** An Object where each key is the attribute name and the value is an Array of dropped tag names. Matching attributes will be removed. */
|
||||
dropAttributes?: Record<string, string[]>;
|
||||
/** A Boolean value set to false (default) to remove components and their children. If set to true, components will be subject to built-in and custom configuration checks (and will be retained or dropped based on those checks). */
|
||||
allowComponents?: boolean;
|
||||
/** A Boolean value set to false (default) to remove custom elements and their children. If set to true, custom elements will be subject to built-in and custom configuration checks (and will be retained or dropped based on those checks). */
|
||||
allowCustomElements?: boolean;
|
||||
/** A Boolean value set to false (default) to remove HTML comments. Set to true in order to keep comments. */
|
||||
allowComments?: boolean;
|
||||
}
|
||||
declare function sanitize(opts?: SanitizeOptions): (doc: Node$1) => Node$1;
|
||||
|
||||
export {
|
||||
sanitize as default,
|
||||
};
|
||||
|
||||
export {};
|
1
node_modules/ultrahtml/dist/transformers/sanitize.js
generated
vendored
Normal file
1
node_modules/ultrahtml/dist/transformers/sanitize.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{ELEMENT_NODE as a,walkSync as p}from"../index.js";function f(t){var n;if(t===void 0)return{allowElements:[],dropElements:["script"],allowComponents:!1,allowCustomElements:!1,allowComments:!1};{let e=new Set([]);(n=t.allowElements)!=null&&n.includes("script")||e.add("script");for(let l of t.dropElements??[])e.add(l);return{allowComponents:!1,allowCustomElements:!1,allowComments:!1,...t,dropElements:Array.from(e)}}}function E(t){return t.name.includes("-")?"custom-element":/[\_\$A-Z]/.test(t.name[0])||t.name.includes(".")?"component":"element"}function w(t,n,e){var l,o,s,r;return((l=e.allowElements)==null?void 0:l.length)>0&&e.allowElements.includes(t)?"allow":((o=e.blockElements)==null?void 0:o.length)>0&&e.blockElements.includes(t)?"block":((s=e.dropElements)==null?void 0:s.length)>0&&e.dropElements.find(u=>u===t)||n==="component"&&!e.allowComponents||n==="custom-element"&&!e.allowCustomElements?"drop":e.unblockElements?e.unblockElements.some(u=>u===t)?"allow":"block":((r=e.allowElements)==null?void 0:r.length)>0?"drop":"allow"}function b(t,n){var l,o,s,r,u,m,c,d;let e=t.attributes;for(let i of Object.keys(t.attributes))(l=n.allowAttributes)!=null&&l[i]&&((o=n.allowAttributes)!=null&&o[i].includes(t.name))||(r=(s=n.allowAttributes)==null?void 0:s[i])!=null&&r.includes("*")||((u=n.dropAttributes)!=null&&u[i]&&((m=n.dropAttributes)!=null&&m[i].includes(t.name))||(d=(c=n.dropAttributes)==null?void 0:c[i])!=null&&d.includes("*"))&&delete e[i];return e}function g(t,n,e){let l=E(n),{name:o}=n,s=w(o,l,t);return s==="drop"?()=>{e.children=e.children.filter(r=>r!==n)}:s==="block"?()=>{e.children=e.children.map(r=>r===n?r.children:r).flat(1)}:()=>{n.attributes=b(n,t)}}function N(t){let n=f(t);return e=>{let l=[];p(e,(o,s)=>{switch(o.type){case a:{l.push(g(n,o,s));return}default:return}});for(let o=l.length-1;o>=0;o--)l[o]();return e}}export{N as default};
|
7
node_modules/ultrahtml/dist/transformers/sanitize.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/transformers/sanitize.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
node_modules/ultrahtml/dist/transformers/scope.d.ts
generated
vendored
Normal file
58
node_modules/ultrahtml/dist/transformers/scope.d.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
export interface ScopeOptions {
|
||||
hash?: string;
|
||||
attribute?: string;
|
||||
}
|
||||
declare function scope(opts?: ScopeOptions): (doc: Node$1) => Promise<Node$1>;
|
||||
|
||||
export {
|
||||
scope as default,
|
||||
};
|
||||
|
||||
export {};
|
31
node_modules/ultrahtml/dist/transformers/scope.js
generated
vendored
Normal file
31
node_modules/ultrahtml/dist/transformers/scope.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/ultrahtml/dist/transformers/scope.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/transformers/scope.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
54
node_modules/ultrahtml/dist/transformers/swap.d.ts
generated
vendored
Normal file
54
node_modules/ultrahtml/dist/transformers/swap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
// Generated by dts-bundle-generator v9.5.1
|
||||
|
||||
type Node$1 = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
||||
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
||||
interface Location$1 {
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
interface BaseNode {
|
||||
type: NodeType;
|
||||
loc: [
|
||||
Location$1,
|
||||
Location$1
|
||||
];
|
||||
parent: Node$1;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface LiteralNode extends BaseNode {
|
||||
value: string;
|
||||
}
|
||||
interface ParentNode$1 extends BaseNode {
|
||||
children: Node$1[];
|
||||
}
|
||||
interface DocumentNode extends Omit<ParentNode$1, "parent"> {
|
||||
type: typeof DOCUMENT_NODE;
|
||||
attributes: Record<string, string>;
|
||||
parent: undefined;
|
||||
}
|
||||
interface ElementNode extends ParentNode$1 {
|
||||
type: typeof ELEMENT_NODE;
|
||||
name: string;
|
||||
attributes: Record<string, string>;
|
||||
}
|
||||
interface TextNode extends LiteralNode {
|
||||
type: typeof TEXT_NODE;
|
||||
}
|
||||
interface CommentNode extends LiteralNode {
|
||||
type: typeof COMMENT_NODE;
|
||||
}
|
||||
interface DoctypeNode extends LiteralNode {
|
||||
type: typeof DOCTYPE_NODE;
|
||||
}
|
||||
declare const DOCUMENT_NODE = 0;
|
||||
declare const ELEMENT_NODE = 1;
|
||||
declare const TEXT_NODE = 2;
|
||||
declare const COMMENT_NODE = 3;
|
||||
declare const DOCTYPE_NODE = 4;
|
||||
declare function swap(components?: Record<string, string | ((props: Record<string, any>, ...children: any[]) => any)>): (doc: Node$1) => Node$1;
|
||||
|
||||
export {
|
||||
swap as default,
|
||||
};
|
||||
|
||||
export {};
|
1
node_modules/ultrahtml/dist/transformers/swap.js
generated
vendored
Normal file
1
node_modules/ultrahtml/dist/transformers/swap.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{RenderFn as r}from"../index.js";import{__unsafeRenderFn as i}from"../index.js";import{querySelectorAll as s}from"../selector.js";function d(t={}){return o=>{for(let[f,e]of Object.entries(t))for(let n of s(o,f))typeof e=="string"?(n.name=e,r in n&&delete n[r]):typeof e=="function"&&i(n,e);return o}}export{d as default};
|
7
node_modules/ultrahtml/dist/transformers/swap.js.map
generated
vendored
Normal file
7
node_modules/ultrahtml/dist/transformers/swap.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../src/transformers/swap.ts"],
|
||||
"sourcesContent": ["import { ElementNode, RenderFn } from '../index.js';\nimport { Node, __unsafeRenderFn } from '../index.js';\nimport { querySelectorAll } from '../selector.js';\n\nexport default function swap(\n\tcomponents: Record<\n\t\tstring,\n\t\tstring | ((props: Record<string, any>, ...children: any[]) => any)\n\t> = {},\n) {\n\treturn (doc: Node): Node => {\n\t\tfor (const [selector, component] of Object.entries(components)) {\n\t\t\tfor (const node of querySelectorAll(doc, selector)) {\n\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\tnode.name = component;\n\t\t\t\t\tif (RenderFn in node) {\n\t\t\t\t\t\tdelete (node as any)[RenderFn];\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t__unsafeRenderFn(node as ElementNode, component);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn doc;\n\t};\n}\n"],
|
||||
"mappings": "AAAA,OAAsB,YAAAA,MAAgB,cACtC,OAAe,oBAAAC,MAAwB,cACvC,OAAS,oBAAAC,MAAwB,iBAElB,SAARC,EACNC,EAGI,CAAC,EACJ,CACD,OAAQC,GAAoB,CAC3B,OAAW,CAACC,EAAUC,CAAS,IAAK,OAAO,QAAQH,CAAU,EAC5D,QAAWI,KAAQN,EAAiBG,EAAKC,CAAQ,EAC5C,OAAOC,GAAc,UACxBC,EAAK,KAAOD,EACRP,KAAYQ,GACf,OAAQA,EAAaR,CAAQ,GAEpB,OAAOO,GAAc,YAC/BN,EAAiBO,EAAqBD,CAAS,EAIlD,OAAOF,CACR,CACD",
|
||||
"names": ["RenderFn", "__unsafeRenderFn", "querySelectorAll", "swap", "components", "doc", "selector", "component", "node"]
|
||||
}
|
1
node_modules/ultrahtml/jsx-runtime.d.ts
generated
vendored
Normal file
1
node_modules/ultrahtml/jsx-runtime.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/jsx-runtime/index';
|
79
node_modules/ultrahtml/package.json
generated
vendored
Normal file
79
node_modules/ultrahtml/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "ultrahtml",
|
||||
"type": "module",
|
||||
"version": "1.6.0",
|
||||
"types": "./dist/index.d.ts",
|
||||
"main": "./dist/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/natemoo-re/ultrahtml"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/natemoo-re/ultrahtml/issues"
|
||||
},
|
||||
"homepage": "https://github.com/natemoo-re/ultrahtml#README",
|
||||
"files": [
|
||||
"selector.d.ts",
|
||||
"transform.d.ts",
|
||||
"jsx-runtime.d.ts",
|
||||
"transformers",
|
||||
"dist",
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
},
|
||||
"./package.json": "./package.json",
|
||||
"./selector": {
|
||||
"types": "./dist/selector.d.ts",
|
||||
"import": "./dist/selector.js"
|
||||
},
|
||||
"./transformers/*": {
|
||||
"types": "./dist/transformers/*.d.ts",
|
||||
"import": "./dist/transformers/*.js"
|
||||
},
|
||||
"./jsx-runtime": {
|
||||
"types": "./dist/jsx-runtime/index.d.ts",
|
||||
"import": "./dist/jsx-runtime/index.js"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"html",
|
||||
"template",
|
||||
"sanitize"
|
||||
],
|
||||
"author": {
|
||||
"name": "Nate Moore",
|
||||
"email": "nate@natemoo.re",
|
||||
"url": "https://twitter.com/n_moore"
|
||||
},
|
||||
"license": "MIT",
|
||||
"volta": {
|
||||
"node": "18.20.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.9.2",
|
||||
"@changesets/cli": "^2.27.8",
|
||||
"@types/stylis": "^4.2.6",
|
||||
"chalk": "^5.3.0",
|
||||
"dts-bundle-generator": "^9.5.1",
|
||||
"esbuild": "^0.25.2",
|
||||
"globby": "^13.2.2",
|
||||
"gzip-size": "^7.0.0",
|
||||
"markdown-it": "^13.0.2",
|
||||
"media-query-fns": "^2.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"parsel-js": "^1.1.2",
|
||||
"pretty-bytes": "^6.1.1",
|
||||
"stylis": "^4.3.4",
|
||||
"vitest": "^2.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"format": "biome format --write",
|
||||
"dev": "vitest",
|
||||
"test": "vitest run"
|
||||
}
|
||||
}
|
1
node_modules/ultrahtml/selector.d.ts
generated
vendored
Normal file
1
node_modules/ultrahtml/selector.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/selector';
|
1
node_modules/ultrahtml/transform.d.ts
generated
vendored
Normal file
1
node_modules/ultrahtml/transform.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/transform';
|
2
node_modules/ultrahtml/transformers/inline.d.ts
generated
vendored
Normal file
2
node_modules/ultrahtml/transformers/inline.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from '../dist/transformers/inline';
|
||||
export * from '../dist/transformers/inline';
|
2
node_modules/ultrahtml/transformers/sanitize.d.ts
generated
vendored
Normal file
2
node_modules/ultrahtml/transformers/sanitize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from '../dist/transformers/sanitize';
|
||||
export * from '../dist/transformers/sanitize';
|
2
node_modules/ultrahtml/transformers/scope.d.ts
generated
vendored
Normal file
2
node_modules/ultrahtml/transformers/scope.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from '../dist/transformers/scope';
|
||||
export * from '../dist/transformers/scope';
|
2
node_modules/ultrahtml/transformers/swap.d.ts
generated
vendored
Normal file
2
node_modules/ultrahtml/transformers/swap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from '../dist/transformers/swap';
|
||||
export * from '../dist/transformers/swap';
|
Reference in New Issue
Block a user