artalk 2.8.1 → 2.8.2
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/dist/Artalk.cjs +1 -1
- package/dist/Artalk.cjs.map +1 -1
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.iife.js.map +1 -1
- package/dist/Artalk.js +2 -2
- package/dist/Artalk.js.map +1 -1
- package/dist/Artalk.mjs +23 -23
- package/dist/Artalk.mjs.map +1 -1
- package/dist/ArtalkLite.cjs +1 -1
- package/dist/ArtalkLite.cjs.map +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.iife.js.map +1 -1
- package/dist/ArtalkLite.js +2 -2
- package/dist/ArtalkLite.js.map +1 -1
- package/dist/ArtalkLite.mjs +23 -23
- package/dist/ArtalkLite.mjs.map +1 -1
- package/dist/i18n/jp.cjs +1 -1
- package/dist/i18n/jp.js +1 -1
- package/dist/i18n/jp.mjs +1 -1
- package/dist/i18n/zh-TW.cjs +1 -1
- package/dist/i18n/zh-TW.js +1 -1
- package/dist/i18n/zh-TW.mjs +3 -3
- package/dist/main.d.cts +4 -2
- package/dist/main.d.ts +4 -2
- package/package.json +1 -1
package/dist/ArtalkLite.mjs
CHANGED
|
@@ -2472,7 +2472,7 @@ const en = {
|
|
|
2472
2472
|
link: "Website",
|
|
2473
2473
|
emoticon: "Emoji",
|
|
2474
2474
|
preview: "Preview",
|
|
2475
|
-
|
|
2475
|
+
uploadImage: "Upload Image",
|
|
2476
2476
|
uploadFail: "Upload Failed",
|
|
2477
2477
|
commentFail: "Failed to comment",
|
|
2478
2478
|
restoredMsg: "Content has been restored",
|
|
@@ -2545,14 +2545,14 @@ const zhCN = {
|
|
|
2545
2545
|
/* Editor */
|
|
2546
2546
|
placeholder: "键入内容...",
|
|
2547
2547
|
noComment: "「此时无声胜有声」",
|
|
2548
|
-
send: "
|
|
2549
|
-
save: "
|
|
2548
|
+
send: "发送",
|
|
2549
|
+
save: "保存",
|
|
2550
2550
|
nick: "昵称",
|
|
2551
2551
|
email: "邮箱",
|
|
2552
2552
|
link: "网址",
|
|
2553
2553
|
emoticon: "表情",
|
|
2554
2554
|
preview: "预览",
|
|
2555
|
-
|
|
2555
|
+
uploadImage: "上传图片",
|
|
2556
2556
|
uploadFail: "上传失败",
|
|
2557
2557
|
commentFail: "评论失败",
|
|
2558
2558
|
restoredMsg: "内容已自动恢复",
|
|
@@ -3528,7 +3528,7 @@ class Component {
|
|
|
3528
3528
|
return this.$el;
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
3531
|
-
const EditorHTML = '<div class="atk-main-editor">\n <div class="atk-header">\n <input name="nick" class="atk-nick" type="text" required="required">\n <input name="email" class="atk-email" type="email" required="required">\n <input name="link" class="atk-link" type="url">\n </div>\n <div class="atk-textarea-wrap">\n <textarea class="atk-textarea"></textarea>\n </div>\n <div class="atk-plug-panel-wrap" style="display: none;"></div>\n <div class="atk-bottom">\n <div class="atk-item atk-plug-btn-wrap"></div>\n <div class="atk-item">\n <button type="button" class="atk-send-btn"></button>\n </div>\n </div>\n <div class="atk-notify-wrap"></div>\n</div>\n';
|
|
3531
|
+
const EditorHTML = '<div class="atk-main-editor">\n <div class="atk-header">\n <input name="nick" class="atk-nick" type="text" required="required">\n <input name="email" class="atk-email" type="email" required="required">\n <input name="link" class="atk-link" type="url">\n </div>\n <div class="atk-textarea-wrap">\n <textarea class="atk-textarea"></textarea>\n </div>\n <div class="atk-plug-panel-wrap" style="display: none;"></div>\n <div class="atk-bottom">\n <div class="atk-item atk-bottom-left">\n <span class="atk-state-wrap"></span>\n <span class="atk-plug-btn-wrap"></span>\n </div>\n <div class="atk-item">\n <button type="button" class="atk-send-btn"></button>\n </div>\n </div>\n <div class="atk-notify-wrap"></div>\n</div>\n';
|
|
3532
3532
|
const Sel = {
|
|
3533
3533
|
$header: ".atk-header",
|
|
3534
3534
|
$nick: '.atk-header [name="nick"]',
|
|
@@ -3539,6 +3539,8 @@ const Sel = {
|
|
|
3539
3539
|
$bottom: ".atk-bottom",
|
|
3540
3540
|
$submitBtn: ".atk-send-btn",
|
|
3541
3541
|
$notifyWrap: ".atk-notify-wrap",
|
|
3542
|
+
$bottomLeft: ".atk-bottom-left",
|
|
3543
|
+
$stateWrap: ".atk-state-wrap",
|
|
3542
3544
|
$plugBtnWrap: ".atk-plug-btn-wrap",
|
|
3543
3545
|
$plugPanelWrap: ".atk-plug-panel-wrap"
|
|
3544
3546
|
};
|
|
@@ -5952,15 +5954,16 @@ class StateReply extends EditorPlug {
|
|
|
5952
5954
|
}
|
|
5953
5955
|
setReply(commentData) {
|
|
5954
5956
|
const ui = this.kit.useUI();
|
|
5955
|
-
if (!ui.$
|
|
5956
|
-
|
|
5957
|
-
`<
|
|
5957
|
+
if (!ui.$sendReplyBtn) {
|
|
5958
|
+
const $btn = createElement(
|
|
5959
|
+
`<span class="atk-state-btn"><span class="atk-text-wrap">${t("reply")} <span class="atk-text"></span></span><span class="atk-cancel">×</span></span>`
|
|
5958
5960
|
);
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
+
$btn.querySelector(".atk-text").innerText = `@${commentData.nick}`;
|
|
5962
|
+
$btn.addEventListener("click", () => {
|
|
5961
5963
|
this.kit.useEditor().resetState();
|
|
5962
5964
|
});
|
|
5963
|
-
ui.$
|
|
5965
|
+
ui.$stateWrap.append($btn);
|
|
5966
|
+
ui.$sendReplyBtn = $btn;
|
|
5964
5967
|
}
|
|
5965
5968
|
this.comment = commentData;
|
|
5966
5969
|
ui.$textarea.focus();
|
|
@@ -5969,9 +5972,9 @@ class StateReply extends EditorPlug {
|
|
|
5969
5972
|
if (!this.comment)
|
|
5970
5973
|
return;
|
|
5971
5974
|
const ui = this.kit.useUI();
|
|
5972
|
-
if (ui.$
|
|
5973
|
-
ui.$
|
|
5974
|
-
ui.$
|
|
5975
|
+
if (ui.$sendReplyBtn) {
|
|
5976
|
+
ui.$sendReplyBtn.remove();
|
|
5977
|
+
ui.$sendReplyBtn = void 0;
|
|
5975
5978
|
}
|
|
5976
5979
|
this.comment = void 0;
|
|
5977
5980
|
}
|
|
@@ -6018,12 +6021,12 @@ class StateEdit extends EditorPlug {
|
|
|
6018
6021
|
const ui = this.kit.useUI();
|
|
6019
6022
|
if (!ui.$editCancelBtn) {
|
|
6020
6023
|
const $btn = createElement(
|
|
6021
|
-
`<
|
|
6024
|
+
`<span class="atk-state-btn"><span class="atk-text-wrap">${t("editCancel")}</span><span class="atk-cancel">×</span></span>`
|
|
6022
6025
|
);
|
|
6023
6026
|
$btn.onclick = () => {
|
|
6024
6027
|
this.kit.useEditor().resetState();
|
|
6025
6028
|
};
|
|
6026
|
-
ui.$
|
|
6029
|
+
ui.$stateWrap.append($btn);
|
|
6027
6030
|
ui.$editCancelBtn = $btn;
|
|
6028
6031
|
}
|
|
6029
6032
|
this.comment = comment;
|
|
@@ -6220,7 +6223,7 @@ class Emoticons extends EditorPlug {
|
|
|
6220
6223
|
__publicField(this, "isImgLoaded", false);
|
|
6221
6224
|
this.kit.useMounted(() => {
|
|
6222
6225
|
this.usePanel(`<div class="atk-editor-plug-emoticons"></div>`);
|
|
6223
|
-
this.useBtn(t("emoticon"));
|
|
6226
|
+
this.useBtn(`<i aria-label="${t("emoticon")}"><svg fill="currentColor" aria-hidden="true" height="14" viewBox="0 0 14 14" width="14"><path d="m4.26829 5.29294c0-.94317.45893-1.7074 1.02439-1.7074.56547 0 1.02439.76423 1.02439 1.7074s-.45892 1.7074-1.02439 1.7074c-.56546 0-1.02439-.76423-1.02439-1.7074zm4.43903 1.7074c.56546 0 1.02439-.76423 1.02439-1.7074s-.45893-1.7074-1.02439-1.7074c-.56547 0-1.02439.76423-1.02439 1.7074s.45892 1.7074 1.02439 1.7074zm-1.70732 2.73184c-1.51883 0-2.06312-1.52095-2.08361-1.58173l-1.29551.43231c.03414.10244.868 2.51604 3.3798 2.51604 2.51181 0 3.34502-2.41291 3.37982-2.51604l-1.29484-.43573c-.02254.06488-.56683 1.58583-2.08498 1.58583zm7-2.73252c0 3.86004-3.1401 7.00034-7 7.00034s-7-3.1396-7-6.99966c0-3.86009 3.1401-7.00034 7-7.00034s7 3.14025 7 7.00034zm-1.3659 0c0-3.10679-2.5275-5.63442-5.6341-5.63442-3.10663 0-5.63415 2.52832-5.63415 5.6351 0 3.10676 2.52752 5.63446 5.63415 5.63446 3.1066 0 5.6341-2.5277 5.6341-5.63446z"/></svg></i>`);
|
|
6224
6227
|
});
|
|
6225
6228
|
this.kit.useUnmounted(() => {
|
|
6226
6229
|
});
|
|
@@ -6471,7 +6474,7 @@ class Upload extends EditorPlug {
|
|
|
6471
6474
|
this.$imgUploadInput.type = "file";
|
|
6472
6475
|
this.$imgUploadInput.style.display = "none";
|
|
6473
6476
|
this.$imgUploadInput.accept = AllowImgExts.map((o) => `.${o}`).join(",");
|
|
6474
|
-
const $btn = this.useBtn(
|
|
6477
|
+
const $btn = this.useBtn(`<i aria-label="${t("uploadImage")}"><svg fill="currentColor" aria-hidden="true" height="14" viewBox="0 0 14 14" width="14"><path d="m0 1.94444c0-1.074107.870333-1.94444 1.94444-1.94444h10.11116c1.0741 0 1.9444.870333 1.9444 1.94444v10.11116c0 1.0741-.8703 1.9444-1.9444 1.9444h-10.11116c-1.074107 0-1.94444-.8703-1.94444-1.9444zm1.94444-.38888c-.21466 0-.38888.17422-.38888.38888v7.06689l2.33333-2.33333 2.33333 2.33333 3.88888-3.88889 2.3333 2.33334v-5.51134c0-.21466-.1742-.38888-.3888-.38888zm10.49996 8.09977-2.3333-2.33333-3.88888 3.8889-2.33333-2.33334-2.33333 2.33334v.8447c0 .2146.17422.3888.38888.3888h10.11116c.2146 0 .3888-.1742.3888-.3888zm-7.1944-6.54422c-.75133 0-1.36111.60978-1.36111 1.36111 0 .75134.60978 1.36111 1.36111 1.36111s1.36111-.60977 1.36111-1.36111c0-.75133-.60978-1.36111-1.36111-1.36111z"/></svg></i>`);
|
|
6475
6478
|
$btn.after(this.$imgUploadInput);
|
|
6476
6479
|
$btn.onclick = () => {
|
|
6477
6480
|
const $input = this.$imgUploadInput;
|
|
@@ -6575,10 +6578,7 @@ class Preview extends EditorPlug {
|
|
|
6575
6578
|
__publicField(this, "isPlugPanelShow", false);
|
|
6576
6579
|
this.kit.useMounted(() => {
|
|
6577
6580
|
this.usePanel(`<div class="atk-editor-plug-preview"></div>`);
|
|
6578
|
-
|
|
6579
|
-
if (getInstance())
|
|
6580
|
-
btnText += ` <i title="Markdown is supported"><svg class="markdown" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"></path></svg></i>`;
|
|
6581
|
-
this.useBtn(btnText);
|
|
6581
|
+
this.useBtn(`<i aria-label="${t("preview")}"><svg fill="currentColor" aria-hidden="true" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"></path></svg></i>`);
|
|
6582
6582
|
});
|
|
6583
6583
|
this.kit.useUnmounted(() => {
|
|
6584
6584
|
});
|
|
@@ -6963,7 +6963,7 @@ const GotoFocus = (ctx) => {
|
|
|
6963
6963
|
comment.focus();
|
|
6964
6964
|
}));
|
|
6965
6965
|
};
|
|
6966
|
-
const version = "2.8.
|
|
6966
|
+
const version = "2.8.2";
|
|
6967
6967
|
const Copyright = (ctx) => {
|
|
6968
6968
|
ctx.on("mounted", () => {
|
|
6969
6969
|
const list = ctx.get("list");
|