jit-viewer 1.0.9 → 1.1.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/dist/index.js CHANGED
@@ -21,7 +21,18 @@ const EXTENSION_MAP = {
21
21
  "markdown": "markdown",
22
22
  "ofd": "ofd",
23
23
  "html": "html",
24
- "htm": "html"
24
+ "htm": "html",
25
+ // 图片格式
26
+ "jpg": "image",
27
+ "jpeg": "image",
28
+ "png": "image",
29
+ "gif": "image",
30
+ "webp": "image",
31
+ "svg": "image",
32
+ "bmp": "image",
33
+ "tiff": "image",
34
+ "tif": "image",
35
+ "ico": "image"
25
36
  };
26
37
  const MIME_MAP = {
27
38
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
@@ -35,7 +46,17 @@ const MIME_MAP = {
35
46
  "text/x-markdown": "md",
36
47
  "application/ofd": "ofd",
37
48
  "text/html": "html",
38
- "application/xhtml+xml": "html"
49
+ "application/xhtml+xml": "html",
50
+ // 图片 MIME 类型
51
+ "image/jpeg": "image",
52
+ "image/png": "image",
53
+ "image/gif": "image",
54
+ "image/webp": "image",
55
+ "image/svg+xml": "image",
56
+ "image/bmp": "image",
57
+ "image/tiff": "image",
58
+ "image/x-icon": "image",
59
+ "image/vnd.microsoft.icon": "image"
39
60
  };
40
61
  function getFileExtension(filename) {
41
62
  const match = filename.toLowerCase().match(/\.([a-z0-9]+)$/);
@@ -13834,13 +13855,13 @@ function useViewerState() {
13834
13855
  }
13835
13856
  return context;
13836
13857
  }
13837
- const _hoisted_1$b = ["disabled", "title"];
13838
- const _hoisted_2$7 = { class: "jv-toolbar-btn__icon" };
13839
- const _hoisted_3$2 = {
13858
+ const _hoisted_1$c = ["disabled", "title"];
13859
+ const _hoisted_2$8 = { class: "jv-toolbar-btn__icon" };
13860
+ const _hoisted_3$3 = {
13840
13861
  key: 0,
13841
13862
  class: "jv-toolbar-btn__label"
13842
13863
  };
13843
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
13864
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
13844
13865
  __name: "ActionButton",
13845
13866
  props: {
13846
13867
  type: {},
@@ -13864,11 +13885,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
13864
13885
  title: __props.title,
13865
13886
  onClick: handleClick
13866
13887
  }, [
13867
- createBaseVNode("span", _hoisted_2$7, [
13888
+ createBaseVNode("span", _hoisted_2$8, [
13868
13889
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
13869
13890
  ]),
13870
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
13871
- ], 10, _hoisted_1$b);
13891
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
13892
+ ], 10, _hoisted_1$c);
13872
13893
  };
13873
13894
  }
13874
13895
  });
@@ -13879,11 +13900,11 @@ const _export_sfc = (sfc, props) => {
13879
13900
  }
13880
13901
  return target;
13881
13902
  };
13882
- const ActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-9abd52f0"]]);
13883
- const _hoisted_1$a = { class: "jv-zoom-control" };
13884
- const _hoisted_2$6 = { class: "jv-zoom-control__value" };
13903
+ const ActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-9abd52f0"]]);
13904
+ const _hoisted_1$b = { class: "jv-zoom-control" };
13905
+ const _hoisted_2$7 = { class: "jv-zoom-control__value" };
13885
13906
  const ZOOM_STEP = 0.1;
13886
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
13907
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
13887
13908
  __name: "ZoomControl",
13888
13909
  setup(__props) {
13889
13910
  const { t } = useLocale();
@@ -13898,7 +13919,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
13898
13919
  resetTransform();
13899
13920
  }
13900
13921
  return (_ctx, _cache) => {
13901
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
13922
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
13902
13923
  createVNode(ActionButton, {
13903
13924
  type: "zoom-out",
13904
13925
  title: unref(t)("toolbar.zoomOut"),
@@ -13932,7 +13953,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
13932
13953
  ])]),
13933
13954
  _: 1
13934
13955
  }, 8, ["title"]),
13935
- createBaseVNode("span", _hoisted_2$6, toDisplayString(Math.round(unref(zoom) * 100)) + "%", 1),
13956
+ createBaseVNode("span", _hoisted_2$7, toDisplayString(Math.round(unref(zoom) * 100)) + "%", 1),
13936
13957
  createVNode(ActionButton, {
13937
13958
  type: "zoom-in",
13938
13959
  title: unref(t)("toolbar.zoomIn"),
@@ -14006,10 +14027,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14006
14027
  };
14007
14028
  }
14008
14029
  });
14009
- const ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-874ddbac"]]);
14010
- const _hoisted_1$9 = { class: "jv-rotate-control" };
14030
+ const ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-874ddbac"]]);
14031
+ const _hoisted_1$a = { class: "jv-rotate-control" };
14011
14032
  const ROTATE_STEP = 90;
14012
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
14033
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14013
14034
  __name: "RotateControl",
14014
14035
  setup(__props) {
14015
14036
  const { t } = useLocale();
@@ -14021,7 +14042,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14021
14042
  setRotate(ROTATE_STEP);
14022
14043
  }
14023
14044
  return (_ctx, _cache) => {
14024
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
14045
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
14025
14046
  createVNode(ActionButton, {
14026
14047
  type: "rotate-left",
14027
14048
  title: unref(t)("toolbar.rotateLeft"),
@@ -14060,22 +14081,22 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14060
14081
  };
14061
14082
  }
14062
14083
  });
14063
- const RotateControl = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-ad291658"]]);
14064
- const _hoisted_1$8 = {
14084
+ const RotateControl = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ad291658"]]);
14085
+ const _hoisted_1$9 = {
14065
14086
  key: 0,
14066
14087
  viewBox: "0 0 24 24",
14067
14088
  fill: "none",
14068
14089
  stroke: "currentColor",
14069
14090
  "stroke-width": "2"
14070
14091
  };
14071
- const _hoisted_2$5 = {
14092
+ const _hoisted_2$6 = {
14072
14093
  key: 1,
14073
14094
  viewBox: "0 0 24 24",
14074
14095
  fill: "none",
14075
14096
  stroke: "currentColor",
14076
14097
  "stroke-width": "2"
14077
14098
  };
14078
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
14099
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14079
14100
  __name: "FullscreenButton",
14080
14101
  setup(__props) {
14081
14102
  const { t } = useLocale();
@@ -14104,9 +14125,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14104
14125
  onClick: toggleFullscreen
14105
14126
  }, {
14106
14127
  default: withCtx(() => [
14107
- !isFullscreen.value ? (openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
14128
+ !isFullscreen.value ? (openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
14108
14129
  createBaseVNode("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }, null, -1)
14109
- ])])) : (openBlock(), createElementBlock("svg", _hoisted_2$5, [..._cache[1] || (_cache[1] = [
14130
+ ])])) : (openBlock(), createElementBlock("svg", _hoisted_2$6, [..._cache[1] || (_cache[1] = [
14110
14131
  createBaseVNode("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }, null, -1)
14111
14132
  ])]))
14112
14133
  ]),
@@ -14115,18 +14136,18 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14115
14136
  };
14116
14137
  }
14117
14138
  });
14118
- const _hoisted_1$7 = {
14139
+ const _hoisted_1$8 = {
14119
14140
  key: 0,
14120
14141
  class: "jv-pagination"
14121
14142
  };
14122
- const _hoisted_2$4 = { class: "jv-pagination__info" };
14123
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
14143
+ const _hoisted_2$5 = { class: "jv-pagination__info" };
14144
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14124
14145
  __name: "Pagination",
14125
14146
  setup(__props) {
14126
14147
  const { t } = useLocale();
14127
14148
  const { currentPage, totalPages, prevPage, nextPage } = useViewerState();
14128
14149
  return (_ctx, _cache) => {
14129
- return unref(totalPages) > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
14150
+ return unref(totalPages) > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
14130
14151
  createVNode(ActionButton, {
14131
14152
  type: "prev",
14132
14153
  title: unref(t)("toolbar.prevPage"),
@@ -14145,7 +14166,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14145
14166
  ])]),
14146
14167
  _: 1
14147
14168
  }, 8, ["title", "disabled", "onClick"]),
14148
- createBaseVNode("span", _hoisted_2$4, toDisplayString(unref(t)("toolbar.pageInfo", { current: unref(currentPage).toString(), total: unref(totalPages).toString() })), 1),
14169
+ createBaseVNode("span", _hoisted_2$5, toDisplayString(unref(t)("toolbar.pageInfo", { current: unref(currentPage).toString(), total: unref(totalPages).toString() })), 1),
14149
14170
  createVNode(ActionButton, {
14150
14171
  type: "next",
14151
14172
  title: unref(t)("toolbar.nextPage"),
@@ -14168,17 +14189,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14168
14189
  };
14169
14190
  }
14170
14191
  });
14171
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-97c0759f"]]);
14172
- const _hoisted_1$6 = {
14192
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-97c0759f"]]);
14193
+ const _hoisted_1$7 = {
14173
14194
  key: 0,
14174
14195
  class: "jv-toolbar__top"
14175
14196
  };
14176
- const _hoisted_2$3 = { class: "jv-toolbar__left" };
14177
- const _hoisted_3$1 = {
14197
+ const _hoisted_2$4 = { class: "jv-toolbar__left" };
14198
+ const _hoisted_3$2 = {
14178
14199
  key: 0,
14179
14200
  class: "jv-toolbar__filename"
14180
14201
  };
14181
- const _hoisted_4$1 = { class: "jv-toolbar__center" };
14202
+ const _hoisted_4$2 = { class: "jv-toolbar__center" };
14182
14203
  const _hoisted_5$1 = { class: "jv-toolbar__right" };
14183
14204
  const _hoisted_6$1 = {
14184
14205
  key: 1,
@@ -14187,7 +14208,7 @@ const _hoisted_6$1 = {
14187
14208
  const _hoisted_7$1 = { class: "jv-toolbar__left" };
14188
14209
  const _hoisted_8$1 = { class: "jv-toolbar__center" };
14189
14210
  const _hoisted_9 = { class: "jv-toolbar__right" };
14190
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14211
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14191
14212
  __name: "Toolbar",
14192
14213
  props: {
14193
14214
  config: {},
@@ -14245,20 +14266,20 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14245
14266
  return openBlock(), createElementBlock("div", {
14246
14267
  class: normalizeClass(["jv-toolbar", [positionClass.value, { "jv-toolbar--hidden": !__props.visible }]])
14247
14268
  }, [
14248
- showTop.value ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
14249
- createBaseVNode("div", _hoisted_2$3, [
14269
+ showTop.value ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
14270
+ createBaseVNode("div", _hoisted_2$4, [
14250
14271
  renderSlot(_ctx.$slots, "top-left", {}, () => [
14251
- unref(filename) ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(unref(filename)), 1)) : createCommentVNode("", true)
14272
+ unref(filename) ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(unref(filename)), 1)) : createCommentVNode("", true)
14252
14273
  ], true)
14253
14274
  ]),
14254
- createBaseVNode("div", _hoisted_4$1, [
14275
+ createBaseVNode("div", _hoisted_4$2, [
14255
14276
  renderSlot(_ctx.$slots, "top-center", {}, void 0, true)
14256
14277
  ]),
14257
14278
  createBaseVNode("div", _hoisted_5$1, [
14258
14279
  renderSlot(_ctx.$slots, "top-right", {}, () => [
14259
14280
  hasItem("zoom") ? (openBlock(), createBlock(ZoomControl, { key: 0 })) : createCommentVNode("", true),
14260
14281
  hasItem("rotate") ? (openBlock(), createBlock(RotateControl, { key: 1 })) : createCommentVNode("", true),
14261
- hasItem("fullscreen") ? (openBlock(), createBlock(_sfc_main$b, { key: 2 })) : createCommentVNode("", true)
14282
+ hasItem("fullscreen") ? (openBlock(), createBlock(_sfc_main$c, { key: 2 })) : createCommentVNode("", true)
14262
14283
  ], true)
14263
14284
  ])
14264
14285
  ])) : createCommentVNode("", true),
@@ -14305,7 +14326,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14305
14326
  };
14306
14327
  }
14307
14328
  });
14308
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-74d3b30f"]]);
14329
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-74d3b30f"]]);
14309
14330
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
14310
14331
  function getDefaultExportFromCjs(x) {
14311
14332
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -19431,7 +19452,7 @@ section.${e}>footer { z-index: 1; }
19431
19452
  })(lib$4);
19432
19453
  var libExports$3 = lib$4.exports;
19433
19454
  const VueOfficeDocx = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
19434
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
19455
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
19435
19456
  __name: "DocxRender",
19436
19457
  props: {
19437
19458
  source: {},
@@ -19486,7 +19507,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
19486
19507
  };
19487
19508
  }
19488
19509
  });
19489
- const DocxRender = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-9181c8b1"]]);
19510
+ const DocxRender = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-9181c8b1"]]);
19490
19511
  var lib$2 = { exports: {} };
19491
19512
  (function(module, exports$1) {
19492
19513
  !function(e, t) {
@@ -62273,7 +62294,7 @@ var lib$2 = { exports: {} };
62273
62294
  })(lib$2);
62274
62295
  var libExports$2 = lib$2.exports;
62275
62296
  const VueOfficeExcel = /* @__PURE__ */ getDefaultExportFromCjs(libExports$2);
62276
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
62297
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
62277
62298
  __name: "ExcelRender",
62278
62299
  props: {
62279
62300
  source: {},
@@ -62328,7 +62349,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
62328
62349
  };
62329
62350
  }
62330
62351
  });
62331
- const ExcelRender = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-a8c7c89f"]]);
62352
+ const ExcelRender = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a8c7c89f"]]);
62332
62353
  var lib$1 = { exports: {} };
62333
62354
  (function(module, exports$1) {
62334
62355
  (function(Q, k) {
@@ -64031,8 +64052,8 @@ var t={4186:(t,e,r)=>{var n=r(3749),i=r(8055),a=TypeError;t.exports=function(t){
64031
64052
  })(lib$1);
64032
64053
  var libExports$1 = lib$1.exports;
64033
64054
  const VueOfficePdf = /* @__PURE__ */ getDefaultExportFromCjs(libExports$1);
64034
- const _hoisted_1$5 = ["src"];
64035
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
64055
+ const _hoisted_1$6 = ["src"];
64056
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
64036
64057
  __name: "PdfRender",
64037
64058
  props: {
64038
64059
  source: {},
@@ -64131,12 +64152,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
64131
64152
  style: normalizeStyle(renderStyle.value),
64132
64153
  frameborder: "0",
64133
64154
  onLoad: handleRendered
64134
- }, null, 44, _hoisted_1$5))
64155
+ }, null, 44, _hoisted_1$6))
64135
64156
  ], 512);
64136
64157
  };
64137
64158
  }
64138
64159
  });
64139
- const PdfRender = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-32fed398"]]);
64160
+ const PdfRender = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-32fed398"]]);
64140
64161
  var lib = { exports: {} };
