@bigbinary/neeto-editor 1.47.12 → 1.47.14
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/Editor.js +227 -69
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +1 -1
- package/dist/FormikEditor.js +2 -1
- package/dist/FormikEditor.js.map +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{chunk-Db3trsz6.js → chunk-CBY2h1zh.js} +2 -2
- package/dist/{chunk-Db3trsz6.js.map → chunk-CBY2h1zh.js.map} +1 -1
- package/dist/{chunk-DpvlQ94X.js → chunk-DmstYxyh.js} +2 -2
- package/dist/{chunk-DpvlQ94X.js.map → chunk-DmstYxyh.js.map} +1 -1
- package/dist/cjs/Editor.cjs.js +227 -69
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +1 -1
- package/dist/cjs/FormikEditor.cjs.js +2 -1
- package/dist/cjs/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/Menu.cjs.js +1 -1
- package/dist/cjs/{chunk-DnuP-Z6c.cjs.js → chunk-26e51eTo.cjs.js} +2 -1
- package/dist/cjs/{chunk-DnuP-Z6c.cjs.js.map → chunk-26e51eTo.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-DBc-t5t0.cjs.js → chunk-CWE188ZD.cjs.js} +2 -2
- package/dist/cjs/{chunk-DBc-t5t0.cjs.js.map → chunk-CWE188ZD.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +8 -7
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/utils.cjs.js +1 -1
- package/dist/editor-stats.html +1 -19
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +10 -1
package/dist/EditorContent.js
CHANGED
|
@@ -11,7 +11,7 @@ import { a as EDITOR_SIZES } from './chunk-CJu3yusL.js';
|
|
|
11
11
|
import { n } from './chunk-DmrvuTKK.js';
|
|
12
12
|
import '@bigbinary/neeto-cist';
|
|
13
13
|
import './chunk-BegQDClu.js';
|
|
14
|
-
import { c as convertPlainTextToHtml, s as substituteVariables, a as applySyntaxHighlightingAndLineNumbers, b as applyLineHighlighting } from './chunk-
|
|
14
|
+
import { c as convertPlainTextToHtml, s as substituteVariables, a as applySyntaxHighlightingAndLineNumbers, b as applyLineHighlighting } from './chunk-CBY2h1zh.js';
|
|
15
15
|
import { r as removeEmptyTags, E as EDITOR_CONTENT_CLASS_NAME, S as SANITIZE_OPTIONS, b as EDITOR_CONTENT_DEFAULT_CONFIGURATION } from './chunk-BCoBS5ED.js';
|
|
16
16
|
import { useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
17
17
|
import Close from '@bigbinary/neeto-icons/Close';
|
package/dist/FormikEditor.js
CHANGED
|
@@ -8,7 +8,7 @@ import Editor from './Editor.js';
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
10
10
|
import '@babel/runtime/helpers/slicedToArray';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-DmstYxyh.js';
|
|
12
12
|
import './chunk-DmrvuTKK.js';
|
|
13
13
|
import 'i18next';
|
|
14
14
|
import '@bigbinary/neeto-icons/TextH1';
|
|
@@ -97,6 +97,7 @@ import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
|
97
97
|
import '@bigbinary/neeto-icons/Blockquote';
|
|
98
98
|
import '@bigbinary/neeto-icons/Minus';
|
|
99
99
|
import '@bigbinary/neeto-icons/Notes';
|
|
100
|
+
import '@bigbinary/neeto-icons/MessageSquare';
|
|
100
101
|
import '@bigbinary/neeto-icons/DeleteRow';
|
|
101
102
|
import '@bigbinary/neeto-icons/DeleteColumn';
|
|
102
103
|
import '@bigbinary/neeto-icons/DeleteTable';
|
package/dist/FormikEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikEditor.js","sources":["../src/components/Editor/FormikEditor.jsx"],"sourcesContent":["import { forwardRef, memo } from \"react\";\n\nimport { FastField } from \"formik\";\nimport { noop } from \"neetocist\";\nimport { path } from \"ramda\";\n\nimport Editor from \".\";\n\nconst FormikEditor = (\n {\n name,\n onChange = noop,\n shouldUpdate,\n attachments = [],\n mentions = [],\n variables = [],\n ...otherProps\n },\n ref\n) => {\n // Similar to the `shouldComponentUpdate` logic of FastField component.\n // https://github.com/jaredpalmer/formik/blob/main/packages/formik/src/FastField.tsx#L75-L93\n // Additionally calls the shouldUpdate function passed from the host application and compares to\n // the rest of the values.\n const internalShouldUpdate = (prevProps, nextProps) => {\n const prevFormikProps = prevProps.formik;\n const nextFormikProps = nextProps.formik;\n\n const pathParts = name.split(\".\");\n const prevError = path(pathParts, prevFormikProps.errors);\n const nextError = path(pathParts, nextFormikProps.errors);\n const prevTouched = path(pathParts, prevFormikProps.touched);\n const nextTouched = path(pathParts, nextFormikProps.touched);\n\n return (\n prevError !== nextError ||\n prevTouched !== nextTouched ||\n Object.keys(nextProps).length !== Object.keys(prevProps).length ||\n prevFormikProps.isSubmitting !== nextFormikProps.isSubmitting ||\n Boolean(shouldUpdate?.(prevProps, nextProps))\n );\n };\n\n return (\n <FastField\n {...{ attachments, mentions, name, variables }}\n shouldUpdate={internalShouldUpdate}\n >\n {({ field, form, meta }) => (\n <Editor\n {...{ attachments, mentions, name, ref, variables }}\n error={meta.touched ? meta.error : \"\"}\n initialValue={field.value}\n onBlur={() => {\n form.setFieldTouched(name, true);\n }}\n onChange={value => {\n form.setFieldValue(name, value);\n onChange?.(value);\n }}\n {...otherProps}\n />\n )}\n </FastField>\n );\n};\n\nFormikEditor.displayName = \"FormikNeetoEditor\";\n\nexport default memo(forwardRef(FormikEditor));\n"],"names":["FormikEditor","_ref","ref","name","_ref$onChange","onChange","noop","shouldUpdate","_ref$attachments","attachments","_ref$mentions","mentions","_ref$variables","variables","otherProps","_objectWithoutProperties","_excluded","internalShouldUpdate","prevProps","nextProps","prevFormikProps","formik","nextFormikProps","pathParts","split","prevError","path","errors","nextError","prevTouched","touched","nextTouched","Object","keys","length","isSubmitting","Boolean","_jsx","FastField","children","_ref2","field","form","meta","Editor","_objectSpread","error","initialValue","value","onBlur","setFieldTouched","setFieldValue","displayName","memo","forwardRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormikEditor.js","sources":["../src/components/Editor/FormikEditor.jsx"],"sourcesContent":["import { forwardRef, memo } from \"react\";\n\nimport { FastField } from \"formik\";\nimport { noop } from \"neetocist\";\nimport { path } from \"ramda\";\n\nimport Editor from \".\";\n\nconst FormikEditor = (\n {\n name,\n onChange = noop,\n shouldUpdate,\n attachments = [],\n mentions = [],\n variables = [],\n ...otherProps\n },\n ref\n) => {\n // Similar to the `shouldComponentUpdate` logic of FastField component.\n // https://github.com/jaredpalmer/formik/blob/main/packages/formik/src/FastField.tsx#L75-L93\n // Additionally calls the shouldUpdate function passed from the host application and compares to\n // the rest of the values.\n const internalShouldUpdate = (prevProps, nextProps) => {\n const prevFormikProps = prevProps.formik;\n const nextFormikProps = nextProps.formik;\n\n const pathParts = name.split(\".\");\n const prevError = path(pathParts, prevFormikProps.errors);\n const nextError = path(pathParts, nextFormikProps.errors);\n const prevTouched = path(pathParts, prevFormikProps.touched);\n const nextTouched = path(pathParts, nextFormikProps.touched);\n\n return (\n prevError !== nextError ||\n prevTouched !== nextTouched ||\n Object.keys(nextProps).length !== Object.keys(prevProps).length ||\n prevFormikProps.isSubmitting !== nextFormikProps.isSubmitting ||\n Boolean(shouldUpdate?.(prevProps, nextProps))\n );\n };\n\n return (\n <FastField\n {...{ attachments, mentions, name, variables }}\n shouldUpdate={internalShouldUpdate}\n >\n {({ field, form, meta }) => (\n <Editor\n {...{ attachments, mentions, name, ref, variables }}\n error={meta.touched ? meta.error : \"\"}\n initialValue={field.value}\n onBlur={() => {\n form.setFieldTouched(name, true);\n }}\n onChange={value => {\n form.setFieldValue(name, value);\n onChange?.(value);\n }}\n {...otherProps}\n />\n )}\n </FastField>\n );\n};\n\nFormikEditor.displayName = \"FormikNeetoEditor\";\n\nexport default memo(forwardRef(FormikEditor));\n"],"names":["FormikEditor","_ref","ref","name","_ref$onChange","onChange","noop","shouldUpdate","_ref$attachments","attachments","_ref$mentions","mentions","_ref$variables","variables","otherProps","_objectWithoutProperties","_excluded","internalShouldUpdate","prevProps","nextProps","prevFormikProps","formik","nextFormikProps","pathParts","split","prevError","path","errors","nextError","prevTouched","touched","nextTouched","Object","keys","length","isSubmitting","Boolean","_jsx","FastField","children","_ref2","field","form","meta","Editor","_objectSpread","error","initialValue","value","onBlur","setFieldTouched","setFieldValue","displayName","memo","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAUhBC,GAAG,EACA;AAAA,EAAA,IATDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,aAAA,GAAAH,IAAA,CACJI,QAAQ;AAARA,IAAAA,SAAQ,GAAAD,aAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,aAAA;IACfG,YAAY,GAAAN,IAAA,CAAZM,YAAY;IAAAC,gBAAA,GAAAP,IAAA,CACZQ,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,gBAAA;IAAAE,aAAA,GAAAT,IAAA,CAChBU,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,aAAA;IAAAE,cAAA,GAAAX,IAAA,CACbY,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;A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
3
|
import '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'ramda';
|
|
6
|
-
export { M as default } from './chunk-
|
|
6
|
+
export { M as default } from './chunk-DmstYxyh.js';
|
|
7
7
|
import './chunk-BegQDClu.js';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
9
|
import './chunk-DmrvuTKK.js';
|
|
@@ -12630,11 +12630,11 @@ var substituteVariables = function substituteVariables(highlightedContent, varia
|
|
|
12630
12630
|
});
|
|
12631
12631
|
};
|
|
12632
12632
|
var convertPlainTextToHtml = function convertPlainTextToHtml(htmlString) {
|
|
12633
|
-
if (
|
|
12633
|
+
if (/^<[a-z].*>/i.test(htmlString.trim())) return htmlString;
|
|
12634
12634
|
return htmlString.split("\n").reduce(function (html, str) {
|
|
12635
12635
|
return "".concat(html, "<p>").concat(str, "</p>");
|
|
12636
12636
|
}, "");
|
|
12637
12637
|
};
|
|
12638
12638
|
|
|
12639
12639
|
export { applySyntaxHighlightingAndLineNumbers as a, applyLineHighlighting as b, convertPlainTextToHtml as c, substituteVariables as s };
|
|
12640
|
-
//# sourceMappingURL=chunk-
|
|
12640
|
+
//# sourceMappingURL=chunk-CBY2h1zh.js.map
|