lakelib 0.0.7 → 0.1.1

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.
@@ -1,6 +1,5 @@
1
1
  import EventEmitter from 'eventemitter3';
2
2
  import { NativeNode } from './types/native';
3
- import { UploadRequestMethod } from './types/request';
4
3
  import { Nodes } from './models/nodes';
5
4
  import { Box } from './models/box';
6
5
  import { insertBox } from './operations/insert-box';
@@ -12,6 +11,15 @@ import { Keystroke } from './managers/keystroke';
12
11
  import { BoxManager } from './managers/box-manager';
13
12
  import { Plugin } from './managers/plugin';
14
13
  import { Toolbar } from './ui/toolbar';
14
+ type Config = {
15
+ value: string;
16
+ readonly: boolean;
17
+ spellcheck: boolean;
18
+ tabIndex: number;
19
+ indentWithTab: boolean;
20
+ minChangeSize: number;
21
+ [name: string]: any;
22
+ };
15
23
  type EditorConfig = {
16
24
  root: string | Nodes | NativeNode;
17
25
  toolbar?: Toolbar;
@@ -21,20 +29,7 @@ type EditorConfig = {
21
29
  tabIndex?: number;
22
30
  indentWithTab?: boolean;
23
31
  minChangeSize?: number;
24
- imageRequestMethod?: UploadRequestMethod;
25
- imageRequestAction?: string;
26
- imageRequestTypes?: string[];
27
- };
28
- declare const defaultConfig: {
29
- value: string;
30
- readonly: boolean;
31
- spellcheck: boolean;
32
- tabIndex: number;
33
- indentWithTab: boolean;
34
- minChangeSize: number;
35
- imageRequestMethod: UploadRequestMethod;
36
- imageRequestAction: string;
37
- imageRequestTypes: string[];
32
+ [name: string]: any;
38
33
  };
39
34
  export declare class Editor {
40
35
  static version: string;
@@ -44,7 +39,7 @@ export declare class Editor {
44
39
  private stateData;
45
40
  root: Nodes;
46
41
  toolbar: Toolbar | undefined;
47
- config: typeof defaultConfig;
42
+ config: Config;
48
43
  containerWrapper: Nodes;
49
44
  container: Nodes;
50
45
  overlayContainer: Nodes;
@@ -73,6 +68,9 @@ export declare class Editor {
73
68
  commitUnsavedInputData(): void;
74
69
  prepareOperation(): void;
75
70
  commitOperation(): void;
71
+ setPluginConfig(pluginName: string, pluginConfig: {
72
+ [key: string]: any;
73
+ }): void;
76
74
  focus(): void;
77
75
  blur(): void;
78
76
  setValue(value: string): void;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "lakelib",
3
- "version": "0.0.7",
3
+ "version": "0.1.1",
4
4
  "description": "Rich text editor based on the browser",
5
5
  "keywords": [
6
6
  "rich text",
7
7
  "wysiwyg",
8
8
  "editor"
9
9
  ],
10
- "homepage": "http://lakejs.com",
10
+ "homepage": "http://lakejs.org",
11
11
  "bugs": {
12
12
  "url": "https://github.com/lakejs/lake/issues"
13
13
  },
@@ -46,23 +46,23 @@
46
46
  "@types/chai": "^4.3.14",
47
47
  "@types/mocha": "^10.0.6",
48
48
  "@types/sinon": "^17.0.3",
49
- "@typescript-eslint/eslint-plugin": "^7.5.0",
50
- "@typescript-eslint/parser": "^7.5.0",
49
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
50
+ "@typescript-eslint/parser": "^7.7.0",
51
51
  "chai": "^4.4.1",
52
52
  "eslint": "^8.57.0",
53
53
  "eslint-config-airbnb-base": "^15.0.0",
54
54
  "eslint-config-prettier": "^9.1.0",
55
55
  "execa": "^8.0.1",
56
56
  "express": "^4.19.2",
57
- "lake-codemirror": "^1.0.0",
57
+ "lake-codemirror": "^1.0.2",
58
58
  "mocha": "^10.4.0",
59
59
  "multer": "1.4.5-lts.1",
60
60
  "npm-run-all": "^4.1.5",
61
61
  "picocolors": "^1.0.0",
62
62
  "prompts": "^2.4.2",
63
- "puppeteer": "^22.6.2",
63
+ "puppeteer": "^22.6.5",
64
64
  "rimraf": "^5.0.5",
65
- "rollup": "^4.14.0",
65
+ "rollup": "^4.14.3",
66
66
  "rollup-plugin-import-css": "^3.5.0",
67
67
  "rollup-plugin-svg-import": "^3.0.0",
68
68
  "semver": "^7.6.0",
@@ -70,15 +70,16 @@
70
70
  "sinon": "^17.0.1",
71
71
  "sort-package-json": "^2.10.0",
72
72
  "tslib": "^2.6.2",
73
- "typescript": "^5.4.4",
73
+ "typescript": "^5.4.5",
74
74
  "wait-on": "^7.2.0"
75
75
  },
76
76
  "packageManager": "pnpm@8.15.6",
77
77
  "scripts": {
78
78
  "dev": "npm-run-all --parallel --print-label dev:express dev:rollup",
79
79
  "dev:express": "node ./scripts/start-server.mjs",
80
- "dev:rollup": "rollup --watch --config rollup.config.mjs",
81
- "build": "rimraf ./dist ./lib && rollup --config rollup.config.mjs",
80
+ "dev:rollup": "rollup --watch --config rollup.config.mjs --example --test",
81
+ "dev:lib": "rollup --watch --config rollup.config.mjs --es",
82
+ "build": "rimraf ./dist ./lib && rollup --config rollup.config.mjs --iife --es",
82
83
  "i18n": "typesafe-i18n --no-watch",
83
84
  "sort:package": "sort-package-json",
84
85
  "lint": "eslint . --config .eslintrc.cjs --ext \".ts,.js,.cjs,.mjs\"",