Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update list package #3

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Update list package #3

wants to merge 48 commits into from

Conversation

caioreis
Copy link

@caioreis caioreis commented Feb 11, 2021

Summary by CodeRabbit

  • New Features

    • Added defaultStyle configuration option for lists, allowing users to choose between ordered and unordered lists.
  • Documentation

    • Updated README.md to indicate the deprecation of the repository and direct users to a new repository for enhanced functionality.
    • Streamlined installation instructions, emphasizing Yarn installation and CDN loading.
    • Clarified output data structure and updated configuration parameters table for better usability.
  • Chores

    • Removed outdated installation methods to simplify user experience.

eduPHP and others added 10 commits August 24, 2020 05:12
Both ordered and unordered lists were creating an <ul> tag, this PR fixes it
Create the correct element for ordered lists
Used actions `codex-team/action-nodejs-package-info` and `codex-team/action-codexbot-notify` instead
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <[email protected]>
Fix focus to next block

Thanks, @hata6502
@qcx-borr qcx-borr bot added the sync label Feb 11, 2021
dependabot bot and others added 19 commits March 9, 2021 01:05
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.5.2...v6.5.4)

Signed-off-by: dependabot[bot] <[email protected]>
…c-6.5.4

Bump elliptic from 6.5.2 to 6.5.4
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…rse-1.0.7

Bump path-parse from 1.0.6 to 1.0.7
…4.17.21

Bump lodash from 4.17.15 to 4.17.21
…slist-4.16.6

Bump browserslist from 4.12.0 to 4.16.6
Add config for default list style
Copy link

coderabbitai bot commented Jul 24, 2024

Walkthrough

The changes indicate the deprecation of the repository, with a new warning section added to the README.md file. Installation instructions have been simplified, focusing on Yarn and condensing CDN loading details. A new configuration parameter, defaultStyle, has been introduced for the List tool, allowing for either ordered or unordered styles. The output data section has been clarified to reflect these changes, ensuring consistency in the documentation.

Changes

Files Change Summary
README.md Added deprecation warning and new repository link. Streamlined installation instructions for Yarn, condensed CDN loading to one line, added defaultStyle configuration parameter, and clarified output data structure.

Poem

🐰 In the garden of code, changes sprout,
A new home awaits, of that there's no doubt.
With Yarn we shall dance, and styles we’ll define,
Ordered or unordered, all will align!
So hop to the new, where features abound,
In this land of updates, joy can be found! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6d9f7d3 and 2977364.

Files ignored due to path filters (2)
  • dist/bundle.js is excluded by !**/dist/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (9)
  • .github/workflows/npm-publish.yml (1 hunks)
  • .gitignore (1 hunks)
  • .npmignore (1 hunks)
  • README.md (3 hunks)
  • package.json (1 hunks)
  • postcss.config.js (1 hunks)
  • src/index.js (10 hunks)
  • tsconfig.json (1 hunks)
  • vite.config.js (1 hunks)
Files skipped from review due to trivial changes (2)
  • .gitignore
  • tsconfig.json
Additional context used
LanguageTool
README.md

[grammar] ~52-~52: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...--------- | | defaultStyle | string | type of a list: ordered or unordered, default...

(KIND_OF_A)


[grammar] ~64-~64: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...-------------- | | style | string | type of a list: ordered or unordered | | item...

(KIND_OF_A)

Additional comments not posted (26)
.npmignore (1)

4-5: LGTM!

Adding vite.config.js and postcss.config.js to the .npmignore file is appropriate to exclude unnecessary build configuration files from the package distribution.

postcss.config.js (1)

1-6: LGTM!

The PostCSS configuration correctly sets up the postcss-nested-ancestors and postcss-nested plugins.

.github/workflows/npm-publish.yml (1)

9-13: LGTM!

Consolidating the workflow into a single job and using a reusable workflow enhances maintainability and clarity by reducing redundancy.

vite.config.js (3)

1-4: LGTM!

The imports for Vite configuration are appropriate.


6-7: LGTM!

The environment variables are set correctly.


9-24: LGTM!

The Vite configuration is well-structured and includes necessary build settings and plugins.

package.json (6)

3-3: LGTM!

The version update reflects the significant changes made to the package.


13-15: LGTM!

Including the dist directory in the files array ensures that the build artifacts are packaged.


16-18: LGTM!

The updates to the main, module, and types fields ensure correct module resolution for different environments.


19-25: LGTM!

The exports field defines how the package can be imported in different environments, improving module compatibility.


27-28: LGTM!

The build scripts have been updated to use Vite, reflecting a modernization of the build process.


37-43: LGTM!

The updates to dependencies and devDependencies are appropriate for the new build process.

README.md (5)

12-12: LGTM!

The update to use Yarn streamlines the installation process.


20-20: LGTM!

The update to use double quotes standardizes the formatting.


40-42: LGTM!

The addition of defaultStyle enhances the tool's functionality by allowing customization of the list type.


50-52: LGTM!

The config params table provides a clear overview of the configuration parameters.

Tools
LanguageTool

[grammar] ~52-~52: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...--------- | | defaultStyle | string | type of a list: ordered or unordered, default...

(KIND_OF_A)


62-65: LGTM!

The reformatting of the output data section improves the clarity of the information presented.

Tools
LanguageTool

[grammar] ~64-~64: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...-------------- | | style | string | type of a list: ordered or unordered | | item...

(KIND_OF_A)

src/index.js (9)

8-10: Typedef for PasteEvent is correct.

The typedef for PasteEvent from @editorjs/editorjs is correct and improves type safety.


19-21: Typedef for ListConfig is correct.

The typedef for ListConfig is correctly defined and improves type safety and clarity.


27-27: Export statement updated to ES module syntax.

The export statement has been correctly updated to ES module syntax, enhancing compatibility with modern JavaScript tooling.


56-58: Toolbox method updated to use imported icons.

The toolbox method correctly uses the imported IconListBulleted for the icon property.


86-94: Constructor method updated with new settings.

The settings array in the constructor method has been correctly updated to use the imported icons and new labels. The default values are set based on the config.defaultStyle.


207-215: RenderSettings method updated to return an array.

The renderSettings method now returns an array of settings objects, each containing properties for active state and activation behavior. This change improves the separation of concerns by decoupling the settings logic from the UI rendering.


240-253: New method makeMainTag introduced.

The makeMainTag method dynamically generates either an ordered or unordered list based on the current style. This encapsulates the logic for element creation and ensures that the wrapper element is replaced correctly.


261-268: ToggleTune method updated to use makeMainTag.

The toggleTune method has been updated to utilize the new makeMainTag method for creating the main list element. This improves code organization and maintainability.


4-7: Ensure the imported icons are used appropriately.

The import statements for IconListBulleted and IconListNumbered from @codexteam/icons are correct. Ensure these icons are used in the code as intended.

Verification successful

The imported icons are used appropriately in the code.

The import statements for IconListBulleted and IconListNumbered from @codexteam/icons are correctly utilized in the code.

  • IconListBulleted is used on lines where icon: IconListBulleted is present.
  • IconListNumbered is used on lines where icon: IconListNumbered is present.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of imported icons.

# Test: Search for the usage of imported icons. Expect: Usage of IconListBulleted and IconListNumbered in the code.
rg --type js 'IconListBulleted|IconListNumbered'

Length of output: 266

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
README.md (5)

5-7: Consider enhancing the deprecation notice with additional details.

While the warning is clear, it would be helpful to provide:

  • The timeline for deprecation
  • Whether this version will continue receiving critical updates
  • Any breaking changes in the new repository

25-25: Add a code example for CDN usage.

Consider adding a direct script tag example for CDN usage to make it easier for users:

-Optionally, you can load this tool from CDN [JsDelivr CDN](https://cdn.jsdelivr.net/npm/@editorjs/list@latest)
+Optionally, you can load this tool from CDN [JsDelivr CDN](https://cdn.jsdelivr.net/npm/@editorjs/list@latest):
+
+```html
+<script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script>
+```

52-54: Fix grammar in parameter description.

Update the description to improve clarity:

-| defaultStyle | `string` | type of a list: `ordered` or `unordered`, default is `ordered` |
+| defaultStyle | `string` | type of list: `ordered` or `unordered`, default is `ordered` |
🧰 Tools
🪛 LanguageTool

[grammar] ~54-~54: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...--------- | | defaultStyle | string | type of a list: ordered or unordered, default...

(KIND_OF_A)


64-67: Fix grammar in output data description.

Update the description to improve clarity:

-| style | `string`   | type of a list: `ordered` or `unordered` |
+| style | `string`   | type of list: `ordered` or `unordered` |
🧰 Tools
🪛 LanguageTool

[grammar] ~66-~66: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...-------------- | | style | string | type of a list: ordered or unordered | | item...

(KIND_OF_A)


Line range hint 1-1: Add alt text to images for accessibility.

Please add descriptive alt text to all images in the documentation:

-![](https://badgen.net/badge/Editor.js/v2.0/blue)
+![Editor.js v2.0 Badge](https://badgen.net/badge/Editor.js/v2.0/blue)

-![](assets/example.gif)
+![List Tool Usage Example](assets/example.gif)

-![](https://capella.pics/bf5a42e4-1350-499d-a728-493b0fcaeda4.jpg)
+![List Tool Settings Interface](https://capella.pics/bf5a42e4-1350-499d-a728-493b0fcaeda4.jpg)

Also applies to: 11-11, 59-59

🧰 Tools
🪛 Markdownlint

9-9: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2977364 and 3812544.

📒 Files selected for processing (1)
  • README.md (3 hunks)
🧰 Additional context used
🪛 Markdownlint
README.md

9-9: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

🪛 LanguageTool
README.md

[grammar] ~54-~54: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...--------- | | defaultStyle | string | type of a list: ordered or unordered, default...

(KIND_OF_A)


[grammar] ~66-~66: If ‘type’ is a classification term, ‘a’ is not necessary. Use “type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.)
Context: ...-------------- | | style | string | type of a list: ordered or unordered | | item...

(KIND_OF_A)

Comment on lines +42 to +44
config: {
defaultStyle: 'unordered'
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistency in default style documentation.

There's a discrepancy between the usage example showing 'unordered' as the value and the config params table indicating that 'ordered' is the default value. Please ensure consistency across the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants