delta-comic-core 0.1.2 → 0.1.3

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
@@ -4,7 +4,7 @@ import { NButton, NEmpty, NIcon, NIconWrapper, NImage, NProgress, NResult, NVirt
4
4
  import { Icon, Loading, showImagePreview } from "vant";
5
5
  import { defineStore } from "pinia";
6
6
  import axios, { getAdapter, isAxiosError, isCancel } from "axios";
7
- import { delay, isError, isUndefined } from "es-toolkit";
7
+ import { delay, isError, isString, isUndefined } from "es-toolkit";
8
8
  import { AnimatePresence, motion } from "motion-v";
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 = {};
@@ -825,7 +825,7 @@ var useScopeId = () => {
825
825
  }), r;
826
826
  };
827
827
  process.env.NODE_ENV === "production" || Object.freeze({}), process.env.NODE_ENV === "production" || Object.freeze([]);
828
- var isArray$1 = Array.isArray, isString$1 = (e) => typeof e == "string", isObject$2 = (e) => typeof e == "object" && !!e, cacheStringFunction$1 = (e) => {
828
+ var isArray$1 = Array.isArray, isString$2 = (e) => typeof e == "string", isObject$2 = (e) => typeof e == "object" && !!e, cacheStringFunction$1 = (e) => {
829
829
  let n = /* @__PURE__ */ Object.create(null);
830
830
  return ((r) => n[r] || (n[r] = e(r)));
831
831
  }, hyphenateRE$1 = /\B([A-Z])/g, hyphenate$1 = cacheStringFunction$1((e) => e.replace(hyphenateRE$1, "-$1").toLowerCase());
@@ -833,11 +833,11 @@ function normalizeStyle$1(e) {
833
833
  if (isArray$1(e)) {
834
834
  let n = {};
835
835
  for (let r = 0; r < e.length; r++) {
836
- let i = e[r], a = isString$1(i) ? parseStringStyle(i) : normalizeStyle$1(i);
836
+ let i = e[r], a = isString$2(i) ? parseStringStyle(i) : normalizeStyle$1(i);
837
837
  if (a) for (let e in a) n[e] = a[e];
838
838
  }
839
839
  return n;
840
- } else if (isString$1(e) || isObject$2(e)) return e;
840
+ } else if (isString$2(e) || isObject$2(e)) return e;
841
841
  }
842
842
  var listDelimiterRE = /;(?![^(]*\))/g, propertyDelimiterRE = /:([^]+)/, styleCommentRE = /\/\*[^]*?\*\//g;
