@payloadcms/richtext-lexical 3.21.0 → 3.22.0

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.
Files changed (72) hide show
  1. package/dist/exports/client/bundled.css +1 -1
  2. package/dist/exports/client/chunk-PUXDVIHC.js +2 -0
  3. package/dist/exports/client/chunk-PUXDVIHC.js.map +7 -0
  4. package/dist/exports/client/chunk-UJAPUXH4.js +2 -0
  5. package/dist/exports/client/chunk-UJAPUXH4.js.map +7 -0
  6. package/dist/exports/client/{component-VJVZFYZJ.js → component-P5K7Z5NW.js} +2 -2
  7. package/dist/exports/client/componentInline-KK5V376W.js +2 -0
  8. package/dist/exports/client/index.js +10 -10
  9. package/dist/exports/client/index.js.map +3 -3
  10. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  11. package/dist/features/blocks/client/component/index.js +19 -9
  12. package/dist/features/blocks/client/component/index.js.map +1 -1
  13. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +1 -1
  14. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -1
  15. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  16. package/dist/features/blocks/client/componentInline/index.js +16 -6
  17. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  18. package/dist/features/blocks/client/index.d.ts.map +1 -1
  19. package/dist/features/blocks/client/index.js +7 -4
  20. package/dist/features/blocks/client/index.js.map +1 -1
  21. package/dist/features/blocks/client/markdownTransformer.js +1 -1
  22. package/dist/features/blocks/client/markdownTransformer.js.map +1 -1
  23. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +4 -4
  24. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -1
  25. package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -1
  26. package/dist/features/blocks/server/markdownTransformer.js +5 -4
  27. package/dist/features/blocks/server/markdownTransformer.js.map +1 -1
  28. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  29. package/dist/features/blocks/server/validate.js +9 -3
  30. package/dist/features/blocks/server/validate.js.map +1 -1
  31. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  32. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +12 -10
  33. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  34. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
  35. package/dist/features/experimental_table/markdownTransformer.js +6 -2
  36. package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
  37. package/dist/features/heading/markdownTransformer.js +1 -1
  38. package/dist/features/heading/markdownTransformer.js.map +1 -1
  39. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +1 -1
  40. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  41. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  42. package/dist/features/link/nodes/LinkNode.js +4 -6
  43. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  44. package/dist/features/link/server/validate.d.ts.map +1 -1
  45. package/dist/features/link/server/validate.js +9 -3
  46. package/dist/features/link/server/validate.js.map +1 -1
  47. package/dist/features/lists/shared/markdown.js.map +1 -1
  48. package/dist/features/upload/server/validate.d.ts.map +1 -1
  49. package/dist/features/upload/server/validate.js +9 -3
  50. package/dist/features/upload/server/validate.js.map +1 -1
  51. package/dist/field/bundled.css +1 -1
  52. package/dist/field/rscEntry.d.ts.map +1 -1
  53. package/dist/field/rscEntry.js +1 -0
  54. package/dist/field/rscEntry.js.map +1 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +6 -2
  57. package/dist/index.js.map +1 -1
  58. package/dist/utilities/buildInitialState.d.ts +1 -0
  59. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  60. package/dist/utilities/buildInitialState.js +2 -0
  61. package/dist/utilities/buildInitialState.js.map +1 -1
  62. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  63. package/dist/utilities/fieldsDrawer/DrawerContent.js +11 -3
  64. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  65. package/package.json +7 -7
  66. package/dist/exports/client/chunk-KDV47ZNZ.js +0 -2
  67. package/dist/exports/client/chunk-KDV47ZNZ.js.map +0 -7
  68. package/dist/exports/client/chunk-QP2NYEWJ.js +0 -2
  69. package/dist/exports/client/chunk-QP2NYEWJ.js.map +0 -7
  70. package/dist/exports/client/componentInline-DTNGYZCL.js +0 -2
  71. /package/dist/exports/client/{component-VJVZFYZJ.js.map → component-P5K7Z5NW.js.map} +0 -0
  72. /package/dist/exports/client/{componentInline-DTNGYZCL.js.map → componentInline-KK5V376W.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerContent.js","names":["Form","FormSubmit","RenderFields","useDocumentInfo","useServerFunctions","useTranslation","abortAndIgnore","React","useCallback","useEffect","useRef","useState","v4","uuid","useEditorConfigContext","DrawerContent","data","featureKey","fieldMapOverride","handleDrawerSubmit","schemaFieldsPathOverride","schemaPath","schemaPathSuffix","t","id","collectionSlug","getDocPreferences","globalSlug","onChangeAbortControllerRef","AbortController","initialState","setInitialState","fieldProps","featureClientSchemaMap","permissions","getFormState","schemaFieldsPath","fields","controller","awaitInitialState","state","docPermissions","docPreferences","operation","renderAllFields","signal","onChange","formState","prevFormState","current","_jsxs","beforeSubmit","disableValidationOnSubmit","Array","isArray","onSubmit","_jsx","forceRender","parentIndexPath","parentPath","parentSchemaPath","readOnly"],"sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useDocumentInfo,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useRef, 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 fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n const [initialState, setInitialState] = useState<false | FormState | undefined>(false)\n\n const {\n fieldProps: { featureClientSchemaMap, permissions },\n } = useEditorConfigContext()\n\n const { getFormState } = useServerFunctions()\n\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any = fieldMapOverride ?? featureClientSchemaMap[featureKey]?.[schemaFieldsPath] // Field Schema\n\n useEffect(() => {\n const controller = new AbortController()\n\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: data ?? {},\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n globalSlug,\n operation: 'update',\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n\n return () => {\n abortAndIgnore(controller)\n }\n }, [schemaFieldsPath, id, data, getFormState, collectionSlug, globalSlug, getDocPreferences])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }: { formState: FormState }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n formState: prevFormState,\n globalSlug,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n return state\n },\n [getFormState, id, collectionSlug, getDocPreferences, globalSlug, schemaFieldsPath],\n )\n\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={permissions}\n readOnly={false}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SACEA,IAAI,EACJC,UAAU,EACVC,YAAY,EACZC,eAAe,EACfC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAChE,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAI3B,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,aAAA,GAAiFA,CAAC;EAC7FC,IAAI;EACJC,UAAU;EACVC,gBAAgB;EAChBC,kBAAkB;EAClBC,wBAAwB;EACxBC,UAAU;EACVC;AAAgB,CACjB;EACC,MAAM;IAAEC;EAAC,CAAE,GAAGlB,cAAA;EACd,MAAM;IAAEmB,EAAE;IAAEC,cAAc;IAAEC,iBAAiB;IAAEC;EAAU,CAAE,GAAGxB,eAAA;EAE9D,MAAMyB,0BAAA,GAA6BlB,MAAA,CAAO,IAAImB,eAAA;EAE9C,MAAM,CAACC,YAAA,EAAcC,eAAA,CAAgB,GAAGpB,QAAA,CAAwC;EAEhF,MAAM;IACJqB,UAAA,EAAY;MAAEC,sBAAsB;MAAEC;IAAW;EAAE,CACpD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C,cAAA;MACAgB,cAAA,EAAgB;QACdJ,MAAA,EAAQ;MACV;MACAK,cAAA,EAAgB,MAAMhB,iBAAA;MACtBqB,SAAA,EAAWC,aAAA;MACXrB,UAAA;MACAgB,SAAA,EAAW;MACXtB,UAAA,EAAYe,gBAAA;MACZS,MAAA,EAAQP,YAAA,CAAWO;IACrB;IAEA,IAAI,CAACL,OAAA,EAAO;MACV,OAAOQ,aAAA;IACT;IAEA,OAAOR,OAAA;EACT,GACA,CAACL,YAAA,EAAcX,EAAA,EAAIC,cAAA,EAAgBC,iBAAA,EAAmBC,UAAA,EAAYS,gBAAA,CAAiB;EAGrF;EACA3B,SAAA,CAAU;IACR,OAAO;MACLH,cAAA,CAAesB,0BAAA,CAA2BqB,OAAO;IACnD;EACF,GAAG,EAAE;EAEL,IAAInB,YAAA,KAAiB,OAAO;IAC1B,OAAO;EACT;EAEA,oBACEoB,KAAA,CAAClD,IAAA;IACCmD,YAAA,EAAc,CAACL,QAAA,CAAS;IACxBM,yBAAyB;IACzBf,MAAA,EAAQgB,KAAA,CAAMC,OAAO,CAACjB,MAAA,IAAUA,MAAA,GAAS,EAAE;IAC3CP,YAAA,EAAcA,YAAA;IACdgB,QAAA,EAAU,CAACA,QAAA,CAAS;IACpBS,QAAA,EAAUpC,kBAAA;IACVN,IAAA,EAAMA,IAAA;4BAEN2C,IAAA,CAACtD,YAAA;MACCmC,MAAA,EAAQgB,KAAA,CAAMC,OAAO,CAACjB,MAAA,IAAUA,MAAA,GAAS,EAAE;MAC3CoB,WAAW;MACXC,eAAA,EAAgB;MAChBC,UAAA,EAAW,GAAG;MAAA;;MACdC,gBAAA,EAAkBxB,gBAAA;MAClBF,WAAA,EAAaA,WAAA;MACb2B,QAAA,EAAU;qBAEZL,IAAA,CAACvD,UAAA;gBAAYsB,CAAA,CAAE;;;AAGrB","ignoreList":[]}
1
+ {"version":3,"file":"DrawerContent.js","names":["Form","FormSubmit","RenderFields","useDocumentForm","useDocumentInfo","useServerFunctions","useTranslation","abortAndIgnore","deepCopyObjectSimpleWithoutReactComponents","React","useCallback","useEffect","useRef","useState","v4","uuid","useEditorConfigContext","DrawerContent","data","featureKey","fieldMapOverride","handleDrawerSubmit","schemaFieldsPathOverride","schemaPath","schemaPathSuffix","t","id","collectionSlug","getDocPreferences","globalSlug","fields","parentDocumentFields","onChangeAbortControllerRef","AbortController","initialState","setInitialState","fieldProps","featureClientSchemaMap","permissions","getFormState","schemaFieldsPath","controller","awaitInitialState","state","docPermissions","docPreferences","documentFormState","initialBlockData","operation","renderAllFields","signal","onChange","formState","prevFormState","current","initialBlockFormState","_jsxs","beforeSubmit","disableValidationOnSubmit","Array","isArray","onSubmit","_jsx","forceRender","parentIndexPath","parentPath","parentSchemaPath","readOnly"],"sources":["../../../src/utilities/fieldsDrawer/DrawerContent.tsx"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useDocumentForm,\n useDocumentInfo,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared'\nimport React, { useCallback, useEffect, useRef, 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 fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n const [initialState, setInitialState] = useState<false | FormState | undefined>(false)\n\n const {\n fieldProps: { featureClientSchemaMap, permissions },\n } = useEditorConfigContext()\n\n const { getFormState } = useServerFunctions()\n\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any = fieldMapOverride ?? featureClientSchemaMap[featureKey]?.[schemaFieldsPath] // Field Schema\n\n useEffect(() => {\n const controller = new AbortController()\n\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: data ?? {},\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields),\n globalSlug,\n initialBlockData: data,\n operation: 'update',\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n\n return () => {\n abortAndIgnore(controller)\n }\n }, [\n schemaFieldsPath,\n id,\n data,\n getFormState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }: { formState: FormState }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n schemaFieldsPath,\n ],\n )\n\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={permissions}\n readOnly={false}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SACEA,IAAI,EACJC,UAAU,EACVC,YAAY,EACZC,eAAe,EACfC,eAAe,EACfC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,0CAA0C,QAAQ;AAC3D,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAChE,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAI3B,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,aAAA,GAAiFA,CAAC;EAC7FC,IAAI;EACJC,UAAU;EACVC,gBAAgB;EAChBC,kBAAkB;EAClBC,wBAAwB;EACxBC,UAAU;EACVC;AAAgB,CACjB;EACC,MAAM;IAAEC;EAAC,CAAE,GAAGnB,cAAA;EACd,MAAM;IAAEoB,EAAE;IAAEC,cAAc;IAAEC,iBAAiB;IAAEC;EAAU,CAAE,GAAGzB,eAAA;EAC9D,MAAM;IAAE0B,MAAA,EAAQC;EAAoB,CAAE,GAAG5B,eAAA;EAEzC,MAAM6B,0BAAA,GAA6BpB,MAAA,CAAO,IAAIqB,eAAA;EAE9C,MAAM,CAACC,YAAA,EAAcC,eAAA,CAAgB,GAAGtB,QAAA,CAAwC;EAEhF,MAAM;IACJuB,UAAA,EAAY;MAAEC,sBAAsB;MAAEC;IAAW;EAAE,CACpD,GAAGtB,sBAAA;EAEJ,MAAM;IAAEuB;EAAY,CAAE,GAAGlC,kBAAA;EAEzB,MAAM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AAGrB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.21.0",
3
+ "version": "3.22.0",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -352,8 +352,8 @@
352
352
  "react-error-boundary": "4.1.2",
353
353
  "ts-essentials": "10.0.3",
354
354
  "uuid": "10.0.0",
355
- "@payloadcms/translations": "3.21.0",
356
- "@payloadcms/ui": "3.21.0"
355
+ "@payloadcms/translations": "3.22.0",
356
+ "@payloadcms/ui": "3.22.0"
357
357
  },
358
358
  "devDependencies": {
359
359
  "@babel/cli": "7.26.4",
@@ -373,8 +373,8 @@
373
373
  "esbuild-sass-plugin": "3.3.1",
374
374
  "eslint-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
375
375
  "swc-plugin-transform-remove-imports": "3.1.0",
376
- "@payloadcms/eslint-config": "3.9.0",
377
- "payload": "3.21.0"
376
+ "payload": "3.22.0",
377
+ "@payloadcms/eslint-config": "3.9.0"
378
378
  },
379
379
  "peerDependencies": {
380
380
  "@faceless-ui/modal": "3.0.0-beta.2",
@@ -392,8 +392,8 @@
392
392
  "lexical": "0.21.0",
393
393
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
394
394
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
395
- "@payloadcms/next": "3.21.0",
396
- "payload": "3.21.0"
395
+ "@payloadcms/next": "3.22.0",
396
+ "payload": "3.22.0"
397
397
  },
398
398
  "engines": {
399
399
  "node": "^18.20.2 || >=20.9.0"
@@ -1,2 +0,0 @@
1
- import{a as X}from"./chunk-INBEEENE.js";import{b as U}from"./chunk-3LGFOM34.js";import{jsx as n,jsxs as f,Fragment as Be}from"react/jsx-runtime";import F,{createContext as xe,useCallback as O,useEffect as w,useMemo as D,useRef as E}from"react";import{useLexicalComposerContext as _e}from"@lexical/react/LexicalComposerContext";import{getTranslation as Z}from"@payloadcms/translations";import{Button as ee,Drawer as Ce,EditDepthProvider as Se,Form as ye,formatDrawerSlug as Ie,FormSubmit as we,RenderFields as De,ShimmerEffect as Fe,useDocumentInfo as Ne,useEditDepth as ve,useServerFunctions as $e,useTranslation as Pe}from"@payloadcms/ui";import{abortAndIgnore as L}from"@payloadcms/ui/shared";import{$getNodeByKey as te}from"lexical";import{v4 as Te}from"uuid";import{jsx as pe}from"react/jsx-runtime";import be from"bson-objectid";import he from"react";import de from"bson-objectid";import{DecoratorNode as me}from"lexical";var k=class extends me{__cacheBuster;__fields;constructor({cacheBuster:e,fields:t,key:l}){super(l),this.__fields=t,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,key:e.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(e){return fe(e.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(){let e=document.createElement("span");return e.classList.add("inline-block-container"),e}decorate(e,t){return null}exportDOM(){let e=document.createElement("span");e.classList.add("inline-block-container");let t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(e,t){let l=this.getWritable();l.__fields=e,t||l.__cacheBuster++}updateDOM(){return!1}};function fe(r){return new k({fields:{...r,id:r?.id||new de.default().toHexString()}})}var ke=he.lazy(()=>import("./componentInline-DTNGYZCL.js").then(r=>({default:r.InlineBlockComponent}))),I=class extends k{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return ge(e.fields)}decorate(e,t){return pe(ke,{cacheBuster:this.getCacheBuster(),formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ge(r){return new I({fields:{...r,id:r?.id||new be.default().toHexString()}})}function Y(r){return r instanceof I}var d="inline-block",ne=xe({initialState:!1}),tt=()=>F.useContext(ne),nt=r=>{let{cacheBuster:e,formData:t,nodeKey:l}=r,[m]=_e(),{i18n:N,t:u}=Pe(),{createdInlineBlock:j,fieldProps:{featureClientSchemaMap:oe,initialLexicalFormState:re,permissions:le,readOnly:g,schemaPath:M},setCreatedInlineBlock:R,uuid:ie}=U(),{getFormState:B}=$e(),se=ve(),A=E(!1),[a,J]=F.useState(re?.[t.id]?.formState);w(()=>{J(!1)},[e]);let[v,K]=F.useState(a?._components?.customComponents?.BlockLabel),[z,H]=F.useState(a?._components?.customComponents?.Block),V=Ie({slug:`lexical-inlineBlocks-create-${ie}-${t.id}`,depth:se}),{toggleDrawer:p}=X(V,!0),ce=E(null),{id:x,collectionSlug:_,getDocPreferences:C,globalSlug:S}=Ne(),ae=`${M}.lexical_internal_feature.blocks.lexical_inline_blocks.${t.blockType}`,i=oe.blocks[ae]?.[0]?.blocks?.[0];w(()=>{!A.current&&j?.getKey()===l&&(i?.fields?.length>2&&p(),R?.(void 0),A.current=!0)},[i?.fields?.length,j,l,R,p]);let W=O(()=>{m.update(()=>{te(l)?.remove()})},[m,l]),b=i?.labels?.singular?Z(i?.labels.singular,N):i?.slug,$=E(new AbortController),h=`${M}.lexical_internal_feature.blocks.lexical_inline_blocks.${i?.slug}.fields`;w(()=>{let o=new AbortController;return t&&!a&&(async()=>{let{state:s}=await B({id:x,collectionSlug:_,data:t,docPermissions:{fields:!0},docPreferences:await C(),globalSlug:S,operation:"update",renderAllFields:!0,schemaPath:h,signal:o.signal});s&&(J(s),K(s._components?.customComponents?.BlockLabel),H(s._components?.customComponents?.Block))})(),()=>{L(o)}},[B,h,x,t,a,_,S,C]);let q=O(async({formState:o,submit:c})=>{L($.current);let s=new AbortController;$.current=s;let{state:y}=await B({id:x,collectionSlug:_,docPermissions:{fields:!0},docPreferences:await C(),formState:o,globalSlug:S,operation:"update",renderAllFields:!!c,schemaPath:h,signal:s.signal});return y?(c&&(K(y._components?.customComponents?.BlockLabel),H(y._components?.customComponents?.Block)),y):o},[B,x,_,C,S,h]);w(()=>()=>{L($.current)},[]);let ue=O((o,c)=>{c.blockType=t.blockType,m.update(()=>{let s=te(l);s&&Y(s)&&s.setFields(c,!0)})},[m,l,t]),P=D(()=>()=>n(ee,{buttonStyle:"icon-label",className:`${d}__removeButton`,disabled:g,icon:"x",onClick:o=>{o.preventDefault(),W()},round:!0,size:"small",tooltip:u("lexical:blocks:inlineBlocks:remove",{label:b})}),[b,g,W,u]),G=D(()=>()=>n(ee,{buttonStyle:"icon-label",className:`${d}__editButton`,disabled:g,el:"button",icon:"edit",onClick:()=>{p()},round:!0,size:"small",tooltip:u("lexical:blocks:inlineBlocks:edit",{label:b})}),[b,g,u,p]),T=D(()=>({children:o,className:c})=>n("div",{className:[d,d+"-"+t.blockType,c].filter(Boolean).join(" "),ref:ce,children:o}),[t.blockType]),Q=D(()=>v?()=>v:()=>n("div",{children:i?.labels?Z(i?.labels.singular,N):""}),[v,i?.labels,N]);return i?f(ye,{beforeSubmit:[async({formState:o})=>await q({formState:o,submit:!0})],disableValidationOnSubmit:!0,fields:i?.fields,initialState:a||{},onChange:[q],onSubmit:(o,c)=>{ue(o,c),p()},uuid:Te(),children:[n(Se,{children:n(Ce,{className:"",slug:V,title:u(`lexical:blocks:inlineBlocks:${t?.id?"edit":"create"}`,{label:b??u("lexical:blocks:inlineBlocks:label")}),children:a?f(Be,{children:[n(De,{fields:i?.fields,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:h,permissions:le,readOnly:!1}),n(we,{programmaticSubmit:!0,children:u("fields:saveChanges")})]}):null})}),z?n(ne.Provider,{value:{EditButton:G,initialState:a,InlineBlockContainer:T,Label:Q,nodeKey:l,RemoveButton:P},children:z}):f(T,{children:[a?n(Q,{}):n(Fe,{height:"15px",width:"40px"}),m.isEditable()?f("div",{className:`${d}__actions`,children:[n(G,{}),n(P,{})]}):null]})]}):f(T,{className:`${d}-not-found`,children:[f("span",{children:["Error: Block '",t.blockType,"' not found"]}),m.isEditable()?n("div",{className:`${d}__actions`,children:n(P,{})}):null]})};export{tt as a,nt as b,I as c,ge as d,Y as e};
2
- //# sourceMappingURL=chunk-KDV47ZNZ.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/blocks/client/componentInline/index.tsx", "../../../src/features/blocks/client/nodes/InlineBlocksNode.tsx", "../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nconst baseClass = 'inline-block'\n\nimport type { BlocksFieldClient, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n FormSubmit,\n RenderFields,\n ShimmerEffect,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\n\nimport './index.scss'\n\nimport { v4 as uuid } from 'uuid'\n\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\ntype Props = {\n /**\n * Can be modified by the node in order to trigger the re-fetch of the initial state based on the\n * formData. This is useful when node.setFields() is explicitly called from outside of the form - in\n * this case, the new field state is likely not reflected in the form state, so we need to re-fetch\n */\n readonly cacheBuster: number\n readonly formData: InlineBlockFields\n readonly nodeKey: string\n}\n\ntype InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.useContext(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<Props> = (props) => {\n const { cacheBuster, formData, nodeKey } = props\n\n const [editor] = useLexicalComposerContext()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: {\n featureClientSchemaMap,\n initialLexicalFormState,\n permissions,\n readOnly,\n schemaPath,\n },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(\n initialLexicalFormState?.[formData.id]?.formState,\n )\n\n useEffect(() => {\n setInitialState(false)\n }, [cacheBuster])\n\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n initialState?.['_components']?.customComponents?.BlockLabel,\n )\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n initialState?.['_components']?.customComponents?.Block,\n )\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient = clientSchemaMap[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock = blocksField?.blocks?.[0]\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlock?.fields?.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [\n clientBlock?.fields?.length,\n createdInlineBlock,\n nodeKey,\n setCreatedInlineBlock,\n toggleDrawer,\n ])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n globalSlug,\n operation: 'update',\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n setInitialState(state)\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n formState: prevFormState,\n globalSlug,\n operation: 'update',\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n\n return state\n },\n [getFormState, id, collectionSlug, getDocPreferences, globalSlug, schemaFieldsPath],\n )\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n })\n },\n [editor, nodeKey, formData],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [blockDisplayName, readOnly, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={readOnly}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [blockDisplayName, readOnly, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[baseClass, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [formData.blockType],\n )\n\n const Label = useMemo(() => {\n if (CustomLabel) {\n return () => CustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [CustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {editor.isEditable() ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={uuid()}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={permissions}\n readOnly={false}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {CustomBlock ? (\n <InlineBlockComponentContext.Provider\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {CustomBlock}\n </InlineBlockComponentContext.Provider>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {editor.isEditable() ? (\n <div className={`${baseClass}__actions`}>\n <EditButton />\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n", "'use client'\nimport type { EditorConfig, LexicalEditor, LexicalNode } from 'lexical'\n\nimport ObjectID from 'bson-objectid'\nimport React, { type JSX } from 'react'\n\nimport type {\n InlineBlockFields,\n SerializedInlineBlockNode,\n} from '../../server/nodes/InlineBlocksNode.js'\n\nimport { ServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nconst InlineBlockComponent = React.lazy(() =>\n import('../componentInline/index.js').then((module) => ({\n default: module.InlineBlockComponent,\n })),\n)\n\nexport class InlineBlockNode extends ServerInlineBlockNode {\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode {\n const node = $createInlineBlockNode(serializedNode.fields)\n return node\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <InlineBlockComponent\n cacheBuster={this.getCacheBuster()}\n formData={this.getFields()}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return super.exportJSON()\n }\n}\n\nexport function $createInlineBlockNode(fields: Exclude<InlineBlockFields, 'id'>): InlineBlockNode {\n return new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n })\n}\n\nexport function $isInlineBlockNode(\n node: InlineBlockNode | LexicalNode | null | undefined,\n): node is InlineBlockNode {\n return node instanceof InlineBlockNode\n}\n", "import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { DecoratorNode } from 'lexical'\n\nexport type InlineBlockFields<TInlineBlockFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TInlineBlockFields\n\nexport type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n fields: InlineBlockFields<TBlockFields>\n type: 'inlineBlock'\n },\n SerializedLexicalNode\n>\n\nexport class ServerInlineBlockNode extends DecoratorNode<null | React.ReactElement> {\n __cacheBuster: number\n __fields: InlineBlockFields\n\n constructor({\n cacheBuster,\n fields,\n key,\n }: {\n cacheBuster?: number\n fields: InlineBlockFields\n key?: NodeKey\n }) {\n super(key)\n this.__fields = fields\n this.__cacheBuster = cacheBuster || 0\n }\n\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return new this({\n cacheBuster: node.__cacheBuster,\n fields: node.__fields,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'inlineBlock'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode {\n const node = $createServerInlineBlockNode(serializedNode.fields)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n canIndent() {\n return true\n }\n override createDOM() {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n return element\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n return null\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return {\n type: 'inlineBlock',\n fields: this.getFields(),\n version: 1,\n }\n }\n\n getCacheBuster(): number {\n return this.getLatest().__cacheBuster\n }\n\n getFields(): InlineBlockFields {\n return this.getLatest().__fields\n }\n\n override getTextContent(): string {\n return `Block Field`\n }\n\n override isInline() {\n return true\n }\n\n setFields(fields: InlineBlockFields, preventFormStateUpdate?: boolean): void {\n const writable = this.getWritable()\n writable.__fields = fields\n if (!preventFormStateUpdate) {\n writable.__cacheBuster++\n }\n }\n\n override updateDOM(): boolean {\n return false\n }\n}\n\nexport function $createServerInlineBlockNode(\n fields: Exclude<InlineBlockFields, 'id'>,\n): ServerInlineBlockNode {\n return new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n })\n}\n\nexport function $isServerInlineBlockNode(\n node: LexicalNode | null | ServerInlineBlockNode | undefined,\n): node is ServerInlineBlockNode {\n return node instanceof ServerInlineBlockNode\n}\n"],
5
- "mappings": "iJAEA,OAAOA,GAASC,iBAAAA,GAAeC,eAAAA,EAAaC,aAAAA,EAAWC,WAAAA,EAASC,UAAAA,MAAc,QAK9E,OAASC,6BAAAA,OAAiC,wCAC1C,OAASC,kBAAAA,MAAsB,2BAC/B,OACEC,UAAAA,GACAC,UAAAA,GACAC,qBAAAA,GACAC,QAAAA,GACAC,oBAAAA,GACAC,cAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,mBAAAA,GACAC,gBAAAA,GACAC,sBAAAA,GACAC,kBAAAA,OACK,iBACP,OAASC,kBAAAA,MAAsB,wBAC/B,OAASC,iBAAAA,OAAqB,UAI9B,OAASC,MAAMC,OAAY,gDCzB3B,OAAOC,OAAc,gBACrB,OAAOC,OAAyB,QCUhC,OAAOC,OAAc,gBACrB,OAASC,iBAAAA,OAAqB,UAgBvB,IAAMC,EAAN,cAAoCD,EAAA,CACzCE,cACAC,SAEAC,YAAY,CACVC,YAAAA,EACAC,OAAAA,EACAC,IAAAA,CAAG,EAKF,CACD,MAAMA,CAAA,EACN,KAAKJ,SAAWG,EAChB,KAAKJ,cAAgBG,GAAe,CACtC,CAEA,OAAgBG,MAAMC,EAAoD,CACxE,OAAO,IAAI,K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6E,EAACP,EAAA,WACE9G,EAAe+F,EAACqB,EAAA,CAAA,CAAA,EAAWrB,EAACwC,GAAA,CAAcC,OAAO,OAAOC,MAAM,SAC9DhI,EAAOiI,WAAU,EAChBrB,EAAC,MAAA,CAAInB,UAAW,GAAGrG,CAAA,sBACjBkG,EAACa,EAAA,CAAA,CAAA,EACDb,EAACF,EAAA,CAAA,CAAA,CAAA,IAED,IAAA,OA1ERwB,EAACP,EAAA,CAAqBZ,UAAW,GAAGrG,CAAA,uBAClCwH,EAAC,OAAA,WAAK,iBAAe9G,EAASgD,UAAU,aAAA,IACvC9C,EAAOiI,WAAU,EAChB3C,EAAC,MAAA,CAAIG,UAAW,GAAGrG,CAAA,qBACjBkG,EAACF,EAAA,CAAA,CAAA,IAED,IAAA,GAyEZ",
6
- "names": ["React", "createContext", "useCallback", "useEffect", "useMemo", "useRef", "useLexicalComposerContext", "getTranslation", "Button", "Drawer", "EditDepthProvider", "Form", "formatDrawerSlug", "FormSubmit", "RenderFields", "ShimmerEffect", "useDocumentInfo", "useEditDepth", "useServerFunctions", "useTranslation", "abortAndIgnore", "$getNodeByKey", "v4", "uuid", "ObjectID", "React", "ObjectID", "DecoratorNode", "ServerInlineBlockNode", "__cacheBuster", "__fields", "constructor", "cacheBuster", "fields", "key", "clone", "node", "__key", "getType", "importDOM", "importJSON", "serializedNode", "$createServerInlineBlockNode", "isInline", "canIndent", "createDOM", "element", "document", "createElement", "classList", "add", "decorate", "editor", "config", "exportDOM", "text", "createTextNode", "getTextContent", "append", "exportJSON", "type", "getFields", "version", "getCacheBuster", "getLatest", "setFields", "preventFormStateUpdate", "writable", "getWritable", "updateDOM", "id", "default", "toHexString", "InlineBlockComponent", "React", "lazy", "then", "module", "default", "InlineBlockNode", "ServerInlineBlockNode", "clone", "node", "getType", "importJSON", "serializedNode", "$createInlineBlockNode", "fields", "decorate", "editor", "config", "_jsx", "cacheBuster", "getCacheBuster", "formData", "getFields", "nodeKey", "getKey", "exportJSON", "id", "ObjectID", "toHexString", "$isInlineBlockNode", "baseClass", "InlineBlockComponentContext", "createContext", "initialState", "useInlineBlockComponentContext", "React", "useContext", "InlineBlockComponent", "props", "cacheBuster", "formData", "nodeKey", "editor", "useLexicalComposerContext", "i18n", "t", "useTranslation", "createdInlineBlock", "fieldProps", "featureClientSchemaMap", "initialLexicalFormState", "permissions", "readOnly", "schemaPath", "setCreatedInlineBlock", "uuid", "uuidFromContext", "useEditorConfigContext", "getFormState", "useServerFunctions", "editDepth", "useEditDepth", "firstTimeDrawer", "useRef", "setInitialState", "useState", "id", "formState", "useEffect", "CustomLabel", "setCustomLabel", "customComponents", "BlockLabel", "CustomBlock", "setCustomBlock", "Block", "drawerSlug", "formatDrawerSlug", "slug", "depth", "toggleDrawer", "useLexicalDrawer", "inlineBlockElemElemRef", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "componentMapRenderedBlockPath", "blockType", "clientBlock", "blocks", "current", "getKey", "fields", "length", "undefined", "removeInlineBlock", "useCallback", "update", "$getNodeByKey", "remove", "blockDisplayName", "labels", "singular", "getTranslation", "onChangeAbortControllerRef", "AbortController", "schemaFieldsPath", "abortController", "state", "data", "docPermissions", "docPreferences", "operation", "renderAllFields", "signal", "abortAndIgnore", "onChange", "prevFormState", "submit", "controller", "onFormSubmit", "newData", "node", "$isInlineBlockNode", "setFields", "RemoveButton", "useMemo", "_jsx", "Button", "buttonStyle", "className", "disabled", "icon", "onClick", "e", "preventDefault", "round", "size", "tooltip", "label", "EditButton", "el", "InlineBlockContainer", "children", "filter", "Boolean", "join", "ref", "Label", "_jsxs", "Form", "beforeSubmit", "disableValidationOnSubmit", "onSubmit", "EditDepthProvider", "Drawer", "title", "_Fragment", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "FormSubmit", "programmaticSubmit", "Provider", "value", "ShimmerEffect", "height", "width", "isEditable"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as E}from"./chunk-3LGFOM34.js";import{c as U}from"react/compiler-runtime";import{jsx as D}from"react/jsx-runtime";import{Drawer as V,EditDepthProvider as B,useModal as q}from"@payloadcms/ui";import"react";import{jsx as I,jsxs as j}from"react/jsx-runtime";import{Form as v,FormSubmit as M,RenderFields as O,useDocumentInfo as T,useServerFunctions as $,useTranslation as N}from"@payloadcms/ui";import{abortAndIgnore as x}from"@payloadcms/ui/shared";import{useCallback as W,useEffect as y,useRef as k,useState as H}from"react";import{v4 as L}from"uuid";var F=({data:a,featureKey:e,fieldMapOverride:n,handleDrawerSubmit:s,schemaFieldsPathOverride:t,schemaPath:d,schemaPathSuffix:m})=>{let{t:p}=N(),{id:l,collectionSlug:c,getDocPreferences:u,globalSlug:i}=T(),o=k(new AbortController),[f,r]=H(!1),{fieldProps:{featureClientSchemaMap:h,permissions:A}}=E(),{getFormState:S}=$(),g=t??`${d}.lexical_internal_feature.${e}${m?`.${m}`:""}`,b=n??h[e]?.[g];y(()=>{let C=new AbortController;return(async()=>{let{state:_}=await S({id:l,collectionSlug:c,data:a??{},docPermissions:{fields:!0},docPreferences:await u(),globalSlug:i,operation:"update",renderAllFields:!0,schemaPath:g,signal:C.signal});r(_)})(),()=>{x(C)}},[g,l,a,S,c,i,u]);let R=W(async({formState:C})=>{x(o.current);let P=new AbortController;o.current=P;let{state:_}=await S({id:l,collectionSlug:c,docPermissions:{fields:!0},docPreferences:await u(),formState:C,globalSlug:i,operation:"update",schemaPath:g,signal:P.signal});return _||C},[S,l,c,u,i,g]);return y(()=>()=>{x(o.current)},[]),f===!1?null:j(v,{beforeSubmit:[R],disableValidationOnSubmit:!0,fields:Array.isArray(b)?b:[],initialState:f,onChange:[R],onSubmit:s,uuid:L(),children:[I(O,{fields:Array.isArray(b)?b:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:g,permissions:A,readOnly:!1}),I(M,{children:p("fields:saveChanges")})]})};var pe=a=>{let e=U(15),{className:n,data:s,drawerSlug:t,drawerTitle:d,featureKey:m,fieldMapOverride:p,handleDrawerSubmit:l,schemaFieldsPathOverride:c,schemaPath:u,schemaPathSuffix:i}=a,{closeModal:o}=q(),f=d??"",r;e[0]!==o||e[1]!==t||e[2]!==l?(r=(A,S)=>{o(t),setTimeout(()=>{l(A,S)},1)},e[0]=o,e[1]=t,e[2]=l,e[3]=r):r=e[3];let h;return e[4]!==n||e[5]!==s||e[6]!==t||e[7]!==m||e[8]!==p||e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==f||e[13]!==r?(h=D(B,{children:D(V,{className:n,slug:t,title:f,children:D(F,{data:s,featureKey:m,fieldMapOverride:p,handleDrawerSubmit:r,schemaFieldsPathOverride:c,schemaPath:u,schemaPathSuffix:i})})}),e[4]=n,e[5]=s,e[6]=t,e[7]=m,e[8]=p,e[9]=c,e[10]=u,e[11]=i,e[12]=f,e[13]=r,e[14]=h):h=e[14],h};import{c as z}from"react/compiler-runtime";import{jsx as G}from"react/jsx-runtime";import{useAuth as J,useConfig as K,useEntityVisibility as Q}from"@payloadcms/ui";import*as w from"react";var X=(a,e)=>a.filter(({slug:n,admin:{enableRichTextRelationship:s},upload:t})=>e?.visibleEntities.collections.includes(n)?e?.uploads?s&&!!t:t?!1:s:!1),be=a=>{let e=z(20),n,s,t,d;e[0]!==a?({children:s,FallbackComponent:n,uploads:d,...t}=a,e[0]=a,e[1]=n,e[2]=s,e[3]=t,e[4]=d):(n=e[1],s=e[2],t=e[3],d=e[4]);let m=d===void 0?!1:d,{config:p}=K(),{collections:l}=p,{user:c}=J(),{visibleEntities:u}=Q(),i;e[5]!==l||e[6]!==m||e[7]!==c||e[8]!==u?(i=()=>X(l,{uploads:m,user:c,visibleEntities:u}).map(Y),e[5]=l,e[6]=m,e[7]=c,e[8]=u,e[9]=i):i=e[9];let[o]=w.useState(i);if(!o.length){let r;return e[10]!==n||e[11]!==t?(r=n?G(n,{...t}):null,e[10]=n,e[11]=t,e[12]=r):r=e[12],r}let f;if(e[13]!==s||e[14]!==o||e[15]!==t){let r;e[17]!==o||e[18]!==t?(r={...t,enabledCollectionSlugs:o},e[17]=o,e[18]=t,e[19]=r):r=e[19],f=w.cloneElement(s,r),e[13]=s,e[14]=o,e[15]=t,e[16]=f}else f=e[16];return f};function Y(a){let{slug:e}=a;return e}import{createCommand as Z}from"lexical";var Ae=Z("INSERT_UPLOAD_WITH_DRAWER_COMMAND");export{pe as a,be as b,Ae as c};
2
- //# sourceMappingURL=chunk-QP2NYEWJ.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/client/utils/EnabledRelationshipsCondition.tsx", "../../../src/features/upload/client/drawer/commands.ts"],
4
- "sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer, EditDepthProvider, useModal } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPath: string\n readonly 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 fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { closeModal } = useModal()\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 <EditDepthProvider>\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={(args, args2) => {\n // Simply close drawer - no need for useLexicalDrawer here as at this point,\n // we don't need to restore the cursor position. This is handled by the useEffect in useLexicalDrawer.\n closeModal(drawerSlug)\n\n // Actual drawer submit logic needs to be triggered after the drawer is closed.\n // That's because the lexical selection / cursor restore logic that is striggerer by\n // `useLexicalDrawer` neeeds to be triggered before any editor.update calls that may happen\n // in the `handleDrawerSubmit` function.\n setTimeout(() => {\n handleDrawerSubmit(args, args2)\n }, 1)\n }}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPath={schemaPath}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n </EditDepthProvider>\n )\n}\n", "'use client'\nimport type { FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useDocumentInfo,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useRef, 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 fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n const [initialState, setInitialState] = useState<false | FormState | undefined>(false)\n\n const {\n fieldProps: { featureClientSchemaMap, permissions },\n } = useEditorConfigContext()\n\n const { getFormState } = useServerFunctions()\n\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any = fieldMapOverride ?? featureClientSchemaMap[featureKey]?.[schemaFieldsPath] // Field Schema\n\n useEffect(() => {\n const controller = new AbortController()\n\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: data ?? {},\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n globalSlug,\n operation: 'update',\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n\n return () => {\n abortAndIgnore(controller)\n }\n }, [schemaFieldsPath, id, data, getFormState, collectionSlug, globalSlug, getDocPreferences])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }: { formState: FormState }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n formState: prevFormState,\n globalSlug,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n return state\n },\n [getFormState, id, collectionSlug, getDocPreferences, globalSlug, schemaFieldsPath],\n )\n\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={permissions}\n readOnly={false}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n", "'use client'\nimport 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<{\n children: any\n FallbackComponent?: React.FC\n uploads?: boolean\n}> = (props) => {\n const { children, FallbackComponent, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user: user!, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return FallbackComponent ? <FallbackComponent {...rest} /> : 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"],
5
- "mappings": "wCAAA,OAAAA,KAAAC,MAAA,iEAGA,OAASC,UAAAA,EAAQC,qBAAAA,EAAmBC,YAAAA,MAAgB,iBACpD,MAAkB,0DCDlB,OACEC,QAAAA,EACAC,cAAAA,EACAC,gBAAAA,EACAC,mBAAAA,EACAC,sBAAAA,EACAC,kBAAAA,MACK,i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AD,EAAA,EAAA,IAAAG,GACIY,EAAAd,EAAoBe,EAACf,EAAA,CAAA,GAAsBE,CAAI,CAAA,EAAA,KAAOH,EAAA,EAAA,EAAAC,EAAAD,EAAA,EAAA,EAAAG,EAAAH,EAAA,EAAA,EAAAe,GAAAA,EAAAf,EAAA,EAAA,EAAtDe,CAAsD,CAAA,IAAAA,EAAA,GAAAf,EAAA,EAAA,IAAAE,GAAAF,EAAA,EAAA,IAAAY,GAAAZ,EAAA,EAAA,IAAAG,EAAA,CAAA,IAAAc,EAAAjB,EAAA,EAAA,IAAAY,GAAAZ,EAAA,EAAA,IAAAG,GAG3Bc,EAAA,CAAA,GAAKd,EAAIS,uBAAAA,CAAA,EAAyBZ,EAAA,EAAA,EAAAY,EAAAZ,EAAA,EAAA,EAAAG,EAAAH,EAAA,EAAA,EAAAiB,GAAAA,EAAAjB,EAAA,EAAA,EAA/De,EAAAG,eAAmBhB,EAAUe,CAAkC,EAAAjB,EAAA,EAAA,EAAAE,EAAAF,EAAA,EAAA,EAAAY,EAAAZ,EAAA,EAAA,EAAAG,EAAAH,EAAA,EAAA,EAAAe,CAAA,MAAAA,EAAAf,EAAA,EAAA,EAAA,OAA/De,CAA+D,EAlBnE,SAAAJ,EAAAP,EAAA,CAUE,GAAA,CAAAd,KAAAA,CAAA,EAAAc,EAAQ,OAAKd,CAAA,CC1CpB,OAAS6B,iBAAAA,MAAqB,UAEvB,IAAMC,GAERD,EAAc,mCAAA",
6
- "names": ["c", "_c", "Drawer", "EditDepthProvider", "useModal", "Form", "FormSubmit", "RenderFields", "useDocumentInfo", "useServerFunctions", "useTranslation", "abortAndIgnore", "useCallback", "useEffect", "useRef", "useState", "v4", "uuid", "DrawerContent", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "t", "useTranslation", "id", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "onChangeAbortControllerRef", "useRef", "AbortController", "initialState", "setInitialState", "useState", "fieldProps", "featureClientSchemaMap", "permissions", "useEditorConfigContext", "getFormState", "useServerFunctions", "schemaFieldsPath", "fields", "useEffect", "controller", "state", "docPermissions", "docPreferences", "operation", "renderAllFields", "signal", "abortAndIgnore", "onChange", "useCallback", "formState", "prevFormState", "current", "_jsxs", "Form", "beforeSubmit", "disableValidationOnSubmit", "Array", "isArray", "onSubmit", "uuid", "_jsx", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "readOnly", "FormSubmit", "FieldsDrawer", "t0", "$", "_c", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "closeModal", "useModal", "t1", "t2", "args", "args2", "setTimeout", "t3", "_jsx", "EditDepthProvider", "children", "Drawer", "slug", "title", "DrawerContent", "c", "_c", "useAuth", "useConfig", "useEntityVisibility", "React", "filterRichTextCollections", "collections", "options", "filter", "slug", "admin", "enableRichTextRelationship", "upload", "visibleEntities", "includes", "uploads", "Boolean", "EnabledRelationshipsCondition", "props", "$", "FallbackComponent", "children", "rest", "t0", "undefined", "config", "t1", "user", "t2", "map", "_temp", "enabledCollectionSlugs", "useState", "length", "t3", "_jsx", "t4", "cloneElement", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";import{a,b}from"./chunk-KDV47ZNZ.js";import"./chunk-INBEEENE.js";import"./chunk-3LGFOM34.js";export{b as InlineBlockComponent,a as useInlineBlockComponentContext};
2
- //# sourceMappingURL=componentInline-DTNGYZCL.js.map