@worktile/theia 17.1.1 → 17.2.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.
@@ -116,6 +116,7 @@ export interface TheOptions {
116
116
  extraElementOptions?: ElementOptionsInfo[];
117
117
  neededScrollIntoView?: (e: Editor) => boolean;
118
118
  placeholderDecorate?: (e: Editor) => SlatePlaceholder[];
119
+ autoNormalize?: boolean;
119
120
  }
120
121
  export type NodeMatch<T = Node> = Predicate<T>;
121
122
  export interface MatchOptions<T = Node> {
@@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core';
2
2
  import { TheOptions } from './editor';
3
3
  import { ThePlugin } from './plugins';
4
4
  export interface ThePresetConfig {
5
- options?: Pick<TheOptions, 'mode' | 'inlineToolbarVisible' | 'toolbar' | 'menu'>;
5
+ options?: Pick<TheOptions, 'mode' | 'inlineToolbarVisible' | 'toolbar' | 'menu' | 'autoNormalize'>;
6
6
  plugins?: ThePlugin[];
7
7
  }
8
8
  export declare const THE_PRESET_CONFIG_TOKEN: InjectionToken<ThePresetConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "17.1.1",
3
+ "version": "17.2.1",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -38,7 +38,7 @@
38
38
  "peerDependencies": {
39
39
  "@angular/core": "^17.2.4",
40
40
  "date-fns": ">= 2.6.0",
41
- "slate-angular": "17.1.0",
41
+ "slate-angular": ">= 17.1.0",
42
42
  "slate": ">= 0.101.5",
43
43
  "ngx-tethys": "^17.0.0",
44
44
  "ng-codemirror": "^17.0.0",
@@ -1,2 +1,4 @@
1
+ import { Editor } from 'slate';
2
+ export declare const closeConversionHint: (editor: Editor) => void;
1
3
  export declare const withDeserializeMd: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
2
4
  export declare const createDeserializeMdPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
package/public-api.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './core/index';
4
4
  export * from './core/toolbar-item/base-toolbar-item';
5
5
  export * from './custom-types';
6
6
  export * from './editor.component';
7
+ export * from './editor.module';
7
8
  export * from './interfaces';
8
9
  export * from './plugins';
9
10
  export * from './plugins/image/image.component';
@@ -1,6 +1,5 @@
1
1
  import { applyDeepToNodes } from './apply-deep-to-nodes';
2
2
  import { clearMarks } from './clear-marks';
3
- import { closeConversionHint } from './close-conversion-hint';
4
3
  import { deleteElement } from './delete-element';
5
4
  import { deleteNodeByType } from './delete-node-by-type';
6
5
  import { handleContinualDeleteBackward } from './handle-continual-delete-backward';
@@ -16,4 +15,4 @@ import { setNode } from './set-node';
16
15
  import { setNodeByType } from './set-node-by-type';
17
16
  import { unWrap } from './un-wrap';
18
17
  import { unwrapNodesByType } from './unwrap-nodes-by-type';
19
- export { applyDeepToNodes, clearMarks, closeConversionHint, deleteElement, deleteNodeByType, handleContinualDeleteBackward, handleContinualInsertBreak, insertElements, insertParagraph, mergeDeepToNodes, moveChildren, onKeyDownResetBlockType, setEndSelection, setMarks, setNode, setNodeByType, unWrap, unwrapNodesByType };
18
+ export { applyDeepToNodes, clearMarks, deleteElement, deleteNodeByType, handleContinualDeleteBackward, handleContinualInsertBreak, insertElements, insertParagraph, mergeDeepToNodes, moveChildren, onKeyDownResetBlockType, setEndSelection, setMarks, setNode, setNodeByType, unWrap, unwrapNodesByType };
package/utils/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export * from './refocus';
19
19
  export * from './scroll-into-view';
20
20
  export * from './update-popover-position';
21
21
  export * from './weak-maps';
22
+ export * from './normalize';
@@ -0,0 +1,5 @@
1
+ import { Descendant, Editor, Element, Path } from 'slate';
2
+ export declare function getDirtyElements(editor: Editor, content: Descendant[], result?: Element[]): import("@worktile/theia").CustomElement[];
3
+ export declare function fixBlockWithoutText(editor: Editor, path: Path): void;
4
+ export declare function fixBlockWithoutParagraph(editor: Editor, path: Path): void;
5
+ export declare function normalizeValue(editor: Editor, value: Descendant[]): void;
@@ -1,8 +0,0 @@
1
- import { THE_EDITOR_CONVERSION_HINT_REF } from '../utils/weak-maps';
2
- export const closeConversionHint = (editor) => {
3
- const hintRef = THE_EDITOR_CONVERSION_HINT_REF.get(editor);
4
- if (hintRef) {
5
- hintRef.close();
6
- }
7
- };
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvc2UtY29udmVyc2lvbi1oaW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3RyYW5zZm9ybXMvY2xvc2UtY29udmVyc2lvbi1oaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSw4QkFBOEIsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXBFLE1BQU0sQ0FBQyxNQUFNLG1CQUFtQixHQUFHLENBQUMsTUFBYyxFQUFFLEVBQUU7SUFDbEQsTUFBTSxPQUFPLEdBQUcsOEJBQThCLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQzNELElBQUksT0FBTyxFQUFFLENBQUM7UUFDVixPQUFPLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDcEIsQ0FBQztBQUNMLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEVkaXRvciB9IGZyb20gJ3NsYXRlJztcbmltcG9ydCB7IFRIRV9FRElUT1JfQ09OVkVSU0lPTl9ISU5UX1JFRiB9IGZyb20gJy4uL3V0aWxzL3dlYWstbWFwcyc7XG5cbmV4cG9ydCBjb25zdCBjbG9zZUNvbnZlcnNpb25IaW50ID0gKGVkaXRvcjogRWRpdG9yKSA9PiB7XG4gICAgY29uc3QgaGludFJlZiA9IFRIRV9FRElUT1JfQ09OVkVSU0lPTl9ISU5UX1JFRi5nZXQoZWRpdG9yKTtcbiAgICBpZiAoaGludFJlZikge1xuICAgICAgICBoaW50UmVmLmNsb3NlKCk7XG4gICAgfVxufTtcbiJdfQ==
@@ -1,2 +0,0 @@
1
- import { Editor } from 'slate';
2
- export declare const closeConversionHint: (editor: Editor) => void;