babel-plugin-jsx-dom-expressions 0.31.11 → 0.32.7

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.
Files changed (2) hide show
  1. package/index.js +10 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -81,6 +81,7 @@ const DelegatedEvents = new Set([
81
81
  "beforeinput",
82
82
  "click",
83
83
  "dblclick",
84
+ "contextmenu",
84
85
  "focusin",
85
86
  "focusout",
86
87
  "input",
@@ -551,6 +552,7 @@ function transformElement$2(path, info) {
551
552
 
552
553
  function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE }) {
553
554
  // pull out namespace
555
+ const config = getConfig(path);
554
556
  let parts, namespace;
555
557
  if ((parts = name.split(":")) && parts[1] && reservedNameSpaces.has(parts[0])) {
556
558
  name = parts[1];
@@ -595,6 +597,13 @@ function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE }) {
595
597
  );
596
598
  }
597
599
 
600
+ if (config.hydratable && name === "innerHTML") {
601
+ return t__namespace.callExpression(
602
+ registerImportMethod(path, "innerHTML"),
603
+ [elem, value]
604
+ );
605
+ }
606
+
598
607
  if (dynamic && name === "textContent") {
599
608
  return t__namespace.assignmentExpression("=", t__namespace.memberExpression(elem, t__namespace.identifier("data")), value);
600
609
  }
@@ -808,7 +817,7 @@ function transformAttributes$2(path, results) {
808
817
  : node.name.name,
809
818
  reservedNameSpace =
810
819
  t__namespace.isJSXNamespacedName(node.name) && reservedNameSpaces.has(node.name.namespace.name);
811
- if (t__namespace.isJSXExpressionContainer(value)) {
820
+ if (t__namespace.isJSXExpressionContainer(value) && !key.startsWith("use:")) {
812
821
  const evaluated = attribute.get("value").get("expression").evaluate().value;
813
822
  let type;
814
823
  if (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-plugin-jsx-dom-expressions",
3
3
  "description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
4
- "version": "0.31.11",
4
+ "version": "0.32.7",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "@babel/types": "^7.16.0",
24
24
  "html-entities": "2.3.2"
25
25
  },
26
- "gitHead": "fd496194eaf6d4155f2fc27bf4a90bc3ed44b1ac"
26
+ "gitHead": "3acfcd6802238e587e01ebcc1d1a89459a1a07a9"
27
27
  }