Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs(fluent-editor): optimize fluent-editor mobile-first docs #1804

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

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

kagol
Copy link
Member

@kagol kagol commented Jul 31, 2024

PR

主要变更:

  • 完善多端富文本的 api / demo 文档
  • 修复一些样式问题
  • 屏蔽 file / video 两个有问题的功能(待后续完善好再开放)

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?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced new configuration options for the image upload module in the editor.
    • Added several new Vue components for editing interfaces, including functionalities for image uploads and disabled states.
  • Bug Fixes

    • Simplified component usage by removing unnecessary attributes, improving overall user experience.
  • Enhancements

    • Streamlined the editor's toolbar by removing extraneous options for better usability.
    • Improved emitted events for better interactivity with parent components.
  • Style

    • Updated styling rules to enhance visual consistency and layout of the editor components.

@kagol kagol added the documentation 对文档的改进或补充 label Jul 31, 2024
Copy link

coderabbitai bot commented Jul 31, 2024

Walkthrough

The recent changes enhance the functionality and usability of the TinyFluentEditor across various Vue components. Key additions include image upload capabilities, new configuration options, and a simplified toolbar. Multiple new demo components showcase different features, while updates to existing components streamline user interactions. These improvements collectively elevate the editor's flexibility and user experience.

Changes

Files Change Summary
examples/sites/demos/apis/fluent-editor.js Introduced new configuration options for image uploads and defined the IImageUploadOptions interface for enhanced type safety.
examples/sites/demos/mobile-first/app/fluent-editor/basic-usage.vue Removed :zIndex="2" from the <tiny-fluent-editor> component to simplify usage and default stacking behavior.
examples/sites/demos/mobile-first/app/fluent-editor/data-switch.vue New Vue component integrating TinyFluentEditor, enabling two-way binding with a default HTML string.
examples/sites/demos/mobile-first/app/fluent-editor/disabled.vue New component featuring a disabled editor to display content without edits, initialized with a JSON string.
examples/sites/demos/mobile-first/app/fluent-editor/image-upload.vue New component for rich text editing with image upload capabilities, including configuration for handling uploads.
examples/sites/demos/mobile-first/app/fluent-editor/options.vue New component integrating TinyFluentEditor with dynamic content input and immediate display feedback.
examples/sites/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.js Added new demo objects for Data Switch, Disabled State, Image Upload, and Editor Options to showcase functionalities.
packages/renderless/src/fluent-editor/options.ts Simplified toolbar by removing 'video' and 'file' options, focusing on 'link', 'image', and 'better-table'.
packages/theme/src/fluent-editor/index.less Added CSS styles to adjust spacing and hide unnecessary content for improved visual presentation.
packages/vue/src/fluent-editor/src/mobile-first.vue Enhanced interactivity by adding new emitted events: 'ready', 'blur', 'focus', 'update:modelValue', and 'change'.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Editor
    participant Server

    User->>Editor: Upload Image
    Editor->>Server: Send Image Data
    Server-->>Editor: Return Image URL
    Editor->>User: Display Uploaded Image
Loading

🐇 "In the meadow, bright and fair,
Tiny editor, a joy to share.
With uploads now, and options galore,
Editing's easy, who could ask for more?
Hopping with glee in this code we weave,
A delightful tool, we do believe!" 🌼


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

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 3aee085 and 14a511d.

Files selected for processing (10)
  • examples/sites/demos/apis/fluent-editor.js (2 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/basic-usage.vue (1 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/data-switch.vue (1 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/disabled.vue (1 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/image-upload.vue (1 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/options.vue (1 hunks)
  • examples/sites/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.js (1 hunks)
  • packages/renderless/src/fluent-editor/options.ts (1 hunks)
  • packages/theme/src/fluent-editor/index.less (2 hunks)
  • packages/vue/src/fluent-editor/src/mobile-first.vue (1 hunks)
Files skipped from review due to trivial changes (2)
  • examples/sites/demos/mobile-first/app/fluent-editor/basic-usage.vue
  • packages/renderless/src/fluent-editor/options.ts
Additional comments not posted (19)
examples/sites/demos/mobile-first/app/fluent-editor/data-switch.vue (2)

1-7: LGTM!

The template section is well-structured and correctly binds the TinyFluentEditor component to the value.


9-22: LGTM!

The script section correctly imports the TinyFluentEditor component, registers it, and sets up the data object with an initial value.

examples/sites/demos/mobile-first/app/fluent-editor/options.vue (2)

1-7: LGTM!

The template section is well-structured and correctly binds the TinyFluentEditor component to content and options.


9-25: LGTM!

The script section correctly imports the TinyFluentEditor component, registers it, and sets up the data object with initial values for content and options.

examples/sites/demos/mobile-first/app/fluent-editor/disabled.vue (2)

1-7: LGTM!

The template section is well-structured and correctly binds the TinyFluentEditor component to content and sets it to disabled.


9-22: LGTM!

The script section correctly imports the TinyFluentEditor component, registers it, and sets up the data object with an initial value.

examples/sites/demos/mobile-first/app/fluent-editor/image-upload.vue (3)

1-7: LGTM!

The template section is well-structured and follows Vue best practices.


9-45: LGTM!

The script section is well-structured and correctly handles the image upload configuration.


17-43: LGTM!

The data section is well-structured and follows Vue best practices.

examples/sites/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.js (4)

18-28: LGTM!

The data-switch demo configuration is well-structured and follows the existing format.


31-41: LGTM!

The disabled demo configuration is well-structured and follows the existing format.


44-53: LGTM!

The image-upload demo configuration is well-structured and follows the existing format.


56-65: LGTM!

The options demo configuration is well-structured and follows the existing format.

examples/sites/demos/apis/fluent-editor.js (3)

41-52: LGTM!

The image-upload API configuration is well-structured and follows the existing format.


64-74: LGTM!

The options API configuration is well-structured and follows the existing format.


93-108: LGTM!

The IImageUploadOptions interface definition is well-structured and follows TypeScript best practices.

packages/vue/src/fluent-editor/src/mobile-first.vue (1)

86-86: LGTM! But verify the emission of new events.

The addition of new events enhances the component's interactivity. Ensure that these events are correctly emitted within the component.

packages/theme/src/fluent-editor/index.less (2)

75-76: LGTM! But verify the visual impact.

The addition of margin-right: 24px !important; likely aims to enhance layout consistency. Ensure that this change does not introduce any unintended side effects.


112-114: LGTM! But verify the impact on presentation.

The addition of display: none; for the &::after pseudo-element likely aims to remove unnecessary visual clutter. Ensure that this change does not hide any important content.

@zzcr zzcr merged commit 7054c15 into dev Jul 31, 2024
7 of 9 checks passed
@kagol kagol deleted the kagol/docs-fluent-editor-mobile-first branch November 4, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 对文档的改进或补充
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants