@embedpdf/plugin-zoom 1.0.19 → 1.0.21
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +106 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/handlers/index.d.ts +1 -0
- package/dist/lib/handlers/marquee-zoom.handler.d.ts +10 -0
- package/dist/lib/types.d.ts +12 -0
- package/dist/lib/zoom-plugin.d.ts +5 -1
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +88 -128
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +88 -128
- package/dist/react/index.js.map +1 -1
- package/dist/shared-preact/components/marquee-zoom.d.ts +1 -9
- package/dist/shared-preact/index.d.ts +1 -0
- package/dist/shared-preact/utils/pinch-zoom-logic.d.ts +8 -0
- package/dist/shared-react/components/marquee-zoom.d.ts +1 -9
- package/dist/shared-react/index.d.ts +1 -0
- package/dist/shared-react/utils/pinch-zoom-logic.d.ts +8 -0
- package/dist/shared-vue/utils/pinch-zoom-logic.d.ts +8 -0
- package/dist/vue/components/index.d.ts +2 -0
- package/dist/vue/components/marquee-zoom.vue.d.ts +16 -0
- package/dist/vue/components/pinch-wrapper.vue.d.ts +12 -0
- package/dist/vue/hooks/index.d.ts +2 -0
- package/dist/vue/hooks/use-pinch-zoom.d.ts +3 -0
- package/dist/vue/hooks/use-zoom.d.ts +13 -0
- package/dist/vue/index.cjs +2 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +3 -0
- package/dist/vue/index.js +197 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +18 -11
- package/dist/preact/interaction-manager.d.ts +0 -1
- package/dist/react/interaction-manager.d.ts +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted, defineComponent, createElementBlock, createCommentVNode, openBlock, normalizeClass, normalizeStyle, mergeProps, renderSlot } from "vue";
|
|
2
|
+
import { useCapability, usePlugin } from "@embedpdf/core/vue";
|
|
3
|
+
import { ZoomPlugin, initialState } from "@embedpdf/plugin-zoom";
|
|
4
|
+
export * from "@embedpdf/plugin-zoom";
|
|
5
|
+
const useZoomCapability = () => useCapability(ZoomPlugin.id);
|
|
6
|
+
const useZoomPlugin = () => usePlugin(ZoomPlugin.id);
|
|
7
|
+
const useZoom = () => {
|
|
8
|
+
const { provides } = useZoomCapability();
|
|
9
|
+
const state = ref(initialState);
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
if (!provides.value) return;
|
|
12
|
+
const unsubscribe = provides.value.onStateChange((newState) => {
|
|
13
|
+
state.value = newState;
|
|
14
|
+
});
|
|
15
|
+
onUnmounted(() => {
|
|
16
|
+
unsubscribe();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
state,
|
|
21
|
+
provides
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
function setupPinchZoom({ element, viewportProvides, zoomProvides }) {
|
|
25
|
+
if (typeof window === "undefined") {
|
|
26
|
+
return () => {
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
let hammer;
|
|
30
|
+
let initialZoom = 0;
|
|
31
|
+
let lastCenter = { x: 0, y: 0 };
|
|
32
|
+
const getState = () => zoomProvides.getState();
|
|
33
|
+
const updateTransform = (scale) => {
|
|
34
|
+
element.style.transform = `scale(${scale})`;
|
|
35
|
+
};
|
|
36
|
+
const resetTransform = () => {
|
|
37
|
+
element.style.transform = "none";
|
|
38
|
+
element.style.transformOrigin = "0 0";
|
|
39
|
+
};
|
|
40
|
+
const pinchStart = (e) => {
|
|
41
|
+
var _a;
|
|
42
|
+
initialZoom = getState().currentZoomLevel;
|
|
43
|
+
const contRect = viewportProvides.getBoundingRect();
|
|
44
|
+
lastCenter = {
|
|
45
|
+
x: e.center.x - contRect.origin.x,
|
|
46
|
+
y: e.center.y - contRect.origin.y
|
|
47
|
+
};
|
|
48
|
+
const innerRect = element.getBoundingClientRect();
|
|
49
|
+
element.style.transformOrigin = `${e.center.x - innerRect.left}px ${e.center.y - innerRect.top}px`;
|
|
50
|
+
if ((_a = e.srcEvent) == null ? void 0 : _a.cancelable) {
|
|
51
|
+
e.srcEvent.preventDefault();
|
|
52
|
+
e.srcEvent.stopPropagation();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const pinchMove = (e) => {
|
|
56
|
+
var _a;
|
|
57
|
+
updateTransform(e.scale);
|
|
58
|
+
if ((_a = e.srcEvent) == null ? void 0 : _a.cancelable) {
|
|
59
|
+
e.srcEvent.preventDefault();
|
|
60
|
+
e.srcEvent.stopPropagation();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const pinchEnd = (e) => {
|
|
64
|
+
const delta = (e.scale - 1) * initialZoom;
|
|
65
|
+
zoomProvides.requestZoomBy(delta, { vx: lastCenter.x, vy: lastCenter.y });
|
|
66
|
+
resetTransform();
|
|
67
|
+
initialZoom = 0;
|
|
68
|
+
};
|
|
69
|
+
const setupHammer = async () => {
|
|
70
|
+
try {
|
|
71
|
+
const Hammer = (await import("../hammer-e1aXHboh.js").then((n) => n.h)).default;
|
|
72
|
+
const inputClass = (() => {
|
|
73
|
+
const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
|
74
|
+
const SUPPORT_TOUCH = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
75
|
+
const SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
|
76
|
+
if (SUPPORT_ONLY_TOUCH) return Hammer.TouchInput;
|
|
77
|
+
if (!SUPPORT_TOUCH) return Hammer.MouseInput;
|
|
78
|
+
return Hammer.TouchMouseInput;
|
|
79
|
+
})();
|
|
80
|
+
hammer = new Hammer(element, {
|
|
81
|
+
touchAction: "pan-x pan-y",
|
|
82
|
+
// allow scroll in every direction
|
|
83
|
+
inputClass
|
|
84
|
+
});
|
|
85
|
+
hammer.get("pinch").set({ enable: true, pointers: 2, threshold: 0.1 });
|
|
86
|
+
hammer.on("pinchstart", pinchStart);
|
|
87
|
+
hammer.on("pinchmove", pinchMove);
|
|
88
|
+
hammer.on("pinchend", pinchEnd);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.warn("Failed to load HammerJS:", error);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
setupHammer();
|
|
94
|
+
return () => {
|
|
95
|
+
hammer == null ? void 0 : hammer.destroy();
|
|
96
|
+
resetTransform();
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function usePinch() {
|
|
100
|
+
const { provides: viewportProvides } = useCapability("viewport");
|
|
101
|
+
const { provides: zoomProvides } = useZoomCapability();
|
|
102
|
+
const elementRef = ref(null);
|
|
103
|
+
let cleanup;
|
|
104
|
+
onMounted(async () => {
|
|
105
|
+
const element = elementRef.value;
|
|
106
|
+
if (!element || !viewportProvides.value || !zoomProvides.value) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
cleanup = setupPinchZoom({
|
|
110
|
+
element,
|
|
111
|
+
viewportProvides: viewportProvides.value,
|
|
112
|
+
zoomProvides: zoomProvides.value
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
onUnmounted(() => {
|
|
116
|
+
cleanup == null ? void 0 : cleanup();
|
|
117
|
+
});
|
|
118
|
+
return { elementRef };
|
|
119
|
+
}
|
|
120
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
121
|
+
__name: "marquee-zoom",
|
|
122
|
+
props: {
|
|
123
|
+
pageIndex: {},
|
|
124
|
+
scale: {},
|
|
125
|
+
className: {},
|
|
126
|
+
stroke: { default: "rgba(33,150,243,0.8)" },
|
|
127
|
+
fill: { default: "rgba(33,150,243,0.15)" }
|
|
128
|
+
},
|
|
129
|
+
setup(__props) {
|
|
130
|
+
const props = __props;
|
|
131
|
+
const { provides: zoomPlugin } = useZoomCapability();
|
|
132
|
+
const rect = ref(null);
|
|
133
|
+
let unregister;
|
|
134
|
+
onMounted(() => {
|
|
135
|
+
if (!zoomPlugin.value) return;
|
|
136
|
+
unregister = zoomPlugin.value.registerMarqueeOnPage({
|
|
137
|
+
pageIndex: props.pageIndex,
|
|
138
|
+
scale: props.scale,
|
|
139
|
+
callback: {
|
|
140
|
+
onPreview: (newRect) => {
|
|
141
|
+
rect.value = newRect;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
onUnmounted(() => {
|
|
147
|
+
unregister == null ? void 0 : unregister();
|
|
148
|
+
});
|
|
149
|
+
return (_ctx, _cache) => {
|
|
150
|
+
return rect.value ? (openBlock(), createElementBlock("div", {
|
|
151
|
+
key: 0,
|
|
152
|
+
style: normalizeStyle({
|
|
153
|
+
position: "absolute",
|
|
154
|
+
pointerEvents: "none",
|
|
155
|
+
left: `${rect.value.origin.x * _ctx.scale}px`,
|
|
156
|
+
top: `${rect.value.origin.y * _ctx.scale}px`,
|
|
157
|
+
width: `${rect.value.size.width * _ctx.scale}px`,
|
|
158
|
+
height: `${rect.value.size.height * _ctx.scale}px`,
|
|
159
|
+
border: `1px solid ${_ctx.stroke}`,
|
|
160
|
+
background: _ctx.fill,
|
|
161
|
+
boxSizing: "border-box"
|
|
162
|
+
}),
|
|
163
|
+
class: normalizeClass(_ctx.className)
|
|
164
|
+
}, null, 6)) : createCommentVNode("", true);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
169
|
+
__name: "pinch-wrapper",
|
|
170
|
+
setup(__props) {
|
|
171
|
+
const { elementRef } = usePinch();
|
|
172
|
+
return (_ctx, _cache) => {
|
|
173
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
174
|
+
ref_key: "elementRef",
|
|
175
|
+
ref: elementRef,
|
|
176
|
+
style: {
|
|
177
|
+
display: "block",
|
|
178
|
+
width: "fit-content",
|
|
179
|
+
overflow: "visible",
|
|
180
|
+
boxSizing: "border-box",
|
|
181
|
+
margin: "0px auto"
|
|
182
|
+
}
|
|
183
|
+
}, _ctx.$attrs), [
|
|
184
|
+
renderSlot(_ctx.$slots, "default")
|
|
185
|
+
], 16);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
export {
|
|
190
|
+
_sfc_main$1 as MarqueeZoom,
|
|
191
|
+
_sfc_main as PinchWrapper,
|
|
192
|
+
usePinch,
|
|
193
|
+
useZoom,
|
|
194
|
+
useZoomCapability,
|
|
195
|
+
useZoomPlugin
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/vue/hooks/use-zoom.ts","../../src/shared/utils/pinch-zoom-logic.ts","../../src/vue/hooks/use-pinch-zoom.ts","../../src/vue/components/marquee-zoom.vue","../../src/vue/components/pinch-wrapper.vue"],"sourcesContent":["import { ref, onMounted, onUnmounted } from 'vue';\nimport { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { initialState, ZoomPlugin, ZoomState } from '@embedpdf/plugin-zoom';\n\nexport const useZoomCapability = () => useCapability<ZoomPlugin>(ZoomPlugin.id);\nexport const useZoomPlugin = () => usePlugin<ZoomPlugin>(ZoomPlugin.id);\n\nexport const useZoom = () => {\n const { provides } = useZoomCapability();\n const state = ref<ZoomState>(initialState);\n\n onMounted(() => {\n if (!provides.value) return;\n\n const unsubscribe = provides.value.onStateChange((newState) => {\n state.value = newState;\n });\n\n onUnmounted(() => {\n unsubscribe();\n });\n });\n\n return {\n state,\n provides,\n };\n};\n","import type { ViewportCapability } from '@embedpdf/plugin-viewport';\nimport type { ZoomCapability, ZoomState } from '@embedpdf/plugin-zoom';\n\nexport interface PinchZoomDeps {\n element: HTMLDivElement;\n viewportProvides: ViewportCapability;\n zoomProvides: ZoomCapability;\n}\n\nexport function setupPinchZoom({ element, viewportProvides, zoomProvides }: PinchZoomDeps) {\n // Check if we're on the client side\n if (typeof window === 'undefined') {\n return () => {};\n }\n\n let hammer: any | undefined;\n let initialZoom = 0; // numeric scale at pinchstart\n let lastCenter = { x: 0, y: 0 };\n\n const getState = (): ZoomState => zoomProvides.getState();\n\n const updateTransform = (scale: number) => {\n // 1 → no scale; we only scale *relatively* to the start\n element.style.transform = `scale(${scale})`;\n };\n\n const resetTransform = () => {\n element.style.transform = 'none';\n element.style.transformOrigin = '0 0';\n };\n\n const pinchStart = (e: HammerInput) => {\n initialZoom = getState().currentZoomLevel;\n\n const contRect = viewportProvides.getBoundingRect();\n\n lastCenter = {\n x: e.center.x - contRect.origin.x,\n y: e.center.y - contRect.origin.y,\n };\n\n // put the transform-origin under the fingers so the preview feels right\n const innerRect = element.getBoundingClientRect();\n element.style.transformOrigin = `${e.center.x - innerRect.left}px ${e.center.y - innerRect.top}px`;\n\n // stop the browser's own pinch-zoom\n if (e.srcEvent?.cancelable) {\n e.srcEvent.preventDefault();\n e.srcEvent.stopPropagation();\n }\n };\n\n const pinchMove = (e: HammerInput) => {\n updateTransform(e.scale); // *only* CSS, no real zoom yet\n if (e.srcEvent?.cancelable) {\n e.srcEvent.preventDefault();\n e.srcEvent.stopPropagation();\n }\n };\n\n const pinchEnd = (e: HammerInput) => {\n // translate the relative hammer scale into a delta for requestZoomBy\n const delta = (e.scale - 1) * initialZoom;\n zoomProvides.requestZoomBy(delta, { vx: lastCenter.x, vy: lastCenter.y });\n\n resetTransform();\n initialZoom = 0;\n };\n\n // Async Hammer setup (internal)\n const setupHammer = async () => {\n try {\n const Hammer = (await import('hammerjs')).default;\n\n /* ------------------------------------------------------------------ */\n /* Hammer setup */\n /* ------------------------------------------------------------------ */\n const inputClass = (() => {\n const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n const SUPPORT_TOUCH = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n const SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n if (SUPPORT_ONLY_TOUCH) return Hammer.TouchInput;\n if (!SUPPORT_TOUCH) return Hammer.MouseInput;\n return Hammer.TouchMouseInput;\n })();\n\n hammer = new Hammer(element, {\n touchAction: 'pan-x pan-y', // allow scroll in every direction\n inputClass,\n });\n\n hammer.get('pinch').set({ enable: true, pointers: 2, threshold: 0.1 });\n\n hammer.on('pinchstart', pinchStart);\n hammer.on('pinchmove', pinchMove);\n hammer.on('pinchend', pinchEnd);\n } catch (error) {\n console.warn('Failed to load HammerJS:', error);\n }\n };\n\n setupHammer(); // Fire and forget\n\n // Return cleanup immediately\n return () => {\n hammer?.destroy();\n resetTransform();\n };\n}\n","import { ref, onMounted, onUnmounted } from 'vue';\nimport { useCapability } from '@embedpdf/core/vue';\nimport type { ViewportPlugin } from '@embedpdf/plugin-viewport';\n\nimport { setupPinchZoom } from '../../shared/utils/pinch-zoom-logic';\nimport { useZoomCapability } from './use-zoom';\n\nexport function usePinch() {\n const { provides: viewportProvides } = useCapability<ViewportPlugin>('viewport');\n const { provides: zoomProvides } = useZoomCapability();\n const elementRef = ref<HTMLDivElement | null>(null);\n\n let cleanup: (() => void) | undefined;\n\n onMounted(async () => {\n const element = elementRef.value;\n if (!element || !viewportProvides.value || !zoomProvides.value) {\n return;\n }\n\n cleanup = setupPinchZoom({\n element,\n viewportProvides: viewportProvides.value,\n zoomProvides: zoomProvides.value,\n });\n });\n\n onUnmounted(() => {\n cleanup?.();\n });\n\n return { elementRef };\n}\n","<template>\n <div\n v-if=\"rect\"\n :style=\"{\n position: 'absolute',\n pointerEvents: 'none',\n left: `${rect.origin.x * scale}px`,\n top: `${rect.origin.y * scale}px`,\n width: `${rect.size.width * scale}px`,\n height: `${rect.size.height * scale}px`,\n border: `1px solid ${stroke}`,\n background: fill,\n boxSizing: 'border-box',\n }\"\n :class=\"className\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useZoomCapability } from '../hooks';\n\ninterface MarqueeZoomProps {\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n}\n\nconst props = withDefaults(defineProps<MarqueeZoomProps>(), {\n stroke: 'rgba(33,150,243,0.8)',\n fill: 'rgba(33,150,243,0.15)',\n});\n\nconst { provides: zoomPlugin } = useZoomCapability();\nconst rect = ref<Rect | null>(null);\n\nlet unregister: (() => void) | undefined;\n\nonMounted(() => {\n if (!zoomPlugin.value) return;\n\n unregister = zoomPlugin.value.registerMarqueeOnPage({\n pageIndex: props.pageIndex,\n scale: props.scale,\n callback: {\n onPreview: (newRect) => {\n rect.value = newRect;\n },\n },\n });\n});\n\nonUnmounted(() => {\n unregister?.();\n});\n</script>\n","<template>\n <div\n ref=\"elementRef\"\n :style=\"{\n display: 'block',\n width: 'fit-content',\n overflow: 'visible',\n boxSizing: 'border-box',\n margin: '0px auto',\n }\"\n v-bind=\"$attrs\"\n >\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { usePinch } from '../hooks/use-pinch-zoom';\n\nconst { elementRef } = usePinch();\n</script>\n"],"names":["_createElementBlock","_normalizeStyle","scale","stroke","fill","className","_openBlock","_mergeProps","$attrs","_renderSlot"],"mappings":";;;;AAIO,MAAM,oBAAoB,MAAM,cAA0B,WAAW,EAAE;AACvE,MAAM,gBAAgB,MAAM,UAAsB,WAAW,EAAE;AAE/D,MAAM,UAAU,MAAM;AACrB,QAAA,EAAE,SAAS,IAAI,kBAAkB;AACjC,QAAA,QAAQ,IAAe,YAAY;AAEzC,YAAU,MAAM;AACV,QAAA,CAAC,SAAS,MAAO;AAErB,UAAM,cAAc,SAAS,MAAM,cAAc,CAAC,aAA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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-zoom",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -20,30 +20,36 @@
|
|
|
20
20
|
"types": "./dist/react/index.d.ts",
|
|
21
21
|
"import": "./dist/react/index.js",
|
|
22
22
|
"require": "./dist/react/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./vue": {
|
|
25
|
+
"types": "./dist/vue/index.d.ts",
|
|
26
|
+
"import": "./dist/vue/index.js",
|
|
27
|
+
"require": "./dist/vue/index.cjs"
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
"dependencies": {
|
|
26
31
|
"hammerjs": "^2.0.8",
|
|
27
|
-
"@embedpdf/models": "1.0.
|
|
32
|
+
"@embedpdf/models": "1.0.21"
|
|
28
33
|
},
|
|
29
34
|
"devDependencies": {
|
|
30
35
|
"@types/hammerjs": "^2.0.46",
|
|
31
36
|
"@types/react": "^18.2.0",
|
|
32
37
|
"typescript": "^5.0.0",
|
|
33
|
-
"@embedpdf/core": "1.0.
|
|
34
|
-
"@embedpdf/plugin-viewport": "1.0.19",
|
|
38
|
+
"@embedpdf/core": "1.0.21",
|
|
35
39
|
"@embedpdf/build": "1.0.0",
|
|
36
|
-
"@embedpdf/plugin-scroll": "1.0.
|
|
37
|
-
"@embedpdf/plugin-interaction-manager": "1.0.
|
|
40
|
+
"@embedpdf/plugin-scroll": "1.0.21",
|
|
41
|
+
"@embedpdf/plugin-interaction-manager": "1.0.21",
|
|
42
|
+
"@embedpdf/plugin-viewport": "1.0.21"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
40
45
|
"react": ">=16.8.0",
|
|
41
46
|
"react-dom": ">=16.8.0",
|
|
42
47
|
"preact": "^10.26.4",
|
|
43
|
-
"
|
|
44
|
-
"@embedpdf/plugin-viewport": "1.0.
|
|
45
|
-
"@embedpdf/plugin-scroll": "1.0.
|
|
46
|
-
"@embedpdf/
|
|
48
|
+
"vue": ">=3.2.0",
|
|
49
|
+
"@embedpdf/plugin-viewport": "1.0.21",
|
|
50
|
+
"@embedpdf/plugin-scroll": "1.0.21",
|
|
51
|
+
"@embedpdf/core": "1.0.21",
|
|
52
|
+
"@embedpdf/plugin-interaction-manager": "1.0.21"
|
|
47
53
|
},
|
|
48
54
|
"files": [
|
|
49
55
|
"dist",
|
|
@@ -65,7 +71,8 @@
|
|
|
65
71
|
"build:base": "vite build --mode base",
|
|
66
72
|
"build:react": "vite build --mode react",
|
|
67
73
|
"build:preact": "vite build --mode preact",
|
|
68
|
-
"build": "
|
|
74
|
+
"build:vue": "vite build --mode vue",
|
|
75
|
+
"build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\"",
|
|
69
76
|
"clean": "rimraf dist",
|
|
70
77
|
"lint": "eslint src --color",
|
|
71
78
|
"lint:fix": "eslint src --color --fix"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@embedpdf/plugin-interaction-manager/preact';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@embedpdf/plugin-interaction-manager/react';
|