64141
64162
  (function(module, exports$1) {
64142
64163
  (function(Ma, No) {
@@ -102505,7 +102526,7 @@ echarts.use([` + E + "]);" : "Unknown series " + P));
102505
102526
  })(lib);
102506
102527
  var libExports = lib.exports;
102507
102528
  const VueOfficePptx = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
102508
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
102529
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
102509
102530
  __name: "PptxRender",
102510
102531
  props: {
102511
102532
  source: {},
@@ -102560,9 +102581,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
102560
102581
  };
102561
102582
  }
102562
102583
  });
102563
- const PptxRender = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-b31abca4"]]);
102564
- const _hoisted_1$4 = { class: "jv-text-content" };
102565
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
102584
+ const PptxRender = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b31abca4"]]);
102585
+ const _hoisted_1$5 = { class: "jv-text-content" };
102586
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
102566
102587
  __name: "TextRender",
102567
102588
  props: {
102568
102589
  source: {}
@@ -102594,14 +102615,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
102594
102615
  ref: containerRef,
102595
102616
  class: "jv-file-render jv-file-render--text"
102596
102617
  }, [
102597
- createBaseVNode("pre", _hoisted_1$4, toDisplayString(content.value), 1)
102618
+ createBaseVNode("pre", _hoisted_1$5, toDisplayString(content.value), 1)
102598
102619
  ], 512);
102599
102620
  };
102600
102621
  }
102601
102622
  });
102602
- const TextRender = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f5957104"]]);
102603
- const _hoisted_1$3 = ["innerHTML"];
102604
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
102623
+ const TextRender = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f5957104"]]);
102624
+ const _hoisted_1$4 = ["innerHTML"];
102625
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
102605
102626
  __name: "MarkdownRender",
102606
102627
  props: {
102607
102628
  source: {}
@@ -102618,7 +102639,89 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
102618
102639
  });
102619
102640
  function simpleMarkdownToHtml(md) {
102620
102641
  if (!md) return "";
102621
- return md.replace(/```(\w+)?\n([\s\S]*?)```/g, "<pre><code>$2</code></pre>").replace(/`([^`]+)`/g, "<code>$1</code>").replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*\*(.*?)\*\*\*/g, "<strong><em>$1</em></strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img alt="$1" src="$2" />').replace(/^\s*[-*+]\s+(.*$)/gim, "<li>$1</li>").replace(/^\s*\d+\.\s+(.*$)/gim, "<li>$1</li>").replace(/^>\s+(.*$)/gim, "<blockquote>$1</blockquote>").replace(/^---$/gim, "<hr />").replace(/\n\n/g, "</p><p>").replace(/\n/g, "<br />").replace(/^(.+)$/gim, "<p>$1</p>").replace(/<p><\/p>/g, "").replace(/(<li>.*<\/li>)/s, "<ul>$1</ul>");
102642
+ let html = md.replace(/```(\w+)?\n([\s\S]*?)```/g, "<pre><code>$2</code></pre>").replace(/`([^`]+)`/g, "<code>$1</code>");
102643
+ html = parseTables(html);
102644
+ html = html.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*\*(.*?)\*\*\*/g, "<strong><em>$1</em></strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/___(.*?)___/g, "<strong><em>$1</em></strong>").replace(/__(.*?)__/g, "<strong>$1</strong>").replace(/_(.*?)_/g, "<em>$1</em>").replace(/~~(.*?)~~/g, "<del>$1</del>").replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img alt="$1" src="$2" />').replace(/^>\s+(.*$)/gim, "<blockquote>$1</blockquote>").replace(/^---$/gim, "<hr />").replace(/^\*\*\*$/gim, "<hr />").replace(/^___$/gim, "<hr />");
102645
+ html = parseLists(html);
102646
+ html = html.replace(/\n\n/g, "</p><p>").replace(/\n/g, "<br />").replace(/^(.+)$/gim, "<p>$1</p>").replace(/<p><\/p>/g, "").replace(/<p>(<[uo]l>)/g, "$1").replace(/(<\/[uo]l>)<\/p>/g, "$1").replace(/<p>(<[hb]r)/g, "$1").replace(/(<\/blockquote>)<\/p>/g, "$1");
102647
+ return html;
102648
+ }
102649
+ function parseTables(md) {
102650
+ const lines = md.split("\n");
102651
+ const result = [];
102652
+ let i = 0;
102653
+ while (i < lines.length) {
102654
+ const line = lines[i];
102655
+ if (line.includes("|")) {
102656
+ const nextLine = lines[i + 1];
102657
+ if (nextLine && /^\|?[\s|:|-]+\|/.test(nextLine)) {
102658
+ const headerLine = line;
102659
+ i += 2;
102660
+ const headers = headerLine.split("|").map((cell) => cell.trim()).filter((cell) => cell !== "").map((cell) => `<th>${cell}</th>`).join("");
102661
+ const rows = [];
102662
+ while (i < lines.length && lines[i].includes("|")) {
102663
+ const rowCells = lines[i].split("|").map((cell) => cell.trim()).filter((cell) => cell !== "").map((cell) => `<td>${cell}</td>`).join("");
102664
+ if (rowCells) {
102665
+ rows.push(`<tr>${rowCells}</tr>`);
102666
+ }
102667
+ i++;
102668
+ }
102669
+ const tableHtml = `<table><thead><tr>${headers}</tr></thead><tbody>${rows.join("")}</tbody></table>`;
102670
+ result.push(tableHtml);
102671
+ continue;
102672
+ }
102673
+ }
102674
+ result.push(line);
102675
+ i++;
102676
+ }
102677
+ return result.join("\n");
102678
+ }
102679
+ function parseLists(md) {
102680
+ const lines = md.split("\n");
102681
+ const result = [];
102682
+ let inUl = false;
102683
+ let inOl = false;
102684
+ for (let i = 0; i < lines.length; i++) {
102685
+ const line = lines[i];
102686
+ const ulMatch = line.match(/^(\s*)[-*+]\s+(.+)$/);
102687
+ const olMatch = line.match(/^(\s*)\d+\.\s+(.+)$/);
102688
+ if (ulMatch) {
102689
+ const content2 = ulMatch[2];
102690
+ if (!inUl) {
102691
+ if (inOl) {
102692
+ result.push("</ol>");
102693
+ inOl = false;
102694
+ }
102695
+ result.push("<ul>");
102696
+ inUl = true;
102697
+ }
102698
+ result.push(`<li>${content2}</li>`);
102699
+ } else if (olMatch) {
102700
+ const content2 = olMatch[2];
102701
+ if (!inOl) {
102702
+ if (inUl) {
102703
+ result.push("</ul>");
102704
+ inUl = false;
102705
+ }
102706
+ result.push("<ol>");
102707
+ inOl = true;
102708
+ }
102709
+ result.push(`<li>${content2}</li>`);
102710
+ } else {
102711
+ if (inUl) {
102712
+ result.push("</ul>");
102713
+ inUl = false;
102714
+ }
102715
+ if (inOl) {
102716
+ result.push("</ol>");
102717
+ inOl = false;
102718
+ }
102719
+ result.push(line);
102720
+ }
102721
+ }
102722
+ if (inUl) result.push("</ul>");
102723
+ if (inOl) result.push("</ol>");
102724
+ return result.join("\n");
102622
102725
  }
102623
102726
  async function loadFile() {
102624
102727
  try {
@@ -102643,12 +102746,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
102643
102746
  createBaseVNode("div", {
102644
102747
  class: "jv-markdown-content",
102645
102748
  innerHTML: renderedContent.value
102646
- }, null, 8, _hoisted_1$3)
102749
+ }, null, 8, _hoisted_1$4)
102647
102750
  ], 512);
102648
102751
  };
102649
102752
  }
102650
102753
  });
102651
- const MarkdownRender = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-9b60bb2a"]]);
102754
+ const MarkdownRender = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2d9fb509"]]);
102652
102755
  var dist = { exports: {} };
102653
102756
  /*! For license information please see index.js.LICENSE.txt */
102654
102757
  (function(module, exports$1) {
@@ -128282,12 +128385,12 @@ class LiteOfdAdapter {
128282
128385
  this.instance = null;
128283
128386
  }
128284
128387
  }
128285
- const _hoisted_1$2 = {
128388
+ const _hoisted_1$3 = {
128286
128389
  key: 0,
128287
128390
  class: "jv-ofd-error"
128288
128391
  };
128289
- const _hoisted_2$2 = { class: "jv-ofd-loading" };
128290
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128392
+ const _hoisted_2$3 = { class: "jv-ofd-loading" };
128393
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
128291
128394
  __name: "OfdRender",
128292
128395
  props: {
128293
128396
  source: {},
@@ -128518,7 +128621,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128518
128621
  ref: containerRef,
128519
128622
  class: "jv-file-render jv-file-render--ofd"
128520
128623
  }, [
128521
- error.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
128624
+ error.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
128522
128625
  createBaseVNode("span", null, toDisplayString(error.value), 1)
128523
128626
  ])) : (openBlock(), createElementBlock("div", {
128524
128627
  key: 1,
@@ -128537,7 +128640,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128537
128640
  }, null, 512)
128538
128641
  ], 4)
128539
128642
  ], 512)),
128540
- withDirectives(createBaseVNode("div", _hoisted_2$2, [
128643
+ withDirectives(createBaseVNode("div", _hoisted_2$3, [
128541
128644
  createBaseVNode("span", null, toDisplayString(t("loading")), 1)
128542
128645
  ], 512), [
128543
128646
  [vShow, loading.value]
@@ -128546,13 +128649,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128546
128649
  };
128547
128650
  }
128548
128651
  });
128549
- const OfdRender = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-f933a20c"]]);
128550
- const _hoisted_1$1 = { class: "jv-html-loading" };
128551
- const _hoisted_2$1 = {
128652
+ const OfdRender = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f933a20c"]]);
128653
+ const _hoisted_1$2 = { class: "jv-html-loading" };
128654
+ const _hoisted_2$2 = {
128552
128655
  key: 0,
128553
128656
  class: "jv-html-error"
128554
128657
  };
128555
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
128658
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128556
128659
  __name: "HtmlRender",
128557
128660
  props: {
128558
128661
  source: {},
@@ -128710,20 +128813,427 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
128710
128813
  style: normalizeStyle(renderStyle.value),
128711
128814
  sandbox: "allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
128712
128815
  }, null, 4),
128713
- withDirectives(createBaseVNode("div", _hoisted_1$1, [..._cache[0] || (_cache[0] = [
128816
+ withDirectives(createBaseVNode("div", _hoisted_1$2, [..._cache[0] || (_cache[0] = [
128714
128817
  createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1),
128715
128818
  createBaseVNode("span", null, "加载中...", -1)
128716
128819
  ])], 512), [
128717
128820
  [vShow, loading.value]
128718
128821
  ]),
128719
- error.value ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
128822
+ error.value ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
128720
128823
  createBaseVNode("span", null, toDisplayString(error.value), 1)
128721
128824
  ])) : createCommentVNode("", true)
128722
128825
  ], 512);
128723
128826
  };
128724
128827
  }
128725
128828
  });
128726
- const HtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-af6df043"]]);
128829
+ const HtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-af6df043"]]);
128830
+ const _hoisted_1$1 = {
128831
+ key: 0,
128832
+ class: "jv-image-loading"
128833
+ };
128834
+ const _hoisted_2$1 = {
128835
+ key: 1,
128836
+ class: "jv-image-error"
128837
+ };
128838
+ const _hoisted_3$1 = ["src", "alt"];
128839
+ const _hoisted_4$1 = {
128840
+ key: 2,
128841
+ class: "jv-image-info"
128842
+ };
128843
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
128844
+ __name: "ImageRender",
128845
+ props: {
128846
+ source: {},
128847
+ zoom: { default: 1 }
128848
+ },
128849
+ emits: ["load", "error"],
128850
+ setup(__props, { emit: __emit }) {
128851
+ const props = __props;
128852
+ const emit2 = __emit;
128853
+ const containerRef = /* @__PURE__ */ ref();
128854
+ const imageWrapperRef = /* @__PURE__ */ ref();
128855
+ const imageRef = /* @__PURE__ */ ref();
128856
+ const loading = /* @__PURE__ */ ref(true);
128857
+ const error = /* @__PURE__ */ ref(null);
128858
+ const imageSrc = /* @__PURE__ */ ref("");
128859
+ const imageAlt = /* @__PURE__ */ ref("");
128860
+ const imageInfo = /* @__PURE__ */ ref(null);
128861
+ const scale = /* @__PURE__ */ ref(1);
128862
+ const rotation = /* @__PURE__ */ ref(0);
128863
+ const translateX = /* @__PURE__ */ ref(0);
128864
+ const translateY = /* @__PURE__ */ ref(0);
128865
+ const isDragging = /* @__PURE__ */ ref(false);
128866
+ const dragStart = /* @__PURE__ */ ref({ x: 0, y: 0 });
128867
+ const initialTranslate = /* @__PURE__ */ ref({ x: 0, y: 0 });
128868
+ const naturalSize = /* @__PURE__ */ ref({ width: 0, height: 0 });
128869
+ const imageStyle = computed(() => ({
128870
+ transform: `translate(${translateX.value}px, ${translateY.value}px) rotate(${rotation.value}deg) scale(${scale.value})`,
128871
+ transition: isDragging.value ? "none" : "transform 0.2s ease",
128872
+ cursor: isDragging.value ? "grabbing" : scale.value > 1 ? "grab" : "default"
128873
+ }));
128874
+ async function loadImage() {
128875
+ try {
128876
+ loading.value = true;
128877
+ error.value = null;
128878
+ const blob = await fileToBlob(props.source);
128879
+ imageInfo.value = {
128880
+ width: 0,
128881
+ height: 0,
128882
+ size: blob.size
128883
+ };
128884
+ imageSrc.value = URL.createObjectURL(blob);
128885
+ if (props.source instanceof File) {
128886
+ imageAlt.value = props.source.name;
128887
+ }
128888
+ } catch (err) {
128889
+ loading.value = false;
128890
+ error.value = err;
128891
+ emit2("error", err);
128892
+ }
128893
+ }
128894
+ function handleImageLoad() {
128895
+ if (imageRef.value) {
128896
+ naturalSize.value = {
128897
+ width: imageRef.value.naturalWidth,
128898
+ height: imageRef.value.naturalHeight
128899
+ };
128900
+ if (imageInfo.value) {
128901
+ imageInfo.value.width = imageRef.value.naturalWidth;
128902
+ imageInfo.value.height = imageRef.value.naturalHeight;
128903
+ }
128904
+ fitToScreen();
128905
+ loading.value = false;
128906
+ emit2("load");
128907
+ }
128908
+ }
128909
+ function handleImageError() {
128910
+ loading.value = false;
128911
+ error.value = new Error("图片加载失败");
128912
+ emit2("error", error.value);
128913
+ }
128914
+ function zoomIn() {
128915
+ scale.value = Math.min(scale.value * 1.25, 10);
128916
+ }
128917
+ function zoomOut() {
128918
+ scale.value = Math.max(scale.value / 1.25, 0.1);
128919
+ if (scale.value <= 1) {
128920
+ translateX.value = 0;
128921
+ translateY.value = 0;
128922
+ }
128923
+ }
128924
+ function resetZoom() {
128925
+ scale.value = 1;
128926
+ rotation.value = 0;
128927
+ translateX.value = 0;
128928
+ translateY.value = 0;
128929
+ }
128930
+ function fitToScreen() {
128931
+ if (!imageRef.value || !containerRef.value) return;
128932
+ const containerRect = containerRef.value.getBoundingClientRect();
128933
+ const containerWidth = containerRect.width - 40;
128934
+ const containerHeight = containerRect.height - 40;
128935
+ const imgWidth = naturalSize.value.width;
128936
+ const imgHeight = naturalSize.value.height;
128937
+ const scaleX = containerWidth / imgWidth;
128938
+ const scaleY = containerHeight / imgHeight;
128939
+ const fitScale = Math.min(scaleX, scaleY, 1);
128940
+ scale.value = fitScale;
128941
+ rotation.value = 0;
128942
+ translateX.value = 0;
128943
+ translateY.value = 0;
128944
+ }
128945
+ function rotateLeft() {
128946
+ rotation.value -= 90;
128947
+ }
128948
+ function rotateRight() {
128949
+ rotation.value += 90;
128950
+ }
128951
+ function handleWheel(e) {
128952
+ const delta = e.deltaY > 0 ? 0.9 : 1.1;
128953
+ const newScale = Math.min(Math.max(scale.value * delta, 0.1), 10);
128954
+ if (newScale !== scale.value && imageWrapperRef.value) {
128955
+ const rect = imageWrapperRef.value.getBoundingClientRect();
128956
+ const mouseX = e.clientX - rect.left - rect.width / 2;
128957
+ const mouseY = e.clientY - rect.top - rect.height / 2;
128958
+ const scaleRatio = newScale / scale.value;
128959
+ translateX.value = translateX.value * scaleRatio + mouseX * (scaleRatio - 1);
128960
+ translateY.value = translateY.value * scaleRatio + mouseY * (scaleRatio - 1);
128961
+ scale.value = newScale;
128962
+ if (scale.value <= 1) {
128963
+ translateX.value = 0;
128964
+ translateY.value = 0;
128965
+ }
128966
+ }
128967
+ }
128968
+ function handleDoubleClick() {
128969
+ if (scale.value !== 1) {
128970
+ resetZoom();
128971
+ } else {
128972
+ scale.value = 2;
128973
+ }
128974
+ }
128975
+ function handleMouseDown(e) {
128976
+ if (scale.value <= 1) return;
128977
+ isDragging.value = true;
128978
+ dragStart.value = { x: e.clientX, y: e.clientY };
128979
+ initialTranslate.value = { x: translateX.value, y: translateY.value };
128980
+ }
128981
+ function handleMouseMove(e) {
128982
+ if (!isDragging.value) return;
128983
+ const dx = e.clientX - dragStart.value.x;
128984
+ const dy = e.clientY - dragStart.value.y;
128985
+ translateX.value = initialTranslate.value.x + dx;
128986
+ translateY.value = initialTranslate.value.y + dy;
128987
+ }
128988
+ function handleMouseUp() {
128989
+ isDragging.value = false;
128990
+ }
128991
+ function toggleFullscreen() {
128992
+ if (!containerRef.value) return;
128993
+ if (!document.fullscreenElement) {
128994
+ containerRef.value.requestFullscreen();
128995
+ } else {
128996
+ document.exitFullscreen();
128997
+ }
128998
+ }
128999
+ async function downloadImage() {
129000
+ await downloadFile(props.source, imageAlt.value || "image");
129001
+ }
129002
+ function formatFileSize(bytes) {
129003
+ if (bytes === 0) return "0 B";
129004
+ const k = 1024;
129005
+ const sizes = ["B", "KB", "MB", "GB"];
129006
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
129007
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
129008
+ }
129009
+ watch(() => props.zoom, (newZoom) => {
129010
+ scale.value = newZoom;
129011
+ });
129012
+ watch(() => props.source, () => {
129013
+ if (imageSrc.value) {
129014
+ URL.revokeObjectURL(imageSrc.value);
129015
+ }
129016
+ resetZoom();
129017
+ loadImage();
129018
+ }, { immediate: true });
129019
+ onUnmounted(() => {
129020
+ if (imageSrc.value) {
129021
+ URL.revokeObjectURL(imageSrc.value);
129022
+ }
129023
+ });
129024
+ return (_ctx, _cache) => {
129025
+ return openBlock(), createElementBlock("div", {
129026
+ ref_key: "containerRef",
129027
+ ref: containerRef,
129028
+ class: "jv-file-render jv-file-render--image"
129029
+ }, [
129030
+ loading.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [..._cache[0] || (_cache[0] = [
129031
+ createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1),
129032
+ createBaseVNode("span", null, "加载中...", -1)
129033
+ ])])) : error.value ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
129034
+ _cache[1] || (_cache[1] = createBaseVNode("svg", {
129035
+ viewBox: "0 0 24 24",
129036
+ fill: "none",
129037
+ stroke: "currentColor",
129038
+ "stroke-width": "2"
129039
+ }, [
129040
+ createBaseVNode("circle", {
129041
+ cx: "12",
129042
+ cy: "12",
129043
+ r: "10"
129044
+ }),
129045
+ createBaseVNode("line", {
129046
+ x1: "12",
129047
+ y1: "8",
129048
+ x2: "12",
129049
+ y2: "12"
129050
+ }),
129051
+ createBaseVNode("line", {
129052
+ x1: "12",
129053
+ y1: "16",
129054
+ x2: "12.01",
129055
+ y2: "16"
129056
+ })
129057
+ ], -1)),
129058
+ createBaseVNode("span", null, toDisplayString(error.value.message || "图片加载失败"), 1)
129059
+ ])) : createCommentVNode("", true),
129060
+ withDirectives(createBaseVNode("div", {
129061
+ ref_key: "imageWrapperRef",
129062
+ ref: imageWrapperRef,
129063
+ class: normalizeClass(["jv-image-wrapper", { "jv-image-wrapper--dragging": isDragging.value }]),
129064
+ onWheel: withModifiers(handleWheel, ["prevent"]),
129065
+ onMousedown: withModifiers(handleMouseDown, ["prevent"]),
129066
+ onMousemove: handleMouseMove,
129067
+ onMouseup: handleMouseUp,
129068
+ onMouseleave: handleMouseUp,
129069
+ onDblclick: handleDoubleClick
129070
+ }, [
129071
+ imageSrc.value ? (openBlock(), createElementBlock("img", {
129072
+ key: 0,
129073
+ ref_key: "imageRef",
129074
+ ref: imageRef,
129075
+ src: imageSrc.value,
129076
+ alt: imageAlt.value,
129077
+ class: "jv-image",
129078
+ style: normalizeStyle(imageStyle.value),
129079
+ draggable: "false",
129080
+ onLoad: handleImageLoad,
129081
+ onError: handleImageError
129082
+ }, null, 44, _hoisted_3$1)) : createCommentVNode("", true)
129083
+ ], 34), [
129084
+ [vShow, !loading.value && !error.value]
129085
+ ]),
129086
+ createBaseVNode("div", { class: "jv-image-controls" }, [
129087
+ createBaseVNode("button", {
129088
+ class: "jv-image-btn",
129089
+ title: "放大",
129090
+ onClick: zoomIn
129091
+ }, [..._cache[2] || (_cache[2] = [
129092
+ createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-cc028f53><circle cx="11" cy="11" r="8" data-v-cc028f53></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-cc028f53></line><line x1="11" y1="8" x2="11" y2="14" data-v-cc028f53></line><line x1="8" y1="11" x2="14" y2="11" data-v-cc028f53></line></svg>', 1)
129093
+ ])]),
129094
+ createBaseVNode("button", {
129095
+ class: "jv-image-btn",
129096
+ title: "缩小",
129097
+ onClick: zoomOut
129098
+ }, [..._cache[3] || (_cache[3] = [
129099
+ createBaseVNode("svg", {
129100
+ viewBox: "0 0 24 24",
129101
+ fill: "none",
129102
+ stroke: "currentColor",
129103
+ "stroke-width": "2"
129104
+ }, [
129105
+ createBaseVNode("circle", {
129106
+ cx: "11",
129107
+ cy: "11",
129108
+ r: "8"
129109
+ }),
129110
+ createBaseVNode("line", {
129111
+ x1: "21",
129112
+ y1: "21",
129113
+ x2: "16.65",
129114
+ y2: "16.65"
129115
+ }),
129116
+ createBaseVNode("line", {
129117
+ x1: "8",
129118
+ y1: "11",
129119
+ x2: "14",
129120
+ y2: "11"
129121
+ })
129122
+ ], -1)
129123
+ ])]),
129124
+ createBaseVNode("button", {
129125
+ class: "jv-image-btn",
129126
+ title: "适应屏幕",
129127
+ onClick: fitToScreen
129128
+ }, [..._cache[4] || (_cache[4] = [
129129
+ createBaseVNode("svg", {
129130
+ viewBox: "0 0 24 24",
129131
+ fill: "none",
129132
+ stroke: "currentColor",
129133
+ "stroke-width": "2"
129134
+ }, [
129135
+ createBaseVNode("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" })
129136
+ ], -1)
129137
+ ])]),
129138
+ createBaseVNode("button", {
129139
+ class: "jv-image-btn",
129140
+ title: "实际大小",
129141
+ onClick: resetZoom
129142
+ }, [..._cache[5] || (_cache[5] = [
129143
+ createBaseVNode("svg", {
129144
+ viewBox: "0 0 24 24",
129145
+ fill: "none",
129146
+ stroke: "currentColor",
129147
+ "stroke-width": "2"
129148
+ }, [
129149
+ createBaseVNode("rect", {
129150
+ x: "3",
129151
+ y: "3",
129152
+ width: "18",
129153
+ height: "18",
129154
+ rx: "2",
129155
+ ry: "2"
129156
+ }),
129157
+ createBaseVNode("line", {
129158
+ x1: "9",
129159
+ y1: "3",
129160
+ x2: "9",
129161
+ y2: "21"
129162
+ })
129163
+ ], -1)
129164
+ ])]),
129165
+ createBaseVNode("button", {
129166
+ class: "jv-image-btn",
129167
+ title: "向左旋转",
129168
+ onClick: rotateLeft
129169
+ }, [..._cache[6] || (_cache[6] = [
129170
+ createBaseVNode("svg", {
129171
+ viewBox: "0 0 24 24",
129172
+ fill: "none",
129173
+ stroke: "currentColor",
129174
+ "stroke-width": "2"
129175
+ }, [
129176
+ createBaseVNode("polyline", { points: "9 14 4 9 9 4" }),
129177
+ createBaseVNode("path", { d: "M4 9h10a5 5 0 0 1 5 5v0" })
129178
+ ], -1)
129179
+ ])]),
129180
+ createBaseVNode("button", {
129181
+ class: "jv-image-btn",
129182
+ title: "向右旋转",
129183
+ onClick: rotateRight
129184
+ }, [..._cache[7] || (_cache[7] = [
129185
+ createBaseVNode("svg", {
129186
+ viewBox: "0 0 24 24",
129187
+ fill: "none",
129188
+ stroke: "currentColor",
129189
+ "stroke-width": "2"
129190
+ }, [
129191
+ createBaseVNode("polyline", { points: "15 14 20 9 15 4" }),
129192
+ createBaseVNode("path", { d: "M20 9H10a5 5 0 0 0-5 5v0" })
129193
+ ], -1)
129194
+ ])]),
129195
+ createBaseVNode("button", {
129196
+ class: "jv-image-btn",
129197
+ title: "全屏查看",
129198
+ onClick: toggleFullscreen
129199
+ }, [..._cache[8] || (_cache[8] = [
129200
+ createBaseVNode("svg", {
129201
+ viewBox: "0 0 24 24",
129202
+ fill: "none",
129203
+ stroke: "currentColor",
129204
+ "stroke-width": "2"
129205
+ }, [
129206
+ createBaseVNode("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" })
129207
+ ], -1)
129208
+ ])]),
129209
+ createBaseVNode("button", {
129210
+ class: "jv-image-btn",
129211
+ title: "下载图片",
129212
+ onClick: downloadImage
129213
+ }, [..._cache[9] || (_cache[9] = [
129214
+ createBaseVNode("svg", {
129215
+ viewBox: "0 0 24 24",
129216
+ fill: "none",
129217
+ stroke: "currentColor",
129218
+ "stroke-width": "2"
129219
+ }, [
129220
+ createBaseVNode("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
129221
+ createBaseVNode("polyline", { points: "7 10 12 15 17 10" }),
129222
+ createBaseVNode("line", {
129223
+ x1: "12",
129224
+ y1: "15",
129225
+ x2: "12",
129226
+ y2: "3"
129227
+ })
129228
+ ], -1)
129229
+ ])])
129230
+ ]),
129231
+ imageInfo.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, toDisplayString(imageInfo.value.width) + " × " + toDisplayString(imageInfo.value.height) + " | " + toDisplayString(formatFileSize(imageInfo.value.size)), 1)) : createCommentVNode("", true)
129232
+ ], 512);
129233
+ };
129234
+ }
129235
+ });
129236
+ const ImageRender = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-cc028f53"]]);
128727
129237
  const _hoisted_1 = {
128728
129238
  key: 0,
128729
129239
  class: "jv-viewer__error"
@@ -128737,11 +129247,11 @@ const _hoisted_4 = { class: "jv-empty-text" };
128737
129247
  const _hoisted_5 = { class: "jv-viewer__loading-overlay" };
128738
129248
  const _hoisted_6 = { class: "jv-loading-text" };
128739
129249
  const _hoisted_7 = {
128740
- key: 8,
129250
+ key: 9,
128741
129251
  class: "jv-viewer__unsupported"
128742
129252
  };
128743
129253
  const _hoisted_8 = {
128744
- key: 9,
129254
+ key: 10,
128745
129255
  class: "jv-viewer__unsupported"
128746
129256
  };
128747
129257
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -129241,7 +129751,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
129241
129751
  "request-adapter": requestAdapter.value,
129242
129752
  onLoad: handleLoad,
129243
129753
  onError: handleError2
129244
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "unknown" && unref(fileSource) ? (openBlock(), createElementBlock("div", _hoisted_7, [..._cache[3] || (_cache[3] = [
129754
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "image" ? (openBlock(), createBlock(unref(ImageRender), {
129755
+ key: 8,
129756
+ source: unref(fileSource),
129757
+ zoom: unref(zoom),
129758
+ onLoad: handleLoad,
129759
+ onError: handleError2
129760
+ }, null, 8, ["source", "zoom"])) : unref(fileType) === "unknown" && unref(fileSource) ? (openBlock(), createElementBlock("div", _hoisted_7, [..._cache[3] || (_cache[3] = [
129245
129761
  createBaseVNode("span", null, "未知文件类型", -1)
129246
129762
  ])])) : (openBlock(), createElementBlock("div", _hoisted_8, [
129247
129763
  createBaseVNode("span", null, toDisplayString(unref(t)("error.unsupportedType")), 1)
@@ -129252,7 +129768,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
129252
129768
  };
129253
129769
  }
129254
129770
  });
129255
- const Viewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6150f325"]]);
129771
+ const Viewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-12fe006b"]]);
129256
129772
  function createViewer(options) {
129257
129773
  const events = createEventBus();
129258
129774
  let app = null;
@@ -129404,6 +129920,7 @@ export {
129404
129920
  DocxRender,
129405
129921
  ExcelRender,
129406
129922
  HtmlRender,
129923
+ ImageRender,
129407
129924
  MarkdownRender,
129408
129925
  OfdRender,
129409
129926
  PdfRender,