delta-comic-core 0.0.6 → 0.0.8

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.js CHANGED
@@ -1080,13 +1080,13 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1080
1080
  }), K();
1081
1081
  };
1082
1082
  isHidden(a) ? nextTick().then(r) : r();
1083
- }, ll = () => J(s.active), ul, dl = (n) => {
1084
- !e.touchable || n.touches.length > 1 || (l.start(n), c = !1, ul = Date.now(), W(), k());
1085
- }, fl = (r) => {
1083
+ }, dl = () => J(s.active), fl, pl = (n) => {
1084
+ !e.touchable || n.touches.length > 1 || (l.start(n), c = !1, fl = Date.now(), W(), k());
1085
+ }, ml = (r) => {
1086
1086
  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))));
1087
- }, pl = () => {
1087
+ }, hl = () => {
1088
1088
  if (!e.touchable || !s.swiping) return;
1089
- let r = Date.now() - ul, i = h.value / r;
1089
+ let r = Date.now() - fl, i = h.value / r;
1090
1090
  if ((Math.abs(i) > .25 || Math.abs(h.value) > m.value / 2) && S.value) {
1091
1091
  let n = e.vertical ? l.offsetY.value : l.offsetX.value, r = 0;
1092
1092
  r = e.loop ? n > 0 ? h.value > 0 ? -1 : 1 : 0 : -Math[h.value > 0 ? "ceil" : "floor"](h.value / m.value), O({
@@ -1095,7 +1095,7 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1095
1095
  });
1096
1096
  } else h.value && O({ pace: 0 });
1097
1097
  c = !1, s.swiping = !1, n("dragEnd", { index: b.value }), K();
1098
- }, ml = (n, r = {}) => {
1098
+ }, gl = (n, r = {}) => {
1099
1099
  k(), l.reset(), doubleRaf(() => {
1100
1100
  let i;
1101
1101
  i = e.loop && n === p.value ? s.active === 0 ? 0 : n : n % p.value, r.immediate ? doubleRaf(() => {
@@ -1105,25 +1105,25 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1105
1105
  emitChange: !0
1106
1106
  });
1107
1107
  });
1108
- }, hl = (n, r) => {
1108
+ }, _l = (n, r) => {
1109
1109
  let i = r === b.value;
1110
1110
  return createVNode("i", {
1111
1111
  style: i ? { backgroundColor: e.indicatorColor } : void 0,
1112
1112
  class: bem$7("indicator", { active: i })
1113
1113
  }, null);
1114
- }, gl = () => {
1114
+ }, vl = () => {
1115
1115
  if (r.indicator) return r.indicator({
1116
1116
  active: b.value,
1117
1117
  total: p.value
1118
1118
  });
1119
- if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(hl)]);
1119
+ if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(_l)]);
1120
1120
  };
1121
1121
  return useExpose({
1122
1122
  prev: M,
1123
1123
  next: V,
1124
1124
  state: s,
1125
- resize: ll,
1126
- swipeTo: ml
1125
+ resize: dl,
1126
+ swipeTo: gl
1127
1127
  }), f({
1128
1128
  size: m,
1129
1129
  props: e,
@@ -1134,19 +1134,19 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1134
1134
  windowHeight,
1135
1135
  () => e.width,
1136
1136
  () => e.height
1137
- ], ll), watch(usePageVisibility(), (e) => {
1137
+ ], dl), watch(usePageVisibility(), (e) => {
1138
1138
  e === "visible" ? K() : W();
1139
- }), onMounted(J), onActivated(() => J(s.active)), onPopupReopen(() => J(s.active)), onDeactivated(W), onBeforeUnmount(W), useEventListener("touchmove", fl, { target: o }), () => createVNode("div", {
1139
+ }), onMounted(J), onActivated(() => J(s.active)), onPopupReopen(() => J(s.active)), onDeactivated(W), onBeforeUnmount(W), useEventListener("touchmove", ml, { target: o }), () => createVNode("div", {
1140
1140
  ref: a,
1141
1141
  class: bem$7()
1142
1142
  }, [createVNode("div", {
1143
1143
  ref: o,
1144
1144
  style: C.value,
1145
1145
  class: bem$7("track", { vertical: e.vertical }),
1146
- onTouchstartPassive: dl,
1147
- onTouchend: pl,
1148
- onTouchcancel: pl
1149
- }, [r.default?.call(r)]), gl()]);
1146
+ onTouchstartPassive: pl,
1147
+ onTouchend: hl,
1148
+ onTouchcancel: hl
1149
+ }, [r.default?.call(r)]), vl()]);
1150
1150
  }
