Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: upgrade framer-motion, remove animation from editor

thecodrrae189a95b7b5
diff --git a/apps/web/package.json b/apps/web/package.json
index f2e8e8e16..214f33d67 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -10,7 +10,7 @@
"emotion-theming": "^10.0.19",
"eventsource": "^1.0.7",
"fast-sort": "^2.1.1",
- "framer-motion": "^1.10.3",
+ "framer-motion": "^2.6.15",
"hookrouter": "^1.2.3",
"immer": "^6.0.3",
"localforage": "^1.7.3",
@@ -72,4 +72,4 @@
"last 4 edge version"
]
}
-}
+}
\ No newline at end of file
diff --git a/apps/web/src/components/animated/index.js b/apps/web/src/components/animated/index.js
index c24762339..60e2ce30a 100644
--- a/apps/web/src/components/animated/index.js
+++ b/apps/web/src/components/animated/index.js
@@ -5,5 +5,5 @@ export default {
Flex: motion.custom(Rebass.Flex),
Box: motion.custom(Rebass.Box),
Image: motion.custom(Rebass.Image),
- Text: motion.custom(Rebass.Text)
+ Text: motion.custom(Rebass.Text),
};
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index eea628aa6..40a4e2ef7 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -16,7 +16,6 @@ import Header from "./header";
import { useHashParam } from "../../utils/useHashParam";
import SplitEditor from "../spliteditor";
import Unlock from "../unlock";
-import { useAnimation } from "framer-motion";
function Editor() {
console.log("rendering editor");
@@ -27,7 +26,6 @@ function Editor() {
const updateWordCount = useStore((store) => store.updateWordCount);
const init = useStore((store) => store.init);
const isFocusMode = useAppStore((store) => store.isFocusMode);
- const animation = useAnimation();
const isTrial = useUserStore(
(store) => store.user.notesnook?.subscription?.isTrial
);
@@ -50,30 +48,6 @@ function Editor() {
init();
}, [init]);
- useEffect(() => {
- if (sessionState === SESSION_STATES.new) {
- animation
- .start({
- opacity: 0,
- transition: { duration: 0.1 },
- })
- .then(() =>
- animation
- .start({
- x: -100,
- transition: { duration: 0 },
- })
- .then(() =>
- animation.start({
- opacity: 1,
- x: 0,
- transition: { duration: 0.1 },
- })
- )
- );
- }
- }, [sessionState, animation]);
-
useEffect(() => {
if (!quillRef || !quillRef.current) return;
@@ -113,35 +87,33 @@ function Editor() {
<Header />
<Flex id="toolbar" />
<EditorMenu quill={quillRef.current && quillRef.current.quill} />
- <Animated.Flex initial={{ opacity: 0 }} animate={animation}>
- <ReactQuill
- id="quill"
- ref={quillRef}
- refresh={sessionState === SESSION_STATES.new}
- isSimple={isLoggedin || !isTrial}
- onFocus={() => {
- toggleProperties(false);
- }}
- placeholder="Type anything here"
- container=".editor"
- onSave={() => {
- saveSession();
- }}
- changeInterval={500}
- onWordCountChanged={updateWordCount}
- onChange={() => {
- const { quill } = quillRef.current;
- const delta = quill.getContents().ops;
- const text = quill.getText();
- setSession((state) => {
- state.session.content = {
- delta: { ops: delta },
- text: text,
- };
- });
- }}
- />
- </Animated.Flex>
+ <ReactQuill
+ id="quill"
+ ref={quillRef}
+ refresh={sessionState === SESSION_STATES.new}
+ isSimple={isLoggedin || !isTrial}
+ onFocus={() => {
+ toggleProperties(false);
+ }}
+ placeholder="Type anything here"
+ container=".editor"
+ onSave={() => {
+ saveSession();
+ }}
+ changeInterval={500}
+ onWordCountChanged={updateWordCount}
+ onChange={() => {
+ const { quill } = quillRef.current;
+ const delta = quill.getContents().ops;
+ const text = quill.getText();
+ setSession((state) => {
+ state.session.content = {
+ delta: { ops: delta },
+ text: text,
+ };
+ });
+ }}
+ />
</Flex>
<Properties />
</Animated.Flex>
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index c6b499e9b..7f94d6405 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -1476,22 +1476,6 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
-"@popmotion/easing@^1.0.1", "@popmotion/easing@^1.0.2":
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/@popmotion/easing/-/easing-1.0.2.tgz#17d925c45b4bf44189e5a38038d149df42d8c0b4"
- integrity sha512-IkdW0TNmRnWTeWI7aGQIVDbKXPWHVEYdGgd5ZR4SH/Ty/61p63jCjrPxX1XrR7IGkl08bjhJROStD7j+RKgoIw==
-
-"@popmotion/popcorn@^0.4.2", "@popmotion/popcorn@^0.4.4":
- version "0.4.4"
- resolved "https://registry.yarnpkg.com/@popmotion/popcorn/-/popcorn-0.4.4.tgz#a5f906fccdff84526e3fcb892712d7d8a98d6adc"
- integrity sha512-jYO/8319fKoNLMlY4ZJPiPu8Ea8occYwRZhxpaNn/kZsK4QG2E7XFlXZMJBsTWDw7I1i0uaqyC4zn1nwEezLzg==
- dependencies:
- "@popmotion/easing" "^1.0.1"
- framesync "^4.0.1"
- hey-listen "^1.0.8"
- style-value-types "^3.1.7"
- tslib "^1.10.0"
-
"@rebass/forms@^4.0.6":
version "4.0.6"
resolved "https://registry.yarnpkg.com/@rebass/forms/-/forms-4.0.6.tgz#19a3af64f855baa65dec65aecadda5cd95a09dd7"
@@ -5123,23 +5107,20 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"
-framer-motion@^1.10.3:
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-1.11.1.tgz#b031d1556a78854e0989b8c7e96418c6e15aa474"
- integrity sha512-CP6aYLPSivAWkq9UoSurefHBggxG85IT8ObYyWYkcZppgtjHzpwRzhaA8P0ljMGRqtcpeQAIybiGgPioBPlOSw==
+framer-motion@^2.6.15:
+ version "2.6.15"
+ resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-2.6.15.tgz#08e8aae96f199ed1a40a8414458b455101301d6d"
+ integrity sha512-S9q1adpF0ZEoKQfI3SC3V4EAWnxa8JmHh+8H7fNgBWmiGOR9+BtglEhDcRx8/ylnb+H+uqM50RryonsnGV6U1A==
dependencies:
- "@popmotion/easing" "^1.0.2"
- "@popmotion/popcorn" "^0.4.2"
- framesync "^4.0.4"
+ framesync "^4.1.0"
hey-listen "^1.0.8"
- popmotion "9.0.0-beta-8"
- style-value-types "^3.1.6"
- stylefire "^7.0.2"
+ popmotion "9.0.0-rc.14"
+ style-value-types "^3.1.9"
tslib "^1.10.0"
optionalDependencies:
"@emotion/is-prop-valid" "^0.8.2"
-framesync@^4.0.0, framesync@^4.0.1, framesync@^4.0.4:
+framesync@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/framesync/-/framesync-4.1.0.tgz#69a8db3ca432dc70d6a76ba882684a1497ef068a"
integrity sha512-MmgZ4wCoeVxNbx2xp5hN/zPDCbLSKiDt4BbbslK7j/pM2lg5S0vhTNv1v8BCVb99JPIo6hXBFdwzU7Q4qcAaoQ==
@@ -8250,16 +8231,14 @@ [email protected]:
dependencies:
ts-pnp "^1.1.6"
- version "9.0.0-beta-8"
- resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.0.0-beta-8.tgz#f5a709f11737734e84f2a6b73f9bcf25ee30c388"
- integrity sha512-6eQzqursPvnP7ePvdfPeY4wFHmS3OLzNP8rJRvmfFfEIfpFqrQgLsM50Gd9AOvGKJtYJOFknNG+dsnzCpgIdAA==
+ version "9.0.0-rc.14"
+ resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-9.0.0-rc.14.tgz#e57351b7b85a3e42b7a16affbbd440138797c11f"
+ integrity sha512-zdMw1OSKjFBH+KKpZx7P+cGSUb3QCqg5QD12f6llucUeEFT+SDZYxvTY09JI23ZcJyzxgKFT1anbLq0eZ9bj3g==
dependencies:
- "@popmotion/easing" "^1.0.1"
- "@popmotion/popcorn" "^0.4.2"
- framesync "^4.0.4"
+ framesync "^4.1.0"
hey-listen "^1.0.8"
- style-value-types "^3.1.6"
+ style-value-types "^3.1.9"
tslib "^1.10.0"
portfinder@^1.0.25:
@@ -10554,7 +10533,7 @@ [email protected]:
loader-utils "^1.1.0"
schema-utils "^1.0.0"
-style-value-types@^3.1.6, style-value-types@^3.1.7:
+style-value-types@^3.1.9:
version "3.1.9"
resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-3.1.9.tgz#faf7da660d3f284ed695cff61ea197d85b9122cc"
integrity sha512-050uqgB7WdvtgacoQKm+4EgKzJExVq0sieKBQQtJiU3Muh6MYcCp4T3M8+dfl6VOF2LR0NNwXBP1QYEed8DfIw==
@@ -10581,17 +10560,6 @@ styled-system@^5.0.0, styled-system@^5.1.5:
"@styled-system/variant" "^5.1.5"
object-assign "^4.1.1"
-stylefire@^7.0.2:
- version "7.0.3"
- resolved "https://registry.yarnpkg.com/stylefire/-/stylefire-7.0.3.tgz#9120ecbb084111788e0ddaa04074799750f20d1d"
- integrity sha512-Q0l7NSeFz/OkX+o6/7Zg3VZxSAZeQzQpYomWmIpOehFM/rJNMSLVX5fgg6Q48ut2ETNKwdhm97mPNU643EBCoQ==
- dependencies:
- "@popmotion/popcorn" "^0.4.4"
- framesync "^4.0.0"
- hey-listen "^1.0.8"
- style-value-types "^3.1.7"
- tslib "^1.10.0"
-
stylehacks@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5"