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/Artalk.mjs
CHANGED
|
@@ -4493,7 +4493,7 @@ const en = {
|
|
|
4493
4493
|
link: "Website",
|
|
4494
4494
|
emoticon: "Emoji",
|
|
4495
4495
|
preview: "Preview",
|
|
4496
|
-
|
|
4496
|
+
uploadImage: "Upload Image",
|
|
4497
4497
|
uploadFail: "Upload Failed",
|
|
4498
4498
|
commentFail: "Failed to comment",
|
|
4499
4499
|
restoredMsg: "Content has been restored",
|
|
@@ -4566,14 +4566,14 @@ const zhCN = {
|
|
|
4566
4566
|
/* Editor */
|
|
4567
4567
|
placeholder: "键入内容...",
|
|
4568
4568
|
noComment: "「此时无声胜有声」",
|
|
4569
|
-
send: "
|
|
4570
|
-
save: "
|
|
4569
|
+
send: "发送",
|
|
4570
|
+
save: "保存",
|
|
4571
4571
|
nick: "昵称",
|
|
4572
4572
|
email: "邮箱",
|
|
4573
4573
|
link: "网址",
|
|
4574
4574
|
emoticon: "表情",
|
|
4575
4575
|
preview: "预览",
|
|
4576
|
-
|
|
4576
|
+
uploadImage: "上传图片",
|
|
4577
4577
|
uploadFail: "上传失败",
|
|
4578
4578
|
commentFail: "评论失败",
|
|
4579
4579
|
restoredMsg: "内容已自动恢复",
|
|
@@ -5549,7 +5549,7 @@ class Component {
|
|
|
5549
5549
|
return this.$el;
|
|
5550
5550
|
}
|
|
5551
5551
|
}
|
|
5552
|
-
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';
|
|
5552
|
+
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';
|
|
5553
5553
|
const Sel = {
|
|
5554
5554
|
$header: ".atk-header",
|
|
5555
5555
|
$nick: '.atk-header [name="nick"]',
|
|
@@ -5560,6 +5560,8 @@ const Sel = {
|
|
|
5560
5560
|
$bottom: ".atk-bottom",
|
|
5561
5561
|
$submitBtn: ".atk-send-btn",
|
|
5562
5562
|
$notifyWrap: ".atk-notify-wrap",
|
|
5563
|
+
$bottomLeft: ".atk-bottom-left",
|
|
5564
|
+
$stateWrap: ".atk-state-wrap",
|
|
5563
5565
|
$plugBtnWrap: ".atk-plug-btn-wrap",
|
|
5564
5566
|
$plugPanelWrap: ".atk-plug-panel-wrap"
|
|
5565
5567
|
};
|
|
@@ -7973,15 +7975,16 @@ class StateReply extends EditorPlug {
|
|
|
7973
7975
|
}
|
|
7974
7976
|
setReply(commentData) {
|
|
7975
7977
|
const ui = this.kit.useUI();
|
|
7976
|
-
if (!ui.$
|
|
7977
|
-
|
|
7978
|
-
`<
|
|
7978
|
+
if (!ui.$sendReplyBtn) {
|
|
7979
|
+
const $btn = createElement(
|
|
7980
|
+
`<span class="atk-state-btn"><span class="atk-text-wrap">${t("reply")} <span class="atk-text"></span></span><span class="atk-cancel">×</span></span>`
|
|
7979
7981
|
);
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
+
$btn.querySelector(".atk-text").innerText = `@${commentData.nick}`;
|
|
7983
|
+
$btn.addEventListener("click", () => {
|
|
7982
7984
|
this.kit.useEditor().resetState();
|
|
7983
7985
|
});
|
|
7984
|
-
ui.$
|
|
7986
|
+
ui.$stateWrap.append($btn);
|
|
7987
|
+
ui.$sendReplyBtn = $btn;
|
|
7985
7988
|
}
|
|
7986
7989
|
this.comment = commentData;
|
|
7987
7990
|
ui.$textarea.focus();
|
|
@@ -7990,9 +7993,9 @@ class StateReply extends EditorPlug {
|
|
|
7990
7993
|
if (!this.comment)
|
|
7991
7994
|
return;
|
|
7992
7995
|
const ui = this.kit.useUI();
|
|
7993
|
-
if (ui.$
|
|
7994
|
-
ui.$
|
|
7995
|
-
ui.$
|
|
7996
|
+
if (ui.$sendReplyBtn) {
|
|
7997
|
+
ui.$sendReplyBtn.remove();
|
|
7998
|
+
ui.$sendReplyBtn = void 0;
|
|
7996
7999
|
}
|
|
7997
8000
|
this.comment = void 0;
|
|
7998
8001
|
}
|
|
@@ -8039,12 +8042,12 @@ class StateEdit extends EditorPlug {
|
|
|
8039
8042
|
const ui = this.kit.useUI();
|
|
8040
8043
|
if (!ui.$editCancelBtn) {
|
|
8041
8044
|
const $btn = createElement(
|
|
8042
|
-
`<
|
|
8045
|
+
`<span class="atk-state-btn"><span class="atk-text-wrap">${t("editCancel")}</span><span class="atk-cancel">×</span></span>`
|
|
8043
8046
|
);
|
|
8044
8047
|
$btn.onclick = () => {
|
|
8045
8048
|
this.kit.useEditor().resetState();
|
|
8046
8049
|
};
|
|
8047
|
-
ui.$
|
|
8050
|
+
ui.$stateWrap.append($btn);
|
|
8048
8051
|
ui.$editCancelBtn = $btn;
|
|
8049
8052
|
}
|
|
8050
8053
|
this.comment = comment;
|
|
@@ -8241,7 +8244,7 @@ class Emoticons extends EditorPlug {
|
|
|
8241
8244
|
__publicField(this, "isImgLoaded", false);
|
|
8242
8245
|
this.kit.useMounted(() => {
|
|
8243
8246
|
this.usePanel(`<div class="atk-editor-plug-emoticons"></div>`);
|
|
8244
|
-
this.useBtn(t("emoticon"));
|
|
8247
|
+
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>`);
|
|
8245
8248
|
});
|
|
8246
8249
|
this.kit.useUnmounted(() => {
|
|
8247
8250
|
});
|
|
@@ -8492,7 +8495,7 @@ class Upload extends EditorPlug {
|
|
|
8492
8495
|
this.$imgUploadInput.type = "file";
|
|
8493
8496
|
this.$imgUploadInput.style.display = "none";
|
|
8494
8497
|
this.$imgUploadInput.accept = AllowImgExts.map((o) => `.${o}`).join(",");
|
|
8495
|
-
const $btn = this.useBtn(
|
|
8498
|
+
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>`);
|
|
8496
8499
|
$btn.after(this.$imgUploadInput);
|
|
8497
8500
|
$btn.onclick = () => {
|
|
8498
8501
|
const $input = this.$imgUploadInput;
|
|
@@ -8596,10 +8599,7 @@ class Preview extends EditorPlug {
|
|
|
8596
8599
|
__publicField(this, "isPlugPanelShow", false);
|
|
8597
8600
|
this.kit.useMounted(() => {
|
|
8598
8601
|
this.usePanel(`<div class="atk-editor-plug-preview"></div>`);
|
|
8599
|
-
|
|
8600
|
-
if (getInstance())
|
|
8601
|
-
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>`;
|
|
8602
|
-
this.useBtn(btnText);
|
|
8602
|
+
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>`);
|
|
8603
8603
|
});
|
|
8604
8604
|
this.kit.useUnmounted(() => {
|
|
8605
8605
|
});
|
|
@@ -8984,7 +8984,7 @@ const GotoFocus = (ctx) => {
|
|
|
8984
8984
|
comment.focus();
|
|
8985
8985
|
}));
|
|
8986
8986
|
};
|
|
8987
|
-
const version = "2.8.
|
|
8987
|
+
const version = "2.8.2";
|
|
8988
8988
|
const Copyright = (ctx) => {
|
|
8989
8989
|
ctx.on("mounted", () => {
|
|
8990
8990
|
const list2 = ctx.get("list");
|