lakelib 0.1.22 → 0.1.23
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 +4 -4
- package/dist/lake.css +45 -36
- package/dist/lake.min.js +37 -29
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.css +45 -36
- package/lib/lake.js +924 -227
- package/lib/lake.js.map +1 -1
- package/lib/types/boxes/code-block.d.ts +2 -1
- package/lib/types/boxes/emoji.d.ts +2 -1
- package/lib/types/boxes/equation.d.ts +2 -1
- package/lib/types/boxes/file.d.ts +2 -1
- package/lib/types/boxes/hr.d.ts +2 -1
- package/lib/types/boxes/image.d.ts +2 -1
- package/lib/types/boxes/video.d.ts +2 -1
- package/lib/types/config/slash-items.d.ts +2 -0
- package/lib/types/css/index.d.ts +1 -1
- package/lib/types/editor.d.ts +2 -0
- package/lib/types/i18n/en-US/index.d.ts +36 -0
- package/lib/types/i18n/ja/index.d.ts +36 -0
- package/lib/types/i18n/ko/index.d.ts +36 -0
- package/lib/types/i18n/types.d.ts +278 -2
- package/lib/types/i18n/zh-CN/index.d.ts +36 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/managers/keystroke.d.ts +0 -1
- package/lib/types/managers/plugin.d.ts +4 -5
- package/lib/types/managers/selection.d.ts +1 -1
- package/lib/types/models/box.d.ts +1 -1
- package/lib/types/models/nodes.d.ts +2 -0
- package/lib/types/plugins/slash.d.ts +3 -0
- package/lib/types/types/plugin.d.ts +3 -0
- package/lib/types/types/{commands.d.ts → slash.d.ts} +4 -4
- package/lib/types/ui/box-toolbar.d.ts +2 -1
- package/lib/types/ui/dropdown.d.ts +1 -0
- package/lib/types/ui/link-popup.d.ts +2 -3
- package/lib/types/ui/slash-popup.d.ts +34 -0
- package/lib/types/ui/toolbar.d.ts +5 -3
- package/lib/types/utils/index.d.ts +2 -1
- package/lib/types/utils/{node-and-view.d.ts → node-position.d.ts} +1 -1
- package/lib/types/utils/scroll-to-node.d.ts +2 -0
- package/package.json +1 -1
- package/lib/types/ui/commands-popup.d.ts +0 -24
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Lake is a rich text editor for the web. It aims to be a user-friendly editor, an
|
|
|
12
12
|
|
|
13
13
|
## Development
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
For local development, you need to download the source code and run a development server that includes an HTTP service and real-time bundling.
|
|
16
16
|
|
|
17
17
|
``` bash
|
|
18
18
|
# Clone the repository
|
|
@@ -23,15 +23,15 @@ pnpm install
|
|
|
23
23
|
pnpm dev
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
You can now view
|
|
26
|
+
You can now view the demonstration by visiting `http://localhost:8080/examples/`.
|
|
27
27
|
|
|
28
28
|
## Running tests
|
|
29
29
|
|
|
30
|
-
Lake depends on a lot of browser APIs
|
|
30
|
+
Lake depends on a lot of browser APIs, so running its test cases needs a real browser environment. You can run the tests visibly by visiting `http://localhost:8080/tests/`, or execute the `pnpm test` command to run the tests in headless mode.
|
|
31
31
|
|
|
32
32
|
## License
|
|
33
33
|
|
|
34
|
-
Lake is released under the [MIT](https://github.com/lakejs/lake/blob/main/LICENSE) license. The
|
|
34
|
+
Lake is released under the [MIT](https://github.com/lakejs/lake/blob/main/LICENSE) license. The following table is a list of the licenses for the packages that Lake depends on.
|
|
35
35
|
|
|
36
36
|
| Dependency | License |
|
|
37
37
|
| ------------- | ------------- |
|
package/dist/lake.css
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
position: relative;
|
|
46
46
|
}
|
|
47
47
|
.lake-container {
|
|
48
|
-
box-sizing:
|
|
48
|
+
box-sizing: border-box;
|
|
49
49
|
font-family: var(--font-family);
|
|
50
50
|
font-size: 16px;
|
|
51
51
|
font-weight: normal;
|
|
@@ -60,6 +60,11 @@
|
|
|
60
60
|
color: inherit;
|
|
61
61
|
background: var(--selection-background-color);
|
|
62
62
|
}
|
|
63
|
+
.lake-container *,
|
|
64
|
+
.lake-container ::before,
|
|
65
|
+
.lake-container ::after {
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
}
|
|
63
68
|
.lake-container.lake-placeholder::before {
|
|
64
69
|
position: absolute;
|
|
65
70
|
top: 8px;
|
|
@@ -196,7 +201,6 @@ lake-box .lake-button-group button svg {
|
|
|
196
201
|
top: 0;
|
|
197
202
|
left: 0;
|
|
198
203
|
z-index: 1;
|
|
199
|
-
box-sizing: content-box;
|
|
200
204
|
border: 1px solid var(--border-color);
|
|
201
205
|
border-radius: 5px;
|
|
202
206
|
font-family: var(--font-family);
|
|
@@ -212,7 +216,6 @@ lake-box .lake-button-group button svg {
|
|
|
212
216
|
align-items: center;
|
|
213
217
|
}
|
|
214
218
|
.lake-box-toolbar .lake-toolbar-divider {
|
|
215
|
-
box-sizing: content-box;
|
|
216
219
|
width: 1px;
|
|
217
220
|
height: 20px;
|
|
218
221
|
margin: 0 4px;
|
|
@@ -221,7 +224,6 @@ lake-box .lake-button-group button svg {
|
|
|
221
224
|
}
|
|
222
225
|
|
|
223
226
|
button.lake-button {
|
|
224
|
-
box-sizing: content-box;
|
|
225
227
|
border-radius: 5px;
|
|
226
228
|
border: 0;
|
|
227
229
|
font-family: Arial;
|
|
@@ -242,7 +244,8 @@ button.lake-button[disabled] {
|
|
|
242
244
|
opacity: 0.25;
|
|
243
245
|
cursor: default;
|
|
244
246
|
}
|
|
245
|
-
button.lake-button svg
|
|
247
|
+
button.lake-button svg,
|
|
248
|
+
button.lake-button img {
|
|
246
249
|
display: inline-block;
|
|
247
250
|
width: 16px;
|
|
248
251
|
height: 16px;
|
|
@@ -258,6 +261,7 @@ button.lake-text-button {
|
|
|
258
261
|
background-color: transparent;
|
|
259
262
|
border: 1px solid var(--border-color);
|
|
260
263
|
padding: 8px 16px;
|
|
264
|
+
line-height: normal;
|
|
261
265
|
}
|
|
262
266
|
button.lake-text-button.lake-button-hovered {
|
|
263
267
|
background-color: var(--background-hover-color);
|
|
@@ -292,7 +296,6 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
292
296
|
user-select: none;
|
|
293
297
|
}
|
|
294
298
|
.lake-dropdown button.lake-dropdown-title {
|
|
295
|
-
box-sizing: content-box;
|
|
296
299
|
border-radius: 5px;
|
|
297
300
|
border: 0;
|
|
298
301
|
font-family: Arial;
|
|
@@ -552,11 +555,15 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
552
555
|
line-height: normal;
|
|
553
556
|
color: var(--text-color);
|
|
554
557
|
}
|
|
558
|
+
.lake-popup *,
|
|
559
|
+
.lake-popup ::before,
|
|
560
|
+
.lake-popup ::after {
|
|
561
|
+
box-sizing: border-box;
|
|
562
|
+
}
|
|
555
563
|
.lake-popup button {
|
|
556
564
|
box-shadow: var(--button-shadow);
|
|
557
565
|
}
|
|
558
566
|
.lake-popup input[type="text"] {
|
|
559
|
-
box-sizing: content-box;
|
|
560
567
|
font-family: var(--font-family);
|
|
561
568
|
font-size: 14px;
|
|
562
569
|
color: var(--text-color);
|
|
@@ -583,7 +590,6 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
583
590
|
.lake-resizer-top-right,
|
|
584
591
|
.lake-resizer-bottom-left,
|
|
585
592
|
.lake-resizer-bottom-right {
|
|
586
|
-
box-sizing: border-box;
|
|
587
593
|
position: absolute;
|
|
588
594
|
width: 12px;
|
|
589
595
|
height: 12px;
|
|
@@ -683,7 +689,6 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
683
689
|
top: 0;
|
|
684
690
|
left: 0;
|
|
685
691
|
z-index: 1;
|
|
686
|
-
box-sizing: content-box;
|
|
687
692
|
border: 1px solid var(--border-color);
|
|
688
693
|
border-radius: 5px;
|
|
689
694
|
padding: 16px;
|
|
@@ -706,7 +711,7 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
706
711
|
justify-content: space-between;
|
|
707
712
|
}
|
|
708
713
|
.lake-link-popup input[type="text"] {
|
|
709
|
-
width:
|
|
714
|
+
width: 220px;
|
|
710
715
|
margin-right: 4px;
|
|
711
716
|
}
|
|
712
717
|
.lake-link-popup button[name="copy"] svg:first-child {
|
|
@@ -728,6 +733,10 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
728
733
|
margin-bottom: 4px;
|
|
729
734
|
padding: 0;
|
|
730
735
|
}
|
|
736
|
+
.lake-container ol lake-box[type="inline"],
|
|
737
|
+
.lake-container ul lake-box[type="inline"] {
|
|
738
|
+
vertical-align: middle;
|
|
739
|
+
}
|
|
731
740
|
.lake-container ol[indent="1"],
|
|
732
741
|
.lake-container ul[indent="1"] {
|
|
733
742
|
padding-left: 2em;
|
|
@@ -848,7 +857,6 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
848
857
|
}
|
|
849
858
|
|
|
850
859
|
.lake-container blockquote {
|
|
851
|
-
box-sizing: content-box;
|
|
852
860
|
margin: 0;
|
|
853
861
|
margin-bottom: 8px;
|
|
854
862
|
padding: 8px 12px;
|
|
@@ -876,7 +884,6 @@ button.lake-primary-button.lake-button-hovered {
|
|
|
876
884
|
}
|
|
877
885
|
|
|
878
886
|
.lake-container table {
|
|
879
|
-
box-sizing: content-box;
|
|
880
887
|
display: block;
|
|
881
888
|
border-collapse: collapse;
|
|
882
889
|
border: 0;
|
|
@@ -941,7 +948,6 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block {
|
|
|
941
948
|
}
|
|
942
949
|
.lake-code-block {
|
|
943
950
|
position: relative;
|
|
944
|
-
box-sizing: border-box;
|
|
945
951
|
border: 1px solid transparent;
|
|
946
952
|
border-radius: 5px;
|
|
947
953
|
}
|
|
@@ -986,7 +992,6 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block .lake-dropdown {
|
|
|
986
992
|
display: flex;
|
|
987
993
|
align-items: center;
|
|
988
994
|
justify-content: center;
|
|
989
|
-
box-sizing: border-box;
|
|
990
995
|
border: 1px solid transparent;
|
|
991
996
|
background-color: #fafafa;
|
|
992
997
|
border-radius: 4px;
|
|
@@ -1003,7 +1008,6 @@ lake-box[name="codeBlock"] .lake-box-activated .lake-code-block .lake-dropdown {
|
|
|
1003
1008
|
.lake-image {
|
|
1004
1009
|
position: relative;
|
|
1005
1010
|
line-height: 0;
|
|
1006
|
-
box-sizing: content-box;
|
|
1007
1011
|
border: 1px solid transparent;
|
|
1008
1012
|
border-radius: 4px;
|
|
1009
1013
|
}
|
|
@@ -1089,21 +1093,18 @@ lake-box[name="image"] .lake-box-selected .lake-image-error {
|
|
|
1089
1093
|
font-size: 14px;
|
|
1090
1094
|
font-weight: normal;
|
|
1091
1095
|
line-height: 0;
|
|
1092
|
-
box-sizing: content-box;
|
|
1093
1096
|
border: 1px solid transparent;
|
|
1094
1097
|
}
|
|
1095
1098
|
lake-box[name="video"] .lake-box-hovered .lake-resizer {
|
|
1096
1099
|
display: block;
|
|
1097
1100
|
}
|
|
1098
1101
|
.lake-video .lake-video-form {
|
|
1099
|
-
box-sizing: content-box;
|
|
1100
1102
|
padding: 16px;
|
|
1101
1103
|
line-height: normal;
|
|
1102
1104
|
border: 1px solid var(--box-border-color);
|
|
1103
1105
|
border-radius: 4px;
|
|
1104
1106
|
}
|
|
1105
1107
|
.lake-video input[type="text"] {
|
|
1106
|
-
box-sizing: border-box;
|
|
1107
1108
|
font-family: var(--font-family);
|
|
1108
1109
|
font-size: 14px;
|
|
1109
1110
|
color: var(--text-color);
|
|
@@ -1131,7 +1132,6 @@ lake-box[name="video"] .lake-box-hovered .lake-resizer {
|
|
|
1131
1132
|
padding-top: 16px;
|
|
1132
1133
|
}
|
|
1133
1134
|
.lake-video .lake-button-row button {
|
|
1134
|
-
box-sizing: border-box;
|
|
1135
1135
|
width: 100%;
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
@@ -1140,7 +1140,6 @@ lake-box[name="video"] .lake-box-hovered .lake-resizer {
|
|
|
1140
1140
|
font-size: 16px;
|
|
1141
1141
|
font-weight: normal;
|
|
1142
1142
|
line-height: 0;
|
|
1143
|
-
box-sizing: content-box;
|
|
1144
1143
|
border: 1px solid transparent;
|
|
1145
1144
|
border-radius: 4px;
|
|
1146
1145
|
}
|
|
@@ -1205,7 +1204,6 @@ lake-box[name="file"] .lake-box-focused .lake-file {
|
|
|
1205
1204
|
|
|
1206
1205
|
.lake-emoji {
|
|
1207
1206
|
line-height: 0;
|
|
1208
|
-
box-sizing: content-box;
|
|
1209
1207
|
border: 1px solid transparent;
|
|
1210
1208
|
border-radius: 2px;
|
|
1211
1209
|
}
|
|
@@ -1246,7 +1244,6 @@ lake-box[name="equation"] .lake-box-focused .lake-equation {
|
|
|
1246
1244
|
top: 28px;
|
|
1247
1245
|
left: 0;
|
|
1248
1246
|
z-index: 1;
|
|
1249
|
-
box-sizing: content-box;
|
|
1250
1247
|
border: 1px solid var(--border-color);
|
|
1251
1248
|
border-radius: 5px;
|
|
1252
1249
|
padding: 16px;
|
|
@@ -1261,7 +1258,6 @@ lake-box[name="equation"] .lake-box-activated .lake-equation-form {
|
|
|
1261
1258
|
}
|
|
1262
1259
|
.lake-equation .lake-equation-form textarea {
|
|
1263
1260
|
border: 0;
|
|
1264
|
-
box-sizing: border-box;
|
|
1265
1261
|
font-family: Consolas, Courier, monospace;
|
|
1266
1262
|
font-size: 14px;
|
|
1267
1263
|
color: var(--text-color);
|
|
@@ -1284,6 +1280,7 @@ lake-box[name="equation"] .lake-box-activated .lake-equation-form {
|
|
|
1284
1280
|
}
|
|
1285
1281
|
|
|
1286
1282
|
.lake-toolbar {
|
|
1283
|
+
box-sizing: border-box;
|
|
1287
1284
|
font-family: var(--font-family);
|
|
1288
1285
|
font-size: 14px;
|
|
1289
1286
|
font-weight: normal;
|
|
@@ -1293,8 +1290,12 @@ lake-box[name="equation"] .lake-box-activated .lake-equation-form {
|
|
|
1293
1290
|
flex-wrap: wrap;
|
|
1294
1291
|
align-items: center;
|
|
1295
1292
|
}
|
|
1293
|
+
.lake-toolbar *,
|
|
1294
|
+
.lake-toolbar ::before,
|
|
1295
|
+
.lake-toolbar ::after {
|
|
1296
|
+
box-sizing: border-box;
|
|
1297
|
+
}
|
|
1296
1298
|
.lake-toolbar .lake-toolbar-divider {
|
|
1297
|
-
box-sizing: content-box;
|
|
1298
1299
|
width: 1px;
|
|
1299
1300
|
height: 20px;
|
|
1300
1301
|
margin: 0 4px;
|
|
@@ -1308,14 +1309,15 @@ lake-box[name="equation"] .lake-box-activated .lake-equation-form {
|
|
|
1308
1309
|
display: none;
|
|
1309
1310
|
}
|
|
1310
1311
|
|
|
1311
|
-
.lake-
|
|
1312
|
+
.lake-slash-popup {
|
|
1312
1313
|
position: absolute;
|
|
1313
1314
|
top: 0;
|
|
1314
1315
|
left: 0;
|
|
1315
1316
|
z-index: 1;
|
|
1316
|
-
|
|
1317
|
+
list-style: none;
|
|
1317
1318
|
border: 1px solid var(--border-color);
|
|
1318
1319
|
border-radius: 5px;
|
|
1320
|
+
margin: 0;
|
|
1319
1321
|
padding: 4px 8px;
|
|
1320
1322
|
width: fit-content;
|
|
1321
1323
|
font-family: var(--font-family);
|
|
@@ -1324,41 +1326,48 @@ lake-box[name="equation"] .lake-box-activated .lake-equation-form {
|
|
|
1324
1326
|
background-color: #fff;
|
|
1325
1327
|
box-shadow: var(--popup-shadow);
|
|
1326
1328
|
display: none;
|
|
1327
|
-
height: 380px;
|
|
1329
|
+
max-height: 380px;
|
|
1328
1330
|
overflow-y: scroll;
|
|
1329
1331
|
scrollbar-width: thin;
|
|
1332
|
+
user-select: none;
|
|
1330
1333
|
}
|
|
1331
|
-
.lake-
|
|
1334
|
+
.lake-slash-popup .lake-slash-item {
|
|
1332
1335
|
display: flex;
|
|
1333
1336
|
cursor: pointer;
|
|
1334
1337
|
padding: 4px 8px;
|
|
1338
|
+
margin: 0;
|
|
1335
1339
|
border-radius: 5px;
|
|
1340
|
+
scroll-margin: 4px 0;
|
|
1336
1341
|
}
|
|
1337
|
-
.lake-
|
|
1342
|
+
.lake-slash-popup .lake-slash-item-selected {
|
|
1338
1343
|
background-color: var(--background-active-color);
|
|
1339
1344
|
}
|
|
1340
|
-
.lake-
|
|
1341
|
-
|
|
1345
|
+
.lake-slash-popup .lake-slash-item input[type="file"] {
|
|
1346
|
+
display: none;
|
|
1347
|
+
}
|
|
1348
|
+
.lake-slash-popup .lake-slash-icon {
|
|
1349
|
+
margin-inline-end: 8px;
|
|
1342
1350
|
border-radius: 5px;
|
|
1343
1351
|
border: 1px solid var(--border-color);
|
|
1344
1352
|
background-color: #fff;
|
|
1345
1353
|
}
|
|
1346
|
-
.lake-
|
|
1354
|
+
.lake-slash-popup .lake-slash-icon svg,
|
|
1355
|
+
.lake-slash-popup .lake-slash-icon img {
|
|
1347
1356
|
width: 32px;
|
|
1348
1357
|
height: 32px;
|
|
1349
1358
|
margin: 6px;
|
|
1350
1359
|
}
|
|
1351
|
-
.lake-
|
|
1360
|
+
.lake-slash-popup .lake-slash-text {
|
|
1352
1361
|
display: flex;
|
|
1353
1362
|
flex-direction: column;
|
|
1354
1363
|
justify-content: center;
|
|
1355
1364
|
}
|
|
1356
|
-
.lake-
|
|
1365
|
+
.lake-slash-popup .lake-slash-title {
|
|
1357
1366
|
font-weight: 500;
|
|
1358
1367
|
color: var(--text-color);
|
|
1359
1368
|
}
|
|
1360
|
-
.lake-
|
|
1361
|
-
color:
|
|
1369
|
+
.lake-slash-popup .lake-slash-description {
|
|
1370
|
+
color: #8c8c8c;
|
|
1362
1371
|
}
|
|
1363
1372
|
|
|
1364
1373
|
/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */
|