@payloadcms/next 3.0.0-canary.0374de4 → 3.0.0-canary.0992b47
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/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +24 -27
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +0 -3
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +0 -2
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +0 -2
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +0 -2
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +1 -4
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +1 -8
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +2 -14
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +0 -5
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +1 -16
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Document/getDocumentData.d.ts +2 -5
- package/dist/views/Document/getDocumentData.d.ts.map +1 -1
- package/dist/views/Document/getDocumentData.js +2 -13
- package/dist/views/Document/getDocumentData.js.map +1 -1
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +14 -162
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +0 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +0 -1
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +1 -4
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +2 -23
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +48 -63
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +20 -48
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +4 -15
- package/dist/views/Versions/index.js.map +1 -1
- package/package.json +7 -7
- package/dist/elements/DocumentLocked/index.d.ts +0 -12
- package/dist/elements/DocumentLocked/index.d.ts.map +0 -1
- package/dist/elements/DocumentLocked/index.js +0 -142
- package/dist/elements/DocumentLocked/index.js.map +0 -1
- package/dist/elements/DocumentLocked/index.scss +0 -37
- package/dist/elements/DocumentTakeOver/index.d.ts +0 -8
- package/dist/elements/DocumentTakeOver/index.d.ts.map +0 -1
- package/dist/elements/DocumentTakeOver/index.js +0 -98
- package/dist/elements/DocumentTakeOver/index.js.map +0 -1
- package/dist/elements/DocumentTakeOver/index.scss +0 -37
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts +0 -13
- package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts.map +0 -1
- package/dist/routes/rest/utilities/sanitizeJoinParams.js +0 -17
- package/dist/routes/rest/utilities/sanitizeJoinParams.js.map +0 -1
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Button, Modal, useModal, useTranslation } from '@payloadcms/ui';
|
|
6
|
-
import React, { useEffect } from 'react';
|
|
7
|
-
const modalSlug = 'document-locked';
|
|
8
|
-
const baseClass = 'document-locked';
|
|
9
|
-
const formatDate = date => {
|
|
10
|
-
if (!date) {
|
|
11
|
-
return '';
|
|
12
|
-
}
|
|
13
|
-
return new Intl.DateTimeFormat('en-US', {
|
|
14
|
-
day: 'numeric',
|
|
15
|
-
hour: 'numeric',
|
|
16
|
-
hour12: true,
|
|
17
|
-
minute: 'numeric',
|
|
18
|
-
month: 'short',
|
|
19
|
-
year: 'numeric'
|
|
20
|
-
}).format(date);
|
|
21
|
-
};
|
|
22
|
-
export const DocumentLocked = t0 => {
|
|
23
|
-
const $ = _c(19);
|
|
24
|
-
const {
|
|
25
|
-
editedAt,
|
|
26
|
-
handleGoBack,
|
|
27
|
-
isActive,
|
|
28
|
-
onReadOnly,
|
|
29
|
-
onTakeOver,
|
|
30
|
-
user
|
|
31
|
-
} = t0;
|
|
32
|
-
const {
|
|
33
|
-
closeModal,
|
|
34
|
-
openModal
|
|
35
|
-
} = useModal();
|
|
36
|
-
const {
|
|
37
|
-
t
|
|
38
|
-
} = useTranslation();
|
|
39
|
-
let t1;
|
|
40
|
-
let t2;
|
|
41
|
-
if ($[0] !== isActive || $[1] !== openModal || $[2] !== closeModal) {
|
|
42
|
-
t1 = () => {
|
|
43
|
-
if (isActive) {
|
|
44
|
-
openModal(modalSlug);
|
|
45
|
-
} else {
|
|
46
|
-
closeModal(modalSlug);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
t2 = [isActive, openModal, closeModal];
|
|
50
|
-
$[0] = isActive;
|
|
51
|
-
$[1] = openModal;
|
|
52
|
-
$[2] = closeModal;
|
|
53
|
-
$[3] = t1;
|
|
54
|
-
$[4] = t2;
|
|
55
|
-
} else {
|
|
56
|
-
t1 = $[3];
|
|
57
|
-
t2 = $[4];
|
|
58
|
-
}
|
|
59
|
-
useEffect(t1, t2);
|
|
60
|
-
let t3;
|
|
61
|
-
if ($[5] !== t || $[6] !== user || $[7] !== editedAt || $[8] !== handleGoBack || $[9] !== onReadOnly || $[10] !== closeModal || $[11] !== onTakeOver) {
|
|
62
|
-
let t4;
|
|
63
|
-
if ($[13] !== onReadOnly || $[14] !== closeModal) {
|
|
64
|
-
t4 = () => {
|
|
65
|
-
onReadOnly();
|
|
66
|
-
closeModal(modalSlug);
|
|
67
|
-
};
|
|
68
|
-
$[13] = onReadOnly;
|
|
69
|
-
$[14] = closeModal;
|
|
70
|
-
$[15] = t4;
|
|
71
|
-
} else {
|
|
72
|
-
t4 = $[15];
|
|
73
|
-
}
|
|
74
|
-
let t5;
|
|
75
|
-
if ($[16] !== onTakeOver || $[17] !== closeModal) {
|
|
76
|
-
t5 = () => {
|
|
77
|
-
onTakeOver();
|
|
78
|
-
closeModal(modalSlug);
|
|
79
|
-
};
|
|
80
|
-
$[16] = onTakeOver;
|
|
81
|
-
$[17] = closeModal;
|
|
82
|
-
$[18] = t5;
|
|
83
|
-
} else {
|
|
84
|
-
t5 = $[18];
|
|
85
|
-
}
|
|
86
|
-
t3 = _jsx(Modal, {
|
|
87
|
-
className: baseClass,
|
|
88
|
-
onClose: handleGoBack,
|
|
89
|
-
slug: modalSlug,
|
|
90
|
-
children: _jsxs("div", {
|
|
91
|
-
className: `${baseClass}__wrapper`,
|
|
92
|
-
children: [_jsxs("div", {
|
|
93
|
-
className: `${baseClass}__content`,
|
|
94
|
-
children: [_jsx("h1", {
|
|
95
|
-
children: t("general:documentLocked")
|
|
96
|
-
}), _jsxs("p", {
|
|
97
|
-
children: [_jsx("strong", {
|
|
98
|
-
children: user?.email ?? user?.id
|
|
99
|
-
}), " ", t("general:currentlyEditing")]
|
|
100
|
-
}), _jsxs("p", {
|
|
101
|
-
children: [t("general:editedSince"), " ", _jsx("strong", {
|
|
102
|
-
children: formatDate(editedAt)
|
|
103
|
-
})]
|
|
104
|
-
})]
|
|
105
|
-
}), _jsxs("div", {
|
|
106
|
-
className: `${baseClass}__controls`,
|
|
107
|
-
children: [_jsx(Button, {
|
|
108
|
-
buttonStyle: "secondary",
|
|
109
|
-
id: `${modalSlug}-go-back`,
|
|
110
|
-
onClick: handleGoBack,
|
|
111
|
-
size: "large",
|
|
112
|
-
children: t("general:goBack")
|
|
113
|
-
}), _jsx(Button, {
|
|
114
|
-
buttonStyle: "secondary",
|
|
115
|
-
id: `${modalSlug}-view-read-only`,
|
|
116
|
-
onClick: t4,
|
|
117
|
-
size: "large",
|
|
118
|
-
children: t("general:viewReadOnly")
|
|
119
|
-
}), _jsx(Button, {
|
|
120
|
-
buttonStyle: "primary",
|
|
121
|
-
id: `${modalSlug}-take-over`,
|
|
122
|
-
onClick: t5,
|
|
123
|
-
size: "large",
|
|
124
|
-
children: t("general:takeOver")
|
|
125
|
-
})]
|
|
126
|
-
})]
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
$[5] = t;
|
|
130
|
-
$[6] = user;
|
|
131
|
-
$[7] = editedAt;
|
|
132
|
-
$[8] = handleGoBack;
|
|
133
|
-
$[9] = onReadOnly;
|
|
134
|
-
$[10] = closeModal;
|
|
135
|
-
$[11] = onTakeOver;
|
|
136
|
-
$[12] = t3;
|
|
137
|
-
} else {
|
|
138
|
-
t3 = $[12];
|
|
139
|
-
}
|
|
140
|
-
return t3;
|
|
141
|
-
};
|
|
142
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","Button","Modal","useModal","useTranslation","React","useEffect","modalSlug","baseClass","formatDate","date","Intl","DateTimeFormat","day","hour","hour12","minute","month","year","format","DocumentLocked","t0","$","editedAt","handleGoBack","isActive","onReadOnly","onTakeOver","user","closeModal","openModal","t","t1","t2","t3","t4","t5","_jsx","className","onClose","slug","children","_jsxs","email","id","buttonStyle","onClick","size"],"sources":["../../../src/elements/DocumentLocked/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientUser } from 'payload'\n\nimport { Button, Modal, useModal, useTranslation } from '@payloadcms/ui'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst modalSlug = 'document-locked'\n\nconst baseClass = 'document-locked'\n\nconst formatDate = (date) => {\n if (!date) {\n return ''\n }\n return new Intl.DateTimeFormat('en-US', {\n day: 'numeric',\n hour: 'numeric',\n hour12: true,\n minute: 'numeric',\n month: 'short',\n year: 'numeric',\n }).format(date)\n}\n\nexport const DocumentLocked: React.FC<{\n editedAt?: null | number\n handleGoBack: () => void\n isActive: boolean\n onReadOnly: () => void\n onTakeOver: () => void\n user?: ClientUser\n}> = ({ editedAt, handleGoBack, isActive, onReadOnly, onTakeOver, user }) => {\n const { closeModal, openModal } = useModal()\n const { t } = useTranslation()\n\n useEffect(() => {\n if (isActive) {\n openModal(modalSlug)\n } else {\n closeModal(modalSlug)\n }\n }, [isActive, openModal, closeModal])\n\n return (\n <Modal className={baseClass} onClose={handleGoBack} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:documentLocked')}</h1>\n <p>\n <strong>{user?.email ?? user?.id}</strong> {t('general:currentlyEditing')}\n </p>\n <p>\n {t('general:editedSince')} <strong>{formatDate(editedAt)}</strong>\n </p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button\n buttonStyle=\"secondary\"\n id={`${modalSlug}-go-back`}\n onClick={handleGoBack}\n size=\"large\"\n >\n {t('general:goBack')}\n </Button>\n <Button\n buttonStyle=\"secondary\"\n id={`${modalSlug}-view-read-only`}\n onClick={() => {\n onReadOnly()\n closeModal(modalSlug)\n }}\n size=\"large\"\n >\n {t('general:viewReadOnly')}\n </Button>\n <Button\n buttonStyle=\"primary\"\n id={`${modalSlug}-take-over`}\n onClick={() => {\n void onTakeOver()\n closeModal(modalSlug)\n }}\n size=\"large\"\n >\n {t('general:takeOver')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AACxD,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAIjC,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAAY;AAElB,MAAMC,UAAA,GAAcC,IAAA;EAClB,IAAI,CAACA,IAAA,EAAM;IACT,OAAO;EACT;EACA,OAAO,IAAIC,IAAA,CAAKC,cAAc,CAAC,SAAS;IACtCC,GAAA,EAAK;IACLC,IAAA,EAAM;IACNC,MAAA,EAAQ;IACRC,MAAA,EAAQ;IACRC,KAAA,EAAO;IACPC,IAAA,EAAM;EACR,GAAGC,MAAM,CAACT,IAAA;AACZ;AAEA,OAAO,MAAMU,cAAA,GAORC,EAAA;EAAA,MAAAC,CAAA,GAAAtB,EAAA;EAAC;IAAAuB,QAAA;IAAAC,YAAA;IAAAC,QAAA;IAAAC,UAAA;IAAAC,UAAA;IAAAC;EAAA,IAAAP,EAAkE;EACtE;IAAAQ,UAAA;IAAAC;EAAA,IAAkC3B,QAAA;EAClC;IAAA4B;EAAA,IAAc3B,cAAA;EAAA,IAAA4B,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAX,CAAA,QAAAG,QAAA,IAAAH,CAAA,QAAAQ,SAAA,IAAAR,CAAA,QAAAO,UAAA;IAEJG,EAAA,GAAAA,CAAA;MAAA,IACJP,QAAA;QACFK,SAAA,CAAAvB,SAAU;MAAA;QAEVsB,UAAA,CAAAtB,SAAW;MAAA;IAAA;IAEZ0B,EAAA,IAACR,QAAA,EAAUK,SAAA,EAAWD,UAAA;IAAWP,CAAA,MAAAG,QAAA;IAAAH,CAAA,MAAAQ,SAAA;IAAAR,CAAA,MAA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C;YAAAI,QAAA,EAAIV,CAAA,CAAE;UAAA,C,GACPW,KAAA,CAAC;YAAAD,QAAA,GACCJ,IAAA,CAAC;cAAAI,QAAA,EAAQb,IAAA,EAAAe,KAAA,IAAef,IAAA,EAAAgB;YAAM,C,GAAY,KAAEb,CAAA,CAAE;UAAA,C,GAEhDW,KAAA,CAAC;YAAAD,QAAA,GACEV,CAAA,CAAE,wBAAuB,KAACM,IAAA,CAAC;cAAAI,QAAA,EAAQhC,UAAA,CAAWc,QAAA;YAAA,C;;YAGnDmB,KAAA,CAAC;UAAAJ,SAAA,EAAe,GAAA9B,SAAA,YAAwB;UAAAiC,QAAA,GACtCJ,IAAA,CAAApC,MAAA;YAAA4C,WAAA,EACc;YAAAD,EAAA,EACR,GAAArC,SAAA,UAAsB;YAAAuC,OAAA,EACjBtB,YAAA;YAAAuB,IAAA,EACJ;YAAAN,QAAA,EAEJV,CAAA,CAAE;UAAA,C,GAELM,IAAA,CAAApC,MAAA;YAAA4C,WAAA,EACc;YAAAD,EAAA,EACR,GAAArC,SAAA,iBAA6B;YAAAuC,OAAA,EACxBX,EAGT;YAAAY,IAAA,EACK;YAAAN,QAAA,EAEJV,CAAA,CAAE;UAAA,C,GAELM,IAAA,CAAApC,MAAA;YAAA4C,WAAA,EACc;YAAAD,EAAA,EACR,GAAArC,SAAA,YAAwB;YAAAuC,OAAA,EACnBV,EAGT;YAAAW,IAAA,EACK;YAAAN,QAAA,EAEJV,CAAA,CAAE;UAAA,C;;;;;;;;;;;;;;;SAxCXG,E;CA8CJ","ignoreList":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
@import '../../scss/styles.scss';
|
|
2
|
-
|
|
3
|
-
.document-locked {
|
|
4
|
-
@include blur-bg;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
height: 100%;
|
|
9
|
-
|
|
10
|
-
&__wrapper {
|
|
11
|
-
z-index: 1;
|
|
12
|
-
position: relative;
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
gap: var(--base);
|
|
16
|
-
padding: base(2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&__content {
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
gap: var(--base);
|
|
23
|
-
|
|
24
|
-
> * {
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__controls {
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: var(--base);
|
|
32
|
-
|
|
33
|
-
.btn {
|
|
34
|
-
margin: 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/DocumentTakeOver/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,cAAc,CAAA;AAMrB,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,qBAAqB,EAAE,MAAM,IAAI,CAAA;IACjC,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CA2CA,CAAA"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { Button, Modal, useModal, useTranslation } from '@payloadcms/ui';
|
|
6
|
-
import React, { useEffect } from 'react';
|
|
7
|
-
const modalSlug = 'document-take-over';
|
|
8
|
-
const baseClass = 'document-take-over';
|
|
9
|
-
export const DocumentTakeOver = t0 => {
|
|
10
|
-
const $ = _c(13);
|
|
11
|
-
const {
|
|
12
|
-
handleBackToDashboard,
|
|
13
|
-
isActive,
|
|
14
|
-
onReadOnly
|
|
15
|
-
} = t0;
|
|
16
|
-
const {
|
|
17
|
-
closeModal,
|
|
18
|
-
openModal
|
|
19
|
-
} = useModal();
|
|
20
|
-
const {
|
|
21
|
-
t
|
|
22
|
-
} = useTranslation();
|
|
23
|
-
let t1;
|
|
24
|
-
let t2;
|
|
25
|
-
if ($[0] !== isActive || $[1] !== openModal || $[2] !== closeModal) {
|
|
26
|
-
t1 = () => {
|
|
27
|
-
if (isActive) {
|
|
28
|
-
openModal(modalSlug);
|
|
29
|
-
} else {
|
|
30
|
-
closeModal(modalSlug);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
t2 = [isActive, openModal, closeModal];
|
|
34
|
-
$[0] = isActive;
|
|
35
|
-
$[1] = openModal;
|
|
36
|
-
$[2] = closeModal;
|
|
37
|
-
$[3] = t1;
|
|
38
|
-
$[4] = t2;
|
|
39
|
-
} else {
|
|
40
|
-
t1 = $[3];
|
|
41
|
-
t2 = $[4];
|
|
42
|
-
}
|
|
43
|
-
useEffect(t1, t2);
|
|
44
|
-
let t3;
|
|
45
|
-
if ($[5] !== t || $[6] !== handleBackToDashboard || $[7] !== onReadOnly || $[8] !== closeModal) {
|
|
46
|
-
let t4;
|
|
47
|
-
if ($[10] !== onReadOnly || $[11] !== closeModal) {
|
|
48
|
-
t4 = () => {
|
|
49
|
-
onReadOnly();
|
|
50
|
-
closeModal(modalSlug);
|
|
51
|
-
};
|
|
52
|
-
$[10] = onReadOnly;
|
|
53
|
-
$[11] = closeModal;
|
|
54
|
-
$[12] = t4;
|
|
55
|
-
} else {
|
|
56
|
-
t4 = $[12];
|
|
57
|
-
}
|
|
58
|
-
t3 = _jsx(Modal, {
|
|
59
|
-
className: baseClass,
|
|
60
|
-
slug: modalSlug,
|
|
61
|
-
children: _jsxs("div", {
|
|
62
|
-
className: `${baseClass}__wrapper`,
|
|
63
|
-
children: [_jsxs("div", {
|
|
64
|
-
className: `${baseClass}__content`,
|
|
65
|
-
children: [_jsx("h1", {
|
|
66
|
-
children: t("general:editingTakenOver")
|
|
67
|
-
}), _jsx("p", {
|
|
68
|
-
children: t("general:anotherUserTakenOver")
|
|
69
|
-
})]
|
|
70
|
-
}), _jsxs("div", {
|
|
71
|
-
className: `${baseClass}__controls`,
|
|
72
|
-
children: [_jsx(Button, {
|
|
73
|
-
buttonStyle: "primary",
|
|
74
|
-
id: `${modalSlug}-back-to-dashboard`,
|
|
75
|
-
onClick: handleBackToDashboard,
|
|
76
|
-
size: "large",
|
|
77
|
-
children: t("general:backToDashboard")
|
|
78
|
-
}), _jsx(Button, {
|
|
79
|
-
buttonStyle: "secondary",
|
|
80
|
-
id: `${modalSlug}-view-read-only`,
|
|
81
|
-
onClick: t4,
|
|
82
|
-
size: "large",
|
|
83
|
-
children: t("general:viewReadOnly")
|
|
84
|
-
})]
|
|
85
|
-
})]
|
|
86
|
-
})
|
|
87
|
-
});
|
|
88
|
-
$[5] = t;
|
|
89
|
-
$[6] = handleBackToDashboard;
|
|
90
|
-
$[7] = onReadOnly;
|
|
91
|
-
$[8] = closeModal;
|
|
92
|
-
$[9] = t3;
|
|
93
|
-
} else {
|
|
94
|
-
t3 = $[9];
|
|
95
|
-
}
|
|
96
|
-
return t3;
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","Button","Modal","useModal","useTranslation","React","useEffect","modalSlug","baseClass","DocumentTakeOver","t0","$","handleBackToDashboard","isActive","onReadOnly","closeModal","openModal","t","t1","t2","t3","t4","_jsx","className","slug","children","_jsxs","buttonStyle","id","onClick","size"],"sources":["../../../src/elements/DocumentTakeOver/index.tsx"],"sourcesContent":["'use client'\nimport { Button, Modal, useModal, useTranslation } from '@payloadcms/ui'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst modalSlug = 'document-take-over'\n\nconst baseClass = 'document-take-over'\n\nexport const DocumentTakeOver: React.FC<{\n handleBackToDashboard: () => void\n isActive: boolean\n onReadOnly: () => void\n}> = ({ handleBackToDashboard, isActive, onReadOnly }) => {\n const { closeModal, openModal } = useModal()\n const { t } = useTranslation()\n\n useEffect(() => {\n if (isActive) {\n openModal(modalSlug)\n } else {\n closeModal(modalSlug)\n }\n }, [isActive, openModal, closeModal])\n\n return (\n <Modal className={baseClass} slug={modalSlug}>\n <div className={`${baseClass}__wrapper`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:editingTakenOver')}</h1>\n <p>{t('general:anotherUserTakenOver')}</p>\n </div>\n <div className={`${baseClass}__controls`}>\n <Button\n buttonStyle=\"primary\"\n id={`${modalSlug}-back-to-dashboard`}\n onClick={handleBackToDashboard}\n size=\"large\"\n >\n {t('general:backToDashboard')}\n </Button>\n <Button\n buttonStyle=\"secondary\"\n id={`${modalSlug}-view-read-only`}\n onClick={() => {\n onReadOnly()\n closeModal(modalSlug)\n }}\n size=\"large\"\n >\n {t('general:viewReadOnly')}\n </Button>\n </div>\n </div>\n </Modal>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AACxD,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAIjC,MAAMC,SAAA,GAAY;AAElB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,gBAAA,GAIRC,EAAA;EAAA,MAAAC,CAAA,GAAAX,EAAA;EAAC;IAAAY,qBAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAJ,EAA+C;EACnD;IAAAK,UAAA;IAAAC;EAAA,IAAkCb,QAAA;EAClC;IAAAc;EAAA,IAAcb,cAAA;EAAA,IAAAc,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAK,SAAA,IAAAL,CAAA,QAAAI,UAAA;IAEJG,EAAA,GAAAA,CAAA;MAAA,IACJL,QAAA;QACFG,SAAA,CAAA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WAAA,EACc;YAAAC,EAAA,EACR,GAAArB,SAAA,oBAAgC;YAAAsB,OAAA,EAC3BjB,qBAAA;YAAAkB,IAAA,EACJ;YAAAL,QAAA,EAEJR,CAAA,CAAE;UAAA,C,GAELK,IAAA,CAAArB,MAAA;YAAA0B,WAAA,EACc;YAAAC,EAAA,EACR,GAAArB,SAAA,iBAA6B;YAAAsB,OAAA,EACxBR,EAGT;YAAAS,IAAA,EACK;YAAAL,QAAA,EAEJR,CAAA,CAAE;UAAA,C;;;;;;;;;;;;SAxBXG,E;CA8BJ","ignoreList":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
@import '../../scss/styles.scss';
|
|
2
|
-
|
|
3
|
-
.document-take-over {
|
|
4
|
-
@include blur-bg;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
height: 100%;
|
|
9
|
-
|
|
10
|
-
&__wrapper {
|
|
11
|
-
z-index: 1;
|
|
12
|
-
position: relative;
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
gap: var(--base);
|
|
16
|
-
padding: base(2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&__content {
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
gap: var(--base);
|
|
23
|
-
|
|
24
|
-
> * {
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__controls {
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: var(--base);
|
|
32
|
-
|
|
33
|
-
.btn {
|
|
34
|
-
margin: 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { JoinQuery } from 'payload';
|
|
2
|
-
/**
|
|
3
|
-
* Convert request JoinQuery object from strings to numbers
|
|
4
|
-
* @param joins
|
|
5
|
-
*/
|
|
6
|
-
export declare const sanitizeJoinParams: (joins?: {
|
|
7
|
-
[schemaPath: string]: {
|
|
8
|
-
limit?: unknown;
|
|
9
|
-
sort?: string;
|
|
10
|
-
where?: unknown;
|
|
11
|
-
};
|
|
12
|
-
} | false) => JoinQuery;
|
|
13
|
-
//# sourceMappingURL=sanitizeJoinParams.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeJoinParams.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/utilities/sanitizeJoinParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,WAEzB;IACE,CAAC,UAAU,EAAE,MAAM,GAAG;QACpB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,CAAA;CACF,GACD,KAAK,KACR,SAYF,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isNumber } from 'payload/shared';
|
|
2
|
-
/**
|
|
3
|
-
* Convert request JoinQuery object from strings to numbers
|
|
4
|
-
* @param joins
|
|
5
|
-
*/
|
|
6
|
-
export const sanitizeJoinParams = (joins = {}) => {
|
|
7
|
-
const joinQuery = {};
|
|
8
|
-
Object.keys(joins).forEach(schemaPath => {
|
|
9
|
-
joinQuery[schemaPath] = {
|
|
10
|
-
limit: isNumber(joins[schemaPath]?.limit) ? Number(joins[schemaPath].limit) : undefined,
|
|
11
|
-
sort: joins[schemaPath]?.sort ? joins[schemaPath].sort : undefined,
|
|
12
|
-
where: joins[schemaPath]?.where ? joins[schemaPath].where : undefined
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
return joinQuery;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=sanitizeJoinParams.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeJoinParams.js","names":["isNumber","sanitizeJoinParams","joins","joinQuery","Object","keys","forEach","schemaPath","limit","Number","undefined","sort","where"],"sources":["../../../../src/routes/rest/utilities/sanitizeJoinParams.ts"],"sourcesContent":["import type { JoinQuery } from 'payload'\n\nimport { isNumber } from 'payload/shared'\n\n/**\n * Convert request JoinQuery object from strings to numbers\n * @param joins\n */\nexport const sanitizeJoinParams = (\n joins:\n | {\n [schemaPath: string]: {\n limit?: unknown\n sort?: string\n where?: unknown\n }\n }\n | false = {},\n): JoinQuery => {\n const joinQuery = {}\n\n Object.keys(joins).forEach((schemaPath) => {\n joinQuery[schemaPath] = {\n limit: isNumber(joins[schemaPath]?.limit) ? Number(joins[schemaPath].limit) : undefined,\n sort: joins[schemaPath]?.sort ? joins[schemaPath].sort : undefined,\n where: joins[schemaPath]?.where ? joins[schemaPath].where : undefined,\n }\n })\n\n return joinQuery\n}\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ;AAEzB;;;;AAIA,OAAO,MAAMC,kBAAA,GAAqBA,CAChCC,KAAA,GAQY,CAAC,CAAC;EAEd,MAAMC,SAAA,GAAY,CAAC;EAEnBC,MAAA,CAAOC,IAAI,CAACH,KAAA,EAAOI,OAAO,CAAEC,UAAA;IAC1BJ,SAAS,CAACI,UAAA,CAAW,GAAG;MACtBC,KAAA,EAAOR,QAAA,CAASE,KAAK,CAACK,UAAA,CAAW,EAAEC,KAAA,IAASC,MAAA,CAAOP,KAAK,CAACK,UAAA,CAAW,CAACC,KAAK,IAAIE,SAAA;MAC9EC,IAAA,EAAMT,KAAK,CAACK,UAAA,CAAW,EAAEI,IAAA,GAAOT,KAAK,CAACK,UAAA,CAAW,CAACI,IAAI,GAAGD,SAAA;MACzDE,KAAA,EAAOV,KAAK,CAACK,UAAA,CAAW,EAAEK,KAAA,GAAQV,KAAK,CAACK,UAAA,CAAW,CAACK,KAAK,GAAGF;IAC9D;EACF;EAEA,OAAOP,SAAA;AACT","ignoreList":[]}
|