From 376f8de70748e8b4121ebc2cf010fb0147b533d9 Mon Sep 17 00:00:00 2001 From: Graeme Fulton Date: Sat, 24 Aug 2024 08:19:34 +0100 Subject: [PATCH] update editor --- app/typr/PageContent.js | 3 + components/typr-demo/IndexedDBBrowser.js | 23 ++-- package-lock.json | 128 ++--------------------- package.json | 4 +- 4 files changed, 33 insertions(+), 125 deletions(-) diff --git a/app/typr/PageContent.js b/app/typr/PageContent.js index 05456dba..28b08a73 100644 --- a/app/typr/PageContent.js +++ b/app/typr/PageContent.js @@ -492,6 +492,9 @@ function DemoPageContent() { { + setPostId(-1) + }} onDelete={fetchData} router={router} searchParams={searchParams} diff --git a/components/typr-demo/IndexedDBBrowser.js b/components/typr-demo/IndexedDBBrowser.js index 39084bd3..12d09f86 100644 --- a/components/typr-demo/IndexedDBBrowser.js +++ b/components/typr-demo/IndexedDBBrowser.js @@ -4,7 +4,7 @@ import { DB_NAME, STORE_NAME } from "@/lib/typr-demo/indexedDB"; // Import the I import { TrashIcon } from "@radix-ui/react-icons"; // Import the Radix TrashIcon import { PlusIcon } from "@radix-ui/react-icons"; // Import the Radix PlusIcon -const IndexedDBBrowser = ({ data, onDelete, router, searchParams }) => { +const IndexedDBBrowser = ({ data, onDelete, router, searchParams, reset }) => { const deleteRow = async id => { // const db = await openDB(DB_NAME, 1); const db = await openDB(DB_NAME); @@ -15,8 +15,9 @@ const IndexedDBBrowser = ({ data, onDelete, router, searchParams }) => { onDelete(); // Fetch data again after deletion }; - const handleCreateNew = () => { + const handleCreateNew = reset => { router.push("/typr"); + reset(); }; return ( @@ -27,14 +28,22 @@ const IndexedDBBrowser = ({ data, onDelete, router, searchParams }) => { ) : ( <> {data.map(entry => ( - + ))}
- Start New + + Start New +
)} @@ -71,7 +80,9 @@ const Card = ({ entry, onDelete, router, searchParams }) => { return (
@@ -97,4 +108,4 @@ const Card = ({ entry, onDelete, router, searchParams }) => {
); -}; \ No newline at end of file +}; diff --git a/package-lock.json b/package-lock.json index 68eb14dd..5c490210 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,7 +128,7 @@ "swiper": "^8.0.0", "swr": "^1.3.0", "tailwindcss-border-gradient-radius": "^3.0.1", - "tiptypr": "^0.0.90", + "tiptypr": "^0.0.91", "tsparticles": "^2.7.1", "uuidv4": "^6.2.13", "yup": "^0.32.11", @@ -149,7 +149,7 @@ "tailwindcss-scoped-groups": "^2.0.0" }, "optionalDependencies": { - "@prototypr/paper-interview": "^0.0.475", + "@prototypr/paper-interview": "^0.0.476", "@prototypr/prototypr-postie": "^1.0.91" } }, @@ -4113,9 +4113,9 @@ } }, "node_modules/@prototypr/paper-interview": { - "version": "0.0.475", - "resolved": "https://npm.pkg.github.com/download/@prototypr/paper-interview/0.0.475/fe589bde9eae67989b18b568c625fc240eec796b", - "integrity": "sha512-qWtmwt3vyJx+5/1cb1oG4WofaAfnouB4SVUlJcZD2tAabOEeU2yPPVhK3FQgQ13/AhPKs0GB+FjJ/ys6lqO8MA==", + "version": "0.0.476", + "resolved": "https://npm.pkg.github.com/download/@prototypr/paper-interview/0.0.476/36bf7673978e64aa876bd6b37264e1202e869ae7", + "integrity": "sha512-iOjT5e4w1EIEG9ab0vl65TqE7PgZoi0YPPr6BtP8q18zoYE56mh+UkiuKT3eN69HGDQQ5v8somkpU3Kpjg9J4w==", "license": "UNLICENSED", "optional": true, "dependencies": { @@ -4157,7 +4157,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-markdown": "^6.0.0", - "tiptypr": "^0.0.90" + "tiptypr": "^0.0.91" } }, "node_modules/@prototypr/paper-interview/node_modules/@types/hast": { @@ -22192,9 +22192,9 @@ } }, "node_modules/tiptypr": { - "version": "0.0.90", - "resolved": "https://registry.npmjs.org/tiptypr/-/tiptypr-0.0.90.tgz", - "integrity": "sha512-ZVetA/DKcvK6ETRiInPt3DPUTN78hMUq9H7fihfd/yKZgy07XBmIFwixgslpGuwYerZ8QNDpxeNnJq2tP8fEZg==", + "version": "0.0.91", + "resolved": "https://registry.npmjs.org/tiptypr/-/tiptypr-0.0.91.tgz", + "integrity": "sha512-n2k+1j5D7v3qAsYU5H8/z3/rGm8mKgXOHavAmSO2eUVvbesKgdJLJ+jc8Qf52GONOBIO+N36AFxDmcjLvZwmfQ==", "dependencies": { "@geist-ui/icons": "^1.0.2", "@heroicons/react": "^1.0.5", @@ -24270,7 +24270,7 @@ }, "prototypr-packages/paper-interview": { "name": "@prototypr/paper-interview", - "version": "0.0.475", + "version": "0.0.476", "extraneous": true, "license": "UNLICENSED", "dependencies": { @@ -24312,7 +24312,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-markdown": "^6.0.0", - "tiptypr": "^0.0.90" + "tiptypr": "^0.0.91" }, "devDependencies": { "@babel/cli": "^7.24.8", @@ -24372,112 +24372,6 @@ "react": "^18.3.1", "react-dom": "^18.3.1" } - }, - "prototypr-packages/tiptypr": { - "version": "0.0.90", - "extraneous": true, - "license": "none yet", - "dependencies": { - "@geist-ui/icons": "^1.0.2", - "@heroicons/react": "^1.0.5", - "@radix-ui/colors": "^0.1.8", - "@radix-ui/react-checkbox": "^1.0.1", - "@radix-ui/react-collapsible": "^1.0.1", - "@radix-ui/react-dialog": "^1.0.2", - "@radix-ui/react-dropdown-menu": "2.0.1", - "@radix-ui/react-icons": "^1.1.1", - "@radix-ui/react-navigation-menu": "^1.1.4", - "@radix-ui/react-popover": "^1.0.2", - "@radix-ui/react-select": "^2.0.0", - "@radix-ui/react-slider": "^1.1.2", - "@radix-ui/react-switch": "^1.0.1", - "@radix-ui/react-tabs": "^1.1.0", - "@radix-ui/react-toggle": "^1.0.1", - "@radix-ui/react-toggle-group": "^1.0.1", - "@radix-ui/react-tooltip": "^1.0.2", - "@stitches/react": "^1.2.8", - "@tippyjs/react": "^4.2.6", - "@tiptap/extension-blockquote": "^2.4.0", - "@tiptap/extension-bold": "^2.4.0", - "@tiptap/extension-bullet-list": "^2.4.0", - "@tiptap/extension-code": "^2.4.0", - "@tiptap/extension-code-block": "^2.4.0", - "@tiptap/extension-collaboration": "^2.4.0", - "@tiptap/extension-collaboration-cursor": "^2.4.0", - "@tiptap/extension-document": "^2.4.0", - "@tiptap/extension-dropcursor": "^2.4.0", - "@tiptap/extension-gapcursor": "^2.4.0", - "@tiptap/extension-hard-break": "^2.4.0", - "@tiptap/extension-heading": "^2.4.0", - "@tiptap/extension-history": "^2.4.0", - "@tiptap/extension-horizontal-rule": "^2.4.0", - "@tiptap/extension-image": "^2.4.0", - "@tiptap/extension-italic": "^2.4.0", - "@tiptap/extension-link": "^2.4.0", - "@tiptap/extension-list-item": "^2.4.0", - "@tiptap/extension-paragraph": "^2.4.0", - "@tiptap/extension-placeholder": "^2.4.0", - "@tiptap/extension-strike": "^2.4.0", - "@tiptap/extension-text": "^2.4.0", - "@tiptap/extension-underline": "^2.4.0", - "@tiptap/extension-youtube": "^2.4.0", - "@tiptap/html": "^2.4.0", - "@tiptap/pm": "^2.4.0", - "@tiptap/react": "^2.4.0", - "@tiptap/starter-kit": "^2.4.0", - "@tiptap/suggestion": "^2.4.0", - "axios": "^0.19.2", - "classnames": "2.3.1", - "formik": "^2.4.6", - "framer-motion": "^8.4.0", - "js-cookie": "^2.2.1", - "jwt-decode": "^3.1.2", - "lodash": "^4.17.21", - "normalize-url": "^6.1.0", - "react-avatar-editor": "^13.0.2", - "react-datepicker": "^4.8.0", - "react-hot-toast": "^2.2.0", - "react-intl": "^5.24.8", - "react-lazyload": "^3.2.0", - "react-portal": "^4.2.2", - "sanitize-html": "^2.7.3", - "tippy.js": "^6.3.7", - "use-debounce": "^10.0.2", - "yup": "^0.32.11" - }, - "devDependencies": { - "@babel/cli": "^7.24.8", - "@babel/core": "^7.24.9", - "@babel/plugin-transform-runtime": "^7.24.7", - "@babel/preset-env": "^7.x.x", - "@babel/preset-react": "^7.x.x", - "@babel/preset-typescript": "^7.24.7", - "@rollup/plugin-commonjs": "^26.0.1", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "autoprefixer": "^10.4.19", - "babel-plugin-module-resolver": "^5.0.2", - "i": "^0.3.7", - "mini-css-extract-plugin": "^2.9.0", - "npm": "^10.8.2", - "postcss": "^8.4.40", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "rollup": "^2.79.1", - "rollup-plugin-babel": "^4.4.0", - "rollup-plugin-peer-deps-external": "^2.2.4", - "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-terser": "^7.0.2", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "string-hash": "^1.1.3", - "tailwindcss": "^3.4.6", - "webpack-cli": "^5.1.4" - }, - "peerDependencies": { - "react": "^18.3.1", - "react-dom": "^18.3.1" - } } } } diff --git a/package.json b/package.json index c2de4f63..f9552a26 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "swiper": "^8.0.0", "swr": "^1.3.0", "tailwindcss-border-gradient-radius": "^3.0.1", - "tiptypr": "^0.0.90", + "tiptypr": "^0.0.91", "tsparticles": "^2.7.1", "uuidv4": "^6.2.13", "yup": "^0.32.11", @@ -168,7 +168,7 @@ "tailwindcss-scoped-groups": "^2.0.0" }, "optionalDependencies": { - "@prototypr/paper-interview": "^0.0.475", + "@prototypr/paper-interview": "^0.0.476", "@prototypr/prototypr-postie": "^1.0.91" } }