@plasmicapp/react-web 0.2.320 → 0.2.322

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/all.d.ts CHANGED
@@ -11404,6 +11404,10 @@ interface JsonElement {
11404
11404
  interface DefaultComponentElement<P> {
11405
11405
  type: "default-component";
11406
11406
  kind: "button" | "text-input";
11407
+ /**
11408
+ * The name of the element in the tree
11409
+ */
11410
+ elementName?: string;
11407
11411
  props?: {
11408
11412
  [prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
11409
11413
  } & {
@@ -11417,6 +11421,10 @@ interface CodeComponentElement<P> {
11417
11421
  * The registered component name
11418
11422
  */
11419
11423
  name: string;
11424
+ /**
11425
+ * The name of the element in the tree
11426
+ */
11427
+ elementName?: string;
11420
11428
  styles?: CSSProperties;
11421
11429
  props?: {
11422
11430
  [prop in keyof Partial<P>]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[];
package/dist/index.cjs.js CHANGED
@@ -1412,14 +1412,17 @@ function getImageLoader(loader) {
1412
1412
  return loader;
1413
1413
  }
1414
1414
  }
1415
+ function isInternalKey(src) {
1416
+ return /^([a-f0-9]{32})\..{1,16}$/i.test(src);
1417
+ }
1415
1418
  var PLASMIC_IMAGE_LOADER = {
1416
1419
  supportsUrl: function (src) {
1417
- return src.startsWith("http") && !isSvg(src);
1420
+ return (src.startsWith("http") || isInternalKey(src)) && !isSvg(src);
1418
1421
  },
1419
1422
  transformUrl: function (opts) {
1420
1423
  var _a;
1421
1424
  var params = [
1422
- "src=".concat(opts.src),
1425
+ "src=".concat(encodeURIComponent(opts.src)),
1423
1426
  opts.width ? "w=".concat(opts.width) : undefined,
1424
1427
  "q=".concat((_a = opts.quality) !== null && _a !== void 0 ? _a : 75),
1425
1428
  opts.format ? "f=".concat(opts.format) : undefined,
@@ -3948,7 +3951,15 @@ function useTriggeredOverlay(plasmicClass, props, config, outerRef, isDismissabl
3948
3951
  if (outerRef === void 0) { outerRef = null; }
3949
3952
  if (isDismissable === void 0) { isDismissable = true; }
3950
3953
  var overlayRef = React__namespace.useRef(null);
3951
- var onOverlayRef = mergeRefs(overlayRef, outerRef);
3954
+ var onOverlayRef = mergeRefs(overlayRef, outerRef, function (ref) {
3955
+ // Workaround for https://github.com/adobe/react-spectrum/issues/1513
3956
+ // to avoid touch events leaking under the overlay when it is closed.
3957
+ if (ref) {
3958
+ ref.addEventListener("touchend", function (e) {
3959
+ e.preventDefault();
3960
+ });
3961
+ }
3962
+ });
3952
3963
  var context = React__namespace.useContext(TriggeredOverlayContext);
3953
3964
  if (!context) {
3954
3965
  // If no context, then we are not being correctly used. Either complain, or