@bigbinary/neeto-molecules 1.17.1 → 1.17.3
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 +29 -10
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/Onboarding.js +4 -4
- package/dist/Onboarding.js.map +1 -1
- package/dist/cjs/DocumentEditor.js +27 -8
- package/dist/cjs/DocumentEditor.js.map +1 -1
- package/dist/cjs/Onboarding.js +4 -4
- package/dist/cjs/Onboarding.js.map +1 -1
- package/package.json +1 -1
package/dist/DocumentEditor.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { _ as _extends } from './extends-093996c9.js';
|
|
2
2
|
import { _ as _defineProperty } from './defineProperty-549061a7.js';
|
|
3
3
|
import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
|
|
4
|
-
import React__default, { useRef, useState } from 'react';
|
|
4
|
+
import React__default, { useRef, useState, useCallback } from 'react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
-
import { noop } from '@bigbinary/neeto-cist';
|
|
6
|
+
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
7
7
|
import { FormikEditor } from '@bigbinary/neeto-editor';
|
|
8
8
|
import { Typography } from '@bigbinary/neetoui';
|
|
9
9
|
import { Textarea } from '@bigbinary/neetoui/formik';
|
|
@@ -29,7 +29,8 @@ var useEditor = function useEditor(_ref) {
|
|
|
29
29
|
onAttachmentChange = _ref.onAttachmentChange,
|
|
30
30
|
onTitleChange = _ref.onTitleChange,
|
|
31
31
|
titleFieldName = _ref.titleFieldName,
|
|
32
|
-
editorRef = _ref.editorRef
|
|
32
|
+
editorRef = _ref.editorRef,
|
|
33
|
+
titleRef = _ref.titleRef;
|
|
33
34
|
var _useFormikContext = useFormikContext(),
|
|
34
35
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
35
36
|
errors = _useFormikContext.errors;
|
|
@@ -47,16 +48,31 @@ var useEditor = function useEditor(_ref) {
|
|
|
47
48
|
setFieldValue(titleFieldName, title);
|
|
48
49
|
onTitleChange === null || onTitleChange === void 0 ? void 0 : onTitleChange(title);
|
|
49
50
|
};
|
|
51
|
+
var handleEditorBackspaceKeypress = function handleEditorBackspaceKeypress() {
|
|
52
|
+
var _editorRef$current, _editor$state;
|
|
53
|
+
var editor = (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.editor;
|
|
54
|
+
var selection = editor === null || editor === void 0 ? void 0 : (_editor$state = editor.state) === null || _editor$state === void 0 ? void 0 : _editor$state.selection;
|
|
55
|
+
if (editor !== null && editor !== void 0 && editor.isFocused && isPresent(titleRef.current) && (selection === null || selection === void 0 ? void 0 : selection.anchor) === 1) {
|
|
56
|
+
var title = titleRef.current.value;
|
|
57
|
+
titleRef.current.focus();
|
|
58
|
+
titleRef.current.setSelectionRange(title === null || title === void 0 ? void 0 : title.length, title === null || title === void 0 ? void 0 : title.length);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
50
61
|
var titleHotkeyRef = useHotkeys("return", function () {
|
|
51
|
-
var _editorRef$
|
|
52
|
-
|
|
62
|
+
var _editorRef$current2, _editorRef$current2$e, _editorRef$current2$e2, _editorRef$current3, _editorRef$current3$e, _editorRef$current3$e2;
|
|
63
|
+
(_editorRef$current2 = editorRef.current) === null || _editorRef$current2 === void 0 ? void 0 : (_editorRef$current2$e = _editorRef$current2.editor) === null || _editorRef$current2$e === void 0 ? void 0 : (_editorRef$current2$e2 = _editorRef$current2$e.commands) === null || _editorRef$current2$e2 === void 0 ? void 0 : _editorRef$current2$e2.insertContentAt(0, "<p />");
|
|
64
|
+
(_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : (_editorRef$current3$e = _editorRef$current3.editor) === null || _editorRef$current3$e === void 0 ? void 0 : (_editorRef$current3$e2 = _editorRef$current3$e.commands) === null || _editorRef$current3$e2 === void 0 ? void 0 : _editorRef$current3$e2.focus("start");
|
|
53
65
|
}, {
|
|
54
66
|
mode: "scoped"
|
|
55
67
|
});
|
|
68
|
+
var editorHotkeyRef = useHotkeys("backspace", handleEditorBackspaceKeypress, {
|
|
69
|
+
mode: "scoped"
|
|
70
|
+
});
|
|
56
71
|
return {
|
|
57
72
|
handleContentChange: handleContentChange,
|
|
58
73
|
handleAttachmentChange: handleAttachmentChange,
|
|
59
74
|
handleTitleChange: handleTitleChange,
|
|
75
|
+
editorHotkeyRef: editorHotkeyRef,
|
|
60
76
|
titleHotkeyRef: titleHotkeyRef,
|
|
61
77
|
errors: errors
|
|
62
78
|
};
|
|
@@ -108,11 +124,13 @@ var Editor = function Editor(_ref) {
|
|
|
108
124
|
onAttachmentChange: onAttachmentChange,
|
|
109
125
|
onTitleChange: onTitleChange,
|
|
110
126
|
titleFieldName: titleFieldName,
|
|
111
|
-
editorRef: editorRef
|
|
127
|
+
editorRef: editorRef,
|
|
128
|
+
titleRef: titleRef
|
|
112
129
|
}),
|
|
113
130
|
handleContentChange = _useEditor.handleContentChange,
|
|
114
131
|
handleAttachmentChange = _useEditor.handleAttachmentChange,
|
|
115
132
|
handleTitleChange = _useEditor.handleTitleChange,
|
|
133
|
+
editorHotkeyRef = _useEditor.editorHotkeyRef,
|
|
116
134
|
titleHotkeyRef = _useEditor.titleHotkeyRef,
|
|
117
135
|
errors = _useEditor.errors;
|
|
118
136
|
var setTitleRef = function setTitleRef(node) {
|
|
@@ -120,13 +138,14 @@ var Editor = function Editor(_ref) {
|
|
|
120
138
|
getTitleRef(node);
|
|
121
139
|
titleRef.current = node;
|
|
122
140
|
};
|
|
123
|
-
var setEditorRef = function
|
|
124
|
-
getEditorRef(node);
|
|
141
|
+
var setEditorRef = useCallback(function (node) {
|
|
125
142
|
editorRef.current = node;
|
|
126
|
-
|
|
143
|
+
getEditorRef(node);
|
|
144
|
+
}, []);
|
|
127
145
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
128
146
|
className: "neeto-molecules-document__wrapper",
|
|
129
|
-
"data-testid": "document-editor-container"
|
|
147
|
+
"data-testid": "document-editor-container",
|
|
148
|
+
ref: editorHotkeyRef
|
|
130
149
|
}, /*#__PURE__*/React__default.createElement(FormikEditor, _extends({
|
|
131
150
|
attachmentsClassName: "editor-content-attachments",
|
|
132
151
|
className: "h-full w-full",
|
|
@@ -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};\n","import { useFormikContext } from \"formik\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n };\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => editorRef.current?.editor?.commands?.focus(),\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\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 React, { 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 { 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 = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = node => {\n getEditorRef(node);\n editorRef.current = node;\n };\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments\"\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 name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons || [])}\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\nexport default Editor;\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","titleHotkeyRef","useHotkeys","_editorRef$current","_editorRef$current$ed","_editorRef$current$ed2","current","editor","commands","focus","mode","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","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","titleRef","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","React","createElement","className","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","name","ref","classNames","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"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,EAAA;AACV,CAAC;;;;;AChBD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAQT;AAAA,EAAA,IAPJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;IACtBC,cAAc,GAAAH,IAAA,CAAdG,cAAc;I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B,IAAAA,QAAQ,EAAEhE,iBAAkB;IAC5BsE,SAAS,EAAE,SAAAA,SAAAA,CAAAC,CAAC,EAAA;AAAA,MAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,KAAA;AACvD,GAAA,EACGrC,UAAU,CACf,CAAC,EACD1C,MAAM,CAACT,sBAAsB,CAAC,iBAC7BiE,cAAA,CAAAC,aAAA,CAACuB,UAAU,EAAA;AACTtB,IAAAA,SAAS,EAAC,6DAA6D;AACvE,IAAA,SAAA,EAAQ,8BAA8B;AACtCuB,IAAAA,KAAK,EAAC,OAAA;AAAO,GAAA,EAEZjF,MAAM,CAACT,sBAAsB,CACpB,CAEX,CACO,CACX,CAAC,CAAA;AAEV;;;;"}
|
|
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};\n","import { 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 = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\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 React, { useCallback, 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 { 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 = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\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 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\"\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 name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons || [])}\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\nexport default Editor;\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","titleRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","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","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","useCallback","React","createElement","className","ref","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","name","classNames","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"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,EAAA;AACV,CAAC;;;;;ACfD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAST;AAAA,EAAA,IARJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;IACtBC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ,CAAA;AAER,EAAA,IAAAC,iBAAA,GAAkCC,gBAAgB,EAAE;IAA5CC,aAAa,GAAAF,iBAAA,CAAbE,aAAa;IAAEC,MAAM,GAAAH,iBAAA,CAANG,MAAM,CAAA;A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AAC,0CAAA;AAA0C,GAAA,eACvDF,cAAA,CAAAC,aAAA,CAACc,QAAQ,EAAAV,QAAA,CAAA;IACPW,aAAa,EAAA,IAAA;AACbd,IAAAA,SAAS,EAAC,iCAAiC;AAC3C,IAAA,SAAA,EAAQ,2CAA2C;AACnDQ,IAAAA,IAAI,EAAEvF,cAAe;AACrBgF,IAAAA,GAAG,EAAEP,WAAY;AACjBqB,IAAAA,IAAI,EAAE,CAAE;IACRC,WAAW,EACThC,UAAU,CAACgC,WAAW,IAAI7B,CAAC,CAAC,qCAAqC,CAClE;AACDwB,IAAAA,QAAQ,EAAE/E,iBAAkB;IAC5BqF,SAAS,EAAE,SAAAA,SAAAA,CAAAC,CAAC,EAAA;AAAA,MAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,KAAA;AACvD,GAAA,EACGrC,UAAU,CACf,CAAC,EACDzD,MAAM,CAACV,sBAAsB,CAAC,iBAC7BiF,cAAA,CAAAC,aAAA,CAACuB,UAAU,EAAA;AACTtB,IAAAA,SAAS,EAAC,6DAA6D;AACvE,IAAA,SAAA,EAAQ,8BAA8B;AACtCuB,IAAAA,KAAK,EAAC,OAAA;AAAO,GAAA,EAEZhG,MAAM,CAACV,sBAAsB,CACpB,CAEX,CACO,CACX,CAAC,CAAA;AAEV;;;;"}
|
package/dist/Onboarding.js
CHANGED
|
@@ -148,7 +148,9 @@ var CompletedScreen = withT(function (_ref) {
|
|
|
148
148
|
}))), /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
149
149
|
"data-cy": "onboarding-congratulations-button",
|
|
150
150
|
"data-testid": "onboarding-congratulations-button",
|
|
151
|
-
label: t("neetoMolecules.onboarding.
|
|
151
|
+
label: t("neetoMolecules.onboarding.helpScreen.startUsingButton", {
|
|
152
|
+
appName: globalProps$1.appName
|
|
153
|
+
})
|
|
152
154
|
}, completeButtonProps)));
|
|
153
155
|
});
|
|
154
156
|
|
|
@@ -168,9 +170,7 @@ var HelpScreen = function HelpScreen(_ref) {
|
|
|
168
170
|
"data-cy": "onboarding-help-title",
|
|
169
171
|
"data-testid": "onboarding-help-title",
|
|
170
172
|
style: "h2"
|
|
171
|
-
}, t("neetoMolecules.onboarding.helpScreen.
|
|
172
|
-
appName: globalProps$1.appName
|
|
173
|
-
})), /*#__PURE__*/React__default.createElement(Typography, {
|
|
173
|
+
}, t("neetoMolecules.onboarding.helpScreen.title")), /*#__PURE__*/React__default.createElement(Typography, {
|
|
174
174
|
"data-cy": "onboarding-help-description",
|
|
175
175
|
"data-testid": "onboarding-help-description",
|
|
176
176
|
lineHeight: "normal",
|
package/dist/Onboarding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Onboarding.js","sources":["../src/components/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/HelpScreen.jsx","../src/components/Onboarding/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/Onboarding/HelpScreen.jsx","../src/components/Onboarding/Onboarding/utils.jsx","../src/components/Onboarding/Onboarding/WelcomeScreen.jsx","../src/components/Onboarding/Onboarding/index.jsx","../src/components/Onboarding/WelcomeScreen.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(\n ({ t, title, description, children, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-description\"\n data-testid=\"onboarding-congratulations-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n {children}\n </div>\n {isPresent(buttonProps) && (\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...buttonProps}\n />\n )}\n </div>\n )\n);\n\nCompletedScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the completed screen\n */\n title: PropTypes.string,\n /**\n * Description of the completed screen\n */\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * Additional children elements to be rendered within the completed screen.\n */\n children: PropTypes.node,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport \"./onboarding.scss\";\n\nconst HelpScreen = ({ buttonProps, className = \"\", standalone = false }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-help-wrapper\"\n >\n <div className=\"mx-auto w-full max-w-2xl space-y-6\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full overflow-hidden\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n label={\n standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.continueButton\")\n }\n {...buttonProps}\n />\n </div>\n </div>\n );\n};\n\nHelpScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n /**\n * To specify if the help screen is standalone or not.\n */\n standalone: PropTypes.bool,\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div className=\"mx-auto w-full max-w-2xl space-y-6 p-4\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (onboardingSteps, setCurrentStep, currentStep) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: <HelpScreen {...{ currentStep, setCurrentStep }} />,\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n}) => {\n const steps = useMemo(\n () => createSteps(onboardingSteps, setCurrentStep, currentStep),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n};\n\nexport default Onboarding;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(\n ({ t, title, description, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n {...buttonProps}\n />\n </div>\n )\n);\n\nWelcomeScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the welcome screen\n */\n title: PropTypes.string,\n /**\n * Description of the welcome screen\n */\n description: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default WelcomeScreen;\n"],"names":["CompletedScreen","withT","_ref","t","title","description","children","buttonProps","_ref$className","className","React","createElement","classnames","Typography","style","lineHeight","isPresent","Button","_extends","label","propTypes","PropTypes","string","oneOfType","node","object","HelpScreen","_ref$standalone","standalone","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","component","appName","globalProps","alt","src","completeButtonProps","setCurrentStep","currentStep","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","steps","useMemo","length","handleStepChange","index","isStepperVisible","classNames","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,IAAMA,iBAAe,GAAGC,KAAK,CAC3B,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IAAEC,QAAQ,GAAAJ,IAA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,eACNK,cAAA,CAAAC,aAAA,CAACM,MAAM,EAAAC,QAAA,CAAA;AACL,IAAA,SAAA,EAAQ,2BAA2B;AACnC,IAAA,aAAA,EAAY,2BAA2B;AACvCwB,IAAAA,IAAI,EAAEC,UAAW;IACjBxB,KAAK,EAAEhB,CAAC,CAAC,sCAAsC,CAAA;GAC3CI,EAAAA,WAAW,CAChB,CACE,CAAC,CAAA;AAAA,CAEV,EAAC;AAEDiD,aAAa,CAACpC,SAAS,GAAG;AACxB;AACF;AACA;EACEX,SAAS,EAAEY,iBAAS,CAACC,MAAM;AAC3B;AACF;AACA;EACElB,KAAK,EAAEiB,iBAAS,CAACC,MAAM;AACvB;AACF;AACA;EACEjB,WAAW,EAAEgB,iBAAS,CAACC,MAAM;AAC7B;AACF;AACA;EACEf,WAAW,EAAEc,iBAAS,CAACI,MAAAA;AACzB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Onboarding.js","sources":["../src/components/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/HelpScreen.jsx","../src/components/Onboarding/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/Onboarding/HelpScreen.jsx","../src/components/Onboarding/Onboarding/utils.jsx","../src/components/Onboarding/Onboarding/WelcomeScreen.jsx","../src/components/Onboarding/Onboarding/index.jsx","../src/components/Onboarding/WelcomeScreen.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(\n ({ t, title, description, children, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-description\"\n data-testid=\"onboarding-congratulations-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n {children}\n </div>\n {isPresent(buttonProps) && (\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...buttonProps}\n />\n )}\n </div>\n )\n);\n\nCompletedScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the completed screen\n */\n title: PropTypes.string,\n /**\n * Description of the completed screen\n */\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * Additional children elements to be rendered within the completed screen.\n */\n children: PropTypes.node,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport \"./onboarding.scss\";\n\nconst HelpScreen = ({ buttonProps, className = \"\", standalone = false }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-help-wrapper\"\n >\n <div className=\"mx-auto w-full max-w-2xl space-y-6\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full overflow-hidden\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n label={\n standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.continueButton\")\n }\n {...buttonProps}\n />\n </div>\n </div>\n );\n};\n\nHelpScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n /**\n * To specify if the help screen is standalone or not.\n */\n standalone: PropTypes.bool,\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div className=\"mx-auto w-full max-w-2xl space-y-6 p-4\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (onboardingSteps, setCurrentStep, currentStep) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: <HelpScreen {...{ currentStep, setCurrentStep }} />,\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n}) => {\n const steps = useMemo(\n () => createSteps(onboardingSteps, setCurrentStep, currentStep),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n};\n\nexport default Onboarding;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(\n ({ t, title, description, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n {...buttonProps}\n />\n </div>\n )\n);\n\nWelcomeScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the welcome screen\n */\n title: PropTypes.string,\n /**\n * Description of the welcome screen\n */\n description: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default WelcomeScreen;\n"],"names":["CompletedScreen","withT","_ref","t","title","description","children","buttonProps","_ref$className","className","React","createElement","classnames","Typography","style","lineHeight","isPresent","Button","_extends","label","propTypes","PropTypes","string","oneOfType","node","object","HelpScreen","_ref$standalone","standalone","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","component","appName","globalProps","alt","src","completeButtonProps","setCurrentStep","currentStep","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","steps","useMemo","length","handleStepChange","index","isStepperVisible","classNames","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,IAAMA,iBAAe,GAAGC,KAAK,CAC3B,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,WAAW,GAAAH,IAAA,CAAXG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;GAELT,EAAAA,WACS,CAEX,CAAC,eACNK,cAAA,CAAAC,aAAA,CAACM,MAAM,EAAAC,QAAA,CAAA;AACL,IAAA,SAAA,EAAQ,2BAA2B;AACnC,IAAA,aAAA,EAAY,2BAA2B;AACvCwB,IAAAA,IAAI,EAAEC,UAAW;IACjBxB,KAAK,EAAEhB,CAAC,CAAC,sCAAsC,CAAA;GAC3CI,EAAAA,WAAW,CAChB,CACE,CAAC,CAAA;AAAA,CAEV,EAAC;AAEDiD,aAAa,CAACpC,SAAS,GAAG;AACxB;AACF;AACA;EACEX,SAAS,EAAEY,iBAAS,CAACC,MAAM;AAC3B;AACF;AACA;EACElB,KAAK,EAAEiB,iBAAS,CAACC,MAAM;AACvB;AACF;AACA;EACEjB,WAAW,EAAEgB,iBAAS,CAACC,MAAM;AAC7B;AACF;AACA;EACEf,WAAW,EAAEc,iBAAS,CAACI,MAAAA;AACzB,CAAC;;;;"}
|
|
@@ -37,7 +37,8 @@ var useEditor = function useEditor(_ref) {
|
|
|
37
37
|
onAttachmentChange = _ref.onAttachmentChange,
|
|
38
38
|
onTitleChange = _ref.onTitleChange,
|
|
39
39
|
titleFieldName = _ref.titleFieldName,
|
|
40
|
-
editorRef = _ref.editorRef
|
|
40
|
+
editorRef = _ref.editorRef,
|
|
41
|
+
titleRef = _ref.titleRef;
|
|
41
42
|
var _useFormikContext = formik.useFormikContext(),
|
|
42
43
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
43
44
|
errors = _useFormikContext.errors;
|
|
@@ -55,16 +56,31 @@ var useEditor = function useEditor(_ref) {
|
|
|
55
56
|
setFieldValue(titleFieldName, title);
|
|
56
57
|
onTitleChange === null || onTitleChange === void 0 ? void 0 : onTitleChange(title);
|
|
57
58
|
};
|
|
59
|
+
var handleEditorBackspaceKeypress = function handleEditorBackspaceKeypress() {
|
|
60
|
+
var _editorRef$current, _editor$state;
|
|
61
|
+
var editor = (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.editor;
|
|
62
|
+
var selection = editor === null || editor === void 0 ? void 0 : (_editor$state = editor.state) === null || _editor$state === void 0 ? void 0 : _editor$state.selection;
|
|
63
|
+
if (editor !== null && editor !== void 0 && editor.isFocused && neetoCist.isPresent(titleRef.current) && (selection === null || selection === void 0 ? void 0 : selection.anchor) === 1) {
|
|
64
|
+
var title = titleRef.current.value;
|
|
65
|
+
titleRef.current.focus();
|
|
66
|
+
titleRef.current.setSelectionRange(title === null || title === void 0 ? void 0 : title.length, title === null || title === void 0 ? void 0 : title.length);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
58
69
|
var titleHotkeyRef = useHotkeys__default["default"]("return", function () {
|
|
59
|
-
var _editorRef$
|
|
60
|
-
|
|
70
|
+
var _editorRef$current2, _editorRef$current2$e, _editorRef$current2$e2, _editorRef$current3, _editorRef$current3$e, _editorRef$current3$e2;
|
|
71
|
+
(_editorRef$current2 = editorRef.current) === null || _editorRef$current2 === void 0 ? void 0 : (_editorRef$current2$e = _editorRef$current2.editor) === null || _editorRef$current2$e === void 0 ? void 0 : (_editorRef$current2$e2 = _editorRef$current2$e.commands) === null || _editorRef$current2$e2 === void 0 ? void 0 : _editorRef$current2$e2.insertContentAt(0, "<p />");
|
|
72
|
+
(_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : (_editorRef$current3$e = _editorRef$current3.editor) === null || _editorRef$current3$e === void 0 ? void 0 : (_editorRef$current3$e2 = _editorRef$current3$e.commands) === null || _editorRef$current3$e2 === void 0 ? void 0 : _editorRef$current3$e2.focus("start");
|
|
61
73
|
}, {
|
|
62
74
|
mode: "scoped"
|
|
63
75
|
});
|
|
76
|
+
var editorHotkeyRef = useHotkeys__default["default"]("backspace", handleEditorBackspaceKeypress, {
|
|
77
|
+
mode: "scoped"
|
|
78
|
+
});
|
|
64
79
|
return {
|
|
65
80
|
handleContentChange: handleContentChange,
|
|
66
81
|
handleAttachmentChange: handleAttachmentChange,
|
|
67
82
|
handleTitleChange: handleTitleChange,
|
|
83
|
+
editorHotkeyRef: editorHotkeyRef,
|
|
68
84
|
titleHotkeyRef: titleHotkeyRef,
|
|
69
85
|
errors: errors
|
|
70
86
|
};
|
|
@@ -116,11 +132,13 @@ var Editor = function Editor(_ref) {
|
|
|
116
132
|
onAttachmentChange: onAttachmentChange,
|
|
117
133
|
onTitleChange: onTitleChange,
|
|
118
134
|
titleFieldName: titleFieldName,
|
|
119
|
-
editorRef: editorRef
|
|
135
|
+
editorRef: editorRef,
|
|
136
|
+
titleRef: titleRef
|
|
120
137
|
}),
|
|
121
138
|
handleContentChange = _useEditor.handleContentChange,
|
|
122
139
|
handleAttachmentChange = _useEditor.handleAttachmentChange,
|
|
123
140
|
handleTitleChange = _useEditor.handleTitleChange,
|
|
141
|
+
editorHotkeyRef = _useEditor.editorHotkeyRef,
|
|
124
142
|
titleHotkeyRef = _useEditor.titleHotkeyRef,
|
|
125
143
|
errors = _useEditor.errors;
|
|
126
144
|
var setTitleRef = function setTitleRef(node) {
|
|
@@ -128,13 +146,14 @@ var Editor = function Editor(_ref) {
|
|
|
128
146
|
getTitleRef(node);
|
|
129
147
|
titleRef.current = node;
|
|
130
148
|
};
|
|
131
|
-
var setEditorRef = function
|
|
132
|
-
getEditorRef(node);
|
|
149
|
+
var setEditorRef = React.useCallback(function (node) {
|
|
133
150
|
editorRef.current = node;
|
|
134
|
-
|
|
151
|
+
getEditorRef(node);
|
|
152
|
+
}, []);
|
|
135
153
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
136
154
|
className: "neeto-molecules-document__wrapper",
|
|
137
|
-
"data-testid": "document-editor-container"
|
|
155
|
+
"data-testid": "document-editor-container",
|
|
156
|
+
ref: editorHotkeyRef
|
|
138
157
|
}, /*#__PURE__*/React__default["default"].createElement(neetoEditor.FormikEditor, _extends._extends({
|
|
139
158
|
attachmentsClassName: "editor-content-attachments",
|
|
140
159
|
className: "h-full w-full",
|
|
@@ -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};\n","import { useFormikContext } from \"formik\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n };\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => editorRef.current?.editor?.commands?.focus(),\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\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 React, { 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 { 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 = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\n\n const {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n titleHotkeyRef,\n errors,\n } = useEditor({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n });\n\n const setTitleRef = node => {\n titleHotkeyRef.current = node;\n getTitleRef(node);\n titleRef.current = node;\n };\n\n const setEditorRef = node => {\n getEditorRef(node);\n editorRef.current = node;\n };\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments\"\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 name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons || [])}\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\nexport default Editor;\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","titleHotkeyRef","useHotkeys","_editorRef$current","_editorRef$current$ed","_editorRef$current$ed2","current","editor","commands","focus","mode","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","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","titleRef","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","React","createElement","className","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","name","ref","classNames","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"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,EAAA;AACV,CAAC;;;;;AChBD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAQT;AAAA,EAAA,IAPJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;IACtBC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,SAAS,GAAAP,IAAA,CAATO,SAAS,CAAA;AAET,EAAA,IAAAC,iBAAA,GAAkCC,uBAAgB,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,EAAE,CAAA;AAAA,KAAA;AACvD,GAAA,EACGrC,UAAU,CACf,CAAC,EACD1C,MAAM,CAACT,sBAAsB,CAAC,iBAC7BiE,yBAAA,CAAAC,aAAA,CAACuB,kBAAU,EAAA;AACTtB,IAAAA,SAAS,EAAC,6DAA6D;AACvE,IAAA,SAAA,EAAQ,8BAA8B;AACtCuB,IAAAA,KAAK,EAAC,OAAA;AAAO,GAAA,EAEZjF,MAAM,CAACT,sBAAsB,CACpB,CAEX,CACO,CACX,CAAC,CAAA;AAEV;;;;"}
|
|
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};\n","import { 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 = content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n };\n\n const handleAttachmentChange = attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\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 React, { useCallback, 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 { 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 = DEFAULT_EDITOR_PROPS,\n titleProps = {},\n}) => {\n const { t } = useTranslation();\n\n const titleRef = useRef();\n const editorRef = useRef();\n\n const [attachments, setAttachments] = useState(() =>\n getUniqueAttachments(initialAttachments)\n );\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 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\"\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 name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps }}\n addons={EDITOR_ADDONS.concat(editorProps.addons || [])}\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\nexport default Editor;\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","titleRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","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","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","useCallback","React","createElement","className","ref","FormikEditor","_extends","attachmentsClassName","contentClassName","error","undefined","name","classNames","concat","onChange","onChangeAttachments","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style"],"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,EAAA;AACV,CAAC;;;;;ACfD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAST;AAAA,EAAA,IARJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;IACtBC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ,CAAA;AAER,EAAA,IAAAC,iBAAA,GAAkCC,uBAAgB,EAAE;IAA5CC,aAAa,GAAAF,iBAAA,CAAbE,aAAa;IAAEC,MAAM,GAAAH,iBAAA,CAANG,MAAM,CAAA;AAE7B,EAAA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,OAAO,EAAI;AACrCH,IAAAA,aAAa,CAACT,sBAAsB,EAAEY,OAAO,CAAC,CAAA;AAC9Cb,IAAAA,eAAe,aAAfA,eAAe,KAAA,KA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AAA,EAAQ,2CAA2C;AACnDQ,IAAAA,IAAI,EAAEvF,cAAe;AACrBgF,IAAAA,GAAG,EAAEP,WAAY;AACjBqB,IAAAA,IAAI,EAAE,CAAE;IACRC,WAAW,EACThC,UAAU,CAACgC,WAAW,IAAI7B,CAAC,CAAC,qCAAqC,CAClE;AACDwB,IAAAA,QAAQ,EAAE/E,iBAAkB;IAC5BqF,SAAS,EAAE,SAAAA,SAAAA,CAAAC,CAAC,EAAA;AAAA,MAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,KAAA;AACvD,GAAA,EACGrC,UAAU,CACf,CAAC,EACDzD,MAAM,CAACV,sBAAsB,CAAC,iBAC7BiF,yBAAA,CAAAC,aAAA,CAACuB,kBAAU,EAAA;AACTtB,IAAAA,SAAS,EAAC,6DAA6D;AACvE,IAAA,SAAA,EAAQ,8BAA8B;AACtCuB,IAAAA,KAAK,EAAC,OAAA;AAAO,GAAA,EAEZhG,MAAM,CAACV,sBAAsB,CACpB,CAEX,CACO,CACX,CAAC,CAAA;AAEV;;;;"}
|
package/dist/cjs/Onboarding.js
CHANGED
|
@@ -159,7 +159,9 @@ var CompletedScreen = withT__default["default"](function (_ref) {
|
|
|
159
159
|
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends._extends({
|
|
160
160
|
"data-cy": "onboarding-congratulations-button",
|
|
161
161
|
"data-testid": "onboarding-congratulations-button",
|
|
162
|
-
label: t("neetoMolecules.onboarding.
|
|
162
|
+
label: t("neetoMolecules.onboarding.helpScreen.startUsingButton", {
|
|
163
|
+
appName: initializers.globalProps.appName
|
|
164
|
+
})
|
|
163
165
|
}, completeButtonProps)));
|
|
164
166
|
});
|
|
165
167
|
|
|
@@ -179,9 +181,7 @@ var HelpScreen = function HelpScreen(_ref) {
|
|
|
179
181
|
"data-cy": "onboarding-help-title",
|
|
180
182
|
"data-testid": "onboarding-help-title",
|
|
181
183
|
style: "h2"
|
|
182
|
-
}, t("neetoMolecules.onboarding.helpScreen.
|
|
183
|
-
appName: initializers.globalProps.appName
|
|
184
|
-
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
184
|
+
}, t("neetoMolecules.onboarding.helpScreen.title")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
185
185
|
"data-cy": "onboarding-help-description",
|
|
186
186
|
"data-testid": "onboarding-help-description",
|
|
187
187
|
lineHeight: "normal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Onboarding.js","sources":["../../src/components/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/Onboarding/utils.jsx","../../src/components/Onboarding/Onboarding/WelcomeScreen.jsx","../../src/components/Onboarding/Onboarding/index.jsx","../../src/components/Onboarding/WelcomeScreen.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(\n ({ t, title, description, children, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-description\"\n data-testid=\"onboarding-congratulations-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n {children}\n </div>\n {isPresent(buttonProps) && (\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...buttonProps}\n />\n )}\n </div>\n )\n);\n\nCompletedScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the completed screen\n */\n title: PropTypes.string,\n /**\n * Description of the completed screen\n */\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * Additional children elements to be rendered within the completed screen.\n */\n children: PropTypes.node,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport \"./onboarding.scss\";\n\nconst HelpScreen = ({ buttonProps, className = \"\", standalone = false }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-help-wrapper\"\n >\n <div className=\"mx-auto w-full max-w-2xl space-y-6\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full overflow-hidden\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n label={\n standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.continueButton\")\n }\n {...buttonProps}\n />\n </div>\n </div>\n );\n};\n\nHelpScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n /**\n * To specify if the help screen is standalone or not.\n */\n standalone: PropTypes.bool,\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div className=\"mx-auto w-full max-w-2xl space-y-6 p-4\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (onboardingSteps, setCurrentStep, currentStep) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: <HelpScreen {...{ currentStep, setCurrentStep }} />,\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n}) => {\n const steps = useMemo(\n () => createSteps(onboardingSteps, setCurrentStep, currentStep),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n};\n\nexport default Onboarding;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(\n ({ t, title, description, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n {...buttonProps}\n />\n </div>\n )\n);\n\nWelcomeScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the welcome screen\n */\n title: PropTypes.string,\n /**\n * Description of the welcome screen\n */\n description: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default WelcomeScreen;\n"],"names":["CompletedScreen","withT","_ref","t","title","description","children","buttonProps","_ref$className","className","React","createElement","classnames","Typography","style","lineHeight","isPresent","Button","_extends","label","propTypes","PropTypes","string","oneOfType","node","object","HelpScreen","_ref$standalone","standalone","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","component","appName","globalProps","alt","src","completeButtonProps","setCurrentStep","currentStep","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","steps","useMemo","length","handleStepChange","index","isStepperVisible","classNames","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,iBAAe,GAAGC,yBAAK,CAC3B,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IAAEC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAEC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IAAAC,cAAA,GAAAN,IAAA,CAAEO,SAAS;AAATA,IAAAA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BAAA,CAAAC,aAAA,CAACM,cAAM,EAAAC,iBAAA,CAAA;AACL,IAAA,SAAA,EAAQ,2BAA2B;AACnC,IAAA,aAAA,EAAY,2BAA2B;AACvCwB,IAAAA,IAAI,EAAEC,qBAAW;IACjBxB,KAAK,EAAEhB,CAAC,CAAC,sCAAsC,CAAA;GAC3CI,EAAAA,WAAW,CAChB,CACE,CAAC,CAAA;AAAA,CAEV,EAAC;AAEDiD,aAAa,CAACpC,SAAS,GAAG;AACxB;AACF;AACA;EACEX,SAAS,EAAEY,uBAAS,CAACC,MAAM;AAC3B;AACF;AACA;EACElB,KAAK,EAAEiB,uBAAS,CAACC,MAAM;AACvB;AACF;AACA;EACEjB,WAAW,EAAEgB,uBAAS,CAACC,MAAM;AAC7B;AACF;AACA;EACEf,WAAW,EAAEc,uBAAS,CAACI,MAAAA;AACzB,CAAC;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Onboarding.js","sources":["../../src/components/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/Onboarding/utils.jsx","../../src/components/Onboarding/Onboarding/WelcomeScreen.jsx","../../src/components/Onboarding/Onboarding/index.jsx","../../src/components/Onboarding/WelcomeScreen.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(\n ({ t, title, description, children, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-description\"\n data-testid=\"onboarding-congratulations-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n {children}\n </div>\n {isPresent(buttonProps) && (\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.startUsing\")}\n {...buttonProps}\n />\n )}\n </div>\n )\n);\n\nCompletedScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the completed screen\n */\n title: PropTypes.string,\n /**\n * Description of the completed screen\n */\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * Additional children elements to be rendered within the completed screen.\n */\n children: PropTypes.node,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport \"./onboarding.scss\";\n\nconst HelpScreen = ({ buttonProps, className = \"\", standalone = false }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-help-wrapper\"\n >\n <div className=\"mx-auto w-full max-w-2xl space-y-6\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full overflow-hidden\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n label={\n standalone\n ? t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })\n : t(\"neetoMolecules.onboarding.helpScreen.continueButton\")\n }\n {...buttonProps}\n />\n </div>\n </div>\n );\n};\n\nHelpScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n /**\n * To specify if the help screen is standalone or not.\n */\n standalone: PropTypes.bool,\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div className=\"mx-auto w-full max-w-2xl space-y-6 p-4\">\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (onboardingSteps, setCurrentStep, currentStep) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: <HelpScreen {...{ currentStep, setCurrentStep }} />,\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n}) => {\n const steps = useMemo(\n () => createSteps(onboardingSteps, setCurrentStep, currentStep),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n};\n\nexport default Onboarding;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport \"./onboarding.scss\";\n\nconst WelcomeScreen = withT(\n ({ t, title, description, buttonProps, className = \"\" }) => (\n <div\n className={classnames(\"neeto-molecules-onboarding__wrapper\", className)}\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {title}\n </Typography>\n {description && (\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {description}\n </Typography>\n )}\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n {...buttonProps}\n />\n </div>\n )\n);\n\nWelcomeScreen.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * Title of the welcome screen\n */\n title: PropTypes.string,\n /**\n * Description of the welcome screen\n */\n description: PropTypes.string,\n /**\n * Additional props that can be passed on to the button\n */\n buttonProps: PropTypes.object,\n};\n\nexport default WelcomeScreen;\n"],"names":["CompletedScreen","withT","_ref","t","title","description","children","buttonProps","_ref$className","className","React","createElement","classnames","Typography","style","lineHeight","isPresent","Button","_extends","label","propTypes","PropTypes","string","oneOfType","node","object","HelpScreen","_ref$standalone","standalone","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","component","appName","globalProps","alt","src","completeButtonProps","setCurrentStep","currentStep","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","steps","useMemo","length","handleStepChange","index","isStepperVisible","classNames","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,iBAAe,GAAGC,yBAAK,CAC3B,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,WA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,SAAA,EAAQ,gCAAgC;AACxC,IAAA,aAAA,EAAY,gCAAgC;AAC5CM,IAAAA,UAAU,EAAC,QAAQ;AACnBD,IAAAA,KAAK,EAAC,OAAA;GAELT,EAAAA,WACS,CAEX,CAAC,eACNK,yBAAA,CAAAC,aAAA,CAACM,cAAM,EAAAC,iBAAA,CAAA;AACL,IAAA,SAAA,EAAQ,2BAA2B;AACnC,IAAA,aAAA,EAAY,2BAA2B;AACvCwB,IAAAA,IAAI,EAAEC,qBAAW;IACjBxB,KAAK,EAAEhB,CAAC,CAAC,sCAAsC,CAAA;GAC3CI,EAAAA,WAAW,CAChB,CACE,CAAC,CAAA;AAAA,CAEV,EAAC;AAEDiD,aAAa,CAACpC,SAAS,GAAG;AACxB;AACF;AACA;EACEX,SAAS,EAAEY,uBAAS,CAACC,MAAM;AAC3B;AACF;AACA;EACElB,KAAK,EAAEiB,uBAAS,CAACC,MAAM;AACvB;AACF;AACA;EACEjB,WAAW,EAAEgB,uBAAS,CAACC,MAAM;AAC7B;AACF;AACA;EACEf,WAAW,EAAEc,uBAAS,CAACI,MAAAA;AACzB,CAAC;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.3",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|