@payloadcms/ui 3.2.2-canary.6fb5cd8 → 3.2.2-canary.a11698b
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/AnimateHeight/index.d.ts.map +1 -1
- package/dist/elements/AnimateHeight/index.js +2 -0
- package/dist/elements/AnimateHeight/index.js.map +1 -1
- package/dist/elements/AnimateHeight/usePatchAnimateHeight.d.ts.map +1 -1
- package/dist/elements/AnimateHeight/usePatchAnimateHeight.js +80 -44
- package/dist/elements/AnimateHeight/usePatchAnimateHeight.js.map +1 -1
- package/dist/elements/Button/types.d.ts +8 -0
- package/dist/elements/Button/types.d.ts.map +1 -1
- package/dist/elements/Button/types.js.map +1 -1
- package/dist/elements/DocumentDrawer/Provider.d.ts +2 -2
- package/dist/elements/DocumentDrawer/Provider.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/Provider.js.map +1 -1
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +3 -3
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +11 -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.map +1 -1
- package/dist/forms/Form/types.d.ts +1 -1
- package/dist/forms/Form/types.d.ts.map +1 -1
- package/dist/forms/Form/types.js.map +1 -1
- package/dist/forms/Submit/index.d.ts.map +1 -1
- package/dist/forms/Submit/index.js +6 -4
- package/dist/forms/Submit/index.js.map +1 -1
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +5 -6
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/providers/SearchParams/index.d.ts +2 -0
- package/dist/providers/SearchParams/index.d.ts.map +1 -1
- package/dist/providers/SearchParams/index.js +24 -28
- package/dist/providers/SearchParams/index.js.map +1 -1
- package/dist/utilities/buildFormState.d.ts +6 -5
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/views/Edit/index.d.ts +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +76 -51
- package/dist/views/Edit/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/AnimateHeight/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/AnimateHeight/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAGhD,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAqFA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useEffect","useRef","usePatchAnimateHeight","AnimateHeight","id","children","className","duration","height","open","setOpen","useState","Boolean","prevIsOpen","childrenDisplay","setChildrenDisplay","parentOverflow","setParentOverflow","isAnimating","setIsAnimating","displayTimer","overflowTimer","newIsOpen","hasChanged","current","window","setTimeout","clearTimeout","containerRef","_jsx","filter","join","ref","style","overflow","transition","display"],"sources":["../../../src/elements/AnimateHeight/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useEffect","useRef","usePatchAnimateHeight","AnimateHeight","id","children","className","duration","height","open","setOpen","useState","Boolean","prevIsOpen","childrenDisplay","setChildrenDisplay","parentOverflow","setParentOverflow","isAnimating","setIsAnimating","displayTimer","overflowTimer","newIsOpen","hasChanged","current","window","setTimeout","clearTimeout","containerRef","_jsx","filter","join","ref","style","overflow","transition","display"],"sources":["../../../src/elements/AnimateHeight/index.tsx"],"sourcesContent":["'use client'\nimport React, { useEffect, useRef } from 'react'\n\nimport { usePatchAnimateHeight } from './usePatchAnimateHeight.js'\nimport './index.scss'\n\nexport const AnimateHeight: React.FC<{\n children: React.ReactNode\n className?: string\n duration?: number\n height?: 'auto' | number\n id?: string\n}> = ({ id, children, className, duration = 300, height }) => {\n const [open, setOpen] = React.useState(() => Boolean(height))\n const prevIsOpen = useRef(open)\n\n const [childrenDisplay, setChildrenDisplay] = React.useState<CSSStyleDeclaration['display']>(\n () => (open ? '' : 'none'),\n )\n\n const [parentOverflow, setParentOverflow] = React.useState<CSSStyleDeclaration['overflow']>(() =>\n open ? '' : 'hidden',\n )\n\n const [isAnimating, setIsAnimating] = React.useState(false)\n\n useEffect(() => {\n let displayTimer: number\n let overflowTimer: number\n\n const newIsOpen = Boolean(height)\n const hasChanged = prevIsOpen.current !== newIsOpen\n prevIsOpen.current = newIsOpen\n\n if (hasChanged) {\n setIsAnimating(true)\n setParentOverflow('hidden')\n\n if (newIsOpen) {\n setChildrenDisplay('')\n } else {\n // `display: none` once closed\n displayTimer = window.setTimeout(() => {\n setChildrenDisplay('none')\n }, duration)\n }\n\n setOpen(newIsOpen)\n\n // reset overflow once open\n overflowTimer = window.setTimeout(() => {\n setParentOverflow('')\n setIsAnimating(false)\n }, duration)\n }\n\n return () => {\n if (displayTimer) {\n clearTimeout(displayTimer)\n }\n\n if (overflowTimer) {\n clearTimeout(overflowTimer)\n }\n }\n }, [height, duration])\n\n const containerRef = useRef<HTMLDivElement>(null)\n\n usePatchAnimateHeight({\n containerRef,\n duration,\n open,\n })\n\n return (\n <div\n aria-hidden={!open}\n className={[\n className,\n 'rah-static',\n open && height === 'auto' && 'rah-static--height-auto',\n isAnimating && `rah-animating--${open ? 'down' : 'up'}`,\n isAnimating && height === 'auto' && `rah-animating--to-height-auto`,\n ]\n .filter(Boolean)\n .join(' ')}\n id={id}\n ref={containerRef}\n style={{\n overflow: parentOverflow,\n transition: `height ${duration}ms ease`,\n }}\n >\n <div {...(childrenDisplay ? { style: { display: childrenDisplay } } : {})}>{children}</div>\n </div>\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,IAASC,SAAS,EAAEC,MAAM,QAAQ;AAEzC,SAASC,qBAAqB,QAAQ;AACtC,OAAO;AAEP,OAAO,MAAMC,aAAA,GAMRA,CAAC;EAAEC,EAAE;EAAEC,QAAQ;EAAEC,SAAS;EAAEC,QAAA,GAAW,GAAG;EAAEC;AAAM,CAAE;EACvD,MAAM,CAACC,IAAA,EAAMC,OAAA,CAAQ,GAAGX,KAAA,CAAMY,QAAQ,CAAC,MAAMC,OAAA,CAAQJ,MAAA;EACrD,MAAMK,UAAA,GAAaZ,MAAA,CAAOQ,IAAA;EAE1B,MAAM,CAACK,eAAA,EAAiBC,kBAAA,CAAmB,GAAGhB,KAAA,CAAMY,QAAQ,CAC1D,MAAOF,IAAA,GAAO,KAAK;EAGrB,MAAM,CAACO,cAAA,EAAgBC,iBAAA,CAAkB,GAAGlB,KAAA,CAAMY,QAAQ,CAAkC,MAC1FF,IAAA,GAAO,KAAK;EAGd,MAAM,CAACS,WAAA,EAAaC,cAAA,CAAe,GAAGpB,KAAA,CAAMY,QAAQ,CAAC;EAErDX,SAAA,CAAU;IACR,IAAIoB,YAAA;IACJ,IAAIC,aAAA;IAEJ,MAAMC,SAAA,GAAYV,OAAA,CAAQJ,MAAA;IAC1B,MAAMe,UAAA,GAAaV,UAAA,CAAWW,OAAO,KAAKF,SAAA;IAC1CT,UAAA,CAAWW,OAAO,GAAGF,SAAA;IAErB,IAAIC,UAAA,EAAY;MACdJ,cAAA,CAAe;MACfF,iBAAA,CAAkB;MAElB,IAAIK,SAAA,EAAW;QACbP,kBAAA,CAAmB;MACrB,OAAO;QACL;QACAK,YAAA,GAAeK,MAAA,CAAOC,UAAU,CAAC;UAC/BX,kBAAA,CAAmB;QACrB,GAAGR,QAAA;MACL;MAEAG,OAAA,CAAQY,SAAA;MAER;MACAD,aAAA,GAAgBI,MAAA,CAAOC,UAAU,CAAC;QAChCT,iBAAA,CAAkB;QAClBE,cAAA,CAAe;MACjB,GAAGZ,QAAA;IACL;IAEA,OAAO;MACL,IAAIa,YAAA,EAAc;QAChBO,YAAA,CAAaP,YAAA;MACf;MAEA,IAAIC,aAAA,EAAe;QACjBM,YAAA,CAAaN,aAAA;MACf;IACF;EACF,GAAG,CAACb,MAAA,EAAQD,QAAA,CAAS;EAErB,MAAMqB,YAAA,GAAe3B,MAAA,CAAuB;EAE5CC,qBAAA,CAAsB;IACpB0B,YAAA;IACArB,QAAA;IACAE;EACF;EAEA,oBACEoB,IAAA,CAAC;IACC,eAAa,CAACpB,IAAA;IACdH,SAAA,EAAW,CACTA,SAAA,EACA,cACAG,IAAA,IAAQD,MAAA,KAAW,UAAU,2BAC7BU,WAAA,IAAe,kBAAkBT,IAAA,GAAO,SAAS,MAAM,EACvDS,WAAA,IAAeV,MAAA,KAAW,UAAU,+BAA+B,CACpE,CACEsB,MAAM,CAAClB,OAAA,EACPmB,IAAI,CAAC;IACR3B,EAAA,EAAIA,EAAA;IACJ4B,GAAA,EAAKJ,YAAA;IACLK,KAAA,EAAO;MACLC,QAAA,EAAUlB,cAAA;MACVmB,UAAA,EAAY,UAAU5B,QAAA;IACxB;cAEA,aAAAsB,IAAA,CAAC;MAAK,IAAIf,eAAA,GAAkB;QAAEmB,KAAA,EAAO;UAAEG,OAAA,EAAStB;QAAgB;MAAE,IAAI,CAAC,CAAC;gBAAIT;;;AAGlF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePatchAnimateHeight.d.ts","sourceRoot":"","sources":["../../../src/elements/AnimateHeight/usePatchAnimateHeight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePatchAnimateHeight.d.ts","sourceRoot":"","sources":["../../../src/elements/AnimateHeight/usePatchAnimateHeight.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,sCAI/B;IACD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IAC7C,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,OAAO,CAAA;CACd,KAAG;IAAE,+BAA+B,EAAE,OAAO,CAAA;CA0D7C,CAAA"}
|
|
@@ -1,49 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
export const usePatchAnimateHeight =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export const usePatchAnimateHeight = t0 => {
|
|
6
|
+
const $ = _c(10);
|
|
7
|
+
const {
|
|
8
|
+
containerRef,
|
|
9
|
+
duration,
|
|
10
|
+
open
|
|
11
|
+
} = t0;
|
|
12
|
+
let t1;
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
15
|
+
t2 = typeof CSS !== "undefined" && CSS && CSS.supports ? Boolean(CSS.supports("interpolate-size", "allow-keywords")) : false;
|
|
16
|
+
$[0] = t2;
|
|
17
|
+
} else {
|
|
18
|
+
t2 = $[0];
|
|
19
|
+
}
|
|
20
|
+
t1 = t2;
|
|
21
|
+
const browserSupportsKeywordAnimation = t1;
|
|
8
22
|
const previousOpenState = useRef(open);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const maxContentHeight = getTotalHeight(container);
|
|
20
|
-
// Set initial state
|
|
21
|
-
if (previousOpenState.current !== open) {
|
|
22
|
-
container.style.height = open ? '0px' : `${maxContentHeight}px`;
|
|
23
|
-
}
|
|
24
|
-
// Trigger reflow
|
|
25
|
-
container.offsetHeight // eslint-disable-line @typescript-eslint/no-unused-expressions
|
|
26
|
-
;
|
|
27
|
-
// Start animation
|
|
28
|
-
container.style.transition = `height ${duration}ms ease`;
|
|
29
|
-
container.style.height = open ? `${maxContentHeight}px` : '0px';
|
|
30
|
-
const transitionEndHandler = () => {
|
|
31
|
-
container.style.transition = '';
|
|
32
|
-
container.style.height = !open ? '0px' : 'auto';
|
|
33
|
-
container.removeEventListener('transitionend', transitionEndHandler);
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[1] !== containerRef.current || $[2] !== open || $[3] !== duration) {
|
|
25
|
+
t3 = () => {
|
|
26
|
+
if (containerRef.current && !browserSupportsKeywordAnimation) {
|
|
27
|
+
const container = containerRef.current;
|
|
28
|
+
const getTotalHeight = el => {
|
|
29
|
+
const styles = window.getComputedStyle(el);
|
|
30
|
+
const marginTop = parseFloat(styles.marginTop);
|
|
31
|
+
const marginBottom = parseFloat(styles.marginBottom);
|
|
32
|
+
return el.scrollHeight + marginTop + marginBottom;
|
|
34
33
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
const animate = () => {
|
|
35
|
+
const maxContentHeight = getTotalHeight(container);
|
|
36
|
+
if (previousOpenState.current !== open) {
|
|
37
|
+
container.style.height = open ? "0px" : `${maxContentHeight}px`;
|
|
38
|
+
}
|
|
39
|
+
container.style.transition = `height ${duration}ms ease`;
|
|
40
|
+
container.style.height = open ? `${maxContentHeight}px` : "0px";
|
|
41
|
+
const transitionEndHandler = () => {
|
|
42
|
+
container.style.transition = "";
|
|
43
|
+
container.style.height = !open ? "0px" : "auto";
|
|
44
|
+
container.removeEventListener("transitionend", transitionEndHandler);
|
|
45
|
+
};
|
|
46
|
+
container.addEventListener("transitionend", transitionEndHandler);
|
|
47
|
+
};
|
|
48
|
+
animate();
|
|
49
|
+
previousOpenState.current = open;
|
|
50
|
+
return () => {
|
|
51
|
+
container.style.transition = "";
|
|
52
|
+
container.style.height = "";
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
$[1] = containerRef.current;
|
|
57
|
+
$[2] = open;
|
|
58
|
+
$[3] = duration;
|
|
59
|
+
$[4] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t3 = $[4];
|
|
62
|
+
}
|
|
63
|
+
let t4;
|
|
64
|
+
if ($[5] !== open || $[6] !== duration || $[7] !== containerRef) {
|
|
65
|
+
t4 = [open, duration, containerRef, browserSupportsKeywordAnimation];
|
|
66
|
+
$[5] = open;
|
|
67
|
+
$[6] = duration;
|
|
68
|
+
$[7] = containerRef;
|
|
69
|
+
$[8] = t4;
|
|
70
|
+
} else {
|
|
71
|
+
t4 = $[8];
|
|
72
|
+
}
|
|
73
|
+
useEffect(t3, t4);
|
|
74
|
+
let t5;
|
|
75
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t5 = {
|
|
77
|
+
browserSupportsKeywordAnimation
|
|
78
|
+
};
|
|
79
|
+
$[9] = t5;
|
|
80
|
+
} else {
|
|
81
|
+
t5 = $[9];
|
|
82
|
+
}
|
|
83
|
+
return t5;
|
|
48
84
|
};
|
|
49
85
|
//# sourceMappingURL=usePatchAnimateHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePatchAnimateHeight.js","names":["useEffect","useMemo","useRef","usePatchAnimateHeight","containerRef","duration","open","
|
|
1
|
+
{"version":3,"file":"usePatchAnimateHeight.js","names":["c","_c","useEffect","useMemo","useRef","usePatchAnimateHeight","t0","$","containerRef","duration","open","t1","t2","Symbol","for","CSS","supports","Boolean","browserSupportsKeywordAnimation","previousOpenState","t3","current","container","getTotalHeight","el","styles","window","getComputedStyle","marginTop","parseFloat","marginBottom","scrollHeight","animate","maxContentHeight","style","height","transition","transitionEndHandler","removeEventListener","addEventListener","t4","t5"],"sources":["../../../src/elements/AnimateHeight/usePatchAnimateHeight.ts"],"sourcesContent":["'use client'\nimport { useEffect, useMemo, useRef } from 'react'\n\nexport const usePatchAnimateHeight = ({\n containerRef,\n duration,\n open,\n}: {\n containerRef: React.RefObject<HTMLDivElement>\n duration: number\n open: boolean\n}): { browserSupportsKeywordAnimation: boolean } => {\n const browserSupportsKeywordAnimation = useMemo(\n () =>\n typeof CSS !== 'undefined' && CSS && CSS.supports\n ? Boolean(CSS.supports('interpolate-size', 'allow-keywords'))\n : false,\n [],\n )\n\n const previousOpenState = useRef(open)\n\n useEffect(() => {\n if (containerRef.current && !browserSupportsKeywordAnimation) {\n const container = containerRef.current\n\n const getTotalHeight = (el: HTMLDivElement) => {\n const styles = window.getComputedStyle(el)\n const marginTop = parseFloat(styles.marginTop)\n const marginBottom = parseFloat(styles.marginBottom)\n return el.scrollHeight + marginTop + marginBottom\n }\n\n const animate = () => {\n const maxContentHeight = getTotalHeight(container)\n\n // Set initial state\n if (previousOpenState.current !== open) {\n container.style.height = open ? '0px' : `${maxContentHeight}px`\n }\n\n // Trigger reflow\n container.offsetHeight // eslint-disable-line @typescript-eslint/no-unused-expressions\n\n // Start animation\n container.style.transition = `height ${duration}ms ease`\n container.style.height = open ? `${maxContentHeight}px` : '0px'\n\n const transitionEndHandler = () => {\n container.style.transition = ''\n container.style.height = !open ? '0px' : 'auto'\n container.removeEventListener('transitionend', transitionEndHandler)\n }\n\n container.addEventListener('transitionend', transitionEndHandler)\n }\n\n animate()\n\n previousOpenState.current = open\n\n return () => {\n container.style.transition = ''\n container.style.height = ''\n }\n }\n }, [open, duration, containerRef, browserSupportsKeywordAnimation])\n\n return { browserSupportsKeywordAnimation }\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAE3C,OAA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,QAAAM,MAAA,CAAAC,GAAA;IAE3D2B,EAAA;MAAAvB;IAAA;IAAkCX,CAAA,MAAAkC,EAAA;EAAA;IAAAA,EAAA,GAAAlC,CAAA;EAAA;EAAA,OAAlCkC,EAAkC;AAAA,CAC3C","ignoreList":[]}
|
|
@@ -20,6 +20,14 @@ export type Props = {
|
|
|
20
20
|
newTab?: boolean;
|
|
21
21
|
onClick?: (event: MouseEvent) => void;
|
|
22
22
|
onMouseDown?: (event: MouseEvent) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Enables form submission via an onClick handler. This is only needed if
|
|
25
|
+
* type="submit" does not trigger form submission, e.g. if the button DOM
|
|
26
|
+
* element is not a direct child of the form element.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
programmaticSubmit?: boolean;
|
|
23
31
|
round?: boolean;
|
|
24
32
|
secondaryActions?: secondaryAction | secondaryAction[];
|
|
25
33
|
size?: 'large' | 'medium' | 'small';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;CACrC,CAAA;AACD,MAAM,MAAM,KAAK,GAAG;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAA;IAChG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,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QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAA;IACvE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/Button/types.ts"],"sourcesContent":["import type { ElementType, MouseEvent } from 'react'\nimport type React from 'react'\n\ntype secondaryAction = {\n label: string\n onClick: (event: MouseEvent) => void\n}\nexport type Props = {\n 'aria-label'?: string\n buttonId?: string\n buttonStyle?: 'error' | 'icon-label' | 'none' | 'pill' | 'primary' | 'secondary' | 'transparent'\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n el?: 'anchor' | 'link' | ElementType\n icon?: ['chevron' | 'edit' | 'plus' | 'x'] | React.ReactNode\n iconPosition?: 'left' | 'right'\n iconStyle?: 'none' | 'with-border' | 'without-border'\n id?: string\n Link?: React.ElementType\n newTab?: boolean\n onClick?: (event: MouseEvent) => void\n onMouseDown?: (event: MouseEvent) => void\n round?: boolean\n secondaryActions?: secondaryAction | secondaryAction[]\n size?: 'large' | 'medium' | 'small'\n SubMenuPopupContent?: (props: { close: () => void }) => React.ReactNode\n to?: string\n tooltip?: string\n type?: 'button' | 'submit'\n url?: string\n}\n"],"mappings":"AAOA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/Button/types.ts"],"sourcesContent":["import type { ElementType, MouseEvent } from 'react'\nimport type React from 'react'\n\ntype secondaryAction = {\n label: string\n onClick: (event: MouseEvent) => void\n}\nexport type Props = {\n 'aria-label'?: string\n buttonId?: string\n buttonStyle?: 'error' | 'icon-label' | 'none' | 'pill' | 'primary' | 'secondary' | 'transparent'\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n el?: 'anchor' | 'link' | ElementType\n icon?: ['chevron' | 'edit' | 'plus' | 'x'] | React.ReactNode\n iconPosition?: 'left' | 'right'\n iconStyle?: 'none' | 'with-border' | 'without-border'\n id?: string\n Link?: React.ElementType\n newTab?: boolean\n onClick?: (event: MouseEvent) => void\n onMouseDown?: (event: MouseEvent) => void\n /**\n * Enables form submission via an onClick handler. This is only needed if\n * type=\"submit\" does not trigger form submission, e.g. if the button DOM\n * element is not a direct child of the form element.\n *\n * @default false\n */\n programmaticSubmit?: boolean\n round?: boolean\n secondaryActions?: secondaryAction | secondaryAction[]\n size?: 'large' | 'medium' | 'small'\n SubMenuPopupContent?: (props: { close: () => void }) => React.ReactNode\n to?: string\n tooltip?: string\n type?: 'button' | 'submit'\n url?: string\n}\n"],"mappings":"AAOA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientCollectionConfig, Data, TypeWithID } from 'payload';
|
|
1
|
+
import type { ClientCollectionConfig, Data, FormState, TypeWithID } from 'payload';
|
|
2
2
|
export type DocumentDrawerContextProps = {
|
|
3
3
|
readonly clearDoc?: () => void;
|
|
4
4
|
readonly drawerSlug: string;
|
|
@@ -15,7 +15,7 @@ export type DocumentDrawerContextProps = {
|
|
|
15
15
|
doc: TypeWithID;
|
|
16
16
|
operation: 'create' | 'update';
|
|
17
17
|
result: Data;
|
|
18
|
-
}) => Promise<void> | void;
|
|
18
|
+
}) => Promise<FormState | void> | void;
|
|
19
19
|
};
|
|
20
20
|
export type DocumentDrawerContextType = DocumentDrawerContextProps;
|
|
21
21
|
export declare const DocumentDrawerCallbacksContext: import("react").Context<DocumentDrawerContextProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/elements/DocumentDrawer/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;
|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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","names":["createContext","useContext","DocumentDrawerCallbacksContext","DocumentDrawerContextProvider","children","rest","_jsx","Provider","value","useDocumentDrawerContext","context","Error"],"sources":["../../../src/elements/DocumentDrawer/Provider.tsx"],"sourcesContent":["import type { ClientCollectionConfig, Data, TypeWithID } from 'payload'\n\nimport { createContext, useContext } from 'react'\n\nexport type DocumentDrawerContextProps = {\n readonly clearDoc?: () => void\n readonly drawerSlug: string\n readonly onDelete?: (args: {\n collectionConfig?: ClientCollectionConfig\n id: string\n }) => Promise<void> | void\n /* only available if `redirectAfterDuplicate` is `false` */\n readonly onDuplicate?: (args: {\n collectionConfig?: ClientCollectionConfig\n doc: TypeWithID\n }) => Promise<void> | void\n readonly onSave?: (args: {\n collectionConfig?: ClientCollectionConfig\n doc: TypeWithID\n operation: 'create' | 'update'\n result: Data\n }) => Promise<void> | void\n}\n\nexport type DocumentDrawerContextType = DocumentDrawerContextProps\n\nexport const DocumentDrawerCallbacksContext = createContext({} as DocumentDrawerContextType)\n\nexport const DocumentDrawerContextProvider: React.FC<\n {\n children: React.ReactNode\n } & DocumentDrawerContextProps\n> = ({ children, ...rest }) => {\n return (\n <DocumentDrawerCallbacksContext.Provider value={rest}>\n {children}\n </DocumentDrawerCallbacksContext.Provider>\n )\n}\n\nexport const useDocumentDrawerContext = (): DocumentDrawerContextType => {\n const context = useContext(DocumentDrawerCallbacksContext)\n\n if (!context) {\n throw new Error('useDocumentDrawerContext must be used within a DocumentDrawerProvider')\n }\n\n return context\n}\n"],"mappings":";AAEA,SAASA,aAAa,EAAEC,UAAU,QAAQ;AAwB1C,OAAO,MAAMC,8BAAA,gBAAiCF,aAAA,CAAc,CAAC;AAE7D,OAAO,MAAMG,6BAAA,GAITA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAA,CAAM;EACxB,oBACEC,IAAA,CAACJ,8BAAA,CAA+BK,QAAQ;IAACC,KAAA,EAAOH,IAAA;cAC7CD;;AAGP;AAEA,OAAO,MAAMK,wBAAA,GAA2BA,CAAA;EACtC,MAAMC,OAAA,GAAUT,UAAA,CAAWC,8BAAA;EAE3B,IAAI,CAACQ,OAAA,EAAS;IACZ,MAAM,IAAIC,KAAA,CAAM;EAClB;EAEA,OAAOD,OAAA;AACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["createContext","useContext","DocumentDrawerCallbacksContext","DocumentDrawerContextProvider","children","rest","_jsx","Provider","value","useDocumentDrawerContext","context","Error"],"sources":["../../../src/elements/DocumentDrawer/Provider.tsx"],"sourcesContent":["import type { ClientCollectionConfig, Data, FormState, TypeWithID } from 'payload'\n\nimport { createContext, useContext } from 'react'\n\nexport type DocumentDrawerContextProps = {\n readonly clearDoc?: () => void\n readonly drawerSlug: string\n readonly onDelete?: (args: {\n collectionConfig?: ClientCollectionConfig\n id: string\n }) => Promise<void> | void\n /* only available if `redirectAfterDuplicate` is `false` */\n readonly onDuplicate?: (args: {\n collectionConfig?: ClientCollectionConfig\n doc: TypeWithID\n }) => Promise<void> | void\n readonly onSave?: (args: {\n collectionConfig?: ClientCollectionConfig\n doc: TypeWithID\n operation: 'create' | 'update'\n result: Data\n }) => Promise<FormState | void> | void\n}\n\nexport type DocumentDrawerContextType = DocumentDrawerContextProps\n\nexport const DocumentDrawerCallbacksContext = createContext({} as DocumentDrawerContextType)\n\nexport const DocumentDrawerContextProvider: React.FC<\n {\n children: React.ReactNode\n } & DocumentDrawerContextProps\n> = ({ children, ...rest }) => {\n return (\n <DocumentDrawerCallbacksContext.Provider value={rest}>\n {children}\n </DocumentDrawerCallbacksContext.Provider>\n )\n}\n\nexport const useDocumentDrawerContext = (): DocumentDrawerContextType => {\n const context = useContext(DocumentDrawerCallbacksContext)\n\n if (!context) {\n throw new Error('useDocumentDrawerContext must be used within a DocumentDrawerProvider')\n }\n\n return context\n}\n"],"mappings":";AAEA,SAASA,aAAa,EAAEC,UAAU,QAAQ;AAwB1C,OAAO,MAAMC,8BAAA,gBAAiCF,aAAA,CAAc,CAAC;AAE7D,OAAO,MAAMG,6BAAA,GAITA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAA,CAAM;EACxB,oBACEC,IAAA,CAACJ,8BAAA,CAA+BK,QAAQ;IAACC,KAAA,EAAOH,IAAA;cAC7CD;;AAGP;AAEA,OAAO,MAAMK,wBAAA,GAA2BA,CAAA;EACtC,MAAMC,OAAA,GAAUT,UAAA,CAAWC,8BAAA;EAE3B,IAAI,CAACQ,OAAA,EAAS;IACZ,MAAM,IAAIC,KAAA,CAAM;EAClB;EAEA,OAAOD,OAAA;AACT","ignoreList":[]}
|