@amplifyup/sdk 0.1.26 → 0.1.27

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.
@@ -1612,6 +1612,12 @@ Available Console Commands:
1612
1612
  return;
1613
1613
  }
1614
1614
  try {
1615
+ if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
1616
+ window.dispatchEvent(
1617
+ new CustomEvent("amplifyup:field-patch", { detail: event.data })
1618
+ );
1619
+ return;
1620
+ }
1615
1621
  if (event.data?.type === "COMPONENT_DELETABLE_STATUS") {
1616
1622
  const { componentId, deletable, nodeId } = event.data;
1617
1623
  const element = document.querySelector(`[data-component-id="${componentId}"]`);
@@ -1798,6 +1804,10 @@ Available Console Commands:
1798
1804
  setEventSelectionMode(enabled) {
1799
1805
  if (typeof document === "undefined") return;
1800
1806
  this.eventSelectionMode = enabled;
1807
+ if (typeof window !== "undefined") {
1808
+ window.__AMPLIFYUP_EVENT_SELECTION__ = enabled;
1809
+ window.dispatchEvent(new CustomEvent("amplifyup:composer-edit"));
1810
+ }
1801
1811
  if (this.eventSelectionClickHandler) {
1802
1812
  document.removeEventListener("click", this.eventSelectionClickHandler, true);
1803
1813
  this.eventSelectionClickHandler = null;
@@ -2035,6 +2045,14 @@ Available Console Commands:
2035
2045
  el.classList.add("amplifyup-selected");
2036
2046
  }
2037
2047
  });
2048
+ if (typeof window !== "undefined") {
2049
+ window.__AMPLIFYUP_COMPOSER_EDIT__ = highlightComponents;
2050
+ window.dispatchEvent(
2051
+ new CustomEvent("amplifyup:composer-edit", {
2052
+ detail: { enabled: highlightComponents }
2053
+ })
2054
+ );
2055
+ }
2038
2056
  }
2039
2057
  /** Document-level drag/drop for cross-iframe drags from Composer sidebar. */
2040
2058
  setupComposerDragDrop() {
@@ -2343,6 +2361,12 @@ Available Console Commands:
2343
2361
  const clearSelection = opts?.clearSelection !== false;
2344
2362
  this.highlightingEnabled = false;
2345
2363
  this.teardownComposerDragDrop();
2364
+ if (opts?.clearSelection !== false && typeof window !== "undefined") {
2365
+ window.__AMPLIFYUP_COMPOSER_EDIT__ = false;
2366
+ window.dispatchEvent(
2367
+ new CustomEvent("amplifyup:composer-edit", { detail: { enabled: false } })
2368
+ );
2369
+ }
2346
2370
  if (this.mutationObserver) {
2347
2371
  this.mutationObserver.disconnect();
2348
2372
  this.mutationObserver = null;