@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.
package/dist/index.js CHANGED
@@ -1774,6 +1774,12 @@ Available Console Commands:
1774
1774
  return;
1775
1775
  }
1776
1776
  try {
1777
+ if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
1778
+ window.dispatchEvent(
1779
+ new CustomEvent("amplifyup:field-patch", { detail: event.data })
1780
+ );
1781
+ return;
1782
+ }
1777
1783
  if (event.data?.type === "COMPONENT_DELETABLE_STATUS") {
1778
1784
  const { componentId, deletable, nodeId } = event.data;
1779
1785
  const element = document.querySelector(`[data-component-id="${componentId}"]`);
@@ -1960,6 +1966,10 @@ Available Console Commands:
1960
1966
  setEventSelectionMode(enabled) {
1961
1967
  if (typeof document === "undefined") return;
1962
1968
  this.eventSelectionMode = enabled;
1969
+ if (typeof window !== "undefined") {
1970
+ window.__AMPLIFYUP_EVENT_SELECTION__ = enabled;
1971
+ window.dispatchEvent(new CustomEvent("amplifyup:composer-edit"));
1972
+ }
1963
1973
  if (this.eventSelectionClickHandler) {
1964
1974
  document.removeEventListener("click", this.eventSelectionClickHandler, true);
1965
1975
  this.eventSelectionClickHandler = null;
@@ -2197,6 +2207,14 @@ Available Console Commands:
2197
2207
  el.classList.add("amplifyup-selected");
2198
2208
  }
2199
2209
  });
2210
+ if (typeof window !== "undefined") {
2211
+ window.__AMPLIFYUP_COMPOSER_EDIT__ = highlightComponents;
2212
+ window.dispatchEvent(
2213
+ new CustomEvent("amplifyup:composer-edit", {
2214
+ detail: { enabled: highlightComponents }
2215
+ })
2216
+ );
2217
+ }
2200
2218
  }
2201
2219
  /** Document-level drag/drop for cross-iframe drags from Composer sidebar. */
2202
2220
  setupComposerDragDrop() {
@@ -2505,6 +2523,12 @@ Available Console Commands:
2505
2523
  const clearSelection = opts?.clearSelection !== false;
2506
2524
  this.highlightingEnabled = false;
2507
2525
  this.teardownComposerDragDrop();
2526
+ if (opts?.clearSelection !== false && typeof window !== "undefined") {
2527
+ window.__AMPLIFYUP_COMPOSER_EDIT__ = false;
2528
+ window.dispatchEvent(
2529
+ new CustomEvent("amplifyup:composer-edit", { detail: { enabled: false } })
2530
+ );
2531
+ }
2508
2532
  if (this.mutationObserver) {
2509
2533
  this.mutationObserver.disconnect();
2510
2534
  this.mutationObserver = null;