@edv4h/usketch-plugin-export 1.0.1 → 2.0.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +30 -32
- package/dist/plugin.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG1E,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG1E,wBAAgB,kBAAkB,IAAI,aAAa,CAiClD"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import { downloadBlob, exportCanvas, exportJson } from "./exporter.js";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
};
|
|
2
|
+
export function createExportPlugin() {
|
|
3
|
+
return {
|
|
4
|
+
id: "usketch-plugin-export",
|
|
5
|
+
name: "エクスポート",
|
|
6
|
+
setup(ctx) {
|
|
7
|
+
const unsub1 = ctx.shortcuts.register("ctrl+shift+e", () => {
|
|
8
|
+
const shapes = new Map(ctx.store.getShapes());
|
|
9
|
+
exportCanvas(shapes, ctx.shapes, { format: "png" })
|
|
10
|
+
.then((blob) => downloadBlob(blob, "usketch-export.png"))
|
|
11
|
+
.catch((e) => console.error("PNG export failed:", e));
|
|
12
|
+
});
|
|
13
|
+
const unsub2 = ctx.shortcuts.register("ctrl+shift+alt+e", () => {
|
|
14
|
+
const shapes = new Map(ctx.store.getShapes());
|
|
15
|
+
exportCanvas(shapes, ctx.shapes, { format: "svg" })
|
|
16
|
+
.then((blob) => downloadBlob(blob, "usketch-export.svg"))
|
|
17
|
+
.catch((e) => console.error("SVG export failed:", e));
|
|
18
|
+
});
|
|
19
|
+
const unsub3 = ctx.shortcuts.register("ctrl+shift+j", () => {
|
|
20
|
+
const shapes = new Map(ctx.store.getShapes());
|
|
21
|
+
const blob = exportJson(shapes);
|
|
22
|
+
downloadBlob(blob, "usketch-export.json");
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
unsub1();
|
|
26
|
+
unsub2();
|
|
27
|
+
unsub3();
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
34
32
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,UAAU,kBAAkB;IACjC,OAAO;QACN,EAAE,EAAE,uBAAuB;QAC3B,IAAI,EAAE,QAAQ;QAEd,KAAK,CAAC,GAAkB;YACvB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;gBAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;gBAC9C,YAAY,CAAC,MAAM,EAAE,GAAG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C;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edv4h/usketch-plugin-export",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"satori": "0.26.0",
|
|
15
|
-
"@edv4h/usketch-core": "
|
|
16
|
-
"@edv4h/usketch-shared": "
|
|
15
|
+
"@edv4h/usketch-core": "2.0.0",
|
|
16
|
+
"@edv4h/usketch-shared": "3.0.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=19",
|