@payloadcms/ui 3.0.0-beta.66 → 3.0.0-beta.67
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/Autosave/index.d.ts.map +1 -1
- package/dist/elements/Autosave/index.js +4 -1
- package/dist/elements/Autosave/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +0 -6
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/EditUpload/index.d.ts +3 -6
- package/dist/elements/EditUpload/index.d.ts.map +1 -1
- package/dist/elements/EditUpload/index.js +20 -25
- package/dist/elements/EditUpload/index.js.map +1 -1
- package/dist/elements/Localizer/index.d.ts.map +1 -1
- package/dist/elements/Localizer/index.js +6 -13
- package/dist/elements/Localizer/index.js.map +1 -1
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/Upload/index.js +12 -27
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +6 -6
- package/dist/exports/client/index.js.map +4 -4
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +5 -15
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js +33 -1
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/UploadEdits/index.d.ts +12 -0
- package/dist/providers/UploadEdits/index.d.ts.map +1 -0
- package/dist/providers/UploadEdits/index.js +30 -0
- package/dist/providers/UploadEdits/index.js.map +1 -0
- package/dist/utilities/buildFormState.js +2 -2
- package/dist/utilities/buildFormState.js.map +1 -1
- package/package.json +5 -5
- package/dist/providers/FormQueryParams/index.d.ts +0 -13
- package/dist/providers/FormQueryParams/index.d.ts.map +0 -1
- package/dist/providers/FormQueryParams/index.js +0 -53
- package/dist/providers/FormQueryParams/index.js.map +0 -1
- package/dist/providers/FormQueryParams/types.d.ts +0 -16
- package/dist/providers/FormQueryParams/types.d.ts.map +0 -1
- package/dist/providers/FormQueryParams/types.js +0 -3
- package/dist/providers/FormQueryParams/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/ui",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.67",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"sonner": "^1.5.0",
|
|
104
104
|
"use-context-selector": "2.0.0",
|
|
105
105
|
"uuid": "10.0.0",
|
|
106
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
106
|
+
"@payloadcms/translations": "3.0.0-beta.67"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@babel/cli": "^7.24.5",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"babel-plugin-react-compiler": "0.0.0-experimental-592953e-20240517",
|
|
121
121
|
"esbuild": "0.23.0",
|
|
122
122
|
"esbuild-sass-plugin": "3.3.1",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
123
|
+
"payload": "3.0.0-beta.67",
|
|
124
|
+
"@payloadcms/eslint-config": "3.0.0-beta.59"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
127
|
"next": "^15.0.0-canary.53",
|
|
128
128
|
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
129
129
|
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
130
|
-
"payload": "3.0.0-beta.
|
|
130
|
+
"payload": "3.0.0-beta.67"
|
|
131
131
|
},
|
|
132
132
|
"engines": {
|
|
133
133
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Action, FormQueryParamsContext, State } from './types.js';
|
|
3
|
-
export type * from './types.js';
|
|
4
|
-
export declare const FormQueryParams: React.Context<FormQueryParamsContext>;
|
|
5
|
-
export declare const FormQueryParamsProvider: React.FC<{
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
initialParams?: State;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const useFormQueryParams: () => {
|
|
10
|
-
dispatchFormQueryParams: React.Dispatch<Action>;
|
|
11
|
-
formQueryParams: State;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/FormQueryParams/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAIvE,mBAAmB,YAAY,CAAA;AAE/B,eAAO,MAAM,eAAe,uCAA8C,CAAA;AAE1E,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAgDA,CAAA;AAED,eAAO,MAAM,kBAAkB,QAAO;IACpC,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC/C,eAAe,EAAE,KAAK,CAAA;CACQ,CAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import React, { createContext, useContext } from 'react';
|
|
4
|
-
import { useLocale } from '../Locale/index.js';
|
|
5
|
-
export const FormQueryParams = /*#__PURE__*/ createContext({});
|
|
6
|
-
export const FormQueryParamsProvider = ({ children, initialParams: formQueryParamsFromProps })=>{
|
|
7
|
-
const [formQueryParams, dispatchFormQueryParams] = React.useReducer((state, action)=>{
|
|
8
|
-
const newState = {
|
|
9
|
-
...state
|
|
10
|
-
};
|
|
11
|
-
switch(action.type){
|
|
12
|
-
case 'SET':
|
|
13
|
-
if (action.params?.uploadEdits === null && newState?.uploadEdits) {
|
|
14
|
-
delete newState.uploadEdits;
|
|
15
|
-
}
|
|
16
|
-
if (action.params?.uploadEdits?.crop === null && newState?.uploadEdits?.crop) {
|
|
17
|
-
delete newState.uploadEdits.crop;
|
|
18
|
-
}
|
|
19
|
-
if (action.params?.uploadEdits?.focalPoint === null && newState?.uploadEdits?.focalPoint) {
|
|
20
|
-
delete newState.uploadEdits.focalPoint;
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
...newState,
|
|
24
|
-
...action.params
|
|
25
|
-
};
|
|
26
|
-
default:
|
|
27
|
-
return state;
|
|
28
|
-
}
|
|
29
|
-
}, formQueryParamsFromProps || {});
|
|
30
|
-
const locale = useLocale();
|
|
31
|
-
React.useEffect(()=>{
|
|
32
|
-
if (locale?.code) {
|
|
33
|
-
dispatchFormQueryParams({
|
|
34
|
-
type: 'SET',
|
|
35
|
-
params: {
|
|
36
|
-
locale: locale.code
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}, [
|
|
41
|
-
locale.code
|
|
42
|
-
]);
|
|
43
|
-
return /*#__PURE__*/ _jsx(FormQueryParams.Provider, {
|
|
44
|
-
value: {
|
|
45
|
-
dispatchFormQueryParams,
|
|
46
|
-
formQueryParams
|
|
47
|
-
},
|
|
48
|
-
children: children
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export const useFormQueryParams = ()=>useContext(FormQueryParams);
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/providers/FormQueryParams/index.tsx"],"sourcesContent":["'use client'\n\nimport React, { createContext, useContext } from 'react'\n\nimport type { Action, FormQueryParamsContext, State } from './types.js'\n\nimport { useLocale } from '../Locale/index.js'\n\nexport type * from './types.js'\n\nexport const FormQueryParams = createContext({} as FormQueryParamsContext)\n\nexport const FormQueryParamsProvider: React.FC<{\n children: React.ReactNode\n initialParams?: State\n}> = ({ children, initialParams: formQueryParamsFromProps }) => {\n const [formQueryParams, dispatchFormQueryParams] = React.useReducer(\n (state: State, action: Action) => {\n const newState = { ...state }\n\n switch (action.type) {\n case 'SET':\n if (action.params?.uploadEdits === null && newState?.uploadEdits) {\n delete newState.uploadEdits\n }\n if (action.params?.uploadEdits?.crop === null && newState?.uploadEdits?.crop) {\n delete newState.uploadEdits.crop\n }\n if (\n action.params?.uploadEdits?.focalPoint === null &&\n newState?.uploadEdits?.focalPoint\n ) {\n delete newState.uploadEdits.focalPoint\n }\n return {\n ...newState,\n ...action.params,\n }\n default:\n return state\n }\n },\n formQueryParamsFromProps || ({} as State),\n )\n\n const locale = useLocale()\n\n React.useEffect(() => {\n if (locale?.code) {\n dispatchFormQueryParams({\n type: 'SET',\n params: {\n locale: locale.code,\n },\n })\n }\n }, [locale.code])\n\n return (\n <FormQueryParams.Provider value={{ dispatchFormQueryParams, formQueryParams }}>\n {children}\n </FormQueryParams.Provider>\n )\n}\n\nexport const useFormQueryParams = (): {\n dispatchFormQueryParams: React.Dispatch<Action>\n formQueryParams: State\n} => useContext(FormQueryParams)\n"],"names":["React","createContext","useContext","useLocale","FormQueryParams","FormQueryParamsProvider","children","initialParams","formQueryParamsFromProps","formQueryParams","dispatchFormQueryParams","useReducer","state","action","newState","type","params","uploadEdits","crop","focalPoint","locale","useEffect","code","Provider","value","useFormQueryParams"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,aAAa,EAAEC,UAAU,QAAQ,QAAO;AAIxD,SAASC,SAAS,QAAQ,qBAAoB;AAI9C,OAAO,MAAMC,gCAAkBH,cAAc,CAAC,GAA4B;AAE1E,OAAO,MAAMI,0BAGR,CAAC,EAAEC,QAAQ,EAAEC,eAAeC,wBAAwB,EAAE;IACzD,MAAM,CAACC,iBAAiBC,wBAAwB,GAAGV,MAAMW,UAAU,CACjE,CAACC,OAAcC;QACb,MAAMC,WAAW;YAAE,GAAGF,KAAK;QAAC;QAE5B,OAAQC,OAAOE,IAAI;YACjB,KAAK;gBACH,IAAIF,OAAOG,MAAM,EAAEC,gBAAgB,QAAQH,UAAUG,aAAa;oBAChE,OAAOH,SAASG,WAAW;gBAC7B;gBACA,IAAIJ,OAAOG,MAAM,EAAEC,aAAaC,SAAS,QAAQJ,UAAUG,aAAaC,MAAM;oBAC5E,OAAOJ,SAASG,WAAW,CAACC,IAAI;gBAClC;gBACA,IACEL,OAAOG,MAAM,EAAEC,aAAaE,eAAe,QAC3CL,UAAUG,aAAaE,YACvB;oBACA,OAAOL,SAASG,WAAW,CAACE,UAAU;gBACxC;gBACA,OAAO;oBACL,GAAGL,QAAQ;oBACX,GAAGD,OAAOG,MAAM;gBAClB;YACF;gBACE,OAAOJ;QACX;IACF,GACAJ,4BAA6B,CAAC;IAGhC,MAAMY,SAASjB;IAEfH,MAAMqB,SAAS,CAAC;QACd,IAAID,QAAQE,MAAM;YAChBZ,wBAAwB;gBACtBK,MAAM;gBACNC,QAAQ;oBACNI,QAAQA,OAAOE,IAAI;gBACrB;YACF;QACF;IACF,GAAG;QAACF,OAAOE,IAAI;KAAC;IAEhB,qBACE,KAAClB,gBAAgBmB,QAAQ;QAACC,OAAO;YAAEd;YAAyBD;QAAgB;kBACzEH;;AAGP,EAAC;AAED,OAAO,MAAMmB,qBAAqB,IAG7BvB,WAAWE,iBAAgB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { UploadEdits } from 'payload';
|
|
2
|
-
export type FormQueryParamsContext = {
|
|
3
|
-
dispatchFormQueryParams: (action: Action) => void;
|
|
4
|
-
formQueryParams: State;
|
|
5
|
-
};
|
|
6
|
-
export type State = {
|
|
7
|
-
depth: number;
|
|
8
|
-
'fallback-locale': string;
|
|
9
|
-
locale: string;
|
|
10
|
-
uploadEdits?: UploadEdits;
|
|
11
|
-
};
|
|
12
|
-
export type Action = {
|
|
13
|
-
params: Partial<State>;
|
|
14
|
-
type: 'SET';
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/FormQueryParams/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,MAAM,sBAAsB,GAAG;IACnC,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,eAAe,EAAE,KAAK,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACtB,IAAI,EAAE,KAAK,CAAA;CACZ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/providers/FormQueryParams/types.ts"],"sourcesContent":["import type { UploadEdits } from 'payload'\n\nexport type FormQueryParamsContext = {\n dispatchFormQueryParams: (action: Action) => void\n formQueryParams: State\n}\n\nexport type State = {\n depth: number\n 'fallback-locale': string\n locale: string\n uploadEdits?: UploadEdits\n}\n\nexport type Action = {\n params: Partial<State>\n type: 'SET'\n}\n"],"names":[],"mappings":"AAcA,WAGC"}
|