lakelib 0.3.3 → 0.3.4

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 (173) hide show
  1. package/README.md +28 -22
  2. package/dist/lake.min.css +1 -1
  3. package/dist/lake.min.js +22 -22
  4. package/dist/lake.min.js.map +1 -1
  5. package/lib/lake.css +4 -1
  6. package/lib/lake.d.ts +2148 -0
  7. package/lib/lake.js +1211 -602
  8. package/lib/lake.js.map +1 -1
  9. package/package.json +30 -33
  10. package/lib/config/element-rules.d.ts +0 -1
  11. package/lib/config/menu-items.d.ts +0 -9
  12. package/lib/config/tag-names.d.ts +0 -6
  13. package/lib/config/toolbar-items.d.ts +0 -2
  14. package/lib/css/index.d.ts +0 -17
  15. package/lib/editor.d.ts +0 -93
  16. package/lib/elements/bookmark.d.ts +0 -2
  17. package/lib/elements/box.d.ts +0 -2
  18. package/lib/i18n/en-US/index.d.ts +0 -169
  19. package/lib/i18n/index.d.ts +0 -2
  20. package/lib/i18n/ja/index.d.ts +0 -169
  21. package/lib/i18n/ko/index.d.ts +0 -169
  22. package/lib/i18n/types.d.ts +0 -1233
  23. package/lib/i18n/zh-CN/index.d.ts +0 -169
  24. package/lib/icons/index.d.ts +0 -1
  25. package/lib/index.d.ts +0 -35
  26. package/lib/managers/box-manager.d.ts +0 -6
  27. package/lib/managers/command.d.ts +0 -23
  28. package/lib/managers/history.d.ts +0 -32
  29. package/lib/managers/keystroke.d.ts +0 -11
  30. package/lib/managers/plugin.d.ts +0 -7
  31. package/lib/managers/selection.d.ts +0 -40
  32. package/lib/models/box.d.ts +0 -25
  33. package/lib/models/fragment.d.ts +0 -8
  34. package/lib/models/nodes.d.ts +0 -98
  35. package/lib/models/range.d.ts +0 -56
  36. package/lib/operations/add-mark.d.ts +0 -3
  37. package/lib/operations/delete-contents.d.ts +0 -2
  38. package/lib/operations/insert-block.d.ts +0 -3
  39. package/lib/operations/insert-bookmark.d.ts +0 -6
  40. package/lib/operations/insert-box.d.ts +0 -4
  41. package/lib/operations/insert-contents.d.ts +0 -4
  42. package/lib/operations/remove-box.d.ts +0 -3
  43. package/lib/operations/remove-mark.d.ts +0 -2
  44. package/lib/operations/set-blocks.d.ts +0 -3
  45. package/lib/operations/split-block.d.ts +0 -3
  46. package/lib/operations/split-marks.d.ts +0 -3
  47. package/lib/operations/to-bookmark.d.ts +0 -6
  48. package/lib/parsers/html-parser.d.ts +0 -13
  49. package/lib/parsers/text-parser.d.ts +0 -6
  50. package/lib/plugins/align.d.ts +0 -3
  51. package/lib/plugins/arrow-keys.d.ts +0 -3
  52. package/lib/plugins/backspace-key.d.ts +0 -3
  53. package/lib/plugins/block-quote.d.ts +0 -3
  54. package/lib/plugins/bold.d.ts +0 -3
  55. package/lib/plugins/code-block/code-block-box.d.ts +0 -4
  56. package/lib/plugins/code-block/index.d.ts +0 -5
  57. package/lib/plugins/code.d.ts +0 -3
  58. package/lib/plugins/copy.d.ts +0 -3
  59. package/lib/plugins/cut.d.ts +0 -3
  60. package/lib/plugins/delete-key.d.ts +0 -3
  61. package/lib/plugins/drop.d.ts +0 -3
  62. package/lib/plugins/emoji/emoji-box.d.ts +0 -4
  63. package/lib/plugins/emoji/index.d.ts +0 -5
  64. package/lib/plugins/enter-key.d.ts +0 -3
  65. package/lib/plugins/equation/equation-box.d.ts +0 -4
  66. package/lib/plugins/equation/index.d.ts +0 -5
  67. package/lib/plugins/escape-key.d.ts +0 -3
  68. package/lib/plugins/file/file-box.d.ts +0 -4
  69. package/lib/plugins/file/index.d.ts +0 -5
  70. package/lib/plugins/font-color.d.ts +0 -3
  71. package/lib/plugins/font-family.d.ts +0 -3
  72. package/lib/plugins/font-size.d.ts +0 -3
  73. package/lib/plugins/format-painter.d.ts +0 -3
  74. package/lib/plugins/heading.d.ts +0 -3
  75. package/lib/plugins/highlight.d.ts +0 -3
  76. package/lib/plugins/hr/hr-box.d.ts +0 -4
  77. package/lib/plugins/hr/index.d.ts +0 -5
  78. package/lib/plugins/image/image-box.d.ts +0 -5
  79. package/lib/plugins/image/index.d.ts +0 -5
  80. package/lib/plugins/indent.d.ts +0 -3
  81. package/lib/plugins/italic.d.ts +0 -3
  82. package/lib/plugins/link/index.d.ts +0 -3
  83. package/lib/plugins/link/insert-link.d.ts +0 -3
  84. package/lib/plugins/link/link-popup.d.ts +0 -32
  85. package/lib/plugins/list.d.ts +0 -3
  86. package/lib/plugins/markdown.d.ts +0 -3
  87. package/lib/plugins/mention/index.d.ts +0 -5
  88. package/lib/plugins/mention/mention-box.d.ts +0 -4
  89. package/lib/plugins/mention/mention-menu.d.ts +0 -15
  90. package/lib/plugins/mention/types.d.ts +0 -6
  91. package/lib/plugins/paste.d.ts +0 -3
  92. package/lib/plugins/redo.d.ts +0 -3
  93. package/lib/plugins/remove-format.d.ts +0 -3
  94. package/lib/plugins/select-all.d.ts +0 -3
  95. package/lib/plugins/shift-enter-key.d.ts +0 -3
  96. package/lib/plugins/slash/index.d.ts +0 -3
  97. package/lib/plugins/slash/slash-items.d.ts +0 -2
  98. package/lib/plugins/slash/slash-menu.d.ts +0 -19
  99. package/lib/plugins/slash/types.d.ts +0 -20
  100. package/lib/plugins/special-character.d.ts +0 -3
  101. package/lib/plugins/strikethrough.d.ts +0 -3
  102. package/lib/plugins/subscript.d.ts +0 -3
  103. package/lib/plugins/superscript.d.ts +0 -3
  104. package/lib/plugins/tab-key.d.ts +0 -3
  105. package/lib/plugins/table/delete-column.d.ts +0 -2
  106. package/lib/plugins/table/delete-row.d.ts +0 -2
  107. package/lib/plugins/table/delete-table.d.ts +0 -2
  108. package/lib/plugins/table/index.d.ts +0 -4
  109. package/lib/plugins/table/insert-column.d.ts +0 -4
  110. package/lib/plugins/table/insert-row.d.ts +0 -4
  111. package/lib/plugins/table/insert-table.d.ts +0 -3
  112. package/lib/plugins/table/merge-cells.d.ts +0 -3
  113. package/lib/plugins/table/split-cell.d.ts +0 -3
  114. package/lib/plugins/table/utils.d.ts +0 -6
  115. package/lib/plugins/underline.d.ts +0 -3
  116. package/lib/plugins/undo.d.ts +0 -3
  117. package/lib/plugins/unlink.d.ts +0 -3
  118. package/lib/plugins/video/index.d.ts +0 -5
  119. package/lib/plugins/video/video-box.d.ts +0 -4
  120. package/lib/storage/box-instances.d.ts +0 -2
  121. package/lib/storage/boxes.d.ts +0 -2
  122. package/lib/storage/editors.d.ts +0 -2
  123. package/lib/types/box.d.ts +0 -15
  124. package/lib/types/corner-toolbar.d.ts +0 -7
  125. package/lib/types/dropdown.d.ts +0 -23
  126. package/lib/types/native.d.ts +0 -2
  127. package/lib/types/node.d.ts +0 -13
  128. package/lib/types/object.d.ts +0 -3
  129. package/lib/types/plugin.d.ts +0 -3
  130. package/lib/types/request.d.ts +0 -20
  131. package/lib/types/selection.d.ts +0 -14
  132. package/lib/types/toolbar.d.ts +0 -29
  133. package/lib/ui/button.d.ts +0 -19
  134. package/lib/ui/corner-toolbar.d.ts +0 -18
  135. package/lib/ui/dropdown.d.ts +0 -36
  136. package/lib/ui/floating-toolbar.d.ts +0 -16
  137. package/lib/ui/menu.d.ts +0 -33
  138. package/lib/ui/resizer.d.ts +0 -17
  139. package/lib/ui/toolbar.d.ts +0 -29
  140. package/lib/utils/append-break.d.ts +0 -2
  141. package/lib/utils/camel-case.d.ts +0 -1
  142. package/lib/utils/change-tag-name.d.ts +0 -2
  143. package/lib/utils/debug.d.ts +0 -1
  144. package/lib/utils/denormalize-value.d.ts +0 -1
  145. package/lib/utils/encode.d.ts +0 -1
  146. package/lib/utils/file-size.d.ts +0 -1
  147. package/lib/utils/fix-numbered-list.d.ts +0 -2
  148. package/lib/utils/from-base64.d.ts +0 -1
  149. package/lib/utils/get-box.d.ts +0 -3
  150. package/lib/utils/get-css.d.ts +0 -1
  151. package/lib/utils/get-deep-element.d.ts +0 -2
  152. package/lib/utils/in-string.d.ts +0 -1
  153. package/lib/utils/indent-block.d.ts +0 -2
  154. package/lib/utils/merge-nodes.d.ts +0 -5
  155. package/lib/utils/modifier-text.d.ts +0 -1
  156. package/lib/utils/morph.d.ts +0 -56
  157. package/lib/utils/normalize-value.d.ts +0 -1
  158. package/lib/utils/parse-style.d.ts +0 -2
  159. package/lib/utils/query.d.ts +0 -2
  160. package/lib/utils/remove-break.d.ts +0 -2
  161. package/lib/utils/remove-empty-marks.d.ts +0 -2
  162. package/lib/utils/remove-zws.d.ts +0 -2
  163. package/lib/utils/request.d.ts +0 -27
  164. package/lib/utils/scroll-to-node.d.ts +0 -2
  165. package/lib/utils/split-nodes.d.ts +0 -5
  166. package/lib/utils/template.d.ts +0 -1
  167. package/lib/utils/to-base64.d.ts +0 -1
  168. package/lib/utils/to-hex.d.ts +0 -1
  169. package/lib/utils/to-node-list.d.ts +0 -1
  170. package/lib/utils/unsafe-template.d.ts +0 -1
  171. package/lib/utils/upload-file.d.ts +0 -11
  172. package/lib/utils/visible-info.d.ts +0 -10
  173. package/lib/utils/wrap-node-list.d.ts +0 -2
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import './emoji-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,5 +0,0 @@
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 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import './equation-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,5 +0,0 @@
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 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import './file-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,5 +0,0 @@
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 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import './hr-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,5 +0,0 @@
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,5 +0,0 @@
1
- import './image-box.css';
2
- import 'photoswipe/style.css';
3
- import { BoxComponent } from 'lakelib/types/box';
4
- declare const _default: BoxComponent;
5
- export default _default;
@@ -1,5 +0,0 @@
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 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => (() => void) | undefined;
3
- export default _default;
@@ -1,3 +0,0 @@
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,32 +0,0 @@
1
- import './link-popup.css';
2
- import { TranslationFunctions } from 'lakelib/i18n/types';
3
- import { Nodes } from 'lakelib/models/nodes';
4
- type LinkPopupConfig = {
5
- locale?: TranslationFunctions;
6
- onCopy?: (error: boolean) => void;
7
- onSave?: (node: Nodes) => void;
8
- onRemove?: (node: Nodes) => void;
9
- onShow?: () => void;
10
- onHide?: () => void;
11
- };
12
- export declare class LinkPopup {
13
- private config;
14
- private locale;
15
- private linkNode;
16
- container: Nodes;
17
- constructor(config?: LinkPopupConfig);
18
- private writeClipboardText;
19
- private appendCopyButton;
20
- private appendOpenButton;
21
- private appendSaveButton;
22
- private appendUnlinkButton;
23
- private save;
24
- private scrollListener;
25
- private resizeListener;
26
- private updatePosition;
27
- get visible(): boolean;
28
- show(linkNode: Nodes): void;
29
- hide(): void;
30
- unmount(): void;
31
- }
32
- export {};
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,5 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- import './mention-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,15 +0,0 @@
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';
5
- type OnSelect = (event: Event, item: MentionItem) => void;
6
- type MentionMenuConfig = MenuConfig<MentionItem> & {
7
- onSelect?: OnSelect;
8
- };
9
- export declare class MentionMenu extends Menu<MentionItem> {
10
- private onSelect;
11
- constructor(config: MentionMenuConfig);
12
- protected getItemNode(item: MentionItem): Nodes;
13
- protected search(keyword: string): MentionItem[];
14
- }
15
- export {};
@@ -1,6 +0,0 @@
1
- export type MentionItem = {
2
- id: string;
3
- name: string;
4
- nickname?: string;
5
- avatar?: string;
6
- };
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => (() => void) | undefined;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import { SlashItem } from './types';
2
- export declare const slashItems: SlashItem[];
@@ -1,19 +0,0 @@
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';
6
- type OnSelect = (event: Event, item: SlashItem, fileNode?: Nodes) => void;
7
- type SlashMenuConfig = MenuConfig<string | SlashItem> & {
8
- locale?: TranslationFunctions;
9
- onSelect?: OnSelect;
10
- };
11
- export declare class SlashMenu extends Menu<string | SlashItem> {
12
- private locale;
13
- private onSelect;
14
- constructor(config: SlashMenuConfig);
15
- private getItem;
16
- protected getItemNode(name: string | SlashItem): Nodes;
17
- protected search(keyword: string): (string | SlashItem)[];
18
- }
19
- export {};
@@ -1,20 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- import { TranslationFunctions } from 'lakelib/i18n/types';
3
- export type SlashButtonItem = {
4
- name: string;
5
- type: 'button';
6
- icon?: string;
7
- title: string | ((locale: TranslationFunctions) => string);
8
- description: string | ((locale: TranslationFunctions) => string);
9
- onClick: (editor: Editor, value: string) => void;
10
- };
11
- export type SlashUploadItem = {
12
- name: string;
13
- type: 'upload';
14
- icon?: string;
15
- title: string | ((locale: TranslationFunctions) => string);
16
- description: string | ((locale: TranslationFunctions) => string);
17
- accept?: string;
18
- multiple?: boolean;
19
- };
20
- export type SlashItem = SlashButtonItem | SlashUploadItem;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- export declare function deleteColumn(range: Range): void;
@@ -1,2 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- export declare function deleteRow(range: Range): void;
@@ -1,2 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- export declare function deleteTable(range: Range): void;
@@ -1,4 +0,0 @@
1
- import './table.css';
2
- import { Editor } from 'lakelib/editor';
3
- declare const _default: (editor: Editor) => (() => void) | undefined;
4
- export default _default;
@@ -1,4 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- type InsertColumnDirection = 'left' | 'right';
3
- export declare function insertColumn(range: Range, direction: InsertColumnDirection): void;
4
- export {};
@@ -1,4 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- type InsertRowDirection = 'up' | 'down';
3
- export declare function insertRow(range: Range, direction: InsertRowDirection): void;
4
- export {};
@@ -1,3 +0,0 @@
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;
@@ -1,3 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import { Range } from 'lakelib/models/range';
2
- export type SplitDirection = 'leftRight' | 'topBottom';
3
- export declare function splitCell(range: Range, direction: SplitDirection): void;
@@ -1,6 +0,0 @@
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 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { Editor } from 'lakelib/editor';
2
- declare const _default: (editor: Editor) => void;
3
- export default _default;
@@ -1,5 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- import './video-box.css';
2
- import { BoxComponent } from 'lakelib/types/box';
3
- declare const _default: BoxComponent;
4
- export default _default;
@@ -1,2 +0,0 @@
1
- import type { Box } from '../models/box';
2
- export declare function getInstanceMap(id: number): Map<number, Box>;
@@ -1,2 +0,0 @@
1
- import type { BoxComponent } from '../types/box';
2
- export declare const boxes: Map<string, BoxComponent>;
@@ -1,2 +0,0 @@
1
- import type { Editor } from '../editor';
2
- export declare const editors: Map<number, Editor>;
@@ -1,15 +0,0 @@
1
- import type { Nodes } from '../models/nodes';
2
- import type { Box } from '../models/box';
3
- export type BoxType = 'inline' | 'block';
4
- export type BoxValue = {
5
- [key: string]: any;
6
- };
7
- export type BoxRender = (box: Box) => Nodes | string | void;
8
- export type BoxHTML = (box: Box) => string;
9
- export type BoxComponent = {
10
- type: BoxType;
11
- name: string;
12
- value?: BoxValue;
13
- render: BoxRender;
14
- html?: BoxHTML;
15
- };
@@ -1,7 +0,0 @@
1
- import { TranslationFunctions } from '../i18n/types';
2
- export type CornerToolbarItem = {
3
- name: string;
4
- icon?: string;
5
- tooltip: string | ((locale: TranslationFunctions) => string);
6
- onClick: (event: Event) => void;
7
- };
@@ -1,23 +0,0 @@
1
- import { TranslationFunctions } from '../i18n/types';
2
- export type DropdownLocation = 'local' | 'global';
3
- export type DropdownDirection = 'top' | 'bottom' | 'auto';
4
- export type DropdownMenuType = 'list' | 'icon' | 'character' | 'color';
5
- export type DropdownMenuItem = {
6
- value: string;
7
- icon?: string;
8
- text: string | ((locale: TranslationFunctions) => string);
9
- };
10
- export type DropdownItem = {
11
- name: string;
12
- icon?: string;
13
- accentIcon?: string;
14
- downIcon?: string;
15
- defaultValue?: string;
16
- tooltip: string | ((locale: TranslationFunctions) => string);
17
- width?: string;
18
- menuType: DropdownMenuType;
19
- menuItems: DropdownMenuItem[];
20
- menuWidth?: string;
21
- menuHeight?: string;
22
- menuCheck?: boolean;
23
- };
@@ -1,2 +0,0 @@
1
- export type NativeRange = Range;
2
- export type NativeSelection = Selection;
@@ -1,13 +0,0 @@
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
- };
13
- export type NodePath = number[];
@@ -1,3 +0,0 @@
1
- export type KeyValue = {
2
- [key: string]: string;
3
- };
@@ -1,3 +0,0 @@
1
- import type { Editor } from '../editor';
2
- export type UnmountPlugin = () => void;
3
- export type InitializePlugin = (editor: Editor) => UnmountPlugin | void;
@@ -1,20 +0,0 @@
1
- export type BeforeUploadFileType = File | Blob | boolean | string;
2
- export type UploadRequestMethod = 'GET' | 'POST' | 'PUT' | 'PATCH';
3
- export type UploadRequestHeader = Record<string, string>;
4
- export interface UploadRequestError extends Error {
5
- status?: number;
6
- method?: UploadRequestMethod;
7
- url?: string;
8
- }
9
- export interface UploadRequestOption<T = any> {
10
- method: UploadRequestMethod;
11
- action: string;
12
- file?: Exclude<BeforeUploadFileType, File | boolean> | File;
13
- onSuccess?: (body: T, xhr?: XMLHttpRequest) => void;
14
- onProgress?: (event: ProgressEvent) => void;
15
- onError?: (event: UploadRequestError | ProgressEvent, body?: T) => void;
16
- data?: Record<string, unknown>;
17
- filename?: string;
18
- withCredentials?: boolean;
19
- headers?: UploadRequestHeader;
20
- }
@@ -1,14 +0,0 @@
1
- import { KeyValue } from './object';
2
- import type { Nodes } from '../models/nodes';
3
- export type ActiveItem = {
4
- node: Nodes;
5
- name: string;
6
- attributes: KeyValue;
7
- styles: KeyValue;
8
- };
9
- export type SelectionState = {
10
- activeItems: ActiveItem[];
11
- disabledNameMap?: Map<string, boolean>;
12
- selectedNameMap?: Map<string, boolean>;
13
- selectedValuesMap?: Map<string, string[]>;
14
- };
@@ -1,29 +0,0 @@
1
- import type { Editor } from '../editor';
2
- import { TranslationFunctions } from '../i18n/types';
3
- import { DropdownItem } from './dropdown';
4
- import { ActiveItem } from './selection';
5
- export type ToolbarButtonItem = {
6
- name: string;
7
- type: 'button';
8
- icon?: string;
9
- tooltip: string | ((locale: TranslationFunctions) => string);
10
- isSelected?: (activeItems: ActiveItem[]) => boolean;
11
- isDisabled?: (activeItems: ActiveItem[]) => boolean;
12
- onClick: (editor: Editor, value: string) => void;
13
- };
14
- export type ToolbarDropdownItem = DropdownItem & {
15
- name: string;
16
- type: 'dropdown';
17
- selectedValues?: (activeItems: ActiveItem[]) => string[];
18
- isDisabled?: (activeItems: ActiveItem[]) => boolean;
19
- onSelect: (editor: Editor, value: string) => void;
20
- };
21
- export type ToolbarUploadItem = {
22
- name: string;
23
- type: 'upload';
24
- icon?: string;
25
- tooltip: string | ((locale: TranslationFunctions) => string);
26
- accept?: string;
27
- multiple?: boolean;
28
- };
29
- export type ToolbarItem = ToolbarButtonItem | ToolbarDropdownItem | ToolbarUploadItem;
@@ -1,19 +0,0 @@
1
- import { Nodes } from '../models/nodes';
2
- type ButtonConfig = {
3
- root: Nodes;
4
- name: string;
5
- type?: 'primary' | 'default';
6
- icon?: string;
7
- text?: string;
8
- tooltip?: string;
9
- tabIndex?: number;
10
- onClick: () => void;
11
- };
12
- export declare class Button {
13
- private readonly config;
14
- private readonly root;
15
- readonly node: Nodes;
16
- constructor(config: ButtonConfig);
17
- render(): void;
18
- }
19
- export {};
@@ -1,18 +0,0 @@
1
- import { TranslationFunctions } from '../i18n/types';
2
- import { CornerToolbarItem } from '../types/corner-toolbar';
3
- import { Nodes } from '../models/nodes';
4
- type CornerToolbarConfig = {
5
- locale?: TranslationFunctions;
6
- root: Nodes;
7
- items: CornerToolbarItem[];
8
- };
9
- export declare class CornerToolbar {
10
- private config;
11
- private locale;
12
- private root;
13
- container: Nodes;
14
- constructor(config: CornerToolbarConfig);
15
- private appendButton;
16
- render(): void;
17
- }
18
- export {};