@solidjs/web 2.0.0-beta.12 → 2.0.0-beta.13

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
@@ -129,7 +129,6 @@ function render$1(code, element, init, options = {}) {
129
129
  if (!element) {
130
130
  throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
131
131
  }
132
- const renderRoot = getChildRoot(element);
133
132
  let disposer;
134
133
  solidJs.createRoot(dispose => {
135
134
  disposer = dispose;
@@ -138,14 +137,14 @@ function render$1(code, element, init, options = {}) {
138
137
  effect(() => solidJs.flatten(tree), () => {});
139
138
  } else {
140
139
  const tree = code();
141
- insert(element, () => tree, renderRoot.firstChild ? null : undefined, init, options.insertOptions);
140
+ insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
142
141
  }
143
142
  }, {
144
143
  id: options.renderId
145
144
  });
146
145
  return () => {
147
146
  disposer();
148
- renderRoot.textContent = "";
147
+ element.textContent = "";
149
148
  };
150
149
  }
151
150
  function create(html, bypassGuard, flag) {
@@ -284,11 +283,10 @@ function ref(fn, element) {
284
283
  solidJs.runWithOwner(null, () => applyRef(resolved, element));
285
284
  }
286
285
  function insert(parent, accessor, marker, initial, options) {
287
- const childRoot = getChildRoot(parent);
288
286
  const multi = marker !== undefined;
289
287
  if (multi && !initial) initial = [];
290
288
  if (isHydrating(parent)) {
291
- if (!multi && initial === undefined && parent) initial = [...childRoot.childNodes];
289
+ if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
292
290
  if (Array.isArray(initial)) {
293
291
  let j = 0;
294
292
  for (let i = 0; i < initial.length; i++) {
@@ -303,7 +301,7 @@ function insert(parent, accessor, marker, initial, options) {
303
301
  }
304
302
  if (multi && initial.length === 0) {
305
303
  const placeholder = document.createTextNode("");
306
- childRoot.insertBefore(placeholder, marker);
304
+ parent.insertBefore(placeholder, marker);
307
305
  initial = [placeholder];
308
306
  }
309
307
  let current = initial;
@@ -358,7 +356,7 @@ function loadModuleAssets(mapping) {
358
356
  return pending.length ? Promise.all(pending).then(() => {}) : undefined;
359
357
  }
360
358
  function hydrate$1(code, element, options = {}) {
361
- if (globalThis._$HY.done) return render$1(code, element, [...getChildRoot(element).childNodes], options);
359
+ if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
362
360
  options.renderId ||= "";
363
361
  if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
364
362
  if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
@@ -404,7 +402,7 @@ function hydrate$1(code, element, options = {}) {
404
402
  let disposer;
405
403
  p.then(() => {
406
404
  try {
407
- disposer = render$1(code, element, [...getChildRoot(element).childNodes], options);
405
+ disposer = render$1(code, element, [...element.childNodes], options);
408
406
  } finally {
409
407
  solidJs.sharedConfig.hydrating = false;
410
408
  }
@@ -416,7 +414,7 @@ function hydrate$1(code, element, options = {}) {
416
414
  }
417
415
  try {
418
416
  gatherHydratable(element, options.renderId);
419
- return render$1(code, element, [...getChildRoot(element).childNodes], options);
417
+ return render$1(code, element, [...element.childNodes], options);
420
418
  } finally {
421
419
  solidJs.sharedConfig.hydrating = false;
422
420
  }
@@ -465,7 +463,7 @@ function getNextMarker(start) {
465
463
  return [end, current];
466
464
  }
467
465
  function getFirstChild(node, expectedTag) {
468
- const child = getChildRoot(node).firstChild;
466
+ const child = node.firstChild;
469
467
  if (isHydrating() && expectedTag && child?.localName !== expectedTag) {
470
468
  const isMissing = !child || child.nodeType !== 1;
471
469
  console.warn("Hydration structure mismatch: expected <" + expectedTag + "> as first child of", node, "\n " + describeSiblings(node, child, expectedTag, isMissing));
@@ -484,7 +482,7 @@ function getNextSibling(node, expectedTag) {
484
482
  function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
485
483
  if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
486
484
  const children = [];
487
- let child = getChildRoot(parent).firstChild;
485
+ let child = parent.firstChild;
488
486
  while (child) {
489
487
  if (child.nodeType === 1) children.push(child);
490
488
  child = child.nextSibling;
@@ -534,9 +532,6 @@ function runHydrationEvents() {
534
532
  function isHydrating(node) {
535
533
  return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
536
534
  }
537
- function getChildRoot(node) {
538
- return node && node.localName === "template" ? node.content : node;
539
- }
540
535
  function classListToObject(classList) {
541
536
  if (Array.isArray(classList)) {
542
537
  const result = {};
@@ -571,11 +566,7 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
571
566
  return value;
572
567
  }
573
568
  const hasNamespace = prop.indexOf(":") > -1;
574
- if (hasNamespace && prop.slice(0, 3) === "on:") {
575
- const e = prop.slice(3);
576
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
577
- value && node.addEventListener(e, value, typeof value !== "function" && value);
578
- } else if (!hasNamespace && prop.slice(0, 2) === "on") {
569
+ if (!hasNamespace && prop.slice(0, 2) === "on") {
579
570
  const name = prop.slice(2).toLowerCase();
580
571
  const delegate = DelegatedEvents.has(name);
581
572
  if (!delegate && prev) {
@@ -648,22 +639,21 @@ function eventHandler(e) {
648
639
  function insertExpression(parent, value, current, marker) {
649
640
  if (isHydrating(parent)) return;
650
641
  if (value === current) return;
651
- const childRoot = getChildRoot(parent);
652
642
  const t = typeof value,
653
643
  multi = marker !== undefined;
654
644
  if (t === "string" || t === "number") {
655
645
  const tc = typeof current;
656
646
  if (tc === "string" || tc === "number") {
657
- childRoot.firstChild.data = value;
658
- } else childRoot.textContent = value;
647
+ parent.firstChild.data = value;
648
+ } else parent.textContent = value;
659
649
  } else if (value === undefined) {
660
650
  cleanChildren(parent, current, marker);
661
651
  } else if (value.nodeType) {
662
652
  if (Array.isArray(current)) {
663
653
  cleanChildren(parent, current, multi ? marker : null, value);
664
- } else if (current === undefined || !childRoot.firstChild) {
665
- childRoot.appendChild(value);
666
- } else childRoot.replaceChild(value, childRoot.firstChild);
654
+ } else if (current === undefined || !parent.firstChild) {
655
+ parent.appendChild(value);
656
+ } else parent.replaceChild(value, parent.firstChild);
667
657
  } else if (Array.isArray(value)) {
668
658
  const currentArray = current && Array.isArray(current);
669
659
  if (value.length === 0) {
@@ -671,7 +661,7 @@ function insertExpression(parent, value, current, marker) {
671
661
  } else if (currentArray) {
672
662
  if (current.length === 0) {
673
663
  appendNodes(parent, value, marker);
674
- } else reconcileArrays(childRoot, current, value);
664
+ } else reconcileArrays(parent, current, value);
675
665
  } else {
676
666
  current && cleanChildren(parent);
677
667
  appendNodes(parent, value);
@@ -696,11 +686,9 @@ function normalize(value, current, multi, doNotUnwrap) {
696
686
  return value;
697
687
  }
698
688
  function appendNodes(parent, array, marker = null) {
699
- parent = getChildRoot(parent);
700
689
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
701
690
  }
702
691
  function cleanChildren(parent, current, marker, replacement) {
703
- parent = getChildRoot(parent);
704
692
  if (marker === undefined) return parent.textContent = "";
705
693
  if (current.length) {
706
694
  let inserted = false;
package/dist/dev.js CHANGED
@@ -128,7 +128,6 @@ function render$1(code, element, init, options = {}) {
128
128
  if (!element) {
129
129
  throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
130
130
  }
131
- const renderRoot = getChildRoot(element);
132
131
  let disposer;
133
132
  createRoot(dispose => {
134
133
  disposer = dispose;
@@ -137,14 +136,14 @@ function render$1(code, element, init, options = {}) {
137
136
  effect(() => flatten(tree), () => {});
138
137
  } else {
139
138
  const tree = code();
140
- insert(element, () => tree, renderRoot.firstChild ? null : undefined, init, options.insertOptions);
139
+ insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
141
140
  }
142
141
  }, {
143
142
  id: options.renderId
144
143
  });
145
144
  return () => {
146
145
  disposer();
147
- renderRoot.textContent = "";
146
+ element.textContent = "";
148
147
  };
149
148
  }
150
149
  function create(html, bypassGuard, flag) {
@@ -283,11 +282,10 @@ function ref(fn, element) {
283
282
  runWithOwner(null, () => applyRef(resolved, element));
284
283
  }
285
284
  function insert(parent, accessor, marker, initial, options) {
286
- const childRoot = getChildRoot(parent);
287
285
  const multi = marker !== undefined;
288
286
  if (multi && !initial) initial = [];
289
287
  if (isHydrating(parent)) {
290
- if (!multi && initial === undefined && parent) initial = [...childRoot.childNodes];
288
+ if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
291
289
  if (Array.isArray(initial)) {
292
290
  let j = 0;
293
291
  for (let i = 0; i < initial.length; i++) {
@@ -302,7 +300,7 @@ function insert(parent, accessor, marker, initial, options) {
302
300
  }
303
301
  if (multi && initial.length === 0) {
304
302
  const placeholder = document.createTextNode("");
305
- childRoot.insertBefore(placeholder, marker);
303
+ parent.insertBefore(placeholder, marker);
306
304
  initial = [placeholder];
307
305
  }
308
306
  let current = initial;
@@ -357,7 +355,7 @@ function loadModuleAssets(mapping) {
357
355
  return pending.length ? Promise.all(pending).then(() => {}) : undefined;
358
356
  }
359
357
  function hydrate$1(code, element, options = {}) {
360
- if (globalThis._$HY.done) return render$1(code, element, [...getChildRoot(element).childNodes], options);
358
+ if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
361
359
  options.renderId ||= "";
362
360
  if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
363
361
  if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
@@ -403,7 +401,7 @@ function hydrate$1(code, element, options = {}) {
403
401
  let disposer;
404
402
  p.then(() => {
405
403
  try {
406
- disposer = render$1(code, element, [...getChildRoot(element).childNodes], options);
404
+ disposer = render$1(code, element, [...element.childNodes], options);
407
405
  } finally {
408
406
  sharedConfig.hydrating = false;
409
407
  }
@@ -415,7 +413,7 @@ function hydrate$1(code, element, options = {}) {
415
413
  }
416
414
  try {
417
415
  gatherHydratable(element, options.renderId);
418
- return render$1(code, element, [...getChildRoot(element).childNodes], options);
416
+ return render$1(code, element, [...element.childNodes], options);
419
417
  } finally {
420
418
  sharedConfig.hydrating = false;
421
419
  }
@@ -464,7 +462,7 @@ function getNextMarker(start) {
464
462
  return [end, current];
465
463
  }
466
464
  function getFirstChild(node, expectedTag) {
467
- const child = getChildRoot(node).firstChild;
465
+ const child = node.firstChild;
468
466
  if (isHydrating() && expectedTag && child?.localName !== expectedTag) {
469
467
  const isMissing = !child || child.nodeType !== 1;
470
468
  console.warn("Hydration structure mismatch: expected <" + expectedTag + "> as first child of", node, "\n " + describeSiblings(node, child, expectedTag, isMissing));
@@ -483,7 +481,7 @@ function getNextSibling(node, expectedTag) {
483
481
  function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
484
482
  if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
485
483
  const children = [];
486
- let child = getChildRoot(parent).firstChild;
484
+ let child = parent.firstChild;
487
485
  while (child) {
488
486
  if (child.nodeType === 1) children.push(child);
489
487
  child = child.nextSibling;
@@ -533,9 +531,6 @@ function runHydrationEvents() {
533
531
  function isHydrating(node) {
534
532
  return sharedConfig.hydrating && (!node || node.isConnected);
535
533
  }
536
- function getChildRoot(node) {
537
- return node && node.localName === "template" ? node.content : node;
538
- }
539
534
  function classListToObject(classList) {
540
535
  if (Array.isArray(classList)) {
541
536
  const result = {};
@@ -570,11 +565,7 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
570
565
  return value;
571
566
  }
572
567
  const hasNamespace = prop.indexOf(":") > -1;
573
- if (hasNamespace && prop.slice(0, 3) === "on:") {
574
- const e = prop.slice(3);
575
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
576
- value && node.addEventListener(e, value, typeof value !== "function" && value);
577
- } else if (!hasNamespace && prop.slice(0, 2) === "on") {
568
+ if (!hasNamespace && prop.slice(0, 2) === "on") {
578
569
  const name = prop.slice(2).toLowerCase();
579
570
  const delegate = DelegatedEvents.has(name);
580
571
  if (!delegate && prev) {
@@ -647,22 +638,21 @@ function eventHandler(e) {
647
638
  function insertExpression(parent, value, current, marker) {
648
639
  if (isHydrating(parent)) return;
649
640
  if (value === current) return;
650
- const childRoot = getChildRoot(parent);
651
641
  const t = typeof value,
652
642
  multi = marker !== undefined;
653
643
  if (t === "string" || t === "number") {
654
644
  const tc = typeof current;
655
645
  if (tc === "string" || tc === "number") {
656
- childRoot.firstChild.data = value;
657
- } else childRoot.textContent = value;
646
+ parent.firstChild.data = value;
647
+ } else parent.textContent = value;
658
648
  } else if (value === undefined) {
659
649
  cleanChildren(parent, current, marker);
660
650
  } else if (value.nodeType) {
661
651
  if (Array.isArray(current)) {
662
652
  cleanChildren(parent, current, multi ? marker : null, value);
663
- } else if (current === undefined || !childRoot.firstChild) {
664
- childRoot.appendChild(value);
665
- } else childRoot.replaceChild(value, childRoot.firstChild);
653
+ } else if (current === undefined || !parent.firstChild) {
654
+ parent.appendChild(value);
655
+ } else parent.replaceChild(value, parent.firstChild);
666
656
  } else if (Array.isArray(value)) {
667
657
  const currentArray = current && Array.isArray(current);
668
658
  if (value.length === 0) {
@@ -670,7 +660,7 @@ function insertExpression(parent, value, current, marker) {
670
660
  } else if (currentArray) {
671
661
  if (current.length === 0) {
672
662
  appendNodes(parent, value, marker);
673
- } else reconcileArrays(childRoot, current, value);
663
+ } else reconcileArrays(parent, current, value);
674
664
  } else {
675
665
  current && cleanChildren(parent);
676
666
  appendNodes(parent, value);
@@ -695,11 +685,9 @@ function normalize(value, current, multi, doNotUnwrap) {
695
685
  return value;
696
686
  }
697
687
  function appendNodes(parent, array, marker = null) {
698
- parent = getChildRoot(parent);
699
688
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
700
689
  }
701
690
  function cleanChildren(parent, current, marker, replacement) {
702
- parent = getChildRoot(parent);
703
691
  if (marker === undefined) return parent.textContent = "";
704
692
  if (current.length) {
705
693
  let inserted = false;
package/dist/web.cjs CHANGED
@@ -126,7 +126,6 @@ function reconcileArrays(parentNode, a, b) {
126
126
  const $$EVENTS = "_$DX_DELEGATE";
127
127
  const INNER_OWNED = {};
128
128
  function render$1(code, element, init, options = {}) {
129
- const renderRoot = getChildRoot(element);
130
129
  let disposer;
131
130
  solidJs.createRoot(dispose => {
132
131
  disposer = dispose;
@@ -135,14 +134,14 @@ function render$1(code, element, init, options = {}) {
135
134
  effect(() => solidJs.flatten(tree), () => {});
136
135
  } else {
137
136
  const tree = code();
138
- insert(element, () => tree, renderRoot.firstChild ? null : undefined, init, options.insertOptions);
137
+ insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
139
138
  }
140
139
  }, {
141
140
  id: options.renderId
142
141
  });
143
142
  return () => {
144
143
  disposer();
145
- renderRoot.textContent = "";
144
+ element.textContent = "";
146
145
  };
147
146
  }
148
147
  function create(html, bypassGuard, flag) {
@@ -279,11 +278,10 @@ function ref(fn, element) {
279
278
  solidJs.runWithOwner(null, () => applyRef(resolved, element));
280
279
  }
281
280
  function insert(parent, accessor, marker, initial, options) {
282
- const childRoot = getChildRoot(parent);
283
281
  const multi = marker !== undefined;
284
282
  if (multi && !initial) initial = [];
285
283
  if (isHydrating(parent)) {
286
- if (!multi && initial === undefined && parent) initial = [...childRoot.childNodes];
284
+ if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
287
285
  if (Array.isArray(initial)) {
288
286
  let j = 0;
289
287
  for (let i = 0; i < initial.length; i++) {
@@ -298,7 +296,7 @@ function insert(parent, accessor, marker, initial, options) {
298
296
  }
299
297
  if (multi && initial.length === 0) {
300
298
  const placeholder = document.createTextNode("");
301
- childRoot.insertBefore(placeholder, marker);
299
+ parent.insertBefore(placeholder, marker);
302
300
  initial = [placeholder];
303
301
  }
304
302
  let current = initial;
@@ -353,7 +351,7 @@ function loadModuleAssets(mapping) {
353
351
  return pending.length ? Promise.all(pending).then(() => {}) : undefined;
354
352
  }
355
353
  function hydrate$1(code, element, options = {}) {
356
- if (globalThis._$HY.done) return render$1(code, element, [...getChildRoot(element).childNodes], options);
354
+ if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
357
355
  options.renderId ||= "";
358
356
  if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
359
357
  if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
@@ -389,7 +387,7 @@ function hydrate$1(code, element, options = {}) {
389
387
  let disposer;
390
388
  p.then(() => {
391
389
  try {
392
- disposer = render$1(code, element, [...getChildRoot(element).childNodes], options);
390
+ disposer = render$1(code, element, [...element.childNodes], options);
393
391
  } finally {
394
392
  solidJs.sharedConfig.hydrating = false;
395
393
  }
@@ -401,7 +399,7 @@ function hydrate$1(code, element, options = {}) {
401
399
  }
402
400
  try {
403
401
  gatherHydratable(element, options.renderId);
404
- return render$1(code, element, [...getChildRoot(element).childNodes], options);
402
+ return render$1(code, element, [...element.childNodes], options);
405
403
  } finally {
406
404
  solidJs.sharedConfig.hydrating = false;
407
405
  }
@@ -444,7 +442,7 @@ function getNextMarker(start) {
444
442
  return [end, current];
445
443
  }
446
444
  function getFirstChild(node, expectedTag) {
447
- const child = getChildRoot(node).firstChild;
445
+ const child = node.firstChild;
448
446
  return child;
449
447
  }
450
448
  function getNextSibling(node, expectedTag) {
@@ -477,9 +475,6 @@ function runHydrationEvents() {
477
475
  function isHydrating(node) {
478
476
  return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
479
477
  }
480
- function getChildRoot(node) {
481
- return node && node.localName === "template" ? node.content : node;
482
- }
483
478
  function classListToObject(classList) {
484
479
  if (Array.isArray(classList)) {
485
480
  const result = {};
@@ -514,11 +509,7 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
514
509
  return value;
515
510
  }
516
511
  const hasNamespace = prop.indexOf(":") > -1;
517
- if (hasNamespace && prop.slice(0, 3) === "on:") {
518
- const e = prop.slice(3);
519
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
520
- value && node.addEventListener(e, value, typeof value !== "function" && value);
521
- } else if (!hasNamespace && prop.slice(0, 2) === "on") {
512
+ if (!hasNamespace && prop.slice(0, 2) === "on") {
522
513
  const name = prop.slice(2).toLowerCase();
523
514
  const delegate = DelegatedEvents.has(name);
524
515
  if (!delegate && prev) {
@@ -591,22 +582,21 @@ function eventHandler(e) {
591
582
  function insertExpression(parent, value, current, marker) {
592
583
  if (isHydrating(parent)) return;
593
584
  if (value === current) return;
594
- const childRoot = getChildRoot(parent);
595
585
  const t = typeof value,
596
586
  multi = marker !== undefined;
597
587
  if (t === "string" || t === "number") {
598
588
  const tc = typeof current;
599
589
  if (tc === "string" || tc === "number") {
600
- childRoot.firstChild.data = value;
601
- } else childRoot.textContent = value;
590
+ parent.firstChild.data = value;
591
+ } else parent.textContent = value;
602
592
  } else if (value === undefined) {
603
593
  cleanChildren(parent, current, marker);
604
594
  } else if (value.nodeType) {
605
595
  if (Array.isArray(current)) {
606
596
  cleanChildren(parent, current, multi ? marker : null, value);
607
- } else if (current === undefined || !childRoot.firstChild) {
608
- childRoot.appendChild(value);
609
- } else childRoot.replaceChild(value, childRoot.firstChild);
597
+ } else if (current === undefined || !parent.firstChild) {
598
+ parent.appendChild(value);
599
+ } else parent.replaceChild(value, parent.firstChild);
610
600
  } else if (Array.isArray(value)) {
611
601
  const currentArray = current && Array.isArray(current);
612
602
  if (value.length === 0) {
@@ -614,7 +604,7 @@ function insertExpression(parent, value, current, marker) {
614
604
  } else if (currentArray) {
615
605
  if (current.length === 0) {
616
606
  appendNodes(parent, value, marker);
617
- } else reconcileArrays(childRoot, current, value);
607
+ } else reconcileArrays(parent, current, value);
618
608
  } else {
619
609
  current && cleanChildren(parent);
620
610
  appendNodes(parent, value);
@@ -639,11 +629,9 @@ function normalize(value, current, multi, doNotUnwrap) {
639
629
  return value;
640
630
  }
641
631
  function appendNodes(parent, array, marker = null) {
642
- parent = getChildRoot(parent);
643
632
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
644
633
  }
645
634
  function cleanChildren(parent, current, marker, replacement) {
646
- parent = getChildRoot(parent);
647
635
  if (marker === undefined) return parent.textContent = "";
648
636
  if (current.length) {
649
637
  let inserted = false;
package/dist/web.js CHANGED
@@ -125,7 +125,6 @@ function reconcileArrays(parentNode, a, b) {
125
125
  const $$EVENTS = "_$DX_DELEGATE";
126
126
  const INNER_OWNED = {};
127
127
  function render$1(code, element, init, options = {}) {
128
- const renderRoot = getChildRoot(element);
129
128
  let disposer;
130
129
  createRoot(dispose => {
131
130
  disposer = dispose;
@@ -134,14 +133,14 @@ function render$1(code, element, init, options = {}) {
134
133
  effect(() => flatten(tree), () => {});
135
134
  } else {
136
135
  const tree = code();
137
- insert(element, () => tree, renderRoot.firstChild ? null : undefined, init, options.insertOptions);
136
+ insert(element, () => tree, element.firstChild ? null : undefined, init, options.insertOptions);
138
137
  }
139
138
  }, {
140
139
  id: options.renderId
141
140
  });
142
141
  return () => {
143
142
  disposer();
144
- renderRoot.textContent = "";
143
+ element.textContent = "";
145
144
  };
146
145
  }
147
146
  function create(html, bypassGuard, flag) {
@@ -278,11 +277,10 @@ function ref(fn, element) {
278
277
  runWithOwner(null, () => applyRef(resolved, element));
279
278
  }
280
279
  function insert(parent, accessor, marker, initial, options) {
281
- const childRoot = getChildRoot(parent);
282
280
  const multi = marker !== undefined;
283
281
  if (multi && !initial) initial = [];
284
282
  if (isHydrating(parent)) {
285
- if (!multi && initial === undefined && parent) initial = [...childRoot.childNodes];
283
+ if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
286
284
  if (Array.isArray(initial)) {
287
285
  let j = 0;
288
286
  for (let i = 0; i < initial.length; i++) {
@@ -297,7 +295,7 @@ function insert(parent, accessor, marker, initial, options) {
297
295
  }
298
296
  if (multi && initial.length === 0) {
299
297
  const placeholder = document.createTextNode("");
300
- childRoot.insertBefore(placeholder, marker);
298
+ parent.insertBefore(placeholder, marker);
301
299
  initial = [placeholder];
302
300
  }
303
301
  let current = initial;
@@ -352,7 +350,7 @@ function loadModuleAssets(mapping) {
352
350
  return pending.length ? Promise.all(pending).then(() => {}) : undefined;
353
351
  }
354
352
  function hydrate$1(code, element, options = {}) {
355
- if (globalThis._$HY.done) return render$1(code, element, [...getChildRoot(element).childNodes], options);
353
+ if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
356
354
  options.renderId ||= "";
357
355
  if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
358
356
  if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
@@ -388,7 +386,7 @@ function hydrate$1(code, element, options = {}) {
388
386
  let disposer;
389
387
  p.then(() => {
390
388
  try {
391
- disposer = render$1(code, element, [...getChildRoot(element).childNodes], options);
389
+ disposer = render$1(code, element, [...element.childNodes], options);
392
390
  } finally {
393
391
  sharedConfig.hydrating = false;
394
392
  }
@@ -400,7 +398,7 @@ function hydrate$1(code, element, options = {}) {
400
398
  }
401
399
  try {
402
400
  gatherHydratable(element, options.renderId);
403
- return render$1(code, element, [...getChildRoot(element).childNodes], options);
401
+ return render$1(code, element, [...element.childNodes], options);
404
402
  } finally {
405
403
  sharedConfig.hydrating = false;
406
404
  }
@@ -443,7 +441,7 @@ function getNextMarker(start) {
443
441
  return [end, current];
444
442
  }
445
443
  function getFirstChild(node, expectedTag) {
446
- const child = getChildRoot(node).firstChild;
444
+ const child = node.firstChild;
447
445
  return child;
448
446
  }
449
447
  function getNextSibling(node, expectedTag) {
@@ -476,9 +474,6 @@ function runHydrationEvents() {
476
474
  function isHydrating(node) {
477
475
  return sharedConfig.hydrating && (!node || node.isConnected);
478
476
  }
479
- function getChildRoot(node) {
480
- return node && node.localName === "template" ? node.content : node;
481
- }
482
477
  function classListToObject(classList) {
483
478
  if (Array.isArray(classList)) {
484
479
  const result = {};
@@ -513,11 +508,7 @@ function assignProp(node, prop, value, prev, skipRef, nodeName) {
513
508
  return value;
514
509
  }
515
510
  const hasNamespace = prop.indexOf(":") > -1;
516
- if (hasNamespace && prop.slice(0, 3) === "on:") {
517
- const e = prop.slice(3);
518
- prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
519
- value && node.addEventListener(e, value, typeof value !== "function" && value);
520
- } else if (!hasNamespace && prop.slice(0, 2) === "on") {
511
+ if (!hasNamespace && prop.slice(0, 2) === "on") {
521
512
  const name = prop.slice(2).toLowerCase();
522
513
  const delegate = DelegatedEvents.has(name);
523
514
  if (!delegate && prev) {
@@ -590,22 +581,21 @@ function eventHandler(e) {
590
581
  function insertExpression(parent, value, current, marker) {
591
582
  if (isHydrating(parent)) return;
592
583
  if (value === current) return;
593
- const childRoot = getChildRoot(parent);
594
584
  const t = typeof value,
595
585
  multi = marker !== undefined;
596
586
  if (t === "string" || t === "number") {
597
587
  const tc = typeof current;
598
588
  if (tc === "string" || tc === "number") {
599
- childRoot.firstChild.data = value;
600
- } else childRoot.textContent = value;
589
+ parent.firstChild.data = value;
590
+ } else parent.textContent = value;
601
591
  } else if (value === undefined) {
602
592
  cleanChildren(parent, current, marker);
603
593
  } else if (value.nodeType) {
604
594
  if (Array.isArray(current)) {
605
595
  cleanChildren(parent, current, multi ? marker : null, value);
606
- } else if (current === undefined || !childRoot.firstChild) {
607
- childRoot.appendChild(value);
608
- } else childRoot.replaceChild(value, childRoot.firstChild);
596
+ } else if (current === undefined || !parent.firstChild) {
597
+ parent.appendChild(value);
598
+ } else parent.replaceChild(value, parent.firstChild);
609
599
  } else if (Array.isArray(value)) {
610
600
  const currentArray = current && Array.isArray(current);
611
601
  if (value.length === 0) {
@@ -613,7 +603,7 @@ function insertExpression(parent, value, current, marker) {
613
603
  } else if (currentArray) {
614
604
  if (current.length === 0) {
615
605
  appendNodes(parent, value, marker);
616
- } else reconcileArrays(childRoot, current, value);
606
+ } else reconcileArrays(parent, current, value);
617
607
  } else {
618
608
  current && cleanChildren(parent);
619
609
  appendNodes(parent, value);
@@ -638,11 +628,9 @@ function normalize(value, current, multi, doNotUnwrap) {
638
628
  return value;
639
629
  }
640
630
  function appendNodes(parent, array, marker = null) {
641
- parent = getChildRoot(parent);
642
631
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
643
632
  }
644
633
  function cleanChildren(parent, current, marker, replacement) {
645
- parent = getChildRoot(parent);
646
634
  if (marker === undefined) return parent.textContent = "";
647
635
  if (current.length) {
648
636
  let inserted = false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solidjs/web",
3
3
  "description": "Solid's web runtime: client rendering, hydration, SSR, and DOM-specific control flow (Portal, Dynamic).",
4
- "version": "2.0.0-beta.12",
4
+ "version": "2.0.0-beta.13",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -137,10 +137,10 @@
137
137
  "seroval-plugins": "^1.1.0"
138
138
  },
139
139
  "peerDependencies": {
140
- "solid-js": "^2.0.0-beta.12"
140
+ "solid-js": "^2.0.0-beta.13"
141
141
  },
142
142
  "devDependencies": {
143
- "solid-js": "2.0.0-beta.12"
143
+ "solid-js": "2.0.0-beta.13"
144
144
  },
145
145
  "scripts": {
146
146
  "build": "npm-run-all -nl build:clean types:copy-jsx build:js",
package/types/jsx.d.ts CHANGED
@@ -35,10 +35,9 @@ import type { Element as SolidElement } from "solid-js";
35
35
  *
36
36
  * - Event handlers use `camelCase` such `onClick` and will be delegated when possible, bubbling
37
37
  * through the component tree, not the dom tree.
38
- * - Native event handlers use the namespace `on:` such `on:click`, and wont be delegated. bubbling
39
- * the dom tree.
38
+ * - Event handlers use camelCase attributes; native listener options should be handled with `ref`
39
+ * callbacks that call `addEventListener` directly.
40
40
  * - A global case-insensitive event handler can be added by extending `EventHandlersElement<T>`
41
- * - A native `on:` event handler can be added by extending `CustomEvents<T>` interface
42
41
  *
43
42
  * ## Boolean Attributes (property setter that accepts `true | false`):
44
43
  *
@@ -176,17 +175,6 @@ export namespace JSX {
176
175
  EHandler extends EventHandler<T, any> = EventHandler<T, E>
177
176
  > = EHandler | BoundEventHandler<T, E, EHandler>;
178
177
 
179
- interface EventHandlerWithOptions<T, E extends Event, EHandler = EventHandler<T, E>>
180
- extends AddEventListenerOptions, EventListenerOptions {
181
- handleEvent: EHandler;
182
- }
183
-
184
- type EventHandlerWithOptionsUnion<
185
- T,
186
- E extends Event,
187
- EHandler extends EventHandler<T, any> = EventHandler<T, E>
188
- > = EHandler | EventHandlerWithOptions<T, E, EHandler>;
189
-
190
178
  interface InputEventHandler<T, E extends InputEvent> {
191
179
  (
192
180
  e: E & {
@@ -258,13 +246,9 @@ export namespace JSX {
258
246
  $ServerOnly?: boolean | undefined;
259
247
  }
260
248
  interface ExplicitProperties {}
261
- interface CustomEvents {}
262
249
  type PropAttributes = {
263
250
  [Key in keyof ExplicitProperties as `prop:${Key}`]?: ExplicitProperties[Key];
264
251
  };
265
- type OnAttributes<T> = {
266
- [Key in keyof CustomEvents as `on:${Key}`]?: EventHandlerWithOptionsUnion<T, CustomEvents[Key]>;
267
- };
268
252
 
269
253
  /**
270
254
  * Writable, element-specific DOM properties exposed as `prop:*` attributes, auto-derived
@@ -732,33 +716,7 @@ export namespace JSX {
732
716
  onUnhandledRejection?: EventHandlerUnion<T, PromiseRejectionEvent> | undefined;
733
717
  onUnload?: EventHandlerUnion<T, Event> | undefined;
734
718
 
735
- "on:afterprint"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
736
- "on:beforeprint"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
737
- "on:beforeunload"?: EventHandlerWithOptionsUnion<T, BeforeUnloadEvent> | undefined;
738
- "on:devicemotion"?: EventHandlerWithOptionsUnion<T, DeviceMotionEvent> | undefined;
739
- "on:deviceorientation"?: EventHandlerWithOptionsUnion<T, DeviceOrientationEvent> | undefined;
740
- "on:deviceorientationabsolute"?:
741
- | EventHandlerWithOptionsUnion<T, DeviceOrientationEvent>
742
- | undefined;
743
- "on:gamepadconnected"?: EventHandlerWithOptionsUnion<T, GamepadEvent> | undefined;
744
- "on:gamepaddisconnected"?: EventHandlerWithOptionsUnion<T, GamepadEvent> | undefined;
745
- "on:hashchange"?: EventHandlerWithOptionsUnion<T, HashChangeEvent> | undefined;
746
- "on:languagechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
747
- "on:message"?: EventHandlerWithOptionsUnion<T, MessageEvent> | undefined;
748
- "on:messageerror"?: EventHandlerWithOptionsUnion<T, MessageEvent> | undefined;
749
- "on:offline"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
750
- "on:online"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
751
719
  /** @deprecated Use `screen.orientation` (`ScreenOrientation.change`) instead. */
752
- "on:orientationchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
753
- "on:pagehide"?: EventHandlerWithOptionsUnion<T, PageTransitionEvent> | undefined;
754
- "on:pagereveal"?: EventHandlerWithOptionsUnion<T, PageRevealEvent> | undefined;
755
- "on:pageshow"?: EventHandlerWithOptionsUnion<T, PageTransitionEvent> | undefined;
756
- "on:pageswap"?: EventHandlerWithOptionsUnion<T, PageSwapEvent> | undefined;
757
- "on:popstate"?: EventHandlerWithOptionsUnion<T, PopStateEvent> | undefined;
758
- "on:rejectionhandled"?: EventHandlerWithOptionsUnion<T, PromiseRejectionEvent> | undefined;
759
- "on:storage"?: EventHandlerWithOptionsUnion<T, StorageEvent> | undefined;
760
- "on:unhandledrejection"?: EventHandlerWithOptionsUnion<T, PromiseRejectionEvent> | undefined;
761
- "on:unload"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
762
720
  }
763
721
 
764
722
  /**
@@ -884,167 +842,23 @@ export namespace JSX {
884
842
  onVolumeChange?: EventHandlerUnion<T, Event> | undefined;
885
843
  onWaiting?: EventHandlerUnion<T, Event> | undefined;
886
844
  onWheel?: EventHandlerUnion<T, WheelEvent> | undefined;
887
-
888
- "on:abort"?: EventHandlerWithOptionsUnion<T, UIEvent> | undefined;
889
- "on:animationcancel"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
890
- "on:animationend"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
891
- "on:animationiteration"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
892
- "on:animationstart"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
893
- "on:auxclick"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
894
- "on:beforecopy"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
895
- "on:beforecut"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
896
- "on:beforeinput"?:
897
- | EventHandlerWithOptionsUnion<T, InputEvent, InputEventHandler<T, InputEvent>>
898
- | undefined;
899
- "on:beforematch"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
900
- "on:beforepaste"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
901
- "on:beforetoggle"?: EventHandlerWithOptionsUnion<T, ToggleEvent> | undefined;
902
- "on:beforexrselect"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
903
- "on:blur"?:
904
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
905
- | undefined;
906
- "on:cancel"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
907
- "on:canplay"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
908
- "on:canplaythrough"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
909
- "on:change"?: EventHandlerWithOptionsUnion<T, Event, ChangeEventHandler<T, Event>> | undefined;
910
- "on:click"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
911
- "on:close"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
912
- "on:command"?: EventHandlerWithOptionsUnion<T, CommandEvent> | undefined;
913
- "on:compositionend"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
914
- "on:compositionstart"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
915
- "on:compositionupdate"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
916
- "on:contentvisibilityautostatechange"?:
917
- | EventHandlerWithOptionsUnion<T, ContentVisibilityAutoStateChangeEvent>
918
- | undefined;
919
- "on:contextlost"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
920
- "on:contextmenu"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
921
- "on:contextrestored"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
922
- "on:copy"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
923
- "on:cuechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
924
- "on:cut"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
925
- "on:dblclick"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
926
- "on:drag"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
927
- "on:dragend"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
928
- "on:dragenter"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
929
- "on:dragexit"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
930
- "on:dragleave"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
931
- "on:dragover"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
932
- "on:dragstart"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
933
- "on:drop"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
934
- "on:durationchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
935
- "on:emptied"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
936
- "on:ended"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
937
- "on:error"?: EventHandlerWithOptionsUnion<T, ErrorEvent> | undefined;
938
- "on:focus"?:
939
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
940
- | undefined;
941
- "on:focusin"?:
942
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
943
- | undefined;
944
- "on:focusout"?:
945
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
946
- | undefined;
947
- "on:formdata"?: EventHandlerWithOptionsUnion<T, FormDataEvent> | undefined;
948
- "on:fullscreenchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
949
- "on:fullscreenerror"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
950
- "on:gotpointercapture"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
951
- "on:input"?:
952
- | EventHandlerWithOptionsUnion<T, InputEvent, InputEventHandler<T, InputEvent>>
953
- | undefined;
954
- "on:invalid"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
955
- "on:keydown"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
956
- "on:keypress"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
957
- "on:keyup"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
958
- "on:load"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
959
- "on:loadeddata"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
960
- "on:loadedmetadata"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
961
- "on:loadstart"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
962
- "on:lostpointercapture"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
963
- "on:mousedown"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
964
- "on:mouseenter"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
965
- "on:mouseleave"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
966
- "on:mousemove"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
967
- "on:mouseout"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
968
- "on:mouseover"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
969
- "on:mouseup"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
970
- "on:paste"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
971
- "on:pause"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
972
- "on:play"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
973
- "on:playing"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
974
- "on:pointercancel"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
975
- "on:pointerdown"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
976
- "on:pointerenter"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
977
- "on:pointerleave"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
978
- "on:pointermove"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
979
- "on:pointerout"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
980
- "on:pointerover"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
981
- "on:pointerrawupdate"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
982
- "on:pointerup"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
983
- "on:progress"?: EventHandlerWithOptionsUnion<T, ProgressEvent> | undefined;
984
- "on:ratechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
985
- "on:reset"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
986
- "on:resize"?: EventHandlerWithOptionsUnion<T, UIEvent> | undefined;
987
- "on:scroll"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
988
- "on:scrollend"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
989
- "on:scrollsnapchange"?: EventHandlerWithOptionsUnion<T, SnapEvent> | undefined;
990
- "on:scrollsnapchanging"?: EventHandlerWithOptionsUnion<T, SnapEvent> | undefined;
991
- "on:securitypolicyviolation"?:
992
- | EventHandlerWithOptionsUnion<T, SecurityPolicyViolationEvent>
993
- | undefined;
994
- "on:seeked"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
995
- "on:seeking"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
996
- "on:select"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
997
- "on:selectionchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
998
- "on:selectstart"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
999
- "on:slotchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1000
- "on:stalled"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1001
- "on:submit"?: EventHandlerWithOptionsUnion<T, SubmitEvent> | undefined;
1002
- "on:suspend"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1003
- "on:timeupdate"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1004
- "on:toggle"?: EventHandlerWithOptionsUnion<T, ToggleEvent> | undefined;
1005
- "on:touchcancel"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1006
- "on:touchend"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1007
- "on:touchmove"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1008
- "on:touchstart"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1009
- "on:transitioncancel"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1010
- "on:transitionend"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1011
- "on:transitionrun"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1012
- "on:transitionstart"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1013
- "on:volumechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1014
- "on:waiting"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1015
- "on:wheel"?: EventHandlerWithOptionsUnion<T, WheelEvent> | undefined;
1016
845
  }
1017
846
 
1018
847
  // EventName = "click" | "mousedown" ...
1019
848
 
1020
849
  type EventName =
1021
850
  | (keyof EventHandlersWindow<any> extends infer K
1022
- ? K extends `on:${infer T}`
1023
- ? T
1024
- : K extends `on${infer T}`
1025
- ? Lowercase<T>
1026
- : never
851
+ ? K extends `on${infer T}`
852
+ ? Lowercase<T>
853
+ : never
1027
854
  : never)
1028
855
  | (keyof EventHandlersElement<any> extends infer K
1029
- ? K extends `on:${infer T}`
1030
- ? T
1031
- : K extends `on${infer T}`
1032
- ? Lowercase<T>
1033
- : never
856
+ ? K extends `on${infer T}`
857
+ ? Lowercase<T>
858
+ : never
1034
859
  : never)
1035
860
  | (string & {});
1036
861
 
1037
- type ExtractEventType<T> = {
1038
- [K in keyof T as K extends `on:${infer Name}`
1039
- ? Name
1040
- : never]: T[K] extends EventHandlerWithOptionsUnion<Element, infer E> ? E : never;
1041
- };
1042
-
1043
- // EventType["click"] = MouseEvent
1044
-
1045
- type EventType = ExtractEventType<EventHandlersElement<Element>> &
1046
- ExtractEventType<EventHandlersWindow<Element>>;
1047
-
1048
862
  // GLOBAL ATTRIBUTES
1049
863
 
1050
864
  /**
@@ -1054,12 +868,7 @@ export namespace JSX {
1054
868
  * 2. Includes `keys` defined by `Element` and `Node` interfaces.
1055
869
  */
1056
870
  interface ElementAttributes<T>
1057
- extends
1058
- CustomAttributes<T>,
1059
- PropAttributes,
1060
- OnAttributes<T>,
1061
- EventHandlersElement<T>,
1062
- AriaAttributes {
871
+ extends CustomAttributes<T>, PropAttributes, EventHandlersElement<T>, AriaAttributes {
1063
872
  // [key: ClassKeys]: boolean;
1064
873
 
1065
874
  // properties
@@ -1723,13 +1532,6 @@ export namespace JSX {
1723
1532
  src?: string | RemoveAttribute;
1724
1533
 
1725
1534
  onEncrypted?: EventHandlerUnion<T, MediaEncryptedEvent> | undefined;
1726
- "on:encrypted"?: EventHandlerWithOptionsUnion<T, MediaEncryptedEvent> | undefined;
1727
-
1728
- onWaitingForKey?: EventHandlerUnion<T, Event> | undefined;
1729
- "on:waitingforkey"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1730
-
1731
- /** @deprecated */
1732
- mediagroup?: string | RemoveAttribute;
1733
1535
 
1734
1536
  // special cases locked to properties
1735
1537
 
@@ -2064,14 +1866,6 @@ export namespace JSX {
2064
1866
  width?: number | string | RemoveAttribute;
2065
1867
 
2066
1868
  onEnterPictureInPicture?: EventHandlerUnion<T, PictureInPictureEvent> | undefined;
2067
- "on:enterpictureinpicture"?: EventHandlerWithOptionsUnion<T, PictureInPictureEvent> | undefined;
2068
-
2069
- onLeavePictureInPicture?: EventHandlerUnion<T, PictureInPictureEvent> | undefined;
2070
- "on:leavepictureinpicture"?: EventHandlerWithOptionsUnion<T, PictureInPictureEvent> | undefined;
2071
- }
2072
-
2073
- interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
2074
- allowpopups?: BooleanAttribute | RemoveAttribute;
2075
1869
  disableblinkfeatures?: string | RemoveAttribute;
2076
1870
  disablewebsecurity?: BooleanAttribute | RemoveAttribute;
2077
1871
  enableblinkfeatures?: string | RemoveAttribute;
@@ -2346,32 +2140,6 @@ export namespace JSX {
2346
2140
  interface AnimationElementSVGAttributes<T>
2347
2141
  extends SVGAttributes<T>, ExternalResourceSVGAttributes, ConditionalProcessingSVGAttributes {
2348
2142
  onBegin?: EventHandlerUnion<T, TimeEvent> | undefined;
2349
- "on:begin"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2350
-
2351
- onEnd?: EventHandlerUnion<T, TimeEvent> | undefined;
2352
- "on:end"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2353
-
2354
- onRepeat?: EventHandlerUnion<T, TimeEvent> | undefined;
2355
- "on:repeat"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2356
- }
2357
- interface ContainerElementSVGAttributes<T>
2358
- extends
2359
- SVGAttributes<T>,
2360
- ShapeElementSVGAttributes<T>,
2361
- Pick<
2362
- PresentationSVGAttributes,
2363
- | "clip-path"
2364
- | "mask"
2365
- | "cursor"
2366
- | "opacity"
2367
- | "filter"
2368
- | "enable-background"
2369
- | "color-interpolation"
2370
- | "color-rendering"
2371
- > {}
2372
- interface FilterPrimitiveElementSVGAttributes<T>
2373
- extends SVGAttributes<T>, Pick<PresentationSVGAttributes, "color-interpolation-filters"> {
2374
- height?: number | string | RemoveAttribute;
2375
2143
  result?: string | RemoveAttribute;
2376
2144
  width?: number | string | RemoveAttribute;
2377
2145
  x?: number | string | RemoveAttribute;
@@ -35,10 +35,9 @@ import type { Element as SolidElement } from "solid-js";
35
35
  *
36
36
  * - Event handlers use `camelCase` such `onClick` and will be delegated when possible, bubbling
37
37
  * through the component tree, not the dom tree.
38
- * - Native event handlers use the namespace `on:` such `on:click`, and wont be delegated. bubbling
39
- * the dom tree.
38
+ * - Event handlers use camelCase attributes; native listener options should be handled with `ref`
39
+ * callbacks that call `addEventListener` directly.
40
40
  * - A global case-insensitive event handler can be added by extending `EventHandlersElement<T>`
41
- * - A native `on:` event handler can be added by extending `CustomEvents<T>` interface
42
41
  *
43
42
  * ## Boolean Attributes (property setter that accepts `true | false`):
44
43
  *
@@ -176,17 +175,6 @@ export namespace JSX {
176
175
  EHandler extends EventHandler<T, any> = EventHandler<T, E>
177
176
  > = EHandler | BoundEventHandler<T, E, EHandler>;
178
177
 
179
- interface EventHandlerWithOptions<T, E extends Event, EHandler = EventHandler<T, E>>
180
- extends AddEventListenerOptions, EventListenerOptions {
181
- handleEvent: EHandler;
182
- }
183
-
184
- type EventHandlerWithOptionsUnion<
185
- T,
186
- E extends Event,
187
- EHandler extends EventHandler<T, any> = EventHandler<T, E>
188
- > = EHandler | EventHandlerWithOptions<T, E, EHandler>;
189
-
190
178
  interface InputEventHandler<T, E extends InputEvent> {
191
179
  (
192
180
  e: E & {
@@ -258,13 +246,9 @@ export namespace JSX {
258
246
  $ServerOnly?: boolean | undefined;
259
247
  }
260
248
  interface ExplicitProperties {}
261
- interface CustomEvents {}
262
249
  type PropAttributes = {
263
250
  [Key in keyof ExplicitProperties as `prop:${Key}`]?: ExplicitProperties[Key];
264
251
  };
265
- type OnAttributes<T> = {
266
- [Key in keyof CustomEvents as `on:${Key}`]?: EventHandlerWithOptionsUnion<T, CustomEvents[Key]>;
267
- };
268
252
 
269
253
  /**
270
254
  * Writable, element-specific DOM properties exposed as `prop:*` attributes, auto-derived
@@ -732,33 +716,7 @@ export namespace JSX {
732
716
  onUnhandledRejection?: EventHandlerUnion<T, PromiseRejectionEvent> | undefined;
733
717
  onUnload?: EventHandlerUnion<T, Event> | undefined;
734
718
 
735
- "on:afterprint"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
736
- "on:beforeprint"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
737
- "on:beforeunload"?: EventHandlerWithOptionsUnion<T, BeforeUnloadEvent> | undefined;
738
- "on:devicemotion"?: EventHandlerWithOptionsUnion<T, DeviceMotionEvent> | undefined;
739
- "on:deviceorientation"?: EventHandlerWithOptionsUnion<T, DeviceOrientationEvent> | undefined;
740
- "on:deviceorientationabsolute"?:
741
- | EventHandlerWithOptionsUnion<T, DeviceOrientationEvent>
742
- | undefined;
743
- "on:gamepadconnected"?: EventHandlerWithOptionsUnion<T, GamepadEvent> | undefined;
744
- "on:gamepaddisconnected"?: EventHandlerWithOptionsUnion<T, GamepadEvent> | undefined;
745
- "on:hashchange"?: EventHandlerWithOptionsUnion<T, HashChangeEvent> | undefined;
746
- "on:languagechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
747
- "on:message"?: EventHandlerWithOptionsUnion<T, MessageEvent> | undefined;
748
- "on:messageerror"?: EventHandlerWithOptionsUnion<T, MessageEvent> | undefined;
749
- "on:offline"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
750
- "on:online"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
751
719
  /** @deprecated Use `screen.orientation` (`ScreenOrientation.change`) instead. */
752
- "on:orientationchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
753
- "on:pagehide"?: EventHandlerWithOptionsUnion<T, PageTransitionEvent> | undefined;
754
- "on:pagereveal"?: EventHandlerWithOptionsUnion<T, PageRevealEvent> | undefined;
755
- "on:pageshow"?: EventHandlerWithOptionsUnion<T, PageTransitionEvent> | undefined;
756
- "on:pageswap"?: EventHandlerWithOptionsUnion<T, PageSwapEvent> | undefined;
757
- "on:popstate"?: EventHandlerWithOptionsUnion<T, PopStateEvent> | undefined;
758
- "on:rejectionhandled"?: EventHandlerWithOptionsUnion<T, PromiseRejectionEvent> | undefined;
759
- "on:storage"?: EventHandlerWithOptionsUnion<T, StorageEvent> | undefined;
760
- "on:unhandledrejection"?: EventHandlerWithOptionsUnion<T, PromiseRejectionEvent> | undefined;
761
- "on:unload"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
762
720
  }
763
721
 
764
722
  /**
@@ -884,167 +842,23 @@ export namespace JSX {
884
842
  onVolumeChange?: EventHandlerUnion<T, Event> | undefined;
885
843
  onWaiting?: EventHandlerUnion<T, Event> | undefined;
886
844
  onWheel?: EventHandlerUnion<T, WheelEvent> | undefined;
887
-
888
- "on:abort"?: EventHandlerWithOptionsUnion<T, UIEvent> | undefined;
889
- "on:animationcancel"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
890
- "on:animationend"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
891
- "on:animationiteration"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
892
- "on:animationstart"?: EventHandlerWithOptionsUnion<T, AnimationEvent> | undefined;
893
- "on:auxclick"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
894
- "on:beforecopy"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
895
- "on:beforecut"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
896
- "on:beforeinput"?:
897
- | EventHandlerWithOptionsUnion<T, InputEvent, InputEventHandler<T, InputEvent>>
898
- | undefined;
899
- "on:beforematch"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
900
- "on:beforepaste"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
901
- "on:beforetoggle"?: EventHandlerWithOptionsUnion<T, ToggleEvent> | undefined;
902
- "on:beforexrselect"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
903
- "on:blur"?:
904
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
905
- | undefined;
906
- "on:cancel"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
907
- "on:canplay"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
908
- "on:canplaythrough"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
909
- "on:change"?: EventHandlerWithOptionsUnion<T, Event, ChangeEventHandler<T, Event>> | undefined;
910
- "on:click"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
911
- "on:close"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
912
- "on:command"?: EventHandlerWithOptionsUnion<T, CommandEvent> | undefined;
913
- "on:compositionend"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
914
- "on:compositionstart"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
915
- "on:compositionupdate"?: EventHandlerWithOptionsUnion<T, CompositionEvent> | undefined;
916
- "on:contentvisibilityautostatechange"?:
917
- | EventHandlerWithOptionsUnion<T, ContentVisibilityAutoStateChangeEvent>
918
- | undefined;
919
- "on:contextlost"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
920
- "on:contextmenu"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
921
- "on:contextrestored"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
922
- "on:copy"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
923
- "on:cuechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
924
- "on:cut"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
925
- "on:dblclick"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
926
- "on:drag"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
927
- "on:dragend"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
928
- "on:dragenter"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
929
- "on:dragexit"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
930
- "on:dragleave"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
931
- "on:dragover"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
932
- "on:dragstart"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
933
- "on:drop"?: EventHandlerWithOptionsUnion<T, DragEvent> | undefined;
934
- "on:durationchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
935
- "on:emptied"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
936
- "on:ended"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
937
- "on:error"?: EventHandlerWithOptionsUnion<T, ErrorEvent> | undefined;
938
- "on:focus"?:
939
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
940
- | undefined;
941
- "on:focusin"?:
942
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
943
- | undefined;
944
- "on:focusout"?:
945
- | EventHandlerWithOptionsUnion<T, FocusEvent, FocusEventHandler<T, FocusEvent>>
946
- | undefined;
947
- "on:formdata"?: EventHandlerWithOptionsUnion<T, FormDataEvent> | undefined;
948
- "on:fullscreenchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
949
- "on:fullscreenerror"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
950
- "on:gotpointercapture"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
951
- "on:input"?:
952
- | EventHandlerWithOptionsUnion<T, InputEvent, InputEventHandler<T, InputEvent>>
953
- | undefined;
954
- "on:invalid"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
955
- "on:keydown"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
956
- "on:keypress"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
957
- "on:keyup"?: EventHandlerWithOptionsUnion<T, KeyboardEvent> | undefined;
958
- "on:load"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
959
- "on:loadeddata"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
960
- "on:loadedmetadata"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
961
- "on:loadstart"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
962
- "on:lostpointercapture"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
963
- "on:mousedown"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
964
- "on:mouseenter"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
965
- "on:mouseleave"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
966
- "on:mousemove"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
967
- "on:mouseout"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
968
- "on:mouseover"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
969
- "on:mouseup"?: EventHandlerWithOptionsUnion<T, MouseEvent> | undefined;
970
- "on:paste"?: EventHandlerWithOptionsUnion<T, ClipboardEvent> | undefined;
971
- "on:pause"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
972
- "on:play"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
973
- "on:playing"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
974
- "on:pointercancel"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
975
- "on:pointerdown"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
976
- "on:pointerenter"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
977
- "on:pointerleave"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
978
- "on:pointermove"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
979
- "on:pointerout"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
980
- "on:pointerover"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
981
- "on:pointerrawupdate"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
982
- "on:pointerup"?: EventHandlerWithOptionsUnion<T, PointerEvent> | undefined;
983
- "on:progress"?: EventHandlerWithOptionsUnion<T, ProgressEvent> | undefined;
984
- "on:ratechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
985
- "on:reset"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
986
- "on:resize"?: EventHandlerWithOptionsUnion<T, UIEvent> | undefined;
987
- "on:scroll"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
988
- "on:scrollend"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
989
- "on:scrollsnapchange"?: EventHandlerWithOptionsUnion<T, SnapEvent> | undefined;
990
- "on:scrollsnapchanging"?: EventHandlerWithOptionsUnion<T, SnapEvent> | undefined;
991
- "on:securitypolicyviolation"?:
992
- | EventHandlerWithOptionsUnion<T, SecurityPolicyViolationEvent>
993
- | undefined;
994
- "on:seeked"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
995
- "on:seeking"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
996
- "on:select"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
997
- "on:selectionchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
998
- "on:selectstart"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
999
- "on:slotchange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1000
- "on:stalled"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1001
- "on:submit"?: EventHandlerWithOptionsUnion<T, SubmitEvent> | undefined;
1002
- "on:suspend"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1003
- "on:timeupdate"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1004
- "on:toggle"?: EventHandlerWithOptionsUnion<T, ToggleEvent> | undefined;
1005
- "on:touchcancel"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1006
- "on:touchend"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1007
- "on:touchmove"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1008
- "on:touchstart"?: EventHandlerWithOptionsUnion<T, TouchEvent> | undefined;
1009
- "on:transitioncancel"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1010
- "on:transitionend"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1011
- "on:transitionrun"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1012
- "on:transitionstart"?: EventHandlerWithOptionsUnion<T, TransitionEvent> | undefined;
1013
- "on:volumechange"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1014
- "on:waiting"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1015
- "on:wheel"?: EventHandlerWithOptionsUnion<T, WheelEvent> | undefined;
1016
845
  }
1017
846
 
1018
847
  // EventName = "click" | "mousedown" ...
1019
848
 
1020
849
  type EventName =
1021
850
  | (keyof EventHandlersWindow<any> extends infer K
1022
- ? K extends `on:${infer T}`
1023
- ? T
1024
- : K extends `on${infer T}`
1025
- ? Lowercase<T>
1026
- : never
851
+ ? K extends `on${infer T}`
852
+ ? Lowercase<T>
853
+ : never
1027
854
  : never)
1028
855
  | (keyof EventHandlersElement<any> extends infer K
1029
- ? K extends `on:${infer T}`
1030
- ? T
1031
- : K extends `on${infer T}`
1032
- ? Lowercase<T>
1033
- : never
856
+ ? K extends `on${infer T}`
857
+ ? Lowercase<T>
858
+ : never
1034
859
  : never)
1035
860
  | (string & {});
1036
861
 
1037
- type ExtractEventType<T> = {
1038
- [K in keyof T as K extends `on:${infer Name}`
1039
- ? Name
1040
- : never]: T[K] extends EventHandlerWithOptionsUnion<Element, infer E> ? E : never;
1041
- };
1042
-
1043
- // EventType["click"] = MouseEvent
1044
-
1045
- type EventType = ExtractEventType<EventHandlersElement<Element>> &
1046
- ExtractEventType<EventHandlersWindow<Element>>;
1047
-
1048
862
  // GLOBAL ATTRIBUTES
1049
863
 
1050
864
  /**
@@ -1054,12 +868,7 @@ export namespace JSX {
1054
868
  * 2. Includes `keys` defined by `Element` and `Node` interfaces.
1055
869
  */
1056
870
  interface ElementAttributes<T>
1057
- extends
1058
- CustomAttributes<T>,
1059
- PropAttributes,
1060
- OnAttributes<T>,
1061
- EventHandlersElement<T>,
1062
- AriaAttributes {
871
+ extends CustomAttributes<T>, PropAttributes, EventHandlersElement<T>, AriaAttributes {
1063
872
  // [key: ClassKeys]: boolean;
1064
873
 
1065
874
  // properties
@@ -1723,13 +1532,6 @@ export namespace JSX {
1723
1532
  src?: string | RemoveAttribute;
1724
1533
 
1725
1534
  onEncrypted?: EventHandlerUnion<T, MediaEncryptedEvent> | undefined;
1726
- "on:encrypted"?: EventHandlerWithOptionsUnion<T, MediaEncryptedEvent> | undefined;
1727
-
1728
- onWaitingForKey?: EventHandlerUnion<T, Event> | undefined;
1729
- "on:waitingforkey"?: EventHandlerWithOptionsUnion<T, Event> | undefined;
1730
-
1731
- /** @deprecated */
1732
- mediagroup?: string | RemoveAttribute;
1733
1535
 
1734
1536
  // special cases locked to properties
1735
1537
 
@@ -2064,14 +1866,6 @@ export namespace JSX {
2064
1866
  width?: number | string | RemoveAttribute;
2065
1867
 
2066
1868
  onEnterPictureInPicture?: EventHandlerUnion<T, PictureInPictureEvent> | undefined;
2067
- "on:enterpictureinpicture"?: EventHandlerWithOptionsUnion<T, PictureInPictureEvent> | undefined;
2068
-
2069
- onLeavePictureInPicture?: EventHandlerUnion<T, PictureInPictureEvent> | undefined;
2070
- "on:leavepictureinpicture"?: EventHandlerWithOptionsUnion<T, PictureInPictureEvent> | undefined;
2071
- }
2072
-
2073
- interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
2074
- allowpopups?: BooleanAttribute | RemoveAttribute;
2075
1869
  disableblinkfeatures?: string | RemoveAttribute;
2076
1870
  disablewebsecurity?: BooleanAttribute | RemoveAttribute;
2077
1871
  enableblinkfeatures?: string | RemoveAttribute;
@@ -2346,32 +2140,6 @@ export namespace JSX {
2346
2140
  interface AnimationElementSVGAttributes<T>
2347
2141
  extends SVGAttributes<T>, ExternalResourceSVGAttributes, ConditionalProcessingSVGAttributes {
2348
2142
  onBegin?: EventHandlerUnion<T, TimeEvent> | undefined;
2349
- "on:begin"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2350
-
2351
- onEnd?: EventHandlerUnion<T, TimeEvent> | undefined;
2352
- "on:end"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2353
-
2354
- onRepeat?: EventHandlerUnion<T, TimeEvent> | undefined;
2355
- "on:repeat"?: EventHandlerWithOptionsUnion<T, TimeEvent> | undefined;
2356
- }
2357
- interface ContainerElementSVGAttributes<T>
2358
- extends
2359
- SVGAttributes<T>,
2360
- ShapeElementSVGAttributes<T>,
2361
- Pick<
2362
- PresentationSVGAttributes,
2363
- | "clip-path"
2364
- | "mask"
2365
- | "cursor"
2366
- | "opacity"
2367
- | "filter"
2368
- | "enable-background"
2369
- | "color-interpolation"
2370
- | "color-rendering"
2371
- > {}
2372
- interface FilterPrimitiveElementSVGAttributes<T>
2373
- extends SVGAttributes<T>, Pick<PresentationSVGAttributes, "color-interpolation-filters"> {
2374
- height?: number | string | RemoveAttribute;
2375
2143
  result?: string | RemoveAttribute;
2376
2144
  width?: number | string | RemoveAttribute;
2377
2145
  x?: number | string | RemoveAttribute;