From 7ef6dbcbbb38b9084ba8230995fb87aa61760ddc Mon Sep 17 00:00:00 2001 From: Akhil Date: Fri, 27 Oct 2023 12:03:05 +0530 Subject: [PATCH 1/6] Update neetocommons/pure imports to neeto-cist --- jsconfig.json | 2 ++ package.json | 1 + resolve.js | 1 + src/components/Attachments/Attachment.jsx | 2 +- src/components/Attachments/Preview.jsx | 2 +- src/components/Attachments/index.jsx | 29 ++++++++----------- .../EmojiSuggestion/EmojiSuggestionMenu.jsx | 2 +- .../SlashCommands/constants.js | 2 +- .../CustomExtensions/Table/TableView.js | 2 +- src/components/Editor/FormikEditor.jsx | 14 ++------- .../Editor/MediaUploader/Progress.jsx | 2 +- src/components/Editor/Menu/Fixed/index.jsx | 2 +- .../Editor/Menu/Headless/Option/UI/Button.jsx | 6 ++-- .../Menu/Headless/Option/UI/Dropdown.jsx | 6 ++-- .../Editor/Menu/Headless/constants.js | 3 +- src/components/Editor/Menu/Headless/utils.js | 2 +- src/components/Editor/Menu/index.jsx | 16 +++++----- src/components/Editor/index.jsx | 2 +- src/components/Editor/utils.js | 2 +- src/components/EditorContent/utils.js | 2 +- src/hooks/useUppyUploader.js | 7 ++--- src/utils/DirectUpload/index.js | 2 +- stories/Walkthroughs/Attachments/constants.js | 2 +- yarn.lock | 5 ++++ 24 files changed, 55 insertions(+), 61 deletions(-) diff --git a/jsconfig.json b/jsconfig.json index 5bc08085..a5947c65 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -38,6 +38,8 @@ "neetofilters": ["node_modules/@bigbinary/neeto-filters-frontend"], "neetomolecules": ["node_modules/@bigbinary/neeto-molecules"], "neetomolecules/*": ["node_modules/@bigbinary/neeto-molecules/*"], + "neetocist": ["../../node_modules/@bigbinary/neeto-cist"], + "neetocist/*": ["../../node_modules/@bigbinary/neeto-cist/*"], // You can add custom project specific paths below this comment "common": ["src/common"], "common/*": ["src/common/*"] diff --git a/package.json b/package.json index 9650fd89..1fbdf4f1 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@bigbinary/babel-preset-neeto": "^1.0.4", "@bigbinary/eslint-plugin-neeto": "^1.0.54", "@bigbinary/neeto-audit-frontend": "2.0.1", + "@bigbinary/neeto-cist": "^1.0.2", "@bigbinary/neeto-commons-frontend": "^2.0.128", "@bigbinary/neeto-icons": "1.11.0", "@bigbinary/neeto-molecules": "^1.0.94", diff --git a/resolve.js b/resolve.js index 0208548c..c7ad9126 100644 --- a/resolve.js +++ b/resolve.js @@ -3,5 +3,6 @@ const path = require("path"); module.exports = { alias: { common: path.resolve(__dirname, "./src/common"), + neetocist: "@bigbinary/neeto-cist", }, }; diff --git a/src/components/Attachments/Attachment.jsx b/src/components/Attachments/Attachment.jsx index aae5595d..c24c32c6 100644 --- a/src/components/Attachments/Attachment.jsx +++ b/src/components/Attachments/Attachment.jsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; -import { removeBy } from "neetocommons/pure"; +import { removeBy } from "neetocist"; import { withEventTargetValue } from "neetocommons/utils"; import { MenuVertical, Close } from "neetoicons"; import { diff --git a/src/components/Attachments/Preview.jsx b/src/components/Attachments/Preview.jsx index 02ea7054..1a4dc672 100644 --- a/src/components/Attachments/Preview.jsx +++ b/src/components/Attachments/Preview.jsx @@ -1,6 +1,6 @@ import React, { useRef } from "react"; -import { findIndexBy } from "neetocommons/pure"; +import { findIndexBy } from "neetocist"; import { Download, Left, Right } from "neetoicons"; import { Modal, Typography, Button } from "neetoui"; import { isEmpty } from "ramda"; diff --git a/src/components/Attachments/index.jsx b/src/components/Attachments/index.jsx index 406e075d..b03a4482 100644 --- a/src/components/Attachments/index.jsx +++ b/src/components/Attachments/index.jsx @@ -2,7 +2,7 @@ import React, { useRef, useEffect, useState, useImperativeHandle } from "react"; import DropTarget from "@uppy/drop-target"; import classnames from "classnames"; -import { removeById, noop } from "neetocommons/pure"; +import { removeById, noop } from "neetocist"; import { Button, Toastr } from "neetoui"; import { concat, isEmpty, isNil } from "ramda"; import { useTranslation } from "react-i18next"; @@ -133,10 +133,7 @@ const Attachments = ( useEffect(() => { uppy.on("upload-progress", handleUploadProgress); if (dragDropRef?.current) { - uppy.use(DropTarget, { - target: dragDropRef.current, - onDrop, - }); + uppy.use(DropTarget, { target: dragDropRef.current, onDrop }); } return () => { @@ -153,21 +150,21 @@ const Attachments = (
{attachments.map(attachment => ( ))} {pendingAttachments.map(attachment => ( ))}
@@ -197,9 +194,7 @@ const Attachments = ( }} /> setSelectedAttachment({})} /> diff --git a/src/components/Editor/CustomExtensions/Emoji/EmojiSuggestion/EmojiSuggestionMenu.jsx b/src/components/Editor/CustomExtensions/Emoji/EmojiSuggestion/EmojiSuggestionMenu.jsx index 23806ede..92645b78 100644 --- a/src/components/Editor/CustomExtensions/Emoji/EmojiSuggestion/EmojiSuggestionMenu.jsx +++ b/src/components/Editor/CustomExtensions/Emoji/EmojiSuggestion/EmojiSuggestionMenu.jsx @@ -2,7 +2,7 @@ import React from "react"; import classnames from "classnames"; import { init, SearchIndex } from "emoji-mart"; -import { isNotEmpty } from "neetocommons/pure"; +import { isNotEmpty } from "neetocist"; import { Spinner } from "neetoui"; import { isEmpty } from "ramda"; diff --git a/src/components/Editor/CustomExtensions/SlashCommands/constants.js b/src/components/Editor/CustomExtensions/SlashCommands/constants.js index f62008be..41341636 100644 --- a/src/components/Editor/CustomExtensions/SlashCommands/constants.js +++ b/src/components/Editor/CustomExtensions/SlashCommands/constants.js @@ -1,4 +1,4 @@ -import { noop } from "neetocommons/pure"; +import { noop } from "neetocist"; import { Paragraph, TextH1, diff --git a/src/components/Editor/CustomExtensions/Table/TableView.js b/src/components/Editor/CustomExtensions/Table/TableView.js index 2ba38124..ab872865 100644 --- a/src/components/Editor/CustomExtensions/Table/TableView.js +++ b/src/components/Editor/CustomExtensions/Table/TableView.js @@ -1,4 +1,4 @@ -import { noop } from "neetocommons/pure"; +import { noop } from "neetocist"; function updateColumns(node, colgroup, table, cellMinWidth) { let totalWidth = 0; diff --git a/src/components/Editor/FormikEditor.jsx b/src/components/Editor/FormikEditor.jsx index 47890bbc..1127fd42 100644 --- a/src/components/Editor/FormikEditor.jsx +++ b/src/components/Editor/FormikEditor.jsx @@ -1,7 +1,7 @@ import React, { forwardRef } from "react"; import { FastField } from "formik"; -import { noop } from "neetocommons/pure"; +import { noop } from "neetocist"; import Editor from "."; @@ -16,20 +16,12 @@ const FormikEditor = ( }, ref ) => ( - + {({ field, form, meta }) => ( form.setFieldTouched(name, true)} onChange={value => { form.setFieldValue(name, value); diff --git a/src/components/Editor/MediaUploader/Progress.jsx b/src/components/Editor/MediaUploader/Progress.jsx index 6dce25e4..71ec2cdf 100644 --- a/src/components/Editor/MediaUploader/Progress.jsx +++ b/src/components/Editor/MediaUploader/Progress.jsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; -import { removeById } from "neetocommons/pure"; +import { removeById } from "neetocist"; import { Close } from "neetoicons"; import { Button, Typography } from "neetoui"; import { useTranslation } from "react-i18next"; diff --git a/src/components/Editor/Menu/Fixed/index.jsx b/src/components/Editor/Menu/Fixed/index.jsx index 992124c0..d0f0d980 100644 --- a/src/components/Editor/Menu/Fixed/index.jsx +++ b/src/components/Editor/Menu/Fixed/index.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react"; import classNames from "classnames"; -import { isNotEmpty } from "neetocommons/pure"; +import { isNotEmpty } from "neetocist"; import { Left, Right } from "neetoicons"; import DynamicVariables from "neetomolecules/DynamicVariables"; import { Button } from "neetoui"; diff --git a/src/components/Editor/Menu/Headless/Option/UI/Button.jsx b/src/components/Editor/Menu/Headless/Option/UI/Button.jsx index 2e68e59f..612557d4 100644 --- a/src/components/Editor/Menu/Headless/Option/UI/Button.jsx +++ b/src/components/Editor/Menu/Headless/Option/UI/Button.jsx @@ -1,7 +1,7 @@ import React from "react"; import classnames from "classnames"; -import { noop } from "neetocommons/pure"; +import { noop } from "neetocist"; import { Tooltip } from "neetoui"; const Button = ({ @@ -22,10 +22,8 @@ const Button = ({ > diff --git a/src/components/Editor/Menu/Headless/Option/UI/Dropdown.jsx b/src/components/Editor/Menu/Headless/Option/UI/Dropdown.jsx index 51f0f98e..bb72c4a6 100644 --- a/src/components/Editor/Menu/Headless/Option/UI/Dropdown.jsx +++ b/src/components/Editor/Menu/Headless/Option/UI/Dropdown.jsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import Tippy from "@tippyjs/react"; import classnames from "classnames"; -import { noop } from "neetocommons/pure"; +import { noop } from "neetocist"; import Button from "./Button"; @@ -63,13 +63,13 @@ const Dropdown = ({ mounted &&
{children}
} onClickOutside={onClose} - onClose={onClose} + {...{ onClose }} onHidden={() => setMounted(false)} onMount={() => setMounted(true)} {...otherProps} > -