@bigbinary/neeto-molecules 3.7.11 → 3.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DocumentEditor.js +4 -2
- package/dist/DocumentEditor.js.map +1 -1
- package/dist/SessionEnvironment.js +10 -4
- package/dist/SessionEnvironment.js.map +1 -1
- package/dist/ShareViaLink.js +1 -1
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/cjs/DocumentEditor.js +4 -2
- package/dist/cjs/DocumentEditor.js.map +1 -1
- package/dist/cjs/SessionEnvironment.js +9 -3
- package/dist/cjs/SessionEnvironment.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +1 -1
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/package.json +1 -1
package/dist/DocumentEditor.js
CHANGED
|
@@ -19,7 +19,7 @@ var DEFAULT_EDITOR_PROPS = {
|
|
|
19
19
|
addons: []
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
var css = "@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:750px;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
|
|
22
|
+
var css = ".neeto-molecules-document__wrapper{height:100%}@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{flex-grow:1;height:auto;max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:750px;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
|
|
23
23
|
n(css,{});
|
|
24
24
|
|
|
25
25
|
var useEditor = function useEditor(_ref) {
|
|
@@ -150,11 +150,12 @@ var Editor = function Editor(_ref) {
|
|
|
150
150
|
"data-testid": "document-editor-container",
|
|
151
151
|
ref: editorHotkeyRef,
|
|
152
152
|
children: /*#__PURE__*/jsx(FormikEditor, _objectSpread(_objectSpread({
|
|
153
|
-
attachmentsClassName: "editor-content-attachments",
|
|
153
|
+
attachmentsClassName: "editor-content-attachments w-full flex-shrink-0",
|
|
154
154
|
className: "h-full w-full",
|
|
155
155
|
contentClassName: "editor-content__wrapper neeto-molecules-document__container",
|
|
156
156
|
"data-cy": "neeto-molecules-document-content-text-area",
|
|
157
157
|
error: undefined,
|
|
158
|
+
errorWrapperClassName: "w-full min-h-full flex flex-col items-center",
|
|
158
159
|
name: editorContentFieldName,
|
|
159
160
|
ref: setEditorRef,
|
|
160
161
|
menuClassName: classnames("neeto-molecules-document-editor__menubar", menuClassName)
|
|
@@ -163,6 +164,7 @@ var Editor = function Editor(_ref) {
|
|
|
163
164
|
}, editorProps), {}, {
|
|
164
165
|
addons: addons
|
|
165
166
|
})), {}, {
|
|
167
|
+
contentWrapperClassName: "w-full flex flex-col flex-grow",
|
|
166
168
|
onChange: handleContentChange,
|
|
167
169
|
onChangeAttachments: handleAttachmentChange,
|
|
168
170
|
children: /*#__PURE__*/jsxs("div", {
|
|
@@ -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 { useCallback } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = useCallback(\n content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n },\n [editorContentFieldName, onContentChange, setFieldValue]\n );\n\n const handleAttachmentChange = useCallback(\n attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n },\n [onAttachmentChange, setAttachments, setFieldValue]\n );\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const handleEditorBackspaceKeypress = () => {\n const editor = editorRef.current?.editor;\n const selection = editor?.state?.selection;\n if (\n editor?.isFocused &&\n isPresent(titleRef.current) &&\n selection?.anchor === 1\n ) {\n const title = titleRef.current.value;\n titleRef.current.focus();\n titleRef.current.setSelectionRange(title?.length, title?.length);\n }\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => {\n editorRef.current?.editor?.commands?.insertContentAt(0, \"<p />\");\n editorRef.current?.editor?.commands?.focus(\"start\");\n },\n { mode: \"scoped\" }\n );\n\n const editorHotkeyRef = useHotkeys(\n \"backspace\",\n handleEditorBackspaceKeypress,\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import { memo, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { 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 const addons = useMemo(\n () => EDITOR_ADDONS.concat(editorProps.addons || []),\n [editorProps.addons]\n );\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n ref={editorHotkeyRef}\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments\"\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, 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\nEditor.displayName = \"DocumentEditor\";\n\nexport default memo(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","useCallback","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","handleEditorBackspaceKeypress","_editorRef$current","_editor$state","editor","current","selection","state","isFocused","isPresent","anchor","focus","setSelectionRange","length","titleHotkeyRef","useHotkeys","_editorRef$current2","_editorRef$current2$e","_editorRef$current2$e2","_editorRef$current3","_editorRef$current3$e","_editorRef$current3$e2","commands","insertContentAt","mode","editorHotkeyRef","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","menuClassName","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","useMemo","concat","_jsx","className","ref","children","FormikEditor","attachmentsClassName","contentClassName","error","undefined","name","classNames","onChange","onChangeAttachments","_jsxs","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style","displayName","memo"],"mappings":";;;;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG,CAC3B,WAAW,EACX,OAAO,EACP,cAAc,EACd,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,MAAM,EACN,MAAM,EACN,OAAO,CACR,CAAA;AAEM,IAAMC,oBAAoB,GAAG;AAClCC,EAAAA,sBAAsB,EAAE,IAAI;AAC5BC,EAAAA,iBAAiB,EAAE,IAAI;AACvBC,EAAAA,MAAM,EAAE,EAAA;AACV,CAAC;;;;;ACbD,IAAMC,SAAS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AAAA,SAAS,EAAE,SAAXA,SAASA,CAAEC,CAAC,EAAA;AAAA,YAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,WAAA;SAEpDrC,EAAAA,UAAU,CACf,CAAC,EACD1D,MAAM,CAACV,sBAAsB,CAAC,iBAC7BmF,GAAA,CAACuB,UAAU,EAAA;AACTtB,UAAAA,SAAS,EAAC,6DAA6D;AACvE,UAAA,SAAA,EAAQ,8BAA8B;AACtCuB,UAAAA,KAAK,EAAC,OAAO;UAAArB,QAAA,EAEZ5E,MAAM,CAACV,sBAAsB,CAAA;AAAC,SACrB,CACb,CAAA;OACE,CAAA;KACO,CAAA,CAAA;AAAC,GACZ,CAAC,CAAA;AAEV,CAAC,CAAA;AAyDDuD,MAAM,CAACqD,WAAW,GAAG,gBAAgB,CAAA;AAErC,YAAeC,aAAAA,IAAI,CAACtD,MAAM,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentEditor.js","sources":["../src/components/DocumentEditor/constants.js","../src/components/DocumentEditor/hooks/useEditor.js","../src/components/DocumentEditor/utils.js","../src/components/DocumentEditor/index.jsx"],"sourcesContent":["export const EDITOR_ADDONS = [\n \"highlight\",\n \"emoji\",\n \"video-upload\",\n \"code-block\",\n \"block-quote\",\n \"image-upload\",\n \"image-upload-unsplash\",\n \"divider\",\n \"video-embed\",\n \"undo\",\n \"redo\",\n \"table\",\n];\n\nexport const DEFAULT_EDITOR_PROPS = {\n isCharacterCountActive: true,\n isMenuIndependent: true,\n addons: [],\n};\n","import { useCallback } from \"react\";\n\nimport { useFormikContext } from \"formik\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\n\nconst useEditor = ({\n onContentChange,\n editorContentFieldName,\n setAttachments,\n onAttachmentChange,\n onTitleChange,\n titleFieldName,\n editorRef,\n titleRef,\n}) => {\n const { setFieldValue, errors } = useFormikContext();\n\n const handleContentChange = useCallback(\n content => {\n setFieldValue(editorContentFieldName, content);\n onContentChange?.(content);\n },\n [editorContentFieldName, onContentChange, setFieldValue]\n );\n\n const handleAttachmentChange = useCallback(\n attachments => {\n setAttachments(attachments);\n setFieldValue(\"attachments\", attachments);\n onAttachmentChange?.(attachments);\n },\n [onAttachmentChange, setAttachments, setFieldValue]\n );\n\n const handleTitleChange = event => {\n const title = event.target.value;\n setFieldValue(titleFieldName, title);\n onTitleChange?.(title);\n };\n\n const handleEditorBackspaceKeypress = () => {\n const editor = editorRef.current?.editor;\n const selection = editor?.state?.selection;\n if (\n editor?.isFocused &&\n isPresent(titleRef.current) &&\n selection?.anchor === 1\n ) {\n const title = titleRef.current.value;\n titleRef.current.focus();\n titleRef.current.setSelectionRange(title?.length, title?.length);\n }\n };\n\n const titleHotkeyRef = useHotkeys(\n \"return\",\n () => {\n editorRef.current?.editor?.commands?.insertContentAt(0, \"<p />\");\n editorRef.current?.editor?.commands?.focus(\"start\");\n },\n { mode: \"scoped\" }\n );\n\n const editorHotkeyRef = useHotkeys(\n \"backspace\",\n handleEditorBackspaceKeypress,\n { mode: \"scoped\" }\n );\n\n return {\n handleContentChange,\n handleAttachmentChange,\n handleTitleChange,\n editorHotkeyRef,\n titleHotkeyRef,\n errors,\n };\n};\n\nexport default useEditor;\n","export const getUniqueAttachments = attachments => {\n const uniqueAttachments = attachments?.reduce(\n (uniqueAttachments, attachment) => ({\n ...uniqueAttachments,\n [attachment.signedId]: attachment,\n }),\n {}\n );\n\n return Object.values(uniqueAttachments || {});\n};\n","import { memo, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { FormikEditor } from \"neetoeditor\";\nimport { Typography } from \"neetoui\";\nimport { Textarea } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { 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 const addons = useMemo(\n () => EDITOR_ADDONS.concat(editorProps.addons || []),\n [editorProps.addons]\n );\n\n return (\n <div\n className=\"neeto-molecules-document__wrapper\"\n data-testid=\"document-editor-container\"\n ref={editorHotkeyRef}\n >\n <FormikEditor\n attachmentsClassName=\"editor-content-attachments w-full flex-shrink-0\"\n className=\"h-full w-full\"\n contentClassName=\"editor-content__wrapper neeto-molecules-document__container\"\n data-cy=\"neeto-molecules-document-content-text-area\"\n error={undefined}\n errorWrapperClassName=\"w-full min-h-full flex flex-col items-center\"\n name={editorContentFieldName}\n ref={setEditorRef}\n menuClassName={classNames(\n \"neeto-molecules-document-editor__menubar\",\n menuClassName\n )}\n {...{ attachments, ...editorProps, addons }}\n contentWrapperClassName=\"w-full flex flex-col flex-grow\"\n onChange={handleContentChange}\n onChangeAttachments={handleAttachmentChange}\n >\n <div className=\"neeto-molecules-document__container px-4\">\n <Textarea\n nakedTextarea\n className=\"neeto-molecules-document__title\"\n data-cy=\"neeto-molecules-document-title-text-field\"\n name={titleFieldName}\n ref={setTitleRef}\n rows={1}\n placeholder={\n titleProps.placeholder || t(\"neetoMolecules.documentEditor.title\")\n }\n onChange={handleTitleChange}\n onKeyDown={e =>\n e.key === \"Enter\" && !e.shiftKey && e.preventDefault()\n }\n {...titleProps}\n />\n {errors[editorContentFieldName] && (\n <Typography\n className=\"neeto-ui-input__error neeto-molecules-editor-content__error\"\n data-cy=\"articles-content-input-error\"\n style=\"body3\"\n >\n {errors[editorContentFieldName]}\n </Typography>\n )}\n </div>\n </FormikEditor>\n </div>\n );\n};\n\nEditor.propTypes = {\n /**\n * List of initial attachments.\n */\n attachments: PropTypes.arrayOf(\n PropTypes.shape({\n contentType: PropTypes.string,\n filename: PropTypes.string,\n signedId: PropTypes.string,\n url: PropTypes.string,\n })\n ),\n /**\n * Callback that will be triggered when the editor content changes.\n * This function is not throttled.\n */\n onContentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the attachments changes.\n */\n onAttachmentChange: PropTypes.func,\n /**\n * Callback that will be triggered when the article title changes.\n */\n onTitleChange: PropTypes.func,\n /**\n * This function will be called with the title node reference.\n */\n getTitleRef: PropTypes.func,\n /**\n * This function will be called with editor reference.\n */\n getEditorRef: PropTypes.func,\n /**\n * Formik field name of the editor. The default value is `htmlContent`.\n */\n editorContentFieldName: PropTypes.string,\n /**\n * Formik field name of the title. The default value is `title`.\n */\n titleFieldName: PropTypes.string,\n /**\n * These props will be passed down to the editor component.\n */\n editorProps: PropTypes.object,\n /**\n * These props will be passed down to the title text area component.\n */\n titleProps: PropTypes.object,\n /**\n * A prop to pass class names to the editor menubar.\n */\n menuClassName: PropTypes.string,\n};\n\nEditor.displayName = \"DocumentEditor\";\n\nexport default memo(Editor);\n"],"names":["EDITOR_ADDONS","DEFAULT_EDITOR_PROPS","isCharacterCountActive","isMenuIndependent","addons","useEditor","_ref","onContentChange","editorContentFieldName","setAttachments","onAttachmentChange","onTitleChange","titleFieldName","editorRef","titleRef","_useFormikContext","useFormikContext","setFieldValue","errors","handleContentChange","useCallback","content","handleAttachmentChange","attachments","handleTitleChange","event","title","target","value","handleEditorBackspaceKeypress","_editorRef$current","_editor$state","editor","current","selection","state","isFocused","isPresent","anchor","focus","setSelectionRange","length","titleHotkeyRef","useHotkeys","_editorRef$current2","_editorRef$current2$e","_editorRef$current2$e2","_editorRef$current3","_editorRef$current3$e","_editorRef$current3$e2","commands","insertContentAt","mode","editorHotkeyRef","getUniqueAttachments","uniqueAttachments","reduce","attachment","_objectSpread","_defineProperty","signedId","Object","values","Editor","initialAttachments","_ref$getTitleRef","getTitleRef","noop","_ref$getEditorRef","getEditorRef","menuClassName","_ref$editorContentFie","_ref$titleFieldName","_ref$editorProps","editorProps","_ref$titleProps","titleProps","_useTranslation","useTranslation","t","useRef","_useState","useState","_useState2","_slicedToArray","_useEditor","setTitleRef","node","setEditorRef","useMemo","concat","_jsx","className","ref","children","FormikEditor","attachmentsClassName","contentClassName","error","undefined","errorWrapperClassName","name","classNames","contentWrapperClassName","onChange","onChangeAttachments","_jsxs","Textarea","nakedTextarea","rows","placeholder","onKeyDown","e","key","shiftKey","preventDefault","Typography","style","displayName","memo"],"mappings":";;;;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG,CAC3B,WAAW,EACX,OAAO,EACP,cAAc,EACd,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,MAAM,EACN,MAAM,EACN,OAAO,CACR,CAAA;AAEM,IAAMC,oBAAoB,GAAG;AAClCC,EAAAA,sBAAsB,EAAE,IAAI;AAC5BC,EAAAA,iBAAiB,EAAE,IAAI;AACvBC,EAAAA,MAAM,EAAE,EAAA;AACV,CAAC;;;;;ACbD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAST;AAAA,EAAA,IARJC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,sBAAsB,GAA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CAAEC,CAAC,EAAA;AAAA,YAAA,OACVA,CAAC,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,CAAC,CAACE,QAAQ,IAAIF,CAAC,CAACG,cAAc,EAAE,CAAA;AAAA,WAAA;SAEpDvC,EAAAA,UAAU,CACf,CAAC,EACD1D,MAAM,CAACV,sBAAsB,CAAC,iBAC7BmF,GAAA,CAACyB,UAAU,EAAA;AACTxB,UAAAA,SAAS,EAAC,6DAA6D;AACvE,UAAA,SAAA,EAAQ,8BAA8B;AACtCyB,UAAAA,KAAK,EAAC,OAAO;UAAAvB,QAAA,EAEZ5E,MAAM,CAACV,sBAAsB,CAAA;AAAC,SACrB,CACb,CAAA;OACE,CAAA;KACO,CAAA,CAAA;AAAC,GACZ,CAAC,CAAA;AAEV,CAAC,CAAA;AAyDDuD,MAAM,CAACuD,WAAW,GAAG,gBAAgB,CAAA;AAErC,YAAeC,aAAAA,IAAI,CAACxD,MAAM,CAAC;;;;"}
|
|
@@ -5,7 +5,7 @@ import Down from '@bigbinary/neeto-icons/Down';
|
|
|
5
5
|
import Up from '@bigbinary/neeto-icons/Up';
|
|
6
6
|
import Button from '@bigbinary/neetoui/Button';
|
|
7
7
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
8
|
-
import { isNil, pluck, not } from 'ramda';
|
|
8
|
+
import { pipe, prop, isNil, pluck, not } from 'ramda';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
11
11
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
@@ -98,6 +98,7 @@ var getIcon = function getIcon(_ref2) {
|
|
|
98
98
|
size: iconSize
|
|
99
99
|
}) : null;
|
|
100
100
|
};
|
|
101
|
+
var isValuePresent = pipe(prop("value"), isPresent);
|
|
101
102
|
|
|
102
103
|
var Item = function Item(_ref) {
|
|
103
104
|
var handleCancel = _ref.handleCancel,
|
|
@@ -201,10 +202,12 @@ var Item = function Item(_ref) {
|
|
|
201
202
|
className: "overflow-hidden truncate whitespace-normal break-all ".concat(extraClasses)
|
|
202
203
|
}
|
|
203
204
|
}) : /*#__PURE__*/jsx(Typography, {
|
|
204
|
-
className: "overflow-hidden truncate whitespace-normal break-all ".concat(extraClasses),
|
|
205
205
|
"data-testid": "metadata-value-".concat(name),
|
|
206
206
|
style: "body2",
|
|
207
207
|
weight: "normal",
|
|
208
|
+
className: classnames("overflow-hidden truncate whitespace-normal break-all ".concat(extraClasses), {
|
|
209
|
+
"neeto-molecules-session-environment-editable-text cursor-pointer p-0.5": isEditable
|
|
210
|
+
}),
|
|
208
211
|
onClick: function onClick() {
|
|
209
212
|
return isEditable && setIsEditing(true);
|
|
210
213
|
},
|
|
@@ -274,6 +277,7 @@ var DetailsBlock = function DetailsBlock(_ref) {
|
|
|
274
277
|
title = _ref$title === void 0 ? "" : _ref$title;
|
|
275
278
|
return /*#__PURE__*/jsxs("div", {
|
|
276
279
|
className: "mb-4",
|
|
280
|
+
"data-testid": "details-block-items-parent",
|
|
277
281
|
children: [title && /*#__PURE__*/jsxs("div", {
|
|
278
282
|
className: "mb-2 flex",
|
|
279
283
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
@@ -283,7 +287,9 @@ var DetailsBlock = function DetailsBlock(_ref) {
|
|
|
283
287
|
weight: "bold",
|
|
284
288
|
children: title
|
|
285
289
|
}), isPresent(helpPopoverProps) && /*#__PURE__*/jsx(HelpPopover, _objectSpread({}, helpPopoverProps))]
|
|
286
|
-
}), details.
|
|
290
|
+
}), details.filter(function (detail) {
|
|
291
|
+
return detail.isEditable || isValuePresent(detail);
|
|
292
|
+
}).map(function (detail, index) {
|
|
287
293
|
return /*#__PURE__*/createElement(Item, {
|
|
288
294
|
handleCancel: handleCancel,
|
|
289
295
|
handleSubmit: handleSubmit,
|
|
@@ -297,7 +303,7 @@ var DetailsBlock = function DetailsBlock(_ref) {
|
|
|
297
303
|
};
|
|
298
304
|
var DetailsBlock$1 = /*#__PURE__*/memo(DetailsBlock);
|
|
299
305
|
|
|
300
|
-
var css = ".neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .ant-picker-suffix{display:none}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input__prefix{margin:0;padding:0}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-date-input,.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input>input{padding:4px 45px 4px 4px!important}.neeto-molecules-session-environment-editable-field__actions .neeto-ui-btn{background-color:transparent!important;min-height:0!important;padding:2px!important}";
|
|
306
|
+
var css = ".neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .ant-picker-suffix{display:none}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input__prefix{margin:0;padding:0}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-date-input,.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input>input{padding:4px 45px 4px 4px!important}.neeto-molecules-session-environment-editable-field__actions .neeto-ui-btn{background-color:transparent!important;min-height:0!important;padding:2px!important}.neeto-molecules-session-environment-editable-text{border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);transition:var(--neeto-ui-transition)}.neeto-molecules-session-environment-editable-text:hover{border:thin solid rgb(var(--neeto-ui-gray-400))}";
|
|
301
307
|
n(css,{});
|
|
302
308
|
|
|
303
309
|
var SessionEnvironment = function SessionEnvironment(_ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionEnvironment.js","sources":["../src/components/SessionEnvironment/constants.js","../src/components/SessionEnvironment/utils.jsx","../src/components/SessionEnvironment/Item.jsx","../src/components/SessionEnvironment/DetailsBlock.jsx","../src/components/SessionEnvironment/index.jsx"],"sourcesContent":["import {\n Computer,\n Email,\n Location,\n Mobile,\n Phone,\n Subdomain,\n User,\n} from \"neetoicons\";\nimport {\n Apple,\n Chrome,\n Edge,\n Firefox,\n Safari,\n Ubuntu,\n Windows,\n} from \"neetoicons/misc\";\n\nexport const BOOLEAN_VALUES_MAP = { true: \"Yes\", false: \"No\" };\nexport const ENTER = \"enter\";\nexport const ESCAPE = \"escape\";\nexport const PHONE_NUMBER = \"phone_number\";\nexport const INTEGER = \"integer\";\nexport const ICONS_MAP = {\n name: User,\n user: User,\n email: Email,\n phone_number: Phone,\n location: Location,\n timezone: Subdomain,\n chrome: Chrome,\n safari: Safari,\n firefox: Firefox,\n edge: Edge,\n ie: Edge,\n windows: Windows,\n mac_os: Apple,\n linux: Ubuntu,\n mobile: Mobile,\n desktop: Computer,\n};\n","import { isPresent } from \"neetocist\";\n\nimport { ICONS_MAP, INTEGER, PHONE_NUMBER } from \"./constants\";\n\nexport const getInputType = ({ name, kind }) => {\n if (name === PHONE_NUMBER) return \"tel\";\n else if (kind === INTEGER) return \"number\";\n\n return \"text\";\n};\n\nexport const getIcon = ({ iconSize, name, value }) => {\n const Icon =\n name === \"browser\" || name === \"os\"\n ? ICONS_MAP[value?.toLowerCase().replace(\" \", \"_\")]\n : ICONS_MAP[name];\n\n return isPresent(Icon) ? <Icon size={iconSize} /> : null;\n};\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\nimport { Check, Close } from \"neetoicons\";\nimport { Button, Input, Tooltip, Typography } from \"neetoui\";\nimport { isNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\nimport { PhoneNumberInput } from \"components/PhoneNumber\";\nimport TimeFormat from \"components/TimeFormat\";\n\nimport { BOOLEAN_VALUES_MAP, ENTER, ESCAPE, PHONE_NUMBER } from \"./constants\";\nimport { getIcon, getInputType } from \"./utils\";\n\nconst Item = ({ handleCancel, handleSubmit, iconSize, item, showIcons }) => {\n const [isEditing, setIsEditing] = useState(item.isEditing);\n const [value, setValue] = useState(item.value);\n\n const { t } = useTranslation();\n\n const containerRef = useHotkeys(ESCAPE, () => handleCancel(name), {\n mode: \"scoped\",\n });\n\n const {\n icon,\n isEditable = false,\n extraClasses = \"\",\n extraWrapperClasses = \"\",\n id,\n fieldValueId,\n custom = false,\n name,\n kind,\n error,\n label,\n showCopyButton = false,\n } = item;\n\n const valueToRender = useMemo(() => {\n if (isNil(value)) return \"-\";\n\n if (typeof value === \"boolean\") return BOOLEAN_VALUES_MAP[value.toString()];\n\n return value;\n }, [value]);\n\n const iconToRender = useMemo(\n () => icon || getIcon({ iconSize, name, value }),\n [icon, iconSize, name, value]\n );\n\n const onSuccess = () => setIsEditing(false);\n\n const handleMetadataSubmit = () =>\n handleSubmit({ fieldId: id, fieldValueId, name, value, custom, onSuccess });\n\n const handleMetadataCancel = () => {\n setIsEditing(false);\n setValue(item.value);\n handleCancel(name);\n };\n\n const inputRef = useHotkeys(ENTER, handleMetadataSubmit, {\n mode: \"scoped\",\n });\n\n const InputComponent = name === PHONE_NUMBER ? PhoneNumberInput : Input;\n\n const handleChange = event => {\n const value = name === PHONE_NUMBER ? event : event.target.value;\n setValue(value);\n };\n\n useEffect(() => {\n setValue(item.value);\n }, [item]);\n\n return (\n <div\n ref={containerRef}\n className={classNames(\n \"mb-2 flex place-items-center gap-2 align-middle\",\n extraWrapperClasses,\n { \"flex-wrap\": name !== PHONE_NUMBER }\n )}\n >\n {showIcons && isPresent(iconToRender) ? (\n <Tooltip\n content={\n label || t(`neetoMolecules.sessionEnvironment.details.keys.${name}`)\n }\n >\n <div className=\"flex-shrink-0\">{iconToRender}</div>\n </Tooltip>\n ) : (\n <Typography\n className=\"neeto-molecules-session-environment-editable-field whitespace-nowrap\"\n style=\"h5\"\n >\n {label || t(`neetoMolecules.sessionEnvironment.details.keys.${name}`)}\n </Typography>\n )}\n {!isEditing ? (\n <>\n {kind === \"datetime\" ? (\n <TimeFormat.DateWeekTime\n date={value}\n typographyProps={{\n style: \"body2\",\n className: `overflow-hidden truncate whitespace-normal break-all ${extraClasses}`,\n }}\n />\n ) : (\n <Typography\n className={`overflow-hidden truncate whitespace-normal break-all ${extraClasses}`}\n data-testid={`metadata-value-${name}`}\n style=\"body2\"\n weight=\"normal\"\n onClick={() => isEditable && setIsEditing(true)}\n >\n {valueToRender}\n </Typography>\n )}\n {showCopyButton && (\n <CopyToClipboardButton\n className=\"flex-shrink-0\"\n size=\"small\"\n style=\"text\"\n value={valueToRender}\n />\n )}\n </>\n ) : (\n <div className=\"neeto-molecules-session-environment-editable-field relative flex min-w-0 flex-grow items-center\">\n <InputComponent\n {...{ error }}\n autoFocus\n data-testid={`metadata-input-${name}`}\n placeholder={t(\"neetoMolecules.common.enter\", { what: label })}\n ref={inputRef}\n type={getInputType({ name, kind })}\n value={value || \"\"}\n onChange={handleChange}\n />\n <div className=\"neeto-molecules-session-environment-editable-field__actions absolute right-0 top-0 flex h-8 items-center pr-1\">\n <Button\n icon={Close}\n size=\"small\"\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.actions.cancel\"),\n position: \"top\",\n }}\n onClick={handleMetadataCancel}\n />\n <Button\n data-testid={`metadata-submit-${name}`}\n icon={Check}\n size=\"small\"\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.actions.save\"),\n position: \"top\",\n }}\n onClick={handleMetadataSubmit}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Item;\n","import { memo } from \"react\";\n\nimport { isPresent, noop } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport HelpPopover from \"components/HelpPopover\";\n\nimport Item from \"./Item\";\n\nconst DetailsBlock = ({\n details,\n handleCancel = noop,\n handleSubmit = noop,\n helpPopoverProps,\n iconSize,\n showIcons = false,\n title = \"\",\n}) => (\n <div className=\"mb-4\">\n {title && (\n <div className=\"mb-2 flex\">\n <Typography\n className=\"mr-2\"\n style=\"h4\"\n textTransform=\"uppercase\"\n weight=\"bold\"\n >\n {title}\n </Typography>\n {isPresent(helpPopoverProps) && <HelpPopover {...helpPopoverProps} />}\n </div>\n )}\n {details.map((detail, index) => (\n <Item\n {...{ handleCancel, handleSubmit, iconSize, showIcons }}\n item={detail}\n key={index}\n />\n ))}\n </div>\n);\n\nexport default memo(DetailsBlock);\n","import { memo, useMemo, useState } from \"react\";\n\nimport { filterBy, isPresent, noop, removeBy } from \"neetocist\";\nimport { Down, Up } from \"neetoicons\";\nimport { Button, Spinner } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { pluck, not } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport DetailsBlock from \"./DetailsBlock\";\nimport \"./session-environment.scss\";\n\nconst SessionEnvironment = ({\n details,\n handleCancel = noop,\n handleSubmit = noop,\n helpPopoverProps = {},\n iconSize = 20,\n isLoading = false,\n moreDetails = [],\n title = \"\",\n}) => {\n const [showViewMore, setShowViewMore] = useState(false);\n\n const customViewMoreItems = useMemo(\n () => filterBy({ kind: \"custom\" }, moreDetails),\n [moreDetails]\n );\n\n const { t } = useTranslation();\n\n if (isLoading) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <div className=\"w-full\">\n <DetailsBlock\n {...{\n details,\n handleCancel,\n handleSubmit,\n helpPopoverProps,\n iconSize,\n title,\n }}\n showIcons\n />\n {showViewMore && (\n <>\n <hr className=\"neeto-ui-border-gray-200 m-4\" />\n <DetailsBlock\n {...{\n handleCancel,\n handleSubmit,\n helpPopoverProps,\n iconSize,\n }}\n details={removeBy({ kind: \"custom\" }, moreDetails)}\n />\n {isPresent(customViewMoreItems) && (\n <>\n <hr className=\"neeto-ui-border-gray-200 m-4\" />\n {pluck(\"value\", customViewMoreItems)}\n </>\n )}\n </>\n )}\n <Button\n className=\"mb-4\"\n icon={showViewMore ? Up : Down}\n style=\"link\"\n label={\n showViewMore\n ? t(\"neetoMolecules.sessionEnvironment.viewLess\")\n : t(\"neetoMolecules.sessionEnvironment.viewMore\")\n }\n onClick={() => setShowViewMore(not)}\n />\n </div>\n );\n};\n\nSessionEnvironment.propTypes = {\n /*\n details can be an array of fields to be displayed.\n */\n details: PropTypes.array,\n /*\n handleCancel is a function that will be called when the cancel button is clicked.\n */\n handleCancel: PropTypes.func,\n /*\n handleSubmit is a function that will be called when the form is submitted.\n */\n handleSubmit: PropTypes.func,\n /*\n helpPopoverProps are the props that will be passed to the HelpPopover component.\n */\n helpPopoverProps: PropTypes.object,\n /*\n iconSize is a number that will be used to set the size of the icon.\n */\n iconSize: PropTypes.number,\n /*\n isLoading is a boolean that will be used to show a spinner when true.\n */\n isLoading: PropTypes.bool,\n /*\n moreDetails can be an array of fields to be displayed when the view more button is clicked.\n */\n moreDetails: PropTypes.array,\n /*\n The title to be displayed above the details.\n */\n title: PropTypes.string,\n};\n\nexport default memo(SessionEnvironment);\n"],"names":["BOOLEAN_VALUES_MAP","ENTER","ESCAPE","PHONE_NUMBER","INTEGER","ICONS_MAP","name","User","user","email","Email","phone_number","Phone","location","Location","timezone","Subdomain","chrome","Chrome","safari","Safari","firefox","Firefox","edge","Edge","ie","windows","Windows","mac_os","Apple","linux","Ubuntu","mobile","Mobile","desktop","Computer","getInputType","_ref","kind","getIcon","_ref2","iconSize","value","Icon","toLowerCase","replace","isPresent","_jsx","size","Item","handleCancel","handleSubmit","item","showIcons","_useState","useState","isEditing","_useState2","_slicedToArray","setIsEditing","_useState3","_useState4","setValue","_useTranslation","useTranslation","t","containerRef","useHotkeys","mode","icon","_item$isEditable","isEditable","_item$extraClasses","extraClasses","_item$extraWrapperCla","extraWrapperClasses","id","fieldValueId","_item$custom","custom","error","label","_item$showCopyButton","showCopyButton","valueToRender","useMemo","isNil","toString","iconToRender","onSuccess","handleMetadataSubmit","fieldId","handleMetadataCancel","inputRef","InputComponent","PhoneNumberInput","Input","handleChange","event","target","useEffect","_jsxs","ref","className","classNames","children","Tooltip","content","concat","Typography","style","_Fragment","TimeFormat","DateWeekTime","date","typographyProps","weight","onClick","CopyToClipboardButton","autoFocus","placeholder","what","type","onChange","Button","Close","tooltipProps","position","Check","DetailsBlock","details","_ref$handleCancel","noop","_ref$handleSubmit","helpPopoverProps","_ref$showIcons","_ref$title","title","textTransform","HelpPopover","_objectSpread","map","detail","index","_createElement","key","memo","SessionEnvironment","_ref$helpPopoverProps","_ref$iconSize","_ref$isLoading","isLoading","_ref$moreDetails","moreDetails","showViewMore","setShowViewMore","customViewMoreItems","filterBy","Spinner","removeBy","pluck","Up","Down","not"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAMA,kBAAkB,GAAG;AAAE,EAAA,MAAA,EAAM,KAAK;EAAE,OAAO,EAAA,IAAA;AAAK,CAAC,CAAA;AACvD,IAAMC,KAAK,GAAG,OAAO,CAAA;AACrB,IAAMC,MAAM,GAAG,QAAQ,CAAA;AACvB,IAAMC,YAAY,GAAG,cAAc,CAAA;AACnC,IAAMC,OAAO,GAAG,SAAS,CAAA;AACzB,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAEC,IAAI;AACVC,EAAAA,IAAI,EAAED,IAAI;AACVE,EAAAA,KAAK,EAAEC,KAAK;AACZC,EAAAA,YAAY,EAAEC,KAAK;AACnBC,EAAAA,QAAQ,EAAEC,QAAQ;AAClBC,EAAAA,QAAQ,EAAEC,SAAS;AACnBC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,OAAO,EAAEC,OAAO;AAChBC,EAAAA,IAAI,EAAEC,IAAI;AACVC,EAAAA,EAAE,EAAED,IAAI;AACRE,EAAAA,OAAO,EAAEC,OAAO;AAChBC,EAAAA,MAAM,EAAEC,KAAK;AACbC,EAAAA,KAAK,EAAEC,MAAM;AACbC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,OAAO,EAAEC,QAAAA;AACX,CAAC;;ACrCM,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EA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,SAAE,CAAC,EAC9CyD,KAAK,CAAC,OAAO,EAAEJ,mBAAmB,CAAC,CAAA;AAAA,OACpC,CACH,CAAA;AAAA,KACD,CACH,eACD7G,GAAA,CAAC6E,MAAM,EAAA;AACLrB,MAAAA,SAAS,EAAC,MAAM;AAChBlC,MAAAA,IAAI,EAAEqF,YAAY,GAAGO,EAAE,GAAGC,IAAK;AAC/BpD,MAAAA,KAAK,EAAC,MAAM;MACZ7B,KAAK,EACHyE,YAAY,GACRzF,CAAC,CAAC,4CAA4C,CAAC,GAC/CA,CAAC,CAAC,4CAA4C,CACnD;MACDoD,OAAO,EAAE,SAATA,OAAOA,GAAA;QAAA,OAAQsC,eAAe,CAACQ,GAAG,CAAC,CAAA;AAAA,OAAA;AAAC,KACrC,CAAC,CAAA;AAAA,GACC,CAAC,CAAA;AAEV,CAAC,CAAA;AAqCD,YAAejB,aAAAA,IAAI,CAACC,kBAAkB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"SessionEnvironment.js","sources":["../src/components/SessionEnvironment/constants.js","../src/components/SessionEnvironment/utils.jsx","../src/components/SessionEnvironment/Item.jsx","../src/components/SessionEnvironment/DetailsBlock.jsx","../src/components/SessionEnvironment/index.jsx"],"sourcesContent":["import {\n Computer,\n Email,\n Location,\n Mobile,\n Phone,\n Subdomain,\n User,\n} from \"neetoicons\";\nimport {\n Apple,\n Chrome,\n Edge,\n Firefox,\n Safari,\n Ubuntu,\n Windows,\n} from \"neetoicons/misc\";\n\nexport const BOOLEAN_VALUES_MAP = { true: \"Yes\", false: \"No\" };\nexport const ENTER = \"enter\";\nexport const ESCAPE = \"escape\";\nexport const PHONE_NUMBER = \"phone_number\";\nexport const INTEGER = \"integer\";\nexport const ICONS_MAP = {\n name: User,\n user: User,\n email: Email,\n phone_number: Phone,\n location: Location,\n timezone: Subdomain,\n chrome: Chrome,\n safari: Safari,\n firefox: Firefox,\n edge: Edge,\n ie: Edge,\n windows: Windows,\n mac_os: Apple,\n linux: Ubuntu,\n mobile: Mobile,\n desktop: Computer,\n};\n","import { isPresent } from \"neetocist\";\nimport { prop, pipe } from \"ramda\";\n\nimport { ICONS_MAP, INTEGER, PHONE_NUMBER } from \"./constants\";\n\nexport const getInputType = ({ name, kind }) => {\n if (name === PHONE_NUMBER) return \"tel\";\n else if (kind === INTEGER) return \"number\";\n\n return \"text\";\n};\n\nexport const getIcon = ({ iconSize, name, value }) => {\n const Icon =\n name === \"browser\" || name === \"os\"\n ? ICONS_MAP[value?.toLowerCase().replace(\" \", \"_\")]\n : ICONS_MAP[name];\n\n return isPresent(Icon) ? <Icon size={iconSize} /> : null;\n};\n\nexport const isValuePresent = pipe(prop(\"value\"), isPresent);\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport useHotkeys from \"neetohotkeys\";\nimport { Check, Close } from \"neetoicons\";\nimport { Button, Input, Tooltip, Typography } from \"neetoui\";\nimport { isNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\nimport { PhoneNumberInput } from \"components/PhoneNumber\";\nimport TimeFormat from \"components/TimeFormat\";\n\nimport { BOOLEAN_VALUES_MAP, ENTER, ESCAPE, PHONE_NUMBER } from \"./constants\";\nimport { getIcon, getInputType } from \"./utils\";\n\nconst Item = ({ handleCancel, handleSubmit, iconSize, item, showIcons }) => {\n const [isEditing, setIsEditing] = useState(item.isEditing);\n const [value, setValue] = useState(item.value);\n\n const { t } = useTranslation();\n\n const containerRef = useHotkeys(ESCAPE, () => handleCancel(name), {\n mode: \"scoped\",\n });\n\n const {\n icon,\n isEditable = false,\n extraClasses = \"\",\n extraWrapperClasses = \"\",\n id,\n fieldValueId,\n custom = false,\n name,\n kind,\n error,\n label,\n showCopyButton = false,\n } = item;\n\n const valueToRender = useMemo(() => {\n if (isNil(value)) return \"-\";\n\n if (typeof value === \"boolean\") return BOOLEAN_VALUES_MAP[value.toString()];\n\n return value;\n }, [value]);\n\n const iconToRender = useMemo(\n () => icon || getIcon({ iconSize, name, value }),\n [icon, iconSize, name, value]\n );\n\n const onSuccess = () => setIsEditing(false);\n\n const handleMetadataSubmit = () =>\n handleSubmit({ fieldId: id, fieldValueId, name, value, custom, onSuccess });\n\n const handleMetadataCancel = () => {\n setIsEditing(false);\n setValue(item.value);\n handleCancel(name);\n };\n\n const inputRef = useHotkeys(ENTER, handleMetadataSubmit, {\n mode: \"scoped\",\n });\n\n const InputComponent = name === PHONE_NUMBER ? PhoneNumberInput : Input;\n\n const handleChange = event => {\n const value = name === PHONE_NUMBER ? event : event.target.value;\n setValue(value);\n };\n\n useEffect(() => {\n setValue(item.value);\n }, [item]);\n\n return (\n <div\n ref={containerRef}\n className={classNames(\n \"mb-2 flex place-items-center gap-2 align-middle\",\n extraWrapperClasses,\n { \"flex-wrap\": name !== PHONE_NUMBER }\n )}\n >\n {showIcons && isPresent(iconToRender) ? (\n <Tooltip\n content={\n label || t(`neetoMolecules.sessionEnvironment.details.keys.${name}`)\n }\n >\n <div className=\"flex-shrink-0\">{iconToRender}</div>\n </Tooltip>\n ) : (\n <Typography\n className=\"neeto-molecules-session-environment-editable-field whitespace-nowrap\"\n style=\"h5\"\n >\n {label || t(`neetoMolecules.sessionEnvironment.details.keys.${name}`)}\n </Typography>\n )}\n {!isEditing ? (\n <>\n {kind === \"datetime\" ? (\n <TimeFormat.DateWeekTime\n date={value}\n typographyProps={{\n style: \"body2\",\n className: `overflow-hidden truncate whitespace-normal break-all ${extraClasses}`,\n }}\n />\n ) : (\n <Typography\n data-testid={`metadata-value-${name}`}\n style=\"body2\"\n weight=\"normal\"\n className={classNames(\n `overflow-hidden truncate whitespace-normal break-all ${extraClasses}`,\n {\n \"neeto-molecules-session-environment-editable-text cursor-pointer p-0.5\":\n isEditable,\n }\n )}\n onClick={() => isEditable && setIsEditing(true)}\n >\n {valueToRender}\n </Typography>\n )}\n {showCopyButton && (\n <CopyToClipboardButton\n className=\"flex-shrink-0\"\n size=\"small\"\n style=\"text\"\n value={valueToRender}\n />\n )}\n </>\n ) : (\n <div className=\"neeto-molecules-session-environment-editable-field relative flex min-w-0 flex-grow items-center\">\n <InputComponent\n {...{ error }}\n autoFocus\n data-testid={`metadata-input-${name}`}\n placeholder={t(\"neetoMolecules.common.enter\", { what: label })}\n ref={inputRef}\n type={getInputType({ name, kind })}\n value={value || \"\"}\n onChange={handleChange}\n />\n <div className=\"neeto-molecules-session-environment-editable-field__actions absolute right-0 top-0 flex h-8 items-center pr-1\">\n <Button\n icon={Close}\n size=\"small\"\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.actions.cancel\"),\n position: \"top\",\n }}\n onClick={handleMetadataCancel}\n />\n <Button\n data-testid={`metadata-submit-${name}`}\n icon={Check}\n size=\"small\"\n style=\"text\"\n tooltipProps={{\n content: t(\"neetoMolecules.common.actions.save\"),\n position: \"top\",\n }}\n onClick={handleMetadataSubmit}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default Item;\n","import { memo } from \"react\";\n\nimport { isPresent, noop } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport HelpPopover from \"components/HelpPopover\";\n\nimport Item from \"./Item\";\nimport { isValuePresent } from \"./utils\";\n\nconst DetailsBlock = ({\n details,\n handleCancel = noop,\n handleSubmit = noop,\n helpPopoverProps,\n iconSize,\n showIcons = false,\n title = \"\",\n}) => (\n <div className=\"mb-4\" data-testid=\"details-block-items-parent\">\n {title && (\n <div className=\"mb-2 flex\">\n <Typography\n className=\"mr-2\"\n style=\"h4\"\n textTransform=\"uppercase\"\n weight=\"bold\"\n >\n {title}\n </Typography>\n {isPresent(helpPopoverProps) && <HelpPopover {...helpPopoverProps} />}\n </div>\n )}\n {details\n .filter(detail => detail.isEditable || isValuePresent(detail))\n .map((detail, index) => (\n <Item\n {...{ handleCancel, handleSubmit, iconSize, showIcons }}\n item={detail}\n key={index}\n />\n ))}\n </div>\n);\n\nexport default memo(DetailsBlock);\n","import { memo, useMemo, useState } from \"react\";\n\nimport { filterBy, isPresent, noop, removeBy } from \"neetocist\";\nimport { Down, Up } from \"neetoicons\";\nimport { Button, Spinner } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { pluck, not } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport DetailsBlock from \"./DetailsBlock\";\nimport \"./session-environment.scss\";\n\nconst SessionEnvironment = ({\n details,\n handleCancel = noop,\n handleSubmit = noop,\n helpPopoverProps = {},\n iconSize = 20,\n isLoading = false,\n moreDetails = [],\n title = \"\",\n}) => {\n const [showViewMore, setShowViewMore] = useState(false);\n\n const customViewMoreItems = useMemo(\n () => filterBy({ kind: \"custom\" }, moreDetails),\n [moreDetails]\n );\n\n const { t } = useTranslation();\n\n if (isLoading) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <div className=\"w-full\">\n <DetailsBlock\n {...{\n details,\n handleCancel,\n handleSubmit,\n helpPopoverProps,\n iconSize,\n title,\n }}\n showIcons\n />\n {showViewMore && (\n <>\n <hr className=\"neeto-ui-border-gray-200 m-4\" />\n <DetailsBlock\n {...{\n handleCancel,\n handleSubmit,\n helpPopoverProps,\n iconSize,\n }}\n details={removeBy({ kind: \"custom\" }, moreDetails)}\n />\n {isPresent(customViewMoreItems) && (\n <>\n <hr className=\"neeto-ui-border-gray-200 m-4\" />\n {pluck(\"value\", customViewMoreItems)}\n </>\n )}\n </>\n )}\n <Button\n className=\"mb-4\"\n icon={showViewMore ? Up : Down}\n style=\"link\"\n label={\n showViewMore\n ? t(\"neetoMolecules.sessionEnvironment.viewLess\")\n : t(\"neetoMolecules.sessionEnvironment.viewMore\")\n }\n onClick={() => setShowViewMore(not)}\n />\n </div>\n );\n};\n\nSessionEnvironment.propTypes = {\n /*\n details can be an array of fields to be displayed.\n */\n details: PropTypes.array,\n /*\n handleCancel is a function that will be called when the cancel button is clicked.\n */\n handleCancel: PropTypes.func,\n /*\n handleSubmit is a function that will be called when the form is submitted.\n */\n handleSubmit: PropTypes.func,\n /*\n helpPopoverProps are the props that will be passed to the HelpPopover component.\n */\n helpPopoverProps: PropTypes.object,\n /*\n iconSize is a number that will be used to set the size of the icon.\n */\n iconSize: PropTypes.number,\n /*\n isLoading is a boolean that will be used to show a spinner when true.\n */\n isLoading: PropTypes.bool,\n /*\n moreDetails can be an array of fields to be displayed when the view more button is clicked.\n */\n moreDetails: PropTypes.array,\n /*\n The title to be displayed above the details.\n */\n title: PropTypes.string,\n};\n\nexport default memo(SessionEnvironment);\n"],"names":["BOOLEAN_VALUES_MAP","ENTER","ESCAPE","PHONE_NUMBER","INTEGER","ICONS_MAP","name","User","user","email","Email","phone_number","Phone","location","Location","timezone","Subdomain","chrome","Chrome","safari","Safari","firefox","Firefox","edge","Edge","ie","windows","Windows","mac_os","Apple","linux","Ubuntu","mobile","Mobile","desktop","Computer","getInputType","_ref","kind","getIcon","_ref2","iconSize","value","Icon","toLowerCase","replace","isPresent","_jsx","size","isValuePresent","pipe","prop","Item","handleCancel","handleSubmit","item","showIcons","_useState","useState","isEditing","_useState2","_slicedToArray","setIsEditing","_useState3","_useState4","setValue","_useTranslation","useTranslation","t","containerRef","useHotkeys","mode","icon","_item$isEditable","isEditable","_item$extraClasses","extraClasses","_item$extraWrapperCla","extraWrapperClasses","id","fieldValueId","_item$custom","custom","error","label","_item$showCopyButton","showCopyButton","valueToRender","useMemo","isNil","toString","iconToRender","onSuccess","handleMetadataSubmit","fieldId","handleMetadataCancel","inputRef","InputComponent","PhoneNumberInput","Input","handleChange","event","target","useEffect","_jsxs","ref","className","classNames","children","Tooltip","content","concat","Typography","style","_Fragment","TimeFormat","DateWeekTime","date","typographyProps","weight","onClick","CopyToClipboardButton","autoFocus","placeholder","what","type","onChange","Button","Close","tooltipProps","position","Check","DetailsBlock","details","_ref$handleCancel","noop","_ref$handleSubmit","helpPopoverProps","_ref$showIcons","_ref$title","title","textTransform","HelpPopover","_objectSpread","filter","detail","map","index","_createElement","key","memo","SessionEnvironment","_ref$helpPopoverProps","_ref$iconSize","_ref$isLoading","isLoading","_ref$moreDetails","moreDetails","showViewMore","setShowViewMore","customViewMoreItems","filterBy","Spinner","removeBy","pluck","Up","Down","not"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAMA,kBAAkB,GAAG;AAAE,EAAA,MAAA,EAAM,KAAK;EAAE,OAAO,EAAA,IAAA;AAAK,CAAC,CAAA;AACvD,IAAMC,KAAK,GAAG,OAAO,CAAA;AACrB,IAAMC,MAAM,GAAG,QAAQ,CAAA;AACvB,IAAMC,YAAY,GAAG,cAAc,CAAA;AACnC,IAAMC,OAAO,GAAG,SAAS,CAAA;AACzB,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAEC,IAAI;AACVC,EAAAA,IAAI,EAAED,IAAI;AACVE,EAAAA,KAAK,EAAEC,KAAK;AACZC,EAAAA,YAAY,EAAEC,KAAK;AACnBC,EAAAA,QAAQ,EAAEC,QAAQ;AAClBC,EAAAA,QAAQ,EAAEC,SAAS;AACnBC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,OAAO,EAAEC,OAAO;AAChBC,EAAAA,IAAI,EAAEC,IAAI;AACVC,EAAAA,EAAE,EAAED,IAAI;AACRE,EAAAA,OAAO,EAAEC,OAAO;AAChBC,EAAAA,MAAM,EAAEC,KAAK;AACbC,EAAAA,KAAK,EAAEC,MAAM;AACbC,EAAAA,MAAM,EAAEC,MAAM;AACdC,EAAAA,OAAO,EAAEC,QAAAA;AACX,CAAC;;ACpCM,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAuB;AAAA,EAAA,IAAjB/B,IAAI,GAAA+B,IAAA,CAAJ/B,IAAI;IAAEgC,IAAI,GAAAD,IAAA,CAAJC,IAAI,CAAA;AACvC,EAAA,IAAIhC,I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C,EAAEuH,WAAW,CAAA;OAClD,CAAC,EACD/G,SAAS,CAACkH,mBAAmB,CAAC,iBAC7BxD,IAAA,CAAAU,QAAA,EAAA;AAAAN,QAAAA,QAAA,gBACE7D,GAAA,CAAA,IAAA,EAAA;AAAI2D,UAAAA,SAAS,EAAC,8BAAA;AAA8B,SAAE,CAAC,EAC9C0D,KAAK,CAAC,OAAO,EAAEJ,mBAAmB,CAAC,CAAA;AAAA,OACpC,CACH,CAAA;AAAA,KACD,CACH,eACDjH,GAAA,CAACgF,MAAM,EAAA;AACLrB,MAAAA,SAAS,EAAC,MAAM;AAChBlC,MAAAA,IAAI,EAAEsF,YAAY,GAAGO,EAAE,GAAGC,IAAK;AAC/BrD,MAAAA,KAAK,EAAC,MAAM;MACZ7B,KAAK,EACH0E,YAAY,GACR1F,CAAC,CAAC,4CAA4C,CAAC,GAC/CA,CAAC,CAAC,4CAA4C,CACnD;MACDoD,OAAO,EAAE,SAATA,OAAOA,GAAA;QAAA,OAAQuC,eAAe,CAACQ,GAAG,CAAC,CAAA;AAAA,OAAA;AAAC,KACrC,CAAC,CAAA;AAAA,GACC,CAAC,CAAA;AAEV,CAAC,CAAA;AAqCD,YAAejB,aAAAA,IAAI,CAACC,kBAAkB,CAAC;;;;"}
|
package/dist/ShareViaLink.js
CHANGED
|
@@ -1256,7 +1256,7 @@ var Subtitle = function Subtitle(_ref) {
|
|
|
1256
1256
|
"data-cy": dataCy,
|
|
1257
1257
|
to: link,
|
|
1258
1258
|
onClick: function onClick(event) {
|
|
1259
|
-
event.
|
|
1259
|
+
event.preventDefault();
|
|
1260
1260
|
_onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
1261
1261
|
},
|
|
1262
1262
|
children: /*#__PURE__*/jsx(Typography, {
|