@amplifyup/sdk 0.1.41 → 0.1.43

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/react.mjs CHANGED
@@ -1704,8 +1704,15 @@ Available Console Commands:
1704
1704
  });
1705
1705
  if (preview) {
1706
1706
  params.set("preview", "true");
1707
- if (typeof window !== "undefined" && isWorkingContentRequest(new URLSearchParams(window.location.search))) {
1708
- params.set("working", "true");
1707
+ if (typeof window !== "undefined") {
1708
+ const pageSearch = new URLSearchParams(window.location.search);
1709
+ if (isWorkingContentRequest(pageSearch)) {
1710
+ params.set("working", "true");
1711
+ }
1712
+ const zoneId = pageSearch.get("zoneId");
1713
+ const compositionId = pageSearch.get("compositionId");
1714
+ if (zoneId) params.set("zoneId", zoneId);
1715
+ if (compositionId) params.set("compositionId", compositionId);
1709
1716
  }
1710
1717
  }
1711
1718
  if (isOnOrchestratorOrigin) {
@@ -3261,6 +3268,9 @@ function isReactNodeFallback(fallback) {
3261
3268
  if (fallback == null || fallback === false) return false;
3262
3269
  return !isPlainTextValue(fallback);
3263
3270
  }
3271
+ function classNameIsBlock(className) {
3272
+ return /(?:^|\s)block(?:\s|$)/.test(className || "");
3273
+ }
3264
3274
  function htmlHasVisualChrome(html) {
3265
3275
  return /<(input|button|select|textarea|form|svg|iframe|video|audio|img)\b/i.test(
3266
3276
  html
@@ -3437,7 +3447,8 @@ function ComposerInlineField({
3437
3447
  outlineOffset: "2px",
3438
3448
  minWidth: "1ch",
3439
3449
  minHeight: "1em",
3440
- display: render ? void 0 : "inline",
3450
+ // Do not force `inline` — that overrides Tailwind `block` and parks
3451
+ // an empty-field hint on the same line as a sibling that has a value.
3441
3452
  opacity: showHint ? 0.5 : void 0
3442
3453
  },
3443
3454
  children: showRendered ? value != null && value !== "" && !storedEmpty ? render(value) : fallback ?? idleDisplay : isReactNodeFallback(fallback) && !idleDisplay ? fallback : null
@@ -3561,7 +3572,8 @@ function Field({
3561
3572
  }
3562
3573
  const text = formatFieldValue(fieldValue);
3563
3574
  const showVisualFallback = !text && isReactNodeFallback(fallback);
3564
- if (composerEdit && canInlineEdit(name, fieldValue) && !showVisualFallback) {
3575
+ const emptyBlockField = isComposerEmptyText(fieldValue) && classNameIsBlock(className);
3576
+ if (composerEdit && canInlineEdit(name, fieldValue) && !showVisualFallback && !emptyBlockField) {
3565
3577
  return /* @__PURE__ */ jsx(
3566
3578
  ComposerInlineField,
3567
3579
  {
@@ -3574,7 +3586,7 @@ function Field({
3574
3586
  }
3575
3587
  );
3576
3588
  }
3577
- if (fieldValue === void 0 || fieldValue === null) {
3589
+ if (fieldValue === void 0 || fieldValue === null || isComposerEmptyText(fieldValue)) {
3578
3590
  return fallback ? /* @__PURE__ */ jsx("span", { className, children: fallback }) : null;
3579
3591
  }
3580
3592
  if (!text) {
@@ -3608,7 +3620,7 @@ function RichText({
3608
3620
  return fallback ? /* @__PURE__ */ jsx(Fragment, { children: fallback }) : null;
3609
3621
  }
3610
3622
  if (isComposerEmptyText(fieldValue)) {
3611
- if (composerEdit && canInlineEdit(name, fieldValue) && !isReactNodeFallback(fallback)) {
3623
+ if (composerEdit && canInlineEdit(name, fieldValue) && !isReactNodeFallback(fallback) && !classNameIsBlock(className)) {
3612
3624
  return /* @__PURE__ */ jsx(
3613
3625
  ComposerInlineField,
3614
3626
  {
@@ -4274,6 +4286,17 @@ async function fetchPageConfigServer(route, trackingId, preview = false, options
4274
4286
  });
4275
4287
  if (isPreview) params.set("preview", "true");
4276
4288
  if (workingFlag) params.set("working", "true");
4289
+ if (options?.searchParams) {
4290
+ const sp = options.searchParams instanceof URLSearchParams ? options.searchParams : new URLSearchParams(
4291
+ Object.entries(options.searchParams).flatMap(
4292
+ ([k, v]) => v == null ? [] : Array.isArray(v) ? v.map((item) => [k, item]) : [[k, v]]
4293
+ )
4294
+ );
4295
+ const zoneId = sp.get("zoneId");
4296
+ const compositionId = sp.get("compositionId");
4297
+ if (zoneId) params.set("zoneId", zoneId);
4298
+ if (compositionId) params.set("compositionId", compositionId);
4299
+ }
4277
4300
  const url = `${orchestratorUrl}/api/layout/provider?${params.toString()}`;
4278
4301
  try {
4279
4302
  const res = await fetch(url, {