solid-js 1.4.3 → 1.4.4

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/dev.cjs CHANGED
@@ -161,17 +161,21 @@ let rootCount = 0;
161
161
  function createRoot(fn, detachedOwner) {
162
162
  const listener = Listener,
163
163
  owner = Owner,
164
- root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
164
+ unowned = fn.length === 0,
165
+ root = unowned && !"_SOLID_DEV_" ? UNOWNED : {
165
166
  owned: null,
166
167
  cleanups: null,
167
168
  context: null,
168
169
  owner: detachedOwner || owner
169
- };
170
+ },
171
+ updateFn = unowned ? () => fn(() => {
172
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
173
+ }) : () => fn(() => cleanNode(root));
170
174
  if (owner) root.name = `${owner.name}-r${rootCount++}`;
171
175
  Owner = root;
172
176
  Listener = null;
173
177
  try {
174
- return runUpdates(() => fn(() => cleanNode(root)), true);
178
+ return runUpdates(updateFn, true);
175
179
  } finally {
176
180
  Listener = listener;
177
181
  Owner = owner;
@@ -946,6 +950,7 @@ function cleanNode(node) {
946
950
  }
947
951
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
948
952
  node.context = null;
953
+ delete node.sourceMap;
949
954
  }
950
955
  function reset(node, top) {
951
956
  if (!top) {
@@ -1528,7 +1533,7 @@ function Suspense(props) {
1528
1533
  resolved: false
1529
1534
  },
1530
1535
  owner = getOwner();
1531
- if (sharedConfig.context) {
1536
+ if (sharedConfig.context && sharedConfig.load) {
1532
1537
  const key = sharedConfig.context.id + sharedConfig.context.count;
1533
1538
  p = sharedConfig.load(key);
1534
1539
  if (p) {
@@ -1561,7 +1566,7 @@ function Suspense(props) {
1561
1566
  return flicker = undefined;
1562
1567
  }
1563
1568
  if (ctx && p === undefined) setHydrateContext();
1564
- const rendered = untrack(() => props.children);
1569
+ const rendered = createMemo(() => props.children);
1565
1570
  return createMemo(() => {
1566
1571
  const inFallback = store.inFallback(),
1567
1572
  visibleContent = showContent ? showContent() : true,
@@ -1571,7 +1576,7 @@ function Suspense(props) {
1571
1576
  store.resolved = true;
1572
1577
  ctx = p = undefined;
1573
1578
  resumeEffects(store.effects);
1574
- return rendered;
1579
+ return rendered();
1575
1580
  }
1576
1581
  if (!visibleFallback) return;
1577
1582
  return createRoot(disposer => {
package/dist/dev.js CHANGED
@@ -157,17 +157,21 @@ let rootCount = 0;
157
157
  function createRoot(fn, detachedOwner) {
158
158
  const listener = Listener,
159
159
  owner = Owner,
160
- root = fn.length === 0 && !"_SOLID_DEV_" ? UNOWNED : {
160
+ unowned = fn.length === 0,
161
+ root = unowned && !"_SOLID_DEV_" ? UNOWNED : {
161
162
  owned: null,
162
163
  cleanups: null,
163
164
  context: null,
164
165
  owner: detachedOwner || owner
165
- };
166
+ },
167
+ updateFn = unowned ? () => fn(() => {
168
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
169
+ }) : () => fn(() => cleanNode(root));
166
170
  if (owner) root.name = `${owner.name}-r${rootCount++}`;
167
171
  Owner = root;
168
172
  Listener = null;
169
173
  try {
170
- return runUpdates(() => fn(() => cleanNode(root)), true);
174
+ return runUpdates(updateFn, true);
171
175
  } finally {
172
176
  Listener = listener;
173
177
  Owner = owner;
@@ -942,6 +946,7 @@ function cleanNode(node) {
942
946
  }
943
947
  if (Transition && Transition.running) node.tState = 0;else node.state = 0;
944
948
  node.context = null;
949
+ delete node.sourceMap;
945
950
  }
946
951
  function reset(node, top) {
947
952
  if (!top) {
@@ -1524,7 +1529,7 @@ function Suspense(props) {
1524
1529
  resolved: false
1525
1530
  },
1526
1531
  owner = getOwner();
1527
- if (sharedConfig.context) {
1532
+ if (sharedConfig.context && sharedConfig.load) {
1528
1533
  const key = sharedConfig.context.id + sharedConfig.context.count;
1529
1534
  p = sharedConfig.load(key);
1530
1535
  if (p) {
@@ -1557,7 +1562,7 @@ function Suspense(props) {
1557
1562
  return flicker = undefined;
1558
1563
  }
1559
1564
  if (ctx && p === undefined) setHydrateContext();
1560
- const rendered = untrack(() => props.children);
1565
+ const rendered = createMemo(() => props.children);
1561
1566
  return createMemo(() => {
1562
1567
  const inFallback = store.inFallback(),
1563
1568
  visibleContent = showContent ? showContent() : true,
@@ -1567,7 +1572,7 @@ function Suspense(props) {
1567
1572
  store.resolved = true;
1568
1573
  ctx = p = undefined;
1569
1574
  resumeEffects(store.effects);
1570
- return rendered;
1575
+ return rendered();
1571
1576
  }
1572
1577
  if (!visibleFallback) return;
1573
1578
  return createRoot(disposer => {
package/dist/solid.cjs CHANGED
@@ -160,16 +160,18 @@ let ExecCount = 0;
160
160
  function createRoot(fn, detachedOwner) {
161
161
  const listener = Listener,
162
162
  owner = Owner,
163
- root = fn.length === 0 && !false ? UNOWNED : {
163
+ unowned = fn.length === 0,
164
+ root = unowned && !false ? UNOWNED : {
164
165
  owned: null,
165
166
  cleanups: null,
166
167
  context: null,
167
168
  owner: detachedOwner || owner
168
- };
169
+ },
170
+ updateFn = unowned ? fn : () => fn(() => cleanNode(root));
169
171
  Owner = root;
170
172
  Listener = null;
171
173
  try {
172
- return runUpdates(() => fn(() => cleanNode(root)), true);
174
+ return runUpdates(updateFn, true);
173
175
  } finally {
174
176
  Listener = listener;
175
177
  Owner = owner;
@@ -1443,7 +1445,7 @@ function Suspense(props) {
1443
1445
  resolved: false
1444
1446
  },
1445
1447
  owner = getOwner();
1446
- if (sharedConfig.context) {
1448
+ if (sharedConfig.context && sharedConfig.load) {
1447
1449
  const key = sharedConfig.context.id + sharedConfig.context.count;
1448
1450
  p = sharedConfig.load(key);
1449
1451
  if (p) {
@@ -1476,7 +1478,7 @@ function Suspense(props) {
1476
1478
  return flicker = undefined;
1477
1479
  }
1478
1480
  if (ctx && p === undefined) setHydrateContext();
1479
- const rendered = untrack(() => props.children);
1481
+ const rendered = createMemo(() => props.children);
1480
1482
  return createMemo(() => {
1481
1483
  const inFallback = store.inFallback(),
1482
1484
  visibleContent = showContent ? showContent() : true,
@@ -1486,7 +1488,7 @@ function Suspense(props) {
1486
1488
  store.resolved = true;
1487
1489
  ctx = p = undefined;
1488
1490
  resumeEffects(store.effects);
1489
- return rendered;
1491
+ return rendered();
1490
1492
  }
1491
1493
  if (!visibleFallback) return;
1492
1494
  return createRoot(disposer => {
package/dist/solid.js CHANGED
@@ -156,16 +156,18 @@ let ExecCount = 0;
156
156
  function createRoot(fn, detachedOwner) {
157
157
  const listener = Listener,
158
158
  owner = Owner,
159
- root = fn.length === 0 && !false ? UNOWNED : {
159
+ unowned = fn.length === 0,
160
+ root = unowned && !false ? UNOWNED : {
160
161
  owned: null,
161
162
  cleanups: null,
162
163
  context: null,
163
164
  owner: detachedOwner || owner
164
- };
165
+ },
166
+ updateFn = unowned ? fn : () => fn(() => cleanNode(root));
165
167
  Owner = root;
166
168
  Listener = null;
167
169
  try {
168
- return runUpdates(() => fn(() => cleanNode(root)), true);
170
+ return runUpdates(updateFn, true);
169
171
  } finally {
170
172
  Listener = listener;
171
173
  Owner = owner;
@@ -1439,7 +1441,7 @@ function Suspense(props) {
1439
1441
  resolved: false
1440
1442
  },
1441
1443
  owner = getOwner();
1442
- if (sharedConfig.context) {
1444
+ if (sharedConfig.context && sharedConfig.load) {
1443
1445
  const key = sharedConfig.context.id + sharedConfig.context.count;
1444
1446
  p = sharedConfig.load(key);
1445
1447
  if (p) {
@@ -1472,7 +1474,7 @@ function Suspense(props) {
1472
1474
  return flicker = undefined;
1473
1475
  }
1474
1476
  if (ctx && p === undefined) setHydrateContext();
1475
- const rendered = untrack(() => props.children);
1477
+ const rendered = createMemo(() => props.children);
1476
1478
  return createMemo(() => {
1477
1479
  const inFallback = store.inFallback(),
1478
1480
  visibleContent = showContent ? showContent() : true,
@@ -1482,7 +1484,7 @@ function Suspense(props) {
1482
1484
  store.resolved = true;
1483
1485
  ctx = p = undefined;
1484
1486
  resumeEffects(store.effects);
1485
- return rendered;
1487
+ return rendered();
1486
1488
  }
1487
1489
  if (!visibleFallback) return;
1488
1490
  return createRoot(disposer => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "1.4.3",
4
+ "version": "1.4.4",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -151,5 +151,5 @@
151
151
  "compiler",
152
152
  "performance"
153
153
  ],
154
- "gitHead": "44197a3f304400b055baef40da9ac661c0585b85"
154
+ "gitHead": "9f1de6b3cea905aa0857789a0e4738cae73cb1b1"
155
155
  }
@@ -31,7 +31,8 @@ function wrap$1(value, name) {
31
31
  return p;
32
32
  }
33
33
  function isWrappable(obj) {
34
- return obj != null && typeof obj === "object" && (obj[solidJs.$PROXY] || !obj.__proto__ || obj.__proto__ === Object.prototype || Array.isArray(obj));
34
+ let proto;
35
+ return obj != null && typeof obj === "object" && (obj[solidJs.$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
35
36
  }
36
37
  function unwrap(item, set = new Set()) {
37
38
  let result, unwrapped, v, prop;
@@ -293,11 +294,15 @@ function modifyMutable(state, modifier) {
293
294
  solidJs.batch(() => modifier(unwrap(state)));
294
295
  }
295
296
 
297
+ const $ROOT = Symbol("store-root");
296
298
  function applyState(target, parent, property, merge, key) {
297
299
  const previous = parent[property];
298
300
  if (target === previous) return;
299
301
  if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
300
- target !== previous && setProperty(parent, property, target);
302
+ if (target !== previous) {
303
+ if (property === $ROOT) return target;
304
+ setProperty(parent, property, target);
305
+ }
301
306
  return;
302
307
  }
303
308
  if (Array.isArray(target)) {
@@ -369,10 +374,10 @@ function reconcile(value, options = {}) {
369
374
  v = unwrap(value);
370
375
  return state => {
371
376
  if (!isWrappable(state) || !isWrappable(v)) return v;
372
- solidJs.batch(() => applyState(v, {
373
- state
374
- }, "state", merge, key));
375
- return state;
377
+ const res = applyState(v, {
378
+ [$ROOT]: state
379
+ }, $ROOT, merge, key);
380
+ return res === undefined ? state : res;
376
381
  };
377
382
  }
378
383
  const producers = new WeakMap();
package/store/dist/dev.js CHANGED
@@ -27,7 +27,8 @@ function wrap$1(value, name) {
27
27
  return p;
28
28
  }
29
29
  function isWrappable(obj) {
30
- return obj != null && typeof obj === "object" && (obj[$PROXY] || !obj.__proto__ || obj.__proto__ === Object.prototype || Array.isArray(obj));
30
+ let proto;
31
+ return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
31
32
  }
32
33
  function unwrap(item, set = new Set()) {
33
34
  let result, unwrapped, v, prop;
@@ -289,11 +290,15 @@ function modifyMutable(state, modifier) {
289
290
  batch(() => modifier(unwrap(state)));
290
291
  }
291
292
 
293
+ const $ROOT = Symbol("store-root");
292
294
  function applyState(target, parent, property, merge, key) {
293
295
  const previous = parent[property];
294
296
  if (target === previous) return;
295
297
  if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
296
- target !== previous && setProperty(parent, property, target);
298
+ if (target !== previous) {
299
+ if (property === $ROOT) return target;
300
+ setProperty(parent, property, target);
301
+ }
297
302
  return;
298
303
  }
299
304
  if (Array.isArray(target)) {
@@ -365,10 +370,10 @@ function reconcile(value, options = {}) {
365
370
  v = unwrap(value);
366
371
  return state => {
367
372
  if (!isWrappable(state) || !isWrappable(v)) return v;
368
- batch(() => applyState(v, {
369
- state
370
- }, "state", merge, key));
371
- return state;
373
+ const res = applyState(v, {
374
+ [$ROOT]: state
375
+ }, $ROOT, merge, key);
376
+ return res === undefined ? state : res;
372
377
  };
373
378
  }
374
379
  const producers = new WeakMap();
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const $RAW = Symbol("state-raw");
6
6
  function isWrappable(obj) {
7
- return obj != null && typeof obj === "object" && (obj.__proto__ === Object.prototype || Array.isArray(obj));
7
+ return obj != null && typeof obj === "object" && (Object.getPrototypeOf(obj) === Object.prototype || Array.isArray(obj));
8
8
  }
9
9
  function unwrap(item) {
10
10
  return item;
@@ -22,6 +22,19 @@ function mergeStoreNode(state, value, force) {
22
22
  setProperty(state, key, value[key], force);
23
23
  }
24
24
  }
25
+ function updateArray(current, next) {
26
+ if (typeof next === "function") next = next(current);
27
+ if (Array.isArray(next)) {
28
+ if (current === next) return;
29
+ let i = 0,
30
+ len = next.length;
31
+ for (; i < len; i++) {
32
+ const value = next[i];
33
+ if (current[i] !== value) setProperty(current, i, value);
34
+ }
35
+ setProperty(current, "length", len);
36
+ } else mergeStoreNode(current, next);
37
+ }
25
38
  function updatePath(current, path, traversed = []) {
26
39
  let part,
27
40
  next = current;
@@ -67,8 +80,9 @@ function updatePath(current, path, traversed = []) {
67
80
  } else setProperty(current, part, value);
68
81
  }
69
82
  function createStore(state) {
83
+ const isArray = Array.isArray(state);
70
84
  function setStore(...args) {
71
- updatePath(state, args);
85
+ isArray && args.length === 1 ? updateArray(state, args[0]) : updatePath(state, args);
72
86
  }
73
87
  return [state, setStore];
74
88
  }
@@ -1,6 +1,6 @@
1
1
  const $RAW = Symbol("state-raw");
2
2
  function isWrappable(obj) {
3
- return obj != null && typeof obj === "object" && (obj.__proto__ === Object.prototype || Array.isArray(obj));
3
+ return obj != null && typeof obj === "object" && (Object.getPrototypeOf(obj) === Object.prototype || Array.isArray(obj));
4
4
  }
5
5
  function unwrap(item) {
6
6
  return item;
@@ -18,6 +18,19 @@ function mergeStoreNode(state, value, force) {
18
18
  setProperty(state, key, value[key], force);
19
19
  }
20
20
  }
21
+ function updateArray(current, next) {
22
+ if (typeof next === "function") next = next(current);
23
+ if (Array.isArray(next)) {
24
+ if (current === next) return;
25
+ let i = 0,
26
+ len = next.length;
27
+ for (; i < len; i++) {
28
+ const value = next[i];
29
+ if (current[i] !== value) setProperty(current, i, value);
30
+ }
31
+ setProperty(current, "length", len);
32
+ } else mergeStoreNode(current, next);
33
+ }
21
34
  function updatePath(current, path, traversed = []) {
22
35
  let part,
23
36
  next = current;
@@ -63,8 +76,9 @@ function updatePath(current, path, traversed = []) {
63
76
  } else setProperty(current, part, value);
64
77
  }
65
78
  function createStore(state) {
79
+ const isArray = Array.isArray(state);
66
80
  function setStore(...args) {
67
- updatePath(state, args);
81
+ isArray && args.length === 1 ? updateArray(state, args[0]) : updatePath(state, args);
68
82
  }
69
83
  return [state, setStore];
70
84
  }
@@ -28,7 +28,8 @@ function wrap$1(value, name) {
28
28
  return p;
29
29
  }
30
30
  function isWrappable(obj) {
31
- return obj != null && typeof obj === "object" && (obj[solidJs.$PROXY] || !obj.__proto__ || obj.__proto__ === Object.prototype || Array.isArray(obj));
31
+ let proto;
32
+ return obj != null && typeof obj === "object" && (obj[solidJs.$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
32
33
  }
33
34
  function unwrap(item, set = new Set()) {
34
35
  let result, unwrapped, v, prop;
@@ -271,11 +272,15 @@ function modifyMutable(state, modifier) {
271
272
  solidJs.batch(() => modifier(unwrap(state)));
272
273
  }
273
274
 
275
+ const $ROOT = Symbol("store-root");
274
276
  function applyState(target, parent, property, merge, key) {
275
277
  const previous = parent[property];
276
278
  if (target === previous) return;
277
279
  if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
278
- target !== previous && setProperty(parent, property, target);
280
+ if (target !== previous) {
281
+ if (property === $ROOT) return target;
282
+ setProperty(parent, property, target);
283
+ }
279
284
  return;
280
285
  }
281
286
  if (Array.isArray(target)) {
@@ -347,10 +352,10 @@ function reconcile(value, options = {}) {
347
352
  v = unwrap(value);
348
353
  return state => {
349
354
  if (!isWrappable(state) || !isWrappable(v)) return v;
350
- solidJs.batch(() => applyState(v, {
351
- state
352
- }, "state", merge, key));
353
- return state;
355
+ const res = applyState(v, {
356
+ [$ROOT]: state
357
+ }, $ROOT, merge, key);
358
+ return res === undefined ? state : res;
354
359
  };
355
360
  }
356
361
  const producers = new WeakMap();
@@ -24,7 +24,8 @@ function wrap$1(value, name) {
24
24
  return p;
25
25
  }
26
26
  function isWrappable(obj) {
27
- return obj != null && typeof obj === "object" && (obj[$PROXY] || !obj.__proto__ || obj.__proto__ === Object.prototype || Array.isArray(obj));
27
+ let proto;
28
+ return obj != null && typeof obj === "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj));
28
29
  }
29
30
  function unwrap(item, set = new Set()) {
30
31
  let result, unwrapped, v, prop;
@@ -267,11 +268,15 @@ function modifyMutable(state, modifier) {
267
268
  batch(() => modifier(unwrap(state)));
268
269
  }
269
270
 
271
+ const $ROOT = Symbol("store-root");
270
272
  function applyState(target, parent, property, merge, key) {
271
273
  const previous = parent[property];
272
274
  if (target === previous) return;
273
275
  if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) {
274
- target !== previous && setProperty(parent, property, target);
276
+ if (target !== previous) {
277
+ if (property === $ROOT) return target;
278
+ setProperty(parent, property, target);
279
+ }
275
280
  return;
276
281
  }
277
282
  if (Array.isArray(target)) {
@@ -343,10 +348,10 @@ function reconcile(value, options = {}) {
343
348
  v = unwrap(value);
344
349
  return state => {
345
350
  if (!isWrappable(state) || !isWrappable(v)) return v;
346
- batch(() => applyState(v, {
347
- state
348
- }, "state", merge, key));
349
- return state;
351
+ const res = applyState(v, {
352
+ [$ROOT]: state
353
+ }, $ROOT, merge, key);
354
+ return res === undefined ? state : res;
350
355
  };
351
356
  }
352
357
  const producers = new WeakMap();
package/web/dist/dev.cjs CHANGED
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var solidJs = require('solid-js');
6
6
 
7
7
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
8
- const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
9
- const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
8
+ const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
9
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
10
10
  const Aliases = {
11
11
  className: "class",
12
12
  htmlFor: "for"
@@ -19,8 +19,8 @@ const PropAliases = {
19
19
  playsinline: "playsInline",
20
20
  readonly: "readOnly"
21
21
  };
22
- const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
23
- const SVGElements = new Set([
22
+ const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
23
+ const SVGElements = /*#__PURE__*/new Set([
24
24
  "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
25
25
  "set", "stop",
26
26
  "svg", "switch", "symbol", "text", "textPath",
@@ -29,7 +29,7 @@ const SVGNamespace = {
29
29
  xlink: "http://www.w3.org/1999/xlink",
30
30
  xml: "http://www.w3.org/XML/1998/namespace"
31
31
  };
32
- const DOMElements = new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
32
+ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
33
33
 
34
34
  function memo(fn, equals) {
35
35
  return solidJs.createMemo(fn, undefined, !equals ? {
@@ -146,7 +146,8 @@ function addEventListener(node, name, handler, delegate) {
146
146
  node[`$$${name}Data`] = handler[1];
147
147
  } else node[`$$${name}`] = handler;
148
148
  } else if (Array.isArray(handler)) {
149
- node.addEventListener(name, e => handler[0](handler[1], e));
149
+ const handlerFn = handler[0];
150
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
150
151
  } else node.addEventListener(name, handler);
151
152
  }
152
153
  function classList(node, value, prev = {}) {
@@ -310,14 +311,24 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
310
311
  value(node);
311
312
  }
312
313
  } else if (prop.slice(0, 3) === "on:") {
313
- node.addEventListener(prop.slice(3), value);
314
+ const e = prop.slice(3);
315
+ prev && node.removeEventListener(e, prev);
316
+ value && node.addEventListener(e, value);
314
317
  } else if (prop.slice(0, 10) === "oncapture:") {
315
- node.addEventListener(prop.slice(10), value, true);
318
+ const e = prop.slice(10);
319
+ prev && node.removeEventListener(e, prev, true);
320
+ value && node.addEventListener(e, value, true);
316
321
  } else if (prop.slice(0, 2) === "on") {
317
322
  const name = prop.slice(2).toLowerCase();
318
323
  const delegate = DelegatedEvents.has(name);
319
- addEventListener(node, name, value, delegate);
320
- delegate && delegateEvents([name]);
324
+ if (!delegate && prev) {
325
+ const h = Array.isArray(prev) ? prev[0] : prev;
326
+ node.removeEventListener(name, h);
327
+ }
328
+ if (delegate || value) {
329
+ addEventListener(node, name, value, delegate);
330
+ delegate && delegateEvents([name]);
331
+ }
321
332
  } else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
322
333
  if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[PropAliases[prop] || prop] = value;
323
334
  } else {
@@ -349,7 +360,7 @@ function eventHandler(e) {
349
360
  const handler = node[key];
350
361
  if (handler && !node.disabled) {
351
362
  const data = node[`${key}Data`];
352
- data !== undefined ? handler(data, e) : handler(e);
363
+ data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
353
364
  if (e.cancelBubble) return;
354
365
  }
355
366
  node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
@@ -508,7 +519,7 @@ function resolveSSRNode(node) {}
508
519
  function ssrClassList(value) {}
509
520
  function ssrStyle(value) {}
510
521
  function ssrSpread(accessor) {}
511
- function ssrBoolean(key, value) {}
522
+ function ssrAttribute(key, value) {}
512
523
  function ssrHydrationKey() {}
513
524
  function escape(html) {}
514
525
  function generateHydrationScript() {}
@@ -561,8 +572,9 @@ function Portal(props) {
561
572
  }
562
573
  function Dynamic(props) {
563
574
  const [p, others] = solidJs.splitProps(props, ["component"]);
575
+ const cached = solidJs.createMemo(() => p.component);
564
576
  return solidJs.createMemo(() => {
565
- const component = p.component;
577
+ const component = cached();
566
578
  switch (typeof component) {
567
579
  case "function":
568
580
  Object.assign(component, {
@@ -667,7 +679,7 @@ exports.setAttribute = setAttribute;
667
679
  exports.setAttributeNS = setAttributeNS;
668
680
  exports.spread = spread;
669
681
  exports.ssr = ssr;
670
- exports.ssrBoolean = ssrBoolean;
682
+ exports.ssrAttribute = ssrAttribute;
671
683
  exports.ssrClassList = ssrClassList;
672
684
  exports.ssrHydrationKey = ssrHydrationKey;
673
685
  exports.ssrSpread = ssrSpread;
package/web/dist/dev.js CHANGED
@@ -2,8 +2,8 @@ import { createMemo, createRoot, createRenderEffect, sharedConfig, enableHydrati
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
3
3
 
4
4
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5
- const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
- const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
5
+ const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
7
7
  const Aliases = {
8
8
  className: "class",
9
9
  htmlFor: "for"
@@ -16,8 +16,8 @@ const PropAliases = {
16
16
  playsinline: "playsInline",
17
17
  readonly: "readOnly"
18
18
  };
19
- const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
20
- const SVGElements = new Set([
19
+ const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
20
+ const SVGElements = /*#__PURE__*/new Set([
21
21
  "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
22
22
  "set", "stop",
23
23
  "svg", "switch", "symbol", "text", "textPath",
@@ -26,7 +26,7 @@ const SVGNamespace = {
26
26
  xlink: "http://www.w3.org/1999/xlink",
27
27
  xml: "http://www.w3.org/XML/1998/namespace"
28
28
  };
29
- const DOMElements = new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
29
+ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
30
30
 
31
31
  function memo(fn, equals) {
32
32
  return createMemo(fn, undefined, !equals ? {
@@ -143,7 +143,8 @@ function addEventListener(node, name, handler, delegate) {
143
143
  node[`$$${name}Data`] = handler[1];
144
144
  } else node[`$$${name}`] = handler;
145
145
  } else if (Array.isArray(handler)) {
146
- node.addEventListener(name, e => handler[0](handler[1], e));
146
+ const handlerFn = handler[0];
147
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
147
148
  } else node.addEventListener(name, handler);
148
149
  }
149
150
  function classList(node, value, prev = {}) {
@@ -307,14 +308,24 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
307
308
  value(node);
308
309
  }
309
310
  } else if (prop.slice(0, 3) === "on:") {
310
- node.addEventListener(prop.slice(3), value);
311
+ const e = prop.slice(3);
312
+ prev && node.removeEventListener(e, prev);
313
+ value && node.addEventListener(e, value);
311
314
  } else if (prop.slice(0, 10) === "oncapture:") {
312
- node.addEventListener(prop.slice(10), value, true);
315
+ const e = prop.slice(10);
316
+ prev && node.removeEventListener(e, prev, true);
317
+ value && node.addEventListener(e, value, true);
313
318
  } else if (prop.slice(0, 2) === "on") {
314
319
  const name = prop.slice(2).toLowerCase();
315
320
  const delegate = DelegatedEvents.has(name);
316
- addEventListener(node, name, value, delegate);
317
- delegate && delegateEvents([name]);
321
+ if (!delegate && prev) {
322
+ const h = Array.isArray(prev) ? prev[0] : prev;
323
+ node.removeEventListener(name, h);
324
+ }
325
+ if (delegate || value) {
326
+ addEventListener(node, name, value, delegate);
327
+ delegate && delegateEvents([name]);
328
+ }
318
329
  } else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
319
330
  if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[PropAliases[prop] || prop] = value;
320
331
  } else {
@@ -346,7 +357,7 @@ function eventHandler(e) {
346
357
  const handler = node[key];
347
358
  if (handler && !node.disabled) {
348
359
  const data = node[`${key}Data`];
349
- data !== undefined ? handler(data, e) : handler(e);
360
+ data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
350
361
  if (e.cancelBubble) return;
351
362
  }
352
363
  node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
@@ -505,7 +516,7 @@ function resolveSSRNode(node) {}
505
516
  function ssrClassList(value) {}
506
517
  function ssrStyle(value) {}
507
518
  function ssrSpread(accessor) {}
508
- function ssrBoolean(key, value) {}
519
+ function ssrAttribute(key, value) {}
509
520
  function ssrHydrationKey() {}
510
521
  function escape(html) {}
511
522
  function generateHydrationScript() {}
@@ -558,8 +569,9 @@ function Portal(props) {
558
569
  }
559
570
  function Dynamic(props) {
560
571
  const [p, others] = splitProps(props, ["component"]);
572
+ const cached = createMemo(() => p.component);
561
573
  return createMemo(() => {
562
- const component = p.component;
574
+ const component = cached();
563
575
  switch (typeof component) {
564
576
  case "function":
565
577
  Object.assign(component, {
@@ -575,4 +587,4 @@ function Dynamic(props) {
575
587
  });
576
588
  }
577
589
 
578
- export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrBoolean, ssrClassList, ssrHydrationKey, ssrSpread, ssrStyle, style, template };
590
+ export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrHydrationKey, ssrSpread, ssrStyle, style, template };
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var solidJs = require('solid-js');
6
6
 
7
7
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
8
- const BooleanAttributes = new Set(booleans);
9
- new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
8
+ const BooleanAttributes = /*#__PURE__*/new Set(booleans);
9
+ /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
10
10
  const Aliases = {
11
11
  className: "class",
12
12
  htmlFor: "for"
@@ -2,8 +2,8 @@ import { sharedConfig, splitProps } from 'solid-js';
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, mergeProps } from 'solid-js';
3
3
 
4
4
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5
- const BooleanAttributes = new Set(booleans);
6
- new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
5
+ const BooleanAttributes = /*#__PURE__*/new Set(booleans);
6
+ /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
7
7
  const Aliases = {
8
8
  className: "class",
9
9
  htmlFor: "for"
package/web/dist/web.cjs CHANGED
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var solidJs = require('solid-js');
6
6
 
7
7
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
8
- const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
9
- const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
8
+ const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
9
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
10
10
  const Aliases = {
11
11
  className: "class",
12
12
  htmlFor: "for"
@@ -19,8 +19,8 @@ const PropAliases = {
19
19
  playsinline: "playsInline",
20
20
  readonly: "readOnly"
21
21
  };
22
- const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
23
- const SVGElements = new Set([
22
+ const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
23
+ const SVGElements = /*#__PURE__*/new Set([
24
24
  "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
25
25
  "set", "stop",
26
26
  "svg", "switch", "symbol", "text", "textPath",
@@ -29,7 +29,7 @@ const SVGNamespace = {
29
29
  xlink: "http://www.w3.org/1999/xlink",
30
30
  xml: "http://www.w3.org/XML/1998/namespace"
31
31
  };
32
- const DOMElements = new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
32
+ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
33
33
 
34
34
  function memo(fn, equals) {
35
35
  return solidJs.createMemo(fn, undefined, !equals ? {
@@ -145,7 +145,8 @@ function addEventListener(node, name, handler, delegate) {
145
145
  node[`$$${name}Data`] = handler[1];
146
146
  } else node[`$$${name}`] = handler;
147
147
  } else if (Array.isArray(handler)) {
148
- node.addEventListener(name, e => handler[0](handler[1], e));
148
+ const handlerFn = handler[0];
149
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
149
150
  } else node.addEventListener(name, handler);
150
151
  }
151
152
  function classList(node, value, prev = {}) {
@@ -309,14 +310,24 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
309
310
  value(node);
310
311
  }
311
312
  } else if (prop.slice(0, 3) === "on:") {
312
- node.addEventListener(prop.slice(3), value);
313
+ const e = prop.slice(3);
314
+ prev && node.removeEventListener(e, prev);
315
+ value && node.addEventListener(e, value);
313
316
  } else if (prop.slice(0, 10) === "oncapture:") {
314
- node.addEventListener(prop.slice(10), value, true);
317
+ const e = prop.slice(10);
318
+ prev && node.removeEventListener(e, prev, true);
319
+ value && node.addEventListener(e, value, true);
315
320
  } else if (prop.slice(0, 2) === "on") {
316
321
  const name = prop.slice(2).toLowerCase();
317
322
  const delegate = DelegatedEvents.has(name);
318
- addEventListener(node, name, value, delegate);
319
- delegate && delegateEvents([name]);
323
+ if (!delegate && prev) {
324
+ const h = Array.isArray(prev) ? prev[0] : prev;
325
+ node.removeEventListener(name, h);
326
+ }
327
+ if (delegate || value) {
328
+ addEventListener(node, name, value, delegate);
329
+ delegate && delegateEvents([name]);
330
+ }
320
331
  } else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
321
332
  if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[PropAliases[prop] || prop] = value;
322
333
  } else {
@@ -348,7 +359,7 @@ function eventHandler(e) {
348
359
  const handler = node[key];
349
360
  if (handler && !node.disabled) {
350
361
  const data = node[`${key}Data`];
351
- data !== undefined ? handler(data, e) : handler(e);
362
+ data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
352
363
  if (e.cancelBubble) return;
353
364
  }
354
365
  node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
@@ -507,7 +518,7 @@ function resolveSSRNode(node) {}
507
518
  function ssrClassList(value) {}
508
519
  function ssrStyle(value) {}
509
520
  function ssrSpread(accessor) {}
510
- function ssrBoolean(key, value) {}
521
+ function ssrAttribute(key, value) {}
511
522
  function ssrHydrationKey() {}
512
523
  function escape(html) {}
513
524
  function generateHydrationScript() {}
@@ -560,8 +571,9 @@ function Portal(props) {
560
571
  }
561
572
  function Dynamic(props) {
562
573
  const [p, others] = solidJs.splitProps(props, ["component"]);
574
+ const cached = solidJs.createMemo(() => p.component);
563
575
  return solidJs.createMemo(() => {
564
- const component = p.component;
576
+ const component = cached();
565
577
  switch (typeof component) {
566
578
  case "function":
567
579
  return solidJs.untrack(() => component(others));
@@ -663,7 +675,7 @@ exports.setAttribute = setAttribute;
663
675
  exports.setAttributeNS = setAttributeNS;
664
676
  exports.spread = spread;
665
677
  exports.ssr = ssr;
666
- exports.ssrBoolean = ssrBoolean;
678
+ exports.ssrAttribute = ssrAttribute;
667
679
  exports.ssrClassList = ssrClassList;
668
680
  exports.ssrHydrationKey = ssrHydrationKey;
669
681
  exports.ssrSpread = ssrSpread;
package/web/dist/web.js CHANGED
@@ -2,8 +2,8 @@ import { createMemo, createRoot, createRenderEffect, sharedConfig, enableHydrati
2
2
  export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, mergeProps } from 'solid-js';
3
3
 
4
4
  const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5
- const Properties = new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
- const ChildProperties = new Set(["innerHTML", "textContent", "innerText", "children"]);
5
+ const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
6
+ const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
7
7
  const Aliases = {
8
8
  className: "class",
9
9
  htmlFor: "for"
@@ -16,8 +16,8 @@ const PropAliases = {
16
16
  playsinline: "playsInline",
17
17
  readonly: "readOnly"
18
18
  };
19
- const DelegatedEvents = new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
20
- const SVGElements = new Set([
19
+ const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
20
+ const SVGElements = /*#__PURE__*/new Set([
21
21
  "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
22
22
  "set", "stop",
23
23
  "svg", "switch", "symbol", "text", "textPath",
@@ -26,7 +26,7 @@ const SVGNamespace = {
26
26
  xlink: "http://www.w3.org/1999/xlink",
27
27
  xml: "http://www.w3.org/XML/1998/namespace"
28
28
  };
29
- const DOMElements = new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
29
+ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "main", "nav", "section", "body", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "param", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "menu", "summary", "details", "slot", "template", "acronym", "applet", "basefont", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "hgroup", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp", "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "bgsound", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "nobr", "noembed", "noframes", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "plaintext", "portal", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr", "xmp", "input"]);
30
30
 
31
31
  function memo(fn, equals) {
32
32
  return createMemo(fn, undefined, !equals ? {
@@ -142,7 +142,8 @@ function addEventListener(node, name, handler, delegate) {
142
142
  node[`$$${name}Data`] = handler[1];
143
143
  } else node[`$$${name}`] = handler;
144
144
  } else if (Array.isArray(handler)) {
145
- node.addEventListener(name, e => handler[0](handler[1], e));
145
+ const handlerFn = handler[0];
146
+ node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
146
147
  } else node.addEventListener(name, handler);
147
148
  }
148
149
  function classList(node, value, prev = {}) {
@@ -306,14 +307,24 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
306
307
  value(node);
307
308
  }
308
309
  } else if (prop.slice(0, 3) === "on:") {
309
- node.addEventListener(prop.slice(3), value);
310
+ const e = prop.slice(3);
311
+ prev && node.removeEventListener(e, prev);
312
+ value && node.addEventListener(e, value);
310
313
  } else if (prop.slice(0, 10) === "oncapture:") {
311
- node.addEventListener(prop.slice(10), value, true);
314
+ const e = prop.slice(10);
315
+ prev && node.removeEventListener(e, prev, true);
316
+ value && node.addEventListener(e, value, true);
312
317
  } else if (prop.slice(0, 2) === "on") {
313
318
  const name = prop.slice(2).toLowerCase();
314
319
  const delegate = DelegatedEvents.has(name);
315
- addEventListener(node, name, value, delegate);
316
- delegate && delegateEvents([name]);
320
+ if (!delegate && prev) {
321
+ const h = Array.isArray(prev) ? prev[0] : prev;
322
+ node.removeEventListener(name, h);
323
+ }
324
+ if (delegate || value) {
325
+ addEventListener(node, name, value, delegate);
326
+ delegate && delegateEvents([name]);
327
+ }
317
328
  } else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
318
329
  if (prop === "class" || prop === "className") className(node, value);else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;else node[PropAliases[prop] || prop] = value;
319
330
  } else {
@@ -345,7 +356,7 @@ function eventHandler(e) {
345
356
  const handler = node[key];
346
357
  if (handler && !node.disabled) {
347
358
  const data = node[`${key}Data`];
348
- data !== undefined ? handler(data, e) : handler(e);
359
+ data !== undefined ? handler.call(node, data, e) : handler.call(node, e);
349
360
  if (e.cancelBubble) return;
350
361
  }
351
362
  node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
@@ -504,7 +515,7 @@ function resolveSSRNode(node) {}
504
515
  function ssrClassList(value) {}
505
516
  function ssrStyle(value) {}
506
517
  function ssrSpread(accessor) {}
507
- function ssrBoolean(key, value) {}
518
+ function ssrAttribute(key, value) {}
508
519
  function ssrHydrationKey() {}
509
520
  function escape(html) {}
510
521
  function generateHydrationScript() {}
@@ -557,8 +568,9 @@ function Portal(props) {
557
568
  }
558
569
  function Dynamic(props) {
559
570
  const [p, others] = splitProps(props, ["component"]);
571
+ const cached = createMemo(() => p.component);
560
572
  return createMemo(() => {
561
- const component = p.component;
573
+ const component = cached();
562
574
  switch (typeof component) {
563
575
  case "function":
564
576
  return untrack(() => component(others));
@@ -571,4 +583,4 @@ function Dynamic(props) {
571
583
  });
572
584
  }
573
585
 
574
- export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrBoolean, ssrClassList, ssrHydrationKey, ssrSpread, ssrStyle, style, template };
586
+ export { Aliases, Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Assets as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, generateHydrationScript, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, memo, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrHydrationKey, ssrSpread, ssrStyle, style, template };
@@ -12,10 +12,13 @@ export declare const hydrate: typeof hydrateCore;
12
12
  *
13
13
  * @description https://www.solidjs.com/docs/latest/api#%3Cportal%3E
14
14
  */
15
- export declare function Portal(props: {
15
+ export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
16
16
  mount?: Node;
17
- useShadow?: boolean;
18
- isSVG?: boolean;
17
+ useShadow?: T;
18
+ isSVG?: S;
19
+ ref?: (S extends true ? SVGGElement : HTMLDivElement) | ((el: (T extends true ? {
20
+ readonly shadowRoot: ShadowRoot;
21
+ } : {}) & (S extends true ? SVGGElement : HTMLDivElement)) => void);
19
22
  children: JSX.Element;
20
23
  }): Text;
21
24
  declare type DynamicProps<T> = T & {
@@ -33,7 +33,7 @@ export declare function ssrStyle(value: {
33
33
  [k: string]: string;
34
34
  }): string;
35
35
  export declare function ssrSpread(accessor: any): () => string;
36
- export declare function ssrBoolean(key: string, value: boolean): string;
36
+ export declare function ssrAttribute(key: string, value: boolean): string;
37
37
  export declare function ssrHydrationKey(): string;
38
38
  export declare function escape(html: string): string;
39
39
  export declare function generateHydrationScript(): string;