memi-board 0.61.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 +2 -0
- package/dist/{ar-B6HWpN6c.js → ar-Dg9e1ruU.js} +27 -5
- package/dist/ar-Dg9e1ruU.js.map +1 -0
- package/dist/{commentImages-DZBDCMWH.js → commentImages-DVrG0nFm.js} +164 -130
- 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/{de-CDaEV4cd.js → de-CpGJ3KkZ.js} +27 -5
- package/dist/de-CpGJ3KkZ.js.map +1 -0
- package/dist/{en-lbbULqlq.js → en-PEe41L86.js} +27 -5
- package/dist/en-PEe41L86.js.map +1 -0
- package/dist/{es-D8LzeTe0.js → es-tMBUNff2.js} +27 -5
- package/dist/es-tMBUNff2.js.map +1 -0
- package/dist/{fr-CQDZqx5d.js → fr-BFXp_PeM.js} +27 -5
- package/dist/fr-BFXp_PeM.js.map +1 -0
- package/dist/{id-CIaQbTzK.js → id-B7lgKUHZ.js} +27 -5
- package/dist/id-B7lgKUHZ.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1162 -1045
- package/dist/index.js.map +1 -1
- package/dist/{ja-B2iAAzYv.js → ja-3SXam5Sk.js} +27 -5
- package/dist/ja-3SXam5Sk.js.map +1 -0
- package/dist/{pt-CXAWS0Km.js → pt-C2_VknPa.js} +27 -5
- package/dist/pt-C2_VknPa.js.map +1 -0
- package/dist/runtime/components/CommentItem.vue +61 -2
- 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/storage.js +27 -27
- package/dist/types.d.ts +51 -0
- package/dist/utils/boardPaths.d.ts +6 -0
- package/dist/utils/editLimits.d.ts +6 -0
- package/dist/{zh-ByjHExJt.js → zh-CuOjIYyr.js} +27 -5
- package/dist/zh-CuOjIYyr.js.map +1 -0
- package/docs/firestore.rules.example +133 -2
- package/package.json +1 -1
- package/dist/ar-B6HWpN6c.js.map +0 -1
- package/dist/commentImages-DZBDCMWH.js.map +0 -1
- package/dist/de-CDaEV4cd.js.map +0 -1
- package/dist/en-lbbULqlq.js.map +0 -1
- package/dist/es-D8LzeTe0.js.map +0 -1
- package/dist/fr-CQDZqx5d.js.map +0 -1
- package/dist/id-CIaQbTzK.js.map +0 -1
- package/dist/ja-B2iAAzYv.js.map +0 -1
- package/dist/pt-CXAWS0Km.js.map +0 -1
- package/dist/zh-ByjHExJt.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,84 +84,96 @@ 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
|
-
function
|
|
91
|
-
return
|
|
90
|
+
function te(e, t, n) {
|
|
91
|
+
return d(e, t.settingsCollection, n);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
93
|
+
function ne(e, t) {
|
|
94
|
+
return u(e, t.postsCollection);
|
|
95
|
+
}
|
|
96
|
+
function re(e, t, n) {
|
|
97
|
+
return d(e, t.postsCollection, n);
|
|
95
98
|
}
|
|
96
99
|
function ie(e, t, n) {
|
|
97
|
-
return
|
|
100
|
+
return d(e, t.postsCollection, n, "body", "main");
|
|
98
101
|
}
|
|
99
102
|
function ae(e, t, n) {
|
|
100
|
-
return u(e, t.postsCollection, n, "
|
|
103
|
+
return u(e, t.postsCollection, n, "revisions");
|
|
101
104
|
}
|
|
102
|
-
function oe(e, t) {
|
|
103
|
-
return
|
|
105
|
+
function oe(e, t, n, r) {
|
|
106
|
+
return d(e, t.postsCollection, n, "revisions", String(r));
|
|
104
107
|
}
|
|
105
|
-
function se(e, t
|
|
106
|
-
return u(e, t.commentsCollection
|
|
108
|
+
function se(e, t) {
|
|
109
|
+
return u(e, t.commentsCollection);
|
|
107
110
|
}
|
|
108
|
-
function ce(e, t) {
|
|
109
|
-
return
|
|
111
|
+
function ce(e, t, n) {
|
|
112
|
+
return d(e, t.commentsCollection, n);
|
|
110
113
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
114
|
+
function le(e, t, n) {
|
|
115
|
+
return u(e, t.commentsCollection, n, "revisions");
|
|
113
116
|
}
|
|
114
117
|
function T(e, t, n, r) {
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
function le(e, t) {
|
|
118
|
-
return l(e, t.reportsCollection);
|
|
118
|
+
return d(e, t.commentsCollection, n, "revisions", String(r));
|
|
119
119
|
}
|
|
120
120
|
function E(e, t) {
|
|
121
|
+
return u(e, t.likesCollection);
|
|
122
|
+
}
|
|
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) {
|
|
133
|
+
return `${e}_${t}`;
|
|
134
|
+
}
|
|
135
|
+
function fe(e, t, n, r) {
|
|
136
|
+
return d(e, t.reportsCollection, O(n, r));
|
|
137
|
+
}
|
|
138
|
+
function k(e, t) {
|
|
127
139
|
return `c_${e}_${t}`;
|
|
128
140
|
}
|
|
129
|
-
function
|
|
130
|
-
return
|
|
141
|
+
function pe(e, t, n, r) {
|
|
142
|
+
return d(e, t.reportsCollection, k(n, r));
|
|
131
143
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
144
|
+
function A(e, t, n) {
|
|
145
|
+
return d(e, t.reportsCollection, n);
|
|
134
146
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
147
|
+
function me(e, t) {
|
|
148
|
+
return u(e, t.usersCollection);
|
|
137
149
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
150
|
+
function he(e, t, n) {
|
|
151
|
+
return d(e, t.usersCollection, n);
|
|
140
152
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
153
|
+
function ge(e, t, n) {
|
|
154
|
+
return d(e, t.usersCollection, n, "private", "info");
|
|
143
155
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
156
|
+
function _e(e, t, n, r) {
|
|
157
|
+
return d(e, t.usersCollection, n, "memos", r);
|
|
146
158
|
}
|
|
147
|
-
function
|
|
159
|
+
function ve(e, t) {
|
|
148
160
|
return `${e.postsCollection}/${t}`;
|
|
149
161
|
}
|
|
150
|
-
function
|
|
162
|
+
function ye(e, t) {
|
|
151
163
|
return `${e.postsCollection}/${e.usersCollection}/${t}`;
|
|
152
164
|
}
|
|
153
165
|
//#endregion
|
|
154
166
|
//#region src/config.ts
|
|
155
|
-
var
|
|
156
|
-
function
|
|
167
|
+
var j = "__MEMI_BOARD_CONFIG__";
|
|
168
|
+
function M() {
|
|
157
169
|
let e = globalThis;
|
|
158
|
-
return e[
|
|
159
|
-
postsCollection:
|
|
160
|
-
commentsCollection:
|
|
161
|
-
likesCollection:
|
|
162
|
-
reportsCollection:
|
|
163
|
-
settingsCollection:
|
|
164
|
-
usersCollection:
|
|
170
|
+
return e[j] || (e[j] = o({
|
|
171
|
+
postsCollection: v,
|
|
172
|
+
commentsCollection: y,
|
|
173
|
+
likesCollection: b,
|
|
174
|
+
reportsCollection: x,
|
|
175
|
+
settingsCollection: S,
|
|
176
|
+
usersCollection: C,
|
|
165
177
|
auth: { providers: ["google", "apple"] },
|
|
166
178
|
moderation: {
|
|
167
179
|
enabled: !0,
|
|
@@ -179,10 +191,10 @@ function j() {
|
|
|
179
191
|
defaultOgImage: "",
|
|
180
192
|
basePath: "/board"
|
|
181
193
|
}
|
|
182
|
-
})), e[
|
|
194
|
+
})), e[j];
|
|
183
195
|
}
|
|
184
|
-
function
|
|
185
|
-
let t =
|
|
196
|
+
function N(e) {
|
|
197
|
+
let t = M();
|
|
186
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 = {
|
|
187
199
|
...t.i18n,
|
|
188
200
|
...e.i18n
|
|
@@ -194,49 +206,49 @@ function _e(e) {
|
|
|
194
206
|
...e.bannerGeneration
|
|
195
207
|
}), e.roleLabels && (t.roleLabels = { ...e.roleLabels }), e.locale && (t.locale = e.locale);
|
|
196
208
|
}
|
|
197
|
-
function M() {
|
|
198
|
-
return j();
|
|
199
|
-
}
|
|
200
|
-
function N() {
|
|
201
|
-
return M().site?.disableAi !== !0;
|
|
202
|
-
}
|
|
203
209
|
function P() {
|
|
204
|
-
|
|
210
|
+
return M();
|
|
205
211
|
}
|
|
206
212
|
function F() {
|
|
207
|
-
|
|
208
|
-
|
|
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" });
|
|
209
217
|
}
|
|
210
218
|
function I() {
|
|
211
|
-
|
|
219
|
+
let e = P();
|
|
220
|
+
return e.site?.disableI18n !== !0 && e.i18n?.enabled !== !1;
|
|
212
221
|
}
|
|
213
222
|
function L() {
|
|
214
|
-
|
|
215
|
-
if (!F() || !t?.length) return e;
|
|
216
|
-
let n = new Set(t.map((e) => h(e)).filter(Boolean)), r = e.filter((e) => n.has(e));
|
|
217
|
-
return r.length ? r : e;
|
|
223
|
+
return F() && I() && P().translation?.enabled !== !1;
|
|
218
224
|
}
|
|
219
225
|
function R() {
|
|
220
|
-
let e =
|
|
221
|
-
|
|
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;
|
|
222
230
|
}
|
|
223
|
-
function
|
|
224
|
-
|
|
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 = {
|
|
225
237
|
disableAi: e?.disableAi === !0,
|
|
226
238
|
disableI18n: e?.disableI18n === !0,
|
|
227
239
|
locale: typeof e?.locale == "string" && e.locale ? e.locale : void 0,
|
|
228
240
|
locales: Array.isArray(e?.locales) ? e.locales.filter((e) => typeof e == "string") : void 0
|
|
229
241
|
};
|
|
230
242
|
}
|
|
231
|
-
function
|
|
232
|
-
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" });
|
|
233
245
|
}
|
|
234
|
-
function
|
|
235
|
-
return
|
|
246
|
+
function Ce() {
|
|
247
|
+
return w(P());
|
|
236
248
|
}
|
|
237
249
|
//#endregion
|
|
238
250
|
//#region src/i18n/messages/ko/index.ts
|
|
239
|
-
var
|
|
251
|
+
var we = {
|
|
240
252
|
accountDeletion: {
|
|
241
253
|
title: "회원 탈퇴",
|
|
242
254
|
intro: "계정과 개인정보를 삭제하려면 탈퇴를 진행해 주세요.",
|
|
@@ -381,7 +393,11 @@ var be = {
|
|
|
381
393
|
edit: "댓글 수정",
|
|
382
394
|
blind: "댓글 블라인드",
|
|
383
395
|
unblind: "댓글 블라인드 해제",
|
|
384
|
-
delete: "댓글 삭제"
|
|
396
|
+
delete: "댓글 삭제",
|
|
397
|
+
edited: "수정됨",
|
|
398
|
+
editedTooltip: "{count}번 수정됨 · 마지막 수정 {time}",
|
|
399
|
+
history: "수정 기록",
|
|
400
|
+
editLimitTitle: "더 이상 수정할 수 없어요"
|
|
385
401
|
},
|
|
386
402
|
commentList: {
|
|
387
403
|
loading: "댓글을 불러오고 있습니다",
|
|
@@ -401,7 +417,9 @@ var be = {
|
|
|
401
417
|
bodyTooLong: "댓글은 {max}자까지 작성할 수 있습니다.",
|
|
402
418
|
replyTargetNotFound: "답글 대상 댓글을 찾을 수 없습니다.",
|
|
403
419
|
threadNotFound: "댓글 스레드를 찾을 수 없습니다.",
|
|
404
|
-
hasRepliesCannotDelete: "답글이 있는 댓글은 현재 삭제할 수 없습니다."
|
|
420
|
+
hasRepliesCannotDelete: "답글이 있는 댓글은 현재 삭제할 수 없습니다.",
|
|
421
|
+
commentNotFound: "댓글을 찾을 수 없습니다.",
|
|
422
|
+
editLimitReached: "댓글 수정은 최대 {max}번까지 할 수 있어요. 더 고쳐야 하면 보드 관리자에게 요청해 주세요."
|
|
405
423
|
},
|
|
406
424
|
common: {
|
|
407
425
|
action: {
|
|
@@ -468,7 +486,12 @@ var be = {
|
|
|
468
486
|
backToList: "목록으로 돌아가기",
|
|
469
487
|
postNav: "게시글 이동",
|
|
470
488
|
list: "목록",
|
|
471
|
-
comments: "댓글"
|
|
489
|
+
comments: "댓글",
|
|
490
|
+
edited: "수정됨",
|
|
491
|
+
editedCount: "{count}번 수정됨",
|
|
492
|
+
editedTooltip: "{count}번 수정됨 · 마지막 수정 {time}",
|
|
493
|
+
revisions: "수정 기록 {count}",
|
|
494
|
+
editLimitTitle: "더 이상 수정할 수 없어요"
|
|
472
495
|
},
|
|
473
496
|
editor: {
|
|
474
497
|
confirmLeave: "저장하지 않은 내용이 있습니다. 이 페이지를 나가시겠습니까?",
|
|
@@ -747,11 +770,22 @@ var be = {
|
|
|
747
770
|
liftInDays: "약 {days}일 후 해제",
|
|
748
771
|
liftInDaysHours: "약 {days}일 {hours}시간 후 해제"
|
|
749
772
|
},
|
|
773
|
+
postRevisions: {
|
|
774
|
+
title: "수정 기록",
|
|
775
|
+
description: "수정으로 바뀌기 전의 내용이에요. 기록은 고치거나 지울 수 없고 보드 관리자만 볼 수 있어요.",
|
|
776
|
+
original: "원본",
|
|
777
|
+
version: "{version}차 수정본",
|
|
778
|
+
replacedAt: "{time}에 바뀜",
|
|
779
|
+
replacedBy: "수정한 사람: {name}",
|
|
780
|
+
empty: "남아 있는 수정 기록이 없어요.",
|
|
781
|
+
loadFailed: "수정 기록을 불러오지 못했어요."
|
|
782
|
+
},
|
|
750
783
|
posts: {
|
|
751
784
|
boardIdRequired: "[memi-board] boardId 가 필요합니다.",
|
|
752
785
|
photoRequired: "사진을 올려 주세요.",
|
|
753
786
|
bodyRequired: "본문에 글자를 입력하거나 이미지를 첨부해 주세요.",
|
|
754
|
-
titleRequired: "제목을 입력해 주세요."
|
|
787
|
+
titleRequired: "제목을 입력해 주세요.",
|
|
788
|
+
editLimitReached: "수정은 최대 {max}번까지 할 수 있어요. 더 고쳐야 하면 보드 관리자에게 요청해 주세요."
|
|
755
789
|
},
|
|
756
790
|
profile: {
|
|
757
791
|
myAccount: "내 계정",
|
|
@@ -1243,28 +1277,28 @@ var be = {
|
|
|
1243
1277
|
custom: "커스텀 스타일로 바꾸기…"
|
|
1244
1278
|
}
|
|
1245
1279
|
}
|
|
1246
|
-
},
|
|
1247
|
-
en: () => import("./en-
|
|
1248
|
-
ja: () => import("./ja-
|
|
1249
|
-
de: () => import("./de-
|
|
1250
|
-
fr: () => import("./fr-
|
|
1251
|
-
es: () => import("./es-
|
|
1252
|
-
pt: () => import("./pt-
|
|
1253
|
-
zh: () => import("./zh-
|
|
1254
|
-
ar: () => import("./ar-
|
|
1255
|
-
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")
|
|
1256
1290
|
}, B = "__MEMI_BOARD_I18N__";
|
|
1257
1291
|
function V() {
|
|
1258
1292
|
let e = globalThis;
|
|
1259
1293
|
return e[B] ??= {
|
|
1260
|
-
messages: { ko:
|
|
1294
|
+
messages: { ko: we },
|
|
1261
1295
|
pending: {},
|
|
1262
1296
|
version: s(0)
|
|
1263
1297
|
}, e[B];
|
|
1264
1298
|
}
|
|
1265
1299
|
function H(e) {
|
|
1266
1300
|
let t = V();
|
|
1267
|
-
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) => {
|
|
1268
1302
|
t.messages[e] = n.default, t.version.value++;
|
|
1269
1303
|
}).catch((n) => {
|
|
1270
1304
|
delete t.pending[e], console.warn(`[memi-board] failed to load locale "${e}"`, n);
|
|
@@ -1273,7 +1307,7 @@ function H(e) {
|
|
|
1273
1307
|
function U(e) {
|
|
1274
1308
|
return e === "ko" ? Promise.resolve() : Promise.all([H(e), H("en")]).then(() => void 0);
|
|
1275
1309
|
}
|
|
1276
|
-
function
|
|
1310
|
+
function Ee(e) {
|
|
1277
1311
|
return !!V().messages[e];
|
|
1278
1312
|
}
|
|
1279
1313
|
function W(e, t) {
|
|
@@ -1284,7 +1318,7 @@ function W(e, t) {
|
|
|
1284
1318
|
}
|
|
1285
1319
|
return typeof n == "string" ? n : void 0;
|
|
1286
1320
|
}
|
|
1287
|
-
function
|
|
1321
|
+
function De(e, t) {
|
|
1288
1322
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => {
|
|
1289
1323
|
let r = t[n];
|
|
1290
1324
|
return r == null ? e : String(r);
|
|
@@ -1294,23 +1328,23 @@ function G(e, t, n) {
|
|
|
1294
1328
|
let r = V();
|
|
1295
1329
|
r.version.value;
|
|
1296
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);
|
|
1297
|
-
return a == null ? t :
|
|
1331
|
+
return a == null ? t : De(a, n);
|
|
1298
1332
|
}
|
|
1299
1333
|
//#endregion
|
|
1300
1334
|
//#region src/utils/formatDate.ts
|
|
1301
1335
|
function K(e) {
|
|
1302
|
-
return
|
|
1336
|
+
return _(e ?? "ko").intl;
|
|
1303
1337
|
}
|
|
1304
1338
|
function q(e, t) {
|
|
1305
1339
|
return e?.toDate ? e.toDate().toLocaleDateString(K(t)) : "";
|
|
1306
1340
|
}
|
|
1307
|
-
var
|
|
1341
|
+
var Oe = 60, J = 3600, ke = 24 * J;
|
|
1308
1342
|
function Y(e, t = Date.now(), n) {
|
|
1309
1343
|
if (!e?.toDate) return G(n, "common.date.justNow");
|
|
1310
1344
|
let r = Math.max(0, Math.round((t - e.toDate().getTime()) / 1e3));
|
|
1311
1345
|
if (r < 45) return G(n, "common.date.fewSecondsAgo");
|
|
1312
|
-
let i = new Intl.RelativeTimeFormat(K(n), { numeric: "always" }), a = r /
|
|
1313
|
-
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");
|
|
1314
1348
|
}
|
|
1315
1349
|
function X(e, t) {
|
|
1316
1350
|
return e?.toDate ? new Intl.DateTimeFormat(K(t), {
|
|
@@ -1330,48 +1364,48 @@ function Z(e, t, n) {
|
|
|
1330
1364
|
//#endregion
|
|
1331
1365
|
//#region src/i18n/useMemiBoardI18n.ts
|
|
1332
1366
|
var Q = "memiBoard:hostLocale", $ = Symbol("memiBoard:boardLocale");
|
|
1333
|
-
function
|
|
1334
|
-
let s = n(),
|
|
1335
|
-
o.boardLocale !== void 0 && s && a($,
|
|
1336
|
-
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));
|
|
1337
1371
|
return {
|
|
1338
|
-
locale:
|
|
1339
|
-
i18nEnabled:
|
|
1340
|
-
translationEnabled:
|
|
1341
|
-
aiEnabled:
|
|
1342
|
-
dir: e(() =>
|
|
1343
|
-
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),
|
|
1344
1378
|
t: (e, t) => {
|
|
1345
1379
|
let n = e.startsWith("common.role.") ? e.slice(12) : "";
|
|
1346
|
-
return
|
|
1380
|
+
return f.roleLabels?.[n] ?? G(v.value, e, t);
|
|
1347
1381
|
},
|
|
1348
|
-
formatDate: (e) => q(e,
|
|
1349
|
-
formatFullDate: (e) => X(e,
|
|
1350
|
-
formatRelativeDate: (e, t) => Y(e, t,
|
|
1351
|
-
formatTimestampDetails: (e, t) => Z(e, t,
|
|
1352
|
-
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)
|
|
1353
1387
|
};
|
|
1354
1388
|
}
|
|
1355
1389
|
//#endregion
|
|
1356
1390
|
//#region src/utils/slugify.ts
|
|
1357
|
-
var
|
|
1358
|
-
function
|
|
1391
|
+
var je = 40;
|
|
1392
|
+
function Me(e) {
|
|
1359
1393
|
return e.trim().replace(/\s+/g, "-").replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ-]/g, "").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
1360
1394
|
}
|
|
1361
|
-
function
|
|
1395
|
+
function Ne(e, t = 60) {
|
|
1362
1396
|
return e.replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎ._-]/g, "-").slice(0, t);
|
|
1363
1397
|
}
|
|
1364
1398
|
//#endregion
|
|
1365
1399
|
//#region src/utils/commentImages.ts
|
|
1366
|
-
var
|
|
1400
|
+
var Pe = /* @__PURE__ */ new Set([
|
|
1367
1401
|
"image/jpeg",
|
|
1368
1402
|
"image/png",
|
|
1369
1403
|
"image/gif",
|
|
1370
1404
|
"image/webp"
|
|
1371
1405
|
]);
|
|
1372
|
-
function
|
|
1406
|
+
function Fe(e) {
|
|
1373
1407
|
let t = (e.type || "").toLowerCase();
|
|
1374
|
-
if (
|
|
1408
|
+
if (Pe.has(t)) return !0;
|
|
1375
1409
|
let n = e.name.toLowerCase();
|
|
1376
1410
|
return [
|
|
1377
1411
|
".jpg",
|
|
@@ -1381,7 +1415,7 @@ function je(e) {
|
|
|
1381
1415
|
".webp"
|
|
1382
1416
|
].some((e) => n.endsWith(e));
|
|
1383
1417
|
}
|
|
1384
|
-
function
|
|
1418
|
+
function Ie(e) {
|
|
1385
1419
|
if (!e?.length) return [];
|
|
1386
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 [{
|
|
1387
1421
|
name: t.name.slice(0, 200),
|
|
@@ -1392,7 +1426,7 @@ function Me(e) {
|
|
|
1392
1426
|
}];
|
|
1393
1427
|
return [];
|
|
1394
1428
|
}
|
|
1395
|
-
function
|
|
1429
|
+
function Le(e, t) {
|
|
1396
1430
|
let n = t.endsWith("/") ? t : `${t}/`;
|
|
1397
1431
|
if (!Array.isArray(e)) return [];
|
|
1398
1432
|
let r = /* @__PURE__ */ new Set();
|
|
@@ -1404,6 +1438,6 @@ function Ne(e, t) {
|
|
|
1404
1438
|
return [...r];
|
|
1405
1439
|
}
|
|
1406
1440
|
//#endregion
|
|
1407
|
-
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 };
|
|
1408
1442
|
|
|
1409
|
-
//# sourceMappingURL=commentImages-
|
|
1443
|
+
//# sourceMappingURL=commentImages-DVrG0nFm.js.map
|