@amplifyup/sdk 0.1.46 → 0.1.47

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.d.mts CHANGED
@@ -93,7 +93,7 @@ declare function Field({ name, fallback, className, render, }: {
93
93
  fallback?: ReactNode;
94
94
  className?: string;
95
95
  render?: (value: any) => ReactNode;
96
- }): string | number | true | Iterable<React.ReactNode> | react_jsx_runtime.JSX.Element | null;
96
+ }): string | number | true | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | null;
97
97
  /**
98
98
  * RichText - Renders a markdown (or HTML string) field as formatted HTML.
99
99
  *
package/dist/react.d.ts CHANGED
@@ -93,7 +93,7 @@ declare function Field({ name, fallback, className, render, }: {
93
93
  fallback?: ReactNode;
94
94
  className?: string;
95
95
  render?: (value: any) => ReactNode;
96
- }): string | number | true | Iterable<React.ReactNode> | react_jsx_runtime.JSX.Element | null;
96
+ }): string | number | true | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | null;
97
97
  /**
98
98
  * RichText - Renders a markdown (or HTML string) field as formatted HTML.
99
99
  *
package/dist/react.js CHANGED
@@ -2984,17 +2984,29 @@ Available Console Commands:
2984
2984
  '[data-slot-id="main"], [data-amplifyup-slot="main"] {',
2985
2985
  " min-height: 50vh !important;",
2986
2986
  "}",
2987
- /* Single empty-state hint — Slot React label uses .amplifyup-slot-placeholder */
2987
+ /* Empty-slot CTA — Slot / AmplifyPageContent EmptySlotHint */
2988
2988
  ".amplifyup-slot-placeholder {",
2989
2989
  " display: flex !important;",
2990
+ " flex-direction: column !important;",
2990
2991
  " align-items: center !important;",
2991
2992
  " justify-content: center !important;",
2993
+ " gap: 12px !important;",
2992
2994
  " min-height: inherit !important;",
2993
- " color: rgba(34, 197, 94, 0.75) !important;",
2994
- " font-size: 14px !important;",
2995
- " font-weight: 500 !important;",
2995
+ " color: rgba(22, 163, 74, 0.85) !important;",
2996
+ " font-size: 15px !important;",
2997
+ " font-weight: 600 !important;",
2996
2998
  " pointer-events: none !important;",
2997
2999
  " text-align: center !important;",
3000
+ " box-sizing: border-box !important;",
3001
+ "}",
3002
+ ".amplifyup-slot-placeholder-icon {",
3003
+ " color: inherit !important;",
3004
+ "}",
3005
+ ".amplifyup-slot-placeholder-label {",
3006
+ " color: inherit !important;",
3007
+ "}",
3008
+ ".amplifyup-slot-label {",
3009
+ " pointer-events: none !important;",
2998
3010
  "}",
2999
3011
  "[data-slot-id].amplifyup-slot-hover, [data-amplifyup-slot].amplifyup-slot-hover {",
3000
3012
  " outline-color: rgba(34, 197, 94, 1) !important;",
