Skip to content

feat:Complete the api document.#6

Merged
kagol merged 1 commit intoopentiny:mainfrom
discreted66:doc0506
May 27, 2025
Merged

feat:Complete the api document.#6
kagol merged 1 commit intoopentiny:mainfrom
discreted66:doc0506

Conversation

@discreted66
Copy link
Collaborator

@discreted66 discreted66 commented May 6, 2025

api文档补全

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive documentation site for TinySearchBox, including a home page, usage guide, API references, and interactive examples.
    • Added various usage examples demonstrating features such as editable tags, custom panels, default search fields, input splitting, and more.
    • Provided detailed API documentation covering props, events, and types.
  • Documentation

    • Added extensive markdown documentation for all features, configuration options, and event handling.
    • Included contributor information and setup instructions for local development.
  • Style

    • Customized global scrollbar appearance for the documentation site.
  • Chores

    • Added and configured scripts for building and running the documentation site.
    • Updated dependencies and package configurations for documentation and main package.
  • Refactor

    • Standardized component usage in example files by updating component tags and removing redundant imports.
    • Improved code style consistency by removing unnecessary semicolons.
  • Revert

    • Removed outdated or duplicate documentation files to avoid confusion.

@coderabbitai
Copy link

coderabbitai bot commented May 6, 2025

Walkthrough

This update introduces a comprehensive VitePress-based documentation site for the TinySearchBox Vue3 component. It adds new documentation files, example demos, site configuration, and styling. The update also standardizes component usage in all Vue example files, removes outdated documentation, and refines code formatting and dependencies in related packages.

Changes

