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

refactor: Build split code #55

Merged
merged 8 commits into from
Sep 12, 2024
Merged

refactor: Build split code #55

merged 8 commits into from
Sep 12, 2024

Conversation

zzxming
Copy link
Collaborator

@zzxming zzxming commented Sep 10, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

  • split build file. easy to debug and treeshake
  • remove some dependencies to minus chunk size
  • css file will not auto import

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

quill 作为 peerDependencies,用户需要自行安装,用于解决用户需要导出 quill 中并没有在主文件导出的方法。这应该能解决 issue #46 ,用户可以自行从 quill 中导出需要使用的方法

将依赖的 highlight.jshtml2canvas 作为 devDependencies,这两项依赖仅在单独的模块中使用,当用户不使用对应模块时,这是多余的,当用户需要使用时自行安装,并作为模块的 options 传入

从入口文件的导入中移除 css 文件的导入,css 文件应该与 js 文件分离

Summary by CodeRabbit

  • New Features

    • Enhanced styling for the Fluent Editor component across various demo files and documentation by importing the necessary SCSS stylesheet.
    • Introduced syntax highlighting capabilities for code blocks, improving the editor's functionality.
  • Bug Fixes

    • Ensured that the Fluent Editor component is styled correctly to enhance user experience.
  • Documentation

    • Updated documentation to reflect the new styling requirements and configurations for the Fluent Editor.
  • Chores

    • Improved the build process and configuration for better modularity and maintainability.

Copy link

coderabbitai bot commented Sep 10, 2024

Walkthrough

This pull request introduces several changes across multiple files, primarily focusing on the addition of an SCSS stylesheet import for the FluentEditor component. The updates ensure that the editor is styled correctly in various Vue components and documentation files. Additionally, modifications to configuration files enhance the build process, dependency management, and module resolution, transitioning from CSS to SCSS for styling. New dependencies are added to support enhanced functionality, and the overall structure of the project is refined for better maintainability.

Changes

