jit-pdf 0.1.2 → 0.1.4
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/README.md +12 -4
- package/dist/browser.cjs +7 -1
- package/dist/browser.js +110 -42
- package/dist/components/JitPdfEditor.vue.d.ts +1 -0
- package/dist/{http-service-DqmwdbGE.cjs → http-service-D7BocPD1.cjs} +1 -1
- package/dist/{http-service-DBwg8kDH.js → http-service-gGWjQiuE.js} +872 -840
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/jit-pdf.umd.js +17 -11
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,8 +61,8 @@ Latest:
|
|
|
61
61
|
Pinned version:
|
|
62
62
|
|
|
63
63
|
```html
|
|
64
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jit-pdf@0.1.
|
|
65
|
-
<script src="https://cdn.jsdelivr.net/npm/jit-pdf@0.1.
|
|
64
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jit-pdf@0.1.4/dist/style.css" />
|
|
65
|
+
<script src="https://cdn.jsdelivr.net/npm/jit-pdf@0.1.4/dist/jit-pdf.umd.js"></script>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### UNPKG
|
|
@@ -77,8 +77,8 @@ Latest:
|
|
|
77
77
|
Pinned version:
|
|
78
78
|
|
|
79
79
|
```html
|
|
80
|
-
<link rel="stylesheet" href="https://unpkg.com/jit-pdf@0.1.
|
|
81
|
-
<script src="https://unpkg.com/jit-pdf@0.1.
|
|
80
|
+
<link rel="stylesheet" href="https://unpkg.com/jit-pdf@0.1.4/dist/style.css" />
|
|
81
|
+
<script src="https://unpkg.com/jit-pdf@0.1.4/dist/jit-pdf.umd.js"></script>
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
Global browser variable:
|
|
@@ -342,6 +342,14 @@ mountJitPdfEditor({
|
|
|
342
342
|
});
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
+
## Copyright Notice
|
|
346
|
+
|
|
347
|
+
`jit-pdf` renders a built-in copyright badge inside the editor. In browser mount mode and UMD mode, the SDK will also show an integrity reminder if that badge is removed or hidden.
|
|
348
|
+
|
|
349
|
+
Copyright link:
|
|
350
|
+
|
|
351
|
+
- https://jitword.com/jit-pdf.html
|
|
352
|
+
|
|
345
353
|
## GitHub and Examples
|
|
346
354
|
|
|
347
355
|
- Repository: https://github.com/jitOffice/jit-pdf-sdk
|
package/dist/browser.cjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),i=require("./http-service-D7BocPD1.cjs"),b=".jit-copyright-badge",v="data-jit-pdf-copyright-notice",o="data-jit-pdf-copyright-target",w="https://jitword.com/jit-pdf.html";function E(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`jit-pdf-${crypto.randomUUID()}`:`jit-pdf-${Date.now()}-${Math.random().toString(16).slice(2)}`}function I(t){const r=t.getAttribute(o);if(r)return r;const e=E();return t.setAttribute(o,e),e}function g(t){return document.querySelector(`.jit-copyright-integrity-notice[${o}="${t}"]`)}function y(t){var r;(r=g(t))==null||r.remove()}function S(t){const r=g(t);if(r)return r;const e=document.createElement("a");return e.className="jit-copyright-integrity-notice",e.href=w,e.target="_blank",e.rel="noopener noreferrer",e.setAttribute(v,"true"),e.setAttribute(o,t),e.setAttribute("aria-label","Jit PDF 版权提示,点击查看"),e.innerHTML=`
|
|
2
|
+
<span class="jit-copyright-integrity-notice__mark">!</span>
|
|
3
|
+
<span class="jit-copyright-integrity-notice__content">
|
|
4
|
+
<strong>请保留 Jit PDF 版权信息</strong>
|
|
5
|
+
<span>检测到浏览器挂载模式下的版权标识被隐藏或移除,点击查看说明。</span>
|
|
6
|
+
</span>
|
|
7
|
+
`,document.body.appendChild(e),e}function P(t){const r=window.getComputedStyle(t),e=t.getBoundingClientRect(),n=Number.parseFloat(r.opacity||"1");return r.display!=="none"&&r.visibility!=="hidden"&&n>.05&&e.width>0&&e.height>0}function T(t){if(typeof window>"u"||typeof document>"u")return()=>{};const r=I(t);let e=!1;const n=()=>{const d=t.querySelector(b);if(!!d&&P(d)){e=!1,y(r);return}S(r),e||(e=!0,console.warn("[jit-pdf] Please keep the Jit PDF copyright badge visible in browser/UMD mode. See https://jitword.com/jit-pdf.html"))},c=new MutationObserver(()=>{window.requestAnimationFrame(n)});c.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class","hidden","aria-hidden"]});const s=window.setInterval(n,2e3),a=window.setTimeout(n,120);return window.addEventListener("resize",n),()=>{c.disconnect(),window.clearInterval(s),window.clearTimeout(a),window.removeEventListener("resize",n),y(r),t.removeAttribute(o)}}function _(t){if(typeof t=="string"){const r=document.querySelector(t);if(!r)throw new Error(`未找到挂载容器:${t}`);return r}return t}function m(t){const{target:r,onReady:e,onDirtyChange:n,onSaveStart:c,onSaveSuccess:s,onSaveError:a,onLoadError:d,...f}=t,u=_(r),p=l.createApp({render(){return l.h(i._sfc_main,{...f,onReady:e,onDirtyChange:n,onSaveStart:c,onSaveSuccess:s,onSaveError:a,onLoadError:d})}});p.mount(u);const h=T(u);return{app:p,element:u,unmount(){h(),p.unmount()}}}const j={mountJitPdfEditor:m,createHttpPdfEditorService:i.createHttpPdfEditorService,createIndexedDbPdfEditorService:i.createIndexedDbPdfEditorService};exports.JitPdfEditor=i._sfc_main;exports.createHttpPdfEditorService=i.createHttpPdfEditorService;exports.createIndexedDbPdfEditorService=i.createIndexedDbPdfEditorService;exports.usePdfEditorSdk=i.usePdfEditorSdk;exports.browser=j;exports.mountJitPdfEditor=m;
|
package/dist/browser.js
CHANGED
|
@@ -1,56 +1,124 @@
|
|
|
1
|
-
import { createApp as
|
|
2
|
-
import { a as
|
|
3
|
-
import { u as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { createApp as m, h as g } from "vue";
|
|
2
|
+
import { a as h, c as w, _ as b } from "./http-service-gGWjQiuE.js";
|
|
3
|
+
import { u as U } from "./http-service-gGWjQiuE.js";
|
|
4
|
+
const v = ".jit-copyright-badge", I = "data-jit-pdf-copyright-notice", i = "data-jit-pdf-copyright-target", E = "https://jitword.com/jit-pdf.html";
|
|
5
|
+
function T() {
|
|
6
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `jit-pdf-${crypto.randomUUID()}` : `jit-pdf-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
7
|
+
}
|
|
8
|
+
function _(t) {
|
|
9
|
+
const n = t.getAttribute(i);
|
|
10
|
+
if (n)
|
|
11
|
+
return n;
|
|
12
|
+
const e = T();
|
|
13
|
+
return t.setAttribute(i, e), e;
|
|
14
|
+
}
|
|
15
|
+
function l(t) {
|
|
16
|
+
return document.querySelector(
|
|
17
|
+
`.jit-copyright-integrity-notice[${i}="${t}"]`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function f(t) {
|
|
21
|
+
var n;
|
|
22
|
+
(n = l(t)) == null || n.remove();
|
|
23
|
+
}
|
|
24
|
+
function S(t) {
|
|
25
|
+
const n = l(t);
|
|
26
|
+
if (n)
|
|
27
|
+
return n;
|
|
28
|
+
const e = document.createElement("a");
|
|
29
|
+
return e.className = "jit-copyright-integrity-notice", e.href = E, e.target = "_blank", e.rel = "noopener noreferrer", e.setAttribute(I, "true"), e.setAttribute(i, t), e.setAttribute("aria-label", "Jit PDF 版权提示,点击查看"), e.innerHTML = `
|
|
30
|
+
<span class="jit-copyright-integrity-notice__mark">!</span>
|
|
31
|
+
<span class="jit-copyright-integrity-notice__content">
|
|
32
|
+
<strong>请保留 Jit PDF 版权信息</strong>
|
|
33
|
+
<span>检测到浏览器挂载模式下的版权标识被隐藏或移除,点击查看说明。</span>
|
|
34
|
+
</span>
|
|
35
|
+
`, document.body.appendChild(e), e;
|
|
36
|
+
}
|
|
37
|
+
function j(t) {
|
|
38
|
+
const n = window.getComputedStyle(t), e = t.getBoundingClientRect(), r = Number.parseFloat(n.opacity || "1");
|
|
39
|
+
return n.display !== "none" && n.visibility !== "hidden" && r > 0.05 && e.width > 0 && e.height > 0;
|
|
40
|
+
}
|
|
41
|
+
function P(t) {
|
|
42
|
+
if (typeof window > "u" || typeof document > "u")
|
|
43
|
+
return () => {
|
|
44
|
+
};
|
|
45
|
+
const n = _(t);
|
|
46
|
+
let e = !1;
|
|
47
|
+
const r = () => {
|
|
48
|
+
const s = t.querySelector(v);
|
|
49
|
+
if (!!s && j(s)) {
|
|
50
|
+
e = !1, f(n);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
S(n), e || (e = !0, console.warn(
|
|
54
|
+
"[jit-pdf] Please keep the Jit PDF copyright badge visible in browser/UMD mode. See https://jitword.com/jit-pdf.html"
|
|
55
|
+
));
|
|
56
|
+
}, o = new MutationObserver(() => {
|
|
57
|
+
window.requestAnimationFrame(r);
|
|
58
|
+
});
|
|
59
|
+
o.observe(t, {
|
|
60
|
+
subtree: !0,
|
|
61
|
+
childList: !0,
|
|
62
|
+
attributes: !0,
|
|
63
|
+
attributeFilter: ["style", "class", "hidden", "aria-hidden"]
|
|
64
|
+
});
|
|
65
|
+
const c = window.setInterval(r, 2e3), a = window.setTimeout(r, 120);
|
|
66
|
+
return window.addEventListener("resize", r), () => {
|
|
67
|
+
o.disconnect(), window.clearInterval(c), window.clearTimeout(a), window.removeEventListener("resize", r), f(n), t.removeAttribute(i);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function A(t) {
|
|
71
|
+
if (typeof t == "string") {
|
|
72
|
+
const n = document.querySelector(t);
|
|
73
|
+
if (!n)
|
|
74
|
+
throw new Error(`未找到挂载容器:${t}`);
|
|
75
|
+
return n;
|
|
10
76
|
}
|
|
11
|
-
return
|
|
77
|
+
return t;
|
|
12
78
|
}
|
|
13
|
-
function
|
|
79
|
+
function C(t) {
|
|
14
80
|
const {
|
|
15
|
-
target:
|
|
16
|
-
onReady:
|
|
17
|
-
onDirtyChange:
|
|
18
|
-
onSaveStart:
|
|
19
|
-
onSaveSuccess:
|
|
20
|
-
onSaveError:
|
|
21
|
-
onLoadError:
|
|
22
|
-
...
|
|
23
|
-
} =
|
|
81
|
+
target: n,
|
|
82
|
+
onReady: e,
|
|
83
|
+
onDirtyChange: r,
|
|
84
|
+
onSaveStart: o,
|
|
85
|
+
onSaveSuccess: c,
|
|
86
|
+
onSaveError: a,
|
|
87
|
+
onLoadError: s,
|
|
88
|
+
...p
|
|
89
|
+
} = t, d = A(n), u = m({
|
|
24
90
|
render() {
|
|
25
|
-
return
|
|
26
|
-
...
|
|
27
|
-
onReady:
|
|
28
|
-
onDirtyChange:
|
|
29
|
-
onSaveStart:
|
|
30
|
-
onSaveSuccess:
|
|
31
|
-
onSaveError:
|
|
32
|
-
onLoadError:
|
|
91
|
+
return g(b, {
|
|
92
|
+
...p,
|
|
93
|
+
onReady: e,
|
|
94
|
+
onDirtyChange: r,
|
|
95
|
+
onSaveStart: o,
|
|
96
|
+
onSaveSuccess: c,
|
|
97
|
+
onSaveError: a,
|
|
98
|
+
onLoadError: s
|
|
33
99
|
});
|
|
34
100
|
}
|
|
35
101
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
102
|
+
u.mount(d);
|
|
103
|
+
const y = P(d);
|
|
104
|
+
return {
|
|
105
|
+
app: u,
|
|
106
|
+
element: d,
|
|
39
107
|
unmount() {
|
|
40
|
-
|
|
108
|
+
y(), u.unmount();
|
|
41
109
|
}
|
|
42
110
|
};
|
|
43
111
|
}
|
|
44
|
-
const
|
|
45
|
-
mountJitPdfEditor:
|
|
46
|
-
createHttpPdfEditorService:
|
|
47
|
-
createIndexedDbPdfEditorService:
|
|
112
|
+
const G = {
|
|
113
|
+
mountJitPdfEditor: C,
|
|
114
|
+
createHttpPdfEditorService: w,
|
|
115
|
+
createIndexedDbPdfEditorService: h
|
|
48
116
|
};
|
|
49
117
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
118
|
+
b as JitPdfEditor,
|
|
119
|
+
G as browser,
|
|
120
|
+
w as createHttpPdfEditorService,
|
|
121
|
+
h as createIndexedDbPdfEditorService,
|
|
122
|
+
C as mountJitPdfEditor,
|
|
123
|
+
U as usePdfEditorSdk
|
|
56
124
|
};
|
|
@@ -17,5 +17,6 @@ declare const _default: import("vue").DefineComponent<JitPdfEditorProps, {}, {},
|
|
|
17
17
|
readonly: boolean;
|
|
18
18
|
locale: "zh-CN";
|
|
19
19
|
theme: "blue-enterprise";
|
|
20
|
+
showToolbar: boolean;
|
|
20
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
22
|
export default _default;
|