mce 0.25.0 → 0.26.0

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.
@@ -23,6 +23,10 @@ declare global {
23
23
  };
24
24
  type IndexCharacter = _IndexCharacter;
25
25
  type EditorNodeType = 'Doc' | 'Frame' | 'Slice' | 'Element';
26
+ interface Options {
27
+ /** 启动即只读:仅浏览 / 平移 / 缩放,禁用一切编辑。运行时可改 `editor.readonly.value`。 */
28
+ readonly?: boolean;
29
+ }
26
30
  interface Editor {
27
31
  fonts: Fonts;
28
32
  assets: Assets;
@@ -47,6 +51,8 @@ declare global {
47
51
  hoverElement: Ref<Element2D | undefined>;
48
52
  state: Ref<State | undefined>;
49
53
  mode: Ref<Mode>;
54
+ /** 前端只读模式:禁用一切编辑(选择拖动 / 变换 / 工具 / 双击编辑 / 变更类快捷键),仅保留浏览 / 平移 / 缩放。 */
55
+ readonly: Ref<boolean>;
50
56
  getGlobalPointer: () => Vector2Like;
51
57
  parseAnchor: (anchor: Anchor, isRtl?: boolean) => ParsedAnchor;
52
58
  isNode: (value: any) => value is Node;
@@ -22,4 +22,10 @@ export declare const imageMimeTypeExtMap: {
22
22
  };
23
23
  export declare const imageExts: string[];
24
24
  export declare const imageExtRe: RegExp;
25
+ /**
26
+ * 浏览器能直接当 <img> 渲染的位图 mime 白名单(即 imageMimeTypeExtMap 的键)。
27
+ * 用白名单而非 `startsWith('image/')`:svg(矢量,已从上表注释)、psd 等 image/* 容器虽以 image/
28
+ * 开头却无法被 <img> 加载、且各有专属 loader,黑名单容易漏;白名单只放确知可渲染的类型。
29
+ */
30
+ export declare const imageMimes: string[];
25
31
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.25.0",
4
+ "version": "0.26.0",
5
5
  "description": "A headless infinite canvas editor framework built on WebGL rendering, supports exporting to image, video, and PPT. Only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",