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.
package/README.md CHANGED
@@ -1,81 +1,14 @@
1
1
  # Lake
2
2
 
3
- Lake is a rich text editor for the web. It has a good user experience and provides easy-to-use programming interface to allow further extension.
4
-
5
- ## Downloading Lake from CDN
6
-
7
- Compressed copies of Lake files are available, you can download them from jsDelivr or UNPKG.
8
-
9
- * jsDelivr: https://www.jsdelivr.com/package/npm/lakelib
10
- * UNPKG: https://unpkg.com/browse/lakelib/
11
-
12
- Note: `lake.min.js` is not built with CodeMirror, so if you need the code block feature, addtioanaly including `codemirror.min.js` to your page is needed. But if you do not need it, there is no need to include external CodeMirror file. To find out more, see [IIFE example](https://github.com/lakejs/lake/blob/main/examples/iife.html) and [Rollup configuration](https://github.com/lakejs/lake/blob/main/rollup.config.mjs).
13
-
14
- ## Downloading Lake using npm
15
-
16
- Lake is registered as a package on npm. You can install the latest version of Lake with the following npm command.
17
-
18
- ```bash
19
- npm install lakelib
20
- ```
21
-
22
- ## Quick start with CDN
23
-
24
- First, add the following lines of code in the `<head>` of an HTML page.
25
-
26
- ```html
27
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.min.css" />
28
- <script src="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.min.js"></script>
29
- ```
3
+ [![CI](https://github.com/lakejs/lake/actions/workflows/ci.yml/badge.svg)](https://github.com/lakejs/lake/actions)
4
+ [![npm](https://img.shields.io/npm/v/lakelib)](https://npmjs.org/package/lakelib)
5
+ [![size](https://badgen.net/bundlephobia/minzip/lakelib?style=flat-square)](https://bundlephobia.com/package/lakelib)
30
6
 
31
- Then, in the HTML page add the following HTML code that will serve as a placeholder for an editor instance.
7
+ ---
32
8
 
33
- ```html
34
- <div class="lake-editor">
35
- <div class="lake-toolbar-root"></div>
36
- <div class="lake-root"></div>
37
- </div>
38
- ```
39
-
40
- Finally, call the following JavaScript code to render the editor.
41
-
42
- ```js
43
- const toolbar = new Lake.Toolbar({
44
- root: '.lake-toolbar-root',
45
- });
46
- const editor = new Lake.Editor({
47
- root: '.lake-root',
48
- toolbar,
49
- });
50
- editor.render();
51
- ```
52
-
53
- ## Quick start with npm
54
-
55
- First, in the HTML page add the following HTML code that will serve as a placeholder for an editor instance.
56
-
57
- ```html
58
- <div class="lake-editor">
59
- <div class="lake-toolbar-root"></div>
60
- <div class="lake-root"></div>
61
- </div>
62
- ```
63
-
64
- Then, call the following JavaScript code to render the editor.
65
-
66
- ```js
67
- import 'lakelib/lib/lake.css';
68
- import { Editor, Toolbar } from 'lakelib';
9
+ Lake is a rich text editor for the web. It has a good user experience and provides easy-to-use programming interface to allow further extension.
69
10
 
70
- const toolbar = new Toolbar({
71
- root: '.lake-toolbar-root',
72
- });
73
- const editor = new Editor({
74
- root: '.lake-root',
75
- toolbar,
76
- });
77
- editor.render();
78
- ```
11
+ [Examples](https://lakejs.org/examples/) · [Getting started](https://lakejs.org/guide/getting-started) · [Reference](https://lakejs.org/reference/)
79
12
 
80
13
  ## Development
81
14
 
@@ -86,8 +19,6 @@ To build Lake or change source code, you need to download the repository and sta
86
19
  git clone https://github.com/lakejs/lake.git
87
20
  # Install dependencies
88
21
  pnpm install
89
- # Build CodeMirror
90
- pnpm build:codemirror
91
22
  # Start a local server
92
23
  pnpm dev
93
24
  ```
package/dist/lake.css CHANGED
@@ -33,12 +33,11 @@
33
33
  }
34
34
 
35
35
  .lake-container {
36
+ box-sizing: content-box;
36
37
  font-family: var(--font-family);
37
38
  font-size: 16px;
38
39
  font-weight: normal;
39
40
  line-height: normal;
40
- color: var(--text-color);
41
- background-color: #fff;
42
41
  padding: 16px 24px;
43
42
  }
44
43
  .lake-container:focus {
@@ -379,8 +378,9 @@ button.lake-text-button span {
379
378
  .lake-container h4,
380
379
  .lake-container h5,
381
380
  .lake-container h6 {
382
- color: #000000e0;
383
381
  font-weight: bold;
382
+ line-height: normal;
383
+ border: 0;
384
384
  margin: 0;
385
385
  padding: 0;
386
386
  }
@@ -496,6 +496,7 @@ button.lake-text-button span {
496
496
  padding-left: 24px;
497
497
  }
498
498
  .lake-container ul[type="checklist"] li::before {
499
+ box-sizing: content-box;
499
500
  content: '';
500
501
  position: absolute;
501
502
  top: 3px;
@@ -513,6 +514,7 @@ button.lake-text-button span {
513
514
  background-color: #fff;
514
515
  }
515
516
  .lake-container ul[type="checklist"] li::after {
517
+ box-sizing: content-box;
516
518
  content: '';
517
519
  position: absolute;
518
520
  top: 3px;
@@ -534,6 +536,7 @@ button.lake-text-button span {
534
536
  }
535
537
 
536
538
  .lake-container blockquote {
539
+ box-sizing: content-box;
537
540
  margin: 0;
538
541
  margin-bottom: 8px;
539
542
  padding: 8px 12px;
@@ -544,19 +547,21 @@ button.lake-text-button span {
544
547
  color: var(--text-color);
545
548
  border-radius: 8px;
546
549
  }
550
+ .lake-container blockquote[type="info"],
551
+ .lake-container blockquote[type="tip"] {
552
+ background-color: #e6f4ff;
553
+ border: 1px solid #91caff;
554
+ }
547
555
  .lake-container blockquote[type="success"] {
548
556
  background-color: #f6ffed;
549
557
  border: 1px solid #b7eb8f;
550
558
  }
551
- .lake-container blockquote[type="info"] {
552
- background-color: #e6f4ff;
553
- border: 1px solid #91caff;
554
- }
555
559
  .lake-container blockquote[type="warning"] {
556
560
  background-color: #fffbe6;
557
561
  border: 1px solid #ffe58f;
558
562
  }
559
- .lake-container blockquote[type="error"] {
563
+ .lake-container blockquote[type="error"],
564
+ .lake-container blockquote[type="danger"] {
560
565
  background-color: #fff2f0;
561
566
  border: 1px solid #ffccc7;
562
567
  }
@@ -658,11 +663,11 @@ lake-box[name="hr"] .lake-box-focused .lake-hr {
658
663
  .lake-image {
659
664
  position: relative;
660
665
  line-height: 0;
666
+ box-sizing: content-box;
661
667
  border: 1px solid transparent;
662
668
  border-radius: 4px;
663
669
  }
664
670
  .lake-image .lake-image-img {
665
- box-sizing: border-box;
666
671
  border: 0;
667
672
  border-radius: 4px;
668
673
  width: 100%;
@@ -881,6 +886,8 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block .lake-dropdown {
881
886
  }
882
887
  .lake-code-block .lake-dropdown .lake-dropdown-menu {
883
888
  top: 24px;
889
+ left: auto;
890
+ right: 0;
884
891
  overflow-y: scroll;
885
892
  scrollbar-width: thin;
886
893
  height: 200px;
@@ -898,6 +905,7 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block .lake-dropdown {
898
905
  top: 0;
899
906
  left: 0;
900
907
  z-index: 1;
908
+ box-sizing: content-box;
901
909
  border: 1px solid var(--border-color);
902
910
  border-radius: 5px;
903
911
  padding: 16px;
@@ -940,8 +948,6 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block .lake-dropdown {
940
948
  font-size: 14px;
941
949
  font-weight: normal;
942
950
  line-height: normal;
943
- color: var(--text-color);
944
- background-color: #fff;
945
951
  padding: 4px;
946
952
  display: flex;
947
953
  flex-wrap: wrap;