@bixlab/mtone 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/llms.txt +10 -9
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Ready-styled React UI library built on Base UI, Tailwind CSS and Lucide icons. Install one package, not individual copied components.
|
|
4
4
|
|
|
5
|
-
This file describes this package checkout, not necessarily the latest published npm release. Package version: 0.15.
|
|
5
|
+
This file describes this package checkout, not necessarily the latest published npm release. Package version: 0.15.1. Prefer the llms.txt and dist/index.d.ts bundled with your installed version over the live website, which follows master.
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ This file describes this package checkout, not necessarily the latest published
|
|
|
25
25
|
- Semantic colors select a purpose, not a hue: --mt-select-surface for selected surfaces, --mt-focus for keyboard focus, --mt-alert-info-bg for an info surface. New role overrides limit changes to that purpose and preserve legacy CSS fallbacks when unset; existing hue presets remain public.
|
|
26
26
|
- Selected surfaces: use --mt-select-surface for pale-blue selected items and located settings rows. It is #E9EEF4 in light and #293746 in dark mode, not an accent color or focus-border token.
|
|
27
27
|
- Dialog modal defaults true: outside clicks do not close; false allows outside dismissal. Both retain focus trapping, backdrop and scroll lock. Escape and close button remain available.
|
|
28
|
-
- Use Tag for content labels with optional removal, and Status for a state indicator. BlockEditor is documented separately and belongs to the optional @bixlab/mtone-
|
|
28
|
+
- Use Tag for content labels with optional removal, and Status for a state indicator. BlockEditor is documented separately and belongs to the optional @bixlab/mtone-blockeditor package, not this npm package. Upload requires an application service; examples are not backend persistence. DatePicker uses native browser date UI.
|
|
29
29
|
- Toast notifications need ToastProvider; useToast exposes add, success, error, info, update, promise and close (verify installed declarations before use).
|
|
30
30
|
- Do not assume the live docs match an older npm package. Type-check generated code and run interaction tests.
|
|
31
31
|
|
|
@@ -43,21 +43,22 @@ This file describes this package checkout, not necessarily the latest published
|
|
|
43
43
|
### BlockEditor
|
|
44
44
|
|
|
45
45
|
- [BlockEditor](https://xingjianxu.github.io/mtone/#/components/BlockEditor): 可选的块编辑器:BlockNote 管理正文与选区,mtone 提供工具栏、菜单和主题。独立于主包。
|
|
46
|
-
- Import: BlockEditor from @bixlab/mtone-
|
|
47
|
-
- initialContent: readonly BlockEditorInput[].
|
|
46
|
+
- Import: BlockEditor from @bixlab/mtone-blockeditor
|
|
47
|
+
- initialContent: readonly BlockEditorInput[]. 仅在创建该文档时读取。支持正文、标题、列表、待办、引用、分割线、代码、表格、折叠、提示块和 URL 图片。默认空段落。
|
|
48
48
|
- documentKey: string | number. 换文档时修改键;新文档单独读取 initialContent,旧撤销历史不保留。
|
|
49
49
|
- onChange: (blocks: BlockEditorBlock[]) => void. 内容改变时返回 BlockNote JSON。由应用决定怎样保存、验证和重新加载。
|
|
50
|
-
- readOnly: boolean (default: false).
|
|
50
|
+
- readOnly: boolean (default: false). 显示不可编辑正文;代码使用 Typography.Code 高亮。不替代应用权限校验。
|
|
51
|
+
- uploadImage: (file: File) => Promise<string>. 可选。由宿主上传图片并返回 HTTP(S) 地址;未传时仍可通过 URL 插入图片。
|
|
51
52
|
- label / locale / className: string / 'zh' | 'en' / string. 正文的无障碍名称、界面语言和外层样式。语言未指定时继承 mtone,主题同步继承。
|
|
52
|
-
-
|
|
53
|
+
- 新包名 @bixlab/mtone-blockeditor 尚未发布到 npm;下方代码使用新包名。主包不包含、也不依赖编辑器。
|
|
53
54
|
- 导入两份 CSS;Next.js 使用客户端组件,推荐动态导入并设置 ssr: false。移动端 viewport 建议加 interactive-widget=resizes-content。
|
|
54
|
-
- 键入 / 或点 +
|
|
55
|
+
- 键入 / 或点 + 添加块。更多格式提供对齐、文字色和高亮。将光标放进表格单元格即可增删行列、切换表头;不支持合并单元格。代码语言可切换,可选高亮预览;图片可编辑替代文本和说明。
|
|
55
56
|
- 原生 JSON 是主存储格式。只读只影响界面。外部内容仍需由应用验证来源、权限以及数据结构。
|
|
56
57
|
|
|
57
58
|
```tsx
|
|
58
|
-
import { BlockEditor, type BlockEditorBlock } from "@bixlab/mtone-
|
|
59
|
+
import { BlockEditor, type BlockEditorBlock } from "@bixlab/mtone-blockeditor";
|
|
59
60
|
import "@bixlab/mtone/styles.css";
|
|
60
|
-
import "@bixlab/mtone-
|
|
61
|
+
import "@bixlab/mtone-blockeditor/styles.css";
|
|
61
62
|
|
|
62
63
|
export default function Demo() {
|
|
63
64
|
const save = (blocks: BlockEditorBlock[]) => {
|