Skip to content

Commit 3183fc5

Browse files
committed
Build
1 parent df9dabd commit 3183fc5

File tree

7 files changed

+75
-15
lines changed

7 files changed

+75
-15
lines changed

dist/grapesjs-plugin-export.min.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

dist/grapesjs-plugin-export.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/index.d.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import grapesjs from 'grapesjs';
2+
3+
export declare type Editor = grapesjs.Editor;
4+
export declare type PluginOptions = {
5+
/**
6+
* Type id used to register the new storage.
7+
* You can use this option in case you want to replace the already available storages (eg. `local`).
8+
* @default 'indexeddb'
9+
*/
10+
type?: string;
11+
/**
12+
* Add a button inside the export dialog
13+
* @default true
14+
*/
15+
addExportBtn?: boolean;
16+
/**
17+
* Label of the export button
18+
* @default 'Export to ZIP'
19+
*/
20+
btnLabel?: string;
21+
/**
22+
* ZIP filename prefix
23+
* @default 'grapesjs_template'
24+
*/
25+
filenamePfx?: string;
26+
/**
27+
* Use a function to generate the filename, eg. `filename: editor => 'my-file.zip',`
28+
*/
29+
filename?: (editor: Editor) => string;
30+
/**
31+
* Callback to execute once the export is completed
32+
*/
33+
done?: () => void;
34+
/**
35+
* Callback to execute on export error
36+
*/
37+
onError?: (error: Error) => void;
38+
/**
39+
* Use the root object to create the folder structure of your zip (async functions are supported)
40+
* @example
41+
* root: {
42+
* css: {
43+
* 'style.css': ed => ed.getCss(),
44+
* 'some-file.txt': 'My custom content',
45+
* },
46+
* img: async ed => {
47+
* const images = await fetchImagesByStructue(ed.getComponents());
48+
* return images;
49+
* // Where `images` is an object like this:
50+
* // { 'img1.png': '...png content', 'img2.jpg': '...jpg content' }
51+
* },
52+
* 'index.html': ed => `<body>${ed.getHtml()}</body>`
53+
* }
54+
*/
55+
root?: Record<string, unknown>;
56+
/**
57+
* Custom function for checking if the file content is binary
58+
*/
59+
isBinary?: (content: string, name: string) => boolean;
60+
};
61+
declare const plugin: grapesjs.Plugin<PluginOptions>;
62+
63+
export {
64+
plugin as default,
65+
};
66+
67+
export {};

dist/index.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "grapesjs-plugin-export",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "Export GrapesJS templates to ZIP",
5-
"main": "dist/grapesjs-plugin-export.min.js",
5+
"main": "dist/index.js",
6+
"files": ["dist/*"],
67
"scripts": {
78
"start": "grapesjs-cli serve",
89
"build": "grapesjs-cli build"

0 commit comments

Comments
 (0)