lakelib 0.1.5 → 0.1.7

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.
@@ -17,6 +17,7 @@ type Config = {
17
17
  readonly: boolean;
18
18
  spellcheck: boolean;
19
19
  tabIndex: number;
20
+ placeholder: string;
20
21
  indentWithTab: boolean;
21
22
  lang: string;
22
23
  minChangeSize: number;
@@ -29,6 +30,7 @@ type EditorConfig = {
29
30
  readonly?: boolean;
30
31
  spellcheck?: boolean;
31
32
  tabIndex?: number;
33
+ placeholder?: string;
32
34
  indentWithTab?: boolean;
33
35
  lang?: string;
34
36
  minChangeSize?: number;
@@ -63,6 +65,7 @@ export declare class Editor {
63
65
  private updateBoxSelectionStyle;
64
66
  private emitStateChangeEvent;
65
67
  private emitChangeEvent;
68
+ private togglePlaceholderClass;
66
69
  private inputInBoxStrip;
67
70
  private bindInputEvents;
68
71
  private bindHistoryEvents;
@@ -1,5 +1,5 @@
1
1
  import { Nodes } from '../models/nodes';
2
- export type ButtonConfig = {
2
+ type ButtonConfig = {
3
3
  root: Nodes;
4
4
  name: string;
5
5
  icon?: string;
@@ -15,3 +15,4 @@ export declare class Button {
15
15
  constructor(config: ButtonConfig);
16
16
  render(): void;
17
17
  }
18
+ export {};
@@ -1,10 +1,11 @@
1
1
  import { TranslationFunctions } from '../i18n/types';
2
2
  import { DropdownItem, DropdownMenuItem } from '../types/dropdown';
3
3
  import { Nodes } from '../models/nodes';
4
- export type DropdownConfig = DropdownItem & {
4
+ type DropdownConfig = DropdownItem & {
5
5
  root: Nodes;
6
6
  locale?: TranslationFunctions;
7
7
  tabIndex?: number;
8
+ placement?: 'top' | 'bottom';
8
9
  onSelect: (value: string) => void;
9
10
  };
10
11
  export declare class Dropdown {
@@ -24,3 +25,4 @@ export declare class Dropdown {
24
25
  render(): void;
25
26
  unmount(): void;
26
27
  }
28
+ export {};
@@ -1,16 +1,18 @@
1
- import EventEmitter from 'eventemitter3';
2
1
  import { TranslationFunctions } from '../i18n/types';
3
2
  import { Nodes } from '../models/nodes';
4
3
  type LinkPopupConfig = {
5
4
  root: Nodes;
6
5
  locale?: TranslationFunctions;
6
+ onCopy?: (error: boolean) => void;
7
+ onSave?: (node: Nodes) => void;
8
+ onRemove?: (node: Nodes) => void;
7
9
  };
8
10
  export declare class LinkPopup {
9
- private linkNode;
11
+ private config;
10
12
  private root;
11
13
  private locale;
14
+ private linkNode;
12
15
  container: Nodes;
13
- event: EventEmitter;
14
16
  constructor(config: LinkPopupConfig);
15
17
  private writeClipboardText;
16
18
  private appendCopyButton;
@@ -3,13 +3,16 @@ import { NativeNode } from '../types/native';
3
3
  import { SelectionState } from '../types/object';
4
4
  import { ToolbarItem } from '../types/toolbar';
5
5
  import { Nodes } from '../models/nodes';
6
+ type ToolbarPlacement = 'top' | 'bottom';
6
7
  type ToolbarConfig = {
7
8
  root: string | Nodes | NativeNode;
8
9
  items?: (string | ToolbarItem)[];
10
+ placement?: ToolbarPlacement;
9
11
  };
10
12
  export declare class Toolbar {
11
- private items;
12
13
  private root;
14
+ private items;
15
+ private placement;
13
16
  private allMenuMap;
14
17
  private buttonItemList;
15
18
  private dropdownItemList;
@@ -1,10 +1,10 @@
1
1
  import type { Editor } from '../editor';
2
2
  import { Box } from '../models/box';
3
- type Config = {
3
+ type UploadConfig = {
4
4
  editor: Editor;
5
5
  file: File;
6
6
  onError?: () => void;
7
7
  onSuccess?: () => void;
8
8
  };
9
- export declare function uploadImage(config: Config): Box;
9
+ export declare function uploadImage(config: UploadConfig): Box;
10
10
  export {};
@@ -8,7 +8,6 @@ export * from './parse-style';
8
8
  export * from './normalize-value';
9
9
  export * from './denormalize-value';
10
10
  export * from './modifier-text';
11
- export * from './for-each';
12
11
  export * from './get-css';
13
12
  export * from './to-node-list';
14
13
  export * from './query';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakelib",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Rich text editor based on the browser",
5
5
  "keywords": [
6
6
  "rich text",
@@ -1,5 +0,0 @@
1
- type CallbackFunction = (key: string, value: any) => boolean | void;
2
- export declare function forEach(map: {
3
- [key: string]: any;
4
- }, callback: CallbackFunction): void;
5
- export {};