UNPKG

2.99 kBJavaScriptView Raw
1"use strict";
2var __assign = (this && this.__assign) || Object.assign || function(t) {
3 for (var s, i = 1, n = arguments.length; i < n; i++) {
4 s = arguments[i];
5 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6 t[p] = s[p];
7 }
8 return t;
9};
10Object.defineProperty(exports, "__esModule", { value: true });
11var createJson2SvgCLI_1 = require("kaavio/es5/createJson2SvgCLI");
12var path = require("path");
13var npmPackage = require("../package.json");
14// TODO: for the css below, I just want the CSS string,
15// but the .css -> .d.ts compiler doesn't specify a default export.
16// Importing as * as blah yields an object, not a string.
17// Both require and import + extract default work, but they look ugly.
18/*
19//import DiagramCustomStyle from "./DiagramCustomStyle.css";
20import * as DiagramCustomStyleModule from "./DiagramCustomStyle.css";
21const DiagramCustomStyle = DiagramCustomStyleModule["default"];
22//*/
23var theme = require("./themes/dark/theme");
24// TODO what is the best way to handle CSS when using tsc?
25// Compiling w/ webpack is really slow for the CLI.
26// how about using this: https://github.com/longlho/ts-transform-css-modules
27/*
28const DiagramCustomStylePlain = require("./themes/styles/Diagram.plain.css");
29const DiagramCustomStyleDark = require("./themes/styles/Diagram.dark.css");
30//*/
31//*
32var fs = require("fs");
33var DiagramCustomStylePlain = fs.readFileSync(path.resolve(__dirname, "./themes/styles/Diagram.plain.css"));
34var DiagramCustomStyleDark = fs.readFileSync(path.resolve(__dirname, "./themes/styles/Diagram.dark.css"));
35//*/
36createJson2SvgCLI_1.createJson2SvgCLI(npmPackage, [
37 {
38 name: "plain",
39 theme: __assign({ diagramStyle: DiagramCustomStylePlain }, theme)
40 },
41 {
42 name: "dark",
43 theme: __assign({ diagramStyle: DiagramCustomStyleDark }, theme)
44 }
45]);
46//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NsaS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs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