memi-board 0.60.0 → 0.62.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/README.md +10 -0
- package/dist/{ar-CiZZkAEi.js → ar-Dg9e1ruU.js} +38 -5
- package/dist/ar-Dg9e1ruU.js.map +1 -0
- package/dist/{commentImages-Cu3UUpeR.js → commentImages-DVrG0nFm.js} +172 -118
- package/dist/commentImages-DVrG0nFm.js.map +1 -0
- package/dist/composables/useMemiBoardComments.d.ts +105 -1
- package/dist/composables/useMemiBoardPosts.d.ts +109 -1
- package/dist/composables/useMemiBoardReports.d.ts +127 -1
- package/dist/{de-BmsTyFa1.js → de-CpGJ3KkZ.js} +38 -5
- package/dist/de-CpGJ3KkZ.js.map +1 -0
- package/dist/{en-Bizi62l1.js → en-PEe41L86.js} +38 -5
- package/dist/en-PEe41L86.js.map +1 -0
- package/dist/{es-wYEC2eO3.js → es-tMBUNff2.js} +38 -5
- package/dist/es-tMBUNff2.js.map +1 -0
- package/dist/{fr-C_ThACcX.js → fr-BFXp_PeM.js} +38 -5
- package/dist/fr-BFXp_PeM.js.map +1 -0
- package/dist/{id-CHzZpyk8.js → id-B7lgKUHZ.js} +38 -5
- package/dist/id-B7lgKUHZ.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1272 -1063
- package/dist/index.js.map +1 -1
- package/dist/{ja-CvlMTefX.js → ja-3SXam5Sk.js} +38 -5
- package/dist/ja-3SXam5Sk.js.map +1 -0
- package/dist/{pt-DKsrQ_yb.js → pt-C2_VknPa.js} +38 -5
- package/dist/pt-C2_VknPa.js.map +1 -0
- package/dist/runtime/components/CommentItem.vue +72 -3
- package/dist/runtime/components/CommentReportButton.vue +91 -0
- package/dist/runtime/components/CommentRevisions.vue +87 -0
- package/dist/runtime/components/Detail.vue +62 -4
- package/dist/runtime/components/Editor.vue +5 -1
- package/dist/runtime/components/PostRevisions.vue +107 -0
- package/dist/runtime/components/ReportButton.vue +12 -67
- package/dist/runtime/components/ReportList.vue +25 -5
- package/dist/runtime/components/ReportModalBody.vue +88 -0
- package/dist/storage.js +19 -19
- package/dist/types.d.ts +60 -2
- package/dist/utils/boardPaths.d.ts +11 -0
- package/dist/utils/editLimits.d.ts +6 -0
- package/dist/{zh-DiiqT_vJ.js → zh-CuOjIYyr.js} +38 -5
- package/dist/zh-CuOjIYyr.js.map +1 -0
- package/docs/firestore.rules.example +163 -11
- package/package.json +1 -1
- package/dist/ar-CiZZkAEi.js.map +0 -1
- package/dist/commentImages-Cu3UUpeR.js.map +0 -1
- package/dist/de-BmsTyFa1.js.map +0 -1
- package/dist/en-Bizi62l1.js.map +0 -1
- package/dist/es-wYEC2eO3.js.map +0 -1
- package/dist/fr-C_ThACcX.js.map +0 -1
- package/dist/id-CHzZpyk8.js.map +0 -1
- package/dist/ja-CvlMTefX.js.map +0 -1
- package/dist/pt-DKsrQ_yb.js.map +0 -1
- package/dist/zh-DiiqT_vJ.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as e, getCurrentInstance as t, hasInjectionContext as n, inject as r, onServerPrefetch as i, provide as a, reactive as o, shallowRef as s, toValue as c, watch as
|
|
2
|
-
import { collection as
|
|
1
|
+
import { computed as e, getCurrentInstance as t, hasInjectionContext as n, inject as r, onServerPrefetch as i, provide as a, reactive as o, shallowRef as s, toValue as c, watch as l } from "vue";
|
|
2
|
+
import { collection as u, doc as d } from "firebase/firestore";
|
|
3
3
|
//#region src/i18n/locales.ts
|
|
4
|
-
var
|
|
4
|
+
var f = [
|
|
5
5
|
{
|
|
6
6
|
code: "ko",
|
|
7
7
|
name: "한국어",
|
|
@@ -62,19 +62,19 @@ var d = [
|
|
|
62
62
|
intl: "id-ID",
|
|
63
63
|
dir: "ltr"
|
|
64
64
|
}
|
|
65
|
-
],
|
|
66
|
-
function
|
|
65
|
+
], p = "ko", m = "en", h = new Set(f.map((e) => e.code));
|
|
66
|
+
function g(e) {
|
|
67
67
|
if (typeof e != "string") return;
|
|
68
68
|
let t = e.trim().toLowerCase().split(/[-_]/)[0];
|
|
69
|
-
return t &&
|
|
69
|
+
return t && h.has(t) ? t : void 0;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
71
|
+
function _(e) {
|
|
72
|
+
return f.find((t) => t.code === e) ?? f[0];
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/utils/boardPaths.ts
|
|
76
|
-
var
|
|
77
|
-
function
|
|
76
|
+
var v = "memiBoardPosts", y = "memiBoardComments", b = "memiBoardLikes", x = "memiBoardReports", S = "memiBoardSettings", C = "memiBoardUsers";
|
|
77
|
+
function w(e) {
|
|
78
78
|
return {
|
|
79
79
|
postsCollection: e.postsCollection?.trim() || "memiBoardPosts",
|
|
80
80
|
commentsCollection: e.commentsCollection?.trim() || "memiBoardComments",
|
|
@@ -84,61 +84,82 @@ function C(e) {
|
|
|
84
84
|
usersCollection: e.usersCollection?.trim() || "memiBoardUsers"
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
return
|
|
87
|
+
function ee(e, t) {
|
|
88
|
+
return u(e, t.settingsCollection);
|
|
89
89
|
}
|
|
90
90
|
function te(e, t, n) {
|
|
91
|
-
return
|
|
91
|
+
return d(e, t.settingsCollection, n);
|
|
92
92
|
}
|
|
93
93
|
function ne(e, t) {
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
function T(e, t, n) {
|
|
97
|
-
return u(e, t.postsCollection, n);
|
|
94
|
+
return u(e, t.postsCollection);
|
|
98
95
|
}
|
|
99
96
|
function re(e, t, n) {
|
|
100
|
-
return
|
|
97
|
+
return d(e, t.postsCollection, n);
|
|
101
98
|
}
|
|
102
|
-
function ie(e, t) {
|
|
103
|
-
return
|
|
99
|
+
function ie(e, t, n) {
|
|
100
|
+
return d(e, t.postsCollection, n, "body", "main");
|
|
104
101
|
}
|
|
105
102
|
function ae(e, t, n) {
|
|
106
|
-
return u(e, t.
|
|
103
|
+
return u(e, t.postsCollection, n, "revisions");
|
|
107
104
|
}
|
|
108
|
-
function oe(e, t) {
|
|
109
|
-
return
|
|
105
|
+
function oe(e, t, n, r) {
|
|
106
|
+
return d(e, t.postsCollection, n, "revisions", String(r));
|
|
110
107
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
108
|
+
function se(e, t) {
|
|
109
|
+
return u(e, t.commentsCollection);
|
|
110
|
+
}
|
|
111
|
+
function ce(e, t, n) {
|
|
112
|
+
return d(e, t.commentsCollection, n);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return u(e, t.
|
|
114
|
+
function le(e, t, n) {
|
|
115
|
+
return u(e, t.commentsCollection, n, "revisions");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
function T(e, t, n, r) {
|
|
118
|
+
return d(e, t.commentsCollection, n, "revisions", String(r));
|
|
119
|
+
}
|
|
120
|
+
function E(e, t) {
|
|
121
|
+
return u(e, t.likesCollection);
|
|
119
122
|
}
|
|
120
123
|
function D(e, t) {
|
|
121
124
|
return `${e}_${t}`;
|
|
122
125
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
126
|
+
function ue(e, t, n, r) {
|
|
127
|
+
return d(e, t.likesCollection, D(n, r));
|
|
128
|
+
}
|
|
129
|
+
function de(e, t) {
|
|
130
|
+
return u(e, t.reportsCollection);
|
|
125
131
|
}
|
|
126
132
|
function O(e, t) {
|
|
127
|
-
return
|
|
133
|
+
return `${e}_${t}`;
|
|
128
134
|
}
|
|
129
|
-
function
|
|
130
|
-
return
|
|
135
|
+
function fe(e, t, n, r) {
|
|
136
|
+
return d(e, t.reportsCollection, O(n, r));
|
|
137
|
+
}
|
|
138
|
+
function k(e, t) {
|
|
139
|
+
return `c_${e}_${t}`;
|
|
140
|
+
}
|
|
141
|
+
function pe(e, t, n, r) {
|
|
142
|
+
return d(e, t.reportsCollection, k(n, r));
|
|
131
143
|
}
|
|
132
144
|
function A(e, t, n) {
|
|
133
|
-
return
|
|
145
|
+
return d(e, t.reportsCollection, n);
|
|
134
146
|
}
|
|
135
|
-
function
|
|
136
|
-
return u(e, t.usersCollection
|
|
147
|
+
function me(e, t) {
|
|
148
|
+
return u(e, t.usersCollection);
|
|
137
149
|
}
|
|
138
|
-
function
|
|
150
|
+
function he(e, t, n) {
|
|
151
|
+
return d(e, t.usersCollection, n);
|
|
152
|
+
}
|
|
153
|
+
function ge(e, t, n) {
|
|
154
|
+
return d(e, t.usersCollection, n, "private", "info");
|
|
155
|
+
}
|
|
156
|
+
function _e(e, t, n, r) {
|
|
157
|
+
return d(e, t.usersCollection, n, "memos", r);
|
|
158
|
+
}
|
|
159
|
+
function ve(e, t) {
|
|
139
160
|
return `${e.postsCollection}/${t}`;
|
|
140
161
|
}
|
|
141
|
-
function
|
|
162
|
+
function ye(e, t) {
|
|
142
163
|
return `${e.postsCollection}/${e.usersCollection}/${t}`;
|
|
143
164
|
}
|
|
144
165
|
//#endregion
|
|
@@ -147,12 +168,12 @@ var j = "__MEMI_BOARD_CONFIG__";
|
|
|
147
168
|
function M() {
|
|
148
169
|
let e = globalThis;
|
|
149
170
|
return e[j] || (e[j] = o({
|
|
150
|
-
postsCollection:
|
|
151
|
-
commentsCollection:
|
|
152
|
-
likesCollection:
|
|
153
|
-
reportsCollection:
|
|
154
|
-
settingsCollection:
|
|
155
|
-
usersCollection:
|
|
171
|
+
postsCollection: v,
|
|
172
|
+
commentsCollection: y,
|
|
173
|
+
likesCollection: b,
|
|
174
|
+
reportsCollection: x,
|
|
175
|
+
settingsCollection: S,
|
|
176
|
+
usersCollection: C,
|
|
156
177
|
auth: { providers: ["google", "apple"] },
|
|
157
178
|
moderation: {
|
|
158
179
|
enabled: !0,
|
|
@@ -172,7 +193,7 @@ function M() {
|
|
|
172
193
|
}
|
|
173
194
|
})), e[j];
|
|
174
195
|
}
|
|
175
|
-
function
|
|
196
|
+
function N(e) {
|
|
176
197
|
let t = M();
|
|
177
198
|
e.postsCollection != null && e.postsCollection !== "" && (t.postsCollection = e.postsCollection.trim()), e.commentsCollection != null && e.commentsCollection !== "" && (t.commentsCollection = e.commentsCollection.trim()), e.likesCollection != null && e.likesCollection !== "" && (t.likesCollection = e.likesCollection.trim()), e.reportsCollection != null && e.reportsCollection !== "" && (t.reportsCollection = e.reportsCollection.trim()), e.settingsCollection != null && e.settingsCollection !== "" && (t.settingsCollection = e.settingsCollection.trim()), e.usersCollection != null && e.usersCollection !== "" && (t.usersCollection = e.usersCollection.trim()), e.auth && Object.assign(t.auth, e.auth), e.moderation && Object.assign(t.moderation, e.moderation), e.seo && Object.assign(t.seo, e.seo), e.i18n && (t.i18n = {
|
|
178
199
|
...t.i18n,
|
|
@@ -185,49 +206,49 @@ function pe(e) {
|
|
|
185
206
|
...e.bannerGeneration
|
|
186
207
|
}), e.roleLabels && (t.roleLabels = { ...e.roleLabels }), e.locale && (t.locale = e.locale);
|
|
187
208
|
}
|
|
188
|
-
function N() {
|
|
189
|
-
return M();
|
|
190
|
-
}
|
|
191
209
|
function P() {
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
|
-
function me() {
|
|
195
|
-
if (!P()) throw Object.assign(/* @__PURE__ */ Error("AI features are disabled for this board service."), { code: "memi-board/ai-disabled" });
|
|
210
|
+
return M();
|
|
196
211
|
}
|
|
197
212
|
function F() {
|
|
198
|
-
|
|
199
|
-
|
|
213
|
+
return P().site?.disableAi !== !0;
|
|
214
|
+
}
|
|
215
|
+
function be() {
|
|
216
|
+
if (!F()) throw Object.assign(/* @__PURE__ */ Error("AI features are disabled for this board service."), { code: "memi-board/ai-disabled" });
|
|
200
217
|
}
|
|
201
218
|
function I() {
|
|
202
|
-
|
|
219
|
+
let e = P();
|
|
220
|
+
return e.site?.disableI18n !== !0 && e.i18n?.enabled !== !1;
|
|
203
221
|
}
|
|
204
222
|
function L() {
|
|
205
|
-
|
|
206
|
-
if (!F() || !t?.length) return e;
|
|
207
|
-
let n = new Set(t.map((e) => h(e)).filter(Boolean)), r = e.filter((e) => n.has(e));
|
|
208
|
-
return r.length ? r : e;
|
|
223
|
+
return F() && I() && P().translation?.enabled !== !1;
|
|
209
224
|
}
|
|
210
225
|
function R() {
|
|
211
|
-
let e =
|
|
212
|
-
|
|
226
|
+
let e = f.map((e) => e.code), t = P().site?.locales;
|
|
227
|
+
if (!I() || !t?.length) return e;
|
|
228
|
+
let n = new Set(t.map((e) => g(e)).filter(Boolean)), r = e.filter((e) => n.has(e));
|
|
229
|
+
return r.length ? r : e;
|
|
213
230
|
}
|
|
214
|
-
function z(
|
|
215
|
-
|
|
231
|
+
function z() {
|
|
232
|
+
let e = P(), t = e.site?.locale || e.locale, n = R(), r = g(t);
|
|
233
|
+
return n.length === f.length || r && n.includes(r) ? t : n[0];
|
|
234
|
+
}
|
|
235
|
+
function xe(e) {
|
|
236
|
+
P().site = {
|
|
216
237
|
disableAi: e?.disableAi === !0,
|
|
217
238
|
disableI18n: e?.disableI18n === !0,
|
|
218
239
|
locale: typeof e?.locale == "string" && e.locale ? e.locale : void 0,
|
|
219
240
|
locales: Array.isArray(e?.locales) ? e.locales.filter((e) => typeof e == "string") : void 0
|
|
220
241
|
};
|
|
221
242
|
}
|
|
222
|
-
function
|
|
223
|
-
if (!
|
|
243
|
+
function Se() {
|
|
244
|
+
if (!L()) throw Object.assign(/* @__PURE__ */ Error("Content translation is disabled for this board service."), { code: "memi-board/translation-disabled" });
|
|
224
245
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
246
|
+
function Ce() {
|
|
247
|
+
return w(P());
|
|
227
248
|
}
|
|
228
249
|
//#endregion
|
|
229
250
|
//#region src/i18n/messages/ko/index.ts
|
|
230
|
-
var
|
|
251
|
+
var we = {
|
|
231
252
|
accountDeletion: {
|
|
232
253
|
title: "회원 탈퇴",
|
|
233
254
|
intro: "계정과 개인정보를 삭제하려면 탈퇴를 진행해 주세요.",
|
|
@@ -372,7 +393,11 @@ var _e = {
|
|
|
372
393
|
edit: "댓글 수정",
|
|
373
394
|
blind: "댓글 블라인드",
|
|
374
395
|
unblind: "댓글 블라인드 해제",
|
|
375
|
-
delete: "댓글 삭제"
|
|
396
|
+
delete: "댓글 삭제",
|
|
397
|
+
edited: "수정됨",
|
|
398
|
+
editedTooltip: "{count}번 수정됨 · 마지막 수정 {time}",
|
|
399
|
+
history: "수정 기록",
|
|
400
|
+
editLimitTitle: "더 이상 수정할 수 없어요"
|
|
376
401
|
},
|
|
377
402
|
commentList: {
|
|
378
403
|
loading: "댓글을 불러오고 있습니다",
|
|
@@ -392,7 +417,9 @@ var _e = {
|
|
|
392
417
|
bodyTooLong: "댓글은 {max}자까지 작성할 수 있습니다.",
|
|
393
418
|
replyTargetNotFound: "답글 대상 댓글을 찾을 수 없습니다.",
|
|
394
419
|
threadNotFound: "댓글 스레드를 찾을 수 없습니다.",
|
|
395
|
-
hasRepliesCannotDelete: "답글이 있는 댓글은 현재 삭제할 수 없습니다."
|
|
420
|
+
hasRepliesCannotDelete: "답글이 있는 댓글은 현재 삭제할 수 없습니다.",
|
|
421
|
+
commentNotFound: "댓글을 찾을 수 없습니다.",
|
|
422
|
+
editLimitReached: "댓글 수정은 최대 {max}번까지 할 수 있어요. 더 고쳐야 하면 보드 관리자에게 요청해 주세요."
|
|
396
423
|
},
|
|
397
424
|
common: {
|
|
398
425
|
action: {
|
|
@@ -459,7 +486,12 @@ var _e = {
|
|
|
459
486
|
backToList: "목록으로 돌아가기",
|
|
460
487
|
postNav: "게시글 이동",
|
|
461
488
|
list: "목록",
|
|
462
|
-
comments: "댓글"
|
|
489
|
+
comments: "댓글",
|
|
490
|
+
edited: "수정됨",
|
|
491
|
+
editedCount: "{count}번 수정됨",
|
|
492
|
+
editedTooltip: "{count}번 수정됨 · 마지막 수정 {time}",
|
|
493
|
+
revisions: "수정 기록 {count}",
|
|
494
|
+
editLimitTitle: "더 이상 수정할 수 없어요"
|
|
463
495
|
},
|
|
464
496
|
editor: {
|
|
465
497
|
confirmLeave: "저장하지 않은 내용이 있습니다. 이 페이지를 나가시겠습니까?",
|
|
@@ -738,11 +770,22 @@ var _e = {
|
|
|
738
770
|
liftInDays: "약 {days}일 후 해제",
|
|
739
771
|
liftInDaysHours: "약 {days}일 {hours}시간 후 해제"
|
|
740
772
|
},
|
|
773
|
+
postRevisions: {
|
|
774
|
+
title: "수정 기록",
|
|
775
|
+
description: "수정으로 바뀌기 전의 내용이에요. 기록은 고치거나 지울 수 없고 보드 관리자만 볼 수 있어요.",
|
|
776
|
+
original: "원본",
|
|
777
|
+
version: "{version}차 수정본",
|
|
778
|
+
replacedAt: "{time}에 바뀜",
|
|
779
|
+
replacedBy: "수정한 사람: {name}",
|
|
780
|
+
empty: "남아 있는 수정 기록이 없어요.",
|
|
781
|
+
loadFailed: "수정 기록을 불러오지 못했어요."
|
|
782
|
+
},
|
|
741
783
|
posts: {
|
|
742
784
|
boardIdRequired: "[memi-board] boardId 가 필요합니다.",
|
|
743
785
|
photoRequired: "사진을 올려 주세요.",
|
|
744
786
|
bodyRequired: "본문에 글자를 입력하거나 이미지를 첨부해 주세요.",
|
|
745
|
-
titleRequired: "제목을 입력해 주세요."
|
|
787
|
+
titleRequired: "제목을 입력해 주세요.",
|
|
788
|
+
editLimitReached: "수정은 최대 {max}번까지 할 수 있어요. 더 고쳐야 하면 보드 관리자에게 요청해 주세요."
|
|
746
789
|
},
|
|
747
790
|
profile: {
|
|
748
791
|
myAccount: "내 계정",
|
|
@@ -773,6 +816,7 @@ var _e = {
|
|
|
773
816
|
bioPlaceholder: "나를 소개해 보세요"
|
|
774
817
|
},
|
|
775
818
|
reportButton: {
|
|
819
|
+
commentTitle: "댓글 신고",
|
|
776
820
|
failed: "신고하지 못했습니다.",
|
|
777
821
|
reported: "신고함",
|
|
778
822
|
title: "게시물 신고",
|
|
@@ -797,6 +841,14 @@ var _e = {
|
|
|
797
841
|
detailRequired: "자세한 내용 (기타 사유는 필수)"
|
|
798
842
|
},
|
|
799
843
|
reportList: {
|
|
844
|
+
target: {
|
|
845
|
+
post: "글",
|
|
846
|
+
comment: "댓글"
|
|
847
|
+
},
|
|
848
|
+
deletedComment: "댓글 내용 없음",
|
|
849
|
+
blindComment: "이 댓글도 블라인드 처리",
|
|
850
|
+
blindCommentHint: "모든 사용자에게 댓글을 가립니다. 스태프가 댓글에서 다시 해제할 수 있습니다.",
|
|
851
|
+
commentActionHint: "이 처리는 신고 상태만 변경합니다. 댓글을 숨기거나 삭제하지 않습니다.",
|
|
800
852
|
staffOnly: "스태프만 신고 목록을 볼 수 있습니다.",
|
|
801
853
|
loadFailed: "목록을 불러오지 못했습니다: {error}",
|
|
802
854
|
empty: "대기 중인 신고가 없습니다.",
|
|
@@ -821,6 +873,8 @@ var _e = {
|
|
|
821
873
|
actionFailed: "처리하지 못했습니다. 다시 시도해 주세요."
|
|
822
874
|
},
|
|
823
875
|
reports: {
|
|
876
|
+
cannotReportOwnComment: "자신의 댓글은 신고할 수 없습니다.",
|
|
877
|
+
alreadyReportedComment: "이미 신고한 댓글입니다.",
|
|
824
878
|
reason: {
|
|
825
879
|
spam: "스팸·광고",
|
|
826
880
|
abuse: "욕설·혐오·괴롭힘",
|
|
@@ -1223,28 +1277,28 @@ var _e = {
|
|
|
1223
1277
|
custom: "커스텀 스타일로 바꾸기…"
|
|
1224
1278
|
}
|
|
1225
1279
|
}
|
|
1226
|
-
},
|
|
1227
|
-
en: () => import("./en-
|
|
1228
|
-
ja: () => import("./ja-
|
|
1229
|
-
de: () => import("./de-
|
|
1230
|
-
fr: () => import("./fr-
|
|
1231
|
-
es: () => import("./es-
|
|
1232
|
-
pt: () => import("./pt-
|
|
1233
|
-
zh: () => import("./zh-
|
|
1234
|
-
ar: () => import("./ar-
|
|
1235
|
-
id: () => import("./id-
|
|
1280
|
+
}, Te = {
|
|
1281
|
+
en: () => import("./en-PEe41L86.js"),
|
|
1282
|
+
ja: () => import("./ja-3SXam5Sk.js"),
|
|
1283
|
+
de: () => import("./de-CpGJ3KkZ.js"),
|
|
1284
|
+
fr: () => import("./fr-BFXp_PeM.js"),
|
|
1285
|
+
es: () => import("./es-tMBUNff2.js"),
|
|
1286
|
+
pt: () => import("./pt-C2_VknPa.js"),
|
|
1287
|
+
zh: () => import("./zh-CuOjIYyr.js"),
|
|
1288
|
+
ar: () => import("./ar-Dg9e1ruU.js"),
|
|
1289
|
+
id: () => import("./id-B7lgKUHZ.js")
|
|
1236
1290
|
}, B = "__MEMI_BOARD_I18N__";
|
|
1237
1291
|
function V() {
|
|
1238
1292
|
let e = globalThis;
|
|
1239
1293
|
return e[B] ??= {
|
|
1240
|
-
messages: { ko:
|
|
1294
|
+
messages: { ko: we },
|
|
1241
1295
|
pending: {},
|
|
1242
1296
|
version: s(0)
|
|
1243
1297
|
}, e[B];
|
|
1244
1298
|
}
|
|
1245
1299
|
function H(e) {
|
|
1246
1300
|
let t = V();
|
|
1247
|
-
return t.messages[e] || e === "ko" ? Promise.resolve() : (t.pending[e] ??=
|
|
1301
|
+
return t.messages[e] || e === "ko" ? Promise.resolve() : (t.pending[e] ??= Te[e]().then((n) => {
|
|
1248
1302
|
t.messages[e] = n.default, t.version.value++;
|
|
1249
1303
|
}).catch((n) => {
|
|
1250
1304
|
delete t.pending[e], console.warn(`[memi-board] failed to load locale "${e}"`, n);
|
|
@@ -1253,7 +1307,7 @@ function H(e) {
|
|
|
1253
1307
|
function U(e) {
|
|
1254
1308
|
return e === "ko" ? Promise.resolve() : Promise.all([H(e), H("en")]).then(() => void 0);
|
|
1255
1309
|
}
|
|
1256
|
-
function
|
|
1310
|
+
function Ee(e) {
|
|
1257
1311
|
return !!V().messages[e];
|
|
1258
1312
|
}
|
|
1259
1313
|
function W(e, t) {
|
|
@@ -1264,7 +1318,7 @@ function W(e, t) {
|
|
|
1264
1318
|
}
|
|
1265
1319
|
return typeof n == "string" ? n : void 0;
|
|
1266
1320
|
}
|
|
1267
|
-
function
|
|
1321
|
+
function De(e, t) {
|
|
1268
1322
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => {
|
|
1269
1323
|
let r = t[n];
|
|
1270
1324
|
return r == null ? e : String(r);
|
|
@@ -1274,23 +1328,23 @@ function G(e, t, n) {
|
|
|
1274
1328
|
let r = V();
|
|
1275
1329
|
r.version.value;
|
|
1276
1330
|
let i = e ?? "ko", a = W(r.messages[i], t) ?? (i === "ko" ? void 0 : W(r.messages.en, t)) ?? W(r.messages.ko, t);
|
|
1277
|
-
return a == null ? t :
|
|
1331
|
+
return a == null ? t : De(a, n);
|
|
1278
1332
|
}
|
|
1279
1333
|
//#endregion
|
|
1280
1334
|
//#region src/utils/formatDate.ts
|
|
1281
1335
|
function K(e) {
|
|
1282
|
-
return
|
|
1336
|
+
return _(e ?? "ko").intl;
|
|
1283
1337
|
}
|
|
1284
1338
|
function q(e, t) {
|
|
1285
1339
|
return e?.toDate ? e.toDate().toLocaleDateString(K(t)) : "";
|
|
1286
1340
|
}
|
|
1287
|
-
var
|
|
1341
|
+
var Oe = 60, J = 3600, ke = 24 * J;
|
|
1288
1342
|
function Y(e, t = Date.now(), n) {
|
|
1289
1343
|
if (!e?.toDate) return G(n, "common.date.justNow");
|
|
1290
1344
|
let r = Math.max(0, Math.round((t - e.toDate().getTime()) / 1e3));
|
|
1291
1345
|
if (r < 45) return G(n, "common.date.fewSecondsAgo");
|
|
1292
|
-
let i = new Intl.RelativeTimeFormat(K(n), { numeric: "always" }), a = r /
|
|
1293
|
-
return r < 90 ? i.format(-1, "minute") : r < 2700 ? i.format(-Math.round(r /
|
|
1346
|
+
let i = new Intl.RelativeTimeFormat(K(n), { numeric: "always" }), a = r / ke;
|
|
1347
|
+
return r < 90 ? i.format(-1, "minute") : r < 2700 ? i.format(-Math.round(r / Oe), "minute") : r < 5400 ? i.format(-1, "hour") : r < 22 * J ? i.format(-Math.round(r / J), "hour") : r < 36 * J ? i.format(-1, "day") : a < 26 ? i.format(-Math.round(a), "day") : a < 46 ? i.format(-1, "month") : a < 320 ? i.format(-Math.round(a / 30.4), "month") : a < 548 ? i.format(-1, "year") : i.format(-Math.round(a / 365), "year");
|
|
1294
1348
|
}
|
|
1295
1349
|
function X(e, t) {
|
|
1296
1350
|
return e?.toDate ? new Intl.DateTimeFormat(K(t), {
|
|
@@ -1310,48 +1364,48 @@ function Z(e, t, n) {
|
|
|
1310
1364
|
//#endregion
|
|
1311
1365
|
//#region src/i18n/useMemiBoardI18n.ts
|
|
1312
1366
|
var Q = "memiBoard:hostLocale", $ = Symbol("memiBoard:boardLocale");
|
|
1313
|
-
function
|
|
1314
|
-
let s = n(),
|
|
1315
|
-
o.boardLocale !== void 0 && s && a($,
|
|
1316
|
-
let
|
|
1367
|
+
function Ae(o = {}) {
|
|
1368
|
+
let s = n(), u = s ? r($, null) : null, d = s ? r(Q, null) : null, f = P(), p = e(I), m = e(L), h = e(F), v = e(() => p.value ? g(c(o.boardLocale)) ?? u?.value ?? g(c(d)) ?? g(z()) ?? "ko" : g(z()) ?? "ko");
|
|
1369
|
+
o.boardLocale !== void 0 && s && a($, v), l(v, (e) => void U(e), { immediate: !0 }), t() && i(() => U(v.value));
|
|
1370
|
+
let y = e(() => _(v.value));
|
|
1317
1371
|
return {
|
|
1318
|
-
locale:
|
|
1319
|
-
i18nEnabled:
|
|
1320
|
-
translationEnabled:
|
|
1321
|
-
aiEnabled:
|
|
1322
|
-
dir: e(() =>
|
|
1323
|
-
intlLocale: e(() =>
|
|
1372
|
+
locale: v,
|
|
1373
|
+
i18nEnabled: p,
|
|
1374
|
+
translationEnabled: m,
|
|
1375
|
+
aiEnabled: h,
|
|
1376
|
+
dir: e(() => y.value.dir),
|
|
1377
|
+
intlLocale: e(() => y.value.intl),
|
|
1324
1378
|
t: (e, t) => {
|
|
1325
1379
|
let n = e.startsWith("common.role.") ? e.slice(12) : "";
|
|
1326
|
-
return
|
|
1380
|
+
return f.roleLabels?.[n] ?? G(v.value, e, t);
|
|
1327
1381
|
},
|
|
1328
|
-
formatDate: (e) => q(e,
|
|
1329
|
-
formatFullDate: (e) => X(e,
|
|
1330
|
-
formatRelativeDate: (e, t) => Y(e, t,
|
|
1331
|
-
formatTimestampDetails: (e, t) => Z(e, t,
|
|
1332
|
-
formatNumber: (e) => e.toLocaleString(
|
|
1382
|
+
formatDate: (e) => q(e, v.value),
|
|
1383
|
+
formatFullDate: (e) => X(e, v.value),
|
|
1384
|
+
formatRelativeDate: (e, t) => Y(e, t, v.value),
|
|
1385
|
+
formatTimestampDetails: (e, t) => Z(e, t, v.value),
|
|
1386
|
+
formatNumber: (e) => e.toLocaleString(y.value.intl)
|
|
1333
1387
|
};
|
|
1334
1388
|
}
|
|
1335
1389
|
//#endregion
|
|
1336
1390
|
//#region src/utils/slugify.ts
|
|
1337
|
-
var
|
|
1338
|
-
function
|
|
1391
|
+
var je = 40;
|
|
1392
|
+
function Me(e) {
|
|
1339
1393
|
return e.trim().replace(/\s+/g, "-").replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ-]/g, "").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
1340
1394
|
}
|
|
1341
|
-
function
|
|
1395
|
+
function Ne(e, t = 60) {
|
|
1342
1396
|
return e.replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎ._-]/g, "-").slice(0, t);
|
|
1343
1397
|
}
|
|
1344
1398
|
//#endregion
|
|
1345
1399
|
//#region src/utils/commentImages.ts
|
|
1346
|
-
var
|
|
1400
|
+
var Pe = /* @__PURE__ */ new Set([
|
|
1347
1401
|
"image/jpeg",
|
|
1348
1402
|
"image/png",
|
|
1349
1403
|
"image/gif",
|
|
1350
1404
|
"image/webp"
|
|
1351
1405
|
]);
|
|
1352
|
-
function
|
|
1406
|
+
function Fe(e) {
|
|
1353
1407
|
let t = (e.type || "").toLowerCase();
|
|
1354
|
-
if (
|
|
1408
|
+
if (Pe.has(t)) return !0;
|
|
1355
1409
|
let n = e.name.toLowerCase();
|
|
1356
1410
|
return [
|
|
1357
1411
|
".jpg",
|
|
@@ -1361,7 +1415,7 @@ function Oe(e) {
|
|
|
1361
1415
|
".webp"
|
|
1362
1416
|
].some((e) => n.endsWith(e));
|
|
1363
1417
|
}
|
|
1364
|
-
function
|
|
1418
|
+
function Ie(e) {
|
|
1365
1419
|
if (!e?.length) return [];
|
|
1366
1420
|
for (let t of e) if (t?.name && t.url?.startsWith("https://") && t.path && !t.path.includes("..") && t.type?.startsWith("image/") && !(!Number.isFinite(t.size) || t.size <= 0)) return [{
|
|
1367
1421
|
name: t.name.slice(0, 200),
|
|
@@ -1372,7 +1426,7 @@ function ke(e) {
|
|
|
1372
1426
|
}];
|
|
1373
1427
|
return [];
|
|
1374
1428
|
}
|
|
1375
|
-
function
|
|
1429
|
+
function Le(e, t) {
|
|
1376
1430
|
let n = t.endsWith("/") ? t : `${t}/`;
|
|
1377
1431
|
if (!Array.isArray(e)) return [];
|
|
1378
1432
|
let r = /* @__PURE__ */ new Set();
|
|
@@ -1384,6 +1438,6 @@ function Ae(e, t) {
|
|
|
1384
1438
|
return [...r];
|
|
1385
1439
|
}
|
|
1386
1440
|
//#endregion
|
|
1387
|
-
export {
|
|
1441
|
+
export { fe as $, x as A, k as B, z as C, y as D, P as E, he as F, D as G, le as H, ge as I, re as J, E as K, me as L, C as M, _e as N, b as O, ye as P, ne as Q, ce as R, L as S, Ce as T, se as U, T as V, ue as W, ae as X, oe as Y, ve as Z, be as _, Ne as a, te as at, F as b, Ae as c, f as ct, Y as d, A as et, Z as f, xe as g, G as h, je as i, ee as it, S as j, v as k, q as l, _ as lt, U as m, Fe as n, de as nt, Me as o, p as ot, Ee as p, ie as q, Ie as r, w as rt, Q as s, m as st, Le as t, O as tt, X as u, g as ut, Se as v, R as w, I as x, N as y, pe as z };
|
|
1388
1442
|
|
|
1389
|
-
//# sourceMappingURL=commentImages-
|
|
1443
|
+
//# sourceMappingURL=commentImages-DVrG0nFm.js.map
|