1151
1151
  })), [name$6, bem$6] = createNamespace("tabs"), stdin_default$5 = defineComponent({
1152
1152
  name: name$6,
@@ -1283,26 +1283,26 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1283
1283
  event: a,
1284
1284
  disabled: s
1285
1285
  });
1286
- }, ll = (e) => {
1286
+ }, dl = (e) => {
1287
1287
  s = e.isFixed, n("scroll", e);
1288
- }, ul = (e) => {
1288
+ }, fl = (e) => {
1289
1289
  nextTick(() => {
1290
1290
  W(e), K(!0);
1291
1291
  });
1292
- }, dl = () => {
1292
+ }, pl = () => {
1293
1293
  for (let e = 0; e < b.length; e++) {
1294
1294
  let { top: n } = useRect(b[e].$el);
1295
1295
  if (n > M.value) return e === 0 ? 0 : e - 1;
1296
1296
  }
1297
1297
  return b.length - 1;
1298
- }, fl = () => {
1299
- e.scrollspy && !o && H(dl());
1300
- }, pl = () => {
1298
+ }, ml = () => {
1299
+ e.scrollspy && !o && H(pl());
1300
+ }, hl = () => {
1301
1301
  if (e.type === "line" && b.length) return createVNode("div", {
1302
1302
  class: bem$5("line"),
1303
1303
  style: C.lineStyle
1304
1304
  }, null);
1305
- }, ml = () => {
1305
+ }, gl = () => {
1306
1306
  let { type: n, border: i, sticky: a } = e, o = [createVNode("div", {
1307
1307
  ref: a ? void 0 : p,
1308
1308
  class: [bem$5("wrap"), { [BORDER_TOP_BOTTOM]: n === "line" && i }]
@@ -1318,11 +1318,11 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1318
1318
  }, [
1319
1319
  r["nav-left"]?.call(r),
1320
1320
  b.map((e) => e.renderTitle(J)),
1321
- pl(),
1321
+ hl(),
1322
1322
  r["nav-right"]?.call(r)
1323
1323
  ])]), r["nav-bottom"]?.call(r)];
1324
1324
  return a ? createVNode("div", { ref: p }, [o]) : o;
1325
- }, hl = () => {
1325
+ }, _l = () => {
1326
1326
  B(), nextTick(() => {
1327
1327
  var e;
1328
1328
  z(!0), (e = m.value?.swipeRef.value) == null || e.resize();
@@ -1333,20 +1333,20 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1333
1333
  e.duration,
1334
1334
  e.lineWidth,
1335
1335
  e.lineHeight
1336
- ], B), watch(windowWidth, hl), watch(() => e.active, (e) => {
1336
+ ], B), watch(windowWidth, _l), watch(() => e.active, (e) => {
1337
1337
  e !== k.value && W(e);
1338
1338
  }), watch(() => b.length, () => {
1339
1339
  C.inited && (W(e.active), B(), nextTick(() => {
1340
1340
  z(!0);
1341
1341
  }));
1342
1342
  }), useExpose({
1343
- resize: hl,
1344
- scrollTo: ul
1343
+ resize: _l,
1344
+ scrollTo: fl
1345
1345
  }), onActivated(B), onPopupReopen(B), onMountedOrActivated(() => {
1346
1346
  W(e.active, !0), nextTick(() => {
1347
1347
  C.inited = !0, p.value && (a = useRect(p.value).height), z(!0);
1348
1348
  });
1349
- }), useVisibilityChange(d, B), useEventListener("scroll", fl, {
1349
+ }), useVisibilityChange(d, B), useEventListener("scroll", ml, {
1350
1350
  target: g,
1351
1351
  passive: !0
1352
1352
  }), S({
@@ -1364,8 +1364,8 @@ var [name$8, bem$8] = createNamespace("sticky"), Sticky = withInstall(defineComp
1364
1364
  }, [e.showHeader ? e.sticky ? createVNode(Sticky, {
1365
1365
  container: d.value,
1366
1366
  offsetTop: j.value,
1367
- onScroll: ll
1368
- }, { default: () => [ml()] }) : ml() : null, createVNode(stdin_default$5, {
1367
+ onScroll: dl
1368
+ }, { default: () => [gl()] }) : gl() : null, createVNode(stdin_default$5, {
1369
1369
  ref: m,
1370
1370
  count: b.length,
1371
1371
  inited: C.inited,
@@ -3265,7 +3265,7 @@ let utilInterceptors;
3265
3265
  })(utilInterceptors ||= {});
3266
3266
  const createAxios = (e, n = {}, r) => {
3267
3267
  let i = axios.create(n);
3268
- return r?.(i), i.interceptors.request.use(async (n) => (n.baseURL ??= await e(), n)), i.interceptors.response.use(void 0, utilInterceptors.isClientError), i.interceptors.response.use(void 0, utilInterceptors.createAutoRetry(i, 10)), {
3268
+ return r?.(i), i.interceptors.request.use(async (n) => (n.baseURL ??= await e(), n)), n.noPassClientError || i.interceptors.response.use(void 0, utilInterceptors.isClientError), i.interceptors.response.use(void 0, utilInterceptors.createAutoRetry(i, 10)), {
3269
3269
  get: async (e, n = {}) => utilInterceptors.useUnreadableRetry(() => i.get(e, n)),
3270
3270
  post: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.post(e, n, r)),
3271
3271
  postForm: async (e, n, r = {}) => utilInterceptors.useUnreadableRetry(() => i.postForm(e, n, r)),
@@ -3291,7 +3291,7 @@ var data_exports = /* @__PURE__ */ __export({
3291
3291
  }, PromiseContent = class e {
3292
3292
  [Symbol.toStringTag] = "PromiseContent";
3293
3293
  static _this;
3294
- static #_ = this._this = useGlobalVar(this, "data/PromiseContent");
3294
+ static #e = this._this = useGlobalVar(this, "data/PromiseContent");
3295
3295
  static isPromiseContent(e) {
3296
3296
  return e instanceof this._this;
3297
3297
  }
@@ -3365,7 +3365,7 @@ var data_exports = /* @__PURE__ */ __export({
3365
3365
  this.generator = e(this.abortController.signal, this), generatorMap.set(this, e);
3366
3366
  }
3367
3367
  static _this;
3368
- static #_ = this._this = useGlobalVar(this, "data/Stream");
3368
+ static #e = this._this = useGlobalVar(this, "data/Stream");
3369
3369
  static isStream(e) {
3370
3370
  return e instanceof this._this;
3371
3371
  }
@@ -4875,7 +4875,11 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
4875
4875
  return O(1e3 * e);
4876
4876
  }, O.en = C[S], O.Ls = C, O.p = {}, O;
4877
4877
  }));
4878
- })), import_dayjs_min$2 = /* @__PURE__ */ __toESM(require_dayjs_min(), 1), content_exports = /* @__PURE__ */ __export({ ContentPage: () => ContentPage }), ContentPage = class {
4878
+ })), import_dayjs_min$2 = /* @__PURE__ */ __toESM(require_dayjs_min(), 1), content_exports = /* @__PURE__ */ __export({
4879
+ ContentImagePage: () => ContentImagePage,
4880
+ ContentPage: () => ContentPage,
4881
+ ContentVideoPage: () => ContentVideoPage
4882
+ }), ContentPage = class {
4879
4883
  static viewLayout = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/viewLayout");
4880
4884
  static setViewLayout(e, n) {
4881
4885
  let r = this.toContentTypeString(e);
@@ -4963,6 +4967,10 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
4963
4967
  union = computed(() => this.detail.content.data.value ?? this.preload.value);
4964
4968
  recommends = PromiseContent.withResolvers();
4965
4969
  eps = PromiseContent.withResolvers();
4970
+ }, ContentImagePage = class extends ContentPage {
4971
+ images = PromiseContent.withResolvers();
4972
+ }, ContentVideoPage = class extends ContentPage {
4973
+ videos = PromiseContent.withResolvers();
4966
4974
  }, ep_exports = /* @__PURE__ */ __export({ Ep: () => Ep }), Ep = class extends Struct {
4967
4975
  name;
4968
4976
  index;
@@ -5009,7 +5017,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
5009
5017
  customIsAI;
5010
5018
  get $isAi() {
5011
5019
  let e = (e) => /(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);
5012
- return this.customIsAI || e(this.title) || this.author.some((n) => e(n));
5020
+ return this.customIsAI || e(this.title) || this.author.some((n) => e(`${n.label}\u1145${n.description}`));
5013
5021
  }
5014
5022
  }, comment_exports = /* @__PURE__ */ __export({ Comment: () => Comment }), import_dayjs_min$1 = /* @__PURE__ */ __toESM(require_dayjs_min(), 1), Comment = class extends Struct {
5015
5023
  static commentRow = shallowReactive(/* @__PURE__ */ new Map());
@@ -5040,6 +5048,20 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
5040
5048
  }, user_exports = /* @__PURE__ */ __export({ User: () => User }), User = class {
5041
5049
  static userBase = shallowReactive(/* @__PURE__ */ new Map());
5042
5050
  static userEditorBase = shallowReactive(/* @__PURE__ */ new Map());
5051
+ static subscribes = shallowReactive(/* @__PURE__ */ new Map());
5052
+ static setSubscribes(e, n, r) {
5053
+ this.subscribes.set(`${e}:${n}`, r);
5054
+ }
5055
+ static getSubscribes(e, n) {
5056
+ return this.subscribes.get(`${e}:${n}`);
5057
+ }
5058
+ static authorActions = shallowReactive(/* @__PURE__ */ new Map());
5059
+ static setAuthorActions(e, n, r) {
5060
+ this.authorActions.set(`${e}:${n}`, r);
5061
+ }
5062
+ static getAuthorActions(e, n) {
5063
+ return this.authorActions.get(`${e}:${n}`);
5064
+ }
5043
5065
  constructor(e) {
5044
5066
  e.avatar && (this.avatar = Image$1.create(e.avatar)), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin;
5045
5067
  }
@@ -5217,7 +5239,7 @@ const appConfig = new ConfigPointer("core", {
5217
5239
  if (isFunction(e)) var n = e(window.$$safe$$);
5218
5240
  else var n = e;
5219
5241
  console.log("[definePlugin] new plugin defining...", n);
5220
- let { name: r, content: i, image: a, search: o, user: s } = n;
5242
+ let { name: r, content: i, image: a, search: o, user: s, subscribe: c } = n;
5221
5243
  if (i) {
5222
5244
  for (let [e, n] of Object.entries(i.layout ?? {})) ContentPage.setViewLayout(e, n);
5223
5245
  for (let [e, n] of Object.entries(i.itemCard ?? {})) ContentPage.setItemCard(e, n);
@@ -5237,7 +5259,9 @@ const appConfig = new ConfigPointer("core", {
5237
5259
  for (let e of o.hotPage.topButton ?? []) ContentPage.setTopButton(r, e);
5238
5260
  }
5239
5261
  }
5240
- if (s && User.userEditorBase.set(r, s.edit), n.config) for (let e of n.config) useConfig().$resignerConfig(e);
5262
+ if (s && (s.edit && User.userEditorBase.set(r, s.edit), s.authorActions)) for (let [e, n] of Object.entries(s.authorActions)) User.setAuthorActions(r, e, n);
5263
+ if (c) for (let [e, n] of Object.entries(c)) User.setSubscribes(r, e, n);
5264
+ if (n.config) for (let e of n.config) useConfig().$resignerConfig(e);
5241
5265
  return SharedFunction.call("addPlugin", n);
5242
5266
  }, declareDependType = (e) => Symbol.for(`expose:${e}`), requireDepend = (e) => _pluginExposes.get(e), _pluginExposes = /* @__PURE__ */ new Map(), coreModule = declareDependType("core"), _ = void 0, Comp = {
5243
5267
  Await: await_default,