@payloadcms/next 3.2.2 → 3.2.3-canary.3e78927
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/Tab/TabLink.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +16 -19
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +14 -11
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/index.client.js +16 -22
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/templates/Default/Wrapper/index.js +3 -3
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +4 -4
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +5 -5
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.js +3 -3
- package/dist/views/Account/index.client.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +11 -11
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +5 -5
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Preview/index.js +58 -54
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +11 -11
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +24 -23
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +8 -8
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.js +3 -3
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.js +11 -11
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +5 -5
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +9 -9
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.js +19 -19
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Logout/LogoutClient.js +11 -11
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/NotFound/index.client.js +3 -3
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +9 -9
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -1
- package/dist/views/Verify/index.client.js +3 -3
- package/dist/views/Verify/index.client.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +17 -32
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.js +13 -13
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +6 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +5 -5
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +7 -7
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +8 -8
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/index.client.js +11 -11
- package/dist/views/Versions/index.client.js.map +1 -1
- package/package.json +17 -17
|
@@ -33,13 +33,13 @@ export const Wrapper = props => {
|
|
|
33
33
|
}
|
|
34
34
|
const t4 = t3.join(" ");
|
|
35
35
|
let t5;
|
|
36
|
-
if ($[6] !==
|
|
36
|
+
if ($[6] !== children || $[7] !== t4) {
|
|
37
37
|
t5 = _jsx("div", {
|
|
38
38
|
className: t4,
|
|
39
39
|
children
|
|
40
40
|
});
|
|
41
|
-
$[6] =
|
|
42
|
-
$[7] =
|
|
41
|
+
$[6] = children;
|
|
42
|
+
$[7] = t4;
|
|
43
43
|
$[8] = t5;
|
|
44
44
|
} else {
|
|
45
45
|
t5 = $[8];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useNav","React","Wrapper","props","$","baseClass","children","className","hydrated","navOpen","shouldAnimate","t0","t1","t2","t3","filter","Boolean","t4","join","t5","_jsx"],"sources":["../../../../src/templates/Default/Wrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nexport const Wrapper: React.FC<{\n baseClass?: string\n children?: React.ReactNode\n className?: string\n}> = (props) => {\n const { baseClass, children, className } = props\n const { hydrated, navOpen, shouldAnimate } = useNav()\n\n return (\n <div\n className={[\n baseClass,\n className,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,QAAQ;AACvB,OAAOC,KAAA,MAAW;AAIlB,OAAO,MAAMC,OAAA,GAIRC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM,SAAA;IAAAC,QAAA;IAAAC;EAAA,IAA2CJ,KAAA;EAC3C;IAAAK,QAAA;IAAAC,OAAA;IAAAC;EAAA,IAA6CV,MAAA;EAOvC,MAAAW,EAAA,GAAAF,OAAA,IAAW,GAAGJ,SAAA,YAAqB;EACnC,MAAAO,EAAA,GAAAF,aAAA,IAAiB,GAAGL,SAAA,eAAwB;EAC5C,MAAAQ,EAAA,GAAAL,QAAA,IAAY,GAAGH,SAAA,gBAAyB;EAAA,IAAAS,EAAA;EAAA,IAAAV,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAG,SAAA,IAAAH,CAAA,QAAAO,EAAA,IAAAP,CAAA,QAAAQ,EAAA,IAAAR,CAAA,QAAAS,EAAA;IAL/BC,EAAA,IACTT,SAAA,EACAE,SAAA,EACAI,EAAmC,EACnCC,EAA4C,EAC5CC,EAAwC,EAAAE,MAAA,CAAAC,OAEhC;IAAAZ,CAAA,MAAAC,SAAA;IAAAD,CAAA,MAAAG,SAAA;IAAAH,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAS,EAAA;IAAAT,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAPC,MAAAa,EAAA,GAAAH,EAOD,CAAAI,IAAA,CACF;EAAA,IAAAC,EAAA;EAAA,IAAAf,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useNav","React","Wrapper","props","$","baseClass","children","className","hydrated","navOpen","shouldAnimate","t0","t1","t2","t3","filter","Boolean","t4","join","t5","_jsx"],"sources":["../../../../src/templates/Default/Wrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nexport const Wrapper: React.FC<{\n baseClass?: string\n children?: React.ReactNode\n className?: string\n}> = (props) => {\n const { baseClass, children, className } = props\n const { hydrated, navOpen, shouldAnimate } = useNav()\n\n return (\n <div\n className={[\n baseClass,\n className,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAA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1;
|
|
17
|
-
if ($[0] !==
|
|
17
|
+
if ($[0] !== localeOptions || $[1] !== onChange || $[2] !== t) {
|
|
18
18
|
let t2;
|
|
19
19
|
if ($[4] !== onChange) {
|
|
20
20
|
t2 = value => onChange(value);
|
|
@@ -32,9 +32,9 @@ export const LocaleSelector = t0 => {
|
|
|
32
32
|
onChange: t2,
|
|
33
33
|
path: "locale"
|
|
34
34
|
});
|
|
35
|
-
$[0] =
|
|
36
|
-
$[1] =
|
|
37
|
-
$[2] =
|
|
35
|
+
$[0] = localeOptions;
|
|
36
|
+
$[1] = onChange;
|
|
37
|
+
$[2] = t;
|
|
38
38
|
$[3] = t1;
|
|
39
39
|
} else {
|
|
40
40
|
t1 = $[3];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","SelectField","useTranslation","React","LocaleSelector","t0","$","localeOptions","onChange","t","t1","t2","value","_jsx","field","name","label","options","path"],"sources":["../../../../src/views/API/LocaleSelector/index.tsx"],"sourcesContent":["'use client'\nimport { SelectField, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const LocaleSelector: React.FC<{\n readonly localeOptions: {\n label: Record<string, string> | string\n value: string\n }[]\n readonly onChange: (value: string) => void\n}> = ({ localeOptions, onChange }) => {\n const { t } = useTranslation()\n\n return (\n <SelectField\n field={{\n name: 'locale',\n label: t('general:locale'),\n options: localeOptions,\n }}\n onChange={(value: string) => onChange(value)}\n path=\"locale\"\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,cAAc,QAAQ;AAC5C,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,cAAA,GAMRC,EAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAAC;IAAAO,aAAA;IAAAC;EAAA,IAAAH,EAA2B;EAC/B;IAAAI;EAAA,IAAcP,cAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAJ,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","SelectField","useTranslation","React","LocaleSelector","t0","$","localeOptions","onChange","t","t1","t2","value","_jsx","field","name","label","options","path"],"sources":["../../../../src/views/API/LocaleSelector/index.tsx"],"sourcesContent":["'use client'\nimport { SelectField, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const LocaleSelector: React.FC<{\n readonly localeOptions: {\n label: Record<string, string> | string\n value: string\n }[]\n readonly onChange: (value: string) => void\n}> = ({ localeOptions, onChange }) => {\n const { t } = useTranslation()\n\n return (\n <SelectField\n field={{\n name: 'locale',\n label: t('general:locale'),\n options: localeOptions,\n }}\n onChange={(value: string) => onChange(value)}\n path=\"locale\"\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,cAAc,QAAQ;AAC5C,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,cAAA,GAMRC,EAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAAC;IAAAO,aAAA;IAAAC;EAAA,IAAAH,EAA2B;EAC/B;IAAAI;EAAA,IAAcP,cAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAJ,CAAA,QAAAC,aAAA,IAAAD,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAG,CAAA;IAAA,IAAAE,EAAA;IAAA,IAAAL,CAAA,QAAAE,QAAA;MASAG,EAAA,GAAAC,KAAA,IAAmBJ,QAAA,CAASI,KAAA;MAAAN,CAAA,MAAAE,QAAA;MAAAF,CAAA,MAAAK,EAAA;IAAA;MAAAA,EAAA,GAAAL,CAAA;IAAA;IANxCI,EAAA,GAAAG,IAAA,CAAAZ,WAAA;MAAAa,KAAA;QAAAC,IAAA,EAEU;QAAAC,KAAA,EACCP,CAAA,CAAE;QAAAQ,OAAA,EACAV;MAAA;MAAAC,QAAA,EAEDG,EAA4B;MAAAO,IAAA,EACjC;IAAA,C;;;;;;;;SAPPR,E;CAUJ","ignoreList":[]}
|
|
@@ -26,7 +26,7 @@ export const ToggleTheme = () => {
|
|
|
26
26
|
}
|
|
27
27
|
const onChange = t0;
|
|
28
28
|
let t1;
|
|
29
|
-
if ($[2] !==
|
|
29
|
+
if ($[2] !== autoMode || $[3] !== onChange || $[4] !== t || $[5] !== theme) {
|
|
30
30
|
t1 = _jsx(RadioGroupField, {
|
|
31
31
|
disableModifyingForm: true,
|
|
32
32
|
field: {
|
|
@@ -47,10 +47,10 @@ export const ToggleTheme = () => {
|
|
|
47
47
|
path: "theme",
|
|
48
48
|
value: autoMode ? "auto" : theme
|
|
49
49
|
});
|
|
50
|
-
$[2] =
|
|
51
|
-
$[3] =
|
|
52
|
-
$[4] =
|
|
53
|
-
$[5] =
|
|
50
|
+
$[2] = autoMode;
|
|
51
|
+
$[3] = onChange;
|
|
52
|
+
$[4] = t;
|
|
53
|
+
$[5] = theme;
|
|
54
54
|
$[6] = t1;
|
|
55
55
|
} else {
|
|
56
56
|
t1 = $[6];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","RadioGroupField","useTheme","useTranslation","React","useCallback","ToggleTheme","$","autoMode","setTheme","theme","t","t0","newTheme","onChange","t1","_jsx","disableModifyingForm","field","name","label","options","value","path"],"sources":["../../../../src/views/Account/ToggleTheme/index.tsx"],"sourcesContent":["'use client'\n\nimport { RadioGroupField, useTheme, useTranslation } from '@payloadcms/ui'\nimport React, { useCallback } from 'react'\n\nexport const ToggleTheme: React.FC = () => {\n const { autoMode, setTheme, theme } = useTheme()\n const { t } = useTranslation()\n\n const onChange = useCallback(\n (newTheme) => {\n setTheme(newTheme)\n },\n [setTheme],\n )\n\n return (\n <RadioGroupField\n disableModifyingForm={true}\n field={{\n name: 'theme',\n label: t('general:adminTheme'),\n options: [\n {\n label: t('general:automatic'),\n value: 'auto',\n },\n {\n label: t('general:light'),\n value: 'light',\n },\n {\n label: t('general:dark'),\n value: 'dark',\n },\n ],\n }}\n onChange={onChange}\n path=\"theme\"\n value={autoMode ? 'auto' : theme}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,SAASC,eAAe,EAAEC,QAAQ,EAAEC,cAAc,QAAQ;AAC1D,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAEnC,OAAO,MAAMC,WAAA,GAAwBA,CAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACnC;IAAAQ,QAAA;IAAAC,QAAA;IAAAC;EAAA,IAAsCR,QAAA;EACtC;IAAAS;EAAA,IAAcR,cAAA;EAAA,IAAAS,EAAA;EAAA,IAAAL,CAAA,QAAAE,QAAA;IAGZG,EAAA,GAAAC,QAAA;MACEJ,QAAA,CAASI,QAAA;IAAA;IACXN,CAAA,MAAAE,QAAA;IAAAF,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAHF,MAAAO,QAAA,GAAiBF,EAIL;EAAA,IAAAG,EAAA;EAAA,IAAAR,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","RadioGroupField","useTheme","useTranslation","React","useCallback","ToggleTheme","$","autoMode","setTheme","theme","t","t0","newTheme","onChange","t1","_jsx","disableModifyingForm","field","name","label","options","value","path"],"sources":["../../../../src/views/Account/ToggleTheme/index.tsx"],"sourcesContent":["'use client'\n\nimport { RadioGroupField, useTheme, useTranslation } from '@payloadcms/ui'\nimport React, { useCallback } from 'react'\n\nexport const ToggleTheme: React.FC = () => {\n const { autoMode, setTheme, theme } = useTheme()\n const { t } = useTranslation()\n\n const onChange = useCallback(\n (newTheme) => {\n setTheme(newTheme)\n },\n [setTheme],\n )\n\n return (\n <RadioGroupField\n disableModifyingForm={true}\n field={{\n name: 'theme',\n label: t('general:adminTheme'),\n options: [\n {\n label: t('general:automatic'),\n value: 'auto',\n },\n {\n label: t('general:light'),\n value: 'light',\n },\n {\n label: t('general:dark'),\n value: 'dark',\n },\n ],\n }}\n onChange={onChange}\n path=\"theme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
|
let t1;
|
|
16
|
-
if ($[0] !==
|
|
16
|
+
if ($[0] !== setStepNav || $[1] !== t) {
|
|
17
17
|
t0 = () => {
|
|
18
18
|
const nav = [];
|
|
19
19
|
nav.push({
|
|
@@ -23,8 +23,8 @@ export const AccountClient = () => {
|
|
|
23
23
|
setStepNav(nav);
|
|
24
24
|
};
|
|
25
25
|
t1 = [setStepNav, t];
|
|
26
|
-
$[0] =
|
|
27
|
-
$[1] =
|
|
26
|
+
$[0] = setStepNav;
|
|
27
|
+
$[1] = t;
|
|
28
28
|
$[2] = t0;
|
|
29
29
|
$[3] = t1;
|
|
30
30
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.js","names":["c","_c","useStepNav","useTranslation","React","AccountClient","$","setStepNav","t","t0","t1","nav","push","label","url","useEffect"],"sources":["../../../src/views/Account/index.client.tsx"],"sourcesContent":["'use client'\nimport { type StepNavItem, useStepNav, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const AccountClient: React.FC = () => {\n const { setStepNav } = useStepNav()\n const { t } = useTranslation()\n\n React.useEffect(() => {\n const nav: StepNavItem[] = []\n\n nav.push({\n label: t('authentication:account'),\n url: '/account',\n })\n\n setStepNav(nav)\n }, [setStepNav, t])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAA2BC,UAAU,EAAEC,cAAc,QAAQ;AAC7D,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,aAAA,GAA0BA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACrC;IAAAM;EAAA,IAAuBL,UAAA;EACvB;IAAAM;EAAA,IAAcL,cAAA;EAAA,IAAAM,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,
|
|
1
|
+
{"version":3,"file":"index.client.js","names":["c","_c","useStepNav","useTranslation","React","AccountClient","$","setStepNav","t","t0","t1","nav","push","label","url","useEffect"],"sources":["../../../src/views/Account/index.client.tsx"],"sourcesContent":["'use client'\nimport { type StepNavItem, useStepNav, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const AccountClient: React.FC = () => {\n const { setStepNav } = useStepNav()\n const { t } = useTranslation()\n\n React.useEffect(() => {\n const nav: StepNavItem[] = []\n\n nav.push({\n label: t('authentication:account'),\n url: '/account',\n })\n\n setStepNav(nav)\n }, [setStepNav, t])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAA2BC,UAAU,EAAEC,cAAc,QAAQ;AAC7D,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,aAAA,GAA0BA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACrC;IAAAM;EAAA,IAAuBL,UAAA;EACvB;IAAAM;EAAA,IAAcL,cAAA;EAAA,IAAAM,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAE,CAAA;IAEEC,EAAA,GAAAA,CAAA;MACd,MAAAE,GAAA;MAEAA,GAAA,CAAAC,IAAA;QAAAC,KAAA,EACSL,CAAA,CAAE;QAAAM,GAAA,EACJ;MAAA,CACP;MAEAP,UAAA,CAAWI,GAAA;IAAA;IACVD,EAAA,IAACH,UAAA,EAAYC,CAAA;IAAEF,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,CAAA;IAAAF,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EATlBF,KAAA,CAAAW,SAAA,CAAgBN,EAShB,EAAGC,EAAe;EAAA;AAAA,CAGpB","ignoreList":[]}
|
|
@@ -37,7 +37,7 @@ export const ForgotPasswordForm = () => {
|
|
|
37
37
|
const collectionConfig = t2;
|
|
38
38
|
const loginWithUsername = collectionConfig?.auth?.loginWithUsername;
|
|
39
39
|
let t3;
|
|
40
|
-
if ($[3] !==
|
|
40
|
+
if ($[3] !== loginWithUsername || $[4] !== t) {
|
|
41
41
|
t3 = (res, successToast, errorToast) => {
|
|
42
42
|
res.json().then(() => {
|
|
43
43
|
setHasSubmitted(true);
|
|
@@ -46,8 +46,8 @@ export const ForgotPasswordForm = () => {
|
|
|
46
46
|
errorToast(loginWithUsername ? t("authentication:usernameNotValid") : t("authentication:emailNotValid"));
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
$[3] =
|
|
50
|
-
$[4] =
|
|
49
|
+
$[3] = loginWithUsername;
|
|
50
|
+
$[4] = t;
|
|
51
51
|
$[5] = t3;
|
|
52
52
|
} else {
|
|
53
53
|
t3 = $[5];
|
|
@@ -55,7 +55,7 @@ export const ForgotPasswordForm = () => {
|
|
|
55
55
|
const handleResponse = t3;
|
|
56
56
|
let t4;
|
|
57
57
|
let t5;
|
|
58
|
-
if ($[6] !==
|
|
58
|
+
if ($[6] !== api || $[7] !== config || $[8] !== handleResponse || $[9] !== hasSubmitted || $[10] !== loginWithUsername || $[11] !== t || $[12] !== userSlug) {
|
|
59
59
|
t5 = Symbol.for("react.early_return_sentinel");
|
|
60
60
|
bb0: {
|
|
61
61
|
const initialState = loginWithUsername ? {
|
|
@@ -149,13 +149,13 @@ export const ForgotPasswordForm = () => {
|
|
|
149
149
|
})]
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
$[6] =
|
|
153
|
-
$[7] =
|
|
154
|
-
$[8] =
|
|
155
|
-
$[9] =
|
|
156
|
-
$[10] =
|
|
157
|
-
$[11] =
|
|
158
|
-
$[12] =
|
|
152
|
+
$[6] = api;
|
|
153
|
+
$[7] = config;
|
|
154
|
+
$[8] = handleResponse;
|
|
155
|
+
$[9] = hasSubmitted;
|
|
156
|
+
$[10] = loginWithUsername;
|
|
157
|
+
$[11] = t;
|
|
158
|
+
$[12] = userSlug;
|
|
159
159
|
$[13] = t4;
|
|
160
160
|
$[14] = t5;
|
|
161
161
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","EmailField","Form","FormSubmit","TextField","useConfig","useTranslation","email","text","React","useState","FormHeader","ForgotPasswordForm","$","config","admin","t0","routes","t1","user","userSlug","api","t","hasSubmitted","setHasSubmitted","t2","collections","find","collection","slug","collectionConfig","loginWithUsername","auth","t3","res","successToast","errorToast","json","then","catch","handleResponse","t4","t5","Symbol","for","initialState","username","initialValue","valid","value","undefined","t6","_jsx","description","heading","_jsxs","action","method","children","field","name","label","required","path","validate","type","data","preferences","fields","req","payload","siblingData","autoComplete","value_0","size"],"sources":["../../../../src/views/ForgotPassword/ForgotPasswordForm/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState, PayloadRequest } from 'payload'\n\nimport { EmailField, Form, FormSubmit, TextField, useConfig, useTranslation } from '@payloadcms/ui'\nimport { email, text } from 'payload/shared'\nimport React, { useState } from 'react'\n\nimport { FormHeader } from '../../../elements/FormHeader/index.js'\n\nexport const ForgotPasswordForm: React.FC = () => {\n const { config } = useConfig()\n\n const {\n admin: { user: userSlug },\n routes: { api },\n } = config\n\n const { t } = useTranslation()\n const [hasSubmitted, setHasSubmitted] = useState(false)\n const collectionConfig = config.collections?.find((collection) => collection?.slug === userSlug)\n const loginWithUsername = collectionConfig?.auth?.loginWithUsername\n\n const handleResponse: FormProps['handleResponse'] = (res, successToast, errorToast) => {\n res\n .json()\n .then(() => {\n setHasSubmitted(true)\n successToast(t('general:submissionSuccessful'))\n })\n .catch(() => {\n errorToast(\n loginWithUsername\n ? t('authentication:usernameNotValid')\n : t('authentication:emailNotValid'),\n )\n })\n }\n\n const initialState: FormState = loginWithUsername\n ? {\n username: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n : {\n email: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n\n if (hasSubmitted) {\n return (\n <FormHeader\n description={t('authentication:checkYourEmailForPasswordReset')}\n heading={t('authentication:emailSent')}\n />\n )\n }\n\n return (\n <Form\n action={`${api}/${userSlug}/forgot-password`}\n handleResponse={handleResponse}\n initialState={initialState}\n method=\"POST\"\n >\n <FormHeader\n description={\n loginWithUsername\n ? t('authentication:forgotPasswordUsernameInstructions')\n : t('authentication:forgotPasswordEmailInstructions')\n }\n heading={t('authentication:forgotPassword')}\n />\n\n {loginWithUsername ? (\n <TextField\n field={{\n name: 'username',\n label: t('authentication:username'),\n required: true,\n }}\n path=\"username\"\n validate={(value) =>\n text(value, {\n name: 'username',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n ) : (\n <EmailField\n field={{\n name: 'email',\n admin: {\n autoComplete: 'email',\n },\n label: t('general:email'),\n required: true,\n }}\n path=\"email\"\n validate={(value) =>\n email(value, {\n name: 'email',\n type: 'email',\n data: {},\n preferences: { fields: {} },\n req: { payload: { config }, t } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n )}\n <FormSubmit size=\"large\">{t('general:submit')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAKA,SAASC,UAAU,EAAEC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ;AACnF,SAASC,KAAK,EAAEC,IAAI,QAAQ;AAC5B,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,kBAAA,GAA+BA,CAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EAC1C;IAAAc;EAAA,IAAmBT,SAAA;EAEnB;IAAAU,KAAA,EAAAC,EAAA;IAAAC,MAAA,EAAAC;EAAA,IAGIJ,MAAA;EAFK;IAAAK,IAAA,EAAAC;EAAA,IAAAJ,EAAkB;EACjB;IAAAK;EAAA,IAAAH,EAAO;EAGjB;IAAAI;EAAA,IAAchB,cAAA;EACd,OAAAiB,YAAA,EAAAC,eAAA,IAAwCd,QAAA,MAAS;EAAA,IAAAe,EAAA;EAAA,IAAAZ,CAAA,QAAAC,MAAA,CAAAY,WAAA,IAAAb,CAAA,QAAAO,QAAA;IACxBK,EAAA,GAAAX,MAAA,CAAAY,WAAA,EAAAC,IAAA,CAAAC,UAAA,IAAyCA,UAAA,EAAAC,IAAA,KAAqBT,QAAA;IAAAP,CAAA,MAAAC,MAAA,CAAAY,WAAA;IAAAb,CAAA,MAAAO,QAAA;IAAAP,CAAA,MAAAY,EAAA;EAAA;IAAAA,EAAA,GAAAZ,CAAA;EAAA;EAAvF,MAAAiB,gBAAA,GAAyBL,EAA8D;EACvF,MAAAM,iBAAA,GAA0BD,gBAAA,EAAAE,IAAA,EAAAD,iBAAA;EAAwB,IAAAE,EAAA;EAAA,IAAApB,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","EmailField","Form","FormSubmit","TextField","useConfig","useTranslation","email","text","React","useState","FormHeader","ForgotPasswordForm","$","config","admin","t0","routes","t1","user","userSlug","api","t","hasSubmitted","setHasSubmitted","t2","collections","find","collection","slug","collectionConfig","loginWithUsername","auth","t3","res","successToast","errorToast","json","then","catch","handleResponse","t4","t5","Symbol","for","initialState","username","initialValue","valid","value","undefined","t6","_jsx","description","heading","_jsxs","action","method","children","field","name","label","required","path","validate","type","data","preferences","fields","req","payload","siblingData","autoComplete","value_0","size"],"sources":["../../../../src/views/ForgotPassword/ForgotPasswordForm/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState, PayloadRequest } from 'payload'\n\nimport { EmailField, Form, FormSubmit, TextField, useConfig, useTranslation } from '@payloadcms/ui'\nimport { email, text } from 'payload/shared'\nimport React, { useState } from 'react'\n\nimport { FormHeader } from '../../../elements/FormHeader/index.js'\n\nexport const ForgotPasswordForm: React.FC = () => {\n const { config } = useConfig()\n\n const {\n admin: { user: userSlug },\n routes: { api },\n } = config\n\n const { t } = useTranslation()\n const [hasSubmitted, setHasSubmitted] = useState(false)\n const collectionConfig = config.collections?.find((collection) => collection?.slug === userSlug)\n const loginWithUsername = collectionConfig?.auth?.loginWithUsername\n\n const handleResponse: FormProps['handleResponse'] = (res, successToast, errorToast) => {\n res\n .json()\n .then(() => {\n setHasSubmitted(true)\n successToast(t('general:submissionSuccessful'))\n })\n .catch(() => {\n errorToast(\n loginWithUsername\n ? t('authentication:usernameNotValid')\n : t('authentication:emailNotValid'),\n )\n })\n }\n\n const initialState: FormState = loginWithUsername\n ? {\n username: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n : {\n email: {\n initialValue: '',\n valid: true,\n value: undefined,\n },\n }\n\n if (hasSubmitted) {\n return (\n <FormHeader\n description={t('authentication:checkYourEmailForPasswordReset')}\n heading={t('authentication:emailSent')}\n />\n )\n }\n\n return (\n <Form\n action={`${api}/${userSlug}/forgot-password`}\n handleResponse={handleResponse}\n initialState={initialState}\n method=\"POST\"\n >\n <FormHeader\n description={\n loginWithUsername\n ? t('authentication:forgotPasswordUsernameInstructions')\n : t('authentication:forgotPasswordEmailInstructions')\n }\n heading={t('authentication:forgotPassword')}\n />\n\n {loginWithUsername ? (\n <TextField\n field={{\n name: 'username',\n label: t('authentication:username'),\n required: true,\n }}\n path=\"username\"\n validate={(value) =>\n text(value, {\n name: 'username',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n ) : (\n <EmailField\n field={{\n name: 'email',\n admin: {\n autoComplete: 'email',\n },\n label: t('general:email'),\n required: true,\n }}\n path=\"email\"\n validate={(value) =>\n email(value, {\n name: 'email',\n type: 'email',\n data: {},\n preferences: { fields: {} },\n req: { payload: { config }, t } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n }\n />\n )}\n <FormSubmit size=\"large\">{t('general:submit')}</FormSubmit>\n </Form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AEItB,iBAAA,GACIT,CAAA,CAAE,uDACFA,CAAA,CAAE;UAAAgC,OAAA,EAEChC,CAAA,CAAE;QAAA,C,GAGZS,iBAAA,GACCqB,IAAA,CAAAhD,SAAA;UAAAuD,KAAA;YAAAC,IAAA,EAEU;YAAAC,KAAA,EACCvC,CAAA,CAAE;YAAAwC,QAAA;UAAA;UAAAC,IAAA,EAGN;UAAAC,QAAA,EAAAf,KAAA,IAEHzC,IAAA,CAAKyC,KAAA;YAAAW,IAAA,EACG;YAAAK,IAAA,EACA;YAAAC,IAAA;YAAAC,WAAA;cAAAC,MAAA;YAAA;YAAAC,GAAA;cAAAC,OAAA;gBAAAxD;cAAA;cAAAQ;YAAA;YAAAwC,QAAA;YAAAS,WAAA;UAAA,CAWR;QAAA,C,IAIJnB,IAAA,CAAAnD,UAAA;UAAA0D,KAAA;YAAAC,IAAA,EAEU;YAAA7C,KAAA;cAAAyD,YAAA,EAEU;YAAA;YAAAX,KAAA,EAETvC,CAAA,CAAE;YAAAwC,QAAA;UAAA;UAAAC,IAAA,EAGN;UAAAC,QAAA,EAAAS,OAAA,IAEHlE,KAAA,CAAM0C,OAAA;YAAAW,IAAA,EACE;YAAAK,IAAA,EACA;YAAAC,IAAA;YAAAC,WAAA;cAAAC,MAAA;YAAA;YAAAC,GAAA;cAAAC,OAAA;gBAAAxD;cAAA;cAAAQ;YAAA;YAAAwC,QAAA;YAAAS,WAAA;UAAA,CAMR;QAAA,C,GAINnB,IAAA,CAAAjD,UAAA;UAAAuE,IAAA,EAAiB;UAAAhB,QAAA,EAASpC,CAAA,CAAE;QAAA,C;;;;;;;;;;;;;;;;;;;SAhE9BmB,E;CAmEJ","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ export const DeviceContainer = props => {
|
|
|
31
31
|
const t1 = `translate3d(${x}, 0, 0)`;
|
|
32
32
|
const t2 = foundBreakpoint && foundBreakpoint?.name !== "responsive" ? `${size?.width / (typeof zoom === "number" ? zoom : 1)}px` : typeof zoom === "number" ? `${100 / zoom}%` : "100%";
|
|
33
33
|
let t3;
|
|
34
|
-
if ($[0] !==
|
|
34
|
+
if ($[0] !== children || $[1] !== margin || $[2] !== t0 || $[3] !== t1 || $[4] !== t2) {
|
|
35
35
|
t3 = _jsx("div", {
|
|
36
36
|
style: {
|
|
37
37
|
height: t0,
|
|
@@ -41,11 +41,11 @@ export const DeviceContainer = props => {
|
|
|
41
41
|
},
|
|
42
42
|
children
|
|
43
43
|
});
|
|
44
|
-
$[0] =
|
|
44
|
+
$[0] = children;
|
|
45
45
|
$[1] = margin;
|
|
46
|
-
$[2] =
|
|
47
|
-
$[3] =
|
|
48
|
-
$[4] =
|
|
46
|
+
$[2] = t0;
|
|
47
|
+
$[3] = t1;
|
|
48
|
+
$[4] = t2;
|
|
49
49
|
$[5] = t3;
|
|
50
50
|
} else {
|
|
51
51
|
t3 = $[5];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","useLivePreviewContext","DeviceContainer","props","$","children","breakpoint","breakpoints","size","zoom","foundBreakpoint","find","bp","name","x","margin","width","height","scaledWidth","difference","t0","t1","t2","t3","_jsx","style","transform"],"sources":["../../../../src/views/LivePreview/DeviceContainer/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext()\n\n const foundBreakpoint = breakpoint && breakpoints?.find((bp) => bp.name === breakpoint)\n\n let x = '0'\n let margin = '0'\n\n if (foundBreakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n return (\n <div\n style={{\n height:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n }}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAElB,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,eAAA,GAERC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM;EAAA,IAAqBF,KAAA;EAErB;IAAAG,UAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC;EAAA,IAAgDR,qBAAA;EAEhD,MAAAS,eAAA,GAAwBJ,UAAA,IAAcC,WAAA,EAAAI,IAAA,CAAAC,EAAA,IAA0BA,EAAA,CAAAC,IAAA,KAAYP,UAAA;EAE5E,IAAAQ,CAAA,GAAQ;EACR,IAAAC,MAAA,GAAa;EAAA,IAETL,eAAA,IAAmBJ,UAAA,KAAe;IACpCQ,CAAA,CAAAA,CAAA,CAAIA,MAAA;IAAJ,IAGE,OAAOL,IAAA,KAAS,YAChB,OAAOD,IAAA,CAAAQ,KAAA,KAAe,YACtB,OAAOR,IAAA,CAAAS,MAAA,KAAgB;MAEvB,MAAAC,WAAA,GAAoBV,IAAA,CAAAQ,KAAA,GAAaP,IAAA;MACjC,MAAAU,UAAA,GAAmBD,WAAA,GAAcV,IAAA,CAAAQ,KAAU;MAC3CF,CAAA,CAAAA,CAAA,CAAIA,GAAGK,UAAA,IAAa,IAAK;MACzBJ,MAAA,CAAAA,CAAA,CAASA,QAAA;IAAT;EAAA;EAQI,MAAAK,EAAA,GAAAV,eAAA,IAAmBA,eAAA,EAAAG,IAAA,KAA0B,eACzC,GAAGL,IAAA,EAAAS,MAAA,IAAgB,OAAOR,IAAA,KAAS,WAAWA,IAAA,IAAO,KAAM,GAC3D,OAAOA,IAAA,KAAS,WACd,GAAG,MAAMA,IAAA,GAAO,GAChB;EAEG,MAAAY,EAAA,kBAAeP,CAAA,SAAU;EAElC,MAAAQ,EAAA,GAAAZ,eAAA,IAAmBA,eAAA,EAAAG,IAAA,KAA0B,eACzC,GAAGL,IAAA,EAAAQ,KAAA,IAAe,OAAOP,IAAA,KAAS,WAAWA,IAAA,IAAO,KAAM,GAC1D,OAAOA,IAAA,KAAS,WACd,GAAG,MAAMA,IAAA,GAAO,GAChB;EAAA,IAAAc,EAAA;EAAA,IAAAnB,CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","useLivePreviewContext","DeviceContainer","props","$","children","breakpoint","breakpoints","size","zoom","foundBreakpoint","find","bp","name","x","margin","width","height","scaledWidth","difference","t0","t1","t2","t3","_jsx","style","transform"],"sources":["../../../../src/views/LivePreview/DeviceContainer/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext()\n\n const foundBreakpoint = breakpoint && breakpoints?.find((bp) => bp.name === breakpoint)\n\n let x = '0'\n let margin = '0'\n\n if (foundBreakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n return (\n <div\n style={{\n height:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n }}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAElB,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,eAAA,GAERC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM;EAAA,IAAqBF,KAAA;EAErB;IAAAG,UAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC;EAAA,IAAgDR,qBAAA;EAEhD,MAAAS,eAAA,GAAwBJ,UAAA,IAAcC,WAAA,EAAAI,IAAA,CAAAC,EAAA,IAA0BA,EAAA,CAAAC,IAAA,KAAYP,UAAA;EAE5E,IAAAQ,CAAA,GAAQ;EACR,IAAAC,MAAA,GAAa;EAAA,IAETL,eAAA,IAAmBJ,UAAA,KAAe;IACpCQ,CAAA,CAAAA,CAAA,CAAIA,MAAA;IAAJ,IAGE,OAAOL,IAAA,KAAS,YAChB,OAAOD,IAAA,CAAAQ,KAAA,KAAe,YACtB,OAAOR,IAAA,CAAAS,MAAA,KAAgB;MAEvB,MAAAC,WAAA,GAAoBV,IAAA,CAAAQ,KAAA,GAAaP,IAAA;MACjC,MAAAU,UAAA,GAAmBD,WAAA,GAAcV,IAAA,CAAAQ,KAAU;MAC3CF,CAAA,CAAAA,CAAA,CAAIA,GAAGK,UAAA,IAAa,IAAK;MACzBJ,MAAA,CAAAA,CAAA,CAASA,QAAA;IAAT;EAAA;EAQI,MAAAK,EAAA,GAAAV,eAAA,IAAmBA,eAAA,EAAAG,IAAA,KAA0B,eACzC,GAAGL,IAAA,EAAAS,MAAA,IAAgB,OAAOR,IAAA,KAAS,WAAWA,IAAA,IAAO,KAAM,GAC3D,OAAOA,IAAA,KAAS,WACd,GAAG,MAAMA,IAAA,GAAO,GAChB;EAEG,MAAAY,EAAA,kBAAeP,CAAA,SAAU;EAElC,MAAAQ,EAAA,GAAAZ,eAAA,IAAmBA,eAAA,EAAAG,IAAA,KAA0B,eACzC,GAAGL,IAAA,EAAAQ,KAAA,IAAe,OAAOP,IAAA,KAAS,WAAWA,IAAA,IAAO,KAAM,GAC1D,OAAOA,IAAA,KAAS,WACd,GAAG,MAAMA,IAAA,GAAO,GAChB;EAAA,IAAAc,EAAA;EAAA,IAAAnB,CAAA,QAAAC,QAAA,IAAAD,CAAA,QAAAW,MAAA,IAAAX,CAAA,QAAAgB,EAAA,IAAAhB,CAAA,QAAAiB,EAAA,IAAAjB,CAAA,QAAAkB,EAAA;IAfZC,EAAA,GAAAC,IAAA,CAAC;MAAAC,KAAA;QAAAR,MAAA,EAGKG,EAIM;QAAAL,MAAA;QAAAW,SAAA,EAEGL,EAAyB;QAAAL,KAAA,EAElCM;MAIM;MAAAjB;IAAA,C;;;;;;;;;;SAfZkB,E;CAqBJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoH/C,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { ShimmerEffect, useAllFormFields, useDocumentEvents } from '@payloadcms/ui';
|
|
5
|
+
import { ShimmerEffect, useAllFormFields, useDocumentEvents, useLocale } from '@payloadcms/ui';
|
|
6
6
|
import { reduceFieldsToValues } from 'payload/shared';
|
|
7
7
|
import React, { useEffect } from 'react';
|
|
8
8
|
import { useLivePreviewContext } from '../Context/context.js';
|
|
@@ -11,7 +11,7 @@ import { IFrame } from '../IFrame/index.js';
|
|
|
11
11
|
import { LivePreviewToolbar } from '../Toolbar/index.js';
|
|
12
12
|
const baseClass = 'live-preview-window';
|
|
13
13
|
export const LivePreview = props => {
|
|
14
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(41);
|
|
15
15
|
const {
|
|
16
16
|
appIsReady,
|
|
17
17
|
iframeHasLoaded,
|
|
@@ -21,6 +21,7 @@ export const LivePreview = props => {
|
|
|
21
21
|
setIframeHasLoaded,
|
|
22
22
|
url
|
|
23
23
|
} = useLivePreviewContext();
|
|
24
|
+
const locale = useLocale();
|
|
24
25
|
const {
|
|
25
26
|
mostRecentUpdate
|
|
26
27
|
} = useDocumentEvents();
|
|
@@ -31,7 +32,7 @@ export const LivePreview = props => {
|
|
|
31
32
|
const prevWindowType = React.useRef(undefined);
|
|
32
33
|
const [fields] = useAllFormFields();
|
|
33
34
|
let t0;
|
|
34
|
-
if ($[0] !==
|
|
35
|
+
if ($[0] !== appIsReady || $[1] !== fieldSchemaJSON || $[2] !== fields || $[3] !== iframeRef || $[4] !== locale || $[5] !== mostRecentUpdate || $[6] !== popupRef || $[7] !== previewWindowType || $[8] !== url) {
|
|
35
36
|
t0 = () => {
|
|
36
37
|
if (fields && window && "postMessage" in window && appIsReady) {
|
|
37
38
|
const values = reduceFieldsToValues(fields, true);
|
|
@@ -41,7 +42,8 @@ export const LivePreview = props => {
|
|
|
41
42
|
type: "payload-live-preview",
|
|
42
43
|
data: values,
|
|
43
44
|
externallyUpdatedRelationship: mostRecentUpdate,
|
|
44
|
-
fieldSchemaJSON: shouldSendSchema ? fieldSchemaJSON : undefined
|
|
45
|
+
fieldSchemaJSON: shouldSendSchema ? fieldSchemaJSON : undefined,
|
|
46
|
+
locale: locale.code
|
|
45
47
|
};
|
|
46
48
|
if (previewWindowType === "popup" && popupRef.current) {
|
|
47
49
|
popupRef.current.postMessage(message, url);
|
|
@@ -51,38 +53,40 @@ export const LivePreview = props => {
|
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
$[0] =
|
|
55
|
-
$[1] =
|
|
56
|
-
$[2] =
|
|
57
|
-
$[3] =
|
|
58
|
-
$[4] =
|
|
59
|
-
$[5] =
|
|
60
|
-
$[6] =
|
|
61
|
-
$[7] =
|
|
62
|
-
$[8] =
|
|
56
|
+
$[0] = appIsReady;
|
|
57
|
+
$[1] = fieldSchemaJSON;
|
|
58
|
+
$[2] = fields;
|
|
59
|
+
$[3] = iframeRef;
|
|
60
|
+
$[4] = locale;
|
|
61
|
+
$[5] = mostRecentUpdate;
|
|
62
|
+
$[6] = popupRef;
|
|
63
|
+
$[7] = previewWindowType;
|
|
64
|
+
$[8] = url;
|
|
65
|
+
$[9] = t0;
|
|
63
66
|
} else {
|
|
64
|
-
t0 = $[
|
|
67
|
+
t0 = $[9];
|
|
65
68
|
}
|
|
66
69
|
let t1;
|
|
67
|
-
if ($[
|
|
68
|
-
t1 = [fields, url, iframeHasLoaded, previewWindowType, popupRef, appIsReady, iframeRef, setIframeHasLoaded, fieldSchemaJSON, mostRecentUpdate];
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
70
|
+
if ($[10] !== appIsReady || $[11] !== fieldSchemaJSON || $[12] !== fields || $[13] !== iframeHasLoaded || $[14] !== iframeRef || $[15] !== locale || $[16] !== mostRecentUpdate || $[17] !== popupRef || $[18] !== previewWindowType || $[19] !== setIframeHasLoaded || $[20] !== url) {
|
|
71
|
+
t1 = [fields, url, iframeHasLoaded, previewWindowType, popupRef, appIsReady, iframeRef, setIframeHasLoaded, fieldSchemaJSON, mostRecentUpdate, locale];
|
|
72
|
+
$[10] = appIsReady;
|
|
73
|
+
$[11] = fieldSchemaJSON;
|
|
74
|
+
$[12] = fields;
|
|
75
|
+
$[13] = iframeHasLoaded;
|
|
76
|
+
$[14] = iframeRef;
|
|
77
|
+
$[15] = locale;
|
|
78
|
+
$[16] = mostRecentUpdate;
|
|
79
|
+
$[17] = popupRef;
|
|
80
|
+
$[18] = previewWindowType;
|
|
81
|
+
$[19] = setIframeHasLoaded;
|
|
82
|
+
$[20] = url;
|
|
83
|
+
$[21] = t1;
|
|
80
84
|
} else {
|
|
81
|
-
t1 = $[
|
|
85
|
+
t1 = $[21];
|
|
82
86
|
}
|
|
83
87
|
useEffect(t0, t1);
|
|
84
88
|
let t2;
|
|
85
|
-
if ($[
|
|
89
|
+
if ($[22] !== iframeRef || $[23] !== popupRef || $[24] !== previewWindowType || $[25] !== url) {
|
|
86
90
|
t2 = () => {
|
|
87
91
|
const message_0 = {
|
|
88
92
|
type: "payload-document-event"
|
|
@@ -94,40 +98,40 @@ export const LivePreview = props => {
|
|
|
94
98
|
iframeRef.current.contentWindow?.postMessage(message_0, url);
|
|
95
99
|
}
|
|
96
100
|
};
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
101
|
+
$[22] = iframeRef;
|
|
102
|
+
$[23] = popupRef;
|
|
103
|
+
$[24] = previewWindowType;
|
|
104
|
+
$[25] = url;
|
|
105
|
+
$[26] = t2;
|
|
102
106
|
} else {
|
|
103
|
-
t2 = $[
|
|
107
|
+
t2 = $[26];
|
|
104
108
|
}
|
|
105
109
|
let t3;
|
|
106
|
-
if ($[
|
|
110
|
+
if ($[27] !== iframeRef || $[28] !== mostRecentUpdate || $[29] !== popupRef || $[30] !== previewWindowType || $[31] !== url) {
|
|
107
111
|
t3 = [mostRecentUpdate, iframeRef, popupRef, previewWindowType, url];
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
112
|
+
$[27] = iframeRef;
|
|
113
|
+
$[28] = mostRecentUpdate;
|
|
114
|
+
$[29] = popupRef;
|
|
115
|
+
$[30] = previewWindowType;
|
|
116
|
+
$[31] = url;
|
|
117
|
+
$[32] = t3;
|
|
114
118
|
} else {
|
|
115
|
-
t3 = $[
|
|
119
|
+
t3 = $[32];
|
|
116
120
|
}
|
|
117
121
|
useEffect(t2, t3);
|
|
118
122
|
if (previewWindowType === "iframe") {
|
|
119
123
|
const t4 = breakpoint && breakpoint !== "responsive" && `${baseClass}--has-breakpoint`;
|
|
120
124
|
let t5;
|
|
121
|
-
if ($[
|
|
125
|
+
if ($[33] !== t4) {
|
|
122
126
|
t5 = [baseClass, t4].filter(Boolean);
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
127
|
+
$[33] = t4;
|
|
128
|
+
$[34] = t5;
|
|
125
129
|
} else {
|
|
126
|
-
t5 = $[
|
|
130
|
+
t5 = $[34];
|
|
127
131
|
}
|
|
128
132
|
const t6 = t5.join(" ");
|
|
129
133
|
let t7;
|
|
130
|
-
if ($[
|
|
134
|
+
if ($[35] !== iframeRef || $[36] !== props || $[37] !== setIframeHasLoaded || $[38] !== t6 || $[39] !== url) {
|
|
131
135
|
t7 = _jsx("div", {
|
|
132
136
|
className: t6,
|
|
133
137
|
children: _jsxs("div", {
|
|
@@ -148,14 +152,14 @@ export const LivePreview = props => {
|
|
|
148
152
|
})]
|
|
149
153
|
})
|
|
150
154
|
});
|
|
151
|
-
$[33] = props;
|
|
152
|
-
$[34] = url;
|
|
153
155
|
$[35] = iframeRef;
|
|
154
|
-
$[36] =
|
|
155
|
-
$[37] =
|
|
156
|
-
$[38] =
|
|
156
|
+
$[36] = props;
|
|
157
|
+
$[37] = setIframeHasLoaded;
|
|
158
|
+
$[38] = t6;
|
|
159
|
+
$[39] = url;
|
|
160
|
+
$[40] = t7;
|
|
157
161
|
} else {
|
|
158
|
-
t7 = $[
|
|
162
|
+
t7 = $[40];
|
|
159
163
|
}
|
|
160
164
|
return t7;
|
|
161
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useAllFormFields","useDocumentEvents","reduceFieldsToValues","React","useEffect","useLivePreviewContext","DeviceContainer","IFrame","LivePreviewToolbar","baseClass","LivePreview","props","$","appIsReady","iframeHasLoaded","iframeRef","popupRef","previewWindowType","setIframeHasLoaded","url","mostRecentUpdate","breakpoint","fieldSchemaJSON","prevWindowType","useRef","undefined","fields","t0","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useAllFormFields","useDocumentEvents","useLocale","reduceFieldsToValues","React","useEffect","useLivePreviewContext","DeviceContainer","IFrame","LivePreviewToolbar","baseClass","LivePreview","props","$","appIsReady","iframeHasLoaded","iframeRef","popupRef","previewWindowType","setIframeHasLoaded","url","locale","mostRecentUpdate","breakpoint","fieldSchemaJSON","prevWindowType","useRef","undefined","fields","t0","window","values","shouldSendSchema","current","message","type","data","externallyUpdatedRelationship","code","postMessage","contentWindow","t1","t2","message_0","t3","t4","t5","filter","Boolean","t6","join","t7","_jsx","className","children","_jsxs","ref","height"],"sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload'\n\nimport { ShimmerEffect, useAllFormFields, useDocumentEvents, useLocale } from '@payloadcms/ui'\nimport { reduceFieldsToValues } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\nimport { DeviceContainer } from '../Device/index.js'\nimport { IFrame } from '../IFrame/index.js'\nimport { LivePreviewToolbar } from '../Toolbar/index.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-window'\n\nexport const LivePreview: React.FC<EditViewProps> = (props) => {\n const {\n appIsReady,\n iframeHasLoaded,\n iframeRef,\n popupRef,\n previewWindowType,\n setIframeHasLoaded,\n url,\n } = useLivePreviewContext()\n\n const locale = useLocale()\n\n const { mostRecentUpdate } = useDocumentEvents()\n\n const { breakpoint, fieldSchemaJSON } = useLivePreviewContext()\n\n const prevWindowType =\n React.useRef<ReturnType<typeof useLivePreviewContext>['previewWindowType']>(undefined)\n\n const [fields] = useAllFormFields()\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 // For performance, do no reduce fields to values until after the iframe or popup has loaded\n if (fields && window && 'postMessage' in window && appIsReady) {\n const values = reduceFieldsToValues(fields, true)\n\n // To reduce on large `postMessage` payloads, only send `fieldSchemaToJSON` one time\n // To do this, the underlying JS function maintains a cache of this value\n // So we need to send it through each time the window type changes\n // But only once per window type change, not on every render, because this is a potentially large obj\n const shouldSendSchema =\n !prevWindowType.current || prevWindowType.current !== previewWindowType\n\n prevWindowType.current = previewWindowType\n\n const message = {\n type: 'payload-live-preview',\n data: values,\n externallyUpdatedRelationship: mostRecentUpdate,\n fieldSchemaJSON: shouldSendSchema ? fieldSchemaJSON : undefined,\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 fields,\n url,\n iframeHasLoaded,\n previewWindowType,\n popupRef,\n appIsReady,\n iframeRef,\n setIframeHasLoaded,\n fieldSchemaJSON,\n mostRecentUpdate,\n locale,\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 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])\n\n if (previewWindowType === 'iframe') {\n return (\n <div\n className={[\n baseClass,\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;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ;AAC9E,SAASC,oBAAoB,QAAQ;AACrC,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAEjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,MAAM,QAAQ;AACvB,SAASC,kBAAkB,QAAQ;AAGnC,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,WAAA,GAAuCC,KAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAClD;IAAAgB,UAAA;IAAAC,eAAA;IAAAC,SAAA;IAAAC,QAAA;IAAAC,iBAAA;IAAAC,kBAAA;IAAAC;EAAA,I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AA,IAAcA,UAAA,KAAe,gBAAgB,GAAAb,SAAA,kBAA8B;IAAA,IAAAoC,EAAA;IAAA,IAAAjC,CAAA,SAAAgC,EAAA;MAFlEC,EAAA,IAAApC,SAAA,EAETmC,EAA2E,EAAAE,MAAA,CAAAC,OAEnE;MAAAnC,CAAA,OAAAgC,EAAA;MAAAhC,CAAA,OAAAiC,EAAA;IAAA;MAAAA,EAAA,GAAAjC,CAAA;IAAA;IAJC,MAAAoC,EAAA,GAAAH,EAID,CAAAI,IAAA,CACF;IAAA,IAAAC,EAAA;IAAA,IAAAtC,CAAA,SAAAG,SAAA,IAAAH,CAAA,SAAAD,KAAA,IAAAC,CAAA,SAAAM,kBAAA,IAAAN,CAAA,SAAAoC,EAAA,IAAApC,CAAA,SAAAO,GAAA;MANV+B,EAAA,GAAAC,IAAA,CAAC;QAAAC,SAAA,EACYJ,EAKH;QAAAK,QAAA,EAERC,KAAA,CAAC;UAAAF,SAAA,EAAe,GAAA3C,SAAA,WAAuB;UAAA4C,QAAA,GACrCF,IAAA,CAAA3C,kBAAA;YAAA,GAAwBG;UAAK,C,GAC7BwC,IAAA,CAAC;YAAAC,SAAA,EAAe,GAAA3C,SAAA,QAAoB;YAAA4C,QAAA,EAClCF,IAAA,CAAA7C,eAAA;cAAA+C,QAAA,EACGlC,GAAA,GACCgC,IAAA,CAAA5C,MAAA;gBAAAgD,GAAA,EAAaxC,SAAA;gBAAAG,kBAAA;gBAAAC;cAAA,C,IAEbgC,IAAA,CAAArD,aAAA;gBAAA0D,MAAA,EAAsB;cAAA,C;;;;;;;;;;;;;;WAfhCN,E;;CAuBN","ignoreList":[]}
|
|
@@ -23,13 +23,13 @@ export const ToolbarControls = () => {
|
|
|
23
23
|
t
|
|
24
24
|
} = useTranslation();
|
|
25
25
|
let t0;
|
|
26
|
-
if ($[0] !==
|
|
26
|
+
if ($[0] !== breakpoint || $[1] !== breakpoints || $[2] !== setBreakpoint || $[3] !== setPreviewWindowType || $[4] !== setZoom || $[5] !== t || $[6] !== url || $[7] !== zoom) {
|
|
27
27
|
const customOption = {
|
|
28
28
|
label: t("general:custom"),
|
|
29
29
|
value: "custom"
|
|
30
30
|
};
|
|
31
31
|
let t2;
|
|
32
|
-
if ($[9] !==
|
|
32
|
+
if ($[9] !== setZoom || $[10] !== zoom) {
|
|
33
33
|
t2 = t3 => {
|
|
34
34
|
const {
|
|
35
35
|
close: close_0
|
|
@@ -47,8 +47,8 @@ export const ToolbarControls = () => {
|
|
|
47
47
|
})
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
$[9] =
|
|
51
|
-
$[10] =
|
|
50
|
+
$[9] = setZoom;
|
|
51
|
+
$[10] = zoom;
|
|
52
52
|
$[11] = t2;
|
|
53
53
|
} else {
|
|
54
54
|
t2 = $[11];
|
|
@@ -133,14 +133,14 @@ export const ToolbarControls = () => {
|
|
|
133
133
|
children: _jsx(LinkIcon, {})
|
|
134
134
|
})]
|
|
135
135
|
});
|
|
136
|
-
$[0] =
|
|
136
|
+
$[0] = breakpoint;
|
|
137
137
|
$[1] = breakpoints;
|
|
138
|
-
$[2] =
|
|
139
|
-
$[3] =
|
|
140
|
-
$[4] =
|
|
141
|
-
$[5] =
|
|
142
|
-
$[6] =
|
|
143
|
-
$[7] =
|
|
138
|
+
$[2] = setBreakpoint;
|
|
139
|
+
$[3] = setPreviewWindowType;
|
|
140
|
+
$[4] = setZoom;
|
|
141
|
+
$[5] = t;
|
|
142
|
+
$[6] = url;
|
|
143
|
+
$[7] = zoom;
|
|
144
144
|
$[8] = t0;
|
|
145
145
|
} else {
|
|
146
146
|
t0 = $[8];
|