jit-viewer 1.1.0 → 1.1.2

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
@@ -13855,13 +13855,13 @@ function useViewerState() {
13855
13855
  }
13856
13856
  return context;
13857
13857
  }
13858
- const _hoisted_1$c = ["disabled", "title"];
13858
+ const _hoisted_1$d = ["disabled", "title"];
13859
13859
  const _hoisted_2$8 = { class: "jv-toolbar-btn__icon" };
13860
13860
  const _hoisted_3$3 = {
13861
13861
  key: 0,
13862
13862
  class: "jv-toolbar-btn__label"
13863
13863
  };
13864
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
13864
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
13865
13865
  __name: "ActionButton",
13866
13866
  props: {
13867
13867
  type: {},
@@ -13889,7 +13889,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
13889
13889
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
13890
13890
  ]),
13891
13891
  __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
13892
- ], 10, _hoisted_1$c);
13892
+ ], 10, _hoisted_1$d);
13893
13893
  };
13894
13894
  }
13895
13895
  });
@@ -13900,11 +13900,11 @@ const _export_sfc = (sfc, props) => {
13900
13900
  }
13901
13901
  return target;
13902
13902
  };
13903
- const ActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-9abd52f0"]]);
13904
- const _hoisted_1$b = { class: "jv-zoom-control" };
13903
+ const ActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-9abd52f0"]]);
13904
+ const _hoisted_1$c = { class: "jv-zoom-control" };
13905
13905
  const _hoisted_2$7 = { class: "jv-zoom-control__value" };
13906
13906
  const ZOOM_STEP = 0.1;
13907
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
13907
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
13908
13908
  __name: "ZoomControl",
13909
13909
  setup(__props) {
13910
13910
  const { t } = useLocale();
@@ -13919,7 +13919,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
13919
13919
  resetTransform();
13920
13920
  }
13921
13921
  return (_ctx, _cache) => {
13922
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
13922
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
13923
13923
  createVNode(ActionButton, {
13924
13924
  type: "zoom-out",
13925
13925
  title: unref(t)("toolbar.zoomOut"),
@@ -14027,10 +14027,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
14027
14027
  };
14028
14028
  }
14029
14029
  });
14030
- const ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-874ddbac"]]);
14031
- const _hoisted_1$a = { class: "jv-rotate-control" };
14030
+ const ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-874ddbac"]]);
14031
+ const _hoisted_1$b = { class: "jv-rotate-control" };
14032
14032
  const ROTATE_STEP = 90;
14033
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
14033
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
14034
14034
  __name: "RotateControl",
14035
14035
  setup(__props) {
14036
14036
  const { t } = useLocale();
@@ -14042,7 +14042,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14042
14042
  setRotate(ROTATE_STEP);
14043
14043
  }
14044
14044
  return (_ctx, _cache) => {
14045
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
14045
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
14046
14046
  createVNode(ActionButton, {
14047
14047
  type: "rotate-left",
14048
14048
  title: unref(t)("toolbar.rotateLeft"),
@@ -14081,8 +14081,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14081
14081
  };
14082
14082
  }
14083
14083
  });
