ranuts 0.2.0-alpha.1 → 0.4.0-alpha.1
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/CLAUDE.md +126 -24
- package/README.md +7 -5
- package/README.zh-CN.md +7 -5
- package/dist/chain-CTywmh_H.js +1 -0
- package/dist/{color-CRdlaDqQ.js → color-Dohr9BXX.js} +1 -1
- package/dist/enums-BAgbyGdH.js +1 -0
- package/dist/i18n-Cf5TtRb4.js +1 -0
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -1
- package/dist/src/node/appendFile.d.ts +3 -3
- package/dist/src/node/fileInfo.d.ts +2 -2
- package/dist/src/node/index.js +1 -1
- package/dist/src/node/paresUrl.d.ts +1 -1
- package/dist/src/node/readFile.d.ts +3 -3
- package/dist/src/node/traverse.d.ts +2 -2
- package/dist/src/node/watchFile.d.ts +3 -3
- package/dist/src/node/writeFile.d.ts +3 -3
- package/dist/src/sw/index.d.ts +109 -0
- package/dist/src/sw/index.js +1 -0
- package/dist/src/utils/async.d.ts +81 -0
- package/dist/src/utils/audioRecorder.d.ts +1 -1
- package/dist/src/utils/behavior.d.ts +12 -3
- package/dist/src/utils/bom.d.ts +68 -178
- package/dist/src/utils/bridge.d.ts +153 -0
- package/dist/src/utils/canvas.d.ts +54 -0
- package/dist/src/utils/chain.d.ts +80 -0
- package/dist/src/utils/color.d.ts +76 -4
- package/dist/src/utils/compose.d.ts +1 -1
- package/dist/src/utils/console.d.ts +19 -1
- package/dist/src/utils/debounce.d.ts +27 -5
- package/dist/src/utils/device.d.ts +31 -3
- package/dist/src/utils/dom.d.ts +5 -84
- package/dist/src/utils/error.d.ts +18 -1
- package/dist/src/utils/event.d.ts +61 -0
- package/dist/src/utils/file.d.ts +35 -0
- package/dist/src/utils/i18n/index.js +1 -0
- package/dist/src/utils/i18n.d.ts +69 -0
- package/dist/src/utils/idb.d.ts +218 -0
- package/dist/src/utils/img.d.ts +60 -4
- package/dist/src/utils/index.d.ts +50 -16
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/lang.d.ts +69 -0
- package/dist/src/utils/localePath.d.ts +62 -0
- package/dist/src/utils/memoize.d.ts +53 -5
- package/dist/src/utils/monitor.d.ts +55 -26
- package/dist/src/utils/number.d.ts +46 -9
- package/dist/src/utils/obj.d.ts +56 -31
- package/dist/src/utils/paginate.d.ts +73 -0
- package/dist/src/utils/prefetch.d.ts +81 -0
- package/dist/src/utils/queue.d.ts +53 -23
- package/dist/src/utils/report.d.ts +51 -3
- package/dist/src/utils/request.d.ts +26 -7
- package/dist/src/utils/script.d.ts +26 -4
- package/dist/src/utils/segment.d.ts +62 -0
- package/dist/src/utils/signal.d.ts +35 -3
- package/dist/src/utils/storage.d.ts +57 -0
- package/dist/src/utils/str.d.ts +112 -88
- package/dist/src/utils/style.d.ts +31 -0
- package/dist/src/utils/subscribe.d.ts +5 -5
- package/dist/src/utils/throttle.d.ts +26 -13
- package/dist/src/utils/time.d.ts +38 -6
- package/dist/src/utils/tween.d.ts +40 -0
- package/dist/src/utils/visual/application.d.ts +4 -4
- package/dist/src/utils/visual/enums.d.ts +4 -4
- package/dist/src/utils/visual/graphics/graphics.d.ts +25 -25
- package/dist/src/utils/visual/graphics/graphicsData.d.ts +1 -1
- package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +6 -6
- package/dist/src/utils/visual/index.js +1 -1
- package/dist/src/utils/visual/math/matrix.d.ts +8 -8
- package/dist/src/utils/visual/math/transform.d.ts +1 -1
- package/dist/src/utils/visual/render/batchRenderer.d.ts +20 -18
- package/dist/src/utils/visual/render/utils/batch/index.d.ts +13 -13
- package/dist/src/utils/visual/render/utils/float.d.ts +13 -13
- package/dist/src/utils/visual/render/utils/verticy.d.ts +3 -3
- package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +3 -2
- package/dist/src/utils/visual/render/utils/webgpu/shaders.d.ts +2 -2
- package/dist/src/utils/visual/render/webGPURenderer.d.ts +8 -8
- package/dist/src/utils/visual/vertex/container.d.ts +17 -16
- package/dist/src/utils/worker.d.ts +125 -0
- package/dist/src/utils/zip.d.ts +162 -0
- package/dist/src/vnode/index.d.ts +1 -1
- package/dist/src/vnode/index.js +1 -1
- package/dist/src/vnode/is.d.ts +4 -0
- package/dist/test/canvas.test.d.ts +1 -0
- package/dist/test/color.test.d.ts +1 -0
- package/dist/test/sw.test.d.ts +1 -0
- package/dist/test/tween.test.d.ts +1 -0
- package/dist/test/utils/async.test.d.ts +1 -0
- package/dist/test/utils/file-read.test.d.ts +1 -0
- package/dist/test/utils/format.test.d.ts +1 -0
- package/dist/test/utils/idb-collection.test.d.ts +1 -0
- package/dist/test/utils/idb.test.d.ts +1 -0
- package/dist/test/utils/instrumentation.test.d.ts +1 -0
- package/dist/test/utils/lang.test.d.ts +1 -0
- package/dist/test/utils/locale-path.test.d.ts +1 -0
- package/dist/test/utils/media-query.test.d.ts +1 -0
- package/dist/test/utils/number-parse.test.d.ts +1 -0
- package/dist/test/utils/paginate.test.d.ts +1 -0
- package/dist/test/utils/prefetch.test.d.ts +1 -0
- package/dist/test/utils/query-storage.test.d.ts +1 -0
- package/dist/test/utils/queue.test.d.ts +1 -0
- package/dist/test/utils/report-config.test.d.ts +1 -0
- package/dist/test/utils/report-image.test.d.ts +1 -0
- package/dist/test/utils/segment.test.d.ts +1 -0
- package/dist/test/utils/signal-once.test.d.ts +1 -0
- package/dist/test/utils/single-flight.test.d.ts +1 -0
- package/dist/test/utils/timing.test.d.ts +1 -0
- package/dist/test/utils/worker-client.test.d.ts +1 -0
- package/dist/test/utils/worker-serve.test.d.ts +1 -0
- package/dist/test/utils/zip.test.d.ts +1 -0
- package/dist/umd/index.umd.cjs +1 -1
- package/dist/umd/node/node.umd.cjs +1 -1
- package/dist/umd/utils/utils.umd.cjs +1 -1
- package/dist/utils-8TVtLBjA.js +1 -0
- package/docs/API.md +341 -147
- package/package.json +13 -6
- package/dist/src/vnode/chainDom.d.ts +0 -47
- package/dist/subscribe-CINWsor3.js +0 -1
- package/dist/utils-_OxsVZmz.js +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal ZIP reader and rewriter with no dependencies.
|
|
3
|
+
*
|
|
4
|
+
* ZIP is the container behind OOXML (docx/xlsx/pptx), EPUB, ODF and browser extensions, so
|
|
5
|
+
* "read one file out of this archive" and "patch one file inside this archive" come up
|
|
6
|
+
* constantly. A full ZIP library is a large dependency for that; the whole of the format
|
|
7
|
+
* these tasks need is the central directory plus DEFLATE, and DEFLATE now ships in the
|
|
8
|
+
* platform as `DecompressionStream`.
|
|
9
|
+
*
|
|
10
|
+
* Scope, stated plainly:
|
|
11
|
+
* - **Reads** STORED (method 0) and DEFLATE (method 8) entries. Other methods are reported
|
|
12
|
+
* but their data cannot be extracted.
|
|
13
|
+
* - **Writes** rewritten and injected entries as STORED — no recompression. The output is
|
|
14
|
+
* larger than the input, which is the right trade for a patch-and-hand-off pipeline and
|
|
15
|
+
* the wrong one for archiving.
|
|
16
|
+
* - **No ZIP64.** Archives over 4 GiB, or with more than 65535 entries, are out of scope.
|
|
17
|
+
* - **No encryption**, no multi-disk archives.
|
|
18
|
+
*
|
|
19
|
+
* Everything is `Uint8Array` in, `Uint8Array` out; nothing here touches the DOM.
|
|
20
|
+
*/
|
|
21
|
+
/** Compression methods this module understands. */
|
|
22
|
+
export declare const ZIP_STORED = 0;
|
|
23
|
+
export declare const ZIP_DEFLATE = 8;
|
|
24
|
+
/**
|
|
25
|
+
* @description: CRC32 checksum (IEEE 802.3 polynomial), the one ZIP stores per entry.
|
|
26
|
+
* Returned as an unsigned 32-bit number.
|
|
27
|
+
* @param {Uint8Array} data
|
|
28
|
+
* @return {number}
|
|
29
|
+
*/
|
|
30
|
+
export declare const crc32: (data: Uint8Array) => number;
|
|
31
|
+
/**
|
|
32
|
+
* @description: Decompress raw DEFLATE bytes (no zlib or gzip wrapper) — the form ZIP
|
|
33
|
+
* stores entries in — using the platform's `DecompressionStream`.
|
|
34
|
+
*
|
|
35
|
+
* Note the format: `'deflate-raw'`, not `'deflate'`. The latter expects a zlib header that
|
|
36
|
+
* ZIP entries do not carry, and feeding it entry bytes fails with an opaque
|
|
37
|
+
* `TypeError`.
|
|
38
|
+
*
|
|
39
|
+
* @param {Uint8Array} data raw DEFLATE bytes
|
|
40
|
+
* @return {Promise<Uint8Array>} the decompressed bytes
|
|
41
|
+
* @throws when `DecompressionStream` is unavailable or the data is corrupt
|
|
42
|
+
*/
|
|
43
|
+
export declare const inflateRaw: (data: Uint8Array) => Promise<Uint8Array>;
|
|
44
|
+
/** One entry as described by the archive's central directory. */
|
|
45
|
+
export interface ZipEntry {
|
|
46
|
+
/** Path inside the archive, e.g. `word/document.xml`. Always `/`-separated. */
|
|
47
|
+
name: string;
|
|
48
|
+
/** `ZIP_STORED` (0) or `ZIP_DEFLATE` (8); other values are readable metadata only. */
|
|
49
|
+
compression: number;
|
|
50
|
+
crc: number;
|
|
51
|
+
compressedSize: number;
|
|
52
|
+
uncompressedSize: number;
|
|
53
|
+
/** MS-DOS packed time / date, carried through a rewrite unchanged. */
|
|
54
|
+
modTime: number;
|
|
55
|
+
modDate: number;
|
|
56
|
+
/** Whether the name ends in `/` — a directory marker with no content. */
|
|
57
|
+
directory: boolean;
|
|
58
|
+
/** Offset of the entry's compressed bytes in the source array. */
|
|
59
|
+
dataStart: number;
|
|
60
|
+
/** Name as stored, kept verbatim so a rewrite reproduces non-UTF-8 names byte for byte. */
|
|
61
|
+
nameBytes: Uint8Array;
|
|
62
|
+
localOffset: number;
|
|
63
|
+
centralStart: number;
|
|
64
|
+
centralEnd: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @description: Read an archive's central directory. Returns `[]` for anything that is not
|
|
68
|
+
* a ZIP, rather than throwing — the common caller is inspecting a file the user supplied.
|
|
69
|
+
*
|
|
70
|
+
* The central directory is the authority on an entry's sizes and CRC. The local header at
|
|
71
|
+
* the front of each entry may hold zeros instead: archives written by a streaming writer
|
|
72
|
+
* set general-purpose bit 3 and append the real values in a data descriptor *after* the
|
|
73
|
+
* compressed bytes. Reading sizes from local headers is the single most common way a
|
|
74
|
+
* hand-rolled ZIP reader breaks on real files.
|
|
75
|
+
*
|
|
76
|
+
* @param {Uint8Array} bytes the whole archive
|
|
77
|
+
* @return {ZipEntry[]} entries in central-directory order
|
|
78
|
+
*/
|
|
79
|
+
export declare const readZipEntries: (bytes: Uint8Array) => ZipEntry[];
|
|
80
|
+
/**
|
|
81
|
+
* @description: Whether the archive contains an entry with exactly this name. Cheaper than
|
|
82
|
+
* `readZipEntries(bytes).some(...)` only in intent — use it to make the check read clearly.
|
|
83
|
+
* @param {Uint8Array} bytes
|
|
84
|
+
* @param {string} name exact path, e.g. `[Content_Types].xml`
|
|
85
|
+
* @return {boolean}
|
|
86
|
+
*/
|
|
87
|
+
export declare const zipHasEntry: (bytes: Uint8Array, name: string) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* @description: Extract one entry's decompressed bytes. Resolves `null` when the entry is
|
|
90
|
+
* missing, is a directory, is truncated, or uses a compression method other than STORED
|
|
91
|
+
* and DEFLATE.
|
|
92
|
+
*
|
|
93
|
+
* @param {Uint8Array} bytes the whole archive
|
|
94
|
+
* @param {string | ZipEntry} entry entry name, or an entry from `readZipEntries`
|
|
95
|
+
* @return {Promise<Uint8Array | null>}
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const xml = await readZipEntry(docx, 'word/document.xml');
|
|
99
|
+
* if (xml) parse(new TextDecoder().decode(xml));
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export declare const readZipEntry: (bytes: Uint8Array, entry: string | ZipEntry) => Promise<Uint8Array | null>;
|
|
103
|
+
export interface RewriteZipOptions {
|
|
104
|
+
/**
|
|
105
|
+
* Which entries to decompress and hand to `transform`. Omit to consider every file entry
|
|
106
|
+
* — costly on a large archive, since each candidate is decompressed.
|
|
107
|
+
*/
|
|
108
|
+
filter?: (entry: ZipEntry) => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Produce replacement content for an entry. Return `null` (or the bytes unchanged) to
|
|
111
|
+
* leave it alone. A returned string is encoded as UTF-8, which is what XML entries want.
|
|
112
|
+
*/
|
|
113
|
+
transform?: (data: Uint8Array, entry: ZipEntry) => Uint8Array | string | null | Promise<Uint8Array | string | null>;
|
|
114
|
+
/** Brand-new entries to append. An existing entry with the same name is not replaced. */
|
|
115
|
+
inject?: ReadonlyArray<{
|
|
116
|
+
name: string;
|
|
117
|
+
data: Uint8Array | string;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @description: Rebuild an archive with some entries replaced and/or new entries appended.
|
|
122
|
+
* Returns the **original array unchanged** when nothing matched, so the no-op path costs
|
|
123
|
+
* nothing and the result can be compared by identity.
|
|
124
|
+
*
|
|
125
|
+
* Rewritten and injected entries are written STORED (uncompressed); untouched entries keep
|
|
126
|
+
* their original compressed bytes, copied verbatim. The output is therefore bigger than the
|
|
127
|
+
* input but is produced without a compressor.
|
|
128
|
+
*
|
|
129
|
+
* Every local header is written fresh from the central directory's sizes and CRC, and
|
|
130
|
+
* general-purpose bit 3 is cleared throughout. That is what makes the result readable by
|
|
131
|
+
* strict parsers even when the input came from a streaming writer whose local headers hold
|
|
132
|
+
* zero placeholders backed by trailing data descriptors — copying those headers through is
|
|
133
|
+
* the standard way a rewritten ZIP ends up subtly corrupt.
|
|
134
|
+
*
|
|
135
|
+
* An entry whose transform throws, or whose compression method is unsupported, is left
|
|
136
|
+
* untouched rather than dropped: a rewrite must never lose data it failed to understand.
|
|
137
|
+
*
|
|
138
|
+
* @param {Uint8Array} bytes the whole archive
|
|
139
|
+
* @param {RewriteZipOptions} options
|
|
140
|
+
* @return {Promise<Uint8Array>}
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* // Rewrite every XML part, and add one new file.
|
|
144
|
+
* const patched = await rewriteZip(docx, {
|
|
145
|
+
* filter: (e) => e.name.endsWith('.xml'),
|
|
146
|
+
* transform: (data) => new TextDecoder().decode(data).replace(/&#10;/g, ' '),
|
|
147
|
+
* inject: [{ name: 'meta.json', data: JSON.stringify({ patched: true }) }],
|
|
148
|
+
* });
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export declare const rewriteZip: (bytes: Uint8Array, options?: RewriteZipOptions) => Promise<Uint8Array>;
|
|
152
|
+
/**
|
|
153
|
+
* @description: Build a ZIP from scratch, every entry STORED. No compression, so this is
|
|
154
|
+
* for containers whose payload is already compressed (media, an OOXML bundle being
|
|
155
|
+
* assembled) rather than for shrinking anything.
|
|
156
|
+
* @param {ReadonlyArray<{ name: string; data: Uint8Array | string }>} files
|
|
157
|
+
* @return {Uint8Array}
|
|
158
|
+
*/
|
|
159
|
+
export declare const createZip: (files: ReadonlyArray<{
|
|
160
|
+
name: string;
|
|
161
|
+
data: Uint8Array | string;
|
|
162
|
+
}>) => Uint8Array;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { init } from './init';
|
|
2
2
|
import { addNS, h } from './h';
|
|
3
3
|
import { vnode } from './vnode';
|
|
4
|
-
import { Chain, create } from '
|
|
4
|
+
import { Chain, create } from '@/utils/chain';
|
|
5
5
|
import { htmlDomApi } from './htmlDomApi';
|
|
6
6
|
import { modules } from './modules';
|
|
7
7
|
import { attributesModule } from './modules/attributes';
|
package/dist/src/vnode/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../../rolldown-runtime-I3TIJKkN.js";function
|
|
1
|
+
import{n as e}from"../../rolldown-runtime-I3TIJKkN.js";import{n as t,t as n}from"../../chain-CTywmh_H.js";function o(e,t,n,o,r){return{sel:e,data:t,children:n,text:o,elm:r,key:void 0===t?void 0:t.key}}function r(e){if(i(e)){for(;e&&i(e);)e=l(e).parent;return e??null}return e.parentNode}function i(e){return 11===e.nodeType}function l(e,t){const n=e;return n.parent??=t??null,n.firstChildNode??=e.firstChild,n.lastChildNode??=e.lastChild,n}var s={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return l(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(i(e)){let t=e;for(;t&&i(t);)t=l(t).parent;e=t??e}i(t)&&(t=l(t,e)),n&&i(n)&&(n=l(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){i(t)&&(t=l(t,e)),e.appendChild(t)},parentNode:r,nextSibling:function(e){if(i(e)){const t=l(e),n=r(t);if(n&&t.lastChildNode){const e=Array.from(n.childNodes);return e[e.indexOf(t.lastChildNode)+1]??null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:i},a=/* @__PURE__ */e({array:()=>c,isStr:()=>d,isVnode:()=>f,primitive:()=>u}),c=Array.isArray,d=e=>"string"==typeof e;function u(e){return"string"==typeof e||"number"==typeof e}function f(e){return!!e?.sel}function m(e,t){let n;const o=t.elm;let r=e.data&&e.data.attrs,i=t.data&&t.data.attrs;if((r||i)&&r!==i){for(n in r=r||{},i=i||{},i){const e=i[n];r[n]!==e&&(!0===e?o.setAttribute(n,""):!1===e?o.removeAttribute(n):120!==n.charCodeAt(0)?o.setAttribute(n,e):58===n.charCodeAt(3)?o.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?o.setAttributeNS("http://www.w3.org/1999/xlink",n,e):o.setAttribute(n,`${e}`))}for(n in r)n in i||o.removeAttribute(n)}}var p={create:m,update:m};function v(e,t){let n,o;const r=t.elm;let i=e.data&&e.data.class,l=t.data&&t.data.class;if((i||l)&&i!==l){for(o in i=i||{},l=l||{},i)i[o]&&!Object.prototype.hasOwnProperty.call(l,o)&&r.classList.remove(o);for(o in l)n=l[o],n!==i[o]&&r.classList[n?"add":"remove"](o)}}var h={create:v,update:v};function y(e,t,n){if((e=>"function"==typeof e)(e))e.call(t,n,t);else if("object"==typeof e)for(let o=0;o<e.length;o++)y(e[o],t,n)}function g(e,t){const n=e.type,o=t.data&&t.data.on;o&&o[n]&&y(o[n],t,e)}function C(e,t){const n=e?.data?.on,o=e?.listener,r=e.elm,i=t?.data?.on,l=t&&t.elm;let s;if(n!==i){if(n&&o)if(i)for(s in n)i[s]||r.removeEventListener(s,o,!1);else for(s in n)r.removeEventListener(s,o,!1);if(i){const o=t.listener=e.listener||function e(t){g(t,e.vnode)};if(n)for(s in i)n[s]||l.addEventListener(s,o,!1);else for(s in i)l.addEventListener(s,o,!1)}}}var x={create:C,update:C,destroy:C};function N(e,t){let n,o,r;const i=t.elm;let l=e.data?e.data.props:void 0,s=t.data?t.data.props:void 0;if((l||s)&&l!==s)for(n in l=l||{},s=s||{},s)o=s[n],r=l[n],r===o||"value"===n&&i[n]===o||(i[n]=o)}var b={create:N,update:N},w=!1;function A(e,t){let n,o;const r=t.elm;let i=e.data.style,l=t.data.style;if((i||l)&&i!==l){for(o in i=i||{},l=l||{},i)l[o]||("-"===o[0]&&"-"===o[1]?r.style.removeProperty(o):r.style[o]="");for(o in l)n=l[o],n!==i[o]&&("-"===o[0]&&"-"===o[1]?r.style.setProperty(o,n):r.style[o]=n)}}var E={pre:function(){w=!1},create:A,update:A,destroy:function(e){let t,n;const o=e.elm,r=e.data.style;if(r&&(t=r.destroy))for(n in t)o.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let o;w||(w=!0);const r=e.elm;let i=0;const l=n.remove;let s=0;const a=[];for(o in l)a.push(o),r.style[o]=l[o];const c=getComputedStyle(r)["transition-property"].split(", ");for(;i<c.length;++i)-1!==a.indexOf(c[i])&&s++;r.addEventListener("transitionend",function(e){e.target===r&&--s,0===s&&t()})}},T={attributesModule:p,classModule:h,eventListenersModule:x,propsModule:b,styleModule:E};function L(e,t){return e.key===t.key&&e.sel===t.sel}function S(e,t,n){const o={};for(let r=t;r<=n;++r){const t=e[r]?.key;void 0!==t&&(o[t]=r)}return o}var k=o("",{},[],void 0,void 0);function B(){const e=s,t={create:[],update:[],destroy:[]};for(const o of Object.keys(t)){t[o]=[];for(const e of Object.keys(T)){const n=T[e][o];void 0!==n&&t[o].push(n)}}function n(t){const n=t.id?"#"+t.id:"",r=t.className?"."+t.className.split(" ").join("."):"";return o(e.tagName(t).toLowerCase()+n+r,{},[],void 0,t)}function r(e){return void 0===e}function i(e){return void 0!==e}function l(n){let o;const i=n.children,s=n.sel;if("!"===s)r(n.text)&&(n.text=""),n.elm=e.createComment(`${n.text}`);else if(void 0!==s){const r=s.indexOf("#"),a=s.indexOf(".",r),d=r>0?r:s.length,f=a>0?a:s.length,m=-1!==r||-1!==a?s.slice(0,Math.min(d,f)):s,p=n.elm=e.createElement(m);for(d<f&&p.setAttribute("id",s.slice(d+1,f)),a>0&&p.setAttribute("class",s.slice(f+1).replace(/\./g," ")),o=0;o<t.create.length;++o)t.create[o](k,n);if(c(i))for(o=0;o<i.length;++o){const t=i[o];null!=t&&e.appendChild(p,l(t))}else u(n.text)&&e.appendChild(p,e.createTextNode(`${n.text}`))}else n.elm=e.createTextNode(`${n.text}`);return n.elm}function a(e){if(void 0!==e.data){for(let n=0;n<t.destroy.length;++n)t.destroy[n](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&"number"!=typeof n&&a(n)}}}function d(t){return function(){const n=e.parentNode(t);e.removeChild(n,t)}}function f(t,n,o,r){for(;o<=r;++o){let r;const l=n[o];null!=l&&(i(l.sel)?(a(l),r=d(l.elm),r()):e.removeChild(t,l.elm))}}function m(t,n,o){let i,s,a,c,d=0,u=0,m=n.length-1,v=o.length-1,h=n[0],y=n[m],g=o[0],C=o[v];for(;d<=m&&u<=v;)null==h?h=n[++d]:null==y?y=n[--m]:null==g?g=o[++u]:null==C?C=o[--v]:L(h,g)?(p(h,g),h=n[++d],g=o[++u]):L(y,C)?(p(y,C),y=n[--m],C=o[--v]):L(h,C)?(p(h,C),e.insertBefore(t,h.elm,e.nextSibling(y.elm)),h=n[++d],C=o[--v]):L(y,g)?(p(y,g),e.insertBefore(t,y.elm,h.elm),y=n[--m],g=o[++u]):(void 0===i&&(i=S(n,d,m)),s=i[g.key],r(s)?e.insertBefore(t,l(g),h.elm):(a=n[s],a.sel!==g.sel?e.insertBefore(t,l(g),h.elm):(p(a,g),n[s]=void 0,e.insertBefore(t,a.elm,h.elm))),g=o[++u]);(d<=m||u<=v)&&(d>m?(c=null==o[v+1]?null:o[v+1].elm,function(t,n,o,r,i){for(;r<=i;++r){const i=o[r];null!=i&&e.insertBefore(t,l(i),n)}}(t,c,o,u,v)):f(t,n,d,m))}function p(e,n){if(void 0!==n.data)for(let r=0;r<t.update.length;++r)t.update[r](e,n);const o=n.elm=e.elm,l=e.children,s=n.children;e!==n&&r(n.text)&&i(l)&&i(s)&&l!==s&&m(o,l,s)}return function(t,o){let r,i;return function(e){return void 0!==e.sel}(t)||(t=n(t)),L(t,o)?p(t,o):(r=t.elm,i=e.parentNode(r),l(o),null!=i&&(e.insertBefore(i,o.elm,e.nextSibling(r)),f(i,[t],0,0))),o}}function O(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let o=0;o<t.length;++o){const e=t[o];if("string"==typeof e||"number"==typeof e)continue;const n=e.data;void 0!==n&&O(n,e.children,e.sel)}}function j(e,t,n){let r,i,l,s={};if(void 0!==n?(null!=t&&(s=t),c(n)?r=n:u(n)?i=n:n&&n.sel&&(r=[n])):void 0!==t&&null!=t&&(c(t)?r=t:u(t)?i=t:f(t)?r=[t]:s=t),void 0!==r)for(l=0;l<r.length;++l){const e=r[l];u(e)&&(r[l]=o(void 0,void 0,void 0,e,void 0))}return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||O(s,r,e),o(e,s,r,i,void 0)}export{n as Chain,O as addNS,p as attributesModule,h as classModule,t as create,x as eventListenersModule,j as h,s as htmlDomApi,B as init,a as is,T as modules,b as propsModule,E as styleModule,o as vnode};
|
package/dist/src/vnode/is.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|