delta-comic-core 0.1.3 → 0.2.1
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/bundle.cjs +3 -3
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.js +85 -168
- package/dist/bundle.js.map +1 -1
- package/dist/lib/components/image.vue.d.ts +4 -1099
- package/dist/lib/index.d.ts +7 -1467
- package/dist/lib/plugin/define.d.ts +1 -1
- package/dist/lib/struct/comment.d.ts +2 -4
- package/dist/lib/struct/content.d.ts +11 -32
- package/dist/lib/struct/image.d.ts +5 -12
- package/dist/lib/struct/item.d.ts +3 -5
- package/dist/lib/struct/user.d.ts +3 -6
- package/dist/lib/utils/data.d.ts +3 -0
- package/dist/pack.tgz +0 -0
- package/package.json +1 -1
- package/dist/lib/layout/user.d.ts +0 -0
package/dist/bundle.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Fragment, Teleport, Transition, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, customRef, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, hasInjectionContext, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toDisplayString, toRef, toValue, unref, useCssVars, useModel, useTemplateRef, vShow, watch, watchEffect, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
2
|
import { onBeforeRouteLeave, useRoute, useRouter } from "vue-router";
|
|
3
|
-
import { NButton, NEmpty, NIcon, NIconWrapper, NImage, NProgress, NResult, NVirtualList } from "naive-ui";
|
|
4
|
-
import { Icon, Loading, showImagePreview } from "vant";
|
|
5
3
|
import { defineStore } from "pinia";
|
|
4
|
+
import { NButton, NEmpty, NIcon, NIconWrapper, NProgress, NResult, NVirtualList } from "naive-ui";
|
|
6
5
|
import axios, { getAdapter, isAxiosError, isCancel } from "axios";
|
|
7
6
|
import { delay, isError, isString, isUndefined } from "es-toolkit";
|
|
8
7
|
import { AnimatePresence, motion } from "motion-v";
|
|
8
|
+
import { Icon, Loading } from "vant";
|
|
9
9
|
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (e, n) => () => (n || e((n = { exports: {} }).exports, n), n.exports), __export = (e) => {
|
|
10
10
|
let n = {};
|
|
11
11
|
for (var r in e) __defProp(n, r, {
|
|
@@ -1081,13 +1081,13 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1081
1081
|
}), W();
|
|
1082
1082
|
};
|
|
1083
1083
|
isHidden(i) ? nextTick().then(r) : r();
|
|
1084
|
-
}, J = () => K(s.active),
|
|
1085
|
-
!e.touchable || n.touches.length > 1 || (l.start(n), c = !1,
|
|
1086
|
-
},
|
|
1084
|
+
}, J = () => K(s.active), El, Dl = (n) => {
|
|
1085
|
+
!e.touchable || n.touches.length > 1 || (l.start(n), c = !1, El = Date.now(), H(), k());
|
|
1086
|
+
}, Ol = (r) => {
|
|
1087
1087
|
e.touchable && s.swiping && (l.move(r), S.value && (!e.loop && (s.active === 0 && h.value > 0 || s.active === p.value - 1 && h.value < 0) || (preventDefault(r, e.stopPropagation), O({ offset: h.value }), c ||= (n("dragStart", { index: b.value }), !0))));
|
|
1088
|
-
},
|
|
1088
|
+
}, kl = () => {
|
|
1089
1089
|
if (!e.touchable || !s.swiping) return;
|
|
1090
|
-
let r = Date.now() -
|
|
1090
|
+
let r = Date.now() - El, i = h.value / r;
|
|
1091
1091
|
if ((Math.abs(i) > .25 || Math.abs(h.value) > m.value / 2) && S.value) {
|
|
1092
1092
|
let n = e.vertical ? l.offsetY.value : l.offsetX.value, r = 0;
|
|
1093
1093
|
r = e.loop ? n > 0 ? h.value > 0 ? -1 : 1 : 0 : -Math[h.value > 0 ? "ceil" : "floor"](h.value / m.value), O({
|
|
@@ -1096,7 +1096,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1096
1096
|
});
|
|
1097
1097
|
} else h.value && O({ pace: 0 });
|
|
1098
1098
|
c = !1, s.swiping = !1, n("dragEnd", { index: b.value }), W();
|
|
1099
|
-
},
|
|
1099
|
+
}, Al = (n, r = {}) => {
|
|
1100
1100
|
k(), l.reset(), doubleRaf(() => {
|
|
1101
1101
|
let i;
|
|
1102
1102
|
i = e.loop && n === p.value ? s.active === 0 ? 0 : n : n % p.value, r.immediate ? doubleRaf(() => {
|
|
@@ -1106,25 +1106,25 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1106
1106
|
emitChange: !0
|
|
1107
1107
|
});
|
|
1108
1108
|
});
|
|
1109
|
-
},
|
|
1109
|
+
}, jl = (n, r) => {
|
|
1110
1110
|
let i = r === b.value;
|
|
1111
1111
|
return createVNode("i", {
|
|
1112
1112
|
style: i ? { backgroundColor: e.indicatorColor } : void 0,
|
|
1113
1113
|
class: bem$7("indicator", { active: i })
|
|
1114
1114
|
}, null);
|
|
1115
|
-
},
|
|
1115
|
+
}, Ml = () => {
|
|
1116
1116
|
if (r.indicator) return r.indicator({
|
|
1117
1117
|
active: b.value,
|
|
1118
1118
|
total: p.value
|
|
1119
1119
|
});
|
|
1120
|
-
if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(
|
|
1120
|
+
if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(jl)]);
|
|
1121
1121
|
};
|
|
1122
1122
|
return useExpose({
|
|
1123
1123
|
prev: A,
|
|
1124
1124
|
next: z,
|
|
1125
1125
|
state: s,
|
|
1126
1126
|
resize: J,
|
|
1127
|
-
swipeTo:
|
|
1127
|
+
swipeTo: Al
|
|
1128
1128
|
}), f({
|
|
1129
1129
|
size: m,
|
|
1130
1130
|
props: e,
|
|
@@ -1137,17 +1137,17 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1137
1137
|
() => e.height
|
|
1138
1138
|
], J), watch(usePageVisibility(), (e) => {
|
|
1139
1139
|
e === "visible" ? W() : H();
|
|
1140
|
-
}), onMounted(K), onActivated(() => K(s.active)), onPopupReopen(() => K(s.active)), onDeactivated(H), onBeforeUnmount(H), useEventListener("touchmove",
|
|
1140
|
+
}), onMounted(K), onActivated(() => K(s.active)), onPopupReopen(() => K(s.active)), onDeactivated(H), onBeforeUnmount(H), useEventListener("touchmove", Ol, { target: o }), () => createVNode("div", {
|
|
1141
1141
|
ref: i,
|
|
1142
1142
|
class: bem$7()
|
|
1143
1143
|
}, [createVNode("div", {
|
|
1144
1144
|
ref: o,
|
|
1145
1145
|
style: C.value,
|
|
1146
1146
|
class: bem$7("track", { vertical: e.vertical }),
|
|
1147
|
-
onTouchstartPassive:
|
|
1148
|
-
onTouchend:
|
|
1149
|
-
onTouchcancel:
|
|
1150
|
-
}, [r.default?.call(r)]),
|
|
1147
|
+
onTouchstartPassive: Dl,
|
|
1148
|
+
onTouchend: kl,
|
|
1149
|
+
onTouchcancel: kl
|
|
1150
|
+
}, [r.default?.call(r)]), Ml()]);
|
|
1151
1151
|
}
|
|
1152
1152
|
})), [name$6, bem$6] = createNamespace("tabs"), stdin_default$5 = defineComponent({
|
|
1153
1153
|
name: name$6,
|
|
@@ -1247,14 +1247,14 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1247
1247
|
}
|
|
1248
1248
|
C.lineStyle = c;
|
|
1249
1249
|
});
|
|
1250
|
-
},
|
|
1250
|
+
}, Tl = (e) => {
|
|
1251
1251
|
let n = e < C.currentIndex ? -1 : 1;
|
|
1252
1252
|
for (; e >= 0 && e < b.length;) {
|
|
1253
1253
|
if (!b[e].disabled) return e;
|
|
1254
1254
|
e += n;
|
|
1255
1255
|
}
|
|
1256
1256
|
}, V = (r, i) => {
|
|
1257
|
-
let a =
|
|
1257
|
+
let a = Tl(r);
|
|
1258
1258
|
if (!isDef$1(a)) return;
|
|
1259
1259
|
let o = b[a], c = O(o, a), l = C.currentIndex !== null;
|
|
1260
1260
|
C.currentIndex !== a && (C.currentIndex = a, i || z(), B()), c !== e.active && (n("update:active", c), l && n("change", c, o.title)), s && !e.scrollspy && setRootScrollTop(Math.ceil(getElementTop(u.value) - A.value));
|
|
@@ -1286,24 +1286,24 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1286
1286
|
});
|
|
1287
1287
|
}, J = (e) => {
|
|
1288
1288
|
s = e.isFixed, n("scroll", e);
|
|
1289
|
-
},
|
|
1289
|
+
}, El = (e) => {
|
|
1290
1290
|
nextTick(() => {
|
|
1291
1291
|
H(e), W(!0);
|
|
1292
1292
|
});
|
|
1293
|
-
},
|
|
1293
|
+
}, Dl = () => {
|
|
1294
1294
|
for (let e = 0; e < b.length; e++) {
|
|
1295
1295
|
let { top: n } = useRect(b[e].$el);
|
|
1296
1296
|
if (n > M.value) return e === 0 ? 0 : e - 1;
|
|
1297
1297
|
}
|
|
1298
1298
|
return b.length - 1;
|
|
1299
|
-
},
|
|
1300
|
-
e.scrollspy && !o && V(
|
|
1301
|
-
},
|
|
1299
|
+
}, Ol = () => {
|
|
1300
|
+
e.scrollspy && !o && V(Dl());
|
|
1301
|
+
}, kl = () => {
|
|
1302
1302
|
if (e.type === "line" && b.length) return createVNode("div", {
|
|
1303
1303
|
class: bem$5("line"),
|
|
1304
1304
|
style: C.lineStyle
|
|
1305
1305
|
}, null);
|
|
1306
|
-
},
|
|
1306
|
+
}, Al = () => {
|
|
1307
1307
|
let { type: n, border: i, sticky: a } = e, o = [createVNode("div", {
|
|
1308
1308
|
ref: a ? void 0 : p,
|
|
1309
1309
|
class: [bem$5("wrap"), { [BORDER_TOP_BOTTOM]: n === "line" && i }]
|
|
@@ -1319,11 +1319,11 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1319
1319
|
}, [
|
|
1320
1320
|
r["nav-left"]?.call(r),
|
|
1321
1321
|
b.map((e) => e.renderTitle(K)),
|
|
1322
|
-
|
|
1322
|
+
kl(),
|
|
1323
1323
|
r["nav-right"]?.call(r)
|
|
1324
1324
|
])]), r["nav-bottom"]?.call(r)];
|
|
1325
1325
|
return a ? createVNode("div", { ref: p }, [o]) : o;
|
|
1326
|
-
},
|
|
1326
|
+
}, jl = () => {
|
|
1327
1327
|
B(), nextTick(() => {
|
|
1328
1328
|
var e;
|
|
1329
1329
|
z(!0), (e = m.value?.swipeRef.value) == null || e.resize();
|
|
@@ -1334,20 +1334,20 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1334
1334
|
e.duration,
|
|
1335
1335
|
e.lineWidth,
|
|
1336
1336
|
e.lineHeight
|
|
1337
|
-
], B), watch(windowWidth,
|
|
1337
|
+
], B), watch(windowWidth, jl), watch(() => e.active, (e) => {
|
|
1338
1338
|
e !== k.value && H(e);
|
|
1339
1339
|
}), watch(() => b.length, () => {
|
|
1340
1340
|
C.inited && (H(e.active), B(), nextTick(() => {
|
|
1341
1341
|
z(!0);
|
|
1342
1342
|
}));
|
|
1343
1343
|
}), useExpose({
|
|
1344
|
-
resize:
|
|
1345
|
-
scrollTo:
|
|
1344
|
+
resize: jl,
|
|
1345
|
+
scrollTo: El
|
|
1346
1346
|
}), onActivated(B), onPopupReopen(B), onMountedOrActivated(() => {
|
|
1347
1347
|
H(e.active, !0), nextTick(() => {
|
|
1348
1348
|
C.inited = !0, p.value && (i = useRect(p.value).height), z(!0);
|
|
1349
1349
|
});
|
|
1350
|
-
}), useVisibilityChange(u, B), useEventListener("scroll",
|
|
1350
|
+
}), useVisibilityChange(u, B), useEventListener("scroll", Ol, {
|
|
1351
1351
|
target: g,
|
|
1352
1352
|
passive: !0
|
|
1353
1353
|
}), S({
|
|
@@ -1366,7 +1366,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
|
|
|
1366
1366
|
container: u.value,
|
|
1367
1367
|
offsetTop: A.value,
|
|
1368
1368
|
onScroll: J
|
|
1369
|
-
}, { default: () => [
|
|
1369
|
+
}, { default: () => [Al()] }) : Al() : null, createVNode(stdin_default$5, {
|
|
1370
1370
|
ref: m,
|
|
1371
1371
|
count: b.length,
|
|
1372
1372
|
inited: C.inited,
|
|
@@ -2932,9 +2932,9 @@ var floatPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
2932
2932
|
})]);
|
|
2933
2933
|
};
|
|
2934
2934
|
}
|
|
2935
|
-
}), image_exports = /* @__PURE__ */ __export({ showImagePreview: () => showImagePreview
|
|
2936
|
-
const showImagePreview
|
|
2937
|
-
let r = shallowRef(!0), [, , i] = useZIndex(r), o = showImagePreview({
|
|
2935
|
+
}), image_exports = /* @__PURE__ */ __export({ showImagePreview: () => showImagePreview });
|
|
2936
|
+
const showImagePreview = (e, n = {}) => {
|
|
2937
|
+
let r = shallowRef(!0), [, , i] = useZIndex(r), o = window.$api.showImagePreview({
|
|
2938
2938
|
images: e,
|
|
2939
2939
|
...n,
|
|
2940
2940
|
overlayClass: "!z-2147483646",
|
|
@@ -3022,18 +3022,20 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3022
3022
|
}
|
|
3023
3023
|
return "";
|
|
3024
3024
|
}, ""), w = (e) => {
|
|
3025
|
-
p("click"), u.previewable && (e.stopPropagation(), showImagePreview
|
|
3025
|
+
p("click"), u.previewable && (e.stopPropagation(), showImagePreview([f.value], { closeable: !0 }));
|
|
3026
3026
|
}, k = (...e) => {
|
|
3027
3027
|
p("load", ...e), v.loaded.add(f.value);
|
|
3028
3028
|
}, j = useTemplateRef("img");
|
|
3029
|
-
|
|
3029
|
+
r({
|
|
3030
3030
|
isLoaded: S,
|
|
3031
3031
|
imageEl: computed(() => j.value?.imageRef),
|
|
3032
3032
|
imageIns: j
|
|
3033
|
-
})
|
|
3034
|
-
|
|
3033
|
+
});
|
|
3034
|
+
let M = window.$api.NImage;
|
|
3035
|
+
return (r, i) => {
|
|
3036
|
+
let a = Icon$1;
|
|
3035
3037
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3036
|
-
y.value ? withDirectives((openBlock(), createBlock(
|
|
3038
|
+
y.value ? withDirectives((openBlock(), createBlock(unref(M), mergeProps({
|
|
3037
3039
|
key: 0,
|
|
3038
3040
|
onError: h
|
|
3039
3041
|
}, u, {
|
|
@@ -3074,7 +3076,7 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3074
3076
|
style: normalizeStyle(n.style),
|
|
3075
3077
|
onClick: i[0] ||= (e) => p("click")
|
|
3076
3078
|
}, [r.$slots.loading ? renderSlot(r.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(loading_default, { key: 1 }))], 6)) : createCommentVNode("", !0),
|
|
3077
|
-
unref(v).error.has(unref(f)) && !n.hideError ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [n.fallback ? (openBlock(), createBlock(
|
|
3079
|
+
unref(v).error.has(unref(f)) && !n.hideError ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [n.fallback ? (openBlock(), createBlock(unref(M), mergeProps({
|
|
3078
3080
|
key: 0,
|
|
3079
3081
|
onError: h
|
|
3080
3082
|
}, u, {
|
|
@@ -3110,7 +3112,7 @@ var image_default = /* @__PURE__ */ defineComponent({
|
|
|
3110
3112
|
onClick: i[1] ||= withModifiers(() => {
|
|
3111
3113
|
unref(v).error.delete(unref(f)), b();
|
|
3112
3114
|
}, ["stop"])
|
|
3113
|
-
}, [r.$slots.loading ? renderSlot(r.$slots, "loading", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(
|
|
3115
|
+
}, [r.$slots.loading ? renderSlot(r.$slots, "loading", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(a, {
|
|
3114
3116
|
name: "warning-o",
|
|
3115
3117
|
size: "2.5rem",
|
|
3116
3118
|
color: "var(--van-text-color-2)"
|
|
@@ -3307,6 +3309,12 @@ var data_exports = /* @__PURE__ */ __export({
|
|
|
3307
3309
|
this.separator = e;
|
|
3308
3310
|
}
|
|
3309
3311
|
}, SourcedKeyMap = class extends SourcedValue {
|
|
3312
|
+
static create(e = ":") {
|
|
3313
|
+
return shallowReactive(new this(e));
|
|
3314
|
+
}
|
|
3315
|
+
constructor(e = ":") {
|
|
3316
|
+
super(e);
|
|
3317
|
+
}
|
|
3310
3318
|
store = shallowReactive(/* @__PURE__ */ new Map());
|
|
3311
3319
|
get size() {
|
|
3312
3320
|
return this.store.size;
|
|
@@ -4617,22 +4625,9 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4617
4625
|
};
|
|
4618
4626
|
}
|
|
4619
4627
|
}), image_exports$1 = /* @__PURE__ */ __export({ Image: () => Image$1 }), Image$1 = class e extends Struct {
|
|
4620
|
-
static processInstances = useGlobalVar(
|
|
4621
|
-
static
|
|
4622
|
-
|
|
4623
|
-
this.processInstances.set(i, {
|
|
4624
|
-
func: r,
|
|
4625
|
-
plugin: e,
|
|
4626
|
-
referenceName: n,
|
|
4627
|
-
fullName: i
|
|
4628
|
-
});
|
|
4629
|
-
}
|
|
4630
|
-
static fork = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/image/fork");
|
|
4631
|
-
static activeFork = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/image/activeFork");
|
|
4632
|
-
static setFork(e, n, r) {
|
|
4633
|
-
let i = `${e}:${n}`;
|
|
4634
|
-
this.fork.set(i, r);
|
|
4635
|
-
}
|
|
4628
|
+
static processInstances = useGlobalVar(SourcedKeyMap.create(), "uni/image/processInstances");
|
|
4629
|
+
static fork = useGlobalVar(SourcedKeyMap.create(), "uni/image/fork");
|
|
4630
|
+
static activeFork = useGlobalVar(SourcedKeyMap.create(), "uni/image/activeFork");
|
|
4636
4631
|
static is(e) {
|
|
4637
4632
|
return e instanceof this;
|
|
4638
4633
|
}
|
|
@@ -4658,10 +4653,10 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4658
4653
|
console.warn(`[Image.getUrl] process not found, fullname: "${i}"`);
|
|
4659
4654
|
continue;
|
|
4660
4655
|
}
|
|
4661
|
-
let o = await a
|
|
4656
|
+
let o = await a(n, this);
|
|
4662
4657
|
if (n = o[0], !(r.ignoreExit || !o[1])) break;
|
|
4663
4658
|
}
|
|
4664
|
-
return URL.canParse(n) ? n : `${e.activeFork.get(
|
|
4659
|
+
return URL.canParse(n) ? n : `${e.activeFork.get([this.$$plugin, this.forkNamespace])}/${n}`;
|
|
4665
4660
|
}
|
|
4666
4661
|
}, require_dayjs_min = /* @__PURE__ */ __commonJSMin(((e, n) => {
|
|
4667
4662
|
(function(r, i) {
|
|
@@ -4962,84 +4957,32 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
4962
4957
|
ContentPage: () => ContentPage,
|
|
4963
4958
|
ContentVideoPage: () => ContentVideoPage
|
|
4964
4959
|
}), ContentPage = class {
|
|
4965
|
-
static viewLayout = useGlobalVar(
|
|
4966
|
-
static setViewLayout(e, n) {
|
|
4967
|
-
let r = this.toContentTypeString(e);
|
|
4968
|
-
return this.viewLayout.set(r, n), r;
|
|
4969
|
-
}
|
|
4970
|
-
static getViewLayout(e) {
|
|
4971
|
-
let n = this.toContentTypeString(e);
|
|
4972
|
-
return this.viewLayout.get(n);
|
|
4973
|
-
}
|
|
4960
|
+
static viewLayout = useGlobalVar(SourcedKeyMap.create(), "uni/contentPage/viewLayout");
|
|
4974
4961
|
static tabbar = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/tabbar");
|
|
4975
|
-
static
|
|
4976
|
-
this.tabbar.set(e, this.
|
|
4977
|
-
}
|
|
4978
|
-
static getTabbar(e) {
|
|
4979
|
-
return this.tabbar.get(e) ?? [];
|
|
4980
|
-
}
|
|
4981
|
-
static categories = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/categories");
|
|
4982
|
-
static setCategories(e, ...n) {
|
|
4983
|
-
this.categories.set(e, this.getCategories(e).concat(n));
|
|
4984
|
-
}
|
|
4985
|
-
static getCategories(e) {
|
|
4986
|
-
return this.categories.get(e) ?? [];
|
|
4987
|
-
}
|
|
4988
|
-
static itemCard = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/itemCard");
|
|
4989
|
-
static setItemCard(e, n) {
|
|
4990
|
-
let r = this.toContentTypeString(e);
|
|
4991
|
-
return this.itemCard.set(r, n), r;
|
|
4992
|
-
}
|
|
4993
|
-
static getItemCard(e) {
|
|
4994
|
-
let n = this.toContentTypeString(e);
|
|
4995
|
-
return this.itemCard.get(n);
|
|
4996
|
-
}
|
|
4997
|
-
static contentPage = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/contentPage");
|
|
4998
|
-
static setContentPage(e, n) {
|
|
4999
|
-
this.contentPage.set(this.toContentTypeString(e), n);
|
|
5000
|
-
}
|
|
5001
|
-
static getContentPage(e) {
|
|
5002
|
-
let n = this.toContentTypeString(e), r = this.contentPage.get(n);
|
|
5003
|
-
if (!r) throw Error(`[ContentPage.getContentPage] not found ContentPage (contentType: ${e})`);
|
|
5004
|
-
return r;
|
|
5005
|
-
}
|
|
5006
|
-
static toContentType(e) {
|
|
5007
|
-
if (isString$1(e)) {
|
|
5008
|
-
let [n, r] = e.split(":");
|
|
5009
|
-
return {
|
|
5010
|
-
name: r,
|
|
5011
|
-
plugin: n
|
|
5012
|
-
};
|
|
5013
|
-
}
|
|
5014
|
-
return e;
|
|
4962
|
+
static addTabbar(e, ...n) {
|
|
4963
|
+
this.tabbar.set(e, (this.tabbar.get(e) ?? []).concat(n));
|
|
5015
4964
|
}
|
|
5016
|
-
static
|
|
5017
|
-
|
|
4965
|
+
static categories = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/tabbar");
|
|
4966
|
+
static addCategories(e, ...n) {
|
|
4967
|
+
this.categories.set(e, (this.categories.get(e) ?? []).concat(n));
|
|
5018
4968
|
}
|
|
4969
|
+
static itemCard = useGlobalVar(SourcedKeyMap.create(), "uni/contentPage/itemCard");
|
|
4970
|
+
static contentPage = useGlobalVar(SourcedKeyMap.create(), "uni/contentPage/contentPage");
|
|
5019
4971
|
static levelboard = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/levelboard");
|
|
5020
|
-
static
|
|
4972
|
+
static addLevelboard(e, n) {
|
|
5021
4973
|
let r = this.levelboard.get(e) ?? [];
|
|
5022
4974
|
return r.push(n), this.levelboard.set(e, r), e;
|
|
5023
4975
|
}
|
|
5024
|
-
static getLevelboard(e) {
|
|
5025
|
-
return this.levelboard.get(e);
|
|
5026
|
-
}
|
|
5027
4976
|
static topButton = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/topButton");
|
|
5028
|
-
static
|
|
4977
|
+
static addTopButton(e, n) {
|
|
5029
4978
|
let r = this.topButton.get(e) ?? [];
|
|
5030
4979
|
return r.push(n), this.topButton.set(e, r), e;
|
|
5031
4980
|
}
|
|
5032
|
-
static getTopButton(e) {
|
|
5033
|
-
return this.topButton.get(e);
|
|
5034
|
-
}
|
|
5035
4981
|
static mainLists = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/mainLists");
|
|
5036
|
-
static
|
|
4982
|
+
static addMainList(e, n) {
|
|
5037
4983
|
let r = this.mainLists.get(e) ?? [];
|
|
5038
4984
|
return r.push(n), this.mainLists.set(e, r), e;
|
|
5039
4985
|
}
|
|
5040
|
-
static getMainList(e) {
|
|
5041
|
-
return this.mainLists.get(e);
|
|
5042
|
-
}
|
|
5043
4986
|
constructor(e, n, r) {
|
|
5044
4987
|
this.id = n, this.ep = r, this.preload.value = e;
|
|
5045
4988
|
}
|
|
@@ -5062,19 +5005,13 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
5062
5005
|
super(e), this.name = e.name, this.index = e.index, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
|
|
5063
5006
|
}
|
|
5064
5007
|
}, item_exports = /* @__PURE__ */ __export({ Item: () => Item }), Item = class extends Struct {
|
|
5065
|
-
static itemTranslator =
|
|
5008
|
+
static itemTranslator = SourcedKeyMap.create();
|
|
5066
5009
|
static create(e) {
|
|
5067
|
-
let n = this.itemTranslator.get(
|
|
5068
|
-
if (!n) throw Error(`can not found itemTranslator contentType:"${ContentPage.
|
|
5010
|
+
let n = this.itemTranslator.get(e.contentType);
|
|
5011
|
+
if (!n) throw Error(`can not found itemTranslator contentType:"${ContentPage.contentPage.toString(e.contentType)}"`);
|
|
5069
5012
|
return n(e);
|
|
5070
5013
|
}
|
|
5071
|
-
static authorIcon =
|
|
5072
|
-
static getAuthorIcon(e, n) {
|
|
5073
|
-
return this.authorIcon.get(`${e}:${n}`);
|
|
5074
|
-
}
|
|
5075
|
-
static setAuthorIcon(e, n, r) {
|
|
5076
|
-
this.authorIcon.set(`${e}:${n}`, r);
|
|
5077
|
-
}
|
|
5014
|
+
static authorIcon = SourcedKeyMap.create();
|
|
5078
5015
|
static is(e) {
|
|
5079
5016
|
return e instanceof this;
|
|
5080
5017
|
}
|
|
@@ -5106,7 +5043,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
5106
5043
|
return new Ep(this.thisEp);
|
|
5107
5044
|
}
|
|
5108
5045
|
constructor(e) {
|
|
5109
|
-
super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.thisEp = e.thisEp, this.updateTime = e.updateTime, this.cover = e.cover, this.title = e.title, this.id = e.id, this.categories = e.categories, this.author = e.author, this.viewNumber = e.viewNumber, this.likeNumber = e.likeNumber, this.commentNumber = e.commentNumber, this.isLiked = e.isLiked, this.customIsAI = e.customIsAI, this.contentType = ContentPage.
|
|
5046
|
+
super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.thisEp = e.thisEp, this.updateTime = e.updateTime, this.cover = e.cover, this.title = e.title, this.id = e.id, this.categories = e.categories, this.author = e.author, this.viewNumber = e.viewNumber, this.likeNumber = e.likeNumber, this.commentNumber = e.commentNumber, this.isLiked = e.isLiked, this.customIsAI = e.customIsAI, this.contentType = ContentPage.contentPage.toJSON(e.contentType), this.length = e.length, this.epLength = e.epLength, this.description = e.description, this.commentSendable = e.commentSendable, this.customIsSafe = e.customIsSafe;
|
|
5110
5047
|
}
|
|
5111
5048
|
commentSendable;
|
|
5112
5049
|
customIsAI;
|
|
@@ -5115,15 +5052,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
5115
5052
|
return this.customIsAI || e(this.title) || this.author.some((n) => e(`${n.label}\u1145${n.description}`));
|
|
5116
5053
|
}
|
|
5117
5054
|
}, comment_exports = /* @__PURE__ */ __export({ Comment: () => Comment }), import_dayjs_min$1 = /* @__PURE__ */ __toESM(require_dayjs_min(), 1), Comment = class extends Struct {
|
|
5118
|
-
static commentRow =
|
|
5119
|
-
static setCommentRow(e, n) {
|
|
5120
|
-
let r = uni.content.ContentPage.toContentTypeString(e);
|
|
5121
|
-
return this.commentRow.set(r, n), r;
|
|
5122
|
-
}
|
|
5123
|
-
static getCommentRow(e) {
|
|
5124
|
-
let n = uni.content.ContentPage.toContentTypeString(e);
|
|
5125
|
-
return this.commentRow.get(n);
|
|
5126
|
-
}
|
|
5055
|
+
static commentRow = SourcedKeyMap.create();
|
|
5127
5056
|
constructor(e) {
|
|
5128
5057
|
super(e), this.content = e.content, this.time = e.time, this.id = e.id, this.childrenCount = e.childrenCount, this.likeCount = e.likeCount, this.isLiked = e.isLiked, this.reported = e.reported, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.isTop = e.isTop;
|
|
5129
5058
|
}
|
|
@@ -5143,20 +5072,8 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
|
|
|
5143
5072
|
}, user_exports = /* @__PURE__ */ __export({ User: () => User }), User = class {
|
|
5144
5073
|
static userBase = shallowReactive(/* @__PURE__ */ new Map());
|
|
5145
5074
|
static userEditorBase = shallowReactive(/* @__PURE__ */ new Map());
|
|
5146
|
-
static subscribes = shallowReactive(
|
|
5147
|
-
static
|
|
5148
|
-
this.subscribes.set(`${e}:${n}`, r);
|
|
5149
|
-
}
|
|
5150
|
-
static getSubscribes(e, n) {
|
|
5151
|
-
return this.subscribes.get(`${e}:${n}`);
|
|
5152
|
-
}
|
|
5153
|
-
static authorActions = shallowReactive(/* @__PURE__ */ new Map());
|
|
5154
|
-
static setAuthorActions(e, n, r) {
|
|
5155
|
-
this.authorActions.set(`${e}:${n}`, r);
|
|
5156
|
-
}
|
|
5157
|
-
static getAuthorActions(e, n) {
|
|
5158
|
-
return this.authorActions.get(`${e}:${n}`);
|
|
5159
|
-
}
|
|
5075
|
+
static subscribes = shallowReactive(SourcedKeyMap.create());
|
|
5076
|
+
static authorActions = shallowReactive(SourcedKeyMap.create());
|
|
5160
5077
|
constructor(e) {
|
|
5161
5078
|
e.avatar && (this.avatar = Image$1.create(e.avatar)), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin;
|
|
5162
5079
|
}
|
|
@@ -5455,25 +5372,25 @@ const appConfig = new ConfigPointer("core", {
|
|
|
5455
5372
|
else var n = e;
|
|
5456
5373
|
console.log("[definePlugin] new plugin defining...", n);
|
|
5457
5374
|
let { name: r, content: i, image: a, search: o, user: s, subscribe: c } = n;
|
|
5458
|
-
if (i) for (let [e, { commentRow: n, contentPage: r, itemCard: a, layout: o, itemTranslator: s }] of Object.entries(i)) o && ContentPage.
|
|
5375
|
+
if (i) for (let [e, { commentRow: n, contentPage: r, itemCard: a, layout: o, itemTranslator: s }] of Object.entries(i)) o && ContentPage.viewLayout.set(e, o), a && ContentPage.itemCard.set(e, a), r && ContentPage.contentPage.set(e, r), n && Comment.commentRow.set(e, n), s && Item.itemTranslator.set(e, s);
|
|
5459
5376
|
if (a) {
|
|
5460
|
-
if (a.forks) for (let [e, n] of Object.entries(a.forks)) Image$1.
|
|
5461
|
-
if (a.process) for (let [e, n] of Object.entries(a.process)) Image$1.
|
|
5377
|
+
if (a.forks) for (let [e, n] of Object.entries(a.forks)) Image$1.fork.set([r, e], n);
|
|
5378
|
+
if (a.process) for (let [e, n] of Object.entries(a.process)) Image$1.processInstances.set([r, e], n);
|
|
5462
5379
|
}
|
|
5463
5380
|
if (o) {
|
|
5464
|
-
if (o.categories) for (let e of o.categories) ContentPage.
|
|
5465
|
-
if (o.tabbar) for (let e of o.tabbar) ContentPage.
|
|
5381
|
+
if (o.categories) for (let e of o.categories) ContentPage.addCategories(r, e);
|
|
5382
|
+
if (o.tabbar) for (let e of o.tabbar) ContentPage.addTabbar(r, e);
|
|
5466
5383
|
if (o.hotPage) {
|
|
5467
|
-
for (let e of o.hotPage.mainListCard ?? []) ContentPage.
|
|
5468
|
-
for (let e of o.hotPage.levelBoard ?? []) ContentPage.
|
|
5469
|
-
for (let e of o.hotPage.topButton ?? []) ContentPage.
|
|
5384
|
+
for (let e of o.hotPage.mainListCard ?? []) ContentPage.addMainList(r, e);
|
|
5385
|
+
for (let e of o.hotPage.levelBoard ?? []) ContentPage.addLevelboard(r, e);
|
|
5386
|
+
for (let e of o.hotPage.topButton ?? []) ContentPage.addTopButton(r, e);
|
|
5470
5387
|
}
|
|
5471
5388
|
}
|
|
5472
5389
|
if (s) {
|
|
5473
|
-
if (s.edit && User.userEditorBase.set(r, s.edit), s.authorActions) for (let [e, n] of Object.entries(s.authorActions)) User.
|
|
5474
|
-
if (s.authorIcon) for (let [e, n] of Object.entries(s.authorIcon)) Item.
|
|
5390
|
+
if (s.edit && User.userEditorBase.set(r, s.edit), s.authorActions) for (let [e, n] of Object.entries(s.authorActions)) User.authorActions.set([r, e], n);
|
|
5391
|
+
if (s.authorIcon) for (let [e, n] of Object.entries(s.authorIcon)) Item.authorIcon.set([r, e], n);
|
|
5475
5392
|
}
|
|
5476
|
-
if (c) for (let [e, n] of Object.entries(c)) User.
|
|
5393
|
+
if (c) for (let [e, n] of Object.entries(c)) User.subscribes.set([r, e], n);
|
|
5477
5394
|
if (n.config) for (let e of n.config) useConfig().$resignerConfig(e);
|
|
5478
5395
|
return SharedFunction.call("addPlugin", n);
|
|
5479
5396
|
}, declareDependType = (e) => Symbol.for(`expose:${e}`), requireDepend = (e) => _pluginExposes.get(e), _pluginExposes = /* @__PURE__ */ new Map(), coreModule = declareDependType("core"), _ = void 0, Comp = {
|