14084
- const RotateControl = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ad291658"]]);
14085
- const _hoisted_1$9 = {
14084
+ const RotateControl = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-ad291658"]]);
14085
+ const _hoisted_1$a = {
14086
14086
  key: 0,
14087
14087
  viewBox: "0 0 24 24",
14088
14088
  fill: "none",
@@ -14096,7 +14096,7 @@ const _hoisted_2$6 = {
14096
14096
  stroke: "currentColor",
14097
14097
  "stroke-width": "2"
14098
14098
  };
14099
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
14099
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14100
14100
  __name: "FullscreenButton",
14101
14101
  setup(__props) {
14102
14102
  const { t } = useLocale();
@@ -14125,7 +14125,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14125
14125
  onClick: toggleFullscreen
14126
14126
  }, {
14127
14127
  default: withCtx(() => [
14128
- !isFullscreen.value ? (openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
14128
+ !isFullscreen.value ? (openBlock(), createElementBlock("svg", _hoisted_1$a, [..._cache[0] || (_cache[0] = [
14129
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)
14130
14130
  ])])) : (openBlock(), createElementBlock("svg", _hoisted_2$6, [..._cache[1] || (_cache[1] = [
14131
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)
@@ -14136,18 +14136,18 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14136
14136
  };
14137
14137
  }
14138
14138
  });
14139
- const _hoisted_1$8 = {
14139
+ const _hoisted_1$9 = {
14140
14140
  key: 0,
14141
14141
  class: "jv-pagination"
14142
14142
  };
14143
14143
  const _hoisted_2$5 = { class: "jv-pagination__info" };
14144
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
14144
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14145
14145
  __name: "Pagination",
14146
14146
  setup(__props) {
14147
14147
  const { t } = useLocale();
14148
14148
  const { currentPage, totalPages, prevPage, nextPage } = useViewerState();
14149
14149
  return (_ctx, _cache) => {
14150
- return unref(totalPages) > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
14150
+ return unref(totalPages) > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
14151
14151
  createVNode(ActionButton, {
14152
14152
  type: "prev",
14153
14153
  title: unref(t)("toolbar.prevPage"),
@@ -14189,8 +14189,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14189
14189
  };
14190
14190
  }
14191
14191
  });
14192
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-97c0759f"]]);
14193
- const _hoisted_1$7 = {
14192
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-97c0759f"]]);
14193
+ const _hoisted_1$8 = {
14194
14194
  key: 0,
14195
14195
  class: "jv-toolbar__top"
14196
14196
  };
@@ -14208,7 +14208,7 @@ const _hoisted_6$1 = {
14208
14208
  const _hoisted_7$1 = { class: "jv-toolbar__left" };
14209
14209
  const _hoisted_8$1 = { class: "jv-toolbar__center" };
14210
14210
  const _hoisted_9 = { class: "jv-toolbar__right" };
14211
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
14211
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14212
14212
  __name: "Toolbar",
14213
14213
  props: {
14214
14214
  config: {},
@@ -14266,7 +14266,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14266
14266
  return openBlock(), createElementBlock("div", {
14267
14267
  class: normalizeClass(["jv-toolbar", [positionClass.value, { "jv-toolbar--hidden": !__props.visible }]])
14268
14268
  }, [
14269
- showTop.value ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
14269
+ showTop.value ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
14270
14270
  createBaseVNode("div", _hoisted_2$4, [
14271
14271
  renderSlot(_ctx.$slots, "top-left", {}, () => [
14272
14272
  unref(filename) ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(unref(filename)), 1)) : createCommentVNode("", true)
@@ -14279,7 +14279,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14279
14279
  renderSlot(_ctx.$slots, "top-right", {}, () => [
14280
14280
  hasItem("zoom") ? (openBlock(), createBlock(ZoomControl, { key: 0 })) : createCommentVNode("", true),
14281
14281
  hasItem("rotate") ? (openBlock(), createBlock(RotateControl, { key: 1 })) : createCommentVNode("", true),
14282
- hasItem("fullscreen") ? (openBlock(), createBlock(_sfc_main$c, { key: 2 })) : createCommentVNode("", true)
14282
+ hasItem("fullscreen") ? (openBlock(), createBlock(_sfc_main$d, { key: 2 })) : createCommentVNode("", true)
14283
14283
  ], true)
14284
14284
  ])
14285
14285
  ])) : createCommentVNode("", true),
@@ -14326,7 +14326,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14326
14326
  };
14327
14327
  }
14328
14328
  });
14329
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-74d3b30f"]]);
14329
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-74d3b30f"]]);
14330
14330
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
14331
14331
  function getDefaultExportFromCjs(x) {
14332
14332
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -19452,7 +19452,7 @@ section.${e}>footer { z-index: 1; }
19452
19452
  })(lib$4);
19453
19453
  var libExports$3 = lib$4.exports;
19454
19454
  const VueOfficeDocx = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
19455
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
19455
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
19456
19456
  __name: "DocxRender",
19457
19457
  props: {
19458
19458
  source: {},
@@ -19507,7 +19507,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
19507
19507
  };
19508
19508
  }
19509
19509
  });
19510
- const DocxRender = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-9181c8b1"]]);
19510
+ const DocxRender = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-9181c8b1"]]);
19511
19511
  var lib$2 = { exports: {} };
19512
19512
  (function(module, exports$1) {
19513
19513
  !function(e, t) {
@@ -62294,7 +62294,7 @@ var lib$2 = { exports: {} };
62294
62294
  })(lib$2);
62295
62295
  var libExports$2 = lib$2.exports;
62296
62296
  const VueOfficeExcel = /* @__PURE__ */ getDefaultExportFromCjs(libExports$2);
62297
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
62297
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
62298
62298
  __name: "ExcelRender",
62299
62299
  props: {
62300
62300
  source: {},
@@ -62349,7 +62349,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
62349
62349
  };
62350
62350
  }
