vue-devui 1.6.28 → 1.6.30
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/code-review/index.es.js +2 -1
- package/code-review/index.umd.js +17 -17
- package/editor-md/index.es.js +58 -21
- package/editor-md/index.umd.js +43 -43
- package/git-graph/index.es.js +23 -13
- package/git-graph/index.umd.js +17 -17
- package/git-graph/style.css +1 -0
- package/nuxt/components/GitGraph.js +1 -0
- package/nuxt/components/gitGraphProps.js +1 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/editor-md/src/composables/md-render-service.d.ts +1 -0
- package/types/editor-md/src/toolbar-config.d.ts +3 -0
- package/types/git-graph/src/git-graph.d.ts +1 -0
- package/vue-devui.es.js +84 -36
- package/vue-devui.umd.js +73 -73
package/editor-md/index.es.js
CHANGED
|
@@ -1509,13 +1509,26 @@ ToolBarHandler.fullscreen = (editor) => {
|
|
|
1509
1509
|
};
|
|
1510
1510
|
ToolBarHandler.color = () => {
|
|
1511
1511
|
};
|
|
1512
|
+
const GET_CTRL_KEY = () => {
|
|
1513
|
+
var _a;
|
|
1514
|
+
if (typeof window !== "undefined") {
|
|
1515
|
+
return ((_a = navigator == null ? void 0 : navigator.platform) == null ? void 0 : _a.indexOf("Mac")) !== -1 ? "\u2318" : "Ctrl";
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
const GET_ALT_KEY = () => {
|
|
1519
|
+
var _a;
|
|
1520
|
+
if (typeof window !== "undefined") {
|
|
1521
|
+
return ((_a = navigator == null ? void 0 : navigator.platform) == null ? void 0 : _a.indexOf("Mac")) !== -1 ? "\u2325" : "Alt";
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1512
1524
|
const DEFAULT_TOOLBARS = {
|
|
1513
1525
|
undo: {
|
|
1514
1526
|
id: "undo",
|
|
1515
1527
|
name: "undo",
|
|
1516
1528
|
type: "button",
|
|
1517
1529
|
icon: UNDO_ICON,
|
|
1518
|
-
shortKey:
|
|
1530
|
+
shortKey: `${GET_CTRL_KEY()}+Z`,
|
|
1531
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+90`,
|
|
1519
1532
|
handler: ToolBarHandler.undo
|
|
1520
1533
|
},
|
|
1521
1534
|
redo: {
|
|
@@ -1523,7 +1536,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1523
1536
|
name: "redo",
|
|
1524
1537
|
type: "button",
|
|
1525
1538
|
icon: REDO_ICON,
|
|
1526
|
-
shortKey:
|
|
1539
|
+
shortKey: `${GET_CTRL_KEY()}+Y`,
|
|
1540
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+89`,
|
|
1527
1541
|
handler: ToolBarHandler.redo
|
|
1528
1542
|
},
|
|
1529
1543
|
bold: {
|
|
@@ -1531,7 +1545,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1531
1545
|
name: "bold",
|
|
1532
1546
|
type: "button",
|
|
1533
1547
|
icon: BOLD_ICON,
|
|
1534
|
-
shortKey:
|
|
1548
|
+
shortKey: `${GET_CTRL_KEY()}+B`,
|
|
1549
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+66`,
|
|
1535
1550
|
handler: ToolBarHandler.bold
|
|
1536
1551
|
},
|
|
1537
1552
|
italic: {
|
|
@@ -1539,7 +1554,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1539
1554
|
name: "italic",
|
|
1540
1555
|
type: "button",
|
|
1541
1556
|
icon: ITALIC_ICON,
|
|
1542
|
-
shortKey:
|
|
1557
|
+
shortKey: `${GET_CTRL_KEY()}+I`,
|
|
1558
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+73`,
|
|
1543
1559
|
handler: ToolBarHandler.italic
|
|
1544
1560
|
},
|
|
1545
1561
|
strike: {
|
|
@@ -1547,7 +1563,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1547
1563
|
name: "strike",
|
|
1548
1564
|
type: "button",
|
|
1549
1565
|
icon: STRIKE_ICON,
|
|
1550
|
-
shortKey:
|
|
1566
|
+
shortKey: `${GET_CTRL_KEY()}+D`,
|
|
1567
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+68`,
|
|
1551
1568
|
handler: ToolBarHandler.strike
|
|
1552
1569
|
},
|
|
1553
1570
|
h1: {
|
|
@@ -1555,7 +1572,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1555
1572
|
name: "h1",
|
|
1556
1573
|
type: "button",
|
|
1557
1574
|
icon: H1_ICON,
|
|
1558
|
-
shortKey:
|
|
1575
|
+
shortKey: `${GET_CTRL_KEY()}+1`,
|
|
1576
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+49`,
|
|
1559
1577
|
handler: ToolBarHandler.h1
|
|
1560
1578
|
},
|
|
1561
1579
|
h2: {
|
|
@@ -1563,7 +1581,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1563
1581
|
name: "h2",
|
|
1564
1582
|
type: "button",
|
|
1565
1583
|
icon: H2_ICON,
|
|
1566
|
-
shortKey:
|
|
1584
|
+
shortKey: `${GET_CTRL_KEY()}+2`,
|
|
1585
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+50`,
|
|
1567
1586
|
handler: ToolBarHandler.h2
|
|
1568
1587
|
},
|
|
1569
1588
|
ul: {
|
|
@@ -1571,7 +1590,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1571
1590
|
name: "unorderedlist",
|
|
1572
1591
|
type: "button",
|
|
1573
1592
|
icon: LIST_UNORDERED_ICON,
|
|
1574
|
-
shortKey:
|
|
1593
|
+
shortKey: `${GET_CTRL_KEY()}+U`,
|
|
1594
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+85`,
|
|
1575
1595
|
handler: ToolBarHandler.ul
|
|
1576
1596
|
},
|
|
1577
1597
|
ol: {
|
|
@@ -1579,7 +1599,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1579
1599
|
name: "orderedlist",
|
|
1580
1600
|
type: "button",
|
|
1581
1601
|
icon: LIST_ORDERED_ICON,
|
|
1582
|
-
shortKey:
|
|
1602
|
+
shortKey: `${GET_CTRL_KEY()}+O`,
|
|
1603
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+79`,
|
|
1583
1604
|
handler: ToolBarHandler.ol
|
|
1584
1605
|
},
|
|
1585
1606
|
checklist: {
|
|
@@ -1587,7 +1608,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1587
1608
|
name: "checklist",
|
|
1588
1609
|
type: "button",
|
|
1589
1610
|
icon: LIST_CHECK_ICON,
|
|
1590
|
-
shortKey:
|
|
1611
|
+
shortKey: `${GET_CTRL_KEY()}+${GET_ALT_KEY()}+C`,
|
|
1612
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+${GET_ALT_KEY()}+67`,
|
|
1591
1613
|
handler: ToolBarHandler.checkList
|
|
1592
1614
|
},
|
|
1593
1615
|
underline: {
|
|
@@ -1595,7 +1617,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1595
1617
|
name: "underline",
|
|
1596
1618
|
type: "button",
|
|
1597
1619
|
icon: UNDERLINE_ICON,
|
|
1598
|
-
shortKey:
|
|
1620
|
+
shortKey: `${GET_CTRL_KEY()}+R`,
|
|
1621
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+82`,
|
|
1599
1622
|
handler: ToolBarHandler.underline
|
|
1600
1623
|
},
|
|
1601
1624
|
font: {
|
|
@@ -1611,7 +1634,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1611
1634
|
name: "link",
|
|
1612
1635
|
type: "button",
|
|
1613
1636
|
icon: LINK_ICON,
|
|
1614
|
-
shortKey:
|
|
1637
|
+
shortKey: `${GET_CTRL_KEY()}+L`,
|
|
1638
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+76`,
|
|
1615
1639
|
handler: ToolBarHandler.link
|
|
1616
1640
|
},
|
|
1617
1641
|
image: {
|
|
@@ -1619,7 +1643,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1619
1643
|
name: "image",
|
|
1620
1644
|
type: "button",
|
|
1621
1645
|
icon: IMAGE_ICON,
|
|
1622
|
-
shortKey:
|
|
1646
|
+
shortKey: `${GET_CTRL_KEY()}+G`,
|
|
1647
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+71`,
|
|
1623
1648
|
params: { imageUploadToServer: false },
|
|
1624
1649
|
handler: ToolBarHandler.image
|
|
1625
1650
|
},
|
|
@@ -1629,7 +1654,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1629
1654
|
type: "button",
|
|
1630
1655
|
icon: FILE_ICON,
|
|
1631
1656
|
params: {},
|
|
1632
|
-
shortKey:
|
|
1657
|
+
shortKey: `${GET_CTRL_KEY()}+F`,
|
|
1658
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+70`,
|
|
1633
1659
|
handler: ToolBarHandler.file
|
|
1634
1660
|
},
|
|
1635
1661
|
code: {
|
|
@@ -1637,7 +1663,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1637
1663
|
name: "code",
|
|
1638
1664
|
type: "button",
|
|
1639
1665
|
icon: CODE_ICON,
|
|
1640
|
-
shortKey:
|
|
1666
|
+
shortKey: `${GET_CTRL_KEY()}+K`,
|
|
1667
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+75`,
|
|
1641
1668
|
handler: ToolBarHandler.code
|
|
1642
1669
|
},
|
|
1643
1670
|
table: {
|
|
@@ -1645,7 +1672,8 @@ const DEFAULT_TOOLBARS = {
|
|
|
1645
1672
|
name: "table",
|
|
1646
1673
|
type: "button",
|
|
1647
1674
|
icon: TABLE_ICON,
|
|
1648
|
-
shortKey:
|
|
1675
|
+
shortKey: `${GET_CTRL_KEY()}+${GET_ALT_KEY()}+T`,
|
|
1676
|
+
shortKeyWithCode: `${GET_CTRL_KEY()}+${GET_ALT_KEY()}+84`,
|
|
1649
1677
|
handler: ToolBarHandler.table
|
|
1650
1678
|
},
|
|
1651
1679
|
fullscreen: {
|
|
@@ -7477,8 +7505,8 @@ function useEditorMd(props, ctx) {
|
|
|
7477
7505
|
const tempToolbars = { ...toolbars, ...customToolbars == null ? void 0 : customToolbars.value };
|
|
7478
7506
|
for (const key of Object.keys(tempToolbars)) {
|
|
7479
7507
|
const toolbarItem = tempToolbars[key];
|
|
7480
|
-
if (toolbarItem.
|
|
7481
|
-
shortKeys[toolbarItem.
|
|
7508
|
+
if (toolbarItem.shortKeyWithCode && flatToolbarConfig.includes(toolbarItem.id)) {
|
|
7509
|
+
shortKeys[toolbarItem.shortKeyWithCode.replace(/\+/g, "-")] = (_a = toolbarItem.handler) == null ? void 0 : _a.bind(null, editorIns, toolbarItem.params);
|
|
7482
7510
|
}
|
|
7483
7511
|
}
|
|
7484
7512
|
editorIns.setOption(
|
|
@@ -7505,13 +7533,16 @@ function useEditorMd(props, ctx) {
|
|
|
7505
7533
|
if (e.ctrlKey) {
|
|
7506
7534
|
keyCombination += "Ctrl-";
|
|
7507
7535
|
}
|
|
7536
|
+
if (e.metaKey) {
|
|
7537
|
+
keyCombination += "\u2318-";
|
|
7538
|
+
}
|
|
7508
7539
|
if (e.altKey) {
|
|
7509
|
-
keyCombination +=
|
|
7540
|
+
keyCombination += `${GET_ALT_KEY()}-`;
|
|
7510
7541
|
}
|
|
7511
7542
|
if (e.shiftKey) {
|
|
7512
7543
|
keyCombination += "Shift-";
|
|
7513
7544
|
}
|
|
7514
|
-
keyCombination += e.
|
|
7545
|
+
keyCombination += e.keyCode;
|
|
7515
7546
|
if (shortKeys[keyCombination] && typeof shortKeys[keyCombination] === "function") {
|
|
7516
7547
|
e.preventDefault();
|
|
7517
7548
|
shortKeys[keyCombination]();
|
|
@@ -9141,7 +9172,12 @@ class MDRenderService {
|
|
|
9141
9172
|
});
|
|
9142
9173
|
}
|
|
9143
9174
|
onIgnoreTagAttr(tag, name, value, isWhiteAttr) {
|
|
9144
|
-
if (!isWhiteAttr && (name === "id" || tag === "span" && name === "style")) {
|
|
9175
|
+
if (!isWhiteAttr && (name === "id" || tag === "span" && name === "style" || tag === "a" && name === "href")) {
|
|
9176
|
+
return name + "=" + value;
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
onTagAttr(tag, name, value, isWhiteAttr) {
|
|
9180
|
+
if (isWhiteAttr && (tag === "a" && name === "href")) {
|
|
9145
9181
|
return name + "=" + value;
|
|
9146
9182
|
}
|
|
9147
9183
|
}
|
|
@@ -9173,6 +9209,7 @@ class MDRenderService {
|
|
|
9173
9209
|
html = filterXSS(html, {
|
|
9174
9210
|
whiteList: this.xssWhiteList,
|
|
9175
9211
|
onIgnoreTagAttr: this.onIgnoreTagAttr,
|
|
9212
|
+
onTagAttr: this.onTagAttr,
|
|
9176
9213
|
css: {
|
|
9177
9214
|
whiteList: Object.assign({}, this.cssWhiteList, {
|
|
9178
9215
|
top: true,
|