
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
budoux-components
Advanced tools
React、Vue、Astro フレームワーク用の BudouX コンポーネントです。このパッケージは、日本語テキストに BudouX(機械学習を活用した改行位置最適化ツール)を簡単に適用できるコンポーネントを提供します。
npm install budoux-components
コンポーネントは日本語テキストのセグメントを <span class="whitespace-nowrap">
タグで囲み、不自然な改行を防ぎます。Tailwind CSS と相性が良く、独自の CSS を定義することも可能です:
.whitespace-nowrap {
white-space: nowrap;
}
import BudouX from 'budoux-components/react';
function App() {
return (
<div>
{/* text prop を使用 */}
<BudouX text="こんにちは、世界!" />
{/* children を使用 */}
<BudouX>
<span>こんにちは、世界!</span>
日本語のテキストを自然に改行します。
</BudouX>
{/* カスタムクラス名 */}
<BudouX text="カスタムクラス" className="no-wrap" />
</div>
);
}
<template>
<div>
<!-- text prop を使用 -->
<BudouX text="こんにちは、世界!" />
<!-- slot を使用 -->
<BudouX>日本語のテキストを自然に改行します。</BudouX>
<!-- カスタムクラス名 -->
<BudouX text="カスタムクラス" :class-name="'no-wrap'" />
</div>
</template>
<script>
import BudouX from 'budoux-components/vue';
export default {
components: {
BudouX
}
}
</script>
---
import BudouX from 'budoux-components/astro';
---
<!-- text prop を使用 -->
<BudouX text="こんにちは、世界!" />
<!-- slot を使用 -->
<BudouX>
<span>こんにちは、世界!</span>
日本語のテキストを自然に改行します。
</BudouX>
<!-- カスタムクラス名 -->
<BudouX text="カスタムクラス" class="no-wrap" />
BudouX は機械学習を使用して、日本語テキストの最も自然な改行位置を判断します。コンポーネントはテキストを分析し、各セグメントを改行されない <span>
要素で囲みます。
例:
<!-- 入力 -->
<BudouX text="今日は天気がいいですね。" />
<!-- 出力 -->
<span class="whitespace-nowrap">今日は</span>
<span class="whitespace-nowrap">天気が</span>
<span class="whitespace-nowrap">いいですね。</span>
プロパティ | 型 | デフォルト値 | 説明 |
---|---|---|---|
text | string | undefined | BudouX を適用するテキスト |
className | string | 'whitespace-nowrap' | ラッパー span の CSS クラス |
class (Astro) | string | 'whitespace-nowrap' | ラッパー span の CSS クラス |
すべてのコンポーネントは children/slot コンテンツをサポートしています。children を使用する場合、コンポーネントは HTML 構造を保持しながらテキストノードに BudouX を適用します。
# リポジトリをクローン
git clone https://github.com/ideamans/budoux-components.git
cd budoux-components
# 依存関係のインストール
npm install
# ビルド
npm run build
# テスト
npm test
# E2E テスト(初回実行時は自動的にセットアップが行われます)
npm run test:e2e
E2E テストを実行すると、自動的に以下のセットアップが行われます:
手動でセットアップを行う場合:
node scripts/setup-e2e.js
このプロジェクトには Playwright MCP (Model Context Protocol) サーバーが含まれています。これにより、AI アシスタントがブラウザ自動化タスクを実行できます。
設定は .mcp/config.json
にあります。
Apache License 2.0
FAQs
BudouX components for React, Vue, and Astro frameworks
We found that budoux-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.