Files Change Summary
README.md, README.zh-CN.md Added import statement for @opentiny/fluent-editor/style.scss to include styles for the FluentEditor component.
packages/docs/fluent-editor/demos/*.vue Added import statement for @opentiny/fluent-editor/style.scss in various demo files to ensure proper styling of the FluentEditor component.
packages/docs/fluent-editor/docs/quick-start.md Added two instances of import statement for @opentiny/fluent-editor/style.css to ensure correct styling in quick start documentation.
packages/fluent-editor/package.json Updated styling entry to use style.scss instead of style.css, added quill as a peer dependency, and modified build scripts.
packages/fluent-editor/scripts/pre-release.js Updated paths for module entries and changed mapping for style.scss to style.css.
packages/fluent-editor/src/assets/style.scss Introduced foundational styles and imports for the FluentEditor component, including custom font face and various SCSS modules.
packages/fluent-editor/src/config/types/editor-modules.interface.ts Enhanced syntax property in IEditorModules interface to accept more complex configurations for syntax highlighting.
packages/fluent-editor/vite.config.theme.ts Added configuration for Vite to build theme assets from SCSS files, specifying input and output settings.

Possibly related PRs

  • fix: format-painter with not format warning #48: The changes in this PR involve modifications to the format-painter functionality, which may relate to the overall styling and presentation of the FluentEditor component, similar to the addition of the SCSS import in the main PR.

🐰 "In the meadow where bunnies play,
New styles hop in, brightening the day.
With SCSS in tow, the editor's dressed,
A joyful sight, we’re truly blessed!
Hops and skips, let’s celebrate,
For every change, we elevate!" 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ab6a252 and 7eb3c52.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (27)
  • README.md (1 hunks)
  • README.zh-CN.md (1 hunks)
  • packages/docs/fluent-editor/demos/basic-usage.vue (1 hunks)
  • packages/docs/fluent-editor/demos/code-block-highlight.vue (1 hunks)
  • packages/docs/fluent-editor/demos/custom-toolbar.vue (1 hunks)
  • packages/docs/fluent-editor/demos/emoji.vue (1 hunks)
  • packages/docs/fluent-editor/demos/file-upload.vue (1 hunks)
  • packages/docs/fluent-editor/demos/format-painter.vue (1 hunks)
  • packages/docs/fluent-editor/demos/formula.vue (1 hunks)
  • packages/docs/fluent-editor/demos/image-upload-to-server.vue (1 hunks)
  • packages/docs/fluent-editor/demos/image-upload.vue (1 hunks)
  • packages/docs/fluent-editor/demos/markdown.vue (1 hunks)
  • packages/docs/fluent-editor/demos/mention-custom-list.vue (1 hunks)
  • packages/docs/fluent-editor/demos/mention.vue (1 hunks)
  • packages/docs/fluent-editor/demos/table.vue (1 hunks)
  • packages/docs/fluent-editor/docs/quick-start.md (2 hunks)
  • packages/docs/fluent-editor/vite.config.ts (1 hunks)
  • packages/docs/package.json (1 hunks)
  • packages/fluent-editor/package.json (1 hunks)
  • packages/fluent-editor/scripts/pre-release.js (1 hunks)
  • packages/fluent-editor/src/assets/index.scss (1 hunks)
  • packages/fluent-editor/src/index.ts (1 hunks)
  • packages/fluent-editor/src/screenshot/index.ts (3 hunks)
  • packages/fluent-editor/src/syntax/index.ts (1 hunks)
  • packages/fluent-editor/src/toolbar/index.ts (1 hunks)
  • packages/fluent-editor/vite.config.theme.ts (1 hunks)
  • packages/fluent-editor/vite.config.ts (1 hunks)
Files skipped from review due to trivial changes (17)
  • README.md
  • packages/docs/fluent-editor/demos/basic-usage.vue
  • packages/docs/fluent-editor/demos/code-block-highlight.vue
  • packages/docs/fluent-editor/demos/custom-toolbar.vue
  • packages/docs/fluent-editor/demos/emoji.vue
  • packages/docs/fluent-editor/demos/file-upload.vue
  • packages/docs/fluent-editor/demos/format-painter.vue
  • packages/docs/fluent-editor/demos/formula.vue
  • packages/docs/fluent-editor/demos/image-upload-to-server.vue
  • packages/docs/fluent-editor/demos/image-upload.vue
  • packages/docs/fluent-editor/demos/markdown.vue
  • packages/docs/fluent-editor/demos/mention-custom-list.vue
  • packages/docs/fluent-editor/demos/mention.vue
  • packages/docs/fluent-editor/demos/table.vue
  • packages/fluent-editor/src/assets/index.scss
  • packages/fluent-editor/src/index.ts
  • packages/fluent-editor/vite.config.theme.ts
Additional context used
Biome
packages/fluent-editor/src/syntax/index.ts

[error] 6-9: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)

Additional comments not posted (28)
packages/docs/fluent-editor/vite.config.ts (1)

3-19: LGTM!

The changes introduce a new configuration for module resolution using path aliases, which enhances the modularity and maintainability of the code by simplifying the import paths for developers. The path module is correctly used to resolve paths relative to the fluent-editor directory, and the alias mappings are properly defined under the resolve property.

packages/docs/package.json (1)

23-23: LGTM!

The changes introduce new dependencies: quill, highlight.js, and html2canvas, which are correctly added to the dependencies section of package.json. These additions suggest an enhancement in the project's capabilities, likely aimed at improving text editing, syntax highlighting, and rendering of HTML elements on the canvas.

Also applies to: 27-28

packages/fluent-editor/src/syntax/index.ts (1)

2-2: LGTM!

The changes modify the way the Syntax module is imported and utilized within the CustomSyntax class. The import statement for the highlight.js library has been removed, and instead, the TypeSyntax module from quill/modules/syntax is imported. This change alters the method of accessing the Syntax class, switching from Quill.imports['modules/syntax'] to Quill.import('modules/syntax') as typeof TypeSyntax, which may enhance type safety and clarity in the code.

Additionally, the DEFAULTS property of the CustomSyntax class has been updated to assign a function that retrieves window.hljs to the hljs property. This change suggests a shift towards a more dynamic approach for accessing the hljs library, potentially allowing for better integration with the global scope and improving compatibility with different environments.

Overall, these changes reflect a refinement in the module's structure and initialization, enhancing the clarity and functionality of the CustomSyntax class.

Also applies to: 4-4, 12-15

packages/docs/fluent-editor/docs/quick-start.md (2)

27-27: LGTM!

The import of the SCSS file is necessary to ensure the editor is styled correctly.


62-62: LGTM!

The import of the SCSS file is necessary to ensure the editor is styled correctly.

packages/fluent-editor/scripts/pre-release.js (5)

31-31: LGTM!

The change to the main entry is valid and is likely aimed at improving the project's build or distribution structure.


32-32: LGTM!

The change to the module entry is valid and is likely aimed at improving the project's build or distribution structure.


33-33: LGTM!

The change to the import entry is valid and is likely aimed at improving the project's build or distribution structure.


34-34: LGTM!

The change to the require entry is valid and is likely aimed at improving the project's build or distribution structure.


35-35: LGTM!

The change to the mapping of ./index.scss to ./theme/index.css is valid and is likely aimed at improving the organization of styles in the project.

packages/fluent-editor/package.json (5)

32-32: LGTM!

The addition of the new entry for "./index.scss" pointing to "./src/assets/index.scss" is valid and is likely aimed at improving the organization and maintainability of styles in the project.


37-37: LGTM!

The modification of the build script to include the new command pnpm build:theme is valid and is likely aimed at improving the modularity and maintainability of the build process.


38-38: LGTM!

The addition of the new build:theme script that utilizes a specific Vite configuration file vite.config.theme.ts is valid and is likely aimed at improving the modularity and maintainability of the build process.


42-44: LGTM!

The introduction of the new peerDependencies section specifying "quill": "^2.0.0" is valid and is likely aimed at improving the dependency management of the project.


59-59: LGTM, but verify the Vite upgrade.

The upgrade of the vite version from ^2.3.0 to ^5.0.0 is valid and is likely aimed at improving the build process of the project.

However, ensure that this upgrade is thoroughly tested to confirm that it does not introduce any breaking changes or compatibility issues.

Run the following script to verify the Vite upgrade:

packages/fluent-editor/vite.config.ts (5)

6-10: LGTM!

The new Manifest interface provides a structured way to manage package manifests, including versioning and optional dependency records. This change improves the maintainability and readability of the code.


11-13: LGTM!

The new getPackageManifest function reads and parses a package's manifest file, returning an object that conforms to the Manifest interface. This change streamlines the handling of dependencies and improves the modularity of the code.


14-23: LGTM!

The new rollupExternalFromPackage function dynamically determines external dependencies based on the manifest. It constructs a set of dependency keys and checks if a given module ID matches any of these keys or starts with them. This change enhances the control over which packages are treated as external during bundling and improves the flexibility of the module resolution during the build process.


25-32: LGTM!

The new rollupOutput function provides a more comprehensive setup for Rollup output options, supporting both ES and CommonJS formats, with specific settings for file naming and directory structure. This change improves the modularity and maintainability of the build process.


34-37: LGTM!

The input files are now dynamically gathered using glob, allowing for a more scalable approach to include all TypeScript files in the source directory. This change improves the flexibility and maintainability of the build configuration.

README.zh-CN.md (1)

45-45: LGTM!

The addition of the stylesheet import is crucial for the visual presentation of the editor, as it applies the necessary styles defined in the SCSS file. This change enhances the functionality by ensuring that the editor is styled according to the specified theme.

packages/fluent-editor/src/screenshot/index.ts (6)

4-5: LGTM!

The import of Delta from quill is necessary for the functionality of the Screenshot class. This change is a minor refactoring that improves the readability and maintainability of the code.


6-9: LGTM!

The ScreenShotOptions interface allows for the possibility of passing a custom implementation of Html2Canvas, thereby increasing the module's adaptability. This change improves the robustness and configurability of the Screenshot module, making it more versatile for different use cases.


12-18: LGTM!

The update to the DEFAULTS static property ensures that the Html2Canvas library is available when the module is used. This change improves the robustness of the Screenshot module by providing a fallback mechanism for initializing Html2Canvas.


32-37: LGTM!

The modification to the constructor enhances type safety and clarity by accepting a Partial<ScreenShotOptions> type for the options parameter. The error handling enforces the requirement for the Html2Canvas library, thereby improving the robustness of the Screenshot module.


135-135: LGTM!

The update to the usage of Html2Canvas ensures that the method utilizes the potentially overridden Html2Canvas function from the options property. This change improves the flexibility and configurability of the Screenshot module by allowing for custom implementations of Html2Canvas.


138-138: LGTM!

The update to the usage of Html2Canvas ensures that the method utilizes the potentially overridden Html2Canvas function from the options property. This change improves the flexibility and configurability of the Screenshot module by allowing for custom implementations of Html2Canvas.

packages/fluent-editor/src/toolbar/index.ts (1)

6-6: LGTM!

The change of importing the Delta class directly from the Quill instance instead of relying on the quill-delta package is approved.

This change enhances compatibility with the Quill library's internal structure and potentially reduces dependencies on external packages while preserving the functionality associated with Delta.

packages/fluent-editor/src/syntax/index.ts Show resolved Hide resolved
@kagol
Copy link
Member

kagol commented Sep 12, 2024

@zzxming 代码块高亮的 demo 有报错,功能失效
image

@kagol
Copy link
Member

kagol commented Sep 12, 2024

@zzxming 这次重构非常赞!不仅解决了 Quill 内容导出问题,抽离了样式,而且优化了产物结构,减少了包体积。
我发了一个 alpha 包:@opentiny/[email protected],目前验证产物没有问题,你也可以再验证下。

可能有个小问题,之前引入样式的方式:

@import '@opentiny/fluent-editor/style.css';

现在产物里面没有 style.css,会导致报错。
image

@kagol
Copy link
Member

kagol commented Sep 12, 2024

@zzxming 还发现两个问题,一个是插入表情功能失效,点击工具栏的表情图标不会弹出表情面板
另一个是通过 setContents(delta) 给富文本赋值不生效。

@zzxming
Copy link
Collaborator Author

zzxming commented Sep 12, 2024

@zzxming 还发现两个问题,一个是插入表情功能失效,点击工具栏的表情图标不会弹出表情面板 另一个是通过 setContents(delta) 给富文本赋值不生效。

有复现方式吗?我通过下载 @opentiny/[email protected] 进行测试,表情和 setContents 都是正常的

@zzxming
Copy link
Collaborator Author

zzxming commented Sep 12, 2024

@zzxming 代码块高亮的 demo 有报错,功能失效 image

文档说明已修改,可正常使用

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

Outside diff range and nitpick comments (2)
packages/docs/fluent-editor/docs/code-block-highlight.md (1)

11-12: Remove the empty lines.

The two empty lines at the end of the file do not serve any purpose. Please remove them to keep the documentation concise.

Apply this diff to remove the empty lines:

-
-
packages/fluent-editor/src/config/types/editor-modules.interface.ts (1)

23-29: LGTM! Consider adding JSDoc comments for better documentation.

The changes to the syntax property of the IEditorModules interface are approved. The new structure allows for more flexible configuration of the syntax highlighting feature, which is a valuable enhancement.

To improve the maintainability and usability of the code, consider adding JSDoc comments to document the new properties and their expected values. This will help future developers understand the purpose and usage of each property.

For example:

/**
 * Configuration for syntax highlighting.
 * @property {number} [interval] - The interval (in milliseconds) at which syntax highlighting should be updated.
 * @property {{key: string, label: string}[]} [languages] - The list of supported languages, each with a unique key and a display label.
 * @property {any} [hljs] - Additional configuration options to pass to the syntax highlighting library.
 */
syntax?: {
  interval?: number
  languages?: { key: string, label: string }[]
  hljs?: any  
} | boolean
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7eb3c52 and a3a4e58.

Files selected for processing (26)
  • README.md (1 hunks)
  • README.zh-CN.md (1 hunks)
  • packages/docs/fluent-editor/demos/basic-usage.vue (1 hunks)
  • packages/docs/fluent-editor/demos/code-block-highlight.vue (2 hunks)
  • packages/docs/fluent-editor/demos/counter-count.vue (1 hunks)
  • packages/docs/fluent-editor/demos/counter.vue (1 hunks)
  • packages/docs/fluent-editor/demos/custom-toolbar.vue (1 hunks)
  • packages/docs/fluent-editor/demos/emoji.vue (1 hunks)
  • packages/docs/fluent-editor/demos/file-upload.vue (1 hunks)
  • packages/docs/fluent-editor/demos/format-painter.vue (1 hunks)
  • packages/docs/fluent-editor/demos/formula.vue (1 hunks)
  • packages/docs/fluent-editor/demos/get-html.vue (1 hunks)
  • packages/docs/fluent-editor/demos/image-upload-to-server.vue (1 hunks)
  • packages/docs/fluent-editor/demos/image-upload.vue (1 hunks)
  • packages/docs/fluent-editor/demos/markdown.vue (1 hunks)
  • packages/docs/fluent-editor/demos/mention-custom-list.vue (1 hunks)
  • packages/docs/fluent-editor/demos/mention.vue (1 hunks)
  • packages/docs/fluent-editor/demos/table.vue (1 hunks)
  • packages/docs/fluent-editor/demos/video.vue (1 hunks)
  • packages/docs/fluent-editor/docs/code-block-highlight.md (1 hunks)
  • packages/docs/fluent-editor/docs/quick-start.md (2 hunks)
  • packages/fluent-editor/package.json (1 hunks)
  • packages/fluent-editor/scripts/pre-release.js (1 hunks)
  • packages/fluent-editor/src/assets/style.scss (1 hunks)
  • packages/fluent-editor/src/config/types/editor-modules.interface.ts (1 hunks)
  • packages/fluent-editor/vite.config.theme.ts (1 hunks)
Files skipped from review due to trivial changes (3)
  • packages/docs/fluent-editor/demos/counter-count.vue
  • packages/docs/fluent-editor/demos/counter.vue
  • packages/docs/fluent-editor/demos/video.vue
Files skipped from review as they are similar to previous changes (18)
  • README.md
  • README.zh-CN.md
  • packages/docs/fluent-editor/demos/basic-usage.vue
  • packages/docs/fluent-editor/demos/custom-toolbar.vue
  • packages/docs/fluent-editor/demos/emoji.vue
  • packages/docs/fluent-editor/demos/file-upload.vue
  • packages/docs/fluent-editor/demos/format-painter.vue
  • packages/docs/fluent-editor/demos/formula.vue
  • packages/docs/fluent-editor/demos/image-upload-to-server.vue
  • packages/docs/fluent-editor/demos/image-upload.vue
  • packages/docs/fluent-editor/demos/markdown.vue
  • packages/docs/fluent-editor/demos/mention-custom-list.vue
  • packages/docs/fluent-editor/demos/mention.vue
  • packages/docs/fluent-editor/demos/table.vue
  • packages/docs/fluent-editor/docs/quick-start.md
  • packages/fluent-editor/package.json
  • packages/fluent-editor/scripts/pre-release.js
  • packages/fluent-editor/vite.config.theme.ts
Additional comments not posted (10)
packages/docs/fluent-editor/docs/code-block-highlight.md (1)

3-7: LGTM!

The updated instructions for enabling code block highlighting using highlight.js are clear and cover both scenarios effectively. The formatting and link to the library's website enhance the documentation.

packages/fluent-editor/src/assets/style.scss (1)

1-37: LGTM!

The code changes in this new SCSS file are well-structured and modularized. The font-face declaration is correctly defined, and the order of imports is logical. The use of @include directives promotes code reusability and modularity. There are no apparent issues or inconsistencies in the code.

The code changes are approved.

packages/docs/fluent-editor/demos/code-block-highlight.vue (4)

4-4: LGTM!

The import statement for the SCSS stylesheet is correct and necessary for styling the FluentEditor component.


5-10: LGTM!

The import statements for highlight.js, the theme, and the Go language module are correct. Registering the Go language module is necessary for enabling syntax highlighting for Go code.


31-36: LGTM!

The configuration of the syntax module is correct. Specifying highlight.js as the syntax highlighter and including Go as an additional language option is necessary for enabling syntax highlighting for Go code.


Line range hint 1-45: Overall, the changes look great!

The file imports the necessary dependencies, including the SCSS stylesheet, highlight.js, and the Go language module. The configuration of the syntax module is correct, enabling syntax highlighting for Go code using highlight.js.

The changes are well-structured, follow best practices, and enhance the functionality of the code block highlighting demo. I don't have any additional suggestions or issues to report.

Great work!

packages/docs/fluent-editor/demos/get-html.vue (4)

4-4: LGTM!

The code changes are approved. Importing the SCSS stylesheet for the FluentEditor component ensures that the editor is styled correctly.


7-8: LGTM!

The code changes are approved. Importing the highlight.js library and its corresponding CSS enhances the editor's capabilities to support code formatting and highlighting.


10-10: LGTM!

The code changes are approved. Setting the global variable window.hljs makes the highlight.js library accessible globally within the application.


9-9: LGTM!

The code changes are approved. Setting the global variable window.katex makes the katex library accessible globally within the application.

@kagol
Copy link
Member

kagol commented Sep 12, 2024

@zzxming 还发现两个问题,一个是插入表情功能失效,点击工具栏的表情图标不会弹出表情面板 另一个是通过 setContents(delta) 给富文本赋值不生效。

有复现方式吗?我通过下载 @opentiny/[email protected] 进行测试,表情和 setContents 都是正常的

有的

https://stackblitz.com/edit/vitejs-vite-q9ttrh?file=src%2FApp.vue

@zzxming
Copy link
Collaborator Author

zzxming commented Sep 12, 2024

@zzxming 还发现两个问题,一个是插入表情功能失效,点击工具栏的表情图标不会弹出表情面板 另一个是通过 setContents(delta) 给富文本赋值不生效。

有复现方式吗?我通过下载 @opentiny/[email protected] 进行测试,表情和 setContents 都是正常的

有的

https://stackblitz.com/edit/vitejs-vite-q9ttrh?file=src%2FApp.vue

这是因为 Quill 初始化 syntax 模块错误了,后面的没执行成功,删掉 syntax 就行,或者安装一下 highlight.js

@kagol
Copy link
Member

kagol commented Sep 12, 2024

@zzxming 还发现两个问题,一个是插入表情功能失效,点击工具栏的表情图标不会弹出表情面板 另一个是通过 setContents(delta) 给富文本赋值不生效。

有复现方式吗?我通过下载 @opentiny/[email protected] 进行测试,表情和 setContents 都是正常的

有的
https://stackblitz.com/edit/vitejs-vite-q9ttrh?file=src%2FApp.vue

这是因为 Quill 初始化 syntax 模块错误了,后面的没执行成功,删掉 syntax 就行,或者安装一下 highlight.js

是不是可以给个提示,如果配置了 syntax: true,就提示安装 highlight.js

@zzxming
Copy link
Collaborator Author

zzxming commented Sep 12, 2024

是不是可以给个提示,如果配置了 syntax: true,就提示安装 highlight.js

quill 本身在控制台是有提示的 Uncaught Error: Syntax module requires highlight.js. Please include the library on the page before Quill.

@kagol kagol merged commit 1c8be8e into opentiny:main Sep 12, 2024
2 checks passed
@kagol kagol changed the title Build split code refactor: Build split code Sep 12, 2024
@coderabbitai coderabbitai bot mentioned this pull request Sep 12, 2024
13 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 20, 2024
13 tasks
@zzxming zzxming deleted the build-split-code branch December 6, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants