Skip to content

Commit

Permalink
Better handling of trix-toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
thestephenmarshall committed Jul 24, 2024
1 parent c570ad9 commit bfde02e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import React, { useEffect, useState } from 'react'
import classnames from 'classnames'
import Trix from "trix"
import { TrixEditor } from "react-trix"

import inlineFocus from './inlineFocus'
import useFocus from './useFocus'
import { globalProps, GlobalProps } from '../utilities/globalProps'
import { buildAriaProps, buildDataProps, noop, buildHtmlProps } from '../utilities/props'

Trix.config.textAttributes.inlineCode = {
tagName: 'code',
inheritable: true,
try {
import('trix').then((Trix) => {
Trix.config.textAttributes.inlineCode = {
tagName: 'code',
inheritable: true,
}
})
import('@haxtheweb/deduping-fix')
} catch (e) {
// do nothing
}

import EditorToolbar from './TipTap/Toolbar'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@haxtheweb/deduping-fix';
1 change: 1 addition & 0 deletions playbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@babel/preset-react": "^7.12.5",
"@babel/preset-typescript": "^7.15.0",
"@codesandbox/sandpack-react": "^2.12.1",
"@haxtheweb/deduping-fix": "^9.0.1",
"@rollup/plugin-typescript": "^11.1.6",
"@rollup/pluginutils": "^5.1.0",
"@testing-library/jest-dom": "5.16.4",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,11 @@
resolved "https://npm.powerapp.cloud/@gilbarbara/deep-equal/-/deep-equal-0.1.2.tgz#1a106721368dba5e7e9fb7e9a3a6f9efbd8df36d"
integrity sha512-jk+qzItoEb0D0xSSmrKDDzf9sheQj/BAPxlgNxgmOaA3mxpUa6ndJLYGZKsJnIVEQSD8zcTbyILz7I0HcnBCRA==

"@haxtheweb/deduping-fix@^9.0.1":
version "9.0.1"
resolved "https://npm.powerapp.cloud/@haxtheweb/deduping-fix/-/deduping-fix-9.0.1.tgz#1e03e2ba0dd066bc414ee38002c58b8c8f6d5532"
integrity sha512-X0z4rTTrKQ+DoDPe5VfWkzIVrb0DQTOEaXaOxQ5WNRi90PkF8yXwl09jm81qUQHNcyVChc1MXZkc9qPuYgAm1g==

"@hotwired/turbo-rails@^7.3.0":
version "7.3.0"
resolved "https://npm.powerapp.cloud/@hotwired/turbo-rails/-/turbo-rails-7.3.0.tgz#422c21752509f3edcd6c7b2725bbe9e157815f51"
Expand Down

0 comments on commit bfde02e

Please sign in to comment.