@amplifyup/sdk 0.1.25 → 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/AmplifyRenderer.js +47 -35
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +47 -35
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +8 -12
- package/dist/index.d.ts +8 -12
- package/dist/index.js +47 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -36
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +232 -37
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +233 -38
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -60,7 +60,10 @@ var AWSAdapter = class {
|
|
|
60
60
|
headers: {
|
|
61
61
|
"Content-Type": "application/json"
|
|
62
62
|
},
|
|
63
|
-
body: JSON.stringify(eventData)
|
|
63
|
+
body: JSON.stringify(eventData),
|
|
64
|
+
// Keep the request alive through tab close so the single Time on Page
|
|
65
|
+
// flush on pagehide is not cancelled with the document.
|
|
66
|
+
keepalive: true
|
|
64
67
|
});
|
|
65
68
|
if (!response.ok) {
|
|
66
69
|
if (this.config.debug) {
|
|
@@ -519,8 +522,6 @@ async function fetchContent(options) {
|
|
|
519
522
|
|
|
520
523
|
// src/index.ts
|
|
521
524
|
var SESSION_IDLE_GAP_MS = 30 * 60 * 1e3;
|
|
522
|
-
var DWELL_MILESTONES_SEC = [15, 30, 60, 120, 300];
|
|
523
|
-
var DWELL_CHECKPOINT_SEC = 15 * 60;
|
|
524
525
|
var DWELL_ACTIVITY_IDLE_MS = 2 * 60 * 1e3;
|
|
525
526
|
var DWELL_POLL_MS = 5e3;
|
|
526
527
|
function readPreviewQueryOverrides() {
|
|
@@ -591,7 +592,8 @@ var AmplifyUpSDK = class {
|
|
|
591
592
|
reached: /* @__PURE__ */ new Set(),
|
|
592
593
|
visibleMs: 0,
|
|
593
594
|
visibleSince: null,
|
|
594
|
-
|
|
595
|
+
/** True after Time on Page has been sent for the current visit. */
|
|
596
|
+
dwellEmitted: false,
|
|
595
597
|
/** When the tab last became hidden — used for idle-resume re-page. */
|
|
596
598
|
hiddenAt: null,
|
|
597
599
|
/** Last user interaction — freezes dwell when stale while visible. */
|
|
@@ -820,9 +822,9 @@ var AmplifyUpSDK = class {
|
|
|
820
822
|
}
|
|
821
823
|
/**
|
|
822
824
|
* Automatic page-level Scroll Depth + Time on Page.
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
825
|
+
* Time on Page fires once per visit when the visit ends (route change,
|
|
826
|
+
* tab close, or 30-minute idle resume). Hidden tabs pause the clock;
|
|
827
|
+
* visible-but-idle tabs freeze after DWELL_ACTIVITY_IDLE_MS.
|
|
826
828
|
*/
|
|
827
829
|
setupPageEngagement() {
|
|
828
830
|
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
@@ -833,7 +835,7 @@ var AmplifyUpSDK = class {
|
|
|
833
835
|
state.reached = /* @__PURE__ */ new Set();
|
|
834
836
|
state.visibleMs = 0;
|
|
835
837
|
state.visibleSince = document.visibilityState === "visible" ? Date.now() : null;
|
|
836
|
-
state.
|
|
838
|
+
state.dwellEmitted = false;
|
|
837
839
|
state.hiddenAt = document.visibilityState === "hidden" ? Date.now() : null;
|
|
838
840
|
state.lastActivityAt = Date.now();
|
|
839
841
|
state.activityIdle = false;
|
|
@@ -895,48 +897,34 @@ var AmplifyUpSDK = class {
|
|
|
895
897
|
}
|
|
896
898
|
}
|
|
897
899
|
};
|
|
898
|
-
const
|
|
899
|
-
for (const m of DWELL_MILESTONES_SEC) {
|
|
900
|
-
if (m > lastSent) return { seconds: m, reason: "milestone" };
|
|
901
|
-
}
|
|
902
|
-
const nextCheckpoint = Math.floor(lastSent / DWELL_CHECKPOINT_SEC) * DWELL_CHECKPOINT_SEC + DWELL_CHECKPOINT_SEC;
|
|
903
|
-
const target = nextCheckpoint > lastSent ? nextCheckpoint : lastSent + DWELL_CHECKPOINT_SEC;
|
|
904
|
-
return { seconds: target, reason: "checkpoint" };
|
|
905
|
-
};
|
|
906
|
-
const emitDwell = (reason, force = false) => {
|
|
900
|
+
const emitDwell = (reason) => {
|
|
907
901
|
if (this.isPreviewMode()) return;
|
|
902
|
+
if (state.dwellEmitted) return;
|
|
908
903
|
if (!state.activityIdle) {
|
|
909
904
|
accumulateVisible();
|
|
910
905
|
}
|
|
911
906
|
const seconds = Math.floor(state.visibleMs / 1e3);
|
|
912
907
|
if (seconds <= 0) return;
|
|
913
|
-
|
|
914
|
-
if (!force) {
|
|
915
|
-
const target = nextEmitTarget(state.lastDwellSecondsSent);
|
|
916
|
-
if (!target || seconds < target.seconds) return;
|
|
917
|
-
reason = target.reason;
|
|
918
|
-
}
|
|
919
|
-
state.lastDwellSecondsSent = seconds;
|
|
908
|
+
state.dwellEmitted = true;
|
|
920
909
|
this.track("Time on Page", {
|
|
921
910
|
seconds,
|
|
922
911
|
path: this.lastTrackedPath || path(),
|
|
923
912
|
reason
|
|
924
913
|
});
|
|
925
914
|
};
|
|
926
|
-
const
|
|
915
|
+
const evaluateIdle = () => {
|
|
927
916
|
if (document.visibilityState !== "visible") return;
|
|
928
917
|
if (Date.now() - state.lastActivityAt >= DWELL_ACTIVITY_IDLE_MS) {
|
|
929
918
|
freezeActivityIdle();
|
|
930
|
-
return;
|
|
931
919
|
}
|
|
932
|
-
emitDwell("milestone", false);
|
|
933
920
|
};
|
|
934
|
-
this._emitPageDwell = (
|
|
921
|
+
this._emitPageDwell = () => emitDwell("route");
|
|
935
922
|
const onVisibility = () => {
|
|
936
923
|
if (document.visibilityState === "visible") {
|
|
937
924
|
const idleMs = state.hiddenAt != null ? Date.now() - state.hiddenAt : 0;
|
|
938
925
|
state.hiddenAt = null;
|
|
939
926
|
if (idleMs >= SESSION_IDLE_GAP_MS) {
|
|
927
|
+
emitDwell("idle-resume");
|
|
940
928
|
this.resetEngagementQuiet();
|
|
941
929
|
const resumePath = path();
|
|
942
930
|
this.page(resumePath, { resumed: true });
|
|
@@ -953,14 +941,14 @@ var AmplifyUpSDK = class {
|
|
|
953
941
|
state.visibleSince = Date.now();
|
|
954
942
|
state.activityIdle = false;
|
|
955
943
|
} else {
|
|
956
|
-
|
|
944
|
+
accumulateVisible();
|
|
957
945
|
state.hiddenAt = Date.now();
|
|
958
946
|
state.visibleSince = null;
|
|
959
947
|
state.activityIdle = false;
|
|
960
948
|
}
|
|
961
949
|
};
|
|
962
950
|
const onPageHide = () => {
|
|
963
|
-
emitDwell("unload"
|
|
951
|
+
emitDwell("unload");
|
|
964
952
|
if (state.hiddenAt == null) {
|
|
965
953
|
state.hiddenAt = Date.now();
|
|
966
954
|
}
|
|
@@ -981,10 +969,10 @@ var AmplifyUpSDK = class {
|
|
|
981
969
|
window.addEventListener(evt, onActivity, { passive: true });
|
|
982
970
|
}
|
|
983
971
|
checkScroll();
|
|
984
|
-
const
|
|
985
|
-
|
|
972
|
+
const idlePoll = setInterval(() => {
|
|
973
|
+
evaluateIdle();
|
|
986
974
|
}, DWELL_POLL_MS);
|
|
987
|
-
this.trackingIntervals.push(
|
|
975
|
+
this.trackingIntervals.push(idlePoll);
|
|
988
976
|
const previousCleanup = this.trackingCleanup;
|
|
989
977
|
this.trackingCleanup = () => {
|
|
990
978
|
window.removeEventListener("scroll", onScroll);
|
|
@@ -1012,12 +1000,12 @@ var AmplifyUpSDK = class {
|
|
|
1012
1000
|
emit?.(true);
|
|
1013
1001
|
this.resetEngagementQuiet();
|
|
1014
1002
|
}
|
|
1015
|
-
/** Reset dwell/scroll state without emitting (idle resume already flushed
|
|
1003
|
+
/** Reset dwell/scroll state without emitting (idle resume already flushed). */
|
|
1016
1004
|
resetEngagementQuiet() {
|
|
1017
1005
|
const state = this.pageEngagementState;
|
|
1018
1006
|
state.reached = /* @__PURE__ */ new Set();
|
|
1019
1007
|
state.visibleMs = 0;
|
|
1020
|
-
state.
|
|
1008
|
+
state.dwellEmitted = false;
|
|
1021
1009
|
state.hiddenAt = null;
|
|
1022
1010
|
state.lastActivityAt = Date.now();
|
|
1023
1011
|
state.activityIdle = false;
|
|
@@ -1795,6 +1783,12 @@ Available Console Commands:
|
|
|
1795
1783
|
return;
|
|
1796
1784
|
}
|
|
1797
1785
|
try {
|
|
1786
|
+
if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
|
|
1787
|
+
window.dispatchEvent(
|
|
1788
|
+
new CustomEvent("amplifyup:field-patch", { detail: event.data })
|
|
1789
|
+
);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1798
1792
|
if (event.data?.type === "COMPONENT_DELETABLE_STATUS") {
|
|
1799
1793
|
const { componentId, deletable, nodeId } = event.data;
|
|
1800
1794
|
const element = document.querySelector(`[data-component-id="${componentId}"]`);
|
|
@@ -1981,6 +1975,10 @@ Available Console Commands:
|
|
|
1981
1975
|
setEventSelectionMode(enabled) {
|
|
1982
1976
|
if (typeof document === "undefined") return;
|
|
1983
1977
|
this.eventSelectionMode = enabled;
|
|
1978
|
+
if (typeof window !== "undefined") {
|
|
1979
|
+
window.__AMPLIFYUP_EVENT_SELECTION__ = enabled;
|
|
1980
|
+
window.dispatchEvent(new CustomEvent("amplifyup:composer-edit"));
|
|
1981
|
+
}
|
|
1984
1982
|
if (this.eventSelectionClickHandler) {
|
|
1985
1983
|
document.removeEventListener("click", this.eventSelectionClickHandler, true);
|
|
1986
1984
|
this.eventSelectionClickHandler = null;
|
|
@@ -2218,6 +2216,14 @@ Available Console Commands:
|
|
|
2218
2216
|
el.classList.add("amplifyup-selected");
|
|
2219
2217
|
}
|
|
2220
2218
|
});
|
|
2219
|
+
if (typeof window !== "undefined") {
|
|
2220
|
+
window.__AMPLIFYUP_COMPOSER_EDIT__ = highlightComponents;
|
|
2221
|
+
window.dispatchEvent(
|
|
2222
|
+
new CustomEvent("amplifyup:composer-edit", {
|
|
2223
|
+
detail: { enabled: highlightComponents }
|
|
2224
|
+
})
|
|
2225
|
+
);
|
|
2226
|
+
}
|
|
2221
2227
|
}
|
|
2222
2228
|
/** Document-level drag/drop for cross-iframe drags from Composer sidebar. */
|
|
2223
2229
|
setupComposerDragDrop() {
|
|
@@ -2526,6 +2532,12 @@ Available Console Commands:
|
|
|
2526
2532
|
const clearSelection = opts?.clearSelection !== false;
|
|
2527
2533
|
this.highlightingEnabled = false;
|
|
2528
2534
|
this.teardownComposerDragDrop();
|
|
2535
|
+
if (opts?.clearSelection !== false && typeof window !== "undefined") {
|
|
2536
|
+
window.__AMPLIFYUP_COMPOSER_EDIT__ = false;
|
|
2537
|
+
window.dispatchEvent(
|
|
2538
|
+
new CustomEvent("amplifyup:composer-edit", { detail: { enabled: false } })
|
|
2539
|
+
);
|
|
2540
|
+
}
|
|
2529
2541
|
if (this.mutationObserver) {
|
|
2530
2542
|
this.mutationObserver.disconnect();
|
|
2531
2543
|
this.mutationObserver = null;
|
|
@@ -3393,6 +3405,152 @@ function Slot({
|
|
|
3393
3405
|
}
|
|
3394
3406
|
);
|
|
3395
3407
|
}
|
|
3408
|
+
function isComposerEditMode() {
|
|
3409
|
+
if (typeof window === "undefined") return false;
|
|
3410
|
+
return isComposerPreview() && window.__AMPLIFYUP_COMPOSER_EDIT__ === true && window.__AMPLIFYUP_EVENT_SELECTION__ !== true;
|
|
3411
|
+
}
|
|
3412
|
+
function isLikelyNonTextFieldName(name) {
|
|
3413
|
+
const n = name.toLowerCase();
|
|
3414
|
+
return n.includes("href") || n.includes("url") || n.includes("src") || n.includes("image") || n.includes("icon") || n.includes("overlay") || n.includes("color");
|
|
3415
|
+
}
|
|
3416
|
+
function canInlineEdit(name, value) {
|
|
3417
|
+
if (isLikelyNonTextFieldName(name)) return false;
|
|
3418
|
+
if (value !== void 0 && value !== null && typeof value === "object") {
|
|
3419
|
+
return false;
|
|
3420
|
+
}
|
|
3421
|
+
if (typeof value === "boolean") return false;
|
|
3422
|
+
return true;
|
|
3423
|
+
}
|
|
3424
|
+
function useComposerEditMode() {
|
|
3425
|
+
const [enabled, setEnabled] = react.useState(false);
|
|
3426
|
+
react.useEffect(() => {
|
|
3427
|
+
const sync = () => setEnabled(isComposerEditMode());
|
|
3428
|
+
sync();
|
|
3429
|
+
window.addEventListener("amplifyup:composer-edit", sync);
|
|
3430
|
+
return () => window.removeEventListener("amplifyup:composer-edit", sync);
|
|
3431
|
+
}, []);
|
|
3432
|
+
return enabled;
|
|
3433
|
+
}
|
|
3434
|
+
function useFieldOverlay(layoutNodeId, name, source) {
|
|
3435
|
+
const [overlay, setOverlay] = react.useState(void 0);
|
|
3436
|
+
react.useEffect(() => {
|
|
3437
|
+
const onPatch = (event) => {
|
|
3438
|
+
const detail = event.detail || {};
|
|
3439
|
+
if (detail.fieldName !== name) return;
|
|
3440
|
+
if (detail.layoutNodeId && layoutNodeId && String(detail.layoutNodeId) !== String(layoutNodeId)) {
|
|
3441
|
+
return;
|
|
3442
|
+
}
|
|
3443
|
+
setOverlay(detail.value);
|
|
3444
|
+
};
|
|
3445
|
+
window.addEventListener("amplifyup:field-patch", onPatch);
|
|
3446
|
+
return () => window.removeEventListener("amplifyup:field-patch", onPatch);
|
|
3447
|
+
}, [layoutNodeId, name]);
|
|
3448
|
+
return overlay !== void 0 ? overlay : source;
|
|
3449
|
+
}
|
|
3450
|
+
function commitComposerField(layoutNodeId, componentId, name, value) {
|
|
3451
|
+
if (typeof window === "undefined" || window.parent === window) return;
|
|
3452
|
+
window.parent.postMessage(
|
|
3453
|
+
{
|
|
3454
|
+
type: "AMPLIFYUP_FIELD_COMMIT",
|
|
3455
|
+
layoutNodeId,
|
|
3456
|
+
componentId,
|
|
3457
|
+
fieldName: name,
|
|
3458
|
+
value
|
|
3459
|
+
},
|
|
3460
|
+
"*"
|
|
3461
|
+
);
|
|
3462
|
+
}
|
|
3463
|
+
function ComposerInlineField({
|
|
3464
|
+
name,
|
|
3465
|
+
value,
|
|
3466
|
+
fallback,
|
|
3467
|
+
className,
|
|
3468
|
+
render,
|
|
3469
|
+
layoutNodeId,
|
|
3470
|
+
componentId
|
|
3471
|
+
}) {
|
|
3472
|
+
const [editing, setEditing] = react.useState(false);
|
|
3473
|
+
const elRef = react.useRef(null);
|
|
3474
|
+
const text = formatFieldValue(value);
|
|
3475
|
+
const fallbackText = typeof fallback === "string" || typeof fallback === "number" ? String(fallback) : "";
|
|
3476
|
+
const display = text || fallbackText;
|
|
3477
|
+
const showRendered = !!render && !editing;
|
|
3478
|
+
react.useEffect(() => {
|
|
3479
|
+
const el = elRef.current;
|
|
3480
|
+
if (!el || showRendered) return;
|
|
3481
|
+
if (document.activeElement === el) return;
|
|
3482
|
+
const next = display || "";
|
|
3483
|
+
if (el.textContent !== next) el.textContent = next;
|
|
3484
|
+
}, [display, showRendered]);
|
|
3485
|
+
react.useEffect(() => {
|
|
3486
|
+
if (!editing || !elRef.current) return;
|
|
3487
|
+
const el = elRef.current;
|
|
3488
|
+
el.textContent = display || "";
|
|
3489
|
+
el.focus();
|
|
3490
|
+
const range = document.createRange();
|
|
3491
|
+
range.selectNodeContents(el);
|
|
3492
|
+
const sel = window.getSelection();
|
|
3493
|
+
sel?.removeAllRanges();
|
|
3494
|
+
sel?.addRange(range);
|
|
3495
|
+
}, [editing]);
|
|
3496
|
+
const finishEdit = () => {
|
|
3497
|
+
const raw = (elRef.current?.innerText ?? "").replace(/\u00a0/g, " ").replace(/\n+$/g, "");
|
|
3498
|
+
const next = raw.trim() === "" ? "" : raw;
|
|
3499
|
+
setEditing(false);
|
|
3500
|
+
if (next === text) return;
|
|
3501
|
+
if (!text && next === fallbackText) return;
|
|
3502
|
+
commitComposerField(layoutNodeId, componentId, name, next);
|
|
3503
|
+
};
|
|
3504
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3505
|
+
"span",
|
|
3506
|
+
{
|
|
3507
|
+
ref: elRef,
|
|
3508
|
+
className,
|
|
3509
|
+
"data-amplifyup-field": name,
|
|
3510
|
+
"data-amplifyup-node-id": layoutNodeId || void 0,
|
|
3511
|
+
contentEditable: !showRendered,
|
|
3512
|
+
suppressContentEditableWarning: true,
|
|
3513
|
+
role: "textbox",
|
|
3514
|
+
tabIndex: 0,
|
|
3515
|
+
onMouseDown: (event) => {
|
|
3516
|
+
event.stopPropagation();
|
|
3517
|
+
},
|
|
3518
|
+
onClick: (event) => {
|
|
3519
|
+
const link = event.target?.closest?.("a");
|
|
3520
|
+
if (link) event.preventDefault();
|
|
3521
|
+
if (render && isComposerEditMode()) {
|
|
3522
|
+
setEditing(true);
|
|
3523
|
+
}
|
|
3524
|
+
},
|
|
3525
|
+
onFocus: () => {
|
|
3526
|
+
if (!isComposerEditMode()) return;
|
|
3527
|
+
if (render) setEditing(true);
|
|
3528
|
+
},
|
|
3529
|
+
onBlur: finishEdit,
|
|
3530
|
+
onKeyDown: (event) => {
|
|
3531
|
+
event.stopPropagation();
|
|
3532
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
3533
|
+
event.preventDefault();
|
|
3534
|
+
event.currentTarget.blur();
|
|
3535
|
+
}
|
|
3536
|
+
if (event.key === "Escape") {
|
|
3537
|
+
event.preventDefault();
|
|
3538
|
+
if (elRef.current) elRef.current.textContent = display || "";
|
|
3539
|
+
setEditing(false);
|
|
3540
|
+
event.currentTarget.blur();
|
|
3541
|
+
}
|
|
3542
|
+
},
|
|
3543
|
+
style: {
|
|
3544
|
+
cursor: "text",
|
|
3545
|
+
outline: "1px dashed color-mix(in srgb, currentColor 40%, transparent)",
|
|
3546
|
+
outlineOffset: "2px",
|
|
3547
|
+
minWidth: "1ch",
|
|
3548
|
+
display: render ? void 0 : "inline"
|
|
3549
|
+
},
|
|
3550
|
+
children: showRendered ? value != null && value !== "" ? render(value) : fallback ?? display : null
|
|
3551
|
+
}
|
|
3552
|
+
);
|
|
3553
|
+
}
|
|
3396
3554
|
function formatFieldValue(value) {
|
|
3397
3555
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
3398
3556
|
return String(value);
|
|
@@ -3419,11 +3577,30 @@ function Field({
|
|
|
3419
3577
|
render
|
|
3420
3578
|
}) {
|
|
3421
3579
|
const context = react.useContext(ComponentContext);
|
|
3580
|
+
const composerEdit = useComposerEditMode();
|
|
3581
|
+
const fieldValue = useFieldOverlay(
|
|
3582
|
+
context?.layoutNodeId,
|
|
3583
|
+
name,
|
|
3584
|
+
context?.props?.[name]
|
|
3585
|
+
);
|
|
3422
3586
|
if (!context) {
|
|
3423
3587
|
console.warn(`[AmplifyUp SDK] Field "${name}" used outside ComponentContextProvider`);
|
|
3424
3588
|
return fallback ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback }) : null;
|
|
3425
3589
|
}
|
|
3426
|
-
|
|
3590
|
+
if (composerEdit && canInlineEdit(name, fieldValue)) {
|
|
3591
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3592
|
+
ComposerInlineField,
|
|
3593
|
+
{
|
|
3594
|
+
name,
|
|
3595
|
+
value: fieldValue,
|
|
3596
|
+
fallback,
|
|
3597
|
+
className,
|
|
3598
|
+
render,
|
|
3599
|
+
layoutNodeId: context.layoutNodeId,
|
|
3600
|
+
componentId: context.componentId
|
|
3601
|
+
}
|
|
3602
|
+
);
|
|
3603
|
+
}
|
|
3427
3604
|
if (fieldValue === void 0 || fieldValue === null) {
|
|
3428
3605
|
return fallback ? /* @__PURE__ */ jsxRuntime.jsx("span", { className, children: fallback }) : null;
|
|
3429
3606
|
}
|
|
@@ -3451,11 +3628,29 @@ function RichText({
|
|
|
3451
3628
|
as: Tag = "div"
|
|
3452
3629
|
}) {
|
|
3453
3630
|
const context = react.useContext(ComponentContext);
|
|
3631
|
+
const composerEdit = useComposerEditMode();
|
|
3632
|
+
const fieldValue = useFieldOverlay(
|
|
3633
|
+
context?.layoutNodeId,
|
|
3634
|
+
name,
|
|
3635
|
+
context?.props?.[name]
|
|
3636
|
+
);
|
|
3454
3637
|
if (!context) {
|
|
3455
3638
|
console.warn(`[AmplifyUp SDK] RichText "${name}" used outside ComponentContextProvider`);
|
|
3456
3639
|
return fallback ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback }) : null;
|
|
3457
3640
|
}
|
|
3458
|
-
|
|
3641
|
+
if (composerEdit && canInlineEdit(name, fieldValue)) {
|
|
3642
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3643
|
+
ComposerInlineField,
|
|
3644
|
+
{
|
|
3645
|
+
name,
|
|
3646
|
+
value: fieldValue,
|
|
3647
|
+
fallback,
|
|
3648
|
+
className,
|
|
3649
|
+
layoutNodeId: context.layoutNodeId,
|
|
3650
|
+
componentId: context.componentId
|
|
3651
|
+
}
|
|
3652
|
+
);
|
|
3653
|
+
}
|
|
3459
3654
|
if (fieldValue === void 0 || fieldValue === null || fieldValue === "") {
|
|
3460
3655
|
return fallback ? /* @__PURE__ */ jsxRuntime.jsx(Tag, { className, children: fallback }) : null;
|
|
3461
3656
|
}
|