@payloadcms/ui 3.57.0-canary.6 → 3.57.0-internal.1d2ebbc
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/elements/BulkUpload/FileSidebar/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FileSidebar/index.js +74 -38
- package/dist/elements/BulkUpload/FileSidebar/index.js.map +1 -1
- package/dist/elements/BulkUpload/FileSidebar/index.scss +14 -1
- package/dist/elements/BulkUpload/FormsManager/index.d.ts +6 -1
- package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.js +50 -14
- package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/reducer.d.ts +2 -2
- package/dist/elements/BulkUpload/FormsManager/reducer.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/reducer.js +5 -5
- package/dist/elements/BulkUpload/FormsManager/reducer.js.map +1 -1
- package/dist/elements/BulkUpload/index.d.ts +27 -3
- package/dist/elements/BulkUpload/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/index.js +117 -28
- package/dist/elements/BulkUpload/index.js.map +1 -1
- package/dist/elements/LivePreview/IFrame/index.d.ts +7 -1
- package/dist/elements/LivePreview/IFrame/index.d.ts.map +1 -1
- package/dist/elements/LivePreview/IFrame/index.js +18 -39
- package/dist/elements/LivePreview/IFrame/index.js.map +1 -1
- package/dist/elements/LivePreview/Window/index.d.ts.map +1 -1
- package/dist/elements/LivePreview/Window/index.js +61 -135
- package/dist/elements/LivePreview/Window/index.js.map +1 -1
- package/dist/elements/SearchBar/index.scss +0 -4
- package/dist/elements/Status/index.d.ts.map +1 -1
- package/dist/elements/Status/index.js +1 -1
- package/dist/elements/Status/index.js.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.js +28 -44
- package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
- package/dist/exports/client/index.js +24 -24
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/rsc/index.d.ts +0 -1
- package/dist/exports/rsc/index.d.ts.map +1 -1
- package/dist/exports/rsc/index.js +0 -1
- package/dist/exports/rsc/index.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +16 -36
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/forms/Form/index.js +2 -1
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
- package/dist/forms/Form/mergeServerFormState.js +0 -8
- package/dist/forms/Form/mergeServerFormState.js.map +1 -1
- package/dist/forms/Form/types.d.ts +2 -2
- package/dist/forms/Form/types.d.ts.map +1 -1
- package/dist/forms/Form/types.js.map +1 -1
- package/dist/forms/RenderFields/RenderField.js +236 -223
- package/dist/forms/RenderFields/RenderField.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +1 -32
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +1 -2
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js +0 -2
- package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.d.ts +0 -6
- package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
- package/dist/forms/useField/index.d.ts.map +1 -1
- package/dist/forms/useField/index.js +73 -76
- package/dist/forms/useField/index.js.map +1 -1
- package/dist/forms/useField/types.d.ts +9 -5
- package/dist/forms/useField/types.d.ts.map +1 -1
- package/dist/forms/useField/types.js.map +1 -1
- package/dist/providers/LivePreview/context.d.ts +2 -17
- package/dist/providers/LivePreview/context.d.ts.map +1 -1
- package/dist/providers/LivePreview/context.js +2 -3
- package/dist/providers/LivePreview/context.js.map +1 -1
- package/dist/providers/LivePreview/index.d.ts +2 -2
- package/dist/providers/LivePreview/index.d.ts.map +1 -1
- package/dist/providers/LivePreview/index.js +19 -33
- package/dist/providers/LivePreview/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/buildFormState.d.ts +0 -2
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js +1 -20
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +10 -17
- package/dist/views/Edit/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/utilities/formatAbsoluteURL.d.ts +0 -8
- package/dist/utilities/formatAbsoluteURL.d.ts.map +0 -1
- package/dist/utilities/formatAbsoluteURL.js +0 -15
- package/dist/utilities/formatAbsoluteURL.js.map +0 -1
- package/dist/utilities/handleLivePreview.d.ts +0 -58
- package/dist/utilities/handleLivePreview.d.ts.map +0 -1
- package/dist/utilities/handleLivePreview.js +0 -96
- package/dist/utilities/handleLivePreview.js.map +0 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.scss';
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
|
+
ref: React.RefObject<HTMLIFrameElement>;
|
|
5
|
+
setIframeHasLoaded: (value: boolean) => void;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const IFrame: React.FC<Props>;
|
|
9
|
+
export {};
|
|
4
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/LivePreview/IFrame/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/LivePreview/IFrame/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;AAIrB,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmBlC,CAAA"}
|
|
@@ -1,51 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { useLivePreviewContext } from '../../../providers/LivePreview/context.js';
|
|
7
6
|
import './index.scss';
|
|
8
7
|
const baseClass = 'live-preview-iframe';
|
|
9
|
-
export const IFrame =
|
|
10
|
-
const
|
|
8
|
+
export const IFrame = props => {
|
|
9
|
+
const {
|
|
10
|
+
ref,
|
|
11
|
+
setIframeHasLoaded,
|
|
12
|
+
url
|
|
13
|
+
} = props;
|
|
11
14
|
const {
|
|
12
|
-
iframeRef,
|
|
13
|
-
setLoadedURL,
|
|
14
|
-
url,
|
|
15
15
|
zoom
|
|
16
16
|
} = useLivePreviewContext();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
let t2;
|
|
30
|
-
if ($[3] !== iframeRef || $[4] !== t0 || $[5] !== t1 || $[6] !== url) {
|
|
31
|
-
t2 = _jsx("iframe", {
|
|
32
|
-
className: baseClass,
|
|
33
|
-
onLoad: t0,
|
|
34
|
-
ref: iframeRef,
|
|
35
|
-
src: url,
|
|
36
|
-
style: {
|
|
37
|
-
transform: t1
|
|
38
|
-
},
|
|
39
|
-
title: url
|
|
40
|
-
}, url);
|
|
41
|
-
$[3] = iframeRef;
|
|
42
|
-
$[4] = t0;
|
|
43
|
-
$[5] = t1;
|
|
44
|
-
$[6] = url;
|
|
45
|
-
$[7] = t2;
|
|
46
|
-
} else {
|
|
47
|
-
t2 = $[7];
|
|
48
|
-
}
|
|
49
|
-
return t2;
|
|
17
|
+
return /*#__PURE__*/_jsx("iframe", {
|
|
18
|
+
className: baseClass,
|
|
19
|
+
onLoad: () => {
|
|
20
|
+
setIframeHasLoaded(true);
|
|
21
|
+
},
|
|
22
|
+
ref: ref,
|
|
23
|
+
src: url,
|
|
24
|
+
style: {
|
|
25
|
+
transform: typeof zoom === 'number' ? `scale(${zoom}) ` : undefined
|
|
26
|
+
},
|
|
27
|
+
title: url
|
|
28
|
+
});
|
|
50
29
|
};
|
|
51
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useLivePreviewContext","baseClass","IFrame","props","ref","setIframeHasLoaded","url","zoom","_jsx","className","onLoad","src","style","transform","undefined","title"],"sources":["../../../../src/elements/LivePreview/IFrame/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../../../providers/LivePreview/context.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-iframe'\n\ntype Props = {\n ref: React.RefObject<HTMLIFrameElement>\n setIframeHasLoaded: (value: boolean) => void\n url: string\n}\n\nexport const IFrame: React.FC<Props> = (props) => {\n const { ref, setIframeHasLoaded, url } = props\n\n const { zoom } = useLivePreviewContext()\n\n return (\n <iframe\n className={baseClass}\n onLoad={() => {\n setIframeHasLoaded(true)\n }}\n ref={ref}\n src={url}\n style={{\n transform: typeof zoom === 'number' ? `scale(${zoom}) ` : undefined,\n }}\n title={url}\n />\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,SAASC,qBAAqB,QAAQ;AACtC,OAAO;AAEP,MAAMC,SAAA,GAAY;AAQlB,OAAO,MAAMC,MAAA,GAA2BC,KAAA;EACtC,MAAM;IAAEC,GAAG;IAAEC,kBAAkB;IAAEC;EAAG,CAAE,GAAGH,KAAA;EAEzC,MAAM;IAAEI;EAAI,CAAE,GAAGP,qBAAA;EAEjB,oBACEQ,IAAA,CAAC;IACCC,SAAA,EAAWR,SAAA;IACXS,MAAA,EAAQA,CAAA;MACNL,kBAAA,CAAmB;IACrB;IACAD,GAAA,EAAKA,GAAA;IACLO,GAAA,EAAKL,GAAA;IACLM,KAAA,EAAO;MACLC,SAAA,EAAW,OAAON,IAAA,KAAS,WAAW,SAASA,IAAA,IAAQ,GAAGO;IAC5D;IACAC,KAAA,EAAOT;;AAGb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/LivePreview/Window/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/LivePreview/Window/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAoB,MAAM,OAAO,CAAA;AASxC,OAAO,cAAc,CAAA;AAMrB,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0HrD,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { reduceFieldsToValues } from 'payload/shared';
|
|
6
5
|
import React, { useEffect } from 'react';
|
|
@@ -11,20 +10,20 @@ import { useLivePreviewContext } from '../../../providers/LivePreview/context.js
|
|
|
11
10
|
import { useLocale } from '../../../providers/Locale/index.js';
|
|
12
11
|
import { ShimmerEffect } from '../../ShimmerEffect/index.js';
|
|
13
12
|
import { DeviceContainer } from '../Device/index.js';
|
|
13
|
+
import './index.scss';
|
|
14
14
|
import { IFrame } from '../IFrame/index.js';
|
|
15
15
|
import { LivePreviewToolbar } from '../Toolbar/index.js';
|
|
16
|
-
import './index.scss';
|
|
17
16
|
const baseClass = 'live-preview-window';
|
|
18
17
|
export const LivePreviewWindow = props => {
|
|
19
|
-
const $ = _c(49);
|
|
20
18
|
const {
|
|
21
19
|
appIsReady,
|
|
22
20
|
breakpoint,
|
|
21
|
+
iframeHasLoaded,
|
|
23
22
|
iframeRef,
|
|
24
23
|
isLivePreviewing,
|
|
25
|
-
loadedURL,
|
|
26
24
|
popupRef,
|
|
27
25
|
previewWindowType,
|
|
26
|
+
setIframeHasLoaded,
|
|
28
27
|
url
|
|
29
28
|
} = useLivePreviewContext();
|
|
30
29
|
const locale = useLocale();
|
|
@@ -37,151 +36,78 @@ export const LivePreviewWindow = props => {
|
|
|
37
36
|
collectionSlug,
|
|
38
37
|
globalSlug
|
|
39
38
|
} = useDocumentInfo();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
collectionSlug,
|
|
54
|
-
data: values,
|
|
55
|
-
externallyUpdatedRelationship: mostRecentUpdate,
|
|
56
|
-
globalSlug,
|
|
57
|
-
locale: locale.code
|
|
58
|
-
};
|
|
59
|
-
if (previewWindowType === "popup" && popupRef.current) {
|
|
60
|
-
popupRef.current.postMessage(message, url);
|
|
61
|
-
}
|
|
62
|
-
if (previewWindowType === "iframe" && iframeRef.current) {
|
|
63
|
-
iframeRef.current.contentWindow?.postMessage(message, url);
|
|
64
|
-
}
|
|
39
|
+
// For client-side apps, send data through `window.postMessage`
|
|
40
|
+
// The preview could either be an iframe embedded on the page
|
|
41
|
+
// Or it could be a separate popup window
|
|
42
|
+
// We need to transmit data to both accordingly
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!isLivePreviewing || !appIsReady) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// For performance, do not reduce fields to values until after the iframe or popup has loaded
|
|
48
|
+
if (formState) {
|
|
49
|
+
const values = reduceFieldsToValues(formState, true);
|
|
50
|
+
if (!values.id) {
|
|
51
|
+
values.id = id;
|
|
65
52
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
$[6] = isLivePreviewing;
|
|
74
|
-
$[7] = locale;
|
|
75
|
-
$[8] = mostRecentUpdate;
|
|
76
|
-
$[9] = popupRef;
|
|
77
|
-
$[10] = previewWindowType;
|
|
78
|
-
$[11] = url;
|
|
79
|
-
$[12] = t0;
|
|
80
|
-
} else {
|
|
81
|
-
t0 = $[12];
|
|
82
|
-
}
|
|
83
|
-
let t1;
|
|
84
|
-
if ($[13] !== appIsReady || $[14] !== collectionSlug || $[15] !== formState || $[16] !== globalSlug || $[17] !== id || $[18] !== iframeRef || $[19] !== isLivePreviewing || $[20] !== loadedURL || $[21] !== locale || $[22] !== mostRecentUpdate || $[23] !== popupRef || $[24] !== previewWindowType || $[25] !== url) {
|
|
85
|
-
t1 = [formState, url, collectionSlug, globalSlug, id, previewWindowType, popupRef, appIsReady, iframeRef, mostRecentUpdate, locale, isLivePreviewing, loadedURL];
|
|
86
|
-
$[13] = appIsReady;
|
|
87
|
-
$[14] = collectionSlug;
|
|
88
|
-
$[15] = formState;
|
|
89
|
-
$[16] = globalSlug;
|
|
90
|
-
$[17] = id;
|
|
91
|
-
$[18] = iframeRef;
|
|
92
|
-
$[19] = isLivePreviewing;
|
|
93
|
-
$[20] = loadedURL;
|
|
94
|
-
$[21] = locale;
|
|
95
|
-
$[22] = mostRecentUpdate;
|
|
96
|
-
$[23] = popupRef;
|
|
97
|
-
$[24] = previewWindowType;
|
|
98
|
-
$[25] = url;
|
|
99
|
-
$[26] = t1;
|
|
100
|
-
} else {
|
|
101
|
-
t1 = $[26];
|
|
102
|
-
}
|
|
103
|
-
useEffect(t0, t1);
|
|
104
|
-
let t2;
|
|
105
|
-
if ($[27] !== appIsReady || $[28] !== iframeRef || $[29] !== isLivePreviewing || $[30] !== popupRef || $[31] !== previewWindowType || $[32] !== url) {
|
|
106
|
-
t2 = () => {
|
|
107
|
-
if (!isLivePreviewing || !appIsReady) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const message_0 = {
|
|
111
|
-
type: "payload-document-event"
|
|
53
|
+
const message = {
|
|
54
|
+
type: 'payload-live-preview',
|
|
55
|
+
collectionSlug,
|
|
56
|
+
data: values,
|
|
57
|
+
externallyUpdatedRelationship: mostRecentUpdate,
|
|
58
|
+
globalSlug,
|
|
59
|
+
locale: locale.code
|
|
112
60
|
};
|
|
113
|
-
|
|
114
|
-
|
|
61
|
+
// Post message to external popup window
|
|
62
|
+
if (previewWindowType === 'popup' && popupRef.current) {
|
|
63
|
+
popupRef.current.postMessage(message, url);
|
|
115
64
|
}
|
|
116
|
-
|
|
117
|
-
|
|
65
|
+
// Post message to embedded iframe
|
|
66
|
+
if (previewWindowType === 'iframe' && iframeRef.current) {
|
|
67
|
+
iframeRef.current.contentWindow?.postMessage(message, url);
|
|
118
68
|
}
|
|
69
|
+
}
|
|
70
|
+
}, [formState, url, collectionSlug, globalSlug, iframeHasLoaded, id, previewWindowType, popupRef, appIsReady, iframeRef, setIframeHasLoaded, mostRecentUpdate, locale, isLivePreviewing]);
|
|
71
|
+
// To support SSR, we transmit a `window.postMessage` event without a payload
|
|
72
|
+
// This is because the event will ultimately trigger a server-side roundtrip
|
|
73
|
+
// i.e., save, save draft, autosave, etc. will fire `router.refresh()`
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!isLivePreviewing || !appIsReady) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const message_0 = {
|
|
79
|
+
type: 'payload-document-event'
|
|
119
80
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
$[34] = appIsReady;
|
|
134
|
-
$[35] = iframeRef;
|
|
135
|
-
$[36] = isLivePreviewing;
|
|
136
|
-
$[37] = mostRecentUpdate;
|
|
137
|
-
$[38] = popupRef;
|
|
138
|
-
$[39] = previewWindowType;
|
|
139
|
-
$[40] = url;
|
|
140
|
-
$[41] = t3;
|
|
141
|
-
} else {
|
|
142
|
-
t3 = $[41];
|
|
143
|
-
}
|
|
144
|
-
useEffect(t2, t3);
|
|
145
|
-
if (previewWindowType !== "iframe") {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
const t4 = isLivePreviewing && `${baseClass}--is-live-previewing`;
|
|
149
|
-
const t5 = breakpoint && breakpoint !== "responsive" && `${baseClass}--has-breakpoint`;
|
|
150
|
-
let t6;
|
|
151
|
-
if ($[42] !== t4 || $[43] !== t5) {
|
|
152
|
-
t6 = [baseClass, t4, t5].filter(Boolean);
|
|
153
|
-
$[42] = t4;
|
|
154
|
-
$[43] = t5;
|
|
155
|
-
$[44] = t6;
|
|
156
|
-
} else {
|
|
157
|
-
t6 = $[44];
|
|
158
|
-
}
|
|
159
|
-
const t7 = t6.join(" ");
|
|
160
|
-
let t8;
|
|
161
|
-
if ($[45] !== props || $[46] !== t7 || $[47] !== url) {
|
|
162
|
-
t8 = _jsx("div", {
|
|
163
|
-
className: t7,
|
|
164
|
-
children: _jsxs("div", {
|
|
81
|
+
// Post message to external popup window
|
|
82
|
+
if (previewWindowType === 'popup' && popupRef.current) {
|
|
83
|
+
popupRef.current.postMessage(message_0, url);
|
|
84
|
+
}
|
|
85
|
+
// Post message to embedded iframe
|
|
86
|
+
if (previewWindowType === 'iframe' && iframeRef.current) {
|
|
87
|
+
iframeRef.current.contentWindow?.postMessage(message_0, url);
|
|
88
|
+
}
|
|
89
|
+
}, [mostRecentUpdate, iframeRef, popupRef, previewWindowType, url, isLivePreviewing, appIsReady]);
|
|
90
|
+
if (previewWindowType === 'iframe') {
|
|
91
|
+
return /*#__PURE__*/_jsx("div", {
|
|
92
|
+
className: [baseClass, isLivePreviewing && `${baseClass}--is-live-previewing`, breakpoint && breakpoint !== 'responsive' && `${baseClass}--has-breakpoint`].filter(Boolean).join(' '),
|
|
93
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
165
94
|
className: `${baseClass}__wrapper`,
|
|
166
|
-
children: [_jsx(LivePreviewToolbar, {
|
|
95
|
+
children: [/*#__PURE__*/_jsx(LivePreviewToolbar, {
|
|
167
96
|
...props
|
|
168
|
-
}), _jsx("div", {
|
|
97
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
169
98
|
className: `${baseClass}__main`,
|
|
170
|
-
children: _jsx(DeviceContainer, {
|
|
171
|
-
children: url ? _jsx(IFrame, {
|
|
99
|
+
children: /*#__PURE__*/_jsx(DeviceContainer, {
|
|
100
|
+
children: url ? /*#__PURE__*/_jsx(IFrame, {
|
|
101
|
+
ref: iframeRef,
|
|
102
|
+
setIframeHasLoaded: setIframeHasLoaded,
|
|
103
|
+
url: url
|
|
104
|
+
}) : /*#__PURE__*/_jsx(ShimmerEffect, {
|
|
172
105
|
height: "100%"
|
|
173
106
|
})
|
|
174
107
|
})
|
|
175
108
|
})]
|
|
176
109
|
})
|
|
177
110
|
});
|
|
178
|
-
$[45] = props;
|
|
179
|
-
$[46] = t7;
|
|
180
|
-
$[47] = url;
|
|
181
|
-
$[48] = t8;
|
|
182
|
-
} else {
|
|
183
|
-
t8 = $[48];
|
|
184
111
|
}
|
|
185
|
-
return t8;
|
|
186
112
|
};
|
|
187
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["reduceFieldsToValues","React","useEffect","useAllFormFields","useDocumentEvents","useDocumentInfo","useLivePreviewContext","useLocale","ShimmerEffect","DeviceContainer","IFrame","LivePreviewToolbar","baseClass","LivePreviewWindow","props","appIsReady","breakpoint","iframeHasLoaded","iframeRef","isLivePreviewing","popupRef","previewWindowType","setIframeHasLoaded","url","locale","mostRecentUpdate","formState","id","collectionSlug","globalSlug","values","message","type","data","externallyUpdatedRelationship","code","current","postMessage","contentWindow","_jsx","className","filter","Boolean","join","_jsxs","ref","height"],"sources":["../../../../src/elements/LivePreview/Window/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload'\n\nimport { reduceFieldsToValues } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport { useAllFormFields } from '../../../forms/Form/context.js'\nimport { useDocumentEvents } from '../../../providers/DocumentEvents/index.js'\nimport { useDocumentInfo } from '../../../providers/DocumentInfo/index.js'\nimport { useLivePreviewContext } from '../../../providers/LivePreview/context.js'\nimport { useLocale } from '../../../providers/Locale/index.js'\nimport { ShimmerEffect } from '../../ShimmerEffect/index.js'\nimport { DeviceContainer } from '../Device/index.js'\nimport './index.scss'\nimport { IFrame } from '../IFrame/index.js'\nimport { LivePreviewToolbar } from '../Toolbar/index.js'\n\nconst baseClass = 'live-preview-window'\n\nexport const LivePreviewWindow: React.FC<EditViewProps> = (props) => {\n const {\n appIsReady,\n breakpoint,\n iframeHasLoaded,\n iframeRef,\n isLivePreviewing,\n popupRef,\n previewWindowType,\n setIframeHasLoaded,\n url,\n } = useLivePreviewContext()\n\n const locale = useLocale()\n\n const { mostRecentUpdate } = useDocumentEvents()\n\n const [formState] = useAllFormFields()\n const { id, collectionSlug, globalSlug } = useDocumentInfo()\n\n // For client-side apps, send data through `window.postMessage`\n // The preview could either be an iframe embedded on the page\n // Or it could be a separate popup window\n // We need to transmit data to both accordingly\n useEffect(() => {\n if (!isLivePreviewing || !appIsReady) {\n return\n }\n\n // For performance, do not reduce fields to values until after the iframe or popup has loaded\n if (formState) {\n const values = reduceFieldsToValues(formState, true)\n\n if (!values.id) {\n values.id = id\n }\n\n const message = {\n type: 'payload-live-preview',\n collectionSlug,\n data: values,\n externallyUpdatedRelationship: mostRecentUpdate,\n globalSlug,\n locale: locale.code,\n }\n\n // Post message to external popup window\n if (previewWindowType === 'popup' && popupRef.current) {\n popupRef.current.postMessage(message, url)\n }\n\n // Post message to embedded iframe\n if (previewWindowType === 'iframe' && iframeRef.current) {\n iframeRef.current.contentWindow?.postMessage(message, url)\n }\n }\n }, [\n formState,\n url,\n collectionSlug,\n globalSlug,\n iframeHasLoaded,\n id,\n previewWindowType,\n popupRef,\n appIsReady,\n iframeRef,\n setIframeHasLoaded,\n mostRecentUpdate,\n locale,\n isLivePreviewing,\n ])\n\n // To support SSR, we transmit a `window.postMessage` event without a payload\n // This is because the event will ultimately trigger a server-side roundtrip\n // i.e., save, save draft, autosave, etc. will fire `router.refresh()`\n useEffect(() => {\n if (!isLivePreviewing || !appIsReady) {\n return\n }\n\n const message = {\n type: 'payload-document-event',\n }\n\n // Post message to external popup window\n if (previewWindowType === 'popup' && popupRef.current) {\n popupRef.current.postMessage(message, url)\n }\n\n // Post message to embedded iframe\n if (previewWindowType === 'iframe' && iframeRef.current) {\n iframeRef.current.contentWindow?.postMessage(message, url)\n }\n }, [mostRecentUpdate, iframeRef, popupRef, previewWindowType, url, isLivePreviewing, appIsReady])\n\n if (previewWindowType === 'iframe') {\n return (\n <div\n className={[\n baseClass,\n isLivePreviewing && `${baseClass}--is-live-previewing`,\n breakpoint && breakpoint !== 'responsive' && `${baseClass}--has-breakpoint`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <div className={`${baseClass}__wrapper`}>\n <LivePreviewToolbar {...props} />\n <div className={`${baseClass}__main`}>\n <DeviceContainer>\n {url ? (\n <IFrame ref={iframeRef} setIframeHasLoaded={setIframeHasLoaded} url={url} />\n ) : (\n <ShimmerEffect height=\"100%\" />\n )}\n </DeviceContainer>\n </div>\n </div>\n </div>\n )\n }\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,oBAAoB,QAAQ;AACrC,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAEjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,SAAS,QAAQ;AAC1B,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,OAAO;AACP,SAASC,MAAM,QAAQ;AACvB,SAASC,kBAAkB,QAAQ;AAEnC,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,iBAAA,GAA8CC,KAAA;EACzD,MAAM;IACJC,UAAU;IACVC,UAAU;IACVC,eAAe;IACfC,SAAS;IACTC,gBAAgB;IAChBC,QAAQ;IACRC,iBAAiB;IACjBC,kBAAkB;IAClBC;EAAG,CACJ,GAAGjB,qBAAA;EAEJ,MAAMkB,MAAA,GAASjB,SAAA;EAEf,MAAM;IAAEkB;EAAgB,CAAE,GAAGrB,iBAAA;EAE7B,MAAM,CAACsB,SAAA,CAAU,GAAGvB,gBAAA;EACpB,MAAM;IAAEwB,EAAE;IAAEC,cAAc;IAAEC;EAAU,CAAE,GAAGxB,eAAA;EAE3C;EACA;EACA;EACA;EACAH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EAAE;MACvDlB,SAAA,CAAUkB,OAAO,CAACE,aAAa,EAAED,WAAA,CAAYN,SAAA,EAASR,GAAA;IACxD;EACF,GAAG,CAACE,gBAAA,EAAkBP,SAAA,EAAWE,QAAA,EAAUC,iBAAA,EAAmBE,GAAA,EAAKJ,gBAAA,EAAkBJ,UAAA,CAAW;EAEhG,IAAIM,iBAAA,KAAsB,UAAU;IAClC,oBACEkB,IAAA,CAAC;MACCC,SAAA,EAAW,CACT5B,SAAA,EACAO,gBAAA,IAAoB,GAAGP,SAAA,sBAA+B,EACtDI,UAAA,IAAcA,UAAA,KAAe,gBAAgB,GAAGJ,SAAA,kBAA2B,CAC5E,CACE6B,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;gBAER,aAAAC,KAAA,CAAC;QAAIJ,SAAA,EAAW,GAAG5B,SAAA,WAAoB;gCACrC2B,IAAA,CAAC5B,kBAAA;UAAoB,GAAGG;yBACxByB,IAAA,CAAC;UAAIC,SAAA,EAAW,GAAG5B,SAAA,QAAiB;oBAClC,aAAA2B,IAAA,CAAC9B,eAAA;sBACEc,GAAA,gBACCgB,IAAA,CAAC7B,MAAA;cAAOmC,GAAA,EAAK3B,SAAA;cAAWI,kBAAA,EAAoBA,kBAAA;cAAoBC,GAAA,EAAKA;8BAErEgB,IAAA,CAAC/B,aAAA;cAAcsC,MAAA,EAAO;;;;;;EAOpC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Status/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAW1C,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Status/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAW1C,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAkN1B,CAAA"}
|
|
@@ -164,7 +164,7 @@ export const Status = () => {
|
|
|
164
164
|
modalSlug: unPublishModalSlug,
|
|
165
165
|
onConfirm: () => performAction('unpublish')
|
|
166
166
|
})]
|
|
167
|
-
}), !isTrashed && canUpdate &&
|
|
167
|
+
}), (!isTrashed && canUpdate && statusToRender === 'changed' || statusToRender === 'draft') && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
168
168
|
children: [" — ", /*#__PURE__*/_jsx(Button, {
|
|
169
169
|
buttonStyle: "none",
|
|
170
170
|
className: `${baseClass}__action`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useModal","React","useCallback","toast","useForm","useConfig","useDocumentInfo","useLocale","useTranslation","requests","Button","ConfirmationModal","baseClass","Status","id","collectionSlug","docPermissions","globalSlug","hasPublishedDoc","incrementVersionCount","isTrashed","savedDocumentData","doc","setHasPublishedDoc","setMostRecentVersionIsAutosaved","setUnpublishedVersionCount","unpublishedVersionCount","toggleModal","config","routes","api","serverURL","getEntityConfig","reset","resetForm","code","locale","i18n","t","unPublishModalSlug","revertModalSlug","statusToRender","collectionConfig","globalConfig","docConfig","autosaveEnabled","versions","drafts","autosave","_status","displayStatusKey","performAction","action","url","method","body","publishedDoc","get","headers","language","then","res","json","JSON","stringify","status","data","result","success","message","errors","error","err","canUpdate","update","_jsx","className","title","_jsxs","Fragment","buttonStyle","onClick","confirmingLabel","heading","modalSlug","onConfirm"],"sources":["../../../src/elements/Status/index.tsx"],"sourcesContent":["'use client'\nimport { useModal } from '@faceless-ui/modal'\nimport React, { useCallback } from 'react'\nimport { toast } from 'sonner'\n\nimport { useForm } from '../../forms/Form/context.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { requests } from '../../utilities/api.js'\nimport { Button } from '../Button/index.js'\nimport { ConfirmationModal } from '../ConfirmationModal/index.js'\nimport './index.scss'\n\nconst baseClass = 'status'\n\nexport const Status: React.FC = () => {\n const {\n id,\n collectionSlug,\n docPermissions,\n globalSlug,\n hasPublishedDoc,\n incrementVersionCount,\n isTrashed,\n savedDocumentData: doc,\n setHasPublishedDoc,\n setMostRecentVersionIsAutosaved,\n setUnpublishedVersionCount,\n unpublishedVersionCount,\n } = useDocumentInfo()\n\n const { toggleModal } = useModal()\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const { reset: resetForm } = useForm()\n const { code: locale } = useLocale()\n const { i18n, t } = useTranslation()\n\n const unPublishModalSlug = `confirm-un-publish-${id}`\n const revertModalSlug = `confirm-revert-${id}`\n\n let statusToRender: 'changed' | 'draft' | 'published' = 'draft'\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n const globalConfig = getEntityConfig({ globalSlug })\n\n const docConfig = collectionConfig || globalConfig\n const autosaveEnabled =\n typeof docConfig?.versions?.drafts === 'object' ? docConfig.versions.drafts.autosave : false\n\n if (autosaveEnabled) {\n if (hasPublishedDoc) {\n statusToRender = unpublishedVersionCount > 0 ? 'changed' : 'published'\n }\n } else {\n statusToRender = doc._status || 'draft'\n }\n const displayStatusKey = isTrashed\n ? hasPublishedDoc\n ? 'previouslyPublished'\n : 'previouslyDraft'\n : statusToRender\n\n const performAction = useCallback(\n async (action: 'revert' | 'unpublish') => {\n let url\n let method\n let body\n\n if (action === 'unpublish') {\n body = {\n _status: 'draft',\n }\n }\n\n if (collectionSlug) {\n url = `${serverURL}${api}/${collectionSlug}/${id}?locale=${locale}&fallback-locale=null&depth=0`\n method = 'patch'\n }\n\n if (globalSlug) {\n url = `${serverURL}${api}/globals/${globalSlug}?locale=${locale}&fallback-locale=null&depth=0`\n method = 'post'\n }\n\n if (action === 'revert') {\n const publishedDoc = await requests\n .get(url, {\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n },\n })\n .then((res) => res.json())\n\n body = publishedDoc\n }\n\n const res = await requests[method](url, {\n body: JSON.stringify(body),\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n },\n })\n\n if (res.status === 200) {\n let data\n const json = await res.json()\n\n if (globalSlug) {\n data = json.result\n } else if (collectionSlug) {\n data = json.doc\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n resetForm(data)\n toast.success(json.message)\n incrementVersionCount()\n setMostRecentVersionIsAutosaved(false)\n\n if (action === 'unpublish') {\n setHasPublishedDoc(false)\n } else if (action === 'revert') {\n setUnpublishedVersionCount(0)\n }\n } else {\n try {\n const json = await res.json()\n if (json.errors?.[0]?.message) {\n toast.error(json.errors[0].message)\n } else if (json.error) {\n toast.error(json.error)\n } else {\n toast.error(t('error:unPublishingDocument'))\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n toast.error(t('error:unPublishingDocument'))\n }\n }\n },\n [\n api,\n collectionSlug,\n globalSlug,\n id,\n i18n.language,\n incrementVersionCount,\n locale,\n resetForm,\n serverURL,\n setUnpublishedVersionCount,\n setMostRecentVersionIsAutosaved,\n t,\n setHasPublishedDoc,\n ],\n )\n\n const canUpdate = docPermissions?.update\n\n if (statusToRender) {\n return (\n <div\n className={baseClass}\n title={`${t('version:status')}: ${t(`version:${displayStatusKey}`)}`}\n >\n <div className={`${baseClass}__value-wrap`}>\n <span className={`${baseClass}__label`}>{t('version:status')}: </span>\n <span className={`${baseClass}__value`}>{t(`version:${displayStatusKey}`)}</span>\n {!isTrashed && canUpdate && statusToRender === 'published' && (\n <React.Fragment>\n — \n <Button\n buttonStyle=\"none\"\n className={`${baseClass}__action`}\n id={`action-unpublish`}\n onClick={() => toggleModal(unPublishModalSlug)}\n >\n {t('version:unpublish')}\n </Button>\n <ConfirmationModal\n body={t('version:aboutToUnpublish')}\n confirmingLabel={t('version:unpublishing')}\n heading={t('version:confirmUnpublish')}\n modalSlug={unPublishModalSlug}\n onConfirm={() => performAction('unpublish')}\n />\n </React.Fragment>\n )}\n {!isTrashed &&\n canUpdate &&\n hasPublishedDoc &&\n (statusToRender === 'changed' || statusToRender === 'draft') && (\n <React.Fragment>\n — \n <Button\n buttonStyle=\"none\"\n className={`${baseClass}__action`}\n id=\"action-revert-to-published\"\n onClick={() => toggleModal(revertModalSlug)}\n >\n {t('version:revertToPublished')}\n </Button>\n <ConfirmationModal\n body={t('version:aboutToRevertToPublished')}\n confirmingLabel={t('version:reverting')}\n heading={t('version:confirmRevertToSaved')}\n modalSlug={revertModalSlug}\n onConfirm={() => performAction('revert')}\n />\n </React.Fragment>\n )}\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;;AACA,SAASA,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,QAAQ;AACnC,SAASC,KAAK,QAAQ;AAEtB,SAASC,OAAO,QAAQ;AACxB,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,MAAM,QAAQ;AACvB,SAASC,iBAAiB,QAAQ;AAClC,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,MAAA,GAAmBA,CAAA;EAC9B,MAAM;IACJC,EAAE;IACFC,cAAc;IACdC,cAAc;IACdC,UAAU;IACVC,eAAe;IACfC,qBAAqB;IACrBC,SAAS;IACTC,iBAAA,EAAmBC,GAAG;IACtBC,kBAAkB;IAClBC,+BAA+B;IAC/BC,0BAA0B;IAC1BC;EAAuB,CACxB,GAAGpB,eAAA;EAEJ,MAAM;IAAEqB;EAAW,CAAE,GAAG3B,QAAA;EAExB,MAAM;IACJ4B,MAAA,EAAQ;MACNC,MAAA,EAAQ;QAAEC;MAAG,CAAE;MACfC;IAAS,CACV;IACDC;EAAe,CAChB,GAAG3B,SAAA;E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YACjCE,EAAA,EAAI,kBAAkB;YACtBmE,OAAA,EAASA,CAAA,KAAMtD,WAAA,CAAYY,kBAAA;sBAE1BD,CAAA,CAAE;2BAELqC,IAAA,CAAChE,iBAAA;YACC4C,IAAA,EAAMjB,CAAA,CAAE;YACR4C,eAAA,EAAiB5C,CAAA,CAAE;YACnB6C,OAAA,EAAS7C,CAAA,CAAE;YACX8C,SAAA,EAAW7C,kBAAA;YACX8C,SAAA,EAAWA,CAAA,KAAMlC,aAAA,CAAc;;YAIpC,CAAC/B,SAAA,IACAqD,SAAA,IACAvD,eAAA,KACCuB,cAAA,KAAmB,aAAaA,cAAA,KAAmB,OAAM,kBACxDqC,KAAA,CAAC7E,KAAA,CAAM8E,QAAQ;qBAAC,O,aAEdJ,IAAA,CAACjE,MAAA;YACCsE,WAAA,EAAY;YACZJ,SAAA,EAAW,GAAGhE,SAAA,UAAmB;YACjCE,EAAA,EAAG;YACHmE,OAAA,EAASA,CAAA,KAAMtD,WAAA,CAAYa,eAAA;sBAE1BF,CAAA,CAAE;2BAELqC,IAAA,CAAChE,iBAAA;YACC4C,IAAA,EAAMjB,CAAA,CAAE;YACR4C,eAAA,EAAiB5C,CAAA,CAAE;YACnB6C,OAAA,EAAS7C,CAAA,CAAE;YACX8C,SAAA,EAAW5C,eAAA;YACX6C,SAAA,EAAWA,CAAA,KAAMlC,aAAA,CAAc;;;;;EAO/C;EAEA,OAAO;AACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useModal","React","useCallback","toast","useForm","useConfig","useDocumentInfo","useLocale","useTranslation","requests","Button","ConfirmationModal","baseClass","Status","id","collectionSlug","docPermissions","globalSlug","hasPublishedDoc","incrementVersionCount","isTrashed","savedDocumentData","doc","setHasPublishedDoc","setMostRecentVersionIsAutosaved","setUnpublishedVersionCount","unpublishedVersionCount","toggleModal","config","routes","api","serverURL","getEntityConfig","reset","resetForm","code","locale","i18n","t","unPublishModalSlug","revertModalSlug","statusToRender","collectionConfig","globalConfig","docConfig","autosaveEnabled","versions","drafts","autosave","_status","displayStatusKey","performAction","action","url","method","body","publishedDoc","get","headers","language","then","res","json","JSON","stringify","status","data","result","success","message","errors","error","err","canUpdate","update","_jsx","className","title","_jsxs","Fragment","buttonStyle","onClick","confirmingLabel","heading","modalSlug","onConfirm"],"sources":["../../../src/elements/Status/index.tsx"],"sourcesContent":["'use client'\nimport { useModal } from '@faceless-ui/modal'\nimport React, { useCallback } from 'react'\nimport { toast } from 'sonner'\n\nimport { useForm } from '../../forms/Form/context.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useDocumentInfo } from '../../providers/DocumentInfo/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { requests } from '../../utilities/api.js'\nimport { Button } from '../Button/index.js'\nimport { ConfirmationModal } from '../ConfirmationModal/index.js'\nimport './index.scss'\n\nconst baseClass = 'status'\n\nexport const Status: React.FC = () => {\n const {\n id,\n collectionSlug,\n docPermissions,\n globalSlug,\n hasPublishedDoc,\n incrementVersionCount,\n isTrashed,\n savedDocumentData: doc,\n setHasPublishedDoc,\n setMostRecentVersionIsAutosaved,\n setUnpublishedVersionCount,\n unpublishedVersionCount,\n } = useDocumentInfo()\n\n const { toggleModal } = useModal()\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const { reset: resetForm } = useForm()\n const { code: locale } = useLocale()\n const { i18n, t } = useTranslation()\n\n const unPublishModalSlug = `confirm-un-publish-${id}`\n const revertModalSlug = `confirm-revert-${id}`\n\n let statusToRender: 'changed' | 'draft' | 'published' = 'draft'\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n const globalConfig = getEntityConfig({ globalSlug })\n\n const docConfig = collectionConfig || globalConfig\n const autosaveEnabled =\n typeof docConfig?.versions?.drafts === 'object' ? docConfig.versions.drafts.autosave : false\n\n if (autosaveEnabled) {\n if (hasPublishedDoc) {\n statusToRender = unpublishedVersionCount > 0 ? 'changed' : 'published'\n }\n } else {\n statusToRender = doc._status || 'draft'\n }\n const displayStatusKey = isTrashed\n ? hasPublishedDoc\n ? 'previouslyPublished'\n : 'previouslyDraft'\n : statusToRender\n\n const performAction = useCallback(\n async (action: 'revert' | 'unpublish') => {\n let url\n let method\n let body\n\n if (action === 'unpublish') {\n body = {\n _status: 'draft',\n }\n }\n\n if (collectionSlug) {\n url = `${serverURL}${api}/${collectionSlug}/${id}?locale=${locale}&fallback-locale=null&depth=0`\n method = 'patch'\n }\n\n if (globalSlug) {\n url = `${serverURL}${api}/globals/${globalSlug}?locale=${locale}&fallback-locale=null&depth=0`\n method = 'post'\n }\n\n if (action === 'revert') {\n const publishedDoc = await requests\n .get(url, {\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n },\n })\n .then((res) => res.json())\n\n body = publishedDoc\n }\n\n const res = await requests[method](url, {\n body: JSON.stringify(body),\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n },\n })\n\n if (res.status === 200) {\n let data\n const json = await res.json()\n\n if (globalSlug) {\n data = json.result\n } else if (collectionSlug) {\n data = json.doc\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n resetForm(data)\n toast.success(json.message)\n incrementVersionCount()\n setMostRecentVersionIsAutosaved(false)\n\n if (action === 'unpublish') {\n setHasPublishedDoc(false)\n } else if (action === 'revert') {\n setUnpublishedVersionCount(0)\n }\n } else {\n try {\n const json = await res.json()\n if (json.errors?.[0]?.message) {\n toast.error(json.errors[0].message)\n } else if (json.error) {\n toast.error(json.error)\n } else {\n toast.error(t('error:unPublishingDocument'))\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n toast.error(t('error:unPublishingDocument'))\n }\n }\n },\n [\n api,\n collectionSlug,\n globalSlug,\n id,\n i18n.language,\n incrementVersionCount,\n locale,\n resetForm,\n serverURL,\n setUnpublishedVersionCount,\n setMostRecentVersionIsAutosaved,\n t,\n setHasPublishedDoc,\n ],\n )\n\n const canUpdate = docPermissions?.update\n\n if (statusToRender) {\n return (\n <div\n className={baseClass}\n title={`${t('version:status')}: ${t(`version:${displayStatusKey}`)}`}\n >\n <div className={`${baseClass}__value-wrap`}>\n <span className={`${baseClass}__label`}>{t('version:status')}: </span>\n <span className={`${baseClass}__value`}>{t(`version:${displayStatusKey}`)}</span>\n {!isTrashed && canUpdate && statusToRender === 'published' && (\n <React.Fragment>\n — \n <Button\n buttonStyle=\"none\"\n className={`${baseClass}__action`}\n id={`action-unpublish`}\n onClick={() => toggleModal(unPublishModalSlug)}\n >\n {t('version:unpublish')}\n </Button>\n <ConfirmationModal\n body={t('version:aboutToUnpublish')}\n confirmingLabel={t('version:unpublishing')}\n heading={t('version:confirmUnpublish')}\n modalSlug={unPublishModalSlug}\n onConfirm={() => performAction('unpublish')}\n />\n </React.Fragment>\n )}\n {((!isTrashed && canUpdate && statusToRender === 'changed') ||\n statusToRender === 'draft') && (\n <React.Fragment>\n — \n <Button\n buttonStyle=\"none\"\n className={`${baseClass}__action`}\n id=\"action-revert-to-published\"\n onClick={() => toggleModal(revertModalSlug)}\n >\n {t('version:revertToPublished')}\n </Button>\n <ConfirmationModal\n body={t('version:aboutToRevertToPublished')}\n confirmingLabel={t('version:reverting')}\n heading={t('version:confirmRevertToSaved')}\n modalSlug={revertModalSlug}\n onConfirm={() => performAction('revert')}\n />\n </React.Fragment>\n )}\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;;AACA,SAASA,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,QAAQ;AACnC,SAASC,KAAK,QAAQ;AAEtB,SAASC,OAAO,QAAQ;AACxB,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAChC,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,MAAM,QAAQ;AACvB,SAASC,iBAAiB,QAAQ;AAClC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AA,EAAW5C,eAAA;YACX6C,SAAA,EAAWA,CAAA,KAAMlC,aAAA,CAAc;;;;;EAO7C;EAEA,OAAO;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Table/RelationshipProvider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Table/RelationshipProvider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAyE,MAAM,OAAO,CAAA;AAW7F,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG;QACd,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,CAAA;KACjD,CAAA;CACF,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,SAAS,CAAA;IACpB,gBAAgB,EAAE,CAChB,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KACvB,EAAE,KACA,IAAI,CAAA;CACV,CAAA;AAID,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAsFlF,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAO,uBAAuC,CAAA"}
|