@payloadcms/richtext-lexical 3.0.0-beta.63 → 3.0.0-beta.64
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/exports/client/chunk-XMCXIHWD.js +2 -0
- package/dist/exports/client/chunk-XMCXIHWD.js.map +7 -0
- package/dist/exports/client/{component-X4T7AVHY.js → component-VQ4OUM2Q.js} +2 -2
- package/dist/exports/client/index.js +3 -3
- package/dist/exports/client/index.js.map +2 -2
- package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/plugins/TablePlugin/index.js +0 -1
- package/dist/features/experimental_table/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +2 -2
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/index.js +3 -3
- package/dist/utilities/fieldsDrawer/Drawer.d.ts +2 -2
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +2 -4
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +15 -15
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +15 -15
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/package.json +9 -9
- package/dist/exports/client/chunk-M6Q5FGTK.js +0 -2
- package/dist/exports/client/chunk-M6Q5FGTK.js.map +0 -7
- /package/dist/exports/client/{component-X4T7AVHY.js.map → component-VQ4OUM2Q.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { FormState } from 'payload';
|
|
1
|
+
import type { Data, FormState } from 'payload';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type FieldsDrawerProps = {
|
|
4
4
|
className?: string;
|
|
5
|
-
data
|
|
5
|
+
data?: Data;
|
|
6
6
|
drawerSlug: string;
|
|
7
7
|
drawerTitle?: string;
|
|
8
8
|
featureKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqBpD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/fieldsDrawer/Drawer.tsx"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\nimport { Drawer } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n className?: string\n data
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/fieldsDrawer/Drawer.tsx"],"sourcesContent":["'use client'\nimport type { Data, FormState } from 'payload'\n\nimport { Drawer } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n className?: string\n data?: Data\n drawerSlug: string\n drawerTitle?: string\n featureKey: string\n handleDrawerSubmit: (fields: FormState, data: Record<string, unknown>) => void\n schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n handleDrawerSubmit,\n schemaPathSuffix,\n}) => {\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n handleDrawerSubmit={handleDrawerSubmit}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n )\n}\n"],"names":["Drawer","React","DrawerContent","FieldsDrawer","className","data","drawerSlug","drawerTitle","featureKey","handleDrawerSubmit","schemaPathSuffix","slug","title"],"mappings":"AAAA;;AAGA,SAASA,MAAM,QAAQ,iBAAgB;AACvC,OAAOC,WAAW,QAAO;AAEzB,SAASC,aAAa,QAAQ,qBAAoB;AAYlD;;;;CAIC,GACD,OAAO,MAAMC,eAA4C,CAAC,EACxDC,SAAS,EACTC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,kBAAkB,EAClBC,gBAAgB,EACjB;IACC,uGAAuG;IACvG,0CAA0C;IAC1C,qBACE,KAACV;QAAOI,WAAWA;QAAWO,MAAML;QAAYM,OAAOL,eAAe;kBACpE,cAAA,KAACL;YACCG,MAAMA;YACNG,YAAYA;YACZC,oBAAoBA;YACpBC,kBAAkBA;;;AAI1B,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAG/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAIpD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAG/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAIpD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,aAAa,CAAC,CAiFzF,CAAA"}
|
|
@@ -22,7 +22,7 @@ export const DrawerContent = ({ data, featureKey, handleDrawerSubmit, schemaPath
|
|
|
22
22
|
apiRoute: config.routes.api,
|
|
23
23
|
body: {
|
|
24
24
|
id,
|
|
25
|
-
data,
|
|
25
|
+
data: data ?? {},
|
|
26
26
|
operation: 'update',
|
|
27
27
|
schemaPath: schemaFieldsPath
|
|
28
28
|
},
|
|
@@ -31,9 +31,7 @@ export const DrawerContent = ({ data, featureKey, handleDrawerSubmit, schemaPath
|
|
|
31
31
|
;
|
|
32
32
|
setInitialState(state);
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
void awaitInitialState();
|
|
36
|
-
}
|
|
34
|
+
void awaitInitialState();
|
|
37
35
|
}, [
|
|
38
36
|
config.routes.api,
|
|
39
37
|
config.serverURL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"sourcesContent":["'use client'\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n handleDrawerSubmit,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"sourcesContent":["'use client'\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n handleDrawerSubmit,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: data ?? {},\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, data])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n"],"names":["Form","FormSubmit","RenderFields","useConfig","useDocumentInfo","useFieldProps","useTranslation","getFormState","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","DrawerContent","data","featureKey","handleDrawerSubmit","schemaPathSuffix","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","operation","serverURL","onChange","formState","prevFormState","beforeSubmit","disableValidationOnSubmit","fields","Array","isArray","onSubmit","forceRender","path","readOnly"],"mappings":"AAAA;;AAIA,SACEA,IAAI,EACJC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,aAAa,EACbC,cAAc,QACT,iBAAgB;AACvB,SAASC,YAAY,QAAQ,wBAAuB;AACpD,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAC/D,SAASC,MAAMC,IAAI,QAAQ,OAAM;AAIjC,SAASC,sBAAsB,QAAQ,sDAAqD;AAE5F,OAAO,MAAMC,gBAAiF,CAAC,EAC7FC,IAAI,EACJC,UAAU,EACVC,kBAAkB,EAClBC,gBAAgB,EACjB;IACC,MAAM,EAAEC,CAAC,EAAE,GAAGd;IACd,MAAM,EAAEe,EAAE,EAAE,GAAGjB;IACf,MAAM,E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EA,qBACE,MAACxB;QACC2C,cAAc;YAACH;SAAS;QACxBI,yBAAyB;QACzBC,QAAQC,MAAMC,OAAO,CAACjB,YAAYA,WAAW,EAAE;QAC/CN,cAAcA;QACdgB,UAAU;YAACA;SAAS;QACpBQ,UAAU9B;QACVL,MAAMA;;0BAEN,KAACX;gBACC4B,UAAUgB,MAAMC,OAAO,CAACjB,YAAYA,WAAW,EAAE;gBACjDmB,WAAW;gBACXC,MAAK,GAAG,+DAA+D;;gBACvEC,UAAU;gBACV7B,YAAYO;;0BAGd,KAAC5B;0BAAYmB,EAAE;;;;AAGrB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateDocumentFieldsRecursively.d.ts","sourceRoot":"","sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAYpC,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAA;IAEb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gCAAgC,6BAI1C,wBAAwB,KAAG,
|
|
1
|
+
{"version":3,"file":"migrateDocumentFieldsRecursively.d.ts","sourceRoot":"","sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAYpC,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAA;IAEb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gCAAgC,6BAI1C,wBAAwB,KAAG,MAoF7B,CAAA"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { fieldAffectsData, fieldHasSubFields, fieldIsArrayType } from 'payload/shared';
|
|
1
|
+
import { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared';
|
|
2
2
|
import { convertSlateToLexical } from '../../features/migrations/slateToLexical/converter/index.js';
|
|
3
3
|
export const migrateDocumentFieldsRecursively = ({ data, fields, found })=>{
|
|
4
4
|
for (const field of fields){
|
|
5
5
|
if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {
|
|
6
6
|
if (fieldAffectsData(field) && typeof data[field.name] === 'object') {
|
|
7
|
-
migrateDocumentFieldsRecursively({
|
|
7
|
+
found += migrateDocumentFieldsRecursively({
|
|
8
8
|
data: data[field.name],
|
|
9
9
|
fields: field.fields,
|
|
10
10
|
found
|
|
11
11
|
});
|
|
12
12
|
} else {
|
|
13
|
-
migrateDocumentFieldsRecursively({
|
|
13
|
+
found += migrateDocumentFieldsRecursively({
|
|
14
14
|
data,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
fields: field.fields,
|
|
16
|
+
found
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
} else if (field.type === 'tabs') {
|
|
20
20
|
field.tabs.forEach((tab)=>{
|
|
21
|
-
migrateDocumentFieldsRecursively({
|
|
22
|
-
data,
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
found += migrateDocumentFieldsRecursively({
|
|
22
|
+
data: tabHasName(tab) ? data[tab.name] : data,
|
|
23
|
+
fields: tab.fields,
|
|
24
|
+
found
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
} else if (Array.isArray(data[field.name])) {
|
|
@@ -29,20 +29,20 @@ export const migrateDocumentFieldsRecursively = ({ data, fields, found })=>{
|
|
|
29
29
|
data[field.name].forEach((row, i)=>{
|
|
30
30
|
const block = field.blocks.find(({ slug })=>slug === row?.blockType);
|
|
31
31
|
if (block) {
|
|
32
|
-
migrateDocumentFieldsRecursively({
|
|
32
|
+
found += migrateDocumentFieldsRecursively({
|
|
33
33
|
data: data[field.name][i],
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
fields: block.fields,
|
|
35
|
+
found
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
if (field.type === 'array') {
|
|
41
41
|
data[field.name].forEach((_, i)=>{
|
|
42
|
-
migrateDocumentFieldsRecursively({
|
|
42
|
+
found += migrateDocumentFieldsRecursively({
|
|
43
43
|
data: data[field.name][i],
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fields: field.fields,
|
|
45
|
+
found
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { fieldAffectsData, fieldHasSubFields, fieldIsArrayType } from 'payload/shared'\n\nimport type {\n SlateNodeConverter,\n SlateNodeConverterProvider,\n} from '../../features/migrations/slateToLexical/converter/types.js'\nimport type { LexicalRichTextAdapter } from '../../types.js'\n\nimport { convertSlateToLexical } from '../../features/migrations/slateToLexical/converter/index.js'\n\ntype NestedRichTextFieldsArgs = {\n data: unknown\n\n fields: Field[]\n found: number\n}\n\nexport const migrateDocumentFieldsRecursively = ({\n data,\n fields,\n found,\n}: NestedRichTextFieldsArgs): number => {\n for (const field of fields) {\n if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {\n if (fieldAffectsData(field) && typeof data[field.name] === 'object') {\n migrateDocumentFieldsRecursively({\n data: data[field.name],\n fields: field.fields,\n found,\n })\n } else {\n migrateDocumentFieldsRecursively({\n data,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared'\n\nimport type {\n SlateNodeConverter,\n SlateNodeConverterProvider,\n} from '../../features/migrations/slateToLexical/converter/types.js'\nimport type { LexicalRichTextAdapter } from '../../types.js'\n\nimport { convertSlateToLexical } from '../../features/migrations/slateToLexical/converter/index.js'\n\ntype NestedRichTextFieldsArgs = {\n data: unknown\n\n fields: Field[]\n found: number\n}\n\nexport const migrateDocumentFieldsRecursively = ({\n data,\n fields,\n found,\n}: NestedRichTextFieldsArgs): number => {\n for (const field of fields) {\n if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {\n if (fieldAffectsData(field) && typeof data[field.name] === 'object') {\n found += migrateDocumentFieldsRecursively({\n data: data[field.name],\n fields: field.fields,\n found,\n })\n } else {\n found += migrateDocumentFieldsRecursively({\n data,\n fields: field.fields,\n found,\n })\n }\n } else if (field.type === 'tabs') {\n field.tabs.forEach((tab) => {\n found += migrateDocumentFieldsRecursively({\n data: tabHasName(tab) ? data[tab.name] : data,\n fields: tab.fields,\n found,\n })\n })\n } else if (Array.isArray(data[field.name])) {\n if (field.type === 'blocks') {\n data[field.name].forEach((row, i) => {\n const block = field.blocks.find(({ slug }) => slug === row?.blockType)\n if (block) {\n found += migrateDocumentFieldsRecursively({\n data: data[field.name][i],\n fields: block.fields,\n found,\n })\n }\n })\n }\n\n if (field.type === 'array') {\n data[field.name].forEach((_, i) => {\n found += migrateDocumentFieldsRecursively({\n data: data[field.name][i],\n fields: field.fields,\n found,\n })\n })\n }\n }\n\n if (field.type === 'richText' && Array.isArray(data[field.name])) {\n // Slate richText\n const editor: LexicalRichTextAdapter = field.editor as LexicalRichTextAdapter\n if (editor && typeof editor === 'object') {\n if ('features' in editor && editor.features?.length) {\n // find slatetolexical feature\n const slateToLexicalFeature = editor.editorConfig.resolvedFeatureMap.get('slateToLexical')\n if (slateToLexicalFeature) {\n // DO CONVERSION\n\n const converterProviders = (\n slateToLexicalFeature.sanitizedServerFeatureProps as {\n converters?: SlateNodeConverterProvider[]\n }\n ).converters\n\n const converters: SlateNodeConverter[] = []\n\n for (const converter of converterProviders) {\n converters.push(converter.converter)\n }\n\n data[field.name] = convertSlateToLexical({\n converters,\n slateData: data[field.name],\n })\n\n found++\n }\n }\n }\n }\n }\n\n return found\n}\n"],"names":["fieldAffectsData","fieldHasSubFields","fieldIsArrayType","tabHasName","convertSlateToLexical","migrateDocumentFieldsRecursively","data","fields","found","field","name","type","tabs","forEach","tab","Array","isArray","row","i","block","blocks","find","slug","blockType","_","editor","features","length","slateToLexicalFeature","editorConfig","resolvedFeatureMap","get","converterProviders","sanitizedServerFeatureProps","converters","converter","push","slateData"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,iBAAgB;AAQlG,SAASC,qBAAqB,QAAQ,8DAA6D;AASnG,OAAO,MAAMC,mCAAmC,CAAC,EAC/CC,IAAI,EACJC,MAAM,EACNC,KAAK,EACoB;IACzB,KAAK,MAAMC,SAASF,OAAQ;QAC1B,IAAIN,kBAAkBQ,UAAU,CAACP,iBAAiBO,QAAQ;YACxD,IAAIT,iBAAiBS,UAAU,OAAOH,IAAI,CAACG,MAAMC,IAAI,CAAC,KAAK,UAAU;gBACnEF,SAASH,iCAAiC;oBACxCC,MAAMA,IAAI,CAACG,MAAMC,IAAI,CAAC;oBACtBH,QAAQE,MAAMF,MAAM;oBACpBC;gBACF;YACF,OAAO;gBACLA,SAASH,iCAAiC;oBACxCC;oBACAC,QAAQE,MAAMF,MAAM;oBACpBC;gBACF;YACF;QACF,OAAO,IAAIC,MAAME,IAAI,KAAK,QAAQ;YAChCF,MAAMG,IAAI,CAACC,OAAO,CAAC,CAACC;gBAClBN,SAASH,iCAAiC;oBACxCC,MAAMH,WAAWW,OAAOR,IAAI,CAACQ,IAAIJ,IAAI,CAAC,GAAGJ;oBACzCC,QAAQO,IAAIP,MAAM;oBAClBC;gBACF;YACF;QACF,OAAO,IAAIO,MAAMC,OAAO,CAACV,IAAI,CAACG,MAAMC,IAAI,CAAC,GAAG;YAC1C,IAAID,MAAME,IAAI,KAAK,UAAU;gBAC3BL,IAAI,CAACG,MAAMC,IAAI,CA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ACF;gBACF;YACF;QACF;IACF;IAEA,OAAOA;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgradeDocumentFieldsRecursively.d.ts","sourceRoot":"","sources":["../../../src/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AASpC,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAA;IAEb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gCAAgC,6BAI1C,wBAAwB,KAAG,
|
|
1
|
+
{"version":3,"file":"upgradeDocumentFieldsRecursively.d.ts","sourceRoot":"","sources":["../../../src/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AASpC,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAA;IAEb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gCAAgC,6BAI1C,wBAAwB,KAAG,MA+E7B,CAAA"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { createHeadlessEditor } from '@lexical/headless';
|
|
2
|
-
import { fieldAffectsData, fieldHasSubFields, fieldIsArrayType } from 'payload/shared';
|
|
2
|
+
import { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared';
|
|
3
3
|
import { getEnabledNodes } from '../../lexical/nodes/index.js';
|
|
4
4
|
export const upgradeDocumentFieldsRecursively = ({ data, fields, found })=>{
|
|
5
5
|
for (const field of fields){
|
|
6
6
|
if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {
|
|
7
7
|
if (fieldAffectsData(field) && typeof data[field.name] === 'object') {
|
|
8
|
-
upgradeDocumentFieldsRecursively({
|
|
8
|
+
found += upgradeDocumentFieldsRecursively({
|
|
9
9
|
data: data[field.name],
|
|
10
10
|
fields: field.fields,
|
|
11
11
|
found
|
|
12
12
|
});
|
|
13
13
|
} else {
|
|
14
|
-
upgradeDocumentFieldsRecursively({
|
|
14
|
+
found += upgradeDocumentFieldsRecursively({
|
|
15
15
|
data,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
fields: field.fields,
|
|
17
|
+
found
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
} else if (field.type === 'tabs') {
|
|
21
21
|
field.tabs.forEach((tab)=>{
|
|
22
|
-
upgradeDocumentFieldsRecursively({
|
|
23
|
-
data,
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
found += upgradeDocumentFieldsRecursively({
|
|
23
|
+
data: tabHasName(tab) ? data[tab.name] : data,
|
|
24
|
+
fields: tab.fields,
|
|
25
|
+
found
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
} else if (Array.isArray(data[field.name])) {
|
|
@@ -30,20 +30,20 @@ export const upgradeDocumentFieldsRecursively = ({ data, fields, found })=>{
|
|
|
30
30
|
data[field.name].forEach((row, i)=>{
|
|
31
31
|
const block = field.blocks.find(({ slug })=>slug === row?.blockType);
|
|
32
32
|
if (block) {
|
|
33
|
-
upgradeDocumentFieldsRecursively({
|
|
33
|
+
found += upgradeDocumentFieldsRecursively({
|
|
34
34
|
data: data[field.name][i],
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
fields: block.fields,
|
|
36
|
+
found
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
if (field.type === 'array') {
|
|
42
42
|
data[field.name].forEach((_, i)=>{
|
|
43
|
-
upgradeDocumentFieldsRecursively({
|
|
43
|
+
found += upgradeDocumentFieldsRecursively({
|
|
44
44
|
data: data[field.name][i],
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
fields: field.fields,
|
|
46
|
+
found
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field } from 'payload'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { fieldAffectsData, fieldHasSubFields, fieldIsArrayType } from 'payload/shared'\n\nimport type { LexicalRichTextAdapter } from '../../types.js'\n\nimport { getEnabledNodes } from '../../lexical/nodes/index.js'\n\ntype NestedRichTextFieldsArgs = {\n data: unknown\n\n fields: Field[]\n found: number\n}\n\nexport const upgradeDocumentFieldsRecursively = ({\n data,\n fields,\n found,\n}: NestedRichTextFieldsArgs): number => {\n for (const field of fields) {\n if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {\n if (fieldAffectsData(field) && typeof data[field.name] === 'object') {\n upgradeDocumentFieldsRecursively({\n data: data[field.name],\n fields: field.fields,\n found,\n })\n } else {\n upgradeDocumentFieldsRecursively({\n data,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field } from 'payload'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared'\n\nimport type { LexicalRichTextAdapter } from '../../types.js'\n\nimport { getEnabledNodes } from '../../lexical/nodes/index.js'\n\ntype NestedRichTextFieldsArgs = {\n data: unknown\n\n fields: Field[]\n found: number\n}\n\nexport const upgradeDocumentFieldsRecursively = ({\n data,\n fields,\n found,\n}: NestedRichTextFieldsArgs): number => {\n for (const field of fields) {\n if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {\n if (fieldAffectsData(field) && typeof data[field.name] === 'object') {\n found += upgradeDocumentFieldsRecursively({\n data: data[field.name],\n fields: field.fields,\n found,\n })\n } else {\n found += upgradeDocumentFieldsRecursively({\n data,\n fields: field.fields,\n found,\n })\n }\n } else if (field.type === 'tabs') {\n field.tabs.forEach((tab) => {\n found += upgradeDocumentFieldsRecursively({\n data: tabHasName(tab) ? data[tab.name] : data,\n fields: tab.fields,\n found,\n })\n })\n } else if (Array.isArray(data[field.name])) {\n if (field.type === 'blocks') {\n data[field.name].forEach((row, i) => {\n const block = field.blocks.find(({ slug }) => slug === row?.blockType)\n if (block) {\n found += upgradeDocumentFieldsRecursively({\n data: data[field.name][i],\n fields: block.fields,\n found,\n })\n }\n })\n }\n\n if (field.type === 'array') {\n data[field.name].forEach((_, i) => {\n found += upgradeDocumentFieldsRecursively({\n data: data[field.name][i],\n fields: field.fields,\n found,\n })\n })\n }\n }\n\n if (\n field.type === 'richText' &&\n data[field.name] &&\n !Array.isArray(data[field.name]) &&\n 'root' in data[field.name]\n ) {\n // Lexical richText\n const editor: LexicalRichTextAdapter = field.editor as LexicalRichTextAdapter\n if (editor && typeof editor === 'object') {\n if ('features' in editor && editor.features?.length) {\n // Load lexical editor into lexical, then save it immediately\n const editorState: SerializedEditorState = data[field.name]\n\n const headlessEditor = createHeadlessEditor({\n nodes: getEnabledNodes({\n editorConfig: editor.editorConfig,\n }),\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(editorState))\n\n // get editor state\n data[field.name] = headlessEditor.getEditorState().toJSON()\n\n found++\n }\n }\n }\n }\n\n return found\n}\n"],"names":["createHeadlessEditor","fieldAffectsData","fieldHasSubFields","fieldIsArrayType","tabHasName","getEnabledNodes","upgradeDocumentFieldsRecursively","data","fields","found","field","name","type","tabs","forEach","tab","Array","isArray","row","i","block","blocks","find","slug","blockType","_","editor","features","length","editorState","headlessEditor","nodes","editorConfig","setEditorState","parseEditorState","getEditorState","toJSON"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ,oBAAmB;AACxD,SAASC,gBAAgB,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,UAA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,CAACG,MAAMC,IAAI,CAAC,CAACG,OAAO,CAAC,CAACW,GAAGN;oBAC3BV,SAASH,iCAAiC;wBACxCC,MAAMA,IAAI,CAACG,MAAMC,IAAI,CAAC,CAACQ,EAAE;wBACzBX,QAAQE,MAAMF,MAAM;wBACpBC;oBACF;gBACF;YACF;QACF;QAEA,IACEC,MAAME,IAAI,KAAK,cACfL,IAAI,CAACG,MAAMC,IAAI,CAAC,IAChB,CAACK,MAAMC,OAAO,CAACV,IAAI,CAACG,MAAMC,IAAI,CAAC,KAC/B,UAAUJ,IAAI,CAACG,MAAMC,IAAI,CAAC,EAC1B;YACA,mBAAmB;YACnB,MAAMe,SAAiChB,MAAMgB,MAAM;YACnD,IAAIA,UAAU,OAAOA,WAAW,UAAU;gBACxC,IAAI,cAAcA,UAAUA,OAAOC,QAAQ,EAAEC,QAAQ;oBACnD,6DAA6D;oBAC7D,MAAMC,cAAqCtB,IAAI,CAACG,MAAMC,IAAI,CAAC;oBAE3D,MAAMmB,iBAAiB9B,qBAAqB;wBAC1C+B,OAAO1B,gBAAgB;4BACrB2B,cAAcN,OAAOM,YAAY;wBACnC;oBACF;oBACAF,eAAeG,cAAc,CAACH,eAAeI,gBAAgB,CAACL;oBAE9D,mBAAmB;oBACnBtB,IAAI,CAACG,MAAMC,IAAI,CAAC,GAAGmB,eAAeK,cAAc,GAAGC,MAAM;oBAEzD3B;gBACF;YACF;QACF;IACF;IAEA,OAAOA;AACT,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.64",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"esbuild-sass-plugin": "3.3.1",
|
|
57
57
|
"swc-plugin-transform-remove-imports": "1.14.0",
|
|
58
58
|
"@payloadcms/eslint-config": "3.0.0-beta.59",
|
|
59
|
-
"@payloadcms/next": "3.0.0-beta.
|
|
60
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
59
|
+
"@payloadcms/next": "3.0.0-beta.64",
|
|
60
|
+
"@payloadcms/translations": "3.0.0-beta.64",
|
|
61
|
+
"payload": "3.0.0-beta.64",
|
|
62
|
+
"@payloadcms/ui": "3.0.0-beta.64"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"lexical": "0.16.1",
|
|
78
78
|
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
79
79
|
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
80
|
-
"@payloadcms/next": "3.0.0-beta.
|
|
81
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
82
|
-
"@payloadcms/ui": "3.0.0-beta.
|
|
83
|
-
"payload": "3.0.0-beta.
|
|
80
|
+
"@payloadcms/next": "3.0.0-beta.64",
|
|
81
|
+
"@payloadcms/translations": "3.0.0-beta.64",
|
|
82
|
+
"@payloadcms/ui": "3.0.0-beta.64",
|
|
83
|
+
"payload": "3.0.0-beta.64"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk-QZIAQPM7.js";import{Drawer as $}from"@payloadcms/ui";import{Form as R,FormSubmit as F,RenderFields as O,useConfig as E,useDocumentInfo as M,useFieldProps as T,useTranslation as A}from"@payloadcms/ui";import{getFormState as g}from"@payloadcms/ui/shared";import{useCallback as L,useEffect as k,useState as P}from"react";import{v4 as I}from"uuid";import{jsx as D,jsxs as N}from"react/jsx-runtime";var C=({data:e,featureKey:t,handleDrawerSubmit:o,schemaPathSuffix:a})=>{let{t:i}=A(),{id:n}=M(),{schemaPath:l}=T(),r=E(),[p,x]=P(!1),{field:{richTextComponentMap:_}}=y(),U=`lexical_internal_feature.${t}.fields${a?`.${a}`:""}`,s=`${l}.lexical_internal_feature.${t}${a?`.${a}`:""}`,d=_.get(U);k(()=>{e&&(async()=>{let w=await g({apiRoute:r.routes.api,body:{id:n,data:e,operation:"update",schemaPath:s},serverURL:r.serverURL});x(w)})()},[r.routes.api,r.serverURL,s,n,e]);let m=L(async({formState:f})=>await g({apiRoute:r.routes.api,body:{id:n,formState:f,operation:"update",schemaPath:s},serverURL:r.serverURL}),[r.routes.api,r.serverURL,s,n]);return p===!1?null:N(R,{beforeSubmit:[m],disableValidationOnSubmit:!0,fields:Array.isArray(d)?d:[],initialState:p,onChange:[m],onSubmit:o,uuid:I(),children:[D(O,{fieldMap:Array.isArray(d)?d:[],forceRender:!0,path:"",readOnly:!1,schemaPath:s}),D(F,{children:i("fields:saveChanges")})]})};import{jsx as S}from"react/jsx-runtime";var lt=({className:e,data:t,drawerSlug:o,drawerTitle:a,featureKey:i,handleDrawerSubmit:n,schemaPathSuffix:l})=>S($,{className:e,slug:o,title:a??"",children:S(C,{data:t,featureKey:i,handleDrawerSubmit:n,schemaPathSuffix:l})});import{useAuth as H,useConfig as B,useEntityVisibility as K}from"@payloadcms/ui";import*as u from"react";var W=(e,t)=>e.filter(({slug:o,admin:{enableRichTextRelationship:a},upload:i})=>t.visibleEntities.collections.includes(o)?t?.uploads?a&&!!i:i?!1:a:!1),ut=e=>{let{children:t,uploads:o=!1,...a}=e,{collections:i}=B(),{user:n}=H(),{visibleEntities:l}=K(),[r]=u.useState(()=>W(i,{uploads:o,user:n,visibleEntities:l}).map(({slug:p})=>p));return r.length?u.cloneElement(t,{...a,enabledCollectionSlugs:r}):null};import{createCommand as J}from"lexical";var ft=J("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{DecoratorBlockNode as V}from"@lexical/react/LexicalDecoratorBlockNode.js";import h from"bson-objectid";import{$applyNodeReplacement as X}from"lexical";import*as b from"react";import{jsx as Q}from"react/jsx-runtime";var G=b.lazy(()=>import("./component-X4T7AVHY.js").then(e=>({default:e.UploadComponent})));function j(e){return e.parentElement!=null&&e.parentElement.tagName==="LI"&&e.previousSibling===null&&e.getAttribute("aria-roledescription")==="checkbox"}function q(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id"),a=e.getAttribute("data-lexical-upload-relation-to");if(o!=null&&a!=null)return{node:v({data:{fields:{},relationTo:a,value:o}})}}let t=e;return t.src.startsWith("file:///")||j(t),null}var c=class e extends V{__data;constructor({data:t,format:o,key:a}){super(o,a),this.__data=t}static clone(t){return new e({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"upload"}static importDOM(){return{img:t=>({conversion:q,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new h.default().toHexString(),t.version=3);let o={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},a=v({data:o});return a.setFormat(t.format),a}static isInline(){return!1}decorate(){return Q(G,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let t=document.createElement("img");return t.setAttribute("data-lexical-upload-id",String(this.__data?.value)),t.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(t){let o=this.getWritable();o.__data=t}updateDOM(){return!1}};function v({data:e}){return e?.id||(e.id=new h.default().toHexString()),X(new c({data:e}))}function St(e){return e instanceof c}export{lt as a,ut as b,ft as c,c as d,v as e,St as f};
|
|
2
|
-
//# sourceMappingURL=chunk-M6Q5FGTK.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/features/relationship/utils/EnabledRelationshipsCondition.tsx", "../../../src/features/upload/drawer/commands.ts", "../../../src/features/upload/nodes/UploadNode.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport type { FormState } from 'payload'\n\nimport { Drawer } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n className?: string\n data: any\n drawerSlug: string\n drawerTitle?: string\n featureKey: string\n handleDrawerSubmit: (fields: FormState, data: Record<string, unknown>) => void\n schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n handleDrawerSubmit,\n schemaPathSuffix,\n}) => {\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n handleDrawerSubmit={handleDrawerSubmit}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n )\n}\n", "'use client'\nimport type { FormProps } from '@payloadcms/ui'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n handleDrawerSubmit,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n if (data) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, data])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n", "import type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options.visibleEntities.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<any> = (props) => {\n const { children, uploads = false, ...rest } = props\n const { collections } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n", "import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { CollectionSlug } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nexport type UploadData = {\n fields: {\n // unknown, custom fields:\n [key: string]: unknown\n }\n id: string\n relationTo: CollectionSlug\n value: number | string\n}\n\nfunction isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {\n return (\n img.parentElement != null &&\n img.parentElement.tagName === 'LI' &&\n img.previousSibling === null &&\n img.getAttribute('aria-roledescription') === 'checkbox'\n )\n}\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadNode): UploadNode {\n return new UploadNode({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],
|
|
5
|
-
"mappings": "wCAGA,OAAS,UAAAA,MAAc,iBCCvB,OACE,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,kBAAAC,MACK,iBACP,OAAS,gBAAAC,MAAoB,wBAC7B,OAAgB,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QACxD,OAAS,MAAMC,MAAY,OAqEvB,OASE,OAAAC,EATF,QAAAC,MAAA,oB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H,EAAkB,CAChC,KAAAG,CACF,EAEe,CACb,OAAKA,GAAM,KACTA,EAAK,GAAK,IAAIf,EAAS,QAAQ,EAAE,YAAY,GAExCC,EAAsB,IAAIY,EAAW,CAAE,KAAME,CAAmB,CAAC,CAAC,CAC3E,CAEO,SAASQ,GAAcL,EAA0D,CACtF,OAAOA,aAAgBL,CACzB",
|
|
6
|
-
"names": ["Drawer", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useTranslation", "getFormState", "useCallback", "useEffect", "useState", "uuid", "jsx", "jsxs", "DrawerContent", "data", "featureKey", "handleDrawerSubmit", "schemaPathSuffix", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "richTextComponentMap", "useEditorConfigContext", "componentMapRenderedFieldsPath", "schemaFieldsPath", "fieldMap", "useEffect", "state", "getFormState", "onChange", "useCallback", "prevFormState", "Form", "uuid", "RenderFields", "FormSubmit", "jsx", "FieldsDrawer", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "handleDrawerSubmit", "schemaPathSuffix", "Drawer", "DrawerContent", "useAuth", "useConfig", "useEntityVisibility", "React", "filterRichTextCollections", "collections", "options", "slug", "enableRichTextRelationship", "upload", "EnabledRelationshipsCondition", "props", "children", "uploads", "rest", "user", "visibleEntities", "enabledCollectionSlugs", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "DecoratorBlockNode", "ObjectID", "$applyNodeReplacement", "React", "jsx", "RawUploadComponent", "module", "isGoogleDocCheckboxImg", "img", "$convertUploadElement", "domNode", "id", "relationTo", "$createUploadNode", "UploadNode", "_UploadNode", "data", "format", "key", "node", "serializedNode", "importedData", "element", "writable", "$isUploadNode"]
|
|
7
|
-
}
|
|
File without changes
|