hensei-web/package.json
Justin Edmund 1806269877
Deploy tiptap updates (#344)
* Rich text editor and support for tagging objects (#340)

* Preliminary work around making an Element type

* Disabled Youtube code for now

* Clean description with DOMPurify

* Update GranblueElement with slug

* Add new api endpoint for searching all resources

* Add new variables and themes

* Remove fixed height on html tag for now

* Update README.md

We renamed the folders for character images from `chara-` to `character-`

* Add no results string

* Add tiptap and associated packages

* Update .gitignore

* Update components that use character images

* Add Editor component

This commit adds the bulk of the code for our new rich-text editor. The Editor component will be used to edit and display rich text via Tiptap.

* Add mention components

This adds the code required for us to mention objects in rich text fields like team descriptions.

The mentionSuggestion util fetches data from the server and serves it to MentionList for the user to select, then inserts it into the Editor as a token.

* Implements Editor in edit team and team footer

This implements the Editor component in EditPartyModal and PartyFooter. In PartyFooter, it is read-only.

* Remove min-width on tokens

* Add rudimentary conversion for old descriptions

Old descriptions just translate as a blob of text, so we try to insert some paragraphs and newlines to keep things presentable and lessen the load if users decide to update

* Add support for displaying jobs in MentionList

* Handle numbers and value=0 better

* Keep description reactive

This shouldn't work? The snapshot should be the reactive one? I don't fucking know

* Send locale to api with search query

* Delete getLocale.tsx

We didn't actually use this

* Fix build errors

* Override peer dependencies for tiptap mentions

They haven't fixed the suggestion plugin, so we have to use a beta version

* Fix background-color on CharacterRep

* Tiptap updates (#343)

* Reinstantiate editor on changes

We can't dynamically update the content, so we have to recreate the Editor whenever something changes (page loads and updates)

* Fix import

@tiptap/core is different than @tiptap/react, who knew

* Added several Tiptap components

* Added a Remix icon that isn't in remixicon-react

* Add colors for highlights

* Add ToolbarButton component

This is to standardize adding Toolbar icons so it wasn't a miserable mess in the Editor file

* Add extensions and implement ToolbarButton

* Remove unused code

* Use party prop and add keys

We always want to use the party in props until the transformer work is done and our source of truth is more reliable.

Also, we are using keys to ensure that the component reloads on new page.

* Component cleanup

* Always use props.party

* Ensure content gets reset when edits are committed

Here, we do some tactical bandaid fixes to ensure that when the user saves data to the server, the editor will show the freshest data in both editable and read-only mode.

In the Editor, its as easy as calling the setContent command in a useEffect hook when the content changes.

In the party, we are saving party in a state and passing it down to the components via props. This is because the party prop we get from pages is only from the first time the server loaded data, so any edits are not reflected. The app state should have the latest updates, but due to reasons I don't completely understand, it is showing the old state first and then the one we want, causing the Editor to get stuck on old data.

By storing the party in a state, we can populate the state from the server when the component mounts, then update it whenever the user saves data since all party data is saved in that component.

* Fix build errors
2023-07-06 02:55:59 -07:00

113 lines
3.5 KiB
JSON

{
"name": "grid-web",
"private": true,
"cacheDirectories": [
".next/cache"
],
"scripts": {
"dev": "next dev -p 1234",
"build": "next build",
"start": "next start",
"lint": "next lint",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@radix-ui/react-alert-dialog": "^1.0.2",
"@radix-ui/react-dialog": "^1.0.2",
"@radix-ui/react-dropdown-menu": "^2.0.1",
"@radix-ui/react-hover-card": "^1.0.2",
"@radix-ui/react-popover": "^1.0.3",
"@radix-ui/react-radio-group": "^1.1.1",
"@radix-ui/react-select": "^1.1.2",
"@radix-ui/react-slider": "^1.1.1",
"@radix-ui/react-switch": "^1.0.1",
"@radix-ui/react-toast": "^1.1.2",
"@radix-ui/react-toggle-group": "^1.0.1",
"@radix-ui/react-tooltip": "^1.0.3",
"@svgr/webpack": "^6.2.0",
"@tiptap/extension-bubble-menu": "^2.0.3",
"@tiptap/extension-highlight": "^2.0.3",
"@tiptap/extension-link": "^2.0.3",
"@tiptap/extension-mention": "^2.0.3",
"@tiptap/extension-typography": "^2.0.3",
"@tiptap/extension-youtube": "^2.0.3",
"@tiptap/pm": "^2.0.3",
"@tiptap/react": "^2.0.3",
"@tiptap/starter-kit": "^2.0.3",
"@tiptap/suggestion": "2.0.0-beta.91",
"axios": "^0.25.0",
"classnames": "^2.3.1",
"cmdk": "^0.2.0",
"cookies-next": "^2.1.1",
"date-fns": "^2.29.3",
"dompurify": "^3.0.4",
"fast-deep-equal": "^3.1.3",
"fix-date": "^1.1.6",
"i18next": "^21.6.13",
"i18next-browser-languagedetector": "^6.1.3",
"i18next-http-backend": "^1.3.2",
"local-storage": "^2.0.0",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"meyer-reset-scss": "^2.0.4",
"next": "12.0.8",
"next-i18next": "^10.5.0",
"next-themes": "^0.2.1",
"next-usequerystate": "^1.7.0",
"pluralize": "^8.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-i18next": "^11.15.5",
"react-infinite-scroll-component": "^6.1.0",
"react-linkify": "^1.0.0-alpha",
"react-lite-youtube-embed": "^2.3.52",
"react-scroll": "^1.8.5",
"react-string-replace": "^1.1.0",
"remixicon-react": "^1.0.0",
"resolve-url-loader": "^5.0.0",
"sanitize-html": "^2.8.1",
"sass": "^1.61.0",
"tippy.js": "^6.3.7",
"usehooks-ts": "^2.9.1",
"uuid": "^9.0.0",
"valtio": "^1.3.0",
"youtube-api-v3-wrapper": "^2.3.0"
},
"devDependencies": {
"@storybook/addon-essentials": "latest",
"@storybook/addon-interactions": "latest",
"@storybook/addon-links": "latest",
"@storybook/addon-mdx-gfm": "latest",
"@storybook/addon-styling": "latest",
"@storybook/blocks": "latest",
"@storybook/nextjs": "latest",
"@storybook/react": "latest",
"@storybook/testing-library": "latest",
"@types/dompurify": "^3.0.2",
"@types/lodash.clonedeep": "^4.5.6",
"@types/lodash.debounce": "^4.0.6",
"@types/node": "17.0.11",
"@types/pluralize": "^0.0.29",
"@types/react": "17.0.38",
"@types/react-dom": "^17.0.11",
"@types/react-infinite-scroller": "^1.2.2",
"@types/react-linkify": "^1.0.1",
"@types/react-scroll": "^1.8.3",
"@types/sanitize-html": "^2.8.0",
"@types/uuid": "^9.0.0",
"eslint": "8.7.0",
"eslint-config-next": "12.0.8",
"eslint-plugin-storybook": "^0.6.11",
"eslint-plugin-valtio": "^0.4.1",
"sass-loader": "^13.2.2",
"storybook": "latest",
"typescript": "^4.5.5"
},
"overrides": {
"@tiptap/extension-mention": {
"@tiptap/suggestion": "2.0.0-beta.91"
}
}
}