843
843
  function parseStringStyle(e) {
@@ -851,11 +851,11 @@ function parseStringStyle(e) {
851
851
  }
852
852
  function stringifyStyle(e) {
853
853
  if (!e) return "";
854
- if (isString$1(e)) return e;
854
+ if (isString$2(e)) return e;
855
855
  let n = "";
856
856
  for (let r in e) {
857
857
  let i = e[r];
858
- if (isString$1(i) || typeof i == "number") {
858
+ if (isString$2(i) || typeof i == "number") {
859
859
  let e = r.startsWith("--") ? r : hyphenate$1(r);
860
860
  n += `${e}:${i};`;
861
861
  }
@@ -864,7 +864,7 @@ function stringifyStyle(e) {
864
864
  }
865
865
  function normalizeClass$1(e) {
866
866
  let n = "";
867
- if (isString$1(e)) n = e;
867
+ if (isString$2(e)) n = e;
868
868
  else if (isArray$1(e)) for (let r = 0; r < e.length; r++) {
869
869
  let i = normalizeClass$1(e[r]);
870
870
  i && (n += i + " ");
@@ -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), Tl, El = (n) => {
1085
- !e.touchable || n.touches.length > 1 || (l.start(n), c = !1, Tl = Date.now(), H(), k());
1086
- }, Dl = (r) => {
1084
+ }, J = () => K(s.active), Ol, kl = (n) => {
1085
+ !e.touchable || n.touches.length > 1 || (l.start(n), c = !1, Ol = Date.now(), H(), k());
1086
+ }, Al = (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
- }, Ol = () => {
1088
+ }, jl = () => {
1089
1089
  if (!e.touchable || !s.swiping) return;
1090
- let r = Date.now() - Tl, i = h.value / r;
1090
+ let r = Date.now() - Ol, 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
- }, kl = (n, r = {}) => {
1099
+ }, Ml = (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
- }, Al = (n, r) => {
1109
+ }, Nl = (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
- }, jl = () => {
1115
+ }, Pl = () => {
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(Al)]);
1120
+ if (e.showIndicators && p.value > 1) return createVNode("div", { class: bem$7("indicators", { vertical: e.vertical }) }, [Array(p.value).fill("").map(Nl)]);
1121
1121
  };
1122
1122
  return useExpose({
1123
1123
  prev: A,
1124
1124
  next: z,
1125
1125
  state: s,
1126
1126
  resize: J,
1127
- swipeTo: kl
1127
+ swipeTo: Ml
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", Dl, { target: o }), () => createVNode("div", {
1140
+ }), onMounted(K), onActivated(() => K(s.active)), onPopupReopen(() => K(s.active)), onDeactivated(H), onBeforeUnmount(H), useEventListener("touchmove", Al, { 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: El,
1148
- onTouchend: Ol,
1149
- onTouchcancel: Ol
1150
- }, [r.default?.call(r)]), jl()]);
1147
+ onTouchstartPassive: kl,
1148
+ onTouchend: jl,
1149
+ onTouchcancel: jl
1150
+ }, [r.default?.call(r)]), Pl()]);
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
- }, wl = (e) => {
1250
+ }, Dl = (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 = wl(r);
1257
+ let a = Dl(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
- }, Tl = (e) => {
1289
+ }, Ol = (e) => {
1290
1290
  nextTick(() => {
1291
1291
  H(e), W(!0);
1292
1292
  });
1293
- }, El = () => {
1293
+ }, kl = () => {
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
- }, Dl = () => {
1300
- e.scrollspy && !o && V(El());
1301
- }, Ol = () => {
1299
+ }, Al = () => {
1300
+ e.scrollspy && !o && V(kl());
1301
+ }, jl = () => {
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
- }, kl = () => {
1306
+ }, Ml = () => {
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
- Ol(),
1322
+ jl(),
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
- }, Al = () => {
1326
+ }, Nl = () => {
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, Al), watch(() => e.active, (e) => {
1337
+ ], B), watch(windowWidth, Nl), 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: Al,
1345
- scrollTo: Tl
1344
+ resize: Nl,
1345
+ scrollTo: Ol
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", Dl, {
1350
+ }), useVisibilityChange(u, B), useEventListener("scroll", Al, {
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: () => [kl()] }) : kl() : null, createVNode(stdin_default$5, {
1369
+ }, { default: () => [Ml()] }) : Ml() : null, createVNode(stdin_default$5, {
1370
1370
  ref: m,
1371
1371
  count: b.length,
1372
1372
  inited: C.inited,
@@ -2047,7 +2047,7 @@ function last$1(e) {
2047
2047
  function last(e) {
2048
2048
  if (isArrayLike(e)) return last$1(toArray$1(e));
2049
2049
  }
2050
- function isString(e) {
2050
+ function isString$1(e) {
2051
2051
  return typeof e == "string" || e instanceof String;
2052
2052
  }
2053
2053
  function isArray(e) {
@@ -2999,7 +2999,7 @@ var image_default = /* @__PURE__ */ defineComponent({
2999
2999
  setup(n, { expose: r, emit: i }) {
3000
3000
  let u = n, f = computedAsync(async () => {
3001
3001
  try {
3002
- return u.src ? isString(u.src) ? u.src : await u.src.getUrl() : "";
3002
+ return u.src ? isString$1(u.src) ? u.src : await u.src.getUrl() : "";
3003
3003
  } catch (e) {
3004
3004
  console.error(e);
3005
3005
  }
@@ -3016,7 +3016,7 @@ var image_default = /* @__PURE__ */ defineComponent({
3016
3016
  watch(f, b);
3017
3017
  let S = computed(() => v.loaded.has(f.value)), C = computedAsync(async () => {
3018
3018
  try {
3019
- return u.fallback ? isString(u.fallback) ? u.fallback : await u.fallback.getUrl() : "";
3019
+ return u.fallback ? isString$1(u.fallback) ? u.fallback : await u.fallback.getUrl() : "";
3020
3020
  } catch (e) {
3021
3021
  console.error(e);
3022
3022
  }
@@ -3277,6 +3277,8 @@ const createAxios = (e, n = {}, r) => {
3277
3277
  };
3278
3278
  var data_exports = /* @__PURE__ */ __export({
3279
3279
  PromiseContent: () => PromiseContent,
3280
+ SourcedKeyMap: () => SourcedKeyMap,
3281
+ SourcedValue: () => SourcedValue,
3280
3282
  Stream: () => Stream,
3281
3283
  Struct: () => Struct,
3282
3284
  callbackToPromise: () => callbackToPromise
@@ -3287,6 +3289,61 @@ var data_exports = /* @__PURE__ */ __export({
3287
3289
  constructor(e) {
3288
3290
  this.$$raw = e;
3289
3291
  }
3292
+ }, SourcedValue = class {
3293
+ toJSON(e) {
3294
+ return isString(e) ? this.parse(e) : e;
3295
+ }
3296
+ parse(e) {
3297
+ let n = e.split(this.separator);
3298
+ return [n[0], n.slice(1).join(this.separator)];
3299
+ }
3300
+ toString(e) {
3301
+ return isString(e) ? e : this.stringify(e);
3302
+ }
3303
+ stringify(e) {
3304
+ return e.join(this.separator);
3305
+ }
3306
+ constructor(e = ":") {
3307
+ this.separator = e;
3308
+ }
3309
+ }, SourcedKeyMap = class extends SourcedValue {
3310
+ store = shallowReactive(/* @__PURE__ */ new Map());
3311
+ get size() {
3312
+ return this.store.size;
3313
+ }
3314
+ [Symbol.toStringTag] = "SourcedKeyMap";
3315
+ clear() {
3316
+ this.store.clear();
3317
+ }
3318
+ delete(e) {
3319
+ return this.store.delete(this.toString(e));
3320
+ }
3321
+ forEach(e, n) {
3322
+ this.store.forEach((r, i) => {
3323
+ e.call(n, r, i, this);
3324
+ });
3325
+ }
3326
+ get(e) {
3327
+ return this.store.get(this.toString(e));
3328
+ }
3329
+ has(e) {
3330
+ return this.store.has(this.toString(e));
3331
+ }
3332
+ set(e, n) {
3333
+ return this.store.set(this.toString(e), n), this;
3334
+ }
3335
+ entries() {
3336
+ return this.store.entries();
3337
+ }
3338
+ keys() {
3339
+ return this.store.keys();
3340
+ }
3341
+ values() {
3342
+ return this.store.values();
3343
+ }
3344
+ [Symbol.iterator]() {
3345
+ return this.entries();
3346
+ }
3290
3347
  }, PromiseContent = class e {
3291
3348
  [Symbol.toStringTag] = "PromiseContent";
3292
3349
  static _this;
@@ -4583,7 +4640,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
4583
4640
  return new this(e, n);
4584
4641
  }
4585
4642
  constructor(e, n) {
4586
- super(e), this.aspect = n, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.path = e.path, this.forkNamespace = e.forkNamespace, this.processSteps = (e.processSteps ?? []).map((e) => isString(e) ? {
4643
+ super(e), this.aspect = n, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.path = e.path, this.forkNamespace = e.forkNamespace, this.processSteps = (e.processSteps ?? []).map((e) => isString$1(e) ? {
4587
4644
  referenceName: e,
4588
4645
  ignoreExit: !1
4589
4646
  } : e);
@@ -4947,7 +5004,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
4947
5004
  return r;
4948
5005
  }
4949
5006
  static toContentType(e) {
4950
- if (isString(e)) {
5007
+ if (isString$1(e)) {
4951
5008
  let [n, r] = e.split(":");
4952
5009
  return {
4953
5010
  name: r,
@@ -4957,7 +5014,7 @@ var Ce = ["data-index"], U = /* @__PURE__ */ defineComponent({
4957
5014
  return e;
4958
5015
  }
4959
5016
  static toContentTypeString(e) {
4960
- return isString(e) ? e : `${e.plugin}:${e.name}`;
5017
+ return isString$1(e) ? e : `${e.plugin}:${e.name}`;
4961
5018
  }
4962
5019
  static levelboard = useGlobalVar(shallowReactive(/* @__PURE__ */ new Map()), "uni/contentPage/levelboard");
4963
5020
  static setLevelboard(e, n) {
@@ -5196,7 +5253,7 @@ const createLoadingMessage = (e = "加载中", n = window.$message) => {
5196
5253
  });
5197
5254
  return i.ins = m, i;
5198
5255
  };
5199
- var allDownloadMessagesIsMinsize = reactive([]);
5256
+ var allDownloadMessagesIsMinsize = useGlobalVar(reactive([]), "utils/messsage/allDownloadMessagesIsMinsize");
5200
5257
  const createDownloadMessage = async (e, n) => {
5201
5258
  let o = allDownloadMessagesIsMinsize.length;
5202
5259
  allDownloadMessagesIsMinsize[o] = !1;
@@ -5317,7 +5374,9 @@ const createDownloadMessage = async (e, n) => {
5317
5374
  createProgress: (e, n) => m(e, { progress: 0 }, n),
5318
5375
  createLoading: (e, n) => m(e, {}, n)
5319
5376
  });
5320
- await until(() => c.every((e) => !isUndefined(e.state))).toBeTruthy(), l.value = !1, s.value = !0, await nextTick(), await until(l).toBeTruthy(), u.stop(), p.destroy(), allDownloadMessagesIsMinsize[o] = void 0;
5377
+ await until(() => c.every((e) => !!e.state)).toBeTruthy(), l.value = !1, s.value = !0, delay(3e3).then(() => {
5378
+ l.value = !0;
5379
+ }), await nextTick(), await until(l).toBeTruthy(), u.stop(), p.destroy(), allDownloadMessagesIsMinsize[o] = void 0;
5321
5380
  let g = c.find((e) => e.state == "error");
5322
5381
  if (console.log("[maybeError]", g, c), g) throw g.error;
5323
5382
  return h;