@@ -3318,6 +3330,100 @@ function getSDK(adapter) {
3318
3330
  var trackContentView = (contentId, contentType, properties) => getSDK().trackContentView(contentId, contentType, properties);
3319
3331
  var refreshEventTracking = () => getSDK().refreshEventTracking();
3320
3332
  getSDK();
3333
+ function AddComponentIcon({ size = 28 }) {
3334
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3335
+ "svg",
3336
+ {
3337
+ width: size,
3338
+ height: size,
3339
+ viewBox: "0 0 24 24",
3340
+ fill: "none",
3341
+ xmlns: "http://www.w3.org/2000/svg",
3342
+ "aria-hidden": "true",
3343
+ focusable: "false",
3344
+ children: [
3345
+ /* @__PURE__ */ jsxRuntime.jsx(
3346
+ "rect",
3347
+ {
3348
+ x: "3",
3349
+ y: "3",
3350
+ width: "18",
3351
+ height: "18",
3352
+ rx: "4",
3353
+ stroke: "currentColor",
3354
+ strokeWidth: "1.75"
3355
+ }
3356
+ ),
3357
+ /* @__PURE__ */ jsxRuntime.jsx(
3358
+ "path",
3359
+ {
3360
+ d: "M12 8v8M8 12h8",
3361
+ stroke: "currentColor",
3362
+ strokeWidth: "1.75",
3363
+ strokeLinecap: "round"
3364
+ }
3365
+ )
3366
+ ]
3367
+ }
3368
+ );
3369
+ }
3370
+ function EmptySlotHint({
3371
+ label = "Click here to Add Component",
3372
+ compact = false
3373
+ }) {
3374
+ const iconSize = compact ? 20 : 28;
3375
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3376
+ "div",
3377
+ {
3378
+ className: "amplifyup-slot-placeholder",
3379
+ style: {
3380
+ display: "flex",
3381
+ flexDirection: "column",
3382
+ alignItems: "center",
3383
+ justifyContent: "center",
3384
+ gap: compact ? 8 : 12,
3385
+ minHeight: compact ? 60 : void 0,
3386
+ width: "100%",
3387
+ pointerEvents: "none",
3388
+ textAlign: "center",
3389
+ boxSizing: "border-box",
3390
+ padding: compact ? "12px 8px" : "24px 16px"
3391
+ },
3392
+ children: [
3393
+ /* @__PURE__ */ jsxRuntime.jsx(
3394
+ "span",
3395
+ {
3396
+ className: "amplifyup-slot-placeholder-icon",
3397
+ style: {
3398
+ display: "inline-flex",
3399
+ alignItems: "center",
3400
+ justifyContent: "center",
3401
+ width: compact ? 36 : 48,
3402
+ height: compact ? 36 : 48,
3403
+ borderRadius: 12,
3404
+ border: "1.5px dashed currentColor",
3405
+ opacity: 0.9
3406
+ },
3407
+ children: /* @__PURE__ */ jsxRuntime.jsx(AddComponentIcon, { size: iconSize })
3408
+ }
3409
+ ),
3410
+ /* @__PURE__ */ jsxRuntime.jsx(
3411
+ "span",
3412
+ {
3413
+ className: "amplifyup-slot-placeholder-label",
3414
+ style: {
3415
+ fontSize: compact ? 13 : 15,
3416
+ fontWeight: 600,
3417
+ lineHeight: 1.3,
3418
+ letterSpacing: "0.01em"
3419
+ },
3420
+ children: label
3421
+ }
3422
+ )
3423
+ ]
3424
+ }
3425
+ );
3426
+ }
3321
3427
  var ComponentContext = React.createContext(null);
3322
3428
  function useLiveComposerProps(layoutNodeId, props) {
3323
3429
  const [live, setLive] = React.useState(props);
@@ -3462,7 +3568,7 @@ function Slot({
3462
3568
  // Only add position relative for overlay positioning in editor mode
3463
3569
  position: isEditorMode ? "relative" : void 0
3464
3570
  },
3465
- children: isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
3571
+ children: isEmpty ? isEditorMode ? /* @__PURE__ */ jsxRuntime.jsx(EmptySlotHint, { compact: true }) : /* @__PURE__ */ jsxRuntime.jsx(
3466
3572
  "div",
3467
3573
  {
3468
3574
  className: "amplifyup-slot-placeholder",
@@ -3472,13 +3578,13 @@ function Slot({
3472
3578
  fontSize: "14px",
3473
3579
  pointerEvents: "none"
3474
3580
  },
3475
- children: isEditorMode ? `Drop components here` : `Empty slot: ${name}`
3581
+ children: `Empty slot: ${name}`
3476
3582
  }
3477
3583
  ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3478
3584
  isEditorMode && /* @__PURE__ */ jsxRuntime.jsxs(
3479
3585
  "div",
3480
3586
  {
3481
- className: "amplifyup-slot-placeholder",
3587
+ className: "amplifyup-slot-label",
3482
3588
  style: {
3483
3589
  position: "absolute",
3484
3590
  top: "4px",
@@ -3486,8 +3592,7 @@ function Slot({
3486
3592
  fontSize: "10px",
3487
3593
  color: "#9ca3af",
3488
3594
  pointerEvents: "none",
3489
- zIndex: 1,
3490
- minHeight: "auto"
3595
+ zIndex: 1
3491
3596
  },
3492
3597
  children: [
3493
3598
  "Slot: ",
@@ -4447,7 +4552,7 @@ function defaultPreviewCanvas() {
4447
4552
  "data-slot-source": "page",
4448
4553
  "data-slot-empty": "true",
4449
4554
  style: { minHeight: "50vh", width: "100%", display: "block", position: "relative" },
4450
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "amplifyup-slot-placeholder", children: "Drop components here" })
4555
+ children: /* @__PURE__ */ jsxRuntime.jsx(EmptySlotHint, {})
4451
4556
  }
4452
4557
  );
4453
4558
  }