@embedpdf/plugin-stamp 2.11.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/LICENSE +21 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +980 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions.d.ts +14 -0
- package/dist/lib/defaults/name-map.d.ts +2 -0
- package/dist/lib/handlers/rubber-stamp.handler.d.ts +4 -0
- package/dist/lib/index.d.ts +11 -0
- package/dist/lib/manifest.d.ts +4 -0
- package/dist/lib/reducer.d.ts +5 -0
- package/dist/lib/stamp-plugin.d.ts +54 -0
- package/dist/lib/tools.d.ts +58 -0
- package/dist/lib/types.d.ts +135 -0
- package/dist/preact/adapter.d.ts +5 -0
- package/dist/preact/annotation.d.ts +1 -0
- package/dist/preact/core.d.ts +1 -0
- package/dist/preact/index.cjs +2 -0
- package/dist/preact/index.cjs.map +1 -0
- package/dist/preact/index.d.ts +1 -0
- package/dist/preact/index.js +147 -0
- package/dist/preact/index.js.map +1 -0
- package/dist/react/adapter.d.ts +2 -0
- package/dist/react/annotation.d.ts +1 -0
- package/dist/react/core.d.ts +1 -0
- package/dist/react/index.cjs +2 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +146 -0
- package/dist/react/index.js.map +1 -0
- package/dist/shared/components/index.d.ts +3 -0
- package/dist/shared/components/stamp-img.d.ts +10 -0
- package/dist/shared/components/stamp-preview-renderers.d.ts +2 -0
- package/dist/shared/components/stamp-renderer-registration.d.ts +1 -0
- package/dist/shared/hooks/index.d.ts +1 -0
- package/dist/shared/hooks/use-stamp.d.ts +18 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared-preact/components/index.d.ts +3 -0
- package/dist/shared-preact/components/stamp-img.d.ts +10 -0
- package/dist/shared-preact/components/stamp-preview-renderers.d.ts +2 -0
- package/dist/shared-preact/components/stamp-renderer-registration.d.ts +1 -0
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-stamp.d.ts +18 -0
- package/dist/shared-preact/index.d.ts +4 -0
- package/dist/shared-react/components/index.d.ts +3 -0
- package/dist/shared-react/components/stamp-img.d.ts +10 -0
- package/dist/shared-react/components/stamp-preview-renderers.d.ts +2 -0
- package/dist/shared-react/components/stamp-renderer-registration.d.ts +1 -0
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-stamp.d.ts +18 -0
- package/dist/shared-react/index.d.ts +4 -0
- package/dist/svelte/components/StampImg.svelte.d.ts +10 -0
- package/dist/svelte/components/StampPreview.svelte.d.ts +10 -0
- package/dist/svelte/components/StampRendererRegistration.svelte.d.ts +18 -0
- package/dist/svelte/components/index.d.ts +2 -0
- package/dist/svelte/components/stamp-preview-renderers.d.ts +2 -0
- package/dist/svelte/hooks/index.d.ts +1 -0
- package/dist/svelte/hooks/use-stamp.svelte.d.ts +23 -0
- package/dist/svelte/index.cjs +2 -0
- package/dist/svelte/index.cjs.map +1 -0
- package/dist/svelte/index.d.ts +4 -0
- package/dist/svelte/index.js +223 -0
- package/dist/svelte/index.js.map +1 -0
- package/dist/vue/components/index.d.ts +2 -0
- package/dist/vue/components/stamp-img.vue.d.ts +9 -0
- package/dist/vue/components/stamp-preview-renderers.d.ts +2 -0
- package/dist/vue/components/stamp-preview.vue.d.ts +10 -0
- package/dist/vue/components/stamp-renderer-registration.vue.d.ts +13 -0
- package/dist/vue/hooks/index.d.ts +1 -0
- package/dist/vue/hooks/use-stamp.d.ts +262 -0
- package/dist/vue/index.cjs +2 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.js +235 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
+
import { StampPlugin, StampPluginPackage as StampPluginPackage$1 } from "@embedpdf/plugin-stamp";
|
|
3
|
+
export * from "@embedpdf/plugin-stamp";
|
|
4
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, renderSlot, ref, watch, toValue, mergeProps, createCommentVNode } from "vue";
|
|
5
|
+
import { createRenderer, useRegisterRenderers } from "@embedpdf/plugin-annotation/vue";
|
|
6
|
+
import { PdfAnnotationSubtype, ignore, PdfErrorCode } from "@embedpdf/models";
|
|
7
|
+
import { useCapability, usePlugin } from "@embedpdf/core/vue";
|
|
8
|
+
const _hoisted_1$1 = ["src"];
|
|
9
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "stamp-preview",
|
|
11
|
+
props: {
|
|
12
|
+
data: {},
|
|
13
|
+
bounds: {},
|
|
14
|
+
scale: {}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const rotationDeg = computed(() => (4 - props.data.pageRotation) % 4 * 90);
|
|
19
|
+
const style = computed(() => ({
|
|
20
|
+
width: "100%",
|
|
21
|
+
height: "100%",
|
|
22
|
+
opacity: 0.6,
|
|
23
|
+
objectFit: "contain",
|
|
24
|
+
pointerEvents: "none",
|
|
25
|
+
transform: rotationDeg.value ? `rotate(${rotationDeg.value}deg)` : void 0
|
|
26
|
+
}));
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return openBlock(), createElementBlock("img", {
|
|
29
|
+
src: __props.data.ghostUrl,
|
|
30
|
+
style: normalizeStyle(style.value),
|
|
31
|
+
alt: ""
|
|
32
|
+
}, null, 12, _hoisted_1$1);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const stampPreviewRenderers = [
|
|
37
|
+
createRenderer({
|
|
38
|
+
id: "stampPreview",
|
|
39
|
+
matchesPreview: (p) => p.type === PdfAnnotationSubtype.STAMP,
|
|
40
|
+
renderPreview: _sfc_main$2
|
|
41
|
+
})
|
|
42
|
+
];
|
|
43
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
44
|
+
__name: "stamp-renderer-registration",
|
|
45
|
+
setup(__props) {
|
|
46
|
+
useRegisterRenderers(stampPreviewRenderers);
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return renderSlot(_ctx.$slots, "default");
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const useStampPlugin = () => usePlugin(StampPlugin.id);
|
|
53
|
+
const useStampCapability = () => useCapability(StampPlugin.id);
|
|
54
|
+
const useStampLibraries = () => {
|
|
55
|
+
const { provides } = useStampCapability();
|
|
56
|
+
const libraries = ref([]);
|
|
57
|
+
watch(
|
|
58
|
+
provides,
|
|
59
|
+
(capability, _, onCleanup) => {
|
|
60
|
+
if (!capability) {
|
|
61
|
+
libraries.value = [];
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
libraries.value = capability.getLibraries();
|
|
65
|
+
const unsubscribe = capability.onLibraryChange((libs) => {
|
|
66
|
+
libraries.value = libs;
|
|
67
|
+
});
|
|
68
|
+
onCleanup(unsubscribe);
|
|
69
|
+
},
|
|
70
|
+
{ immediate: true }
|
|
71
|
+
);
|
|
72
|
+
return { libraries };
|
|
73
|
+
};
|
|
74
|
+
const useStampsByCategory = (category) => {
|
|
75
|
+
const { provides } = useStampCapability();
|
|
76
|
+
const stamps = ref([]);
|
|
77
|
+
watch(
|
|
78
|
+
[provides, () => toValue(category)],
|
|
79
|
+
([capability, cat], _, onCleanup) => {
|
|
80
|
+
if (!capability) {
|
|
81
|
+
stamps.value = [];
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
stamps.value = capability.getStampsByCategory(cat);
|
|
85
|
+
const unsubscribe = capability.onLibraryChange(() => {
|
|
86
|
+
stamps.value = capability.getStampsByCategory(cat);
|
|
87
|
+
});
|
|
88
|
+
onCleanup(unsubscribe);
|
|
89
|
+
},
|
|
90
|
+
{ immediate: true }
|
|
91
|
+
);
|
|
92
|
+
return stamps;
|
|
93
|
+
};
|
|
94
|
+
const useStampsByLibrary = (libraryId, category) => {
|
|
95
|
+
const { provides } = useStampCapability();
|
|
96
|
+
const stamps = ref([]);
|
|
97
|
+
watch(
|
|
98
|
+
[provides, () => toValue(libraryId), () => toValue(category)],
|
|
99
|
+
([capability, libId, cat], _, onCleanup) => {
|
|
100
|
+
if (!capability) {
|
|
101
|
+
stamps.value = [];
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const derive = () => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
const libraries = capability.getLibraries();
|
|
107
|
+
const results = [];
|
|
108
|
+
for (const library of libraries) {
|
|
109
|
+
if (libId && libId !== "all" && library.id !== libId) continue;
|
|
110
|
+
for (const stamp of library.stamps) {
|
|
111
|
+
if (cat) {
|
|
112
|
+
const libraryMatches = ((_a = library.categories) == null ? void 0 : _a.includes(cat)) ?? false;
|
|
113
|
+
const stampMatches = ((_b = stamp.categories) == null ? void 0 : _b.includes(cat)) ?? false;
|
|
114
|
+
if (!libraryMatches && !stampMatches) continue;
|
|
115
|
+
}
|
|
116
|
+
results.push({ library, stamp });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
stamps.value = results;
|
|
120
|
+
};
|
|
121
|
+
derive();
|
|
122
|
+
const unsubscribe = capability.onLibraryChange(derive);
|
|
123
|
+
onCleanup(unsubscribe);
|
|
124
|
+
},
|
|
125
|
+
{ immediate: true }
|
|
126
|
+
);
|
|
127
|
+
return stamps;
|
|
128
|
+
};
|
|
129
|
+
const useActiveStamp = (documentId) => {
|
|
130
|
+
const { provides } = useStampCapability();
|
|
131
|
+
const activeStamp = ref(null);
|
|
132
|
+
watch(
|
|
133
|
+
[provides, () => toValue(documentId)],
|
|
134
|
+
([capability, docId], _, onCleanup) => {
|
|
135
|
+
if (!capability || !docId) {
|
|
136
|
+
activeStamp.value = null;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const scope = capability.forDocument(docId);
|
|
140
|
+
activeStamp.value = scope.getActiveStamp();
|
|
141
|
+
const unsubscribe = scope.onActiveStampChange((stamp) => {
|
|
142
|
+
activeStamp.value = stamp;
|
|
143
|
+
});
|
|
144
|
+
onCleanup(unsubscribe);
|
|
145
|
+
},
|
|
146
|
+
{ immediate: true }
|
|
147
|
+
);
|
|
148
|
+
return activeStamp;
|
|
149
|
+
};
|
|
150
|
+
const _hoisted_1 = ["src"];
|
|
151
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
152
|
+
__name: "stamp-img",
|
|
153
|
+
props: {
|
|
154
|
+
libraryId: {},
|
|
155
|
+
pageIndex: {},
|
|
156
|
+
width: {},
|
|
157
|
+
dpr: {}
|
|
158
|
+
},
|
|
159
|
+
setup(__props) {
|
|
160
|
+
const props = __props;
|
|
161
|
+
const { provides } = useStampCapability();
|
|
162
|
+
const url = ref(null);
|
|
163
|
+
let urlToRevoke = null;
|
|
164
|
+
function revoke() {
|
|
165
|
+
if (urlToRevoke) {
|
|
166
|
+
URL.revokeObjectURL(urlToRevoke);
|
|
167
|
+
urlToRevoke = null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
let abortTask = null;
|
|
171
|
+
watch(
|
|
172
|
+
[
|
|
173
|
+
() => provides.value,
|
|
174
|
+
() => props.libraryId,
|
|
175
|
+
() => props.pageIndex,
|
|
176
|
+
() => props.width,
|
|
177
|
+
() => props.dpr
|
|
178
|
+
],
|
|
179
|
+
([capability, libraryId, pageIndex, width, dpr], _, onCleanup) => {
|
|
180
|
+
if (abortTask) {
|
|
181
|
+
abortTask();
|
|
182
|
+
abortTask = null;
|
|
183
|
+
}
|
|
184
|
+
if (!capability) {
|
|
185
|
+
url.value = null;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const task = capability.renderStamp(
|
|
189
|
+
libraryId,
|
|
190
|
+
pageIndex,
|
|
191
|
+
width,
|
|
192
|
+
dpr ?? window.devicePixelRatio
|
|
193
|
+
);
|
|
194
|
+
abortTask = () => task.abort({
|
|
195
|
+
code: PdfErrorCode.Cancelled,
|
|
196
|
+
message: "canceled stamp render task"
|
|
197
|
+
});
|
|
198
|
+
task.wait((blob) => {
|
|
199
|
+
revoke();
|
|
200
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
201
|
+
urlToRevoke = objectUrl;
|
|
202
|
+
url.value = objectUrl;
|
|
203
|
+
abortTask = null;
|
|
204
|
+
}, ignore);
|
|
205
|
+
onCleanup(() => {
|
|
206
|
+
if (abortTask) {
|
|
207
|
+
abortTask();
|
|
208
|
+
abortTask = null;
|
|
209
|
+
}
|
|
210
|
+
revoke();
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
{ immediate: true }
|
|
214
|
+
);
|
|
215
|
+
return (_ctx, _cache) => {
|
|
216
|
+
return url.value ? (openBlock(), createElementBlock("img", mergeProps({
|
|
217
|
+
key: 0,
|
|
218
|
+
src: url.value
|
|
219
|
+
}, _ctx.$attrs, { onLoad: revoke }), null, 16, _hoisted_1)) : createCommentVNode("", true);
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const StampPluginPackage = createPluginPackage(StampPluginPackage$1).addUtility(_sfc_main$1).build();
|
|
224
|
+
export {
|
|
225
|
+
_sfc_main as StampImg,
|
|
226
|
+
StampPluginPackage,
|
|
227
|
+
_sfc_main$1 as StampRendererRegistration,
|
|
228
|
+
useActiveStamp,
|
|
229
|
+
useStampCapability,
|
|
230
|
+
useStampLibraries,
|
|
231
|
+
useStampPlugin,
|
|
232
|
+
useStampsByCategory,
|
|
233
|
+
useStampsByLibrary
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/vue/components/stamp-preview.vue","../../src/vue/components/stamp-preview-renderers.ts","../../src/vue/components/stamp-renderer-registration.vue","../../src/vue/hooks/use-stamp.ts","../../src/vue/components/stamp-img.vue","../../src/vue/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport type { StampPreviewData } from '@embedpdf/plugin-stamp';\n\nconst props = defineProps<{\n data: StampPreviewData;\n bounds: Rect;\n scale: number;\n}>();\n\nconst rotationDeg = computed(() => ((4 - props.data.pageRotation) % 4) * 90);\n\nconst style = computed(() => ({\n width: '100%',\n height: '100%',\n opacity: 0.6,\n objectFit: 'contain' as const,\n pointerEvents: 'none' as const,\n transform: rotationDeg.value ? `rotate(${rotationDeg.value}deg)` : undefined,\n}));\n</script>\n\n<template>\n <img :src=\"data.ghostUrl\" :style=\"style\" alt=\"\" />\n</template>\n","import { PdfAnnotationSubtype } from '@embedpdf/models';\nimport type { StampPreviewData } from '@embedpdf/plugin-stamp';\nimport type { BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/vue';\nimport { createRenderer } from '@embedpdf/plugin-annotation/vue';\nimport StampPreview from './stamp-preview.vue';\n\nexport const stampPreviewRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<never, StampPreviewData>({\n id: 'stampPreview',\n matchesPreview: (p) => p.type === PdfAnnotationSubtype.STAMP,\n renderPreview: StampPreview,\n }),\n];\n","<script setup lang=\"ts\">\nimport { useRegisterRenderers } from '@embedpdf/plugin-annotation/vue';\nimport { stampPreviewRenderers } from './stamp-preview-renderers';\n\nuseRegisterRenderers(stampPreviewRenderers);\n</script>\n\n<template>\n <slot />\n</template>\n","import { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport { StampPlugin, StampLibrary, ResolvedStamp, ActiveStampInfo } from '@embedpdf/plugin-stamp';\nimport { ref, watch, toValue, type MaybeRefOrGetter } from 'vue';\n\nexport const useStampPlugin = () => usePlugin<StampPlugin>(StampPlugin.id);\nexport const useStampCapability = () => useCapability<StampPlugin>(StampPlugin.id);\n\nexport const useStampLibraries = () => {\n const { provides } = useStampCapability();\n const libraries = ref<StampLibrary[]>([]);\n\n watch(\n provides,\n (capability, _, onCleanup) => {\n if (!capability) {\n libraries.value = [];\n return;\n }\n\n libraries.value = capability.getLibraries();\n const unsubscribe = capability.onLibraryChange((libs) => {\n libraries.value = libs;\n });\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n return { libraries };\n};\n\nexport const useStampsByCategory = (category: MaybeRefOrGetter<string>) => {\n const { provides } = useStampCapability();\n const stamps = ref<ResolvedStamp[]>([]);\n\n watch(\n [provides, () => toValue(category)],\n ([capability, cat], _, onCleanup) => {\n if (!capability) {\n stamps.value = [];\n return;\n }\n\n stamps.value = capability.getStampsByCategory(cat);\n const unsubscribe = capability.onLibraryChange(() => {\n stamps.value = capability.getStampsByCategory(cat);\n });\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n return stamps;\n};\n\nexport const useStampsByLibrary = (\n libraryId: MaybeRefOrGetter<string | undefined>,\n category?: MaybeRefOrGetter<string | undefined>,\n) => {\n const { provides } = useStampCapability();\n const stamps = ref<ResolvedStamp[]>([]);\n\n watch(\n [provides, () => toValue(libraryId), () => toValue(category)],\n ([capability, libId, cat], _, onCleanup) => {\n if (!capability) {\n stamps.value = [];\n return;\n }\n\n const derive = () => {\n const libraries = capability.getLibraries();\n const results: ResolvedStamp[] = [];\n\n for (const library of libraries) {\n if (libId && libId !== 'all' && library.id !== libId) continue;\n\n for (const stamp of library.stamps) {\n if (cat) {\n const libraryMatches = library.categories?.includes(cat) ?? false;\n const stampMatches = stamp.categories?.includes(cat) ?? false;\n if (!libraryMatches && !stampMatches) continue;\n }\n results.push({ library, stamp });\n }\n }\n\n stamps.value = results;\n };\n\n derive();\n const unsubscribe = capability.onLibraryChange(derive);\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n return stamps;\n};\n\nexport const useActiveStamp = (documentId: MaybeRefOrGetter<string>) => {\n const { provides } = useStampCapability();\n const activeStamp = ref<ActiveStampInfo | null>(null);\n\n watch(\n [provides, () => toValue(documentId)],\n ([capability, docId], _, onCleanup) => {\n if (!capability || !docId) {\n activeStamp.value = null;\n return;\n }\n\n const scope = capability.forDocument(docId);\n activeStamp.value = scope.getActiveStamp();\n const unsubscribe = scope.onActiveStampChange((stamp) => {\n activeStamp.value = stamp;\n });\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n return activeStamp;\n};\n","<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport { useStampCapability } from '../hooks';\nimport { ignore, PdfErrorCode } from '@embedpdf/models';\n\ninterface StampImgProps {\n libraryId: string;\n pageIndex: number;\n width: number;\n dpr?: number;\n}\n\nconst props = defineProps<StampImgProps>();\n\nconst { provides } = useStampCapability();\n\nconst url = ref<string | null>(null);\nlet urlToRevoke: string | null = null;\n\nfunction revoke() {\n if (urlToRevoke) {\n URL.revokeObjectURL(urlToRevoke);\n urlToRevoke = null;\n }\n}\n\nlet abortTask: (() => void) | null = null;\n\nwatch(\n [\n () => provides.value,\n () => props.libraryId,\n () => props.pageIndex,\n () => props.width,\n () => props.dpr,\n ],\n ([capability, libraryId, pageIndex, width, dpr], _, onCleanup) => {\n if (abortTask) {\n abortTask();\n abortTask = null;\n }\n\n if (!capability) {\n url.value = null;\n return;\n }\n\n const task = capability.renderStamp(\n libraryId,\n pageIndex,\n width,\n dpr ?? window.devicePixelRatio,\n );\n\n abortTask = () =>\n task.abort({\n code: PdfErrorCode.Cancelled,\n message: 'canceled stamp render task',\n });\n\n task.wait((blob) => {\n revoke();\n const objectUrl = URL.createObjectURL(blob);\n urlToRevoke = objectUrl;\n url.value = objectUrl;\n abortTask = null;\n }, ignore);\n\n onCleanup(() => {\n if (abortTask) {\n abortTask();\n abortTask = null;\n }\n revoke();\n });\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <img v-if=\"url\" :src=\"url\" v-bind=\"$attrs\" @load=\"revoke\" />\n</template>\n","import { createPluginPackage } from '@embedpdf/core';\nimport { StampPluginPackage as BaseStampPackage } from '@embedpdf/plugin-stamp';\nimport StampRendererRegistration from './components/stamp-renderer-registration.vue';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-stamp';\n\nexport const StampPluginPackage = createPluginPackage(BaseStampPackage)\n .addUtility(StampRendererRegistration)\n .build();\n"],"names":["_createElementBlock","StampPreview","_renderSlot","_openBlock","_mergeProps","$attrs","BaseStampPackage","StampRendererRegistration"],"mappings":";;;;;;;;;;;;;;;;AAKA,UAAM,QAAQ;AAMd,UAAM,cAAc,SAAS,OAAQ,IAAI,MAAM,KAAK,gBAAgB,IAAK,EAAE;AAE3E,UAAM,QAAQ,SAAS,OAAO;AAAA,MAC5B,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,WAAW;AAAA,MACX,eAAe;AAAA,MACf,WAAW,YAAY,QAAQ,UAAU,YAAY,KAAK,SAAS;AAAA,IAAA,EACnE;;0BAIAA,mBAAkD,OAAA;AAAA,QAA5C,KAAK,QAAA,KAAK;AAAA,QAAW,sBAAO,MAAA,KAAK;AAAA,QAAE,KAAI;AAAA,MAAA;;;;AClBxC,MAAM,wBAAmD;AAAA,EAC9D,eAAwC;AAAA,IACtC,IAAI;AAAA,IACJ,gBAAgB,CAAC,MAAM,EAAE,SAAS,qBAAqB;AAAA,IACvD,eAAeC;AAAAA,EAAA,CAChB;AACH;;;;ACRA,yBAAqB,qBAAqB;;aAIxCC,WAAQ,KAAA,QAAA,SAAA;AAAA;;;ACJH,MAAM,iBAAiB,MAAM,UAAuB,YAAY,EAAE;AAClE,MAAM,qBAAqB,MAAM,cAA2B,YAAY,EAAE;AAE1E,MAAM,oBAAoB,MAAM;AACrC,QAAM,EAAE,SAAA,IAAa,mBAAA;AACrB,QAAM,YAAY,IAAoB,EAAE;AAExC;AAAA,IACE;AAAA,IACA,CAAC,YAAY,GAAG,cAAc;AAC5B,UAAI,CAAC,YAAY;AACf,kBAAU,QAAQ,CAAA;AAClB;AAAA,MACF;AAEA,gBAAU,QAAQ,WAAW,aAAA;AAC7B,YAAM,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,MAAM,MAAM;AAAA,QACZ,MAAM,MAAM;AAAA,MAAA;AAAA,MAEd,CAAC,CAAC,YAAY,WAAW,WAAW,OAAO,GAAG,GAAG,GAAG,cAAc;AAChE,YAAI,WAAW;AACb,oBAAA;AACA,sBAAY;AAAA,QACd;AAEA,YAAI,CAAC,YAAY;AACf,cAAI,QAAQ;AACZ;AAAA,QACF;AAEA,cAAM,OAAO,WAAW;AAAA,UACtB;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO,OAAO;AAAA,QAAA;AAGhB,oBAAY,MACV,KAAK,MAAM;AAAA,UACT,MAAM,aAAa;AAAA,UACnB,SAAS;AAAA,QAAA,CACV;AAEH,aAAK,KAAK,CAAC,SAAS;AAClB,iBAAA;AACA,gBAAM,YAAY,IAAI,gBAAgB,IAAI;AAC1C,wBAAc;AACd,cAAI,QAAQ;AACZ,sBAAY;AAAA,QACd,GAAG,MAAM;AAET,kBAAU,MAAM;AACd,cAAI,WAAW;AACb,sBAAA;AACA,wBAAY;AAAA,UACd;AACA,iBAAA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MACA,EAAE,WAAW,KAAA;AAAA,IAAK;;aAKP,IAAA,SAAXC,UAAA,GAAAH,mBAA4D,OAA5DI,WAA4D;AAAA;QAA3C,KAAK,IAAA;AAAA,MAAA,GAAaC,KAAAA,QAAM,EAAG,QAAM,OAAA,CAAM,GAAA,MAAA,IAAA,UAAA;;;;ACzEnD,MAAM,qBAAqB,oBAAoBC,oBAAgB,EACnE,WAAWC,WAAyB,EACpC,MAAA;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@embedpdf/plugin-stamp",
|
|
3
|
+
"version": "2.11.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./preact": {
|
|
16
|
+
"types": "./dist/preact/index.d.ts",
|
|
17
|
+
"import": "./dist/preact/index.js",
|
|
18
|
+
"require": "./dist/preact/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./react": {
|
|
21
|
+
"types": "./dist/react/index.d.ts",
|
|
22
|
+
"import": "./dist/react/index.js",
|
|
23
|
+
"require": "./dist/react/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./vue": {
|
|
26
|
+
"types": "./dist/vue/index.d.ts",
|
|
27
|
+
"import": "./dist/vue/index.js",
|
|
28
|
+
"require": "./dist/vue/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./svelte": {
|
|
31
|
+
"types": "./dist/svelte/index.d.ts",
|
|
32
|
+
"import": "./dist/svelte/index.js",
|
|
33
|
+
"require": "./dist/svelte/index.cjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@embedpdf/models": "2.11.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/react": "^18.2.0",
|
|
41
|
+
"typescript": "^5.0.0",
|
|
42
|
+
"@embedpdf/plugin-annotation": "2.11.0",
|
|
43
|
+
"@embedpdf/core": "2.11.0",
|
|
44
|
+
"@embedpdf/build": "1.1.0",
|
|
45
|
+
"@embedpdf/plugin-i18n": "2.11.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": ">=16.8.0",
|
|
49
|
+
"react-dom": ">=16.8.0",
|
|
50
|
+
"preact": "^10.26.4",
|
|
51
|
+
"vue": ">=3.2.0",
|
|
52
|
+
"svelte": ">=5 <6",
|
|
53
|
+
"@embedpdf/core": "2.11.0",
|
|
54
|
+
"@embedpdf/plugin-annotation": "2.11.0",
|
|
55
|
+
"@embedpdf/plugin-i18n": "2.11.0"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist",
|
|
59
|
+
"README.md"
|
|
60
|
+
],
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer",
|
|
64
|
+
"directory": "packages/plugin-stamp"
|
|
65
|
+
},
|
|
66
|
+
"homepage": "https://www.embedpdf.com/docs",
|
|
67
|
+
"bugs": {
|
|
68
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer/issues"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build:base": "vite build --mode base",
|
|
75
|
+
"build:react": "vite build --mode react",
|
|
76
|
+
"build:preact": "vite build --mode preact",
|
|
77
|
+
"build:vue": "vite build --mode vue",
|
|
78
|
+
"build:svelte": "vite build --mode svelte",
|
|
79
|
+
"build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue,svelte \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\" \"vite build --mode svelte\"",
|
|
80
|
+
"clean": "rimraf dist",
|
|
81
|
+
"lint": "eslint src --color",
|
|
82
|
+
"lint:fix": "eslint src --color --fix"
|
|
83
|
+
}
|
|
84
|
+
}
|