@amplifyup/sdk 0.1.45 → 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/AmplifyRenderer.d.mts +1 -1
- package/dist/AmplifyRenderer.d.ts +1 -1
- package/dist/AmplifyRenderer.js +20 -4
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +20 -4
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{query-2-zPPrMI.d.mts → query-CWFb7rSm.d.mts} +1 -1
- package/dist/{query-CFpvzSZT.d.ts → query-L7zSmLFX.d.ts} +1 -1
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +119 -10
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +119 -10
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/{types-NdLzHxZo.d.mts → types-DpTzUg1C.d.mts} +1 -0
- package/dist/{types-NdLzHxZo.d.ts → types-DpTzUg1C.d.ts} +1 -0
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-
|
|
3
|
-
export { Z as ZoneConfig } from './types-
|
|
2
|
+
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-DpTzUg1C.mjs';
|
|
3
|
+
export { Z as ZoneConfig } from './types-DpTzUg1C.mjs';
|
|
4
4
|
import React, { ReactNode } from 'react';
|
|
5
5
|
export { AmplifyRenderer } from './AmplifyRenderer.mjs';
|
|
6
|
-
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-
|
|
6
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-CWFb7rSm.mjs';
|
|
7
7
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.mjs';
|
|
8
8
|
export { fetchPageConfigServer } from './server.mjs';
|
|
9
9
|
import './reservedRoutes-aGgViBDM.mjs';
|
|
@@ -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> |
|
|
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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-
|
|
3
|
-
export { Z as ZoneConfig } from './types-
|
|
2
|
+
import { P as PageConfig, c as AmplifyUpConfig, e as AmplifyPageContextInput, C as ContentSource, A as AmplifyContentMeta } from './types-DpTzUg1C.js';
|
|
3
|
+
export { Z as ZoneConfig } from './types-DpTzUg1C.js';
|
|
4
4
|
import React, { ReactNode } from 'react';
|
|
5
5
|
export { AmplifyRenderer } from './AmplifyRenderer.js';
|
|
6
|
-
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-
|
|
6
|
+
export { Q as QueryContentError, e as QueryContentOptions, k as QueryFilter, l as QueryFilterOp, i as QueryPagination, h as QueryResult, m as QuerySort, j as QuerySpec, S as SelectVariantsError, a as SelectVariantsOptions, b as SelectVariantsResult, n as nextPageSpec, q as queryContent, d as searchSpec, s as selectVariants } from './query-L7zSmLFX.js';
|
|
7
7
|
export { i as isComposerPreview, a as isPreviewRequest, b as isWorkingContentRequest } from './preview-_vHmzRen.js';
|
|
8
8
|
export { fetchPageConfigServer } from './server.js';
|
|
9
9
|
import './reservedRoutes-aGgViBDM.js';
|
|
@@ -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> |
|
|
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
|
@@ -501,6 +501,10 @@ function applyPageContext(input, opts) {
|
|
|
501
501
|
log.warn(`AmplifyUp: unknown resource field "${k}" dropped`);
|
|
502
502
|
continue;
|
|
503
503
|
}
|
|
504
|
+
if (def.passThrough) {
|
|
505
|
+
if (v != null) fields[k] = v;
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
504
508
|
const coerced = coerceField(def, v, log);
|
|
505
509
|
if (coerced !== void 0) fields[k] = coerced;
|
|
506
510
|
}
|
|
@@ -2980,17 +2984,29 @@ Available Console Commands:
|
|
|
2980
2984
|
'[data-slot-id="main"], [data-amplifyup-slot="main"] {',
|
|
2981
2985
|
" min-height: 50vh !important;",
|
|
2982
2986
|
"}",
|
|
2983
|
-
/*
|
|
2987
|
+
/* Empty-slot CTA — Slot / AmplifyPageContent EmptySlotHint */
|
|
2984
2988
|
".amplifyup-slot-placeholder {",
|
|
2985
2989
|
" display: flex !important;",
|
|
2990
|
+
" flex-direction: column !important;",
|
|
2986
2991
|
" align-items: center !important;",
|
|
2987
2992
|
" justify-content: center !important;",
|
|
2993
|
+
" gap: 12px !important;",
|
|
2988
2994
|
" min-height: inherit !important;",
|
|
2989
|
-
" color: rgba(
|
|
2990
|
-
" font-size:
|
|
2991
|
-
" font-weight:
|
|
2995
|
+
" color: rgba(22, 163, 74, 0.85) !important;",
|
|
2996
|
+
" font-size: 15px !important;",
|
|
2997
|
+
" font-weight: 600 !important;",
|
|
2992
2998
|
" pointer-events: none !important;",
|
|
2993
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;",
|
|
2994
3010
|
"}",
|
|
2995
3011
|
"[data-slot-id].amplifyup-slot-hover, [data-amplifyup-slot].amplifyup-slot-hover {",
|
|
2996
3012
|
" outline-color: rgba(34, 197, 94, 1) !important;",
|
|
@@ -3314,6 +3330,100 @@ function getSDK(adapter) {
|
|
|
3314
3330
|
var trackContentView = (contentId, contentType, properties) => getSDK().trackContentView(contentId, contentType, properties);
|
|
3315
3331
|
var refreshEventTracking = () => getSDK().refreshEventTracking();
|
|
3316
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
|
+
}
|
|
3317
3427
|
var ComponentContext = React.createContext(null);
|
|
3318
3428
|
function useLiveComposerProps(layoutNodeId, props) {
|
|
3319
3429
|
const [live, setLive] = React.useState(props);
|
|
@@ -3458,7 +3568,7 @@ function Slot({
|
|
|
3458
3568
|
// Only add position relative for overlay positioning in editor mode
|
|
3459
3569
|
position: isEditorMode ? "relative" : void 0
|
|
3460
3570
|
},
|
|
3461
|
-
children: isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3571
|
+
children: isEmpty ? isEditorMode ? /* @__PURE__ */ jsxRuntime.jsx(EmptySlotHint, { compact: true }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3462
3572
|
"div",
|
|
3463
3573
|
{
|
|
3464
3574
|
className: "amplifyup-slot-placeholder",
|
|
@@ -3468,13 +3578,13 @@ function Slot({
|
|
|
3468
3578
|
fontSize: "14px",
|
|
3469
3579
|
pointerEvents: "none"
|
|
3470
3580
|
},
|
|
3471
|
-
children:
|
|
3581
|
+
children: `Empty slot: ${name}`
|
|
3472
3582
|
}
|
|
3473
3583
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3474
3584
|
isEditorMode && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3475
3585
|
"div",
|
|
3476
3586
|
{
|
|
3477
|
-
className: "amplifyup-slot-
|
|
3587
|
+
className: "amplifyup-slot-label",
|
|
3478
3588
|
style: {
|
|
3479
3589
|
position: "absolute",
|
|
3480
3590
|
top: "4px",
|
|
@@ -3482,8 +3592,7 @@ function Slot({
|
|
|
3482
3592
|
fontSize: "10px",
|
|
3483
3593
|
color: "#9ca3af",
|
|
3484
3594
|
pointerEvents: "none",
|
|
3485
|
-
zIndex: 1
|
|
3486
|
-
minHeight: "auto"
|
|
3595
|
+
zIndex: 1
|
|
3487
3596
|
},
|
|
3488
3597
|
children: [
|
|
3489
3598
|
"Slot: ",
|
|
@@ -4443,7 +4552,7 @@ function defaultPreviewCanvas() {
|
|
|
4443
4552
|
"data-slot-source": "page",
|
|
4444
4553
|
"data-slot-empty": "true",
|
|
4445
4554
|
style: { minHeight: "50vh", width: "100%", display: "block", position: "relative" },
|
|
4446
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4555
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(EmptySlotHint, {})
|
|
4447
4556
|
}
|
|
4448
4557
|
);
|
|
4449
4558
|
}
|