lakelib 0.2.6 → 0.3.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.
Files changed (125) hide show
  1. package/README.md +3 -3
  2. package/dist/lake.css +377 -363
  3. package/dist/lake.min.js +40 -40
  4. package/dist/lake.min.js.map +1 -1
  5. package/lib/css/index.d.ts +0 -11
  6. package/lib/i18n/en-US/index.d.ts +24 -0
  7. package/lib/i18n/ja/index.d.ts +24 -0
  8. package/lib/i18n/ko/index.d.ts +24 -0
  9. package/lib/i18n/types.d.ts +182 -2
  10. package/lib/i18n/zh-CN/index.d.ts +24 -0
  11. package/lib/index.d.ts +8 -8
  12. package/lib/lake.css +126 -112
  13. package/lib/lake.js +5674 -4655
  14. package/lib/lake.js.map +1 -1
  15. package/lib/managers/command.d.ts +4 -4
  16. package/lib/managers/selection.d.ts +6 -10
  17. package/lib/operations/insert-block.d.ts +3 -0
  18. package/lib/operations/insert-contents.d.ts +4 -0
  19. package/lib/operations/split-block.d.ts +1 -1
  20. package/lib/operations/split-marks.d.ts +1 -1
  21. package/lib/plugins/align.d.ts +1 -1
  22. package/lib/plugins/arrow-keys.d.ts +1 -1
  23. package/lib/plugins/backspace-key.d.ts +1 -1
  24. package/lib/plugins/block-quote.d.ts +1 -1
  25. package/lib/plugins/bold.d.ts +1 -1
  26. package/lib/plugins/code-block/code-block-box.d.ts +4 -0
  27. package/lib/plugins/code-block/index.d.ts +5 -0
  28. package/lib/plugins/code.d.ts +1 -1
  29. package/lib/plugins/copy.d.ts +1 -1
  30. package/lib/plugins/cut.d.ts +1 -1
  31. package/lib/plugins/delete-key.d.ts +1 -1
  32. package/lib/plugins/drop.d.ts +1 -1
  33. package/lib/plugins/emoji/emoji-box.d.ts +4 -0
  34. package/lib/plugins/emoji/index.d.ts +5 -0
  35. package/lib/plugins/enter-key.d.ts +1 -1
  36. package/lib/plugins/equation/equation-box.d.ts +4 -0
  37. package/lib/plugins/equation/index.d.ts +5 -0
  38. package/lib/plugins/escape-key.d.ts +1 -1
  39. package/lib/plugins/file/file-box.d.ts +4 -0
  40. package/lib/plugins/file/index.d.ts +5 -0
  41. package/lib/plugins/font-color.d.ts +1 -1
  42. package/lib/plugins/font-family.d.ts +1 -1
  43. package/lib/plugins/font-size.d.ts +1 -1
  44. package/lib/plugins/format-painter.d.ts +1 -1
  45. package/lib/plugins/heading.d.ts +1 -1
  46. package/lib/plugins/highlight.d.ts +1 -1
  47. package/lib/plugins/hr/hr-box.d.ts +4 -0
  48. package/lib/plugins/hr/index.d.ts +5 -0
  49. package/lib/{boxes/image.d.ts → plugins/image/image-box.d.ts} +2 -1
  50. package/lib/plugins/image/index.d.ts +5 -0
  51. package/lib/plugins/indent.d.ts +1 -1
  52. package/lib/plugins/italic.d.ts +1 -1
  53. package/lib/plugins/{link.d.ts → link/index.d.ts} +1 -1
  54. package/lib/plugins/link/insert-link.d.ts +3 -0
  55. package/lib/{ui → plugins/link}/link-popup.d.ts +3 -2
  56. package/lib/plugins/list.d.ts +1 -1
  57. package/lib/plugins/markdown.d.ts +1 -1
  58. package/lib/plugins/mention/index.d.ts +5 -0
  59. package/lib/plugins/mention/mention-box.d.ts +4 -0
  60. package/lib/{ui → plugins/mention}/mention-menu.d.ts +4 -3
  61. package/lib/plugins/paste.d.ts +1 -1
  62. package/lib/plugins/redo.d.ts +1 -1
  63. package/lib/plugins/remove-format.d.ts +1 -1
  64. package/lib/plugins/select-all.d.ts +1 -1
  65. package/lib/plugins/shift-enter-key.d.ts +1 -1
  66. package/lib/plugins/{mention.d.ts → slash/index.d.ts} +1 -1
  67. package/lib/{config → plugins/slash}/slash-items.d.ts +1 -1
  68. package/lib/{ui → plugins/slash}/slash-menu.d.ts +5 -4
  69. package/lib/{types/slash.d.ts → plugins/slash/types.d.ts} +2 -2
  70. package/lib/plugins/special-character.d.ts +1 -1
  71. package/lib/plugins/strikethrough.d.ts +1 -1
  72. package/lib/plugins/subscript.d.ts +1 -1
  73. package/lib/plugins/superscript.d.ts +1 -1
  74. package/lib/plugins/tab-key.d.ts +1 -1
  75. package/lib/plugins/table/delete-column.d.ts +2 -0
  76. package/lib/plugins/table/delete-row.d.ts +2 -0
  77. package/lib/plugins/table/delete-table.d.ts +2 -0
  78. package/lib/plugins/{slash.d.ts → table/index.d.ts} +2 -1
  79. package/lib/plugins/table/insert-column.d.ts +4 -0
  80. package/lib/plugins/table/insert-row.d.ts +4 -0
  81. package/lib/plugins/table/insert-table.d.ts +3 -0
  82. package/lib/plugins/table/merge-cells.d.ts +3 -0
  83. package/lib/plugins/table/split-cell.d.ts +3 -0
  84. package/lib/plugins/table/utils.d.ts +6 -0
  85. package/lib/plugins/underline.d.ts +1 -1
  86. package/lib/plugins/undo.d.ts +1 -1
  87. package/lib/plugins/unlink.d.ts +1 -1
  88. package/lib/plugins/video/index.d.ts +5 -0
  89. package/lib/plugins/video/video-box.d.ts +4 -0
  90. package/lib/storage/editors.d.ts +1 -1
  91. package/lib/types/dropdown.d.ts +1 -0
  92. package/lib/types/native.d.ts +0 -8
  93. package/lib/types/node.d.ts +12 -0
  94. package/lib/types/object.d.ts +0 -24
  95. package/lib/types/selection.d.ts +14 -0
  96. package/lib/types/toolbar.d.ts +5 -5
  97. package/lib/ui/toolbar.d.ts +2 -2
  98. package/lib/utils/indent-block.d.ts +2 -0
  99. package/lib/utils/remove-empty-marks.d.ts +2 -0
  100. package/lib/utils/unsafe-template.d.ts +1 -0
  101. package/lib/utils/visible-info.d.ts +10 -0
  102. package/package.json +14 -13
  103. package/lib/boxes/code-block.d.ts +0 -3
  104. package/lib/boxes/emoji.d.ts +0 -3
  105. package/lib/boxes/equation.d.ts +0 -3
  106. package/lib/boxes/file.d.ts +0 -3
  107. package/lib/boxes/hr.d.ts +0 -3
  108. package/lib/boxes/mention.d.ts +0 -3
  109. package/lib/boxes/video.d.ts +0 -3
  110. package/lib/operations/fix-list.d.ts +0 -2
  111. package/lib/operations/insert-fragment.d.ts +0 -3
  112. package/lib/operations/insert-link.d.ts +0 -3
  113. package/lib/operations/insert-node.d.ts +0 -3
  114. package/lib/plugins/code-block.d.ts +0 -3
  115. package/lib/plugins/emoji.d.ts +0 -3
  116. package/lib/plugins/equation.d.ts +0 -3
  117. package/lib/plugins/file.d.ts +0 -3
  118. package/lib/plugins/hr.d.ts +0 -3
  119. package/lib/plugins/image.d.ts +0 -3
  120. package/lib/plugins/video.d.ts +0 -3
  121. package/lib/utils/index.d.ts +0 -33
  122. package/lib/utils/is-visible.d.ts +0 -8
  123. package/lib/utils/safe-template.d.ts +0 -1
  124. package/lib/utils/set-block-indent.d.ts +0 -2
  125. /package/lib/{types/mention.d.ts → plugins/mention/types.d.ts} +0 -0
@@ -1,9 +1,9 @@
1
- import { AppliedItem } from '../types/object';
1
+ import { ActiveItem } from '../types/selection';
2
2
  import { Selection } from './selection';
3
3
  type CommmandItem = {
4
- isDisabled?: (AppliedItems: AppliedItem[]) => boolean;
5
- isSelected?: (appliedItems: AppliedItem[]) => boolean;
6
- selectedValues?: (AppliedItems: AppliedItem[]) => string[];
4
+ isDisabled?: (activeItems: ActiveItem[]) => boolean;
5
+ isSelected?: (activeItems: ActiveItem[]) => boolean;
6
+ selectedValues?: (activeItems: ActiveItem[]) => string[];
7
7
  execute: (...data: any[]) => void;
8
8
  };
9
9
  export declare class Command {
@@ -1,19 +1,17 @@
1
- import { AppliedItem } from '../types/object';
1
+ import { ActiveItem } from '../types/selection';
2
2
  import { Nodes } from '../models/nodes';
3
3
  import { Range } from '../models/range';
4
4
  import { Box } from '../models/box';
5
5
  import { insertBookmark } from '../operations/insert-bookmark';
6
6
  import { toBookmark } from '../operations/to-bookmark';
7
- import { insertNode } from '../operations/insert-node';
8
- import { insertFragment } from '../operations/insert-fragment';
7
+ import { insertContents } from '../operations/insert-contents';
9
8
  import { deleteContents } from '../operations/delete-contents';
10
9
  import { setBlocks } from '../operations/set-blocks';
11
10
  import { splitBlock } from '../operations/split-block';
11
+ import { insertBlock } from '../operations/insert-block';
12
12
  import { splitMarks } from '../operations/split-marks';
13
13
  import { addMark } from '../operations/add-mark';
14
14
  import { removeMark } from '../operations/remove-mark';
15
- import { fixList } from '../operations/fix-list';
16
- import { insertLink } from '../operations/insert-link';
17
15
  import { insertBox } from '../operations/insert-box';
18
16
  import { removeBox } from '../operations/remove-box';
19
17
  export declare class Selection {
@@ -25,19 +23,17 @@ export declare class Selection {
25
23
  sync(): void;
26
24
  updateByRange(): void;
27
25
  updateByBookmark(): void;
28
- getAppliedItems(): AppliedItem[];
26
+ getActiveItems(): ActiveItem[];
29
27
  insertBookmark(): ReturnType<typeof insertBookmark>;
30
28
  toBookmark(bookmark: Parameters<typeof toBookmark>[1]): ReturnType<typeof toBookmark>;
31
- insertNode(node: Parameters<typeof insertNode>[1]): ReturnType<typeof insertNode>;
32
- insertFragment(fragment: Parameters<typeof insertFragment>[1]): ReturnType<typeof insertFragment>;
29
+ insertContents(contents: Parameters<typeof insertContents>[1]): ReturnType<typeof insertContents>;
33
30
  deleteContents(): ReturnType<typeof deleteContents>;
34
31
  setBlocks(value: Parameters<typeof setBlocks>[1]): ReturnType<typeof setBlocks>;
35
32
  splitBlock(): ReturnType<typeof splitBlock>;
33
+ insertBlock(value: Parameters<typeof insertBlock>[1]): ReturnType<typeof insertBlock>;
36
34
  splitMarks(removeEmptyMark?: Parameters<typeof splitMarks>[1]): ReturnType<typeof splitMarks>;
37
35
  addMark(value: Parameters<typeof addMark>[1]): ReturnType<typeof addMark>;
38
36
  removeMark(value?: Parameters<typeof removeMark>[1]): ReturnType<typeof removeMark>;
39
- fixList(): ReturnType<typeof fixList>;
40
- insertLink(value: Parameters<typeof insertLink>[1]): ReturnType<typeof insertLink>;
41
37
  selectBox(box: Box | Nodes): void;
42
38
  insertBox(boxName: Parameters<typeof insertBox>[1], boxValue?: Parameters<typeof insertBox>[2]): Box;
43
39
  removeBox(box?: Box | Nodes | null): ReturnType<typeof removeBox>;
@@ -0,0 +1,3 @@
1
+ import { Nodes } from '../models/nodes';
2
+ import { Range } from '../models/range';
3
+ export declare function insertBlock(range: Range, value: string | Nodes): Nodes | null;
@@ -0,0 +1,4 @@
1
+ import { Nodes } from '../models/nodes';
2
+ import { Range } from '../models/range';
3
+ import { Fragment } from '../models/fragment';
4
+ export declare function insertContents(range: Range, contents: string | Node | DocumentFragment | Nodes | Fragment): void;
@@ -1,3 +1,3 @@
1
- import { TwoParts } from '../types/object';
1
+ import { TwoParts } from '../types/node';
2
2
  import { Range } from '../models/range';
3
3
  export declare function splitBlock(range: Range): TwoParts;
@@ -1,3 +1,3 @@
1
- import { ThreeParts } from '../types/object';
1
+ import { ThreeParts } from '../types/node';
2
2
  import { Range } from '../models/range';
3
3
  export declare function splitMarks(range: Range, removeEmptyMark?: boolean): ThreeParts;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,4 @@
1
+ import './code-block-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import codeBlockBox from './code-block-box';
3
+ export { codeBlockBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,4 @@
1
+ import './emoji-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import emojiBox from './emoji-box';
3
+ export { emojiBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,4 @@
1
+ import './equation-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import equationBox from './equation-box';
3
+ export { equationBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,4 @@
1
+ import './file-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import fileBox from './file-box';
3
+ export { fileBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,4 @@
1
+ import './hr-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import hrBox from './hr-box';
3
+ export { hrBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,4 +1,5 @@
1
+ import './image-box.css';
1
2
  import 'photoswipe/style.css';
2
- import { BoxComponent } from '../types/box';
3
+ import { BoxComponent } from 'lakelib/types/box';
3
4
  declare const _default: BoxComponent;
4
5
  export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import imageBox from './image-box';
3
+ export { imageBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import { type Editor } from '..';
1
+ import { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => (() => void) | undefined;
3
3
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { Nodes } from 'lakelib/models/nodes';
2
+ import { Range } from 'lakelib/models/range';
3
+ export declare function insertLink(range: Range, value: string | Nodes): Nodes | null;
@@ -1,5 +1,6 @@
1
- import { TranslationFunctions } from '../i18n/types';
2
- import { Nodes } from '../models/nodes';
1
+ import './link-popup.css';
2
+ import { TranslationFunctions } from 'lakelib/i18n/types';
3
+ import { Nodes } from 'lakelib/models/nodes';
3
4
  type LinkPopupConfig = {
4
5
  locale?: TranslationFunctions;
5
6
  onCopy?: (error: boolean) => void;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import mentionBox from './mention-box';
3
+ export { mentionBox, };
4
+ declare const _default: (editor: Editor) => (() => void) | undefined;
5
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import './mention-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -1,6 +1,7 @@
1
- import { MentionItem } from '../types/mention';
2
- import { Nodes } from '../models/nodes';
3
- import { Menu, MenuConfig } from './menu';
1
+ import './mention-menu.css';
2
+ import { Nodes } from 'lakelib/models/nodes';
3
+ import { Menu, MenuConfig } from 'lakelib/ui/menu';
4
+ import { MentionItem } from './types';
4
5
  type OnSelect = (event: Event, item: MentionItem) => void;
5
6
  type MentionMenuConfig = MenuConfig<MentionItem> & {
6
7
  onSelect?: OnSelect;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => (() => void) | undefined;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- import { SlashItem } from '../types/slash';
1
+ import { SlashItem } from './types';
2
2
  export declare const slashItems: SlashItem[];
@@ -1,7 +1,8 @@
1
- import { TranslationFunctions } from '../i18n/types';
2
- import { SlashItem } from '../types/slash';
3
- import { Nodes } from '../models/nodes';
4
- import { Menu, MenuConfig } from './menu';
1
+ import './slash-menu.css';
2
+ import { TranslationFunctions } from 'lakelib/i18n/types';
3
+ import { Nodes } from 'lakelib/models/nodes';
4
+ import { Menu, MenuConfig } from 'lakelib/ui/menu';
5
+ import { SlashItem } from './types';
5
6
  type OnSelect = (event: Event, item: SlashItem, fileNode?: Nodes) => void;
6
7
  type SlashMenuConfig = MenuConfig<string | SlashItem> & {
7
8
  locale?: TranslationFunctions;
@@ -1,5 +1,5 @@
1
- import type { Editor } from '../editor';
2
- import { TranslationFunctions } from '../i18n/types';
1
+ import type { Editor } from 'lakelib/editor';
2
+ import { TranslationFunctions } from 'lakelib/i18n/types';
3
3
  export type SlashButtonItem = {
4
4
  name: string;
5
5
  type: 'button';
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,2 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ export declare function deleteColumn(range: Range): void;
@@ -0,0 +1,2 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ export declare function deleteRow(range: Range): void;
@@ -0,0 +1,2 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ export declare function deleteTable(range: Range): void;
@@ -1,3 +1,4 @@
1
- import type { Editor } from '..';
1
+ import './table.css';
2
+ import { Editor } from 'lakelib/editor';
2
3
  declare const _default: (editor: Editor) => (() => void) | undefined;
3
4
  export default _default;
@@ -0,0 +1,4 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ type InsertColumnDirection = 'left' | 'right';
3
+ export declare function insertColumn(range: Range, direction: InsertColumnDirection): void;
4
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ type InsertRowDirection = 'up' | 'down';
3
+ export declare function insertRow(range: Range, direction: InsertRowDirection): void;
4
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Nodes } from 'lakelib/models/nodes';
2
+ import { Range } from 'lakelib/models/range';
3
+ export declare function insertTable(range: Range, rows: number, columns: number): Nodes;
@@ -0,0 +1,3 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ export type MergeDirection = 'up' | 'right' | 'down' | 'left';
3
+ export declare function mergeCells(range: Range, direction: MergeDirection): void;
@@ -0,0 +1,3 @@
1
+ import { Range } from 'lakelib/models/range';
2
+ export type SplitDirection = 'leftRight' | 'topBottom';
3
+ export declare function splitCell(range: Range, direction: SplitDirection): void;
@@ -0,0 +1,6 @@
1
+ type TableMap = HTMLTableCellElement[][];
2
+ export declare function getTableMap(table: HTMLTableElement): TableMap;
3
+ export declare function getColumnIndex(tableMap: TableMap, rowIndex: number, currentCell: HTMLTableCellElement): number;
4
+ export declare function getCellIndex(tableMap: TableMap, rowIndex: number, columnIndex: number): number;
5
+ export declare function isNormalColumn(tableMap: TableMap, columnIndex: number): boolean;
6
+ export {};
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from 'lakelib/editor';
2
2
  declare const _default: (editor: Editor) => void;
3
3
  export default _default;
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'lakelib/editor';
2
+ import videoBox from './video-box';
3
+ export { videoBox, };
4
+ declare const _default: (editor: Editor) => void;
5
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import './video-box.css';
2
+ import { BoxComponent } from 'lakelib/types/box';
3
+ declare const _default: BoxComponent;
4
+ export default _default;
@@ -1,2 +1,2 @@
1
- import type { Editor } from '..';
1
+ import type { Editor } from '../editor';
2
2
  export declare const editors: Map<number, Editor>;
@@ -19,4 +19,5 @@ export type DropdownItem = {
19
19
  menuItems: DropdownMenuItem[];
20
20
  menuWidth?: string;
21
21
  menuHeight?: string;
22
+ menuCheck?: boolean;
22
23
  };
@@ -1,10 +1,2 @@
1
1
  export type NativeRange = Range;
2
- export declare const NativeRange: {
3
- new (): Range;
4
- prototype: Range;
5
- readonly START_TO_START: 0;
6
- readonly START_TO_END: 1;
7
- readonly END_TO_END: 2;
8
- readonly END_TO_START: 3;
9
- };
10
2
  export type NativeSelection = Selection;
@@ -1 +1,13 @@
1
+ import type { Nodes } from '../models/nodes';
2
+ export type TwoParts = {
3
+ start: Nodes | null;
4
+ end: Nodes | null;
5
+ };
6
+ export type ThreeParts = TwoParts & {
7
+ center: Nodes | null;
8
+ };
9
+ export type Point = {
10
+ node: Nodes;
11
+ offset: number;
12
+ };
1
13
  export type NodePath = number[];
@@ -1,27 +1,3 @@
1
- import type { Nodes } from '../models/nodes';
2
1
  export type KeyValue = {
3
2
  [key: string]: string;
4
3
  };
5
- export type TwoParts = {
6
- start: Nodes | null;
7
- end: Nodes | null;
8
- };
9
- export type ThreeParts = TwoParts & {
10
- center: Nodes | null;
11
- };
12
- export type Point = {
13
- node: Nodes;
14
- offset: number;
15
- };
16
- export type AppliedItem = {
17
- node: Nodes;
18
- name: string;
19
- attributes: KeyValue;
20
- styles: KeyValue;
21
- };
22
- export type SelectionState = {
23
- appliedItems: AppliedItem[];
24
- disabledNameMap?: Map<string, boolean>;
25
- selectedNameMap?: Map<string, boolean>;
26
- selectedValuesMap?: Map<string, string[]>;
27
- };