lakelib 0.1.21 → 0.1.23

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 (41) hide show
  1. package/README.md +4 -4
  2. package/dist/lake.css +45 -36
  3. package/dist/lake.min.js +37 -29
  4. package/dist/lake.min.js.map +1 -1
  5. package/lib/lake.css +45 -36
  6. package/lib/lake.js +989 -299
  7. package/lib/lake.js.map +1 -1
  8. package/lib/types/boxes/code-block.d.ts +2 -1
  9. package/lib/types/boxes/emoji.d.ts +2 -1
  10. package/lib/types/boxes/equation.d.ts +2 -1
  11. package/lib/types/boxes/file.d.ts +2 -1
  12. package/lib/types/boxes/hr.d.ts +2 -1
  13. package/lib/types/boxes/image.d.ts +2 -1
  14. package/lib/types/boxes/video.d.ts +2 -1
  15. package/lib/types/config/slash-items.d.ts +2 -0
  16. package/lib/types/css/index.d.ts +1 -1
  17. package/lib/types/editor.d.ts +3 -0
  18. package/lib/types/i18n/en-US/index.d.ts +36 -0
  19. package/lib/types/i18n/ja/index.d.ts +36 -0
  20. package/lib/types/i18n/ko/index.d.ts +36 -0
  21. package/lib/types/i18n/types.d.ts +278 -2
  22. package/lib/types/i18n/zh-CN/index.d.ts +36 -0
  23. package/lib/types/index.d.ts +3 -2
  24. package/lib/types/managers/keystroke.d.ts +0 -1
  25. package/lib/types/managers/plugin.d.ts +4 -5
  26. package/lib/types/managers/selection.d.ts +1 -1
  27. package/lib/types/models/box.d.ts +1 -1
  28. package/lib/types/models/nodes.d.ts +2 -0
  29. package/lib/types/plugins/slash.d.ts +3 -0
  30. package/lib/types/types/plugin.d.ts +3 -0
  31. package/lib/types/types/{commands.d.ts → slash.d.ts} +4 -4
  32. package/lib/types/ui/box-toolbar.d.ts +2 -1
  33. package/lib/types/ui/dropdown.d.ts +1 -0
  34. package/lib/types/ui/link-popup.d.ts +2 -3
  35. package/lib/types/ui/slash-popup.d.ts +34 -0
  36. package/lib/types/ui/toolbar.d.ts +5 -3
  37. package/lib/types/utils/index.d.ts +2 -1
  38. package/lib/types/utils/{node-and-view.d.ts → node-position.d.ts} +1 -1
  39. package/lib/types/utils/scroll-to-node.d.ts +2 -0
  40. package/package.json +1 -1
  41. package/lib/types/ui/commands-popup.d.ts +0 -24
@@ -21,6 +21,7 @@ export declare class Dropdown {
21
21
  private apppendMenuItems;
22
22
  private documentClickListener;
23
23
  private showMenu;
24
+ private hideMenu;
24
25
  private bindEvents;
25
26
  render(): void;
26
27
  unmount(): void;
@@ -19,10 +19,9 @@ export declare class LinkPopup {
19
19
  private appendOpenButton;
20
20
  private appendSaveButton;
21
21
  private appendUnlinkButton;
22
- getInputValue(name: string): string;
23
- setInputValue(name: string, value: string): void;
22
+ get visible(): boolean;
24
23
  save(): void;
25
- updatePosition(): void;
24
+ position(): void;
26
25
  render(): void;
27
26
  show(linkNode: Nodes): void;
28
27
  hide(): void;
@@ -0,0 +1,34 @@
1
+ import type { Editor } from '../editor';
2
+ import { SlashItem } from '../types/slash';
3
+ import { Nodes } from '../models/nodes';
4
+ import { Range } from '../models/range';
5
+ type SlashPopupConfig = {
6
+ editor: Editor;
7
+ items: (string | SlashItem)[];
8
+ };
9
+ export declare class SlashPopup {
10
+ private editor;
11
+ private items;
12
+ private root;
13
+ private range;
14
+ private noMouseEvent;
15
+ private keyword;
16
+ container: Nodes;
17
+ constructor(config: SlashPopupConfig);
18
+ private getItem;
19
+ private emptyBlock;
20
+ private appendItem;
21
+ private keydownListener;
22
+ private clickListener;
23
+ private scrollListener;
24
+ private resizeListener;
25
+ get visible(): boolean;
26
+ search(keyword: string): (string | SlashItem)[];
27
+ position(): void;
28
+ render(): void;
29
+ update(keyword?: string | null): void;
30
+ show(range: Range, keyword?: string): void;
31
+ hide(): void;
32
+ unmount(): void;
33
+ }
34
+ export {};
@@ -9,19 +9,21 @@ type ToolbarConfig = {
9
9
  placement?: ToolbarPlacement;
10
10
  };
11
11
  export declare class Toolbar {
12
- private root;
12
+ root: Nodes;
13
13
  private items;
14
14
  private placement;
15
15
  private allMenuMap;
16
16
  private buttonItemList;
17
17
  private dropdownItemList;
18
+ private dropdownList;
18
19
  container: Nodes;
19
20
  constructor(config: ToolbarConfig);
20
21
  private appendDivider;
21
- private appendButton;
22
+ private appendNormalButton;
22
23
  private appendDropdown;
23
- private appendUpload;
24
+ private appendUploadButton;
24
25
  updateState(state: SelectionState): void;
25
26
  render(editor: Editor): void;
27
+ unmount(): void;
26
28
  }
27
29
  export {};
@@ -25,7 +25,8 @@ export * from './append-break';
25
25
  export * from './remove-break';
26
26
  export * from './set-block-indent';
27
27
  export * from './morph';
28
- export * from './node-and-view';
28
+ export * from './node-position';
29
+ export * from './scroll-to-node';
29
30
  export * from './get-box';
30
31
  export * from './request';
31
32
  export * from './upload-file';
@@ -5,5 +5,5 @@ type NodePosition = {
5
5
  top: number;
6
6
  bottom: number;
7
7
  };
8
- export declare function nodeAndView(node: Nodes): NodePosition;
8
+ export declare function nodePosition(node: Nodes): NodePosition;
9
9
  export {};
@@ -0,0 +1,2 @@
1
+ import { Nodes } from '../models/nodes';
2
+ export declare function scrollToNode(node: Nodes, options?: ScrollIntoViewOptions): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakelib",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Rich text editor based on the browser",
5
5
  "keywords": [
6
6
  "rich text",
@@ -1,24 +0,0 @@
1
- import type { Editor } from '../editor';
2
- import { TranslationFunctions } from '../i18n/types';
3
- import { CommandItem } from '../types/commands';
4
- import { Nodes } from '../models/nodes';
5
- import { Range } from '../models/range';
6
- type CommandsPopupConfig = {
7
- editor: Editor;
8
- locale?: TranslationFunctions;
9
- items?: (string | CommandItem)[];
10
- };
11
- export declare class CommandsPopup {
12
- private editor;
13
- private items;
14
- private root;
15
- private range;
16
- container: Nodes;
17
- constructor(config: CommandsPopupConfig);
18
- private appendButton;
19
- updatePosition(): void;
20
- render(): void;
21
- show(range: Range): void;
22
- hide(): void;
23
- }
24
- export {};