62351
62351
  });
62352
- const ExcelRender = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a8c7c89f"]]);
62352
+ const ExcelRender = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-a8c7c89f"]]);
62353
62353
  var lib$1 = { exports: {} };
62354
62354
  (function(module, exports$1) {
62355
62355
  (function(Q, k) {
@@ -64052,8 +64052,8 @@ var t={4186:(t,e,r)=>{var n=r(3749),i=r(8055),a=TypeError;t.exports=function(t){
64052
64052
  })(lib$1);
64053
64053
  var libExports$1 = lib$1.exports;
64054
64054
  const VueOfficePdf = /* @__PURE__ */ getDefaultExportFromCjs(libExports$1);
64055
- const _hoisted_1$6 = ["src"];
64056
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
64055
+ const _hoisted_1$7 = ["src"];
64056
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
64057
64057
  __name: "PdfRender",
64058
64058
  props: {
64059
64059
  source: {},
@@ -64152,12 +64152,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
64152
64152
  style: normalizeStyle(renderStyle.value),
64153
64153
  frameborder: "0",
64154
64154
  onLoad: handleRendered
64155
- }, null, 44, _hoisted_1$6))
64155
+ }, null, 44, _hoisted_1$7))
64156
64156
  ], 512);
64157
64157
  };
64158
64158
  }
64159
64159
  });
64160
- const PdfRender = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-32fed398"]]);
64160
+ const PdfRender = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-32fed398"]]);
64161
64161
  var lib = { exports: {} };
