defuss 3.4.5 → 3.4.6

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/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var dom = require('./dom-BzhVVZDv.cjs');
3
+ var dom = require('./dom-C679BHZu.cjs');
4
4
  require('defuss-runtime');
5
- var mount = require('./mount-BOeNgYt6.cjs');
5
+ var mount = require('./mount-DcLKJdyY.cjs');
6
6
 
7
7
  const inDevMode = typeof process !== "undefined" && process.env ? process.env.NODE_ENV !== "production" : false;
8
8
 
@@ -832,10 +832,7 @@ function createDomFromChild(child, globals) {
832
832
  }
833
833
  function shouldPreserveFormStateAttribute(el, attrName, vnode) {
834
834
  const tag = el.tagName.toLowerCase();
835
- const hasExplicit = Object.prototype.hasOwnProperty.call(
836
- vnode.attributes ?? {},
837
- attrName
838
- );
835
+ const hasExplicit = Object.hasOwn(vnode.attributes ?? {}, attrName);
839
836
  if (hasExplicit) return false;
840
837
  if (tag === "input") return attrName === "value" || attrName === "checked";
841
838
  if (tag === "textarea") return attrName === "value";
@@ -850,10 +847,10 @@ function patchElementInPlace(el, vnode, globals) {
850
847
  const { name } = attr;
851
848
  if (name === "key") continue;
852
849
  if (name.startsWith("on")) continue;
853
- if (name === "class" && (Object.prototype.hasOwnProperty.call(nextAttrs, "class") || Object.prototype.hasOwnProperty.call(nextAttrs, "className"))) {
850
+ if (name === "class" && (Object.hasOwn(nextAttrs, "class") || Object.hasOwn(nextAttrs, "className"))) {
854
851
  continue;
855
852
  }
856
- if (!Object.prototype.hasOwnProperty.call(nextAttrs, name)) {
853
+ if (!Object.hasOwn(nextAttrs, name)) {
857
854
  if (shouldPreserveFormStateAttribute(el, name, vnode)) continue;
858
855
  el.removeAttribute(name);
859
856
  }
@@ -886,10 +883,7 @@ function patchElementInPlace(el, vnode, globals) {
886
883
  }
887
884
  const tag = el.tagName.toLowerCase();
888
885
  if (tag === "textarea") {
889
- const isControlled = Object.prototype.hasOwnProperty.call(
890
- nextAttrs,
891
- "value"
892
- );
886
+ const isControlled = Object.hasOwn(nextAttrs, "value");
893
887
  const isActive = el.ownerDocument?.activeElement === el;
894
888
  if (isActive && !isControlled) return;
895
889
  }
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { M as createStore, h as createRef, $, r as isRef } from './dom-CX5zLg8V.mjs';
2
- export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, N as CallChainImpl, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, O as addElementEvent, d as applyStyles, P as areDomNodesEqual, Q as checkElementVisibility, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, S as clearElementEvents, g as createInPlaceErrorMessageVNode, T as deepEquals, U as dequery, V as domNodeToVNode, W as emptyImpl, Y as getAllFormValues, i as getComponentInstance, Z as getDefaultDequeryOptions, _ as getEventMap, a0 as getMimeType, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, a1 as htmlStringToVNodes, p as isComponentRoot, a2 as isDequery, a3 as isDequeryOptionsObject, a4 as isHTML, q as isJSX, a5 as isMarkup, a6 as isSVG, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, a7 as parseDOM, x as parseEventPropName, y as performTransition, a8 as processAllFormElements, a9 as queueCallback, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, aa as removeElementEvent, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, ab as renderMarkup, ac as replaceDomWithVdom, ad as scrollHelper, ae as shallowEquals, K as unregisterComponent, L as updateDom, af as updateDomWithVdom, ag as waitForDOM, ah as webstorage } from './dom-CX5zLg8V.mjs';
1
+ import { M as createStore, h as createRef, $, r as isRef } from './dom-DUPOK7Hs.mjs';
2
+ export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, N as CallChainImpl, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, O as addElementEvent, d as applyStyles, P as areDomNodesEqual, Q as checkElementVisibility, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, S as clearElementEvents, g as createInPlaceErrorMessageVNode, T as deepEquals, U as dequery, V as domNodeToVNode, W as emptyImpl, Y as getAllFormValues, i as getComponentInstance, Z as getDefaultDequeryOptions, _ as getEventMap, a0 as getMimeType, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, a1 as htmlStringToVNodes, p as isComponentRoot, a2 as isDequery, a3 as isDequeryOptionsObject, a4 as isHTML, q as isJSX, a5 as isMarkup, a6 as isSVG, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, a7 as parseDOM, x as parseEventPropName, y as performTransition, a8 as processAllFormElements, a9 as queueCallback, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, aa as removeElementEvent, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, ab as renderMarkup, ac as replaceDomWithVdom, ad as scrollHelper, ae as shallowEquals, K as unregisterComponent, L as updateDom, af as updateDomWithVdom, ag as waitForDOM, ah as webstorage } from './dom-DUPOK7Hs.mjs';
3
3
  import 'defuss-runtime';
4
- export { m as mount, u as unmount } from './mount-DFegBldg.mjs';
4
+ export { m as mount, u as unmount } from './mount-DNlJN8xI.mjs';
5
5
 
6
6
  const inDevMode = typeof process !== "undefined" && process.env ? process.env.NODE_ENV !== "production" : false;
7
7
 
@@ -831,10 +831,7 @@ function createDomFromChild(child, globals) {
831
831
  }
832
832
  function shouldPreserveFormStateAttribute(el, attrName, vnode) {
833
833
  const tag = el.tagName.toLowerCase();
834
- const hasExplicit = Object.prototype.hasOwnProperty.call(
835
- vnode.attributes ?? {},
836
- attrName
837
- );
834
+ const hasExplicit = Object.hasOwn(vnode.attributes ?? {}, attrName);
838
835
  if (hasExplicit) return false;
839
836
  if (tag === "input") return attrName === "value" || attrName === "checked";
840
837
  if (tag === "textarea") return attrName === "value";
@@ -849,10 +846,10 @@ function patchElementInPlace(el, vnode, globals) {
849
846
  const { name } = attr;
850
847
  if (name === "key") continue;
851
848
  if (name.startsWith("on")) continue;
852
- if (name === "class" && (Object.prototype.hasOwnProperty.call(nextAttrs, "class") || Object.prototype.hasOwnProperty.call(nextAttrs, "className"))) {
849
+ if (name === "class" && (Object.hasOwn(nextAttrs, "class") || Object.hasOwn(nextAttrs, "className"))) {
853
850
  continue;
854
851
  }
855
- if (!Object.prototype.hasOwnProperty.call(nextAttrs, name)) {
852
+ if (!Object.hasOwn(nextAttrs, name)) {
856
853
  if (shouldPreserveFormStateAttribute(el, name, vnode)) continue;
857
854
  el.removeAttribute(name);
858
855
  }
@@ -885,10 +882,7 @@ function patchElementInPlace(el, vnode, globals) {
885
882
  }
886
883
  const tag = el.tagName.toLowerCase();
887
884
  if (tag === "textarea") {
888
- const isControlled = Object.prototype.hasOwnProperty.call(
889
- nextAttrs,
890
- "value"
891
- );
885
+ const isControlled = Object.hasOwn(nextAttrs, "value");
892
886
  const isActive = el.ownerDocument?.activeElement === el;
893
887
  if (isActive && !isControlled) return;
894
888
  }
@@ -0,0 +1,26 @@
1
+ import { J as renderIsomorphicSync, z as registerComponent, w as observeUnmount, K as unregisterComponent } from './dom-DUPOK7Hs.mjs';
2
+
3
+ function mount(container, Component, initialProps) {
4
+ while (container.firstChild) {
5
+ container.removeChild(container.firstChild);
6
+ }
7
+ const vnode = Component(initialProps);
8
+ renderIsomorphicSync(vnode, container, globalThis);
9
+ registerComponent(
10
+ container,
11
+ Component,
12
+ { ...initialProps }
13
+ );
14
+ if (container.parentNode) {
15
+ observeUnmount(container, () => unregisterComponent(container));
16
+ }
17
+ return container;
18
+ }
19
+ function unmount(container) {
20
+ unregisterComponent(container);
21
+ while (container.firstChild) {
22
+ container.removeChild(container.firstChild);
23
+ }
24
+ }
25
+
26
+ export { mount as m, unmount as u };
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var dom = require('./dom-C679BHZu.cjs');
4
+
5
+ function mount(container, Component, initialProps) {
6
+ while (container.firstChild) {
7
+ container.removeChild(container.firstChild);
8
+ }
9
+ const vnode = Component(initialProps);
10
+ dom.renderIsomorphicSync(vnode, container, globalThis);
11
+ dom.registerComponent(
12
+ container,
13
+ Component,
14
+ { ...initialProps }
15
+ );
16
+ if (container.parentNode) {
17
+ dom.observeUnmount(container, () => dom.unregisterComponent(container));
18
+ }
19
+ return container;
20
+ }
21
+ function unmount(container) {
22
+ dom.unregisterComponent(container);
23
+ while (container.firstChild) {
24
+ container.removeChild(container.firstChild);
25
+ }
26
+ }
27
+
28
+ exports.mount = mount;
29
+ exports.unmount = unmount;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dom = require('../dom-BzhVVZDv.cjs');
4
- var mount = require('../mount-BOeNgYt6.cjs');
3
+ var dom = require('../dom-C679BHZu.cjs');
4
+ var mount = require('../mount-DcLKJdyY.cjs');
5
5
  require('defuss-runtime');
6
6
 
7
7
  const renderSync = (virtualNode, parentDomElement = document.documentElement) => {
@@ -1,6 +1,6 @@
1
- import { x as parseEventPropName, A as registerDelegatedEvent, w as observeUnmount, n as globalScopeDomApis, I as renderIsomorphicAsync, J as renderIsomorphicSync } from '../dom-CX5zLg8V.mjs';
2
- export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, y as performTransition, z as registerComponent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, H as renderInto, K as unregisterComponent, L as updateDom } from '../dom-CX5zLg8V.mjs';
3
- export { m as mount, u as unmount } from '../mount-DFegBldg.mjs';
1
+ import { x as parseEventPropName, A as registerDelegatedEvent, w as observeUnmount, n as globalScopeDomApis, I as renderIsomorphicAsync, J as renderIsomorphicSync } from '../dom-DUPOK7Hs.mjs';
2
+ export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, y as performTransition, z as registerComponent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, H as renderInto, K as unregisterComponent, L as updateDom } from '../dom-DUPOK7Hs.mjs';
3
+ export { m as mount, u as unmount } from '../mount-DNlJN8xI.mjs';
4
4
  import 'defuss-runtime';
5
5
 
6
6
  const renderSync = (virtualNode, parentDomElement = document.documentElement) => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var dom = require('../../dom-BzhVVZDv.cjs');
3
+ var dom = require('../../dom-C679BHZu.cjs');
4
4
  require('defuss-runtime');
5
5
 
6
6
 
@@ -1,2 +1,2 @@
1
- export { a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, g as createInPlaceErrorMessageVNode, h as createRef, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, y as performTransition, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, L as updateDom } from '../../dom-CX5zLg8V.mjs';
1
+ export { a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, g as createInPlaceErrorMessageVNode, h as createRef, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, y as performTransition, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, L as updateDom } from '../../dom-DUPOK7Hs.mjs';
2
2
  import 'defuss-runtime';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dom = require('../dom-BzhVVZDv.cjs');
4
- var mount = require('../mount-BOeNgYt6.cjs');
3
+ var dom = require('../dom-C679BHZu.cjs');
4
+ var mount = require('../mount-DcLKJdyY.cjs');
5
5
  require('defuss-runtime');
6
6
 
7
7
 
@@ -1,3 +1,3 @@
1
- export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, x as parseEventPropName, y as performTransition, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, K as unregisterComponent, L as updateDom } from '../dom-CX5zLg8V.mjs';
2
- export { m as mount, u as unmount } from '../mount-DFegBldg.mjs';
1
+ export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, n as globalScopeDomApis, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, x as parseEventPropName, y as performTransition, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, G as render, H as renderInto, I as renderIsomorphicAsync, J as renderIsomorphicSync, K as unregisterComponent, L as updateDom } from '../dom-DUPOK7Hs.mjs';
2
+ export { m as mount, u as unmount } from '../mount-DNlJN8xI.mjs';
3
3
  import 'defuss-runtime';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var HappyDom = require('happy-dom');
4
- var dom = require('../dom-BzhVVZDv.cjs');
4
+ var dom = require('../dom-C679BHZu.cjs');
5
5
  var serializeHtml = require('w3c-xmlserializer');
6
- var mount = require('../mount-BOeNgYt6.cjs');
6
+ var mount = require('../mount-DcLKJdyY.cjs');
7
7
  require('defuss-runtime');
8
8
 
9
9
  function _interopNamespaceDefault(e) {
@@ -1,8 +1,8 @@
1
1
  import * as HappyDom from 'happy-dom';
2
- import { I as renderIsomorphicAsync, J as renderIsomorphicSync, n as globalScopeDomApis } from '../dom-CX5zLg8V.mjs';
3
- export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, x as parseEventPropName, y as performTransition, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, H as renderInto, K as unregisterComponent, L as updateDom } from '../dom-CX5zLg8V.mjs';
2
+ import { I as renderIsomorphicAsync, J as renderIsomorphicSync, n as globalScopeDomApis } from '../dom-DUPOK7Hs.mjs';
3
+ export { C as CAPTURE_ONLY_EVENTS, a as CLASS_ATTRIBUTE_NAME, D as DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE, b as DEFAULT_TRANSITION_CONFIG, F as Fragment, R as REF_ATTRIBUTE_NAME, X as XLINK_ATTRIBUTE_NAME, c as XMLNS_ATTRIBUTE_NAME, d as applyStyles, e as clearDelegatedEvents, f as clearDelegatedEventsDeep, g as createInPlaceErrorMessageVNode, h as createRef, i as getComponentInstance, j as getRegisteredEventKeys, k as getRegisteredEventTypes, l as getRenderer, m as getTransitionStyles, o as handleLifecycleEventsForOnMount, p as isComponentRoot, q as isJSX, r as isRef, s as jsx, t as jsxDEV, u as jsxs, v as nsMap, w as observeUnmount, x as parseEventPropName, y as performTransition, z as registerComponent, A as registerDelegatedEvent, B as removeDelegatedEvent, E as removeDelegatedEventByKey, H as renderInto, K as unregisterComponent, L as updateDom } from '../dom-DUPOK7Hs.mjs';
4
4
  import serializeHtml from 'w3c-xmlserializer';
5
- export { m as mount, u as unmount } from '../mount-DFegBldg.mjs';
5
+ export { m as mount, u as unmount } from '../mount-DNlJN8xI.mjs';
6
6
  import 'defuss-runtime';
7
7
 
8
8
  const setupDomApis = (options = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "defuss",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"