@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.
Files changed (2) hide show
  1. package/llms.txt +10 -9
  2. 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.0. Prefer the llms.txt and dist/index.d.ts bundled with your installed version over the live website, which follows master.
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-blocknote package, not this npm package. Upload requires an application service; examples are not backend persistence. DatePicker uses native browser date UI.
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-blocknote
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
- - 编辑器单独安装:npm install @bixlab/mtone @bixlab/mtone-blocknote。请以 npm 可用版本为准。主包不包含、也不依赖编辑器。
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-blocknote";
59
+ import { BlockEditor, type BlockEditorBlock } from "@bixlab/mtone-blockeditor";
59
60
  import "@bixlab/mtone/styles.css";
60
- import "@bixlab/mtone-blocknote/styles.css";
61
+ import "@bixlab/mtone-blockeditor/styles.css";
61
62
 
62
63
  export default function Demo() {
63
64
  const save = (blocks: BlockEditorBlock[]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bixlab/mtone",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "type": "module",
5
5
  "description": "Compact, ready-styled React components powered by Base UI",
6
6
  "files": [