64162
64162
  (function(module, exports$1) {
64163
64163
  (function(Ma, No) {
@@ -102526,7 +102526,7 @@ echarts.use([` + E + "]);" : "Unknown series " + P));
102526
102526
  })(lib);
102527
102527
  var libExports = lib.exports;
102528
102528
  const VueOfficePptx = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
102529
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
102529
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
102530
102530
  __name: "PptxRender",
102531
102531
  props: {
102532
102532
  source: {},
@@ -102581,9 +102581,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
102581
102581
  };
102582
102582
  }
102583
102583
  });
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({
102584
+ const PptxRender = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-b31abca4"]]);
102585
+ const _hoisted_1$6 = { class: "jv-text-content" };
102586
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
102587
102587
  __name: "TextRender",
102588
102588
  props: {
102589
102589
  source: {}
@@ -102615,14 +102615,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
102615
102615
  ref: containerRef,
102616
102616
  class: "jv-file-render jv-file-render--text"
102617
102617
  }, [
102618
- createBaseVNode("pre", _hoisted_1$5, toDisplayString(content.value), 1)
102618
+ createBaseVNode("pre", _hoisted_1$6, toDisplayString(content.value), 1)
102619
102619
  ], 512);
102620
102620
  };
102621
102621
  }
102622
102622
  });
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({
102623
+ const TextRender = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f5957104"]]);
102624
+ const _hoisted_1$5 = ["innerHTML"];
102625
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
102626
102626
  __name: "MarkdownRender",
102627
102627
  props: {
102628
102628
  source: {}
@@ -102746,12 +102746,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
102746
102746
  createBaseVNode("div", {
102747
102747
  class: "jv-markdown-content",
102748
102748
  innerHTML: renderedContent.value
102749
- }, null, 8, _hoisted_1$4)
102749
+ }, null, 8, _hoisted_1$5)
102750
102750
  ], 512);
102751
102751
  };
102752
102752
  }
102753
102753
  });
102754
- const MarkdownRender = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2d9fb509"]]);
102754
+ const MarkdownRender = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2d9fb509"]]);
102755
102755
  var dist = { exports: {} };
102756
102756
  /*! For license information please see index.js.LICENSE.txt */
102757
102757
  (function(module, exports$1) {
@@ -128385,12 +128385,12 @@ class LiteOfdAdapter {
128385
128385
  this.instance = null;
128386
128386
  }
128387
128387
  }
128388
- const _hoisted_1$3 = {
128388
+ const _hoisted_1$4 = {
128389
128389
  key: 0,
128390
128390
  class: "jv-ofd-error"
128391
128391
  };
128392
128392
  const _hoisted_2$3 = { class: "jv-ofd-loading" };
128393
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
128393
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
128394
128394
  __name: "OfdRender",
128395
128395
  props: {
128396
128396
  source: {},
@@ -128621,7 +128621,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
128621
128621
  ref: containerRef,
128622
128622
  class: "jv-file-render jv-file-render--ofd"
128623
128623
  }, [
128624
- error.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
128624
+ error.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
128625
128625
  createBaseVNode("span", null, toDisplayString(error.value), 1)
128626
128626
  ])) : (openBlock(), createElementBlock("div", {
128627
128627
  key: 1,
@@ -128649,13 +128649,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
128649
128649
  };
128650
128650
  }
128651
128651
  });
128652
- const OfdRender = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f933a20c"]]);
128653
- const _hoisted_1$2 = { class: "jv-html-loading" };
128652
+ const OfdRender = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f933a20c"]]);
128653
+ const _hoisted_1$3 = { class: "jv-html-loading" };
128654
128654
  const _hoisted_2$2 = {
128655
128655
  key: 0,
128656
128656
  class: "jv-html-error"
128657
128657
  };
128658
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128658
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
128659
128659
  __name: "HtmlRender",
128660
128660
  props: {
128661
128661
  source: {},
@@ -128813,7 +128813,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128813
128813
  style: normalizeStyle(renderStyle.value),
128814
128814
  sandbox: "allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
128815
128815
  }, null, 4),
128816
- withDirectives(createBaseVNode("div", _hoisted_1$2, [..._cache[0] || (_cache[0] = [
128816
+ withDirectives(createBaseVNode("div", _hoisted_1$3, [..._cache[0] || (_cache[0] = [
128817
128817
  createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1),
128818
128818
  createBaseVNode("span", null, "加载中...", -1)
128819
128819
  ])], 512), [
@@ -128826,8 +128826,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128826
128826
  };
128827
128827
  }
128828
128828
  });
128829
- const HtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-af6df043"]]);
128830
- const _hoisted_1$1 = {
128829
+ const HtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-c52b0b01"]]);
128830
+ const _hoisted_1$2 = {
128831
128831
  key: 0,
128832
128832
  class: "jv-image-loading"
128833
128833
  };
@@ -128840,7 +128840,7 @@ const _hoisted_4$1 = {
128840
128840
  key: 2,
128841
128841
  class: "jv-image-info"
128842
128842
  };
128843
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
128843
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
128844
128844
  __name: "ImageRender",
128845
128845
  props: {
128846
128846
  source: {},
@@ -129027,7 +129027,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
129027
129027
  ref: containerRef,
129028
129028
  class: "jv-file-render jv-file-render--image"
129029
129029
  }, [
129030
- loading.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [..._cache[0] || (_cache[0] = [
129030
+ loading.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [..._cache[0] || (_cache[0] = [
129031
129031
  createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1),
129032
129032
  createBaseVNode("span", null, "加载中...", -1)
129033
129033
  ])])) : error.value ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
@@ -129089,7 +129089,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
129089
129089
  title: "放大",
129090
129090
  onClick: zoomIn
129091
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)
129092
+ createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-40d06872><circle cx="11" cy="11" r="8" data-v-40d06872></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-40d06872></line><line x1="11" y1="8" x2="11" y2="14" data-v-40d06872></line><line x1="8" y1="11" x2="14" y2="11" data-v-40d06872></line></svg>', 1)
129093
129093
  ])]),
129094
129094
  createBaseVNode("button", {
129095
129095
  class: "jv-image-btn",
@@ -129233,7 +129233,126 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
129233
129233
  };
129234
129234
  }
129235
129235
  });
129236
- const ImageRender = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-cc028f53"]]);
129236
+ const ImageRender = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-40d06872"]]);
129237
+ const _hoisted_1$1 = ["src"];
129238
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
129239
+ __name: "Watermark",
129240
+ props: {
129241
+ watermark: { default: null }
129242
+ },
129243
+ setup(__props) {
129244
+ const props = __props;
129245
+ const watermarkRef = /* @__PURE__ */ ref();
129246
+ const containerStyle = computed(() => {
129247
+ if (!props.watermark) return {};
129248
+ const baseStyle = {
129249
+ opacity: props.watermark.opacity || 0.3,
129250
+ transform: `rotate(${props.watermark.rotate || -30}deg)`,
129251
+ pointerEvents: "none",
129252
+ userSelect: "none",
129253
+ zIndex: props.watermark.position === "top" ? 9999 : 1
129254
+ };
129255
+ if (props.watermark.width) {
129256
+ baseStyle.width = typeof props.watermark.width === "number" ? `${props.watermark.width}px` : props.watermark.width;
129257
+ }
129258
+ if (props.watermark.height) {
129259
+ baseStyle.height = typeof props.watermark.height === "number" ? `${props.watermark.height}px` : props.watermark.height;
129260
+ }
129261
+ return baseStyle;
129262
+ });
129263
+ const lineStyle = computed(() => {
129264
+ var _a, _b, _c, _d, _e;
129265
+ const style = {
129266
+ fontSize: `${((_a = props.watermark) == null ? void 0 : _a.fontSize) || 16}px`,
129267
+ color: ((_b = props.watermark) == null ? void 0 : _b.color) || "#cccccc",
129268
+ fontFamily: ((_c = props.watermark) == null ? void 0 : _c.fontFamily) || "Arial",
129269
+ fontWeight: ((_d = props.watermark) == null ? void 0 : _d.fontWeight) || "normal",
129270
+ whiteSpace: "nowrap"
129271
+ };
129272
+ if ((_e = props.watermark) == null ? void 0 : _e.width) {
129273
+ style.width = typeof props.watermark.width === "number" ? `${props.watermark.width}px` : props.watermark.width;
129274
+ }
129275
+ return style;
129276
+ });
129277
+ const rowStyle = computed(() => {
129278
+ var _a;
129279
+ return {
129280
+ display: "flex",
129281
+ alignItems: "center",
129282
+ justifyContent: "center",
129283
+ gap: `${((_a = props.watermark) == null ? void 0 : _a.gapX) || 100}px`
129284
+ };
129285
+ });
129286
+ const imageStyle = computed(() => {
129287
+ var _a, _b;
129288
+ return {
129289
+ width: `${((_a = props.watermark) == null ? void 0 : _a.imageWidth) || 100}px`,
129290
+ height: `${((_b = props.watermark) == null ? void 0 : _b.imageHeight) || 100}px`,
129291
+ objectFit: "contain"
129292
+ };
129293
+ });
129294
+ const position = computed(() => {
129295
+ var _a;
129296
+ return ((_a = props.watermark) == null ? void 0 : _a.position) || "bottom";
129297
+ });
129298
+ const watermarkLines = computed(() => {
129299
+ if (!props.watermark || props.watermark.type !== "text") return [];
129300
+ const gapY = props.watermark.gapY || 50;
129301
+ const containerHeight = 800;
129302
+ const linesCount = Math.ceil(containerHeight / gapY);
129303
+ return Array(linesCount).fill(props.watermark.content);
129304
+ });
129305
+ const imageRows = computed(() => {
129306
+ if (!props.watermark || props.watermark.type !== "image") return [];
129307
+ const gapX = props.watermark.gapX || 100;
129308
+ const gapY = props.watermark.gapY || 50;
129309
+ const containerWidth = 1200;
129310
+ const containerHeight = 800;
129311
+ const colsCount = Math.ceil(containerWidth / gapX);
129312
+ const rowsCount = Math.ceil(containerHeight / gapY);
129313
+ return Array(rowsCount).fill(Array(colsCount).fill(0));
129314
+ });
129315
+ return (_ctx, _cache) => {
129316
+ return openBlock(), createElementBlock("div", {
129317
+ class: normalizeClass(["jv-watermark-container", [{ "jv-watermark--top": position.value === "top" }]])
129318
+ }, [
129319
+ __props.watermark ? (openBlock(), createElementBlock("div", {
129320
+ key: 0,
129321
+ ref_key: "watermarkRef",
129322
+ ref: watermarkRef,
129323
+ class: "jv-watermark-layer",
129324
+ style: normalizeStyle(containerStyle.value)
129325
+ }, [
129326
+ __props.watermark.type === "text" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(watermarkLines.value, (_, index2) => {
129327
+ return openBlock(), createElementBlock("div", {
129328
+ key: index2,
129329
+ class: "jv-watermark-line",
129330
+ style: normalizeStyle(lineStyle.value)
129331
+ }, toDisplayString(__props.watermark.content), 5);
129332
+ }), 128)) : __props.watermark.type === "image" ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(imageRows.value, (row, rowIndex) => {
129333
+ return openBlock(), createElementBlock("div", {
129334
+ key: rowIndex,
129335
+ class: "jv-watermark-row",
129336
+ style: normalizeStyle(rowStyle.value)
129337
+ }, [
129338
+ (openBlock(true), createElementBlock(Fragment, null, renderList(row, (_, colIndex) => {
129339
+ return openBlock(), createElementBlock("img", {
129340
+ key: `${rowIndex}-${colIndex}`,
129341
+ src: __props.watermark.image,
129342
+ alt: "watermark",
129343
+ class: "jv-watermark-image",
129344
+ style: normalizeStyle(imageStyle.value)
129345
+ }, null, 12, _hoisted_1$1);
129346
+ }), 128))
129347
+ ], 4);
129348
+ }), 128)) : createCommentVNode("", true)
129349
+ ], 4)) : createCommentVNode("", true),
129350
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
129351
+ ], 2);
129352
+ };
129353
+ }
129354
+ });
129355
+ const Watermark = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3c7535d0"]]);
129237
129356
  const _hoisted_1 = {
129238
129357
  key: 0,
129239
129358
  class: "jv-viewer__error"
@@ -129270,6 +129389,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
129270
129389
  className: {},
129271
129390
  style: {},
129272
129391
  pdfRender: {},
129392
+ watermark: {},
129273
129393
  proxyUrl: {},
129274
129394
  requestAdapter: {},
129275
129395
  onReady: {},
@@ -129649,126 +129769,135 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
129649
129769
  ref: contentRef,
129650
129770
  class: "jv-viewer__content"
129651
129771
  }, [
129652
- unref(error) ? (openBlock(), createElementBlock("div", _hoisted_1, [
129653
- _cache[1] || (_cache[1] = createBaseVNode("svg", {
129654
- class: "jv-error-icon",
129655
- viewBox: "0 0 24 24",
129656
- fill: "none",
129657
- stroke: "currentColor",
129658
- "stroke-width": "2"
129659
- }, [
129660
- createBaseVNode("circle", {
129661
- cx: "12",
129662
- cy: "12",
129663
- r: "10"
129664
- }),
129665
- createBaseVNode("line", {
129666
- x1: "12",
129667
- y1: "8",
129668
- x2: "12",
129669
- y2: "12"
129670
- }),
129671
- createBaseVNode("line", {
129672
- x1: "12",
129673
- y1: "16",
129674
- x2: "12.01",
129675
- y2: "16"
129676
- })
129677
- ], -1)),
129678
- createBaseVNode("span", _hoisted_2, toDisplayString(unref(error).message || unref(t)("error.loadFailed")), 1)
129679
- ])) : !unref(fileSource) ? (openBlock(), createElementBlock("div", _hoisted_3, [
129680
- createBaseVNode("span", _hoisted_4, toDisplayString(unref(t)("empty")), 1)
129681
- ])) : (openBlock(), createElementBlock("div", {
129682
- key: 2,
129683
- class: "jv-viewer__render",
129684
- style: normalizeStyle(renderStyle.value)
129685
- }, [
129686
- withDirectives(createBaseVNode("div", _hoisted_5, [
129687
- _cache[2] || (_cache[2] = createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1)),
129688
- createBaseVNode("span", _hoisted_6, toDisplayString(unref(t)("loading")), 1)
129689
- ], 512), [
129690
- [vShow, unref(loading)]
129772
+ __props.watermark ? (openBlock(), createBlock(unref(Watermark), {
129773
+ key: 0,
129774
+ watermark: __props.watermark,
129775
+ style: { width: "100%", height: "100%" }
129776
+ }, {
129777
+ default: withCtx(() => [
129778
+ unref(error) ? (openBlock(), createElementBlock("div", _hoisted_1, [
129779
+ _cache[1] || (_cache[1] = createBaseVNode("svg", {
129780
+ class: "jv-error-icon",
129781
+ viewBox: "0 0 24 24",
129782
+ fill: "none",
129783
+ stroke: "currentColor",
129784
+ "stroke-width": "2"
129785
+ }, [
129786
+ createBaseVNode("circle", {
129787
+ cx: "12",
129788
+ cy: "12",
129789
+ r: "10"
129790
+ }),
129791
+ createBaseVNode("line", {
129792
+ x1: "12",
129793
+ y1: "8",
129794
+ x2: "12",
129795
+ y2: "12"
129796
+ }),
129797
+ createBaseVNode("line", {
129798
+ x1: "12",
129799
+ y1: "16",
129800
+ x2: "12.01",
129801
+ y2: "16"
129802
+ })
129803
+ ], -1)),
129804
+ createBaseVNode("span", _hoisted_2, toDisplayString(unref(error).message || unref(t)("error.loadFailed")), 1)
129805
+ ])) : !unref(fileSource) ? (openBlock(), createElementBlock("div", _hoisted_3, [
129806
+ createBaseVNode("span", _hoisted_4, toDisplayString(unref(t)("empty")), 1)
129807
+ ])) : (openBlock(), createElementBlock("div", {
129808
+ key: 2,
129809
+ class: "jv-viewer__render",
129810
+ style: normalizeStyle(renderStyle.value)
129811
+ }, [
129812
+ withDirectives(createBaseVNode("div", _hoisted_5, [
129813
+ _cache[2] || (_cache[2] = createBaseVNode("div", { class: "jv-loading-spinner" }, null, -1)),
129814
+ createBaseVNode("span", _hoisted_6, toDisplayString(unref(t)("loading")), 1)
129815
+ ], 512), [
129816
+ [vShow, unref(loading)]
129817
+ ]),
129818
+ unref(fileType) === "docx" ? (openBlock(), createBlock(unref(DocxRender), {
129819
+ key: 0,
129820
+ source: unref(fileSource),
129821
+ zoom: unref(zoom),
129822
+ "proxy-url": proxyUrl.value,
129823
+ "request-adapter": requestAdapter.value,
129824
+ onLoad: handleLoad,
129825
+ onError: handleError2
129826
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "xlsx" || unref(fileType) === "xls" ? (openBlock(), createBlock(unref(ExcelRender), {
129827
+ key: 1,
129828
+ source: unref(fileSource),
129829
+ zoom: unref(zoom),
129830
+ "proxy-url": proxyUrl.value,
129831
+ "request-adapter": requestAdapter.value,
129832
+ onLoad: handleLoad,
129833
+ onError: handleError2
129834
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "pdf" ? (openBlock(), createBlock(unref(PdfRender), {
129835
+ key: 2,
129836
+ source: unref(fileSource),
129837
+ zoom: unref(zoom),
129838
+ "proxy-url": proxyUrl.value,
129839
+ "request-adapter": requestAdapter.value,
129840
+ "pdf-render": pdfRenderMode.value,
129841
+ onLoad: handleLoad,
129842
+ onError: handleError2
129843
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter", "pdf-render"])) : unref(fileType) === "pptx" || unref(fileType) === "ppt" ? (openBlock(), createBlock(unref(PptxRender), {
129844
+ key: 3,
129845
+ source: unref(fileSource),
129846
+ zoom: unref(zoom),
129847
+ "proxy-url": proxyUrl.value,
129848
+ "request-adapter": requestAdapter.value,
129849
+ onLoad: handleLoad,
129850
+ onError: handleError2
129851
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "txt" ? (openBlock(), createBlock(unref(TextRender), {
129852
+ key: 4,
129853
+ source: unref(fileSource),
129854
+ onLoad: handleLoad,
129855
+ onError: handleError2
129856
+ }, null, 8, ["source"])) : unref(fileType) === "md" || unref(fileType) === "markdown" ? (openBlock(), createBlock(unref(MarkdownRender), {
129857
+ key: 5,
129858
+ source: unref(fileSource),
129859
+ onLoad: handleLoad,
129860
+ onError: handleError2
129861
+ }, null, 8, ["source"])) : unref(fileType) === "ofd" ? (openBlock(), createBlock(unref(OfdRender), {
129862
+ key: 6,
129863
+ ref_key: "ofdRenderRef",
129864
+ ref: ofdRenderRef,
129865
+ source: unref(fileSource),
129866
+ zoom: unref(zoom),
129867
+ "proxy-url": proxyUrl.value,
129868
+ "request-adapter": requestAdapter.value,
129869
+ onLoad: handleLoad,
129870
+ onError: handleError2,
129871
+ onPageChange: handleOfdPageChange
129872
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "html" ? (openBlock(), createBlock(unref(HtmlRender), {
129873
+ key: 7,
129874
+ source: unref(fileSource),
129875
+ zoom: unref(zoom),
129876
+ "proxy-url": proxyUrl.value,
129877
+ "request-adapter": requestAdapter.value,
129878
+ onLoad: handleLoad,
129879
+ onError: handleError2
129880
+ }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "image" ? (openBlock(), createBlock(unref(ImageRender), {
129881
+ key: 8,
129882
+ source: unref(fileSource),
129883
+ zoom: unref(zoom),
129884
+ onLoad: handleLoad,
129885
+ onError: handleError2
129886
+ }, null, 8, ["source", "zoom"])) : unref(fileType) === "unknown" && unref(fileSource) ? (openBlock(), createElementBlock("div", _hoisted_7, [..._cache[3] || (_cache[3] = [
129887
+ createBaseVNode("span", null, "未知文件类型", -1)
129888
+ ])])) : (openBlock(), createElementBlock("div", _hoisted_8, [
129889
+ createBaseVNode("span", null, toDisplayString(unref(t)("error.unsupportedType")), 1)
129890
+ ]))
129891
+ ], 4))
129691
129892
  ]),
129692
- unref(fileType) === "docx" ? (openBlock(), createBlock(unref(DocxRender), {
129693
- key: 0,
129694
- source: unref(fileSource),
129695
- zoom: unref(zoom),
129696
- "proxy-url": proxyUrl.value,
129697
- "request-adapter": requestAdapter.value,
129698
- onLoad: handleLoad,
129699
- onError: handleError2
129700
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "xlsx" || unref(fileType) === "xls" ? (openBlock(), createBlock(unref(ExcelRender), {
129701
- key: 1,
129702
- source: unref(fileSource),
129703
- zoom: unref(zoom),
129704
- "proxy-url": proxyUrl.value,
129705
- "request-adapter": requestAdapter.value,
129706
- onLoad: handleLoad,
129707
- onError: handleError2
129708
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "pdf" ? (openBlock(), createBlock(unref(PdfRender), {
129709
- key: 2,
129710
- source: unref(fileSource),
129711
- zoom: unref(zoom),
129712
- "proxy-url": proxyUrl.value,
129713
- "request-adapter": requestAdapter.value,
129714
- "pdf-render": pdfRenderMode.value,
129715
- onLoad: handleLoad,
129716
- onError: handleError2
129717
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter", "pdf-render"])) : unref(fileType) === "pptx" || unref(fileType) === "ppt" ? (openBlock(), createBlock(unref(PptxRender), {
129718
- key: 3,
129719
- source: unref(fileSource),
129720
- zoom: unref(zoom),
129721
- "proxy-url": proxyUrl.value,
129722
- "request-adapter": requestAdapter.value,
129723
- onLoad: handleLoad,
129724
- onError: handleError2
129725
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "txt" ? (openBlock(), createBlock(unref(TextRender), {
129726
- key: 4,
129727
- source: unref(fileSource),
129728
- onLoad: handleLoad,
129729
- onError: handleError2
129730
- }, null, 8, ["source"])) : unref(fileType) === "md" || unref(fileType) === "markdown" ? (openBlock(), createBlock(unref(MarkdownRender), {
129731
- key: 5,
129732
- source: unref(fileSource),
129733
- onLoad: handleLoad,
129734
- onError: handleError2
129735
- }, null, 8, ["source"])) : unref(fileType) === "ofd" ? (openBlock(), createBlock(unref(OfdRender), {
129736
- key: 6,
129737
- ref_key: "ofdRenderRef",
129738
- ref: ofdRenderRef,
129739
- source: unref(fileSource),
129740
- zoom: unref(zoom),
129741
- "proxy-url": proxyUrl.value,
129742
- "request-adapter": requestAdapter.value,
129743
- onLoad: handleLoad,
129744
- onError: handleError2,
129745
- onPageChange: handleOfdPageChange
129746
- }, null, 8, ["source", "zoom", "proxy-url", "request-adapter"])) : unref(fileType) === "html" ? (openBlock(), createBlock(unref(HtmlRender), {
129747
- key: 7,
129748
- source: unref(fileSource),
129749
- zoom: unref(zoom),
129750
- "proxy-url": proxyUrl.value,
129751
- "request-adapter": requestAdapter.value,
129752
- onLoad: handleLoad,
129753
- onError: handleError2
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] = [
129761
- createBaseVNode("span", null, "未知文件类型", -1)
129762
- ])])) : (openBlock(), createElementBlock("div", _hoisted_8, [
129763
- createBaseVNode("span", null, toDisplayString(unref(t)("error.unsupportedType")), 1)
129764
- ]))
129765
- ], 4))
129893
+ _: 1
129894
+ }, 8, ["watermark"])) : createCommentVNode("", true)
129766
129895
  ], 512)
129767
129896
  ], 6);
129768
129897
  };
129769
129898
  }
129770
129899
  });
129771
- const Viewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-12fe006b"]]);
129900
+ const Viewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-550d6985"]]);
129772
129901
  function createViewer(options) {
129773
129902
  const events = createEventBus();
129774
129903
  let app = null;
@@ -129928,6 +130057,7 @@ export {
129928
130057
  TextRender,
129929
130058
  Toolbar,
129930
130059
  Viewer,
130060
+ Watermark,
129931
130061
  createElement,
129932
130062
  createEventBus,
129933
130063
  createViewer,