File(s) Change Summary
packages/docs/.env.v3 Added new environment variable VITE_BASE_URL=/ for Vite/VitePress configuration.
packages/docs/.vitepress/config.mts Introduced VitePress site config: dynamic base URL, site meta, navigation, sidebar, markdown plugins, and social links.
packages/docs/.vitepress/theme/index.less Added global scrollbar styling for WebKit browsers.
packages/docs/.vitepress/theme/index.ts Created theme extension: imports styles, registers search box and demo preview components, and enhances app setup.
packages/docs/apis/events.md, props.md, types.md Added new API documentation for events, props, and TypeScript types/interfaces.
packages/docs/examples/*.md Added numerous markdown files documenting usage examples and features such as auto-match, editable tags, help prompts, max length, custom panels, and more.
packages/docs/index.md Added VitePress home page with hero section, features, and action links.
packages/docs/package.json Created new package manifest for docs: scripts for dev/build/preview, dependencies for VitePress and related plugins.
packages/docs/usage.md Added installation, usage, and contributors guide for TinySearchBox.
packages/docs/search-box/*.vue Standardized component usage: removed explicit imports of TinySearchBox, replaced <tvp-search-box> tags with <tiny-search-box>. Minor logic update in max-length.vue (modal → console warning).
packages/docs/search-box/webdoc/search-box.cn.md, search-box.en.md Deleted old documentation files for SearchBox component.
packages/docs/search-box/webdoc/search-box.js Reformatted demo descriptions to plain text, removed HTML tags, updated demoId and codeFiles for default field example.
packages/docs/search-box/default-field.spec.ts Updated test navigation target to new fragment ID.
packages/search-box/package.json Removed dependency on @opentiny/utils.
packages/search-box/vite.config.ts Removed trailing semicolons for code style consistency (no logic changes).
package.json Added dev:docs and build:docs npm scripts targeting the docs workspace.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VitePress Docs Site
    participant TinySearchBox Component
    participant DemoPreview

    User->>VitePress Docs Site: Navigates to documentation
    VitePress Docs Site->>TinySearchBox Component: Loads example usage (via <tiny-search-box>)
    VitePress Docs Site->>DemoPreview: Loads demo preview component
    User->>TinySearchBox Component: Interacts with search box (e.g., input, select)
    TinySearchBox Component-->>User: Emits events (change, search, exceed, etc.)
    VitePress Docs Site-->>User: Displays API, usage, and example documentation
Loading

Poem

🐰
A hop and a skip, our docs now gleam,
With VitePress, examples, and a search box dream.
Old tags retired, new ones in place,
Scrollbars styled with elegant grace.
From props to events, all clearly in view—
Hooray for the docs, and TinySearchBox too!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@github-actions github-actions bot added the enhancement New feature or request label May 6, 2025
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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 6

🧹 Nitpick comments (23)
packages/docs/search-box/editable.vue (1)

3-3: Unnecessary blank line

There's an empty line left after removing the import statement. Consider removing this blank line for better code consistency.

1 <script setup lang="ts">
2 import { reactive, ref } from 'vue'
-3 
4 import { data } from './editable-data'
packages/docs/search-box/empty-placeholder.vue (1)

3-3: Unnecessary blank line

There's an empty line left after removing the import statement. Consider removing this blank line for better code consistency.

1 <script setup lang="ts">
2 import { ref } from 'vue'
-3 
4 import { data } from './editable-data'
packages/docs/examples/editable.md (1)

3-3: Add closing parenthesis and punctuation to note.

On line 3 the parenthetical note is missing a closing bracket and terminal punctuation, which may confuse readers.
Apply this diff:

- 标签支持可编辑功能,通过 editable 打开编辑功能,(注:map 类型不支持编辑
+ 标签支持可编辑功能,通过 `editable` 打开编辑功能(注:map 类型不支持编辑)。
packages/docs/examples/potential-match.md (1)

3-3: Format configuration option as code and add punctuation.

Line 3 should wrap the property name in backticks and end with a period for clarity.
Apply this diff:

- 通过 potential-options 配置潜在匹配项
+ 通过 `potential-options` 配置潜在匹配项。
packages/docs/examples/item-placeholder.md (1)

3-3: Format item properties and terminate sentence properly.

Wrap property names in backticks and add a period at the end for consistency and readability.
Apply this diff:

- 通过 item.placeholder 设置占位文本,item.editAttrDisabled 设置编辑状态下此属性类型不可切换
+ 通过 `item.placeholder` 设置占位文本,并通过 `item.editAttrDisabled` 禁用编辑状态下的属性类型切换。
packages/docs/examples/max-length.md (1)

3-3: Enhance clarity: format code and adjust sentence structure.

Wrap maxlength and exceed in backticks, simplify wording, and add punctuation.
Apply this diff:

- 通过 maxlength 原生属性限制输入不超过 8 个字符长度,配合 exceed 监听输入超出限定长度的事件
+ 通过原生 `maxlength` 属性限制输入不超过 8 个字符,并通过 `exceed` 事件监听超限情况。
packages/docs/examples/basic-usage.md (1)

3-5: Remove empty attributes and format code for consistency.

The preview directive should omit unnecessary empty attributes, and the items property should be wrapped in backticks.
Apply this diff:

- 通过 items 配置搜索数据项
- <preview path="../search-box/basic-usage.vue" title="" description=""></preview>
+ 通过 `items` 配置搜索数据项。
+ <preview path="../search-box/basic-usage.vue"></preview>
packages/docs/examples/group-key.md (1)

1-5: Consider expanding the documentation with examples.

While the documentation briefly explains the purpose of item.groupKey, it would be more helpful to include:

  1. Code examples showing how to set the groupKey property
  2. Visual representation of the grouping effect
  3. Any limitations or advanced usage scenarios

This would make the API documentation more comprehensive for developers.

packages/docs/examples/split-input-value.md (1)

1-5: Enhance with more comprehensive examples.

The documentation provides basic information about the split-input-value feature, but could be improved by adding:

  1. A code snippet showing the property in use
  2. Examples of input before and after splitting
  3. Use cases where this feature is particularly valuable

These additions would make the documentation more complete and useful for developers integrating the component.

packages/docs/examples/default-field.md (1)

1-5: Documentation is clear but could be more detailed.

The explanation of the default-field configuration is concise but relatively minimal. While it explains the basic purpose (configuring search by available regions), it could benefit from:

  1. A brief explanation of what a default search field is
  2. How it affects the user experience
  3. Any specific values or formats expected for this property

The current documentation is functional but could be enhanced for better clarity.

Consider expanding the explanation with more details about how default-field works and its impact on search behavior.

packages/docs/search-box/max-length.vue (1)

1-26: Consider adding comments to explain key concepts.

While the example is clear and focused, it would benefit from comments explaining:

  1. The purpose of the maxlength prop
  2. What the exceed event does and when it fires
  3. How the console log in handleExceed would be replaced with real error handling in production code

This would enhance the educational value of the example.

<script setup lang="ts">
import { ref } from 'vue'

const tags = ref([])
const maxlength = ref(8)
+ // Define data source with a field that demonstrates maxlength constraint
const dataSource = [
  {
    label: '名称',
    field: 'testName',
    replace: true,
    options: [
      {
        label: `不能超过${maxlength.value}个字符`
      }
    ]
  }
]

+ // Handler for the exceed event that fires when input exceeds maxlength
const handleExceed = (number) => {
  console.log(`不能超过${number}个字符`)
+ // In a real application, you might want to show a user-friendly error message
}
</script>

<template>
  <tiny-search-box v-model="tags" :items="dataSource" :maxlength="maxlength" @exceed="handleExceed" />
</template>
packages/docs/examples/auto-match.md (1)

1-5: Fix attribute syntax in documentation

The documentation contains a minor syntax issue. In Vue templates, boolean attributes should have quotes around their values.

-内置自动匹配功能,通过 :show-no-data-tip=false 隐藏面板的无数据提示,通过 search 监听搜索事件,change 监听搜索值变化事件
+内置自动匹配功能,通过 :show-no-data-tip="false" 隐藏面板的无数据提示,通过 search 监听搜索事件,change 监听搜索值变化事件

Otherwise, the documentation is well-structured and provides a clear explanation of the auto-match feature with a working example.

packages/docs/apis/events.md (1)

1-9: LGTM! Well-structured event documentation

The event documentation is comprehensive and well-organized. It clearly describes each event, its type signature, and when it's triggered. The links to type definitions provide good reference for developers.

Consider adding English translations alongside the Chinese descriptions if the component will be used by an international audience. This would make the documentation more accessible to non-Chinese speaking developers.

packages/docs/usage.md (1)

25-31: Specify fenced code block language and fix inconsistent backticks.

The code fences around the import snippet use four backticks and lack a language identifier, which triggers markdownlint errors. Replace the four-backtick fences with triple backticks and specify the language (or remove the empty fence if it was unintended).

Apply this diff:

- ````
+ ```javascript
  import TinySearchBox from '@opentiny/vue-search-box';
- ````
+ ```
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

25-25: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

packages/docs/index.md (1)

19-19: Fix typo: “lable” → “label”.

In the feature description on line 19, correct the spelling:

- 仅需要一个输入框便可替代传统lable+input形式
+ 仅需要一个输入框便可替代传统 label + input 形式
packages/docs/search-box/webdoc/search-box.js (1)

11-233: Improve desc formatting and consistency.

Across all demos, the desc strings include extra leading/trailing spaces and inconsistent spacing around code terms (e.g., items, panel-max-height). To enhance readability and maintainability:

  • Trim whitespace at the start/end of each description.
  • Wrap code identifiers in backticks (`items`).
  • Remove duplicate spaces around punctuation.
packages/docs/apis/props.md (1)

5-5: Fix punctuation in default-field description.

There's a misplaced full stop before “则”. Change it to a comma for proper flow:

- | default-field       | string | -- | 自定义按下 enter 键时,默认搜索的范围;此属性为空时。则默认在关键字范围下搜索 xxx,即生成的搜索标签为“关键字:xxx” |
+ | default-field       | string | -- | 自定义按下 enter 键时,默认搜索的范围;此属性为空时,则默认在关键字范围下搜索 xxx,即生成的搜索标签为“关键字:xxx” |
packages/docs/.vitepress/config.mts (3)

6-6: Fix typo in the reference comment.
The URL comment contains an unintended space (site-co nfig). It should read site-config.


14-16: Remove redundant noExternal entry.
The literal '@opentiny/vue-search-box' is covered by the regex /@opentiny\//, so you can simplify this list to avoid duplication:

 ssr: {
-  noExternal: [/@opentiny\//, '@opentiny/vue-search-box']
+  noExternal: [/@opentiny\//]
 }

34-70: Sidebar is comprehensive but manually maintained.
As the list of examples grows, you might reduce maintenance by generating the sidebar entries automatically (e.g., with a plugin like vitepress-plugin-auto-sidebar) instead of hard-coding every item.

packages/docs/apis/types.md (3)

20-20: Make editAttrDisabled optional for consistency.
All other properties in ISearchBoxItem are optional; consider changing to:

- editAttrDisabled: boolean;
+ editAttrDisabled?: boolean;

21-23: Use string[] for array types.
For readability and idiomatic TypeScript, prefer string[] over Array<string>:

- searchKeys?: Array<string>;
- operators?: Array<string>;
+ searchKeys?: string[];
+ operators?: string[];

5-5: Use TypeScript code blocks for type definitions.
Replace the language identifiers with ts or typescript for proper syntax highlighting when documenting interfaces:

- ```js
+ ```ts

Also applies to: 44-44, 61-61

🛑 Comments failed to post (6)
packages/docs/examples/custom-panel.md (1)

5-5: 💡 Verification agent

🧩 Analysis chain

Verify the preview component path is correct.

The preview component references ../search-box/basic-usage.vue. Please ensure this path is correct and that the referenced component actually demonstrates the custom panel feature described in this documentation.


🏁 Script executed:

#!/bin/bash
# Check if the referenced Vue file exists and contains custom panel implementation
ls -la packages/docs/search-box/basic-usage.vue
grep -A 20 "custom" packages/docs/search-box/basic-usage.vue

Length of output: 199


🏁 Script executed:

#!/bin/bash
# Display the contents of the referenced Vue example to verify it demonstrates the custom panel feature
cat packages/docs/search-box/basic-usage.vue

Length of output: 253


Update preview to the custom‐panel example
The current preview at ../search-box/basic-usage.vue only shows the default <tiny-search-box> usage and doesn’t include any custom panel logic. Please point this to the example that demonstrates adding a custom panel (or add that example if it’s missing).

– packages/docs/examples/custom-panel.md (line 5)

- <preview path="../search-box/basic-usage.vue" ></preview>
+ <preview path="../custom-panel/basic-usage.vue" ></preview>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

<preview path="../custom-panel/basic-usage.vue" ></preview>
🤖 Prompt for AI Agents (early access)
In packages/docs/examples/custom-panel.md at line 5, the preview component path points to ../search-box/basic-usage.vue, which only shows default usage without custom panel logic. Update the preview path to reference the example file that demonstrates the custom panel feature, or create and link to a new example that includes the custom panel implementation.
packages/docs/.vitepress/theme/index.ts (1)

1-1: ⚠️ Potential issue

Fix incorrect import path

The import is referencing a file from a .history directory with a timestamp, which appears to be an editor/VCS history file rather than the actual module.

-import { use } from './../../../../.history/packages/search-box/src/index_20250428162116'
+import { use } from '@opentiny/vue-search-box' // or the correct module path

This could cause issues in production as it's importing from a specific timestamped backup rather than the actual module.

🤖 Prompt for AI Agents (early access)
In packages/docs/.vitepress/theme/index.ts at line 1, the import path incorrectly points to a .history directory with a timestamped backup file. Replace this import path with the correct path to the actual source module in the search-box package, ensuring it does not reference any .history or backup directories to avoid production issues.
packages/docs/search-box/webdoc/search-box.js (1)

110-112: ⚠️ Potential issue

Missing English description for group-key.

The en-US field for the group-key demo is empty. Please provide an English translation so that the demo description appears correctly in both locales.

🤖 Prompt for AI Agents (early access)
In packages/docs/search-box/webdoc/search-box.js around lines 110 to 112, the 'en-US' field for the 'group-key' demo description is currently empty. Add a clear and concise English translation for the description to ensure the demo displays correctly in English locale, matching the intent of the Chinese description.
packages/docs/.vitepress/config.mts (1)

5-5: ⚠️ Potential issue

Incorrect usage of loadEnv arguments.
loadEnv expects the Vite mode (e.g., "development" or "production") as its first parameter, not the VITE_BASE_URL value. Passing process.env.VITE_BASE_URL here will prevent proper loading of environment variables.

Use the runtime mode (e.g., process.env.NODE_ENV) for loadEnv, for example:

- const env = loadEnv(process.env.VITE_BASE_URL!, fileURLToPath(new URL('../', import.meta.url)))
+ const env = loadEnv(process.env.NODE_ENV || 'production', fileURLToPath(new URL('../', import.meta.url)))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

- const env = loadEnv(process.env.VITE_BASE_URL!, fileURLToPath(new URL('../', import.meta.url)))
+ const env = loadEnv(process.env.NODE_ENV || 'production', fileURLToPath(new URL('../', import.meta.url)))
🤖 Prompt for AI Agents (early access)
In packages/docs/.vitepress/config.mts at line 5, the loadEnv function is incorrectly called with process.env.VITE_BASE_URL as the first argument, but it expects the Vite mode string like "development" or "production". Replace process.env.VITE_BASE_URL with the current runtime mode, such as process.env.NODE_ENV or another appropriate mode variable, to ensure environment variables load correctly.
packages/docs/apis/types.md (2)

31-40: ⚠️ Potential issue

Duplicate ISearchBoxTagType definitions.
You’ve declared the same union type twice (after ISearchBoxItem and ISearchBoxTag), and the variants differ ('custom' is present in one but missing in the other). Consolidate into a single alias to avoid conflicts and ensure all variants are covered.

Also applies to: 56-57

🤖 Prompt for AI Agents (early access)
In packages/docs/apis/types.md around lines 31 to 40 and also lines 56 to 57, there are duplicate definitions of the ISearchBoxTagType union type with differing variants. To fix this, remove the redundant duplicate definition and consolidate all variants, including 'custom', into a single ISearchBoxTagType alias. Ensure this unified type is used consistently wherever referenced to avoid conflicts.

10-10: ⚠️ Potential issue

Missing definition for ISearchBoxOption.
The property options?: ISearchBoxOption[] references ISearchBoxOption, but that type isn’t defined or imported in this file. This will break the API documentation and type checking.

Add a declaration for ISearchBoxOption here or import it from the appropriate module.

🤖 Prompt for AI Agents (early access)
In packages/docs/apis/types.md at line 10, the type ISearchBoxOption used in the options property is not defined or imported, causing type errors and broken documentation. Fix this by either adding a proper declaration for ISearchBoxOption in this file or importing it from the correct module where it is defined, ensuring the type is recognized and the documentation builds correctly.

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: 2

🧹 Nitpick comments (2)
packages/docs/usage.md (2)

1-4: Consider adding VitePress frontmatter.

This file lacks a YAML frontmatter block, which VitePress uses for page metadata (title, sidebar configuration, etc.). Adding something like the following at the top will improve navigation and SEO:

---
title: 使用指南
sidebarDepth: 2
---

106-107: Localize the acknowledgment sentence.

The line Thanks goes to these wonderful people is in English, while the rest of the document is Chinese. For consistency, translate it, e.g.:

感谢以下贡献者
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a82b7b5 and aca977f.

⛔ Files ignored due to path filters (4)
  • packages/docs/TinySearchBox.png is excluded by !**/*.png
  • packages/docs/public/favicon.ico is excluded by !**/*.ico
  • packages/docs/public/logo.png is excluded by !**/*.png
  • packages/docs/public/logo.svg is excluded by !**/*.svg
📒 Files selected for processing (53)
  • package.json (1 hunks)
  • packages/docs/.env.v3 (1 hunks)
  • packages/docs/.vitepress/config.mts (1 hunks)
  • packages/docs/.vitepress/theme/index.less (1 hunks)
  • packages/docs/.vitepress/theme/index.ts (1 hunks)
  • packages/docs/apis/events.md (1 hunks)
  • packages/docs/apis/props.md (1 hunks)
  • packages/docs/apis/types.md (1 hunks)
  • packages/docs/examples/auto-match.md (1 hunks)
  • packages/docs/examples/basic-usage.md (1 hunks)
  • packages/docs/examples/custom-panel.md (1 hunks)
  • packages/docs/examples/default-field.md (1 hunks)
  • packages/docs/examples/editable.md (1 hunks)
  • packages/docs/examples/empty-placeholder.md (1 hunks)
  • packages/docs/examples/events.md (1 hunks)
  • packages/docs/examples/group-key.md (1 hunks)
  • packages/docs/examples/help.md (1 hunks)
  • packages/docs/examples/id-map-key.md (1 hunks)
  • packages/docs/examples/item-placeholder.md (1 hunks)
  • packages/docs/examples/max-length.md (1 hunks)
  • packages/docs/examples/max-time-length.md (1 hunks)
  • packages/docs/examples/merge-tag.md (1 hunks)
  • packages/docs/examples/panel-max-height.md (1 hunks)
  • packages/docs/examples/potential-match.md (1 hunks)
  • packages/docs/examples/split-input-value.md (1 hunks)
  • packages/docs/examples/v-model.md (1 hunks)
  • packages/docs/index.md (1 hunks)
  • packages/docs/package.json (1 hunks)
  • packages/docs/search-box/auto-match.vue (2 hunks)
  • packages/docs/search-box/basic-usage.vue (1 hunks)
  • packages/docs/search-box/custom-panel.vue (3 hunks)
  • packages/docs/search-box/default-field.spec.ts (1 hunks)
  • packages/docs/search-box/default-field.vue (1 hunks)
  • packages/docs/search-box/editable.vue (2 hunks)
  • packages/docs/search-box/empty-placeholder.vue (1 hunks)
  • packages/docs/search-box/events.vue (1 hunks)
  • packages/docs/search-box/group-key.vue (1 hunks)
  • packages/docs/search-box/help.vue (2 hunks)
  • packages/docs/search-box/id-map-key.vue (1 hunks)
  • packages/docs/search-box/item-placeholder.vue (1 hunks)
  • packages/docs/search-box/max-length.vue (1 hunks)
  • packages/docs/search-box/max-time-length.vue (1 hunks)
  • packages/docs/search-box/merge-tag.vue (1 hunks)
  • packages/docs/search-box/panel-max-height.vue (2 hunks)
  • packages/docs/search-box/potential-match.vue (2 hunks)
  • packages/docs/search-box/split-input-value.vue (2 hunks)
  • packages/docs/search-box/v-model.vue (2 hunks)
  • packages/docs/search-box/webdoc/search-box.cn.md (0 hunks)
  • packages/docs/search-box/webdoc/search-box.en.md (0 hunks)
  • packages/docs/search-box/webdoc/search-box.js (17 hunks)
  • packages/docs/usage.md (1 hunks)
  • packages/search-box/package.json (0 hunks)
  • packages/search-box/vite.config.ts (3 hunks)
💤 Files with no reviewable changes (3)
  • packages/search-box/package.json
  • packages/docs/search-box/webdoc/search-box.cn.md
  • packages/docs/search-box/webdoc/search-box.en.md
✅ Files skipped from review due to trivial changes (11)
  • packages/docs/examples/max-time-length.md
  • packages/docs/search-box/split-input-value.vue
  • packages/docs/search-box/auto-match.vue
  • packages/docs/search-box/merge-tag.vue
  • packages/docs/search-box/v-model.vue
  • packages/docs/search-box/group-key.vue
  • packages/docs/examples/help.md
  • packages/docs/search-box/editable.vue
  • packages/docs/search-box/default-field.vue
  • package.json
  • packages/docs/search-box/max-time-length.vue
🚧 Files skipped from review as they are similar to previous changes (38)
  • packages/docs/examples/panel-max-height.md
  • packages/docs/search-box/default-field.spec.ts
  • packages/docs/search-box/item-placeholder.vue
  • packages/docs/examples/events.md
  • packages/docs/search-box/empty-placeholder.vue
  • packages/docs/search-box/id-map-key.vue
  • packages/docs/.env.v3
  • packages/docs/examples/v-model.md
  • packages/search-box/vite.config.ts
  • packages/docs/examples/editable.md
  • packages/docs/examples/item-placeholder.md
  • packages/docs/examples/merge-tag.md
  • packages/docs/examples/max-length.md
  • packages/docs/search-box/potential-match.vue
  • packages/docs/search-box/events.vue
  • packages/docs/examples/split-input-value.md
  • packages/docs/search-box/panel-max-height.vue
  • packages/docs/search-box/basic-usage.vue
  • packages/docs/examples/potential-match.md
  • packages/docs/.vitepress/theme/index.less
  • packages/docs/examples/empty-placeholder.md
  • packages/docs/examples/group-key.md
  • packages/docs/examples/default-field.md
  • packages/docs/examples/auto-match.md
  • packages/docs/examples/id-map-key.md
  • packages/docs/search-box/max-length.vue
  • packages/docs/examples/custom-panel.md
  • packages/docs/search-box/help.vue
  • packages/docs/.vitepress/theme/index.ts
  • packages/docs/search-box/custom-panel.vue
  • packages/docs/index.md
  • packages/docs/apis/events.md
  • packages/docs/apis/props.md
  • packages/docs/package.json
  • packages/docs/search-box/webdoc/search-box.js
  • packages/docs/.vitepress/config.mts
  • packages/docs/apis/types.md
  • packages/docs/examples/basic-usage.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
packages/docs/usage.md

25-25: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🔇 Additional comments (3)
packages/docs/usage.md (3)

21-23: Installation snippet is properly highlighted.

Using ```shell for the npm i command is correct and will render with shell syntax highlighting in VitePress.


108-120: Contributor table markup is correct.

The ALL-CONTRIBUTORS table is properly embedded with the required markers and HTML structure. It will render as expected.


15-16:

Details

✅ Verification successful

Verify the image asset path.

The line ![TinySearchBox](TinySearchBox.png) assumes the image is in the same directory or a public assets folder. Please confirm that TinySearchBox.png exists under packages/docs (or packages/docs/public) so it resolves correctly in the built site:


🏁 Script executed:

#!/bin/bash
# Check for TinySearchBox.png in the docs folder
fd TinySearchBox.png packages/docs

Length of output: 68


Asset path verified

The image TinySearchBox.png is present at packages/docs/TinySearchBox.png, so the relative link in packages/docs/usage.md is correct and no changes are needed.

Comment on lines +25 to +31
````

导入 TinySearchBox 综合搜索:

```javascript
import TinySearchBox from '@opentiny/vue-search-box';
````
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 the JavaScript import code fence.

The current nested backticks (\``inside a````block) will break rendering. Replace with a single triple-backticks block specifyingjavascript`, for example:

- ````
- 导入 TinySearchBox 综合搜索:
-
- ```javascript
- import TinySearchBox from '@opentiny/vue-search-box';
- ````
+ ```javascript
+ // 导入 TinySearchBox 综合搜索组件
+ import TinySearchBox from '@opentiny/vue-search-box';
+ ```

This ensures proper syntax highlighting and correct rendering.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

25-25: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🤖 Prompt for AI Agents (early access)
In packages/docs/usage.md around lines 25 to 31, the JavaScript import code block uses nested backticks which breaks rendering. Replace the current four-backtick fenced block with a standard triple-backtick fenced block specifying "javascript" and remove the extra backtick. Also, add a comment line above the import statement for clarity. This will fix the syntax highlighting and ensure proper markdown rendering.

Comment on lines +41 to +44
```html
<script setup>
const tags = ref([])
const items = ref([
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Include necessary imports in the <script setup> example.

The demo uses ref and <tiny-search-box> but never imports them. Update the snippet to:

<script setup>
import { ref } from 'vue'
import TinySearchBox from '@opentiny/vue-search-box'

const tags = ref([])
const items = ref([ /* ... */ ])
</script>

This makes the example functional out of the box.

🤖 Prompt for AI Agents (early access)
In packages/docs/usage.md around lines 41 to 44, the <script setup> example uses ref and <tiny-search-box> without importing them. Fix this by adding the import statements for ref from 'vue' and TinySearchBox from '@opentiny/vue-search-box' at the top of the <script setup> block to make the example functional.

@kagol kagol merged commit 0ea1a4c into opentiny:main May 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants