@bigbinary/neeto-molecules 3.9.11 → 3.9.13
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/DocumentEditor.js +5 -4
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/Schedule.js +199 -182
- package/dist/Schedule.js.map +1 -1
- package/dist/cjs/DocumentEditor.js +5 -4
- package/dist/cjs/DocumentEditor.js.map +1 -1
- package/dist/cjs/Schedule.js +196 -179
- package/dist/cjs/Schedule.js.map +1 -1
- package/package.json +1 -1
- package/types/DocumentEditor.d.ts +1 -0
package/dist/DocumentEditor.js
CHANGED
|
@@ -108,7 +108,8 @@ var Editor = function Editor(_ref) {
|
|
|
108
108
|
_ref$editorProps = _ref.editorProps,
|
|
109
109
|
customEditorProps = _ref$editorProps === void 0 ? {} : _ref$editorProps,
|
|
110
110
|
_ref$titleProps = _ref.titleProps,
|
|
111
|
-
titleProps = _ref$titleProps === void 0 ? {} : _ref$titleProps
|
|
111
|
+
titleProps = _ref$titleProps === void 0 ? {} : _ref$titleProps,
|
|
112
|
+
children = _ref.children;
|
|
112
113
|
var _useTranslation = useTranslation(),
|
|
113
114
|
t = _useTranslation.t;
|
|
114
115
|
var titleRef = useRef();
|
|
@@ -155,7 +156,7 @@ var Editor = function Editor(_ref) {
|
|
|
155
156
|
className: "neeto-molecules-document__wrapper",
|
|
156
157
|
"data-testid": "document-editor-container",
|
|
157
158
|
ref: editorHotkeyRef,
|
|
158
|
-
children: /*#__PURE__*/
|
|
159
|
+
children: /*#__PURE__*/jsxs(FormikEditor, _objectSpread(_objectSpread({
|
|
159
160
|
attachmentsClassName: "editor-content-attachments w-full flex-shrink-0",
|
|
160
161
|
className: "h-full w-full",
|
|
161
162
|
contentClassName: "editor-content__wrapper neeto-molecules-document__container",
|
|
@@ -173,7 +174,7 @@ var Editor = function Editor(_ref) {
|
|
|
173
174
|
contentWrapperClassName: "w-full flex flex-col flex-grow",
|
|
174
175
|
onChange: handleContentChange,
|
|
175
176
|
onChangeAttachments: handleAttachmentChange,
|
|
176
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
177
|
+
children: [children, /*#__PURE__*/jsxs("div", {
|
|
177
178
|
className: "neeto-molecules-document__container px-4",
|
|
178
179
|
children: [/*#__PURE__*/jsx(Textarea, _objectSpread({
|
|
179
180
|
nakedTextarea: true,
|
|
@@ -193,7 +194,7 @@ var Editor = function Editor(_ref) {
|
|
|
193
194
|
style: "body3",
|
|
194
195
|
children: errors[editorContentFieldName]
|
|
195
196
|
})]
|
|
196
|
-
})
|
|
197
|
+
})]
|
|
197
198
|
}))
|
|
198
199
|
});
|
|
199
200
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditor.js","sources":["../src/components/DocumentEditor/constants.js","../src/components/DocumentEditor/hooks/useEditor.js","../src/components/DocumentEditor/utils.js","../src/components/DocumentEditor/index.jsx"],"sourcesContent":["export const EDITOR_ADDONS = [\n \"highlight\",\n \"emoji\",\n \"video-upload\",\n \"code-block\",\n \"block-quote\",\n \"image-upload\",\n \"image-upload-unsplash\",\n \"divider\",\n \"video-embed\",\n \"undo\",\n \"redo\",\n \"table\",\n];\n\nexport const DEFAULT_EDITOR_PROPS = {\n isCharacterCountActive: true,\n isMenuIndependent: true,\n addons: [],\n size: \"medium\",\n};\n","import { useCallback } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = useCallback(\n content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n },\n [editorContentFieldName, onContentChange, setFieldValue]\n );\n\n const handleAttachmentChange = useCallback(\n attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n },\n [onAttachmentChange, setAttachments, setFieldValue]\n );\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const handleEditorBackspaceKeypress = () => {\n const editor = editorRef.current?.editor;\n const selection = editor?.state?.selection;\n if (\n editor?.isFocused &&\n isPresent(titleRef.current) &&\n selection?.anchor === 1\n ) {\n const title = titleRef.current.value;\n titleRef.current.focus();\n titleRef.current.setSelectionRange(title?.length, title?.length);\n }\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => {\n editorRef.current?.editor?.commands?.insertContentAt(0, \"<p />\");\n editorRef.current?.editor?.commands?.focus(\"start\");\n },\n { mode: \"scoped\" }\n );\n\n const editorHotkeyRef = useHotkeys(\n \"backspace\",\n handleEditorBackspaceKeypress,\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DEFAULT_EDITOR_PROPS, EDITOR_ADDONS } from \"./constants\";\nimport \"./editor.scss\";\nimport useEditor from \"./hooks/useEditor\";\nimport { getUniqueAttachments } from \"./utils\";\n\nconst Editor = ({\n attachments: initialAttachments,\n onContentChange,\n onAttachmentChange,\n onTitleChange,\n getTitleRef = noop,\n getEditorRef = noop,\n menuClassName,\n editorContentFieldName = \"htmlContent\",\n titleFieldName = \"title\",\n editorProps: customEditorProps = {},\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const editorProps = mergeRight(DEFAULT_EDITOR_PROPS, customEditorProps);\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n useEffect(() => {\n setAttachments(getUniqueAttachments(initialAttachments));\n }, [initialAttachments]);\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = useCallback(node => {\n editorRef.current = node;\n getEditorRef(node);\n }, []);\n\n const addons = useMemo(\n () => EDITOR_ADDONS.concat(editorProps.addons || []),\n [editorProps.addons]\n );\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n ref={editorHotkeyRef}\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments w-full flex-shrink-0\"\n className=\"h-full w-full\"\n contentClassName=\"editor-content__wrapper neeto-molecules-document__container\"\n data-cy=\"neeto-molecules-document-content-text-area\"\n error={undefined}\n errorWrapperClassName=\"w-full min-h-full flex flex-col items-center\"\n name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps, addons }}\n contentWrapperClassName=\"w-full flex flex-col flex-grow\"\n onChange={handleContentChange}\n onChangeAttachments={handleAttachmentChange}\n >\n <div className=\"neeto-molecules-document__container px-4\">\n <Textarea\n nakedTextarea\n className=\"neeto-molecules-document__title\"\n data-cy=\"neeto-molecules-document-title-text-field\"\n name={titleFieldName}\n ref={setTitleRef}\n rows={1}\n placeholder={\n titleProps.placeholder || t(\"neetoMolecules.documentEditor.title\")\n }\n onChange={handleTitleChange}\n onKeyDown={e =>\n e.key === \"Enter\" && !e.shiftKey && e.preventDefault()\n }\n {...titleProps}\n />\n {errors[editorContentFieldName] && (\n <Typography\n className=\"neeto-ui-input__error neeto-molecules-editor-content__error\"\n data-cy=\"articles-content-input-error\"\n style=\"body3\"\n >\n {errors[editorContentFieldName]}\n </Typography>\n )}\n </div>\n </FormikEditor>\n </div>\n );\n};\n\nEditor.propTypes = {\n /**\n * List of initial attachments.\n */\n attachments: PropTypes.arrayOf(\n PropTypes.shape({\n contentType: PropTypes.string,\n filename: PropTypes.string,\n signedId: PropTypes.string,\n url: PropTypes.string,\n })\n ),\n /**\n * Callback that will be triggered when the editor content changes.\n * This function is not throttled.\n */\n onContentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the attachments changes.\n */\n onAttachmentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the article title changes.\n */\n onTitleChange: PropTypes.func,\n /**\n * This function will be called with the title node reference.\n */\n getTitleRef: PropTypes.func,\n /**\n * This function will be called with editor reference.\n */\n getEditorRef: PropTypes.func,\n /**\n * Formik field name of the editor. The default value is `htmlContent`.\n */\n editorContentFieldName: PropTypes.string,\n /**\n * Formik field name of the title. The default value is `title`.\n */\n titleFieldName: PropTypes.string,\n /**\n * These props will be passed down to the editor component.\n */\n editorProps: PropTypes.object,\n /**\n * These props will be passed down to the title text area component.\n */\n titleProps: PropTypes.object,\n /**\n * A prop to pass class names to the editor menubar.\n */\n menuClassName: PropTypes.string,\n};\n\nEditor.displayName = \"DocumentEditor\";\n\nexport default memo(Editor);\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","size","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","titleRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","useCallback","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","handleEditorBackspaceKeypress","_editorRef$current","_editor$state","editor","current","selection","state","isFocused","isPresent","anchor","focus","setSelectionRange","length","titleHotkeyRef","useHotkeys","_editorRef$current2","_editorRef$current2$e","_editorRef$current2$e2","_editorRef$current3","_editorRef$current3$e","_editorRef$current3$e2","commands","insertContentAt","mode","editorHotkeyRef","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","menuClassName","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","customEditorProps","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","useRef","mergeRight","_useState","useState","_useState2","_slicedToArray","useEffect","_useEditor","setTitleRef","node","setEditorRef","useMemo","concat","_jsx","className","ref","children","FormikEditor","attachmentsClassName","contentClassName","error","undefined","errorWrapperClassName","name","classNames","contentWrapperClassName","onChange","onChangeAttachments","_jsxs","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style","displayName","memo"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG,CAC3B,WAAW,EACX,OAAO,EACP,cAAc,EACd,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,MAAM,EACN,MAAM,EACN,OAAO,CACR,CAAA;AAEM,IAAMC,oBAAoB,GAAG;AAClCC,EAAAA,sBAAsB,EAAE,IAAI;AAC5BC,EAAAA,iBAAiB,EAAE,IAAI;AACvBC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,IAAI,EAAE,QAAA;AACR,CAAC;;;;;ACdD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAST;AAAA,EAAA,IARJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAA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IAAI,EAAE5F,cAAe;AACrBoF,UAAAA,GAAG,EAAEP,WAAY;AACjBuB,UAAAA,IAAI,EAAE,CAAE;UACRC,WAAW,EACTpC,UAAU,CAACoC,WAAW,IAAIjC,CAAC,CAAC,qCAAqC,CAClE;AACD2B,UAAAA,QAAQ,EAAEnF,iBAAkB;AAC5B0F,UAAAA,SAAS,EAAE,SAAXA,SAASA,CAAEC,CAAC,EAAA;AAAA,YAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,WAAA;SAEpDzC,EAAAA,UAAU,CACf,CAAC,EACD3D,MAAM,CAACV,sBAAsB,CAAC,iBAC7BsF,GAAA,CAACyB,UAAU,EAAA;AACTxB,UAAAA,SAAS,EAAC,6DAA6D;AACvE,UAAA,SAAA,EAAQ,8BAA8B;AACtCyB,UAAAA,KAAK,EAAC,OAAO;UAAAvB,QAAA,EAEZ/E,MAAM,CAACV,sBAAsB,CAAA;AAAC,SACrB,CACb,CAAA;OACE,CAAA;KACO,CAAA,CAAA;AAAC,GACZ,CAAC,CAAA;AAEV,CAAC,CAAA;AAyDDuD,MAAM,CAAC0D,WAAW,GAAG,gBAAgB,CAAA;AAErC,YAAeC,aAAAA,IAAI,CAAC3D,MAAM,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentEditor.js","sources":["../src/components/DocumentEditor/constants.js","../src/components/DocumentEditor/hooks/useEditor.js","../src/components/DocumentEditor/utils.js","../src/components/DocumentEditor/index.jsx"],"sourcesContent":["export const EDITOR_ADDONS = [\n \"highlight\",\n \"emoji\",\n \"video-upload\",\n \"code-block\",\n \"block-quote\",\n \"image-upload\",\n \"image-upload-unsplash\",\n \"divider\",\n \"video-embed\",\n \"undo\",\n \"redo\",\n \"table\",\n];\n\nexport const DEFAULT_EDITOR_PROPS = {\n isCharacterCountActive: true,\n isMenuIndependent: true,\n addons: [],\n size: \"medium\",\n};\n","import { useCallback } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = useCallback(\n content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n },\n [editorContentFieldName, onContentChange, setFieldValue]\n );\n\n const handleAttachmentChange = useCallback(\n attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n },\n [onAttachmentChange, setAttachments, setFieldValue]\n );\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const handleEditorBackspaceKeypress = () => {\n const editor = editorRef.current?.editor;\n const selection = editor?.state?.selection;\n if (\n editor?.isFocused &&\n isPresent(titleRef.current) &&\n selection?.anchor === 1\n ) {\n const title = titleRef.current.value;\n titleRef.current.focus();\n titleRef.current.setSelectionRange(title?.length, title?.length);\n }\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => {\n editorRef.current?.editor?.commands?.insertContentAt(0, \"<p />\");\n editorRef.current?.editor?.commands?.focus(\"start\");\n },\n { mode: \"scoped\" }\n );\n\n const editorHotkeyRef = useHotkeys(\n \"backspace\",\n handleEditorBackspaceKeypress,\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { mergeRight } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DEFAULT_EDITOR_PROPS, EDITOR_ADDONS } from \"./constants\";\nimport \"./editor.scss\";\nimport useEditor from \"./hooks/useEditor\";\nimport { getUniqueAttachments } from \"./utils\";\n\nconst Editor = ({\n attachments: initialAttachments,\n onContentChange,\n onAttachmentChange,\n onTitleChange,\n getTitleRef = noop,\n getEditorRef = noop,\n menuClassName,\n editorContentFieldName = \"htmlContent\",\n titleFieldName = \"title\",\n editorProps: customEditorProps = {},\n titleProps = {},\n children,\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const editorProps = mergeRight(DEFAULT_EDITOR_PROPS, customEditorProps);\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n useEffect(() => {\n setAttachments(getUniqueAttachments(initialAttachments));\n }, [initialAttachments]);\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = useCallback(node => {\n editorRef.current = node;\n getEditorRef(node);\n }, []);\n\n const addons = useMemo(\n () => EDITOR_ADDONS.concat(editorProps.addons || []),\n [editorProps.addons]\n );\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n ref={editorHotkeyRef}\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments w-full flex-shrink-0\"\n className=\"h-full w-full\"\n contentClassName=\"editor-content__wrapper neeto-molecules-document__container\"\n data-cy=\"neeto-molecules-document-content-text-area\"\n error={undefined}\n errorWrapperClassName=\"w-full min-h-full flex flex-col items-center\"\n name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps, addons }}\n contentWrapperClassName=\"w-full flex flex-col flex-grow\"\n onChange={handleContentChange}\n onChangeAttachments={handleAttachmentChange}\n >\n {children}\n <div className=\"neeto-molecules-document__container px-4\">\n <Textarea\n nakedTextarea\n className=\"neeto-molecules-document__title\"\n data-cy=\"neeto-molecules-document-title-text-field\"\n name={titleFieldName}\n ref={setTitleRef}\n rows={1}\n placeholder={\n titleProps.placeholder || t(\"neetoMolecules.documentEditor.title\")\n }\n onChange={handleTitleChange}\n onKeyDown={e =>\n e.key === \"Enter\" && !e.shiftKey && e.preventDefault()\n }\n {...titleProps}\n />\n {errors[editorContentFieldName] && (\n <Typography\n className=\"neeto-ui-input__error neeto-molecules-editor-content__error\"\n data-cy=\"articles-content-input-error\"\n style=\"body3\"\n >\n {errors[editorContentFieldName]}\n </Typography>\n )}\n </div>\n </FormikEditor>\n </div>\n );\n};\n\nEditor.propTypes = {\n /**\n * List of initial attachments.\n */\n attachments: PropTypes.arrayOf(\n PropTypes.shape({\n contentType: PropTypes.string,\n filename: PropTypes.string,\n signedId: PropTypes.string,\n url: PropTypes.string,\n })\n ),\n /**\n * Callback that will be triggered when the editor content changes.\n * This function is not throttled.\n */\n onContentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the attachments changes.\n */\n onAttachmentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the article title changes.\n */\n onTitleChange: PropTypes.func,\n /**\n * This function will be called with the title node reference.\n */\n getTitleRef: PropTypes.func,\n /**\n * This function will be called with editor reference.\n */\n getEditorRef: PropTypes.func,\n /**\n * Formik field name of the editor. The default value is `htmlContent`.\n */\n editorContentFieldName: PropTypes.string,\n /**\n * Formik field name of the title. The default value is `title`.\n */\n titleFieldName: PropTypes.string,\n /**\n * These props will be passed down to the editor component.\n */\n editorProps: PropTypes.object,\n /**\n * These props will be passed down to the title text area component.\n */\n titleProps: PropTypes.object,\n /**\n * A prop to pass class names to the editor menubar.\n */\n menuClassName: PropTypes.string,\n /**\n * The children will be rendered above the title input field.\n */\n children: PropTypes.node,\n};\n\nEditor.displayName = \"DocumentEditor\";\n\nexport default memo(Editor);\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","size","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","titleRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","useCallback","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","handleEditorBackspaceKeypress","_editorRef$current","_editor$state","editor","current","selection","state","isFocused","isPresent","anchor","focus","setSelectionRange","length","titleHotkeyRef","useHotkeys","_editorRef$current2","_editorRef$current2$e","_editorRef$current2$e2","_editorRef$current3","_editorRef$current3$e","_editorRef$current3$e2","commands","insertContentAt","mode","editorHotkeyRef","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","menuClassName","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","customEditorProps","_ref$titleProps","titleProps","children","_useTranslation","useTranslation","t","useRef","mergeRight","_useState","useState","_useState2","_slicedToArray","useEffect","_useEditor","setTitleRef","node","setEditorRef","useMemo","concat","_jsx","className","ref","_jsxs","FormikEditor","attachmentsClassName","contentClassName","error","undefined","errorWrapperClassName","name","classNames","contentWrapperClassName","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style","displayName","memo"],"mappings":";;;;;;;;;;;;;;;AAAO,IAAMA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