@ones-editor/editor 1.1.20-beta.12 → 1.1.20-beta.14

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 (42) hide show
  1. package/@ones-editor/block-menu/src/block-menu-button/index.d.ts +15 -5
  2. package/@ones-editor/core/src/core/blocks/common/block-wrapper.d.ts +1 -2
  3. package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -0
  4. package/@ones-editor/core/src/core/containers/container.d.ts +1 -0
  5. package/@ones-editor/core/src/core/types.d.ts +2 -26
  6. package/@ones-editor/drop-target/src/drop-indicator.d.ts +2 -3
  7. package/@ones-editor/drop-target/src/drop-target.d.ts +1 -2
  8. package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
  9. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +4 -1
  10. package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +0 -1
  11. package/@ones-editor/image-embed/src/image-object.d.ts +0 -1
  12. package/@ones-editor/image-embed/src/index.d.ts +1 -4
  13. package/@ones-editor/image-embed/src/types.d.ts +0 -1
  14. package/@ones-editor/to-docx/src/doc2other/core.d.ts +0 -2
  15. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  16. package/@ones-editor/ui/src/quick-menu/index.d.ts +0 -4
  17. package/@ones-editor/ui-base/src/icons/index.d.ts +1 -3
  18. package/@ones-editor/ui-base/src/popup/popup.d.ts +0 -1
  19. package/dist/index.js +202 -212
  20. package/package.json +1 -1
  21. package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +0 -32
  22. package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +0 -22
  23. package/@ones-editor/layout-block/package.json +0 -8
  24. package/@ones-editor/layout-block/src/block-drop.d.ts +0 -3
  25. package/@ones-editor/layout-block/src/child-containers.d.ts +0 -3
  26. package/@ones-editor/layout-block/src/column-resizer/index.d.ts +0 -2
  27. package/@ones-editor/layout-block/src/columns-options.d.ts +0 -2
  28. package/@ones-editor/layout-block/src/constants.d.ts +0 -29
  29. package/@ones-editor/layout-block/src/index.d.ts +0 -4
  30. package/@ones-editor/layout-block/src/layout-creator/index.d.ts +0 -27
  31. package/@ones-editor/layout-block/src/layout-operations.d.ts +0 -11
  32. package/@ones-editor/layout-block/src/locale/en-us.d.ts +0 -8
  33. package/@ones-editor/layout-block/src/locale/index.d.ts +0 -1
  34. package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +0 -8
  35. package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +0 -8
  36. package/@ones-editor/layout-block/src/percent-bar.d.ts +0 -3
  37. package/@ones-editor/layout-block/src/selection.d.ts +0 -5
  38. package/@ones-editor/layout-block/src/toolbar.d.ts +0 -35
  39. package/@ones-editor/layout-block/src/types.d.ts +0 -31
  40. package/@ones-editor/layout-block/src/utils.d.ts +0 -2
  41. package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +0 -22
  42. package/@ones-editor/to-docx/src/doc2other/layout.d.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "1.1.20-beta.12",
3
+ "version": "1.1.20-beta.14",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,32 +0,0 @@
1
- import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
2
- import EmptyBlockMenu from '../../empty-block-menu';
3
- import BlockMenu from '../../block-menu';
4
- export declare enum MenuButtonType {
5
- ROOT = "root",
6
- PARENT = "parent"
7
- }
8
- export default class OnesEditorBlockMenuButton {
9
- private editor;
10
- private menuType;
11
- buttonElement: HTMLButtonElement;
12
- emptyBlockMenu: EmptyBlockMenu;
13
- blockMenu: BlockMenu;
14
- private dragHandler;
15
- private menuButtonType;
16
- private removeButtonDelay;
17
- private shouldRemoveParentButton;
18
- private removeTimer;
19
- constructor(editor: OnesEditor, menuType: MenuButtonType);
20
- destroy(): void;
21
- handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, event: MouseEvent) => void;
22
- showRootButton(hoverBlock: BlockElement): void;
23
- showParentButton(hoverBlock: BlockElement): void;
24
- removeParentButton: () => void;
25
- addButtonToView(block: BlockElement): void;
26
- handleButtonClick: () => void;
27
- updatePlaceholder: (block: BlockElement) => void;
28
- handleChanged: () => void;
29
- createButton(): HTMLButtonElement;
30
- setButtonType(type: 'move' | 'insert'): void;
31
- updateButton(block: BlockElement): void;
32
- }
@@ -1,22 +0,0 @@
1
- import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
2
- import type { CommandItemType } from '../../../../@ones-editor/core';
3
- export default class ImageHoveringToolbarCommands implements BlockCommands {
4
- protected editor: OnesEditor;
5
- protected block: BlockElement;
6
- group: string;
7
- constructor(editor: OnesEditor, block: BlockElement);
8
- _commands: ({
9
- id: string;
10
- name: string;
11
- icon: string;
12
- type?: undefined;
13
- } | {
14
- id: string;
15
- name: string;
16
- type: CommandItemType;
17
- icon?: undefined;
18
- })[];
19
- private createIconItem;
20
- get commands(): CommandItem[];
21
- executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
22
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@ones-editor/layout-block",
3
- "version": "1.0.0",
4
- "type": "module",
5
- "private": true,
6
- "main": "./src/index.ts",
7
- "types": "src/index.d.ts"
8
- }
@@ -1,3 +0,0 @@
1
- import { LayoutKindBlock } from './types';
2
- export declare const handleDrop: LayoutKindBlock['handleDrop'];
3
- export declare const handleDropOver: LayoutKindBlock['handleDropOver'];
@@ -1,3 +0,0 @@
1
- import { BlockElement, ContainerElement } from '../../../@ones-editor/core';
2
- export declare function getChildContainers(block: BlockElement, from?: string, to?: string): ContainerElement[];
3
- export declare function getChildSeparators(block: BlockElement): HTMLElement[];
@@ -1,2 +0,0 @@
1
- import { OnesEditor } from '../../../../@ones-editor/core';
2
- export default function initLayoutColumnWidthDragger(editor: OnesEditor): void;
@@ -1,2 +0,0 @@
1
- import { BlockOptions, OnesEditor } from '../../../@ones-editor/core';
2
- export declare function getLayoutOptions(editor: OnesEditor): BlockOptions;
@@ -1,29 +0,0 @@
1
- /**
2
- * 名称
3
- */
4
- export declare const LAYOUT_NAME = "LayoutBlock";
5
- /**
6
- * 快捷键
7
- */
8
- export declare const LAYOUT_SHORTCUT_ID = "insert-layout";
9
- /**
10
- * 快捷键提示
11
- */
12
- export declare const LAYOUT_SHORTCUT_SUBTEXT = "/layout";
13
- export declare const LAYOUT_BLOCK_TYPE = "layout";
14
- /**
15
- * 最大分栏数
16
- */
17
- export declare const MAX_LAYOUT_COLUMNS = 6;
18
- /**
19
- * 分栏最小宽度,百分比
20
- */
21
- export declare const MIN_LAYOUT_WIDTH_PERCENT = 0.08;
22
- export declare const DROP_BLOCK_TYPE_WHITE_LIST: string[];
23
- export declare const DROP_EMBED_BLOCK_TYPE_WHITE_LIST: string[];
24
- /**
25
- * custom dom
26
- */
27
- export declare const LAYOUT_SEPARATOR_CLASS_NAME = "layout-separator";
28
- export declare const LAYOUT_COLUMN_CONTAINER_CLASS_NAME = "layout-column-container";
29
- export declare const LAYOUT_SEPARATOR_INDEX_ATTRIBUTE_KEY = "layoutSeparatorIndex";
@@ -1,4 +0,0 @@
1
- import './locale';
2
- import './layout-styles.scss';
3
- import { LayoutKindBlock } from './types';
4
- export declare const LayoutBlock: LayoutKindBlock;
@@ -1,27 +0,0 @@
1
- import { Closeable, CommandItem } from '../../../../@ones-editor/core';
2
- import { CreateLayoutData } from '../types';
3
- declare class LayoutCreatorItem implements CommandItem, CreateLayoutData {
4
- id: string;
5
- name: string;
6
- colCount?: number | undefined;
7
- classPrefix: {
8
- container: string;
9
- title: string;
10
- column: string;
11
- };
12
- element: HTMLElement;
13
- closeable: Closeable | null;
14
- columnsArray: number[];
15
- constructor();
16
- setCloseable: (closeable: Closeable) => void;
17
- destroy: () => void;
18
- createLayoutCreatorElement(): HTMLDivElement;
19
- handleCreatorClick: (event: MouseEvent) => void;
20
- handleCreatorLeave: () => void;
21
- handleLayoutCreatorColumnEnter: (event: MouseEvent) => void;
22
- highlightLayoutCreatorColumn: (colIndex: number) => void;
23
- setColumnClassByIndex: (column: HTMLElement | null, index: number, targetIndex: number) => void;
24
- showCreateLayoutCount: (colIndex: number) => void;
25
- }
26
- export declare function getLayoutCreatorItem(): LayoutCreatorItem;
27
- export {};
@@ -1,11 +0,0 @@
1
- import { BlockElement, OnesEditor, InsertEmptyBlockOptions, BlockPathComponent, DocBlock } from '../../../@ones-editor/core';
2
- export declare function handleInsertEmptyBlock(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<BlockElement>;
3
- export declare function createLayout(editor: OnesEditor, col: number | (BlockElement | DocBlock)[], path: BlockPathComponent): BlockElement;
4
- export declare function selectContainer(editor: OnesEditor, layoutBlockElement: BlockElement, startContainerID: string, endContainerID?: string): void;
5
- export declare function reorderColumns(editor: OnesEditor, layoutBlock: BlockElement, sourceContainerID: string, position: number): void;
6
- export declare function combineLayoutBlock(editor: OnesEditor, from: BlockElement, to: BlockElement, position?: number): void;
7
- export declare function addColumn(editor: OnesEditor, targetBlock: BlockElement, options?: {
8
- sourceBlock?: BlockElement;
9
- position?: number;
10
- }): void;
11
- export declare function deleteColumn(editor: OnesEditor, columnContainerID: string, layoutBlock: BlockElement): void;
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- layout: {
3
- title: string;
4
- columnDrag: string;
5
- insertColumn: string;
6
- };
7
- };
8
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- layout: {
3
- title: string;
4
- columnDrag: string;
5
- insertColumn: string;
6
- };
7
- };
8
- export default _default;
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- layout: {
3
- title: string;
4
- columnDrag: string;
5
- insertColumn: string;
6
- };
7
- };
8
- export default _default;
@@ -1,3 +0,0 @@
1
- import { ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
- import { LayoutDocBlock } from './types';
3
- export declare function createPercentBar(editor: OnesEditor, container: ContainerElement, layoutData: LayoutDocBlock, index: number): void;
@@ -1,5 +0,0 @@
1
- import { LayoutKindBlock } from './types';
2
- export declare const updateSelection: LayoutKindBlock['updateSelection'];
3
- export declare const clearSelection: LayoutKindBlock['clearSelection'];
4
- export declare const getSelectedContainers: LayoutKindBlock['getSelectedContainers'];
5
- export declare const getTextToolbarReferenceClient: LayoutKindBlock['getTextToolbarReferenceClient'];
@@ -1,35 +0,0 @@
1
- import { OnesEditor, BlockElement, BlockCommands, CommandItem, AutoScroll, OnesEditorCustom, ContainerElement } from '../../../@ones-editor/core';
2
- export declare function createSeparatorContainer(editor: OnesEditor, childContainerId: string, index: number): HTMLDivElement;
3
- export declare function createActionBar(editor: OnesEditor, containerID: string, _blockElement: BlockElement, columnRemovable?: boolean): HTMLDivElement;
4
- export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement): Promise<string>;
5
- export declare class OnesEditorCustomLayoutDragHandler implements OnesEditorCustom {
6
- private editor;
7
- activeLayoutBlock?: BlockElement;
8
- columnContainer?: ContainerElement;
9
- draggingContainer?: HTMLElement;
10
- autoScroll?: AutoScroll;
11
- startPosition?: {
12
- x: number;
13
- y: number;
14
- };
15
- get separators(): HTMLElement[] | undefined;
16
- get draggingContainerIndex(): number | undefined;
17
- constructor(editor: OnesEditor);
18
- destroy(): void;
19
- private handleMouseDown;
20
- private previewShouldScale;
21
- private initContainerPreview;
22
- private handleDragStart;
23
- private handleDrag;
24
- private handleDragEnd;
25
- private getClosetSeparator;
26
- }
27
- export declare class ColumnsBlockCommands implements BlockCommands {
28
- protected editor: OnesEditor;
29
- protected block: BlockElement;
30
- group: string;
31
- constructor(editor: OnesEditor, block: BlockElement);
32
- _commands: CommandItem[];
33
- get commands(): CommandItem[];
34
- executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
35
- }
@@ -1,31 +0,0 @@
1
- import { ComplexKindBlock, DocBlock } from '../../../@ones-editor/core';
2
- export interface LayoutDocBlock extends DocBlock {
3
- children: string[];
4
- colsWidth: number[];
5
- }
6
- export type LayoutKindBlock = ComplexKindBlock;
7
- export type LayoutDropData = {
8
- isValidColumnDragging: boolean;
9
- position: number;
10
- };
11
- export interface CreateLayoutData {
12
- colCount?: number;
13
- }
14
- /**
15
- * @deprecated
16
- */
17
- export declare const COMMANDS: readonly [{
18
- readonly id: "column-2";
19
- readonly name: "2 columns";
20
- }, {
21
- readonly id: "column-3";
22
- readonly name: "3 columns";
23
- }, {
24
- readonly id: "column-4";
25
- readonly name: "4 columns";
26
- }, {
27
- readonly id: "add-column";
28
- readonly name: "AddColumn";
29
- }];
30
- export type CommandID = (typeof COMMANDS)[number]['id'];
31
- export declare function getColumnLengthByType(type: string): number;
@@ -1,2 +0,0 @@
1
- import { BlockElement } from '../../../@ones-editor/core';
2
- export declare function isBlockElement(item: unknown): item is BlockElement;
@@ -1,22 +0,0 @@
1
- import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
2
- import type { CommandItemType } from '../../../../../@ones-editor/core';
3
- export default class ImageHoveringToolbarCommands implements BlockCommands {
4
- protected editor: OnesEditor;
5
- protected block: BlockElement;
6
- group: string;
7
- constructor(editor: OnesEditor, block: BlockElement);
8
- _commands: ({
9
- id: string;
10
- name: string;
11
- icon: string;
12
- type?: undefined;
13
- } | {
14
- id: string;
15
- name: string;
16
- type: CommandItemType;
17
- icon?: undefined;
18
- })[];
19
- private createIconItem;
20
- get commands(): CommandItem[];
21
- executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
22
- }
@@ -1,10 +0,0 @@
1
- import { DocBlock } from '../../../../@ones-editor/core';
2
- export interface CalcCol {
3
- cellId: string | undefined;
4
- originalWidth: number;
5
- width: number;
6
- }
7
- /**
8
- * 处理分栏数据结构:实际就是一行多列的表格数据
9
- */
10
- export declare function buildLayoutMatrix(block: DocBlock, maxWidth: number): CalcCol[];