@pyreon/runtime-dom 0.12.10 → 0.12.11
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/lib/analysis/index.js.html +1 -1
- package/lib/index.js +33 -7
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +15 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/hydration-debug.ts +4 -1
- package/src/index.ts +5 -2
- package/src/mount.ts +4 -1
- package/src/nodes.ts +4 -1
- package/src/props.ts +17 -1
- package/src/template.ts +29 -1
- package/src/tests/mount.test.ts +69 -0
- package/src/tests/template.test.ts +55 -0
- package/src/transition.ts +7 -1
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"d98f667a-1","name":"delegate.ts"},{"uid":"d98f667a-3","name":"hydration-debug.ts"},{"uid":"d98f667a-5","name":"devtools.ts"},{"uid":"d98f667a-7","name":"nodes.ts"},{"uid":"d98f667a-9","name":"props.ts"},{"uid":"d98f667a-11","name":"mount.ts"},{"uid":"d98f667a-13","name":"hydrate.ts"},{"uid":"d98f667a-15","name":"keep-alive.ts"},{"uid":"d98f667a-17","name":"template.ts"},{"uid":"d98f667a-19","name":"transition.ts"},{"uid":"d98f667a-21","name":"transition-group.ts"},{"uid":"d98f667a-23","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"d98f667a-1":{"renderedLength":1990,"gzipLength":976,"brotliLength":0,"metaUid":"d98f667a-0"},"d98f667a-3":{"renderedLength":662,"gzipLength":370,"brotliLength":0,"metaUid":"d98f667a-2"},"d98f667a-5":{"renderedLength":6803,"gzipLength":2095,"brotliLength":0,"metaUid":"d98f667a-4"},"d98f667a-7":{"renderedLength":16374,"gzipLength":4397,"brotliLength":0,"metaUid":"d98f667a-6"},"d98f667a-9":{"renderedLength":6310,"gzipLength":2403,"brotliLength":0,"metaUid":"d98f667a-8"},"d98f667a-11":{"renderedLength":11542,"gzipLength":3695,"brotliLength":0,"metaUid":"d98f667a-10"},"d98f667a-13":{"renderedLength":7694,"gzipLength":2333,"brotliLength":0,"metaUid":"d98f667a-12"},"d98f667a-15":{"renderedLength":1473,"gzipLength":701,"brotliLength":0,"metaUid":"d98f667a-14"},"d98f667a-17":{"renderedLength":5319,"gzipLength":2069,"brotliLength":0,"metaUid":"d98f667a-16"},"d98f667a-19":{"renderedLength":4017,"gzipLength":1311,"brotliLength":0,"metaUid":"d98f667a-18"},"d98f667a-21":{"renderedLength":6362,"gzipLength":1937,"brotliLength":0,"metaUid":"d98f667a-20"},"d98f667a-23":{"renderedLength":769,"gzipLength":474,"brotliLength":0,"metaUid":"d98f667a-22"}},"nodeMetas":{"d98f667a-0":{"id":"/src/delegate.ts","moduleParts":{"index.js":"d98f667a-1"},"imported":[{"uid":"d98f667a-24"}],"importedBy":[{"uid":"d98f667a-22"},{"uid":"d98f667a-12"},{"uid":"d98f667a-8"}]},"d98f667a-2":{"id":"/src/hydration-debug.ts","moduleParts":{"index.js":"d98f667a-3"},"imported":[],"importedBy":[{"uid":"d98f667a-22"},{"uid":"d98f667a-12"}]},"d98f667a-4":{"id":"/src/devtools.ts","moduleParts":{"index.js":"d98f667a-5"},"imported":[],"importedBy":[{"uid":"d98f667a-22"},{"uid":"d98f667a-10"}]},"d98f667a-6":{"id":"/src/nodes.ts","moduleParts":{"index.js":"d98f667a-7"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"}],"importedBy":[{"uid":"d98f667a-12"},{"uid":"d98f667a-10"}]},"d98f667a-8":{"id":"/src/props.ts","moduleParts":{"index.js":"d98f667a-9"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"},{"uid":"d98f667a-0"}],"importedBy":[{"uid":"d98f667a-22"},{"uid":"d98f667a-12"},{"uid":"d98f667a-10"}]},"d98f667a-10":{"id":"/src/mount.ts","moduleParts":{"index.js":"d98f667a-11"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"},{"uid":"d98f667a-4"},{"uid":"d98f667a-6"},{"uid":"d98f667a-8"}],"importedBy":[{"uid":"d98f667a-22"},{"uid":"d98f667a-12"},{"uid":"d98f667a-14"},{"uid":"d98f667a-16"},{"uid":"d98f667a-20"}]},"d98f667a-12":{"id":"/src/hydrate.ts","moduleParts":{"index.js":"d98f667a-13"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"},{"uid":"d98f667a-0"},{"uid":"d98f667a-2"},{"uid":"d98f667a-10"},{"uid":"d98f667a-6"},{"uid":"d98f667a-8"}],"importedBy":[{"uid":"d98f667a-22"}]},"d98f667a-14":{"id":"/src/keep-alive.ts","moduleParts":{"index.js":"d98f667a-15"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"},{"uid":"d98f667a-10"}],"importedBy":[{"uid":"d98f667a-22"}]},"d98f667a-16":{"id":"/src/template.ts","moduleParts":{"index.js":"d98f667a-17"},"imported":[{"uid":"d98f667a-24"},{"uid":"d98f667a-10"}],"importedBy":[{"uid":"d98f667a-22"}]},"d98f667a-18":{"id":"/src/transition.ts","moduleParts":{"index.js":"d98f667a-19"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"}],"importedBy":[{"uid":"d98f667a-22"}]},"d98f667a-20":{"id":"/src/transition-group.ts","moduleParts":{"index.js":"d98f667a-21"},"imported":[{"uid":"d98f667a-25"},{"uid":"d98f667a-24"},{"uid":"d98f667a-10"}],"importedBy":[{"uid":"d98f667a-22"}]},"d98f667a-22":{"id":"/src/index.ts","moduleParts":{"index.js":"d98f667a-23"},"imported":[{"uid":"d98f667a-0"},{"uid":"d98f667a-12"},{"uid":"d98f667a-2"},{"uid":"d98f667a-14"},{"uid":"d98f667a-10"},{"uid":"d98f667a-8"},{"uid":"d98f667a-16"},{"uid":"d98f667a-18"},{"uid":"d98f667a-20"},{"uid":"d98f667a-4"}],"importedBy":[],"isEntry":true},"d98f667a-24":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"d98f667a-0"},{"uid":"d98f667a-12"},{"uid":"d98f667a-14"},{"uid":"d98f667a-10"},{"uid":"d98f667a-8"},{"uid":"d98f667a-16"},{"uid":"d98f667a-18"},{"uid":"d98f667a-20"},{"uid":"d98f667a-6"}]},"d98f667a-25":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"d98f667a-12"},{"uid":"d98f667a-14"},{"uid":"d98f667a-10"},{"uid":"d98f667a-8"},{"uid":"d98f667a-18"},{"uid":"d98f667a-20"},{"uid":"d98f667a-6"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|
package/lib/index.js
CHANGED
|
@@ -77,7 +77,7 @@ function setupDelegation(container) {
|
|
|
77
77
|
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/hydration-debug.ts
|
|
80
|
-
let _enabled =
|
|
80
|
+
let _enabled = import.meta.env?.DEV === true;
|
|
81
81
|
function enableHydrationWarnings() {
|
|
82
82
|
_enabled = true;
|
|
83
83
|
}
|
|
@@ -303,7 +303,7 @@ function installDevTools() {
|
|
|
303
303
|
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/nodes.ts
|
|
306
|
-
const __DEV__$4 =
|
|
306
|
+
const __DEV__$4 = import.meta.env?.DEV === true;
|
|
307
307
|
/**
|
|
308
308
|
* Move all nodes strictly between `start` and `end` into a throwaway
|
|
309
309
|
* DocumentFragment, detaching them from the live DOM in O(n) top-level moves.
|
|
@@ -814,7 +814,7 @@ function moveEntryBefore(parent, startNode, before) {
|
|
|
814
814
|
|
|
815
815
|
//#endregion
|
|
816
816
|
//#region src/props.ts
|
|
817
|
-
const __DEV__$3 =
|
|
817
|
+
const __DEV__$3 = import.meta.env?.DEV === true;
|
|
818
818
|
let _customSanitizer = null;
|
|
819
819
|
/**
|
|
820
820
|
* Set a custom HTML sanitizer used by `innerHTML` and `sanitizeHtml()`.
|
|
@@ -1058,6 +1058,10 @@ function setStaticProp(el, key, value) {
|
|
|
1058
1058
|
else el.removeAttribute(key);
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
|
+
if (el.namespaceURI && el.namespaceURI !== "http://www.w3.org/1999/xhtml") {
|
|
1062
|
+
el.setAttribute(key, String(value));
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1061
1065
|
if (key in el) {
|
|
1062
1066
|
el[key] = value;
|
|
1063
1067
|
return;
|
|
@@ -1071,7 +1075,7 @@ function setStaticProp(el, key, value) {
|
|
|
1071
1075
|
|
|
1072
1076
|
//#endregion
|
|
1073
1077
|
//#region src/mount.ts
|
|
1074
|
-
const __DEV__$2 =
|
|
1078
|
+
const __DEV__$2 = import.meta.env?.DEV === true;
|
|
1075
1079
|
const noop$1 = () => {};
|
|
1076
1080
|
let _elementDepth = 0;
|
|
1077
1081
|
const _mountingStack = [];
|
|
@@ -1844,10 +1848,32 @@ function _tpl(html, bind) {
|
|
|
1844
1848
|
cleanup: bind(el)
|
|
1845
1849
|
};
|
|
1846
1850
|
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Mount a children slot inside a template.
|
|
1853
|
+
*
|
|
1854
|
+
* Compiler emits this instead of `createTextNode()` when it detects a
|
|
1855
|
+
* children expression (`props.children`, `own.children`). Unlike text nodes,
|
|
1856
|
+
* children can be VNodes, arrays, or reactive accessors — all handled by
|
|
1857
|
+
* `mountChild()`.
|
|
1858
|
+
*
|
|
1859
|
+
* @param children - The children value (VNode, string, array, or accessor)
|
|
1860
|
+
* @param parent - The parent element in the cloned template
|
|
1861
|
+
* @param placeholder - The comment placeholder node to replace
|
|
1862
|
+
* @returns Cleanup function
|
|
1863
|
+
*/
|
|
1864
|
+
function _mountSlot(children, parent, placeholder) {
|
|
1865
|
+
if (children == null || children === false || children === true) {
|
|
1866
|
+
parent.removeChild(placeholder);
|
|
1867
|
+
return null;
|
|
1868
|
+
}
|
|
1869
|
+
const cleanup = mountChild(children, parent, placeholder);
|
|
1870
|
+
parent.removeChild(placeholder);
|
|
1871
|
+
return cleanup;
|
|
1872
|
+
}
|
|
1847
1873
|
|
|
1848
1874
|
//#endregion
|
|
1849
1875
|
//#region src/transition.ts
|
|
1850
|
-
const __DEV__$1 =
|
|
1876
|
+
const __DEV__$1 = import.meta.env?.DEV === true;
|
|
1851
1877
|
/**
|
|
1852
1878
|
* Transition — adds CSS enter/leave animation classes to a single child element,
|
|
1853
1879
|
* controlled by the reactive `show` prop.
|
|
@@ -2178,7 +2204,7 @@ function TransitionGroup(props) {
|
|
|
2178
2204
|
|
|
2179
2205
|
//#endregion
|
|
2180
2206
|
//#region src/index.ts
|
|
2181
|
-
const __DEV__ =
|
|
2207
|
+
const __DEV__ = import.meta.env?.DEV === true;
|
|
2182
2208
|
/**
|
|
2183
2209
|
* Mount a VNode tree into a container element.
|
|
2184
2210
|
* Clears the container first, then mounts the given child.
|
|
@@ -2198,5 +2224,5 @@ function mount(root, container) {
|
|
|
2198
2224
|
const render = mount;
|
|
2199
2225
|
|
|
2200
2226
|
//#endregion
|
|
2201
|
-
export { DELEGATED_EVENTS, KeepAlive, Transition, TransitionGroup, applyProps as _applyProps, applyProps, _bindDirect, _bindText, _tpl, applyProp, createTemplate, delegatedPropName, disableHydrationWarnings, enableHydrationWarnings, hydrateRoot, mount, mountChild, render, sanitizeHtml, setSanitizer, setupDelegation };
|
|
2227
|
+
export { DELEGATED_EVENTS, KeepAlive, Transition, TransitionGroup, applyProps as _applyProps, applyProps, _bindDirect, _bindText, _mountSlot, _tpl, applyProp, createTemplate, delegatedPropName, disableHydrationWarnings, enableHydrationWarnings, hydrateRoot, mount, mountChild, render, sanitizeHtml, setSanitizer, setupDelegation };
|
|
2202
2228
|
//# sourceMappingURL=index.js.map
|