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