Skip to content

Fix editor.js in descriptions#5925

Merged
kzuraw merged 5 commits intomainfrom
eng-807-editorjs-improv-main
Oct 2, 2025
Merged

Fix editor.js in descriptions#5925
kzuraw merged 5 commits intomainfrom
eng-807-editorjs-improv-main

Conversation

@kzuraw
Copy link
Contributor

@kzuraw kzuraw commented Oct 2, 2025

Scope of the change

Backport of #5911 & #5927

  • I confirm I added ripples for changes (see src/ripples) or my feature doesn't contain any user-facing changes
  • I used analytics "trackEvent" for important events

Copilot AI review requested due to automatic review settings October 2, 2025 05:52
@vercel
Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
saleor-dashboard-storybook Ignored Ignored Preview Oct 2, 2025 0:43am

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2025

⚠️ No Changeset found

Latest commit: bff342a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports EditorJS fixes to handle compatibility between different versions of the @editorjs/list plugin. The changes address format differences where newer versions (v2.0.0+) use object-based list items while legacy versions use string arrays.

  • Convert EditorJS list blocks from new object format to legacy string format for backward compatibility
  • Update EditorJS package versions to specific non-caret versions
  • Fix icon import and styling issues for the rich text editor

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/richText/useRichText.ts Added conversion function call to transform list blocks before returning editor data
src/components/RichTextEditor/utils.ts Added utility function to convert EditorJS list blocks from new to legacy format
src/components/RichTextEditor/utils.test.ts Added comprehensive test coverage for the list block conversion function
src/components/RichTextEditor/RichTextEditor.tsx Applied list block conversion to onChange handler
src/components/RichTextEditor/consts.ts Updated strikethrough icon import to use named export
src/icons/StrikethroughIcon.tsx Updated icon SVG and changed to named export with comment attribution
src/components/RichTextEditor/styles.ts Removed absolute positioning styles and added overflow hidden for popover items
package.json Updated EditorJS packages to specific versions without caret ranges

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kzuraw kzuraw added the skip changeset Use if your changes doesn't need entry in changelog label Oct 2, 2025
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.06%. Comparing base (d450f6a) to head (bff342a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/components/RichTextEditor/utils.ts 76.47% 3 Missing and 1 partial ⚠️
src/components/RichTextEditor/ReactEditorJS.tsx 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5925      +/-   ##
==========================================
+ Coverage   40.04%   40.06%   +0.01%     
==========================================
  Files        2472     2473       +1     
  Lines       40153    40170      +17     
  Branches     8814     9151     +337     
==========================================
+ Hits        16080    16093      +13     
+ Misses      24046    22867    -1179     
- Partials       27     1210    +1183     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

Differences Found

✅ No packages or licenses were added.

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
CC-BY-3.0 1
Packages
  • spdx-exceptions
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
WTFPL 1
Packages
  • utf8-byte-length
<<missing>> 2
Packages
  • busboy
  • streamsearch
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
CC0-1.0 2
Packages
  • spdx-license-ids
  • type-fest
SEE LICENSE IN LICENSE 2
Packages
  • posthog-js
  • spawndamnit
BlueOak-1.0.0 3
Packages
  • jackspeak
  • package-json-from-dist
  • path-scurry
BSD-2-Clause 24
Packages
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • normalize-package-data
  • nth-check
  • regjsparser
  • stringify-object
  • And 4 more...
BSD-3-Clause 42
Packages
  • @saleor/app-sdk
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-arm64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • chroma-js
  • diff
  • esquery
  • exenv
  • hoist-non-react-statics
  • And 22 more...
ISC 50
Packages
  • @isaacs/cliui
  • @istanbuljs/load-nyc-config
  • anymatch
  • boolbase
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • foreground-child
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • hosted-git-info
  • inflight
  • inherits
  • ini
  • And 30 more...
Apache-2.0 57
Packages
  • @ampproject/remapping
  • @editorjs/editorjs
  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/core
  • @eslint/object-schema
  • @eslint/plugin-kit
  • @humanfs/core
  • @humanfs/node
  • @humanwhocodes/module-importer
  • @humanwhocodes/retry
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @pollyjs/adapter
  • @pollyjs/core
  • @pollyjs/persister
  • @pollyjs/utils
  • @swc/core
  • @swc/core-darwin-arm64
  • And 37 more...
MIT 1258
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-globals
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1238 more...

kzuraw and others added 2 commits October 2, 2025 14:41
- Upgraded @saleor/macaw-ui-next from 1.3.2 to 1.3.5
- Moved EditorJS list block conversion to save() method in ReactEditorJS for better architecture
- Removed redundant list conversion calls from RichTextEditor and useRichText
- Implemented dangerouslyLowLevelInstance in ClientEditorCore (EditorCore interface requirement)
- Removed unnecessary @ts-expect-error directive for List class (fixed by upgrade)

This ensures list block conversion happens once at the save level rather than multiple times in consuming components, fixing issues with lists in descriptions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 2, 2025 12:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kzuraw kzuraw marked this pull request as ready for review October 2, 2025 12:45
@kzuraw kzuraw requested a review from a team as a code owner October 2, 2025 12:45
@kzuraw kzuraw merged commit f666a69 into main Oct 2, 2025
25 of 26 checks passed
@kzuraw kzuraw deleted the eng-807-editorjs-improv-main branch October 2, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset Use if your changes doesn't need entry in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants