lakelib 0.3.0 → 0.3.2

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.
@@ -5,8 +5,8 @@ import { ToolbarItem } from '../types/toolbar';
5
5
  import { Nodes } from './nodes';
6
6
  import { FloatingToolbar } from '../ui/floating-toolbar';
7
7
  export declare class Box {
8
- node: Nodes;
9
- event: EventEmitter;
8
+ readonly node: Nodes;
9
+ readonly event: EventEmitter;
10
10
  toolbar: FloatingToolbar | null;
11
11
  constructor(node: string | Node | Nodes);
12
12
  private initiate;
@@ -14,12 +14,12 @@ export declare class Box {
14
14
  get name(): string;
15
15
  get value(): BoxValue;
16
16
  set value(value: BoxValue);
17
- updateValue(valueKey: string, valueValue: string): void;
18
- updateValue(valueKey: BoxValue): void;
17
+ updateValue(keyName: string, keyValue: string): void;
18
+ updateValue(keyName: BoxValue): void;
19
19
  getEditor(): Editor;
20
20
  getContainer(): Nodes;
21
+ getHTML(): string;
21
22
  setToolbar(items: ToolbarItem[]): void;
22
23
  render(): void;
23
24
  unmount(): void;
24
- getHTML(): string;
25
25
  }
@@ -1,8 +1,8 @@
1
1
  import { Nodes } from './nodes';
2
2
  export declare class Fragment {
3
- private fragment;
3
+ private readonly fragment;
4
4
  constructor(fragment?: DocumentFragment);
5
5
  get(): DocumentFragment;
6
6
  find(selector: string): Nodes;
7
- append(node: string | Node | Nodes): void;
7
+ append(content: string | Node | Nodes): void;
8
8
  }
@@ -5,8 +5,8 @@ type EventItem = {
5
5
  listener: EventListener;
6
6
  };
7
7
  export declare class Nodes {
8
- private nodeList;
9
- length: number;
8
+ private readonly nodeList;
9
+ readonly length: number;
10
10
  constructor(node?: Node | Node[] | null);
11
11
  get id(): number;
12
12
  get name(): string;
@@ -32,12 +32,12 @@ export declare class Nodes {
32
32
  get(index: number): Node;
33
33
  getAll(): Node[];
34
34
  eq(index: number): Nodes;
35
- each(callback: (element: Node, index: number) => boolean | void): this;
35
+ each(callback: (node: Node, index: number) => boolean | void): this;
36
36
  eachElement(callback: (element: Element, index: number) => boolean | void): this;
37
37
  reverse(): Nodes;
38
38
  matches(selector: string): boolean;
39
- contains(otherNode: Node | Nodes): boolean;
40
- isSibling(target: Nodes): boolean;
39
+ contains(otherNode: Nodes): boolean;
40
+ isSibling(otherNode: Nodes): boolean;
41
41
  find(selector: string | NodePath): Nodes;
42
42
  closest(selector: string): Nodes;
43
43
  closestBlock(): Nodes;
@@ -1,7 +1,7 @@
1
1
  import { NativeRange } from '../types/native';
2
2
  import { Nodes } from './nodes';
3
3
  export declare class Range {
4
- private range;
4
+ private readonly range;
5
5
  constructor(range?: NativeRange);
6
6
  get startNode(): Nodes;
7
7
  get startOffset(): number;
@@ -1,7 +1,7 @@
1
1
  import { Nodes } from '../models/nodes';
2
2
  export declare class HTMLParser {
3
- private rules;
4
- private source;
3
+ private readonly rules;
4
+ private readonly source;
5
5
  constructor(content: string | Nodes, rules?: any);
6
6
  private parseHTML;
7
7
  private static matchRule;
@@ -1,5 +1,5 @@
1
1
  export declare class TextParser {
2
- private content;
2
+ private readonly content;
3
3
  constructor(content: string);
4
4
  getHTML(): string;
5
5
  getFragment(): DocumentFragment;
@@ -10,9 +10,9 @@ type ButtonConfig = {
10
10
  onClick: () => void;
11
11
  };
12
12
  export declare class Button {
13
- private config;
14
- private root;
15
- node: Nodes;
13
+ private readonly config;
14
+ private readonly root;
15
+ readonly node: Nodes;
16
16
  constructor(config: ButtonConfig);
17
17
  render(): void;
18
18
  }
@@ -10,13 +10,13 @@ type DropdownConfig = DropdownItem & {
10
10
  onSelect: (value: string) => void;
11
11
  };
12
12
  export declare class Dropdown {
13
- private config;
14
- private root;
15
- private locale;
16
- private location;
17
- private direction;
18
- private menuNode;
19
- node: Nodes;
13
+ private readonly config;
14
+ private readonly root;
15
+ private readonly locale;
16
+ private readonly location;
17
+ private readonly direction;
18
+ private readonly menuNode;
19
+ readonly node: Nodes;
20
20
  constructor(config: DropdownConfig);
21
21
  static getValue(node: Nodes): string[];
22
22
  static setValue(node: Nodes, value: string[]): void;
@@ -9,13 +9,13 @@ export type ToolbarConfig = {
9
9
  placement?: ToolbarPlacement;
10
10
  };
11
11
  export declare class Toolbar {
12
- root: Nodes;
13
12
  private items;
14
13
  private placement;
15
14
  private allMenuMap;
16
15
  private buttonItemList;
17
16
  private dropdownItemList;
18
17
  private dropdownList;
18
+ root: Nodes;
19
19
  container: Nodes;
20
20
  constructor(config: ToolbarConfig);
21
21
  private appendDivider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakelib",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Lake is a browser-based rich text editor designed for creating content like blogs, comments, and emails.",
5
5
  "keywords": [
6
6
  "rich text",
@@ -38,42 +38,43 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@rollup/plugin-alias": "^5.1.1",
41
- "@rollup/plugin-commonjs": "^28.0.1",
41
+ "@rollup/plugin-commonjs": "^28.0.2",
42
42
  "@rollup/plugin-json": "^6.1.0",
43
- "@rollup/plugin-node-resolve": "^15.3.0",
43
+ "@rollup/plugin-node-resolve": "^16.0.0",
44
44
  "@rollup/plugin-terser": "^0.4.4",
45
- "@rollup/plugin-typescript": "^12.1.1",
45
+ "@rollup/plugin-typescript": "^12.1.2",
46
46
  "@types/chai": "^5.0.1",
47
47
  "@types/mocha": "^10.0.10",
48
48
  "@types/sinon": "^17.0.3",
49
49
  "@typescript-eslint/eslint-plugin": "^7.18.0",
50
50
  "@typescript-eslint/parser": "^7.18.0",
51
51
  "chai": "^5.1.2",
52
+ "clean-css": "^5.3.3",
52
53
  "conventional-changelog-cli": "^5.0.0",
53
54
  "eslint": "^8.57.1",
54
55
  "eslint-config-airbnb-base": "^15.0.0",
55
56
  "eslint-config-prettier": "^9.1.0",
56
- "execa": "^9.5.1",
57
- "express": "^4.21.1",
58
- "katex": "^0.16.11",
59
- "lake-codemirror": "^2.0.0",
60
- "mocha": "^10.8.2",
57
+ "execa": "^9.5.2",
58
+ "express": "^4.21.2",
59
+ "katex": "^0.16.21",
60
+ "lake-codemirror": "^2.0.1",
61
+ "mocha": "^11.1.0",
61
62
  "multer": "1.4.5-lts.1",
62
- "npm-run-all2": "^7.0.1",
63
+ "npm-run-all2": "^7.0.2",
63
64
  "picocolors": "^1.1.1",
64
65
  "prompts": "^2.4.2",
65
- "puppeteer": "^23.10.0",
66
+ "puppeteer": "^24.1.0",
66
67
  "rimraf": "^6.0.1",
67
- "rollup": "^4.28.0",
68
- "rollup-plugin-import-css": "^3.5.7",
68
+ "rollup": "^4.31.0",
69
+ "rollup-plugin-import-css": "^3.5.8",
69
70
  "rollup-plugin-svg-import": "^3.0.0",
70
71
  "semver": "^7.6.3",
71
72
  "simple-git-hooks": "^2.11.1",
72
73
  "sinon": "^19.0.2",
73
- "sort-package-json": "^2.12.0",
74
+ "sort-package-json": "^2.14.0",
74
75
  "tslib": "^2.8.1",
75
- "typescript": "^5.7.2",
76
- "wait-on": "^8.0.1"
76
+ "typescript": "^5.7.3",
77
+ "wait-on": "^8.0.2"
77
78
  },
78
79
  "scripts": {
79
80
  "dev": "npm-run-all --parallel --print-label dev:express dev:rollup",
@@ -82,6 +83,7 @@
82
83
  "dev:lib": "rollup --watch --config rollup.config.mjs --es",
83
84
  "build": "rimraf ./dist ./lib && rollup --config rollup.config.mjs --iife --es",
84
85
  "i18n": "typesafe-i18n --no-watch",
86
+ "install:chrome": "npx puppeteer browsers install chrome-headless-shell",
85
87
  "sort:package": "sort-package-json",
86
88
  "lint": "eslint . --config .eslintrc.cjs --ext \".ts,.js,.cjs,.mjs\"",
87
89
  "test": "node ./scripts/run-tests.mjs",