@amplifyup/sdk 0.1.41 → 0.1.42
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/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/react.js +9 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +9 -4
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -3261,6 +3261,9 @@ function isReactNodeFallback(fallback) {
|
|
|
3261
3261
|
if (fallback == null || fallback === false) return false;
|
|
3262
3262
|
return !isPlainTextValue(fallback);
|
|
3263
3263
|
}
|
|
3264
|
+
function classNameIsBlock(className) {
|
|
3265
|
+
return /(?:^|\s)block(?:\s|$)/.test(className || "");
|
|
3266
|
+
}
|
|
3264
3267
|
function htmlHasVisualChrome(html) {
|
|
3265
3268
|
return /<(input|button|select|textarea|form|svg|iframe|video|audio|img)\b/i.test(
|
|
3266
3269
|
html
|
|
@@ -3437,7 +3440,8 @@ function ComposerInlineField({
|
|
|
3437
3440
|
outlineOffset: "2px",
|
|
3438
3441
|
minWidth: "1ch",
|
|
3439
3442
|
minHeight: "1em",
|
|
3440
|
-
|
|
3443
|
+
// Do not force `inline` — that overrides Tailwind `block` and parks
|
|
3444
|
+
// an empty-field hint on the same line as a sibling that has a value.
|
|
3441
3445
|
opacity: showHint ? 0.5 : void 0
|
|
3442
3446
|
},
|
|
3443
3447
|
children: showRendered ? value != null && value !== "" && !storedEmpty ? render(value) : fallback ?? idleDisplay : isReactNodeFallback(fallback) && !idleDisplay ? fallback : null
|
|
@@ -3561,7 +3565,8 @@ function Field({
|
|
|
3561
3565
|
}
|
|
3562
3566
|
const text = formatFieldValue(fieldValue);
|
|
3563
3567
|
const showVisualFallback = !text && isReactNodeFallback(fallback);
|
|
3564
|
-
|
|
3568
|
+
const emptyBlockField = isComposerEmptyText(fieldValue) && classNameIsBlock(className);
|
|
3569
|
+
if (composerEdit && canInlineEdit(name, fieldValue) && !showVisualFallback && !emptyBlockField) {
|
|
3565
3570
|
return /* @__PURE__ */ jsx(
|
|
3566
3571
|
ComposerInlineField,
|
|
3567
3572
|
{
|
|
@@ -3574,7 +3579,7 @@ function Field({
|
|
|
3574
3579
|
}
|
|
3575
3580
|
);
|
|
3576
3581
|
}
|
|
3577
|
-
if (fieldValue === void 0 || fieldValue === null) {
|
|
3582
|
+
if (fieldValue === void 0 || fieldValue === null || isComposerEmptyText(fieldValue)) {
|
|
3578
3583
|
return fallback ? /* @__PURE__ */ jsx("span", { className, children: fallback }) : null;
|
|
3579
3584
|
}
|
|
3580
3585
|
if (!text) {
|
|
@@ -3608,7 +3613,7 @@ function RichText({
|
|
|
3608
3613
|
return fallback ? /* @__PURE__ */ jsx(Fragment, { children: fallback }) : null;
|
|
3609
3614
|
}
|
|
3610
3615
|
if (isComposerEmptyText(fieldValue)) {
|
|
3611
|
-
if (composerEdit && canInlineEdit(name, fieldValue) && !isReactNodeFallback(fallback)) {
|
|
3616
|
+
if (composerEdit && canInlineEdit(name, fieldValue) && !isReactNodeFallback(fallback) && !classNameIsBlock(className)) {
|
|
3612
3617
|
return /* @__PURE__ */ jsx(
|
|
3613
3618
|
ComposerInlineField,
|
|
3614
3619
|
{
|