@bluepic/embed 0.1.16 → 0.1.18
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/lib/bluepic-embed.es.js +99041 -0
- package/lib/bluepic-embed.umd.js +2626 -0
- package/lib/components/BluepicEmbeddedEditor.vue.d.ts +259 -1
- package/lib/components/BluepicEmbeddedEditor.vue.d.ts.map +1 -1
- package/lib/components/BluepicLogo.vue.d.ts +3 -0
- package/lib/components/BluepicLogo.vue.d.ts.map +1 -0
- package/lib/components/BxTabs.vue.d.ts.map +1 -1
- package/lib/components/CircularProgress.vue.d.ts +54 -0
- package/lib/components/CircularProgress.vue.d.ts.map +1 -0
- package/lib/style.css +1 -1
- package/lib/util/RenderService.d.ts +66 -0
- package/lib/util/RenderService.d.ts.map +1 -0
- package/lib/util/crypto.d.ts +4 -0
- package/lib/util/crypto.d.ts.map +1 -0
- package/lib/util/hash.d.ts +1 -0
- package/lib/util/hash.d.ts.map +1 -1
- package/package.json +10 -4
- package/lib/bluepic-fields.es.js +0 -86274
- package/lib/bluepic-fields.umd.js +0 -2610
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Template, Render } from '@bluepic/types';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
import { z } from '@hono/zod-openapi';
|
|
4
|
+
import BluepicLiveTemplate from '../components/BluepicLiveTemplate.vue';
|
|
5
|
+
export type LocalRenderOpts = {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
frames: Template.Serial['frames'];
|
|
9
|
+
quality?: number;
|
|
10
|
+
format: 'image/svg+xml' | 'image/png' | 'image/jpeg' | 'application/pdf' | 'application/vnd.adobe.indesign-idml-package';
|
|
11
|
+
svgOptions: {
|
|
12
|
+
vectorizeAllTexts: boolean;
|
|
13
|
+
};
|
|
14
|
+
idmlOptions: {
|
|
15
|
+
vectorizeAllTexts: boolean;
|
|
16
|
+
keepGroupTransforms: boolean;
|
|
17
|
+
rasterizeAllMasks: boolean;
|
|
18
|
+
keepFontRemoteUrls: boolean;
|
|
19
|
+
};
|
|
20
|
+
fileBasename: string;
|
|
21
|
+
watermark?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function renderRemote(embedV2Server: string, embedProjectId: number, templateId: string, data: {
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}, width: number, height: number, format: Exclude<z.infer<typeof Render.formatSchema>, 'mp4'>, quality: number, authorization?: string, frames?: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
}, watermark?: string): Promise<{
|
|
29
|
+
creditsConsumed: number;
|
|
30
|
+
files: string[];
|
|
31
|
+
}>;
|
|
32
|
+
export declare function getSessionState(templateId: string, data: {
|
|
33
|
+
[k: string]: unknown;
|
|
34
|
+
}, format: Exclude<z.infer<typeof Render.formatSchema>, 'mp4'>, width: number, height: number, quality: number, frames?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}): string;
|
|
38
|
+
export declare function renderLocal(svgDoc: Document, opts: LocalRenderOpts): Promise<{
|
|
39
|
+
name: string;
|
|
40
|
+
blob: Blob;
|
|
41
|
+
}[]>;
|
|
42
|
+
export declare function useRenderer(embedV2Server: string, bluepicLiveTemplateRef: Ref<InstanceType<typeof BluepicLiveTemplate> | undefined>, serialRef: Ref<Template.Serial | undefined>, embedProjectId: Ref<number | undefined>, templateId: Ref<string | undefined>, data: Ref<{
|
|
43
|
+
[k: string]: unknown;
|
|
44
|
+
}>): {
|
|
45
|
+
renderFiles: Ref<string[] | undefined, string[] | undefined>;
|
|
46
|
+
render: (format: Exclude<z.infer<typeof Render.formatSchema>, 'mp4'>, baseName?: string, watermark?: string) => Promise<{
|
|
47
|
+
files: string[];
|
|
48
|
+
creditsConsumed: number;
|
|
49
|
+
}>;
|
|
50
|
+
renderVideo: (format: 'mp4', duration: number, baseName?: string) => Promise<{
|
|
51
|
+
files: string[];
|
|
52
|
+
creditsConsumed: number;
|
|
53
|
+
}>;
|
|
54
|
+
videoFiles: Ref<{
|
|
55
|
+
name: string;
|
|
56
|
+
url: string;
|
|
57
|
+
}[] | undefined, {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
}[] | undefined>;
|
|
61
|
+
videoRendering: Ref<boolean, boolean>;
|
|
62
|
+
videoProgress: Ref<Render.RenderProgressEvent | undefined, Render.RenderProgressEvent | undefined>;
|
|
63
|
+
};
|
|
64
|
+
export declare function downloadFiles(fileUrls: string[], baseName: string): Promise<void>;
|
|
65
|
+
export declare function consumeCredits(amount: number, embedProjectId: string, sessionState: string, fingerprint: string): Promise<void>;
|
|
66
|
+
//# sourceMappingURL=RenderService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderService.d.ts","sourceRoot":"","sources":["RenderService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAC;AAOpC,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGtC,OAAO,mBAAmB,MAAM,uCAAuC,CAAC;AAUxE,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,iBAAiB,GAAG,6CAA6C,CAAC;IACzH,UAAU,EAAE;QACV,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,WAAW,EAAE;QACX,iBAAiB,EAAE,OAAO,CAAC;QAC3B,mBAAmB,EAAE,OAAO,CAAC;QAC7B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,kBAAkB,EAAE,OAAO,CAAC;KAC7B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AG,SAAS,CAAC,EAC3C,cAAc,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EACvC,UAAU,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EACnC,IAAI,EAAE,GAAG,CAAC;IACR,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB,CAAC;;qBAM4B,QAAQ,EAAE,KAAK,CAAC,OAAO,OAAO,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,MAAM,cAAc,MAAM;;;;0BA2ErF,KAAK,YAAY,MAAM,aAAa,MAAM;;;;;cAF9C,MAAM;aAAO,MAAM;;cAAnB,MAAM;aAAO,MAAM;;;;EA8CnD;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,iBAuBvE;AAGD,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBA6BrH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["crypto.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,UAQrC;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,mBAMzC;AAMD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAIvC"}
|
package/lib/util/hash.d.ts
CHANGED
|
@@ -6,4 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function hashString(input: string, algorithm?: 'sha256' | 'sha512'): string;
|
|
8
8
|
export declare function hashObject(input: any, algorithm?: 'sha256' | 'sha512'): string;
|
|
9
|
+
export declare function hash(input: any): string;
|
|
9
10
|
//# sourceMappingURL=hash.d.ts.map
|
package/lib/util/hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["hash.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,QAAQ,GAAG,QAAmB,GAAG,MAAM,CAI3F;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,GAAE,QAAQ,GAAG,QAAmB,GAAG,MAAM,CAExF"}
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["hash.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,QAAQ,GAAG,QAAmB,GAAG,MAAM,CAI3F;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,GAAE,QAAQ,GAAG,QAAmB,GAAG,MAAM,CAExF;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,GAAG,UAG9B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluepic/embed",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"package.json",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
|
-
"import": "./lib/bluepic-
|
|
14
|
-
"require": "./lib/bluepic-
|
|
13
|
+
"import": "./lib/bluepic-embed.es.js",
|
|
14
|
+
"require": "./lib/bluepic-embed.umd.js"
|
|
15
15
|
},
|
|
16
16
|
"./style.css": "./lib/style.css"
|
|
17
17
|
},
|
|
18
18
|
"types": "./lib/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite",
|
|
21
|
-
"build": "vue-tsc --noEmit && vite build && cp lib/bluepic-
|
|
21
|
+
"build": "vue-tsc --noEmit && vite build && cp lib/bluepic-embed.umd.js tests/test1/bluepic-embed.umd.js && cp lib/style.css tests/test1/bluepic-embed.css",
|
|
22
22
|
"serve": "npm-watch build",
|
|
23
23
|
"lint": "eslint src --ext .ts,.vue"
|
|
24
24
|
},
|
|
@@ -35,12 +35,17 @@
|
|
|
35
35
|
"@floating-ui/vue": "^1.0.6",
|
|
36
36
|
"@hono/zod-openapi": "^0.19.4",
|
|
37
37
|
"@vueuse/core": "^10.11.0",
|
|
38
|
+
"client-zip": "^2.5.0",
|
|
38
39
|
"color": "^5.0.0",
|
|
39
40
|
"compressorjs": "^1.2.1",
|
|
40
41
|
"css": "^3.0.0",
|
|
41
42
|
"css-expression": "^0.0.8",
|
|
43
|
+
"downloadjs": "^1.4.7",
|
|
44
|
+
"flat-svg": "^0.0.14",
|
|
45
|
+
"idml": "^0.0.6",
|
|
42
46
|
"lodash": "^4.17.21",
|
|
43
47
|
"mapbox-gl": "^3.7.0",
|
|
48
|
+
"mime": "^4.0.7",
|
|
44
49
|
"mime-types": "^2.1.35",
|
|
45
50
|
"nanoid": "^5.0.7",
|
|
46
51
|
"object-hash": "^3.0.0",
|
|
@@ -57,6 +62,7 @@
|
|
|
57
62
|
"devDependencies": {
|
|
58
63
|
"@bluepic/types": "^0.1.344",
|
|
59
64
|
"@types/css": "^0.0.38",
|
|
65
|
+
"@types/downloadjs": "^1.4.6",
|
|
60
66
|
"@types/lodash": "^4.17.14",
|
|
61
67
|
"@types/mime-types": "^2.1.4",
|
|
62
68
|
"@types/node": "^18.11.3",
|