@themarioga/grid-editor 9.2.5 → 9.3.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/CHANGELOG.md +51 -0
- package/README.md +68 -5
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +267 -0
- package/dist/grideditor.d.ts +88 -0
- package/dist/grideditor.esm.js +29 -6
- package/dist/grideditor.js +29 -6
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +102 -0
- package/dist/locales/grideditor.es.js +102 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.navbar.esm.js +2084 -0
- package/dist/plugins/grideditor.navbar.js +2085 -0
- package/dist/plugins/grideditor.navbar.min.js +1 -0
- package/dist/plugins/grideditor.navbar.min.js.map +7 -0
- package/dist/plugins/grideditor.sidenav.esm.js +1978 -0
- package/dist/plugins/grideditor.sidenav.js +1979 -0
- package/dist/plugins/grideditor.sidenav.min.js +1 -0
- package/dist/plugins/grideditor.sidenav.min.js.map +7 -0
- package/docs/events.md +5 -1
- package/docs/locale-keys.md +103 -1
- package/docs/plugins.md +27 -4
- package/example/containers.html +59 -2
- package/example/index.html +1 -1
- package/example/playground.html +2 -0
- package/package.json +1 -1
- package/src/js/grideditor.js +43 -5
- package/src/js/locales/grideditor.es.js +102 -0
- package/src/js/nav/browse.js +51 -0
- package/src/js/nav/canvas.js +170 -0
- package/src/js/nav/convert.js +175 -0
- package/src/js/nav/drawers.js +258 -0
- package/src/js/nav/feature.js +94 -0
- package/src/js/nav/locale.js +128 -0
- package/src/js/nav/markup.js +121 -0
- package/src/js/nav/panels.js +443 -0
- package/src/js/nav/pieces.js +207 -0
- package/src/js/plugins/grideditor.navbar.js +454 -0
- package/src/js/plugins/grideditor.sidenav.js +349 -0
- package/src/less/grideditor.less +199 -0
- package/types/grideditor.d.ts +88 -0
package/dist/grideditor.css
CHANGED
|
@@ -677,6 +677,14 @@ html.ge-sidebar-open {
|
|
|
677
677
|
/* Resizing: a grip on the column's edge, clear of the drawer, which is
|
|
678
678
|
what keeps the resize gesture and the sort gesture apart */
|
|
679
679
|
/* The units the column would land on, shown in its drawer while dragging */
|
|
680
|
+
/* Navbars and sidenavs. Every piece has a small drawer beside its text,
|
|
681
|
+
the part that folds is open and so are the menus, and nothing of
|
|
682
|
+
Bootstrap's javascript is involved: what it would open on a click is
|
|
683
|
+
rendered open here. */
|
|
684
|
+
/* The part of a navbar that folds is shown open, whichever the window.
|
|
685
|
+
Expanded, Bootstrap's own rules, which are !important, win */
|
|
686
|
+
/* A sidenav that becomes an offcanvas: the button and the panel both
|
|
687
|
+
show, at any width, as the offcanvas plugin's do */
|
|
680
688
|
}
|
|
681
689
|
.ge-canvas.ge-editing .ge-tools-drawer {
|
|
682
690
|
/* Positioned, so a tool can hang a picker off itself. Deliberately
|
|
@@ -1293,6 +1301,265 @@ html.ge-sidebar-open {
|
|
|
1293
1301
|
.ge-canvas.ge-editing .column.ge-resizing > .ge-tools-drawer > .ge-resize-size {
|
|
1294
1302
|
display: block;
|
|
1295
1303
|
}
|
|
1304
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"],
|
|
1305
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] {
|
|
1306
|
+
/* Rows and columns in a free zone are an ordinary region */
|
|
1307
|
+
/* A menu is shown open, in its place, and folded away with its tool */
|
|
1308
|
+
}
|
|
1309
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link,
|
|
1310
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link,
|
|
1311
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown,
|
|
1312
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown,
|
|
1313
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item,
|
|
1314
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item {
|
|
1315
|
+
display: flex;
|
|
1316
|
+
flex-wrap: wrap;
|
|
1317
|
+
align-items: center;
|
|
1318
|
+
}
|
|
1319
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > a,
|
|
1320
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > a,
|
|
1321
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > a,
|
|
1322
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > a,
|
|
1323
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > a,
|
|
1324
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > a,
|
|
1325
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > h6,
|
|
1326
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > h6,
|
|
1327
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > h6,
|
|
1328
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > h6,
|
|
1329
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > h6,
|
|
1330
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > h6,
|
|
1331
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > span,
|
|
1332
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > span,
|
|
1333
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > span,
|
|
1334
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > span,
|
|
1335
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > span,
|
|
1336
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > span,
|
|
1337
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > hr,
|
|
1338
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > hr,
|
|
1339
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > hr,
|
|
1340
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > hr,
|
|
1341
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > hr,
|
|
1342
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > hr {
|
|
1343
|
+
flex: 1 1 auto;
|
|
1344
|
+
}
|
|
1345
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > .dropdown-menu,
|
|
1346
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > .dropdown-menu,
|
|
1347
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > .dropdown-menu,
|
|
1348
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > .dropdown-menu,
|
|
1349
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > .dropdown-menu,
|
|
1350
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > .dropdown-menu,
|
|
1351
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-link > .collapse,
|
|
1352
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-link > .collapse,
|
|
1353
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > .collapse,
|
|
1354
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > .collapse,
|
|
1355
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-menu-item > .collapse,
|
|
1356
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-menu-item > .collapse {
|
|
1357
|
+
flex: 0 0 100%;
|
|
1358
|
+
}
|
|
1359
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-text,
|
|
1360
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-text,
|
|
1361
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-brand,
|
|
1362
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-brand {
|
|
1363
|
+
align-items: center;
|
|
1364
|
+
}
|
|
1365
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-text > .ge-pane-drawer,
|
|
1366
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-text > .ge-pane-drawer,
|
|
1367
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-brand > .ge-pane-drawer,
|
|
1368
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-brand > .ge-pane-drawer {
|
|
1369
|
+
margin-right: 4px;
|
|
1370
|
+
}
|
|
1371
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-text,
|
|
1372
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-text {
|
|
1373
|
+
display: inline-flex;
|
|
1374
|
+
}
|
|
1375
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-zone,
|
|
1376
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-zone {
|
|
1377
|
+
min-width: 10rem;
|
|
1378
|
+
padding: 5px;
|
|
1379
|
+
outline: 1px dashed #1D8A5E;
|
|
1380
|
+
outline-offset: -2px;
|
|
1381
|
+
}
|
|
1382
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > .dropdown-menu,
|
|
1383
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > .dropdown-menu {
|
|
1384
|
+
display: block;
|
|
1385
|
+
position: static;
|
|
1386
|
+
float: none;
|
|
1387
|
+
transform: none;
|
|
1388
|
+
margin: 0;
|
|
1389
|
+
}
|
|
1390
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown > .collapse,
|
|
1391
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown > .collapse {
|
|
1392
|
+
display: block;
|
|
1393
|
+
}
|
|
1394
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown.ge-nav-folded > .dropdown-menu,
|
|
1395
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown.ge-nav-folded > .dropdown-menu,
|
|
1396
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .ge-nav-dropdown.ge-nav-folded > .collapse,
|
|
1397
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] .ge-nav-dropdown.ge-nav-folded > .collapse {
|
|
1398
|
+
display: none;
|
|
1399
|
+
}
|
|
1400
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] {
|
|
1401
|
+
/* An offcanvas is a block in place: Bootstrap fixes it to the
|
|
1402
|
+
window and hides it until its javascript shows it */
|
|
1403
|
+
}
|
|
1404
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .navbar-collapse.collapse:not(.show) {
|
|
1405
|
+
display: block;
|
|
1406
|
+
}
|
|
1407
|
+
.ge-canvas.ge-editing [data-ge-container="navbar"] .offcanvas {
|
|
1408
|
+
position: static;
|
|
1409
|
+
z-index: auto;
|
|
1410
|
+
visibility: visible;
|
|
1411
|
+
transform: none;
|
|
1412
|
+
transition: none;
|
|
1413
|
+
width: auto;
|
|
1414
|
+
height: auto;
|
|
1415
|
+
max-width: none;
|
|
1416
|
+
}
|
|
1417
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > button {
|
|
1418
|
+
display: inline-block !important;
|
|
1419
|
+
margin-bottom: 5px;
|
|
1420
|
+
}
|
|
1421
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas {
|
|
1422
|
+
position: static;
|
|
1423
|
+
z-index: auto;
|
|
1424
|
+
visibility: visible;
|
|
1425
|
+
transform: none;
|
|
1426
|
+
transition: none;
|
|
1427
|
+
max-width: none;
|
|
1428
|
+
display: flex;
|
|
1429
|
+
}
|
|
1430
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas > .offcanvas-header {
|
|
1431
|
+
display: flex;
|
|
1432
|
+
}
|
|
1433
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-sm {
|
|
1434
|
+
position: static;
|
|
1435
|
+
z-index: auto;
|
|
1436
|
+
visibility: visible;
|
|
1437
|
+
transform: none;
|
|
1438
|
+
transition: none;
|
|
1439
|
+
max-width: none;
|
|
1440
|
+
display: flex;
|
|
1441
|
+
}
|
|
1442
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-sm > .offcanvas-header {
|
|
1443
|
+
display: flex;
|
|
1444
|
+
}
|
|
1445
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-md {
|
|
1446
|
+
position: static;
|
|
1447
|
+
z-index: auto;
|
|
1448
|
+
visibility: visible;
|
|
1449
|
+
transform: none;
|
|
1450
|
+
transition: none;
|
|
1451
|
+
max-width: none;
|
|
1452
|
+
display: flex;
|
|
1453
|
+
}
|
|
1454
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-md > .offcanvas-header {
|
|
1455
|
+
display: flex;
|
|
1456
|
+
}
|
|
1457
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-lg {
|
|
1458
|
+
position: static;
|
|
1459
|
+
z-index: auto;
|
|
1460
|
+
visibility: visible;
|
|
1461
|
+
transform: none;
|
|
1462
|
+
transition: none;
|
|
1463
|
+
max-width: none;
|
|
1464
|
+
display: flex;
|
|
1465
|
+
}
|
|
1466
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-lg > .offcanvas-header {
|
|
1467
|
+
display: flex;
|
|
1468
|
+
}
|
|
1469
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-xl {
|
|
1470
|
+
position: static;
|
|
1471
|
+
z-index: auto;
|
|
1472
|
+
visibility: visible;
|
|
1473
|
+
transform: none;
|
|
1474
|
+
transition: none;
|
|
1475
|
+
max-width: none;
|
|
1476
|
+
display: flex;
|
|
1477
|
+
}
|
|
1478
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-xl > .offcanvas-header {
|
|
1479
|
+
display: flex;
|
|
1480
|
+
}
|
|
1481
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-xxl {
|
|
1482
|
+
position: static;
|
|
1483
|
+
z-index: auto;
|
|
1484
|
+
visibility: visible;
|
|
1485
|
+
transform: none;
|
|
1486
|
+
transition: none;
|
|
1487
|
+
max-width: none;
|
|
1488
|
+
display: flex;
|
|
1489
|
+
}
|
|
1490
|
+
.ge-canvas.ge-editing [data-ge-container="sidenav"] > .offcanvas-xxl > .offcanvas-header {
|
|
1491
|
+
display: flex;
|
|
1492
|
+
}
|
|
1493
|
+
/* A navbar kept in place by Bootstrap's fixed-* and sticky-* would cover
|
|
1494
|
+
the editor: on the canvas it stays where it is in the page, the preview's
|
|
1495
|
+
too */
|
|
1496
|
+
.ge-canvas [data-ge-container="navbar"].fixed-top,
|
|
1497
|
+
.ge-canvas [data-ge-container="navbar"].fixed-bottom,
|
|
1498
|
+
.ge-canvas [data-ge-container="navbar"].sticky-top,
|
|
1499
|
+
.ge-canvas [data-ge-container="navbar"].sticky-bottom {
|
|
1500
|
+
position: static !important;
|
|
1501
|
+
}
|
|
1502
|
+
/* A breakpoint view narrows the canvas, not the window, and Bootstrap's
|
|
1503
|
+
classes answer to the window: so the navbar plugin says how the view lays
|
|
1504
|
+
a navbar out, and that is what shows - in the preview too. The selectors
|
|
1505
|
+
outweigh Bootstrap's !important utilities. In the all view there is no
|
|
1506
|
+
attribute, and the window decides */
|
|
1507
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-toggler {
|
|
1508
|
+
display: block !important;
|
|
1509
|
+
}
|
|
1510
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-collapse {
|
|
1511
|
+
display: none !important;
|
|
1512
|
+
flex-basis: 100% !important;
|
|
1513
|
+
}
|
|
1514
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-collapse.show,
|
|
1515
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-collapse.collapsing {
|
|
1516
|
+
display: block !important;
|
|
1517
|
+
}
|
|
1518
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-nav {
|
|
1519
|
+
flex-direction: column !important;
|
|
1520
|
+
}
|
|
1521
|
+
.ge-canvas [data-ge-navbar-layout="collapsed"] .navbar-nav .dropdown-menu {
|
|
1522
|
+
position: static !important;
|
|
1523
|
+
}
|
|
1524
|
+
.ge-canvas [data-ge-navbar-layout="expanded"] .navbar-toggler {
|
|
1525
|
+
display: none !important;
|
|
1526
|
+
}
|
|
1527
|
+
.ge-canvas [data-ge-navbar-layout="expanded"] .navbar-collapse {
|
|
1528
|
+
display: flex !important;
|
|
1529
|
+
flex-basis: auto !important;
|
|
1530
|
+
flex-grow: 1;
|
|
1531
|
+
}
|
|
1532
|
+
.ge-canvas [data-ge-navbar-layout="expanded"] .navbar-nav {
|
|
1533
|
+
flex-direction: row !important;
|
|
1534
|
+
}
|
|
1535
|
+
/* The same while editing: the part that folds is open, and an offcanvas is
|
|
1536
|
+
a block with its header when collapsed and plain content when expanded */
|
|
1537
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="collapsed"] .navbar-collapse {
|
|
1538
|
+
display: block !important;
|
|
1539
|
+
}
|
|
1540
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="collapsed"] .offcanvas {
|
|
1541
|
+
background-color: var(--bs-offcanvas-bg) !important;
|
|
1542
|
+
border: var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color) !important;
|
|
1543
|
+
}
|
|
1544
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="collapsed"] .offcanvas > .offcanvas-header {
|
|
1545
|
+
display: flex !important;
|
|
1546
|
+
}
|
|
1547
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="collapsed"] .offcanvas > .offcanvas-body {
|
|
1548
|
+
display: block !important;
|
|
1549
|
+
padding: var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x) !important;
|
|
1550
|
+
}
|
|
1551
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="expanded"] .offcanvas {
|
|
1552
|
+
background-color: transparent !important;
|
|
1553
|
+
border-width: 0 !important;
|
|
1554
|
+
}
|
|
1555
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="expanded"] .offcanvas > .offcanvas-header {
|
|
1556
|
+
display: none !important;
|
|
1557
|
+
}
|
|
1558
|
+
.ge-canvas.ge-editing [data-ge-navbar-layout="expanded"] .offcanvas > .offcanvas-body {
|
|
1559
|
+
display: flex !important;
|
|
1560
|
+
flex-grow: 0;
|
|
1561
|
+
padding: 0 !important;
|
|
1562
|
+
}
|
|
1296
1563
|
/* drawer_overflow: 'menu'. A drawer keeps its tools to one line; the ones
|
|
1297
1564
|
that don't fit are hidden behind a more tool at its end, which unfolds it
|
|
1298
1565
|
to show them all */
|
package/dist/grideditor.d.ts
CHANGED
|
@@ -140,6 +140,88 @@ export interface CreateOffcanvasOptions extends Placement, OffcanvasOptions {
|
|
|
140
140
|
trigger_label?: string;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/** A breakpoint a navbar or a sidenav answers to: Bootstrap has none below `sm`. */
|
|
144
|
+
export type NavBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
145
|
+
|
|
146
|
+
/** The backgrounds a navbar and a sidenav offer: `bg-*`. */
|
|
147
|
+
export type NavBackground = 'body-tertiary' | 'body' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
148
|
+
|
|
149
|
+
/** What the browse of the navbar and sidenav plugins is told: the node the field is for, which field, and what it shows. */
|
|
150
|
+
export interface NavBrowseContext {
|
|
151
|
+
node: HTMLElement;
|
|
152
|
+
/** `'href'` for a link, an item or the brand; `'src'` for the brand's image. */
|
|
153
|
+
property: 'href' | 'src';
|
|
154
|
+
value: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** The host's file browser of the navbar and sidenav plugins, with the form of `inline_style.browse`. */
|
|
158
|
+
export type NavBrowse = (
|
|
159
|
+
done: (url?: string | null) => void,
|
|
160
|
+
context: NavBrowseContext,
|
|
161
|
+
) => void | Promise<string | null | undefined>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The navbar plugin's options, the ones a navbar made new has, as the navbar
|
|
165
|
+
* setting gives them and createContainer overrides them.
|
|
166
|
+
*/
|
|
167
|
+
export interface NavbarOptions {
|
|
168
|
+
/** From this breakpoint up it is expanded; `true` always, `false` never. Default `'lg'`. */
|
|
169
|
+
expand?: boolean | NavBreakpoint;
|
|
170
|
+
/** How it folds: a collapse, an offcanvas, or `false` for not at all. Default `'collapse'`. */
|
|
171
|
+
collapse?: 'collapse' | 'offcanvas' | false;
|
|
172
|
+
/** The edge an offcanvas comes from. Default `'end'`. */
|
|
173
|
+
offcanvas_placement?: 'start' | 'end';
|
|
174
|
+
/** `bg-*`; `null` for none. Default `'body-tertiary'`. */
|
|
175
|
+
bg?: NavBackground | null;
|
|
176
|
+
/** `data-bs-theme`. Default null. */
|
|
177
|
+
theme?: 'light' | 'dark' | null;
|
|
178
|
+
/** `fixed-*` or `sticky-*`; null for in the flow. Default null. */
|
|
179
|
+
position?: 'fixed-top' | 'fixed-bottom' | 'sticky-top' | 'sticky-bottom' | null;
|
|
180
|
+
/** The width of what is inside: `'fluid'` (`container-fluid`), `'fixed'` (`container`) or a breakpoint (`container-{bp}`). Default `'fluid'`. */
|
|
181
|
+
width?: 'fluid' | 'fixed' | NavBreakpoint;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** The navbar setting: the options of the navbars made new, and the host's file browser. */
|
|
185
|
+
export interface NavbarSetting extends NavbarOptions {
|
|
186
|
+
browse?: NavBrowse;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** createContainer('navbar', …): the options, and the brand's text or `false` for none. */
|
|
190
|
+
export interface CreateNavbarOptions extends Placement, NavbarOptions {
|
|
191
|
+
brand?: string | false;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The sidenav plugin's options, the ones a sidebar made new has, as the
|
|
196
|
+
* sidenav setting gives them and createContainer overrides them.
|
|
197
|
+
*/
|
|
198
|
+
export interface SidenavOptions {
|
|
199
|
+
/** A css length the browser takes as a width. Default `'280px'`. */
|
|
200
|
+
width?: string;
|
|
201
|
+
/** `bg-*`; `null` for none. Default `'body-tertiary'`. */
|
|
202
|
+
bg?: NavBackground | null;
|
|
203
|
+
/** `data-bs-theme`. Default null. */
|
|
204
|
+
theme?: 'light' | 'dark' | null;
|
|
205
|
+
/** The links as pills, or plain. Default `'pills'`. */
|
|
206
|
+
style?: 'pills' | 'plain';
|
|
207
|
+
/** `vh-100 sticky-top overflow-y-auto`. Default false. */
|
|
208
|
+
full_height?: boolean;
|
|
209
|
+
/** Below this breakpoint it is an offcanvas a button opens; null for always visible. Default null. */
|
|
210
|
+
responsive?: NavBreakpoint | null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** The sidenav setting: the options of the sidebars made new, and the host's file browser. */
|
|
214
|
+
export interface SidenavSetting extends SidenavOptions {
|
|
215
|
+
browse?: NavBrowse;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** createContainer('sidenav', …): the options, the brand's text or `false` for none, and the button's text. */
|
|
219
|
+
export interface CreateSidenavOptions extends Placement, SidenavOptions {
|
|
220
|
+
brand?: string | false;
|
|
221
|
+
/** The text of the button that opens a responsive sidebar. */
|
|
222
|
+
trigger_label?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
143
225
|
/** What a file browser is told about the field it was opened from. */
|
|
144
226
|
export interface InlineStyleBrowseContext {
|
|
145
227
|
node: HTMLElement;
|
|
@@ -226,6 +308,10 @@ export interface GridEditorOptions {
|
|
|
226
308
|
carousel?: CarouselOptions;
|
|
227
309
|
/** The offcanvas plugin: the options of the offcanvases made new. */
|
|
228
310
|
offcanvas?: OffcanvasOptions;
|
|
311
|
+
/** The navbar plugin: the options of the navbars made new, and `browse`. */
|
|
312
|
+
navbar?: NavbarSetting;
|
|
313
|
+
/** The sidenav plugin: the options of the sidebars made new, and `browse`. */
|
|
314
|
+
sidenav?: SidenavSetting;
|
|
229
315
|
elements?: { enabled?: boolean | 'auto'; selector?: string; auto?: boolean; types?: ElementType[] };
|
|
230
316
|
/** The autosave plugin: what is edited, kept in the browser's storage as it changes. */
|
|
231
317
|
autosave?: AutosaveOptions;
|
|
@@ -594,6 +680,8 @@ export declare class GridEditor {
|
|
|
594
680
|
createContainer(type: 'tabs', options?: CreateTabsOptions): HTMLElement | null;
|
|
595
681
|
createContainer(type: 'carousel', options?: CreateCarouselOptions): HTMLElement | null;
|
|
596
682
|
createContainer(type: 'offcanvas', options?: CreateOffcanvasOptions): HTMLElement | null;
|
|
683
|
+
createContainer(type: 'navbar', options?: CreateNavbarOptions): HTMLElement | null;
|
|
684
|
+
createContainer(type: 'sidenav', options?: CreateSidenavOptions): HTMLElement | null;
|
|
597
685
|
createContainer(type: string, options?: Placement & Record<string, unknown>): HTMLElement | null;
|
|
598
686
|
addTab(container: Target, options?: PaneOptions): HTMLElement | null;
|
|
599
687
|
addAccordionItem(container: Target, options?: PaneOptions): HTMLElement | null;
|
package/dist/grideditor.esm.js
CHANGED
|
@@ -1841,6 +1841,11 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1841
1841
|
var type = button.getAttribute("data-ge-container-type");
|
|
1842
1842
|
var made = container ? CONTAINERS[type].create({}) : rowFromLayout(button.getAttribute("data-ge-layout"));
|
|
1843
1843
|
var placed = wrapFor(where.region, made);
|
|
1844
|
+
var holder = placed === made ? null : made.parentElement;
|
|
1845
|
+
if (!acceptsBlock(where.region, placed) || holder && !acceptsBlock(holder, made)) {
|
|
1846
|
+
where = canvasAfterTopOf(where.region);
|
|
1847
|
+
placed = wrapFor(where.region, made);
|
|
1848
|
+
}
|
|
1844
1849
|
return addNode(container ? type : "row", made, function() {
|
|
1845
1850
|
if (where.before) {
|
|
1846
1851
|
where.before.parentNode.insertBefore(placed, where.before);
|
|
@@ -2269,8 +2274,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2269
2274
|
function copyCanvas() {
|
|
2270
2275
|
var toLive = /* @__PURE__ */ new Map();
|
|
2271
2276
|
var toCopy = /* @__PURE__ */ new Map();
|
|
2277
|
+
var inert = document.implementation.createHTMLDocument("");
|
|
2272
2278
|
function copyNode(live) {
|
|
2273
|
-
var copied =
|
|
2279
|
+
var copied = inert.importNode(live, live.nodeName === "TEMPLATE");
|
|
2274
2280
|
if (live.nodeType !== 1) {
|
|
2275
2281
|
return copied;
|
|
2276
2282
|
}
|
|
@@ -3223,10 +3229,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3223
3229
|
});
|
|
3224
3230
|
}
|
|
3225
3231
|
}
|
|
3226
|
-
function createPaneControls(pane, kind, tools, confirmText, remove) {
|
|
3232
|
+
function createPaneControls(pane, kind, tools, confirmText, remove, options) {
|
|
3227
3233
|
var drawer = prependDrawer(pane, "ge-tools-drawer ge-pane-drawer");
|
|
3228
3234
|
createMoveTool(drawer);
|
|
3229
|
-
addSettingsTool(drawer, pane, settings.pane_classes);
|
|
3235
|
+
addSettingsTool(drawer, pane, options && options.presets ? options.presets : settings.pane_classes);
|
|
3230
3236
|
hostTools(drawer, tools);
|
|
3231
3237
|
createTool(drawer, t("tool.delete_pane"), "ge-delete-pane", "bi bi-trash", function() {
|
|
3232
3238
|
deleteNode(kind, pane, confirmText, function(removed) {
|
|
@@ -3275,11 +3281,13 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3275
3281
|
return;
|
|
3276
3282
|
}
|
|
3277
3283
|
var toggle2 = closest(label, "[data-bs-toggle], [data-ge-bs-toggle]");
|
|
3284
|
+
var keepApart = false;
|
|
3278
3285
|
editableLabels.add(label);
|
|
3279
3286
|
label.setAttribute("title", t("tool.rename"));
|
|
3280
3287
|
label.addEventListener("dblclick", function(e) {
|
|
3281
3288
|
e.preventDefault();
|
|
3282
3289
|
e.stopPropagation();
|
|
3290
|
+
keepApart = !!toggle2 && toggle2.hasAttribute("data-ge-bs-toggle");
|
|
3283
3291
|
suspendToggles(toggle2);
|
|
3284
3292
|
label.setAttribute("contenteditable", "true");
|
|
3285
3293
|
label.focus();
|
|
@@ -3296,7 +3304,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3296
3304
|
});
|
|
3297
3305
|
label.addEventListener("blur", function() {
|
|
3298
3306
|
label.removeAttribute("contenteditable");
|
|
3299
|
-
|
|
3307
|
+
if (!keepApart) {
|
|
3308
|
+
resumeToggles(toggle2);
|
|
3309
|
+
}
|
|
3300
3310
|
});
|
|
3301
3311
|
}
|
|
3302
3312
|
function labelIn(button) {
|
|
@@ -4420,9 +4430,18 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4420
4430
|
case "accordion-item":
|
|
4421
4431
|
return t("panel.kind_accordion_item");
|
|
4422
4432
|
default:
|
|
4423
|
-
return kind;
|
|
4433
|
+
return featureKindLabel(kind) || kind;
|
|
4424
4434
|
}
|
|
4425
4435
|
}
|
|
4436
|
+
function featureKindLabel(kind) {
|
|
4437
|
+
var label = null;
|
|
4438
|
+
pluginHooks("kindLabel").forEach(function(hook) {
|
|
4439
|
+
if (label === null) {
|
|
4440
|
+
label = hook(kind) || null;
|
|
4441
|
+
}
|
|
4442
|
+
});
|
|
4443
|
+
return label;
|
|
4444
|
+
}
|
|
4426
4445
|
function addAllColClasses() {
|
|
4427
4446
|
all(canvas, '.column, div[class*="col-"], div.col').forEach(function(col) {
|
|
4428
4447
|
addClass(col, "column");
|
|
@@ -4992,6 +5011,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4992
5011
|
return node;
|
|
4993
5012
|
}
|
|
4994
5013
|
var parent = placement === "appendTo" || placement === "prependTo" ? target : target.parentElement;
|
|
5014
|
+
if (parent && !acceptsBlock(parent, node)) {
|
|
5015
|
+
warn(kind + ": " + kindOf(parent) + " does not take it; nothing is added");
|
|
5016
|
+
return null;
|
|
5017
|
+
}
|
|
4995
5018
|
var add = function() {
|
|
4996
5019
|
return addNode(kind, node, function() {
|
|
4997
5020
|
if (placement === "appendTo") {
|
|
@@ -5424,7 +5447,7 @@ GridEditor.t = translate;
|
|
|
5424
5447
|
GridEditor._plainHtml = plainHtml;
|
|
5425
5448
|
GridEditor.Sortable = null;
|
|
5426
5449
|
GridEditor.bootstrap = null;
|
|
5427
|
-
GridEditor.version = false ? "dev" : "9.
|
|
5450
|
+
GridEditor.version = false ? "dev" : "9.3.0";
|
|
5428
5451
|
GridEditor.locales = {
|
|
5429
5452
|
en: {
|
|
5430
5453
|
"tool.move": "Move",
|
package/dist/grideditor.js
CHANGED
|
@@ -1842,6 +1842,11 @@
|
|
|
1842
1842
|
var type = button.getAttribute("data-ge-container-type");
|
|
1843
1843
|
var made = container ? CONTAINERS[type].create({}) : rowFromLayout(button.getAttribute("data-ge-layout"));
|
|
1844
1844
|
var placed = wrapFor(where.region, made);
|
|
1845
|
+
var holder = placed === made ? null : made.parentElement;
|
|
1846
|
+
if (!acceptsBlock(where.region, placed) || holder && !acceptsBlock(holder, made)) {
|
|
1847
|
+
where = canvasAfterTopOf(where.region);
|
|
1848
|
+
placed = wrapFor(where.region, made);
|
|
1849
|
+
}
|
|
1845
1850
|
return addNode(container ? type : "row", made, function() {
|
|
1846
1851
|
if (where.before) {
|
|
1847
1852
|
where.before.parentNode.insertBefore(placed, where.before);
|
|
@@ -2270,8 +2275,9 @@
|
|
|
2270
2275
|
function copyCanvas() {
|
|
2271
2276
|
var toLive = /* @__PURE__ */ new Map();
|
|
2272
2277
|
var toCopy = /* @__PURE__ */ new Map();
|
|
2278
|
+
var inert = document.implementation.createHTMLDocument("");
|
|
2273
2279
|
function copyNode(live) {
|
|
2274
|
-
var copied =
|
|
2280
|
+
var copied = inert.importNode(live, live.nodeName === "TEMPLATE");
|
|
2275
2281
|
if (live.nodeType !== 1) {
|
|
2276
2282
|
return copied;
|
|
2277
2283
|
}
|
|
@@ -3224,10 +3230,10 @@
|
|
|
3224
3230
|
});
|
|
3225
3231
|
}
|
|
3226
3232
|
}
|
|
3227
|
-
function createPaneControls(pane, kind, tools, confirmText, remove) {
|
|
3233
|
+
function createPaneControls(pane, kind, tools, confirmText, remove, options) {
|
|
3228
3234
|
var drawer = prependDrawer(pane, "ge-tools-drawer ge-pane-drawer");
|
|
3229
3235
|
createMoveTool(drawer);
|
|
3230
|
-
addSettingsTool(drawer, pane, settings.pane_classes);
|
|
3236
|
+
addSettingsTool(drawer, pane, options && options.presets ? options.presets : settings.pane_classes);
|
|
3231
3237
|
hostTools(drawer, tools);
|
|
3232
3238
|
createTool(drawer, t("tool.delete_pane"), "ge-delete-pane", "bi bi-trash", function() {
|
|
3233
3239
|
deleteNode(kind, pane, confirmText, function(removed) {
|
|
@@ -3276,11 +3282,13 @@
|
|
|
3276
3282
|
return;
|
|
3277
3283
|
}
|
|
3278
3284
|
var toggle2 = closest(label, "[data-bs-toggle], [data-ge-bs-toggle]");
|
|
3285
|
+
var keepApart = false;
|
|
3279
3286
|
editableLabels.add(label);
|
|
3280
3287
|
label.setAttribute("title", t("tool.rename"));
|
|
3281
3288
|
label.addEventListener("dblclick", function(e) {
|
|
3282
3289
|
e.preventDefault();
|
|
3283
3290
|
e.stopPropagation();
|
|
3291
|
+
keepApart = !!toggle2 && toggle2.hasAttribute("data-ge-bs-toggle");
|
|
3284
3292
|
suspendToggles(toggle2);
|
|
3285
3293
|
label.setAttribute("contenteditable", "true");
|
|
3286
3294
|
label.focus();
|
|
@@ -3297,7 +3305,9 @@
|
|
|
3297
3305
|
});
|
|
3298
3306
|
label.addEventListener("blur", function() {
|
|
3299
3307
|
label.removeAttribute("contenteditable");
|
|
3300
|
-
|
|
3308
|
+
if (!keepApart) {
|
|
3309
|
+
resumeToggles(toggle2);
|
|
3310
|
+
}
|
|
3301
3311
|
});
|
|
3302
3312
|
}
|
|
3303
3313
|
function labelIn(button) {
|
|
@@ -4421,9 +4431,18 @@
|
|
|
4421
4431
|
case "accordion-item":
|
|
4422
4432
|
return t("panel.kind_accordion_item");
|
|
4423
4433
|
default:
|
|
4424
|
-
return kind;
|
|
4434
|
+
return featureKindLabel(kind) || kind;
|
|
4425
4435
|
}
|
|
4426
4436
|
}
|
|
4437
|
+
function featureKindLabel(kind) {
|
|
4438
|
+
var label = null;
|
|
4439
|
+
pluginHooks("kindLabel").forEach(function(hook) {
|
|
4440
|
+
if (label === null) {
|
|
4441
|
+
label = hook(kind) || null;
|
|
4442
|
+
}
|
|
4443
|
+
});
|
|
4444
|
+
return label;
|
|
4445
|
+
}
|
|
4427
4446
|
function addAllColClasses() {
|
|
4428
4447
|
all(canvas, '.column, div[class*="col-"], div.col').forEach(function(col) {
|
|
4429
4448
|
addClass(col, "column");
|
|
@@ -4993,6 +5012,10 @@
|
|
|
4993
5012
|
return node;
|
|
4994
5013
|
}
|
|
4995
5014
|
var parent = placement === "appendTo" || placement === "prependTo" ? target : target.parentElement;
|
|
5015
|
+
if (parent && !acceptsBlock(parent, node)) {
|
|
5016
|
+
warn(kind + ": " + kindOf(parent) + " does not take it; nothing is added");
|
|
5017
|
+
return null;
|
|
5018
|
+
}
|
|
4996
5019
|
var add = function() {
|
|
4997
5020
|
return addNode(kind, node, function() {
|
|
4998
5021
|
if (placement === "appendTo") {
|
|
@@ -5425,7 +5448,7 @@
|
|
|
5425
5448
|
GridEditor._plainHtml = plainHtml;
|
|
5426
5449
|
GridEditor.Sortable = null;
|
|
5427
5450
|
GridEditor.bootstrap = null;
|
|
5428
|
-
GridEditor.version = false ? "dev" : "9.
|
|
5451
|
+
GridEditor.version = false ? "dev" : "9.3.0";
|
|
5429
5452
|
GridEditor.locales = {
|
|
5430
5453
|
en: {
|
|
5431
5454
|
"tool.move": "Move",
|