mce 0.32.10 → 0.33.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.
@@ -130,6 +130,7 @@ declare const _default: {
130
130
  creator: string;
131
131
  memoryManager: string;
132
132
  toolbelt: string;
133
+ fxaa: string;
133
134
  msaa: string;
134
135
  pixelate: string;
135
136
  layers: string;
@@ -149,6 +150,7 @@ declare const _default: {
149
150
  flipVertical: string;
150
151
  toggleSelectionVisible: string;
151
152
  toggleSelectionLock: string;
153
+ clickToUnlock: string;
152
154
  layerOrder: string;
153
155
  bringToFront: string;
154
156
  bringForward: string;
@@ -130,6 +130,7 @@ declare const _default: {
130
130
  creator: string;
131
131
  memoryManager: string;
132
132
  toolbelt: string;
133
+ fxaa: string;
133
134
  msaa: string;
134
135
  pixelate: string;
135
136
  layers: string;
@@ -149,6 +150,7 @@ declare const _default: {
149
150
  flipVertical: string;
150
151
  toggleSelectionVisible: string;
151
152
  toggleSelectionLock: string;
153
+ clickToUnlock: string;
152
154
  layerOrder: string;
153
155
  bringToFront: string;
154
156
  bringForward: string;
@@ -17,6 +17,9 @@ declare global {
17
17
  interface MsaaConfig {
18
18
  enabled: boolean;
19
19
  }
20
+ interface FxaaConfig {
21
+ enabled: boolean;
22
+ }
20
23
  interface WatermarkConfig {
21
24
  url?: string;
22
25
  width: number;
@@ -31,6 +34,7 @@ declare global {
31
34
  pixelGrid: PixelGridConfig;
32
35
  pixelate: PixelateConfig;
33
36
  msaa: MsaaConfig;
37
+ fxaa: FxaaConfig;
34
38
  watermark: WatermarkConfig;
35
39
  }
36
40
  interface UIConfig {
@@ -0,0 +1,6 @@
1
+ import type { Element2D, Node } from 'modern-canvas';
2
+ import type { Vector2Like } from 'modern-path2d';
3
+ export declare function clampScroll(v: number, min: number, max: number): number;
4
+ export declare function scrollableFrameUnderPoint(roots: Node[] | undefined, isFrameNode: (n: Node) => boolean, p: Vector2Like): Element2D | undefined;
5
+ declare const _default: import("..").Plugin;
6
+ export default _default;
@@ -36,7 +36,7 @@ declare global {
36
36
  direction?: string;
37
37
  }
38
38
  interface Commands {
39
- editElement: () => void;
39
+ editElement: (event?: MouseEvent) => void;
40
40
  getTransform: () => TransformValue;
41
41
  setTransform: (type: TransformType, value: Partial<TransformValue>, options?: TransformOptions) => void;
42
42
  move: (direction: MoveDirection, distance?: number) => void;
@@ -36,6 +36,7 @@ import './plugins/edit'
36
36
  import './plugins/flexLayout'
37
37
  import './plugins/formatPaint'
38
38
  import './plugins/frame'
39
+ import './plugins/frameScroll'
39
40
  import './plugins/history'
40
41
  import './plugins/hover'
41
42
  import './plugins/image'
@@ -17,6 +17,7 @@ export * from './line';
17
17
  export * from './lottie';
18
18
  export * from './png';
19
19
  export * from './propsFactory';
20
+ export * from './readonly';
20
21
  export * from './registry';
21
22
  export * from './remapTextSelection';
22
23
  export * from './saveAs';
@@ -0,0 +1,21 @@
1
+ import type { Node } from 'modern-canvas';
2
+ export interface ClipRect {
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare function overflowClips(el: any): boolean;
9
+ /**
10
+ * 覆盖层框(box) 相对祖先裁剪画板(frameRect) 的 clip-path。二者均为 drawboard 像素坐标。
11
+ * 完全在画板内返回 undefined(不裁);部分溢出返回 inset(...);完全在外返回全裁(隐藏)。
12
+ */
13
+ export declare function insetClipPath(box: ClipRect, frameRect: ClipRect): string | undefined;
14
+ /**
15
+ * 求覆盖层框在其祖先裁剪画板下的 clip-path。
16
+ * @param el 被框住的元素
17
+ * @param box 该元素的 drawboard 像素框
18
+ * @param getAncestorFrame editor.getAncestorFrame
19
+ * @param getFrameRect (frame) => 画板的 drawboard 像素框(getAabb(frame,'drawboard'))
20
+ */
21
+ export declare function frameClipPath(el: Node | undefined, box: ClipRect, getAncestorFrame: (n?: Node) => any, getFrameRect: (frame: any) => ClipRect): string | undefined;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 命令在只读模式下是否放行。
3
+ *
4
+ * @param command 命令名(可含 `:` 参数,如 `copyAs:png`、`togglePanel:layers`,按冒号前基名判定)
5
+ */
6
+ export declare function isReadonlySafeCommand(command: string): boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -68,8 +68,10 @@ export declare class TextEditor extends HTMLElement implements PropertyAccessor
68
68
  protected _updateDomSelection(): void;
69
69
  protected _update(): void;
70
70
  protected _bindEventListeners(): void;
71
- pointerDown(e?: MouseEvent | PointerEvent): boolean;
71
+ pointerDown(e?: MouseEvent | PointerEvent, positionOnly?: boolean): boolean;
72
72
  selectAll(): void;
73
+ /** 重新聚焦隐藏 textarea,但不改变当前选区(用于进入编辑后保留点击处光标)。 */
74
+ focus(): void;
73
75
  attributeChangedCallback(name: string, _oldValue: any, newValue: any): void;
74
76
  protected _emit(type: string, detail?: any): boolean;
75
77
  protected _renderSelectRange(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.32.10",
4
+ "version": "0.33.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",
@@ -60,10 +60,10 @@
60
60
  "@vueuse/core": "^14.3.0",
61
61
  "diff": "^9.0.0",
62
62
  "lodash-es": "^4.18.1",
63
- "modern-canvas": "^0.26.3",
63
+ "modern-canvas": "^0.27.0",
64
64
  "modern-font": "^0.6.3",
65
- "modern-idoc": "^0.12.3",
66
- "modern-text": "^2.1.5",
65
+ "modern-idoc": "^0.12.4",
66
+ "modern-text": "^2.2.1",
67
67
  "y-protocols": "^1.0.7",
68
68
  "yjs": "^13.6.31"
69
69
  },