Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sjdemartini/mui-tiptap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.11.0
Choose a base ref
...
head repository: sjdemartini/mui-tiptap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 7,543 additions and 6,277 deletions.
  1. +0 −135 .eslintrc.json
  2. +12 −5 .github/ISSUE_TEMPLATE/bug_report.md
  3. +70 −6 .github/workflows/build-test.yml
  4. +6 −11 .github/workflows/release.yml
  5. +1 −1 .nvmrc
  6. +1 −1 CONTRIBUTING.md
  7. +201 −0 eslint.config.mjs
  8. +0 −7 example/.eslintrc.json
  9. +2 −3 example/package.json
  10. +1,922 −1,612 example/pnpm-lock.yaml
  11. +3 −5 example/src/App.tsx
  12. +3 −1 example/src/PageContentWithEditor.tsx
  13. +6 −1 example/src/PageContentWithEditorSimple.tsx
  14. +72 −71 package.json
  15. +4,983 −4,310 pnpm-lock.yaml
  16. +10 −2 src/ControlledBubbleMenu.tsx
  17. +27 −42 src/LinkBubbleMenu/EditLinkMenuContent.tsx
  18. +3 −0 src/LinkBubbleMenu/index.tsx
  19. +3 −1 src/RichTextEditor.tsx
  20. +57 −8 src/controls/ColorPicker.tsx
  21. +7 −4 src/controls/ColorPickerPopper.tsx
  22. +10 −4 src/controls/MenuButtonColorPicker.tsx
  23. +0 −1 src/controls/MenuButtonHighlightColor.tsx
  24. +1 −1 src/controls/MenuButtonStrikethrough.tsx
  25. +0 −1 src/controls/MenuButtonTextColor.tsx
  26. +7 −0 src/controls/MenuSelect.tsx
  27. +3 −0 src/controls/MenuSelectFontSize.tsx
  28. +1 −0 src/controls/MenuSelectHeading.tsx
  29. +1 −0 src/controls/MenuSelectTextAlign.tsx
  30. +45 −6 src/demo/App.tsx
  31. +12 −5 src/demo/Editor.tsx
  32. +7 −19 src/demo/SuggestionList.tsx
  33. +4 −0 src/extensions/HeadingWithAnchor.ts
  34. +2 −1 src/extensions/HeadingWithAnchorComponent.tsx
  35. +5 −0 src/extensions/ResizableImage.ts
  36. +0 −2 src/extensions/ResizableImageComponent.tsx
  37. +3 −1 src/extensions/ResizableImageResizer.tsx
  38. +0 −1 src/extensions/TableImproved.ts
  39. +4 −1 src/hooks/useDebouncedFocus.ts
  40. +5 −7 src/styles.ts
  41. +1 −1 src/utils/color.ts
  42. +1 −0 src/utils/index.ts
  43. +41 −0 src/utils/links.ts
  44. +1 −0 src/utils/platform.ts
135 changes: 0 additions & 135 deletions .eslintrc.json

This file was deleted.

17 changes: 12 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,15 @@ A clear and concise description of what the bug is.

Before filing a bug, please confirm that you have:

1. Installed the necessary Tiptap extensions for whatever functionality you are trying to use (e.g. `Color` extension for using the `MenuButtonTextColor`).
2. Passed the extensions you need to the `extensions` field of `RichTextEditor`/`useEditor`
1. Set up your extensions correctly.

See [README info here](https://github.com/sjdemartini/mui-tiptap#choosing-your-editor-extensions) for more details.
a. Installed the necessary Tiptap extensions for whatever functionality you are trying to use (e.g. `Color` extension for using the `MenuButtonTextColor`).

b. Passed the extensions you need to the `extensions` field of `RichTextEditor`/`useEditor`

See [README info here](https://github.com/sjdemartini/mui-tiptap#choosing-your-editor-extensions) for more details.

2. Confirmed there isn't CSS external to mui-tiptap that is causing a problem with appearance/layout.

### To Reproduce

@@ -37,8 +42,10 @@ If applicable, add screenshots to help explain your problem.

### System (please complete the following information)

- mui-tiptap version: [e.g. 1.1.0]
- tiptap version: [e.g. 2.0.0]
- `mui-tiptap` version: [e.g. 1.1.0]
- `tiptap` version: [e.g. 2.0.0]
- `@mui/material`: [e.g. 6.0.0]
- `@mui/icons-material` version: [e.g. 6.0.0]
- Browser: [e.g. Chrome, Firefox]
- Node version: [e.g 16.4.2]
- OS: [e.g. Ubuntu 22.04, macOS 11.4]
76 changes: 70 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -13,28 +13,85 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
node-version: [20]
# Test across different versions of Tiptap to ensure compatibility: the
# version used in our lockfile, an older version we support, and the
# latest v2 version.
tiptap-version: [null, 2.0.4, "^2.10.0"]
include:
- tiptap-version: 2.0.4
# Specify the version of y-prosemirror to use to ensure proper peer
# dependency compatibility and resolution.
y-prosemirror-version: 1.0.20

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
version: 8
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- run: pnpm install

- name: Dependencies audit
run: pnpm audit --audit-level=high

- if: ${{ matrix.tiptap-version != null }}
name: Override tiptap version to ${{ matrix.tiptap-version }}
# So that we can update all tiptap packages at once, we use
# `pnpm update`, which allows wildcard syntax and version specifier
# (unlike `pnpm install`). We have to separately install the indirect
# dependencies of @tiptap/react with the desired version (the floating
# and bubble menu packages), since `update` doesn't apply to them.
run: |
pnpm update -D "@tiptap/*@${{ matrix.tiptap-version }}"
pnpm add -D "@tiptap/extension-floating-menu@${{ matrix.tiptap-version }}" "@tiptap/extension-bubble-menu@${{ matrix.tiptap-version }}"
pnpm dedupe
- if: ${{ matrix.y-prosemirror-version }}
name: Override y-prosemirror version to ${{ matrix.y-prosemirror-version }}
run: pnpm add -D "y-prosemirror@${{ matrix.y-prosemirror-version }}"

- name: Check for duplicate dependencies
run: pnpm dedupe --check

- if: ${{ matrix.tiptap-version == '2.0.4' }}
name: Resolve known inconsequential TS differences in Tiptap 2.0.4
# 1) Delete the `@ts-expect-error` comments where needed, as older
# versions of Tiptap didn't have the same types that required this
# override.
# 2) Add `@ts-expect-error` to TableImproved.ts where the typing in
# older versions was incorrect (as Tiptap itself did here
# https://github.com/ueberdosis/tiptap/blob/b0198eb14b98db5ca691bd9bfe698ffaddbc4ded/packages/extension-table/src/table.ts#L253,
# and we did prior to updating to newer Tiptap).
# 3) Restore an older version of the demo SuggestionList, since it
# relied on local typing overrides awaiting fixes published in Tiptap
# 2.5.0. This ensures `type:check` passes, though isn't part of the
# build anyway.
run: |
sed -i '/@ts-expect-error/d' src/extensions/HeadingWithAnchor.ts src/extensions/ResizableImage.ts
sed -i '/View: this.options.View/i\
// @ts-expect-error incorrect type\
' src/extensions/TableImproved.ts
git fetch origin tag v1.16.0 --no-tags
git restore --source v1.16.0 src/demo/SuggestionList.tsx
- name: Build
run: pnpm run build

- name: Install dependencies in example project
# In order to lint both our main project and the example sub-project, we
# need to install the dependencies for the example project too.
run: pnpm run example:install

- name: Type check
# Though this largely happens as part of `pnpm run build`, there are
# some files that are not part of the publishable build but which we'd
@@ -68,4 +125,11 @@ jobs:
run: pnpm run test:coverage

- name: Validate the build's packaging CJS and ESM compatibility
run: npx @arethetypeswrong/cli@0.15.4 --pack
# For now, we ignore the named-exports rule, as this gets triggered for
# the `node16 (from ESM)` context, and appears hard to resolve while
# still avoiding these issues:
# - https://github.com/sjdemartini/mui-tiptap/issues/256
# - https://github.com/sjdemartini/mui-tiptap/issues/264
# Ideally we can fix this in the future without breaking Node and NextJS
# contexts.
run: npx @arethetypeswrong/cli@0.16.2 --pack --ignore-rules named-exports
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -14,28 +14,23 @@ jobs:
permissions:
contents: read
id-token: write # Needed for https://docs.npmjs.com/generating-provenance-statements
strategy:
matrix:
node-version: [18]

needs: [build-test] # Require standard CI steps to pass before publishing

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

# Set up .npmrc file to publish to npm. This also allows NODE_AUTH_TOKEN
# to work below.
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- run: pnpm install

- run: pnpm run build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v22
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -41,6 +41,6 @@ When a new version should be cut since some new changes have landed on the `main
1. Go to the `main` branch and pull in the latest changes.
2. Run `npm version <major | minor | patch | premajor | preminor | prepatch | prerelease>`, depending on what's appropriate per semver conventions for the latest changes.
- This will create a commit that updates the `version` in `package.json`, and add a git tag for that new commit.
3. Push the commit and tags (ex: `git push origin main` and `git push --tags`)
3. Push the commit and tag (ex: `git push origin main` and `git push origin refs/tags/v0.0.0`, where `v0.0.0` is the new version number/tag).
4. The `release.yml` GitHub Actions workflow will run and should publish to npm upon completion.
5. Once the new version has been successfully published to npm, create a "Release" in GitHub for to the newly pushed tag, per the steps [here](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release), which can auto-generate release notes that can be edited and cleaned up for clarity and succinctness.
Loading