@jx3box/jx3box-editor 2.2.46 → 2.2.47

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.
@@ -1,5 +1,6 @@
1
1
  import $ from "jquery";
2
2
  import { showAvatar } from "@jx3box/jx3box-common/js/utils";
3
+ import {getUserInfo} from "../../service/author";
3
4
 
4
5
  /**
5
6
  * 渲染音频组件
@@ -8,7 +9,7 @@ import { showAvatar } from "@jx3box/jx3box-common/js/utils";
8
9
  */
9
10
  function renderVoice(selector = ".w-audio, .e-audio") {
10
11
  try {
11
- $(selector).each(function (i, ele) {
12
+ $(selector).each(async function (i, ele) {
12
13
  const $audio = $(this);
13
14
  const content = $audio.text().trim();
14
15
 
@@ -22,19 +23,21 @@ function renderVoice(selector = ".w-audio, .e-audio") {
22
23
  });
23
24
 
24
25
  // 提取参数
25
- const { name = "未命名音频", author = "未知", user_id = "", src = "" } = params;
26
+ let { name = "未命名音频", author = "未知", user_id = "", src = "", avatar = "" } = params;
26
27
 
27
28
  if (!src) {
28
29
  console.warn("音频源地址为空", content);
29
30
  return;
30
31
  }
31
32
 
33
+ const user_info = await fetchUserInfo(user_id);
34
+ console.log("用户信息:", user_info);
35
+ avatar = showAvatar(user_info?.user_avatar || '', 240);
36
+ author = author || user_info?.display_name || '匿名用户';
37
+
32
38
  // 生成唯一ID
33
39
  const playerId = `audio-player-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
34
40
 
35
- // 获取用户头像,如果没有则使用默认图片
36
- const avatar = showAvatar(params.avatar, 240);
37
-
38
41
  // 渲染音频播放器 - 使用项目中定义的样式结构
39
42
  const html = `
40
43
  <div class="w-audio-player" id="${playerId}" data-user-id="${user_id}">
@@ -235,4 +238,12 @@ function checkTextWidth($player) {
235
238
  }
236
239
  }
237
240
 
241
+ function fetchUserInfo(userId) {
242
+ return getUserInfo(userId).then((res) => {
243
+ return res || null;
244
+ }).catch((err) => {
245
+ console.error("获取用户信息失败:", err);
246
+ });
247
+ }
248
+
238
249
  export default renderVoice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "2.2.46",
3
+ "version": "2.2.47",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -767,6 +767,7 @@
767
767
  margin-top: 0;
768
768
  margin-bottom: 0;
769
769
  line-height: 1.1;
770
+ text-combine-upright: none !important;
770
771
  }
771
772
  .w-qixue-box .w-qixue-clist {
772
773
  margin: 0;
@@ -1400,6 +1401,321 @@
1400
1401
  padding: 2px 8px;
1401
1402
  line-height: 21px;
1402
1403
  }
1404
+ .e-audio {
1405
+ min-height: 24px;
1406
+ border-radius: 4px;
1407
+ font-size: 14px;
1408
+ width: 100%;
1409
+ box-sizing: border-box;
1410
+ background-color: #f1f8ff;
1411
+ border: 1px solid #c8e1ff;
1412
+ color: #62a9ff;
1413
+ line-height: 1.6 !important;
1414
+ padding: 10px;
1415
+ padding-right: 135px;
1416
+ font-family: Monaco, Consolas, "Lucida Console", "Courier New", serif;
1417
+ word-break: break-all;
1418
+ white-space: pre-wrap !important;
1419
+ overflow-wrap: break-word;
1420
+ position: relative;
1421
+ *zoom: 1;
1422
+ }
1423
+ .e-audio:after {
1424
+ content: "JX3BOX·AUDIO";
1425
+ position: absolute;
1426
+ right: 8px;
1427
+ top: 8px;
1428
+ background-color: #62a9ff;
1429
+ color: #fff;
1430
+ border-radius: 3px;
1431
+ padding: 2px 8px;
1432
+ line-height: 21px;
1433
+ }
1434
+ .w-audio-player {
1435
+ position: relative;
1436
+ *zoom: 1;
1437
+ border-radius: 24px;
1438
+ box-sizing: border-box;
1439
+ width: 376px;
1440
+ background: rgba(255, 255, 255, 0.1);
1441
+ transition: all 0.3s ease-in-out;
1442
+ padding: 24px;
1443
+ }
1444
+ .w-audio-player .m-item {
1445
+ position: relative;
1446
+ cursor: pointer;
1447
+ border-radius: 16px;
1448
+ overflow: hidden;
1449
+ *zoom: 1;
1450
+ margin-bottom: 24px;
1451
+ color: #fff;
1452
+ padding: 32px 36px;
1453
+ box-sizing: border-box;
1454
+ width: 100%;
1455
+ background: linear-gradient(180deg, #7676f0 0%, #9495e9 100%);
1456
+ }
1457
+ .w-audio-player .m-item a {
1458
+ color: #fff;
1459
+ text-decoration: none;
1460
+ }
1461
+ .w-audio-player .m-item a:hover {
1462
+ text-decoration: none;
1463
+ box-shadow: none;
1464
+ }
1465
+ .w-audio-player .m-item img {
1466
+ padding: 0;
1467
+ margin: 0;
1468
+ border: none;
1469
+ }
1470
+ .w-audio-player .m-item::before {
1471
+ content: "";
1472
+ position: absolute;
1473
+ left: 0;
1474
+ top: 0;
1475
+ opacity: 0;
1476
+ filter: alpha(opacity=0);
1477
+ width: 100%;
1478
+ height: 100%;
1479
+ transition: opacity 0.3s ease-in-out;
1480
+ background: linear-gradient(180deg, #f9c27f 0%, #9697ed 100%);
1481
+ }
1482
+ .w-audio-player .m-item .u-title {
1483
+ display: flex;
1484
+ position: relative;
1485
+ *zoom: 1;
1486
+ font-weight: bold;
1487
+ font-size: 24px;
1488
+ text-align: center;
1489
+ justify-content: center;
1490
+ align-items: center;
1491
+ max-width: 300px;
1492
+ box-sizing: border-box;
1493
+ font-family: "ALIMAMASHUHEITI";
1494
+ }
1495
+ .w-audio-player .m-item .u-title .clip {
1496
+ overflow: hidden;
1497
+ *zoom: 1;
1498
+ width: 100%;
1499
+ }
1500
+ .w-audio-player .m-item .u-title .marquee-wrapper {
1501
+ white-space: nowrap;
1502
+ position: relative;
1503
+ display: inline-block;
1504
+ transition: transform 0s linear;
1505
+ }
1506
+ .w-audio-player .m-item .u-title .marquee-wrapper.marquee-animate {
1507
+ animation: marquee linear infinite;
1508
+ animation-fill-mode: forwards;
1509
+ }
1510
+ .w-audio-player .m-item .u-title .marquee-text {
1511
+ display: inline-block;
1512
+ }
1513
+ .w-audio-player .m-item .u-title .marquee-text::after {
1514
+ content: "》";
1515
+ display: inline-block;
1516
+ }
1517
+ .w-audio-player .m-item .u-title .marquee-text::before {
1518
+ content: "《";
1519
+ display: inline-block;
1520
+ }
1521
+ .w-audio-player .m-item .u-title .marquee-text.copy {
1522
+ margin-left: 180px;
1523
+ display: none;
1524
+ }
1525
+ .w-audio-player .m-item .u-title .marquee-text.copy::after,
1526
+ .w-audio-player .m-item .u-title .marquee-text.copy::before {
1527
+ display: none;
1528
+ }
1529
+ .w-audio-player .m-item .u-title.marquee-active .marquee-text.copy {
1530
+ display: inline-block;
1531
+ }
1532
+ .w-audio-player .m-item .u-title.marquee-active .marquee-animate .marquee-text::after,
1533
+ .w-audio-player .m-item .u-title.marquee-active .marquee-animate .marquee-text::before {
1534
+ display: none;
1535
+ }
1536
+ .w-audio-player .m-item .u-title.marquee-active::after {
1537
+ content: "》";
1538
+ display: inline-block;
1539
+ position: absolute;
1540
+ right: -28px;
1541
+ top: 50%;
1542
+ transform: translateY(-50%);
1543
+ z-index: 1;
1544
+ }
1545
+ .w-audio-player .m-item .u-title.marquee-active::before {
1546
+ content: "《";
1547
+ display: inline-block;
1548
+ position: absolute;
1549
+ left: -28px;
1550
+ top: 50%;
1551
+ transform: translateY(-50%);
1552
+ z-index: 1;
1553
+ }
1554
+ .w-audio-player .m-item .u-author {
1555
+ text-align: center;
1556
+ font-size: 14px;
1557
+ opacity: 0.75;
1558
+ filter: alpha(opacity=75);
1559
+ margin-top: 5px;
1560
+ }
1561
+ .w-audio-player .m-item .m-record {
1562
+ position: relative;
1563
+ *zoom: 1;
1564
+ padding: 42px 0 3px 0;
1565
+ }
1566
+ .w-audio-player .m-item .m-record .u-needle {
1567
+ position: absolute;
1568
+ left: 50%;
1569
+ top: 0;
1570
+ width: 120px;
1571
+ height: 72px;
1572
+ margin-left: -10px;
1573
+ user-select: none;
1574
+ pointer-events: none;
1575
+ transition: transform 0.3s ease-out, top 0.3s ease-out, margin 0.3s ease-out;
1576
+ transform-origin: 0% 0%;
1577
+ transform: rotate(0deg);
1578
+ }
1579
+ .w-audio-player .m-item .m-record .u-needle.isPlaying {
1580
+ top: -3px;
1581
+ margin: 0;
1582
+ transform-origin: 0% 0%;
1583
+ transform: rotate(30deg);
1584
+ display: inline-block;
1585
+ }
1586
+ .w-audio-player .m-item .m-record .u-record {
1587
+ display: block;
1588
+ width: 182px;
1589
+ height: 182px;
1590
+ margin-left: auto;
1591
+ margin-right: auto;
1592
+ user-select: none;
1593
+ padding: 28px;
1594
+ box-sizing: border-box;
1595
+ background: url("https://cdn.jx3box.com/design/event/jx3cxk/web/item/record.svg") no-repeat center center;
1596
+ background-size: 100% 100%;
1597
+ }
1598
+ .w-audio-player .m-item .m-record .u-avatar {
1599
+ border-radius: 50%;
1600
+ width: 100%;
1601
+ height: 100%;
1602
+ object-fit: cover;
1603
+ transition: transform 0.6s ease-out;
1604
+ }
1605
+ .w-audio-player .m-item .m-record .u-avatar.isRotate {
1606
+ animation: rotate 6s linear infinite;
1607
+ }
1608
+ .w-audio-player .m-item .m-record .u-avatar.isRotate.isPaused {
1609
+ animation-play-state: paused;
1610
+ }
1611
+ .w-audio-player .m-item .m-progress {
1612
+ position: relative;
1613
+ *zoom: 1;
1614
+ margin: 16px 0;
1615
+ }
1616
+ .w-audio-player .m-item .m-progress .u-progress-bar {
1617
+ position: relative;
1618
+ *zoom: 1;
1619
+ height: 3px;
1620
+ background: rgba(65, 61, 82, 0.3);
1621
+ border-radius: 3px;
1622
+ cursor: pointer;
1623
+ overflow: visible;
1624
+ }
1625
+ .w-audio-player .m-item .m-progress .u-progress-bar .u-progress-fill {
1626
+ position: absolute;
1627
+ height: 100%;
1628
+ background: #fff;
1629
+ border-radius: 3px;
1630
+ width: 0%;
1631
+ transition: width 0.1s linear;
1632
+ }
1633
+ .w-audio-player .m-item .m-progress .u-progress-bar .u-progress-handle {
1634
+ position: absolute;
1635
+ top: 50%;
1636
+ left: 0%;
1637
+ width: 12px;
1638
+ height: 12px;
1639
+ background: #fff;
1640
+ border: 2px solid rgba(65, 61, 82, 0.3);
1641
+ border-radius: 50%;
1642
+ transform: translate(-50%, -50%);
1643
+ cursor: pointer;
1644
+ transition: left 0.1s linear;
1645
+ }
1646
+ .w-audio-player .m-item .m-play {
1647
+ position: relative;
1648
+ *zoom: 1;
1649
+ display: flex;
1650
+ padding-top: 10px;
1651
+ flex-wrap: wrap;
1652
+ justify-content: space-between;
1653
+ align-items: center;
1654
+ }
1655
+ .w-audio-player .m-item .m-play .u-play-button {
1656
+ display: flex;
1657
+ justify-content: space-between;
1658
+ width: 70%;
1659
+ box-sizing: border-box;
1660
+ margin: 0 15% 20px 15%;
1661
+ align-items: center;
1662
+ }
1663
+ .w-audio-player .m-item .m-play .u-icon {
1664
+ width: 24px;
1665
+ height: 24px;
1666
+ }
1667
+ .w-audio-player .m-item .m-play .u-play {
1668
+ width: 64px;
1669
+ height: 64px;
1670
+ }
1671
+ .w-audio-player .m-item .m-play .u-like {
1672
+ opacity: 0.75;
1673
+ filter: alpha(opacity=75);
1674
+ display: flex;
1675
+ align-items: center;
1676
+ gap: 5px;
1677
+ }
1678
+ .w-audio-player .m-item .m-play .u-like .u-icon {
1679
+ width: 20px;
1680
+ height: 20px;
1681
+ }
1682
+ .w-audio-player .m-item .m-play .u-link {
1683
+ opacity: 0.75;
1684
+ filter: alpha(opacity=75);
1685
+ color: #fff;
1686
+ }
1687
+ .w-audio-player.play .m-item {
1688
+ background: linear-gradient(180deg, #55c79f 0%, #9697ed 100%);
1689
+ }
1690
+ .w-audio-player:hover {
1691
+ background: rgba(255, 255, 255, 0.15);
1692
+ }
1693
+ .w-audio-player:hover .m-item::before {
1694
+ opacity: 1;
1695
+ filter: alpha(opacity=100);
1696
+ }
1697
+ @keyframes rotate {
1698
+ from {
1699
+ transform: rotate(0deg);
1700
+ }
1701
+ to {
1702
+ transform: rotate(360deg);
1703
+ }
1704
+ }
1705
+ @keyframes marquee {
1706
+ 0% {
1707
+ transform: translateX(0);
1708
+ }
1709
+ 100% {
1710
+ transform: translateX(-100%);
1711
+ }
1712
+ }
1713
+ .c-article-tinymce .e-audio {
1714
+ display: none;
1715
+ }
1716
+ .c-article-editor .e-audio {
1717
+ display: block;
1718
+ }
1403
1719
  .c-article-directory h1,
1404
1720
  .c-article-directory h2,
1405
1721
  .c-article-directory h3,
@@ -8,12 +8,12 @@
8
8
  <title><%= htmlWebpackPlugin.options.title %></title>
9
9
  <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
10
10
  <script>
11
- // window.RX_TINYMCE_ROOT = "https://cdn.jx3box.com/static/tinymce";
12
- window.RX_TINYMCE_ROOT = "http://localhost:3000";
11
+ window.RX_TINYMCE_ROOT = "https://cdn.jx3box.com/static/tinymce";
12
+ // window.RX_TINYMCE_ROOT = "http://localhost:3000";
13
13
  </script>
14
- <!-- <script src="https://cdn.jx3box.com/static/tinymce/tinymce.min.js?v=1.9.0"></script> -->
14
+ <script src="https://cdn.jx3box.com/static/tinymce/tinymce.min.js?v=1.9.0"></script>
15
15
  <!-- TODO: -->
16
- <script src="http://localhost:3000/tinymce.min.js?v=1.9.0"></script>
16
+ <!-- <script src="http://localhost:3000/tinymce.min.js?v=1.9.0"></script> -->
17
17
  </head>
18
18
  <body>
19
19
  <div id="app"></div>
package/src/Article.vue CHANGED
@@ -66,7 +66,7 @@ import renderCode from "../assets/js/code";
66
66
  import renderImgPreview from "../assets/js/renderImgPreview";
67
67
  import renderPzIframe from "../assets/js/pz_iframe";
68
68
  import renderCombo from "../assets/js/combo";
69
- import renderVoice from "../assets/js/voice";
69
+ import renderAudio from "../assets/js/audio";
70
70
 
71
71
  // 剑三
72
72
  import Item from "./Item";
@@ -217,7 +217,7 @@ export default {
217
217
  // 连招
218
218
  renderCombo();
219
219
  // 音频
220
- renderVoice();
220
+ renderAudio();
221
221
  // 物品
222
222
  renderJx3Element(this);
223
223
  },
@@ -38,7 +38,7 @@ import Skill from "./Skill";
38
38
  import Npc from "./Npc";
39
39
  import renderJx3Element from "../assets/js/jx3_element";
40
40
  import renderImgPreview from "../assets/js/renderImgPreview";
41
- import renderVoice from "../assets/js/voice";
41
+ import renderAudio from "../assets/js/audio";
42
42
 
43
43
  import {xssOptions} from '../assets/data/markdown_whitelist.json'
44
44
 
@@ -118,7 +118,7 @@ export default {
118
118
  // 语法高亮
119
119
  renderCode(`code[class=^'lang-']`)
120
120
  // 音频
121
- renderVoice();
121
+ renderAudio();
122
122
  // 物品
123
123
  renderJx3Element(this);
124
124
  },
package/src/Tinymce.vue CHANGED
@@ -59,8 +59,7 @@ export default {
59
59
 
60
60
  // 样式
61
61
  // TODO:
62
- content_css:
63
- process.env.VUE_APP_DEV_COMPONENT == "true" ? "http://localhost:3000/skins/content/default/content.min.css" : `https://cdn.jx3box.com/static/jx3box-editor/css/article.css`,
62
+ content_css: process.env.VUE_APP_DEV_COMPONENT == "true" ? "/css/article.css" : `https://cdn.jx3box.com/static/jx3box-editor/css/article.css`,
64
63
  // content_css: `http://localhost:3000/skins/content/default/content.min.css`,
65
64
  body_class: "c-article c-article-editor c-article-tinymce",
66
65
  height: this.height || 800,
@@ -76,17 +75,17 @@ export default {
76
75
  "link autolink",
77
76
  "hr lists advlist table codeinline codesample checklist foldtext latex anchor",
78
77
  "image emoticons media videox macro qixue talent2",
79
- "code fullscreen wordcount powerpaste pagebreak printpage pz audio_x", // template anchor jx3icon autosave
78
+ "code fullscreen wordcount powerpaste pagebreak printpage pz audiox", // template anchor jx3icon autosave
80
79
  ],
81
80
  toolbar: [
82
81
  "undo | formatselect | fontsizeselect | forecolor backcolor | bold italic underline strikethrough superscript subscript | link unlink | fullscreen code", //anchor restoredraft
83
- "removeformat | hr alignleft aligncenter alignright alignjustify indent outdent | bullist numlist checklist table blockquote foldtext codeinline codesample latex | emoticons image media videox audio_x | macro pz qixue talent2 pagebreak printpage", // template anchor jx3icon
82
+ "removeformat | hr alignleft aligncenter alignright alignjustify indent outdent | bullist numlist checklist table blockquote foldtext codeinline codesample latex | emoticons image media videox audiox | macro pz qixue talent2 pagebreak printpage", // template anchor jx3icon
84
83
  ],
85
84
  mobile: {
86
85
  toolbar_drawer: true,
87
86
  toolbar: [
88
87
  "undo emoticons bold italic underline strikethrough superscript subscript link unlink forecolor backcolor removeformat pagebreak fullscreen code",
89
- "hr alignleft aligncenter alignright alignjustify indent outdent bullist numlist checklist table blockquote foldtext codeinline codesample latex macro pz qixue talent2 media videox audio_x",
88
+ "hr alignleft aligncenter alignright alignjustify indent outdent bullist numlist checklist table blockquote foldtext codeinline codesample latex macro pz qixue talent2 media videox audiox",
90
89
  ],
91
90
  },
92
91
  block_formats: "段落=p;一级标题=h1;二级标题=h2;三级标题=h3;四级标题=h4;五级标题=h5;六级标题=h6;",