@amplifyup/sdk 0.1.46 → 0.1.48
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/README.md +1 -1
- package/dist/AmplifyRenderer.js +16 -4
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +16 -4
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +115 -10
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +115 -10
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -2978,17 +2978,29 @@ Available Console Commands:
|
|
|
2978
2978
|
'[data-slot-id="main"], [data-amplifyup-slot="main"] {',
|
|
2979
2979
|
" min-height: 50vh !important;",
|
|
2980
2980
|
"}",
|
|
2981
|
-
/*
|
|
2981
|
+
/* Empty-slot CTA — Slot / AmplifyPageContent EmptySlotHint */
|
|
2982
2982
|
".amplifyup-slot-placeholder {",
|
|
2983
2983
|
" display: flex !important;",
|
|
2984
|
+
" flex-direction: column !important;",
|
|
2984
2985
|
" align-items: center !important;",
|
|
2985
2986
|
" justify-content: center !important;",
|
|
2987
|
+
" gap: 12px !important;",
|
|
2986
2988
|
" min-height: inherit !important;",
|
|
2987
|
-
" color: rgba(
|
|
2988
|
-
" font-size:
|
|
2989
|
-
" font-weight:
|
|
2989
|
+
" color: rgba(22, 163, 74, 0.85) !important;",
|
|
2990
|
+
" font-size: 15px !important;",
|
|
2991
|
+
" font-weight: 600 !important;",
|
|
2990
2992
|
" pointer-events: none !important;",
|
|
2991
2993
|
" text-align: center !important;",
|
|
2994
|
+
" box-sizing: border-box !important;",
|
|
2995
|
+
"}",
|
|
2996
|
+
".amplifyup-slot-placeholder-icon {",
|
|
2997
|
+
" color: inherit !important;",
|
|
2998
|
+
"}",
|
|
2999
|
+
".amplifyup-slot-placeholder-label {",
|
|
3000
|
+
" color: inherit !important;",
|
|
3001
|
+
"}",
|
|
3002
|
+
".amplifyup-slot-label {",
|
|
3003
|
+
" pointer-events: none !important;",
|
|
2992
3004
|
"}",
|
|
2993
3005
|
"[data-slot-id].amplifyup-slot-hover, [data-amplifyup-slot].amplifyup-slot-hover {",
|
|
2994
3006
|
" outline-color: rgba(34, 197, 94, 1) !important;",
|
|
@@ -3312,6 +3324,100 @@ function getSDK(adapter) {
|
|
|
3312
3324
|
var trackContentView = (contentId, contentType, properties) => getSDK().trackContentView(contentId, contentType, properties);
|
|
3313
3325
|
var refreshEventTracking = () => getSDK().refreshEventTracking();
|
|
3314
3326
|
getSDK();
|
|
3327
|
+
function AddComponentIcon({ size = 28 }) {
|
|
3328
|
+
return /* @__PURE__ */ jsxs(
|
|
3329
|
+
"svg",
|
|
3330
|
+
{
|
|
3331
|
+
width: size,
|
|
3332
|
+
height: size,
|
|
3333
|
+
viewBox: "0 0 24 24",
|
|
3334
|
+
fill: "none",
|
|
3335
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3336
|
+
"aria-hidden": "true",
|
|
3337
|
+
focusable: "false",
|
|
3338
|
+
children: [
|
|
3339
|
+
/* @__PURE__ */ jsx(
|
|
3340
|
+
"rect",
|
|
3341
|
+
{
|
|
3342
|
+
x: "3",
|
|
3343
|
+
y: "3",
|
|
3344
|
+
width: "18",
|
|
3345
|
+
height: "18",
|
|
3346
|
+
rx: "4",
|
|
3347
|
+
stroke: "currentColor",
|
|
3348
|
+
strokeWidth: "1.75"
|
|
3349
|
+
}
|
|
3350
|
+
),
|
|
3351
|
+
/* @__PURE__ */ jsx(
|
|
3352
|
+
"path",
|
|
3353
|
+
{
|
|
3354
|
+
d: "M12 8v8M8 12h8",
|
|
3355
|
+
stroke: "currentColor",
|
|
3356
|
+
strokeWidth: "1.75",
|
|
3357
|
+
strokeLinecap: "round"
|
|
3358
|
+
}
|
|
3359
|
+
)
|
|
3360
|
+
]
|
|
3361
|
+
}
|
|
3362
|
+
);
|
|
3363
|
+
}
|
|
3364
|
+
function EmptySlotHint({
|
|
3365
|
+
label = "Click here to Add Component",
|
|
3366
|
+
compact = false
|
|
3367
|
+
}) {
|
|
3368
|
+
const iconSize = compact ? 20 : 28;
|
|
3369
|
+
return /* @__PURE__ */ jsxs(
|
|
3370
|
+
"div",
|
|
3371
|
+
{
|
|
3372
|
+
className: "amplifyup-slot-placeholder",
|
|
3373
|
+
style: {
|
|
3374
|
+
display: "flex",
|
|
3375
|
+
flexDirection: "column",
|
|
3376
|
+
alignItems: "center",
|
|
3377
|
+
justifyContent: "center",
|
|
3378
|
+
gap: compact ? 8 : 12,
|
|
3379
|
+
minHeight: compact ? 60 : void 0,
|
|
3380
|
+
width: "100%",
|
|
3381
|
+
pointerEvents: "none",
|
|
3382
|
+
textAlign: "center",
|
|
3383
|
+
boxSizing: "border-box",
|
|
3384
|
+
padding: compact ? "12px 8px" : "24px 16px"
|
|
3385
|
+
},
|
|
3386
|
+
children: [
|
|
3387
|
+
/* @__PURE__ */ jsx(
|
|
3388
|
+
"span",
|
|
3389
|
+
{
|
|
3390
|
+
className: "amplifyup-slot-placeholder-icon",
|
|
3391
|
+
style: {
|
|
3392
|
+
display: "inline-flex",
|
|
3393
|
+
alignItems: "center",
|
|
3394
|
+
justifyContent: "center",
|
|
3395
|
+
width: compact ? 36 : 48,
|
|
3396
|
+
height: compact ? 36 : 48,
|
|
3397
|
+
borderRadius: 12,
|
|
3398
|
+
border: "1.5px dashed currentColor",
|
|
3399
|
+
opacity: 0.9
|
|
3400
|
+
},
|
|
3401
|
+
children: /* @__PURE__ */ jsx(AddComponentIcon, { size: iconSize })
|
|
3402
|
+
}
|
|
3403
|
+
),
|
|
3404
|
+
/* @__PURE__ */ jsx(
|
|
3405
|
+
"span",
|
|
3406
|
+
{
|
|
3407
|
+
className: "amplifyup-slot-placeholder-label",
|
|
3408
|
+
style: {
|
|
3409
|
+
fontSize: compact ? 13 : 15,
|
|
3410
|
+
fontWeight: 600,
|
|
3411
|
+
lineHeight: 1.3,
|
|
3412
|
+
letterSpacing: "0.01em"
|
|
3413
|
+
},
|
|
3414
|
+
children: label
|
|
3415
|
+
}
|
|
3416
|
+
)
|
|
3417
|
+
]
|
|
3418
|
+
}
|
|
3419
|
+
);
|
|
3420
|
+
}
|
|
3315
3421
|
var ComponentContext = createContext(null);
|
|
3316
3422
|
function useLiveComposerProps(layoutNodeId, props) {
|
|
3317
3423
|
const [live, setLive] = useState(props);
|
|
@@ -3456,7 +3562,7 @@ function Slot({
|
|
|
3456
3562
|
// Only add position relative for overlay positioning in editor mode
|
|
3457
3563
|
position: isEditorMode ? "relative" : void 0
|
|
3458
3564
|
},
|
|
3459
|
-
children: isEmpty ? /* @__PURE__ */ jsx(
|
|
3565
|
+
children: isEmpty ? isEditorMode ? /* @__PURE__ */ jsx(EmptySlotHint, { compact: true }) : /* @__PURE__ */ jsx(
|
|
3460
3566
|
"div",
|
|
3461
3567
|
{
|
|
3462
3568
|
className: "amplifyup-slot-placeholder",
|
|
@@ -3466,13 +3572,13 @@ function Slot({
|
|
|
3466
3572
|
fontSize: "14px",
|
|
3467
3573
|
pointerEvents: "none"
|
|
3468
3574
|
},
|
|
3469
|
-
children:
|
|
3575
|
+
children: `Empty slot: ${name}`
|
|
3470
3576
|
}
|
|
3471
3577
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3472
3578
|
isEditorMode && /* @__PURE__ */ jsxs(
|
|
3473
3579
|
"div",
|
|
3474
3580
|
{
|
|
3475
|
-
className: "amplifyup-slot-
|
|
3581
|
+
className: "amplifyup-slot-label",
|
|
3476
3582
|
style: {
|
|
3477
3583
|
position: "absolute",
|
|
3478
3584
|
top: "4px",
|
|
@@ -3480,8 +3586,7 @@ function Slot({
|
|
|
3480
3586
|
fontSize: "10px",
|
|
3481
3587
|
color: "#9ca3af",
|
|
3482
3588
|
pointerEvents: "none",
|
|
3483
|
-
zIndex: 1
|
|
3484
|
-
minHeight: "auto"
|
|
3589
|
+
zIndex: 1
|
|
3485
3590
|
},
|
|
3486
3591
|
children: [
|
|
3487
3592
|
"Slot: ",
|
|
@@ -4441,7 +4546,7 @@ function defaultPreviewCanvas() {
|
|
|
4441
4546
|
"data-slot-source": "page",
|
|
4442
4547
|
"data-slot-empty": "true",
|
|
4443
4548
|
style: { minHeight: "50vh", width: "100%", display: "block", position: "relative" },
|
|
4444
|
-
children: /* @__PURE__ */ jsx(
|
|
4549
|
+
children: /* @__PURE__ */ jsx(EmptySlotHint, {})
|
|
4445
4550
|
}
|
|
4446
4551
|
);
|
|
4447
4552
|
}
|