@payloadcms/ui 3.47.0-canary.1 → 3.47.0-canary.2
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/ArrayAction/index.d.ts +2 -0
- package/dist/elements/ArrayAction/index.d.ts.map +1 -1
- package/dist/elements/ArrayAction/index.js +37 -13
- package/dist/elements/ArrayAction/index.js.map +1 -1
- package/dist/elements/ClipboardAction/ClipboardActionLabel.d.ts +5 -0
- package/dist/elements/ClipboardAction/ClipboardActionLabel.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/ClipboardActionLabel.js +44 -0
- package/dist/elements/ClipboardAction/ClipboardActionLabel.js.map +1 -0
- package/dist/elements/ClipboardAction/clipboardUtilities.d.ts +10 -0
- package/dist/elements/ClipboardAction/clipboardUtilities.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/clipboardUtilities.js +53 -0
- package/dist/elements/ClipboardAction/clipboardUtilities.js.map +1 -0
- package/dist/elements/ClipboardAction/index.d.ts +20 -0
- package/dist/elements/ClipboardAction/index.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/index.js +188 -0
- package/dist/elements/ClipboardAction/index.js.map +1 -0
- package/dist/elements/ClipboardAction/isClipboardDataValid.d.ts +10 -0
- package/dist/elements/ClipboardAction/isClipboardDataValid.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/isClipboardDataValid.js +86 -0
- package/dist/elements/ClipboardAction/isClipboardDataValid.js.map +1 -0
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.d.ts +14 -0
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.js +100 -0
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.js.map +1 -0
- package/dist/elements/ClipboardAction/types.d.ts +45 -0
- package/dist/elements/ClipboardAction/types.d.ts.map +1 -0
- package/dist/elements/ClipboardAction/types.js +2 -0
- package/dist/elements/ClipboardAction/types.js.map +1 -0
- package/dist/exports/client/index.js +22 -22
- package/dist/exports/client/index.js.map +4 -4
- package/dist/fields/Array/ArrayRow.d.ts +2 -0
- package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
- package/dist/fields/Array/ArrayRow.js +49 -43
- package/dist/fields/Array/ArrayRow.js.map +1 -1
- package/dist/fields/Array/index.d.ts.map +1 -1
- package/dist/fields/Array/index.js +175 -44
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Blocks/BlockRow.d.ts +2 -0
- package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockRow.js +41 -35
- package/dist/fields/Blocks/BlockRow.js.map +1 -1
- package/dist/fields/Blocks/RowActions.d.ts +2 -0
- package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
- package/dist/fields/Blocks/RowActions.js +32 -26
- package/dist/fields/Blocks/RowActions.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +294 -348
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FieldState, FormState } from 'payload';
|
|
2
|
+
import type { ClipboardPasteData } from './types.js';
|
|
3
|
+
export declare function reduceFormStateByPath({ formState, path, rowIndex, }: {
|
|
4
|
+
formState: FormState;
|
|
5
|
+
path: string;
|
|
6
|
+
rowIndex?: number;
|
|
7
|
+
}): Record<string, FieldState>;
|
|
8
|
+
export declare function mergeFormStateFromClipboard({ dataFromClipboard: clipboardData, formState, path, rowIndex, }: {
|
|
9
|
+
dataFromClipboard: ClipboardPasteData;
|
|
10
|
+
formState: FormState;
|
|
11
|
+
path: string;
|
|
12
|
+
rowIndex?: number;
|
|
13
|
+
}): FormState;
|
|
14
|
+
//# sourceMappingURL=mergeFormStateFromClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeFormStateFromClipboard.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/mergeFormStateFromClipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,8BAyBA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,iBAAiB,EAAE,aAAa,EAChC,SAAS,EACT,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,iBAAiB,EAAE,kBAAkB,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,aAiFA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export function reduceFormStateByPath({
|
|
2
|
+
formState,
|
|
3
|
+
path,
|
|
4
|
+
rowIndex
|
|
5
|
+
}) {
|
|
6
|
+
const filteredState = {};
|
|
7
|
+
const prefix = typeof rowIndex !== 'number' ? path : `${path}.${rowIndex}`;
|
|
8
|
+
for (const key in formState) {
|
|
9
|
+
if (!key.startsWith(prefix)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const {
|
|
13
|
+
customComponents: _,
|
|
14
|
+
validate: __,
|
|
15
|
+
...field
|
|
16
|
+
} = formState[key];
|
|
17
|
+
if (Array.isArray(field.rows)) {
|
|
18
|
+
field.rows = field.rows.map(row => {
|
|
19
|
+
if (!row || typeof row !== 'object') {
|
|
20
|
+
return row;
|
|
21
|
+
}
|
|
22
|
+
const {
|
|
23
|
+
customComponents: _,
|
|
24
|
+
...serializableRow
|
|
25
|
+
} = row;
|
|
26
|
+
return serializableRow;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
filteredState[key] = field;
|
|
30
|
+
}
|
|
31
|
+
return filteredState;
|
|
32
|
+
}
|
|
33
|
+
export function mergeFormStateFromClipboard({
|
|
34
|
+
dataFromClipboard: clipboardData,
|
|
35
|
+
formState,
|
|
36
|
+
path,
|
|
37
|
+
rowIndex
|
|
38
|
+
}) {
|
|
39
|
+
const {
|
|
40
|
+
type: typeFromClipboard,
|
|
41
|
+
data: dataFromClipboard,
|
|
42
|
+
path: pathFromClipboard,
|
|
43
|
+
rowIndex: rowIndexFromClipboard
|
|
44
|
+
} = clipboardData;
|
|
45
|
+
const copyFromField = typeof rowIndexFromClipboard !== 'number';
|
|
46
|
+
const pasteIntoField = typeof rowIndex !== 'number';
|
|
47
|
+
const fromRowToField = !copyFromField && pasteIntoField;
|
|
48
|
+
const isArray = typeFromClipboard === 'array';
|
|
49
|
+
let pathToReplace;
|
|
50
|
+
if (copyFromField && pasteIntoField) {
|
|
51
|
+
pathToReplace = pathFromClipboard;
|
|
52
|
+
} else if (copyFromField) {
|
|
53
|
+
pathToReplace = `${pathFromClipboard}.${rowIndex}`;
|
|
54
|
+
} else {
|
|
55
|
+
pathToReplace = `${pathFromClipboard}.${rowIndexFromClipboard}`;
|
|
56
|
+
}
|
|
57
|
+
let targetSegment;
|
|
58
|
+
if (!pasteIntoField) {
|
|
59
|
+
targetSegment = `${path}.${rowIndex}`;
|
|
60
|
+
} else if (fromRowToField) {
|
|
61
|
+
targetSegment = `${path}.0`;
|
|
62
|
+
} else {
|
|
63
|
+
targetSegment = path;
|
|
64
|
+
}
|
|
65
|
+
if (fromRowToField) {
|
|
66
|
+
const lastRenderedPath = `${path}.0`;
|
|
67
|
+
const rowIDFromClipboard = dataFromClipboard[`${pathToReplace}.id`].value;
|
|
68
|
+
const hasRows = formState[path].rows?.length;
|
|
69
|
+
formState[path].rows = [{
|
|
70
|
+
...(hasRows && isArray ? formState[path].rows[0] : {}),
|
|
71
|
+
id: rowIDFromClipboard,
|
|
72
|
+
isLoading: false,
|
|
73
|
+
lastRenderedPath
|
|
74
|
+
}];
|
|
75
|
+
formState[path].value = 1;
|
|
76
|
+
formState[path].initialValue = 1;
|
|
77
|
+
formState[path].disableFormData = true;
|
|
78
|
+
for (const fieldPath in formState) {
|
|
79
|
+
if (fieldPath !== path && !fieldPath.startsWith(lastRenderedPath) && fieldPath.startsWith(path)) {
|
|
80
|
+
delete formState[fieldPath];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const clipboardPath in dataFromClipboard) {
|
|
85
|
+
// Pasting a row id, skip overwriting
|
|
86
|
+
if (!pasteIntoField && clipboardPath.endsWith('.id') || !clipboardPath.startsWith(pathToReplace)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const newPath = clipboardPath.replace(pathToReplace, targetSegment);
|
|
90
|
+
const customComponents = isArray ? formState[newPath]?.customComponents : undefined;
|
|
91
|
+
const validate = isArray ? formState[newPath]?.validate : undefined;
|
|
92
|
+
formState[newPath] = {
|
|
93
|
+
customComponents,
|
|
94
|
+
validate,
|
|
95
|
+
...dataFromClipboard[clipboardPath]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return formState;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=mergeFormStateFromClipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeFormStateFromClipboard.js","names":["reduceFormStateByPath","formState","path","rowIndex","filteredState","prefix","key","startsWith","customComponents","_","validate","__","field","Array","isArray","rows","map","row","serializableRow","mergeFormStateFromClipboard","dataFromClipboard","clipboardData","type","typeFromClipboard","data","pathFromClipboard","rowIndexFromClipboard","copyFromField","pasteIntoField","fromRowToField","pathToReplace","targetSegment","lastRenderedPath","rowIDFromClipboard","value","hasRows","length","id","isLoading","initialValue","disableFormData","fieldPath","clipboardPath","endsWith","newPath","replace","undefined"],"sources":["../../../src/elements/ClipboardAction/mergeFormStateFromClipboard.ts"],"sourcesContent":["import type { FieldState, FormState } from 'payload'\n\nimport type { ClipboardPasteData } from './types.js'\n\nexport function reduceFormStateByPath({\n formState,\n path,\n rowIndex,\n}: {\n formState: FormState\n path: string\n rowIndex?: number\n}) {\n const filteredState: Record<string, FieldState> = {}\n const prefix = typeof rowIndex !== 'number' ? path : `${path}.${rowIndex}`\n\n for (const key in formState) {\n if (!key.startsWith(prefix)) {\n continue\n }\n\n const { customComponents: _, validate: __, ...field } = formState[key]\n\n if (Array.isArray(field.rows)) {\n field.rows = field.rows.map((row) => {\n if (!row || typeof row !== 'object') {\n return row\n }\n const { customComponents: _, ...serializableRow } = row\n return serializableRow\n })\n }\n\n filteredState[key] = field\n }\n\n return filteredState\n}\n\nexport function mergeFormStateFromClipboard({\n dataFromClipboard: clipboardData,\n formState,\n path,\n rowIndex,\n}: {\n dataFromClipboard: ClipboardPasteData\n formState: FormState\n path: string\n rowIndex?: number\n}) {\n const {\n type: typeFromClipboard,\n data: dataFromClipboard,\n path: pathFromClipboard,\n rowIndex: rowIndexFromClipboard,\n } = clipboardData\n\n const copyFromField = typeof rowIndexFromClipboard !== 'number'\n const pasteIntoField = typeof rowIndex !== 'number'\n const fromRowToField = !copyFromField && pasteIntoField\n const isArray = typeFromClipboard === 'array'\n\n let pathToReplace: string\n if (copyFromField && pasteIntoField) {\n pathToReplace = pathFromClipboard\n } else if (copyFromField) {\n pathToReplace = `${pathFromClipboard}.${rowIndex}`\n } else {\n pathToReplace = `${pathFromClipboard}.${rowIndexFromClipboard}`\n }\n\n let targetSegment: string\n if (!pasteIntoField) {\n targetSegment = `${path}.${rowIndex}`\n } else if (fromRowToField) {\n targetSegment = `${path}.0`\n } else {\n targetSegment = path\n }\n\n if (fromRowToField) {\n const lastRenderedPath = `${path}.0`\n const rowIDFromClipboard = dataFromClipboard[`${pathToReplace}.id`].value as string\n const hasRows = formState[path].rows?.length\n\n formState[path].rows = [\n {\n ...(hasRows && isArray ? formState[path].rows[0] : {}),\n id: rowIDFromClipboard,\n isLoading: false,\n lastRenderedPath,\n },\n ]\n formState[path].value = 1\n formState[path].initialValue = 1\n formState[path].disableFormData = true\n\n for (const fieldPath in formState) {\n if (\n fieldPath !== path &&\n !fieldPath.startsWith(lastRenderedPath) &&\n fieldPath.startsWith(path)\n ) {\n delete formState[fieldPath]\n }\n }\n }\n\n for (const clipboardPath in dataFromClipboard) {\n // Pasting a row id, skip overwriting\n if (\n (!pasteIntoField && clipboardPath.endsWith('.id')) ||\n !clipboardPath.startsWith(pathToReplace)\n ) {\n continue\n }\n\n const newPath = clipboardPath.replace(pathToReplace, targetSegment)\n\n const customComponents = isArray ? formState[newPath]?.customComponents : undefined\n const validate = isArray ? formState[newPath]?.validate : undefined\n\n formState[newPath] = {\n customComponents,\n validate,\n ...dataFromClipboard[clipboardPath],\n }\n }\n\n return formState\n}\n"],"mappings":"AAIA,OAAO,SAASA,sBAAsB;EACpCC,SAAS;EACTC,IAAI;EACJC;AAAQ,CAKT;EACC,MAAMC,aAAA,GAA4C,CAAC;EACnD,MAAMC,MAAA,GAAS,OAAOF,QAAA,KAAa,WAAWD,IAAA,GAAO,GAAGA,IAAA,IAAQC,QAAA,EAAU;EAE1E,KAAK,MAAMG,GAAA,IAAOL,SAAA,EAAW;IAC3B,IAAI,CAACK,GAAA,CAAIC,UAAU,CAACF,MAAA,GAAS;MAC3B;IACF;IAEA,MAAM;MAAEG,gBAAA,EAAkBC,CAAC;MAAEC,QAAA,EAAUC,EAAE;MAAE,GAAGC;IAAA,CAAO,GAAGX,SAAS,CAACK,GAAA,CAAI;IAEtE,IAAIO,KAAA,CAAMC,OAAO,CAACF,KAAA,CAAMG,IAAI,GAAG;MAC7BH,KAAA,CAAMG,IAAI,GAAGH,KAAA,CAAMG,IAAI,CAACC,GAAG,CAAEC,GAAA;QAC3B,IAAI,CAACA,GAAA,IAAO,OAAOA,GAAA,KAAQ,UAAU;UACnC,OAAOA,GAAA;Q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AAA;MACAE,QAAA;MACA,GAAGU,iBAAiB,CAACsB,aAAA;IACvB;EACF;EAEA,OAAOzC,SAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TFunction } from '@payloadcms/translations';
|
|
2
|
+
import type { ClientBlock, ClientField, FormStateWithoutComponents } from 'payload';
|
|
3
|
+
export type ClipboardCopyBlocksSchema = {
|
|
4
|
+
schemaBlocks: ClientBlock[];
|
|
5
|
+
};
|
|
6
|
+
export type ClipboardCopyBlocksData = {
|
|
7
|
+
blocks: ClientBlock[];
|
|
8
|
+
type: 'blocks';
|
|
9
|
+
};
|
|
10
|
+
export type ClipboardCopyFieldsSchema = {
|
|
11
|
+
schemaFields: ClientField[];
|
|
12
|
+
};
|
|
13
|
+
export type ClipboardCopyFieldsData = {
|
|
14
|
+
fields: ClientField[];
|
|
15
|
+
type: 'array';
|
|
16
|
+
};
|
|
17
|
+
export type ClipboardCopyData = {
|
|
18
|
+
path: string;
|
|
19
|
+
rowIndex?: number;
|
|
20
|
+
} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData);
|
|
21
|
+
export type ClipboardCopyActionArgs = {
|
|
22
|
+
getDataToCopy: () => FormStateWithoutComponents;
|
|
23
|
+
t: TFunction;
|
|
24
|
+
} & ClipboardCopyData;
|
|
25
|
+
export type ClipboardPasteData = {
|
|
26
|
+
data: FormStateWithoutComponents;
|
|
27
|
+
path: string;
|
|
28
|
+
rowIndex?: number;
|
|
29
|
+
} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData);
|
|
30
|
+
export type OnPasteFn = (data: ClipboardPasteData) => void;
|
|
31
|
+
export type ClipboardPasteActionArgs = {
|
|
32
|
+
onPaste: OnPasteFn;
|
|
33
|
+
path: string;
|
|
34
|
+
t: TFunction;
|
|
35
|
+
} & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema);
|
|
36
|
+
export type ClipboardPasteActionValidateArgs = {
|
|
37
|
+
fieldPath: string;
|
|
38
|
+
} & ({
|
|
39
|
+
schemaBlocks: ClientBlock[];
|
|
40
|
+
type: 'blocks';
|
|
41
|
+
} | {
|
|
42
|
+
schemaFields: ClientField[];
|
|
43
|
+
type: 'array';
|
|
44
|
+
}) & ClipboardPasteData;
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEnF,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC,CAAA;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,EAAE,MAAM,0BAA0B,CAAA;IAC/C,CAAC,EAAE,SAAS,CAAA;CACb,GAAG,iBAAiB,CAAA;AAErB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,0BAA0B,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC,CAAA;AAEvD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAA;AAE1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;CACb,GAAG,CAAC,yBAAyB,GAAG,yBAAyB,CAAC,CAAA;AAE3D,MAAM,MAAM,gCAAgC,GAAG;IAC7C,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,CACA;IACE,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,QAAQ,CAAA;CACf,GACD;IACE,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,OAAO,CAAA;CACd,CACJ,GACC,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/ClipboardAction/types.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\nimport type { ClientBlock, ClientField, FormStateWithoutComponents } from 'payload'\n\nexport type ClipboardCopyBlocksSchema = {\n schemaBlocks: ClientBlock[]\n}\n\nexport type ClipboardCopyBlocksData = {\n blocks: ClientBlock[]\n type: 'blocks'\n}\n\nexport type ClipboardCopyFieldsSchema = {\n schemaFields: ClientField[]\n}\n\nexport type ClipboardCopyFieldsData = {\n fields: ClientField[]\n type: 'array'\n}\n\nexport type ClipboardCopyData = {\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type ClipboardCopyActionArgs = {\n getDataToCopy: () => FormStateWithoutComponents\n t: TFunction\n} & ClipboardCopyData\n\nexport type ClipboardPasteData = {\n data: FormStateWithoutComponents\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type OnPasteFn = (data: ClipboardPasteData) => void\n\nexport type ClipboardPasteActionArgs = {\n onPaste: OnPasteFn\n path: string\n t: TFunction\n} & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema)\n\nexport type ClipboardPasteActionValidateArgs = {\n fieldPath: string\n} & (\n | {\n schemaBlocks: ClientBlock[]\n type: 'blocks'\n }\n | {\n schemaFields: ClientField[]\n type: 'array'\n }\n) &\n ClipboardPasteData\n"],"mappings":"AA6CA","ignoreList":[]}
|