fable-editor 1.0.2 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fable-editor",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "FableEditor — a rich text editor with React and Angular wrappers",
5
5
  "author": "Sajin Satheesan <an.sajinsatheesan@gmail.com>",
6
6
  "repository": {
@@ -95,6 +95,7 @@
95
95
  "@playwright/test": "^1.61.1",
96
96
  "@testing-library/jest-dom": "^6.9.1",
97
97
  "@testing-library/react": "^16.3.2",
98
+ "@types/katex": "^0.16.8",
98
99
  "@types/react": "^18.3.0",
99
100
  "@types/react-dom": "^18.3.0",
100
101
  "@vitejs/plugin-react": "^4.3.0",
@@ -109,5 +110,8 @@
109
110
  "vite": "^5.3.0",
110
111
  "vite-plugin-dts": "^3.9.0",
111
112
  "vitest": "^4.1.9"
113
+ },
114
+ "dependencies": {
115
+ "katex": "^0.17.0"
112
116
  }
113
117
  }
package/style.css CHANGED
@@ -270,12 +270,12 @@
270
270
  word-break: break-word;
271
271
  }
272
272
 
273
- .earea img {
273
+ .earea img, .earea video {
274
274
  max-width: 100%;
275
275
  height: auto;
276
276
  }
277
277
 
278
- /* image upload placeholder */
278
+ /* image / video upload placeholder */
279
279
  .earea .img-ph {
280
280
  display: flex;
281
281
  align-items: center;
@@ -583,6 +583,50 @@
583
583
  outline-offset: 1px;
584
584
  }
585
585
 
586
+ /* video align toolbar */
587
+ .earea video.vid-selected,
588
+ .earea .video-embed.vid-selected {
589
+ outline: 2px solid #006ce7;
590
+ outline-offset: 1px;
591
+ }
592
+
593
+ /* embedded hosted players (YouTube & co.) */
594
+ .earea .video-embed {
595
+ display: inline-block;
596
+ max-width: 100%;
597
+ }
598
+
599
+ .earea .video-embed iframe {
600
+ /* clicks land on the wrapper so the embed can be selected/aligned */
601
+ pointer-events: none;
602
+ display: block;
603
+ border: 0;
604
+ max-width: 100%;
605
+ }
606
+
607
+ .earea .tpl-media video,
608
+ .earea .tpl-media .video-embed {
609
+ max-width: 100%;
610
+ }
611
+
612
+ /* math / LaTeX formulas */
613
+ .earea .math-fable {
614
+ cursor: pointer;
615
+ border-radius: 4px;
616
+ }
617
+
618
+ .earea .math-fable-block {
619
+ display: block;
620
+ text-align: center;
621
+ margin: 0.5em 0;
622
+ padding: 4px;
623
+ }
624
+
625
+ .earea .math-fable.math-selected {
626
+ outline: 2px solid #006ce7;
627
+ outline-offset: 2px;
628
+ }
629
+
586
630
  .img-handle {
587
631
  position: absolute;
588
632
  width: 10px;
@@ -1152,7 +1196,68 @@
1152
1196
  font-size: 14px;
1153
1197
  }
1154
1198
 
1155
- /* char map */
1199
+ /* char / emoji map: fixed category tabs left, glyph grid right */
1200
+ .chmap {
1201
+ display: flex;
1202
+ width: 560px;
1203
+ max-width: 76vw;
1204
+ height: 320px;
1205
+ max-height: 46vh;
1206
+ }
1207
+
1208
+ .chmap .chtabs {
1209
+ flex: 0 0 158px;
1210
+ display: flex;
1211
+ flex-direction: column;
1212
+ gap: 2px;
1213
+ overflow-y: auto;
1214
+ padding: 6px 8px 6px 0;
1215
+ border-inline-end: 1px solid #e3e8ee;
1216
+ }
1217
+
1218
+ .chmap .chtabs button {
1219
+ border: 0;
1220
+ background: none;
1221
+ text-align: start;
1222
+ padding: 8px 10px;
1223
+ border-radius: 6px;
1224
+ font: 13.5px inherit;
1225
+ color: #222f3e;
1226
+ cursor: pointer;
1227
+ white-space: nowrap;
1228
+ }
1229
+
1230
+ .chmap .chtabs button:hover {
1231
+ background: #f0f0f0;
1232
+ }
1233
+
1234
+ .chmap .chtabs button.on {
1235
+ background: #e8f1fb;
1236
+ color: #0060ce;
1237
+ font-weight: 600;
1238
+ }
1239
+
1240
+ .chmap .chpanel {
1241
+ flex: 1;
1242
+ overflow-y: auto;
1243
+ padding: 6px 0 6px 8px;
1244
+ }
1245
+
1246
+ .chmap .chgrid {
1247
+ grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
1248
+ padding: 0;
1249
+ }
1250
+
1251
+ .chmap .chgrid.emgrid {
1252
+ grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
1253
+ }
1254
+
1255
+ .chmap .chgrid.emgrid button {
1256
+ width: 36px;
1257
+ height: 36px;
1258
+ font-size: 20px;
1259
+ }
1260
+
1156
1261
  .chgrid {
1157
1262
  display: grid;
1158
1263
  grid-template-columns: repeat(8, 30px);
@@ -1293,6 +1398,84 @@
1293
1398
  resize: vertical;
1294
1399
  }
1295
1400
 
1401
+ /* tabbed dialogs (insert/edit video) */
1402
+ .dlg .dtabs {
1403
+ display: flex;
1404
+ gap: 2px;
1405
+ border-bottom: 1px solid #e3e8ee;
1406
+ margin-bottom: 14px;
1407
+ }
1408
+
1409
+ .dlg .dtabs button {
1410
+ border: 0;
1411
+ background: none;
1412
+ padding: 8px 14px;
1413
+ font: 14px inherit;
1414
+ color: #556;
1415
+ cursor: pointer;
1416
+ border-bottom: 2px solid transparent;
1417
+ margin-bottom: -1px;
1418
+ }
1419
+
1420
+ .dlg .dtabs button.on {
1421
+ color: #006ce7;
1422
+ border-bottom-color: #006ce7;
1423
+ font-weight: 600;
1424
+ }
1425
+
1426
+ .dlg .dtabbody {
1427
+ width: 460px;
1428
+ max-width: 76vw;
1429
+ min-height: 150px;
1430
+ }
1431
+
1432
+ .dlg .dtabpanel textarea {
1433
+ width: 100%;
1434
+ box-sizing: border-box;
1435
+ }
1436
+
1437
+ .dlg .dfield {
1438
+ display: flex;
1439
+ flex-direction: column;
1440
+ gap: 4px;
1441
+ margin-bottom: 12px;
1442
+ flex: 1;
1443
+ }
1444
+
1445
+ .dlg .dfield label {
1446
+ font-size: 13px;
1447
+ color: #445;
1448
+ }
1449
+
1450
+ .dlg .dfield input {
1451
+ border: 1px solid #cfd6df;
1452
+ border-radius: 6px;
1453
+ padding: 8px 10px;
1454
+ font: 14px inherit;
1455
+ min-width: 0;
1456
+ }
1457
+
1458
+ .dlg .drow {
1459
+ display: flex;
1460
+ gap: 10px;
1461
+ align-items: flex-end;
1462
+ }
1463
+
1464
+ .dlg button.txtbtn {
1465
+ border: 1px solid #cfd6df;
1466
+ background: #fff;
1467
+ color: #222f3e;
1468
+ border-radius: 6px;
1469
+ padding: 8px 12px;
1470
+ font: 13.5px inherit;
1471
+ cursor: pointer;
1472
+ white-space: nowrap;
1473
+ }
1474
+
1475
+ .dlg button.txtbtn:hover {
1476
+ background: #f0f4f9;
1477
+ }
1478
+
1296
1479
  .dlg table.kbd {
1297
1480
  border-collapse: collapse;
1298
1481
  width: 100%;