@sciencestack-ai/tokens 0.1.15 → 0.1.16
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/figures/BaseAssetTokenNode.d.ts +30 -0
- package/dist/figures/BaseAssetTokenNode.d.ts.map +1 -0
- package/dist/figures/BaseAssetTokenNode.js +45 -0
- package/dist/figures/BaseAssetTokenNode.js.map +1 -0
- package/dist/figures/DiagramTokenNode.d.ts +5 -15
- package/dist/figures/DiagramTokenNode.d.ts.map +1 -1
- package/dist/figures/DiagramTokenNode.js +8 -35
- package/dist/figures/DiagramTokenNode.js.map +1 -1
- package/dist/figures/IncludeGraphicsTokenNode.d.ts +5 -15
- package/dist/figures/IncludeGraphicsTokenNode.d.ts.map +1 -1
- package/dist/figures/IncludeGraphicsTokenNode.js +4 -30
- package/dist/figures/IncludeGraphicsTokenNode.js.map +1 -1
- package/dist/figures/IncludePdfTokenNode.d.ts +5 -13
- package/dist/figures/IncludePdfTokenNode.d.ts.map +1 -1
- package/dist/figures/IncludePdfTokenNode.js +4 -24
- package/dist/figures/IncludePdfTokenNode.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseTokenNode } from "../base/BaseTokenNode";
|
|
2
|
+
import { ITokenNodeFactory } from "../base/ITokenNodeFactory";
|
|
3
|
+
import { CopyContentOptions, JSONExportOptions, MarkdownExportOptions } from "../export_types";
|
|
4
|
+
import { BaseToken } from "../types";
|
|
5
|
+
interface AssetToken extends BaseToken {
|
|
6
|
+
path?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class BaseAssetTokenNode<T extends AssetToken = AssetToken> extends BaseTokenNode {
|
|
15
|
+
protected tokenFactory?: ITokenNodeFactory | undefined;
|
|
16
|
+
constructor(token: T, id?: string, tokenFactory?: ITokenNodeFactory | undefined);
|
|
17
|
+
get token(): T;
|
|
18
|
+
get width(): number;
|
|
19
|
+
get height(): number;
|
|
20
|
+
getPath(): string | undefined;
|
|
21
|
+
getError(): {
|
|
22
|
+
message: string;
|
|
23
|
+
type: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
getCopyContent(options?: CopyContentOptions): string;
|
|
26
|
+
getJSONContent(options?: JSONExportOptions): any;
|
|
27
|
+
getMarkdownContent(options?: MarkdownExportOptions): string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=BaseAssetTokenNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseAssetTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/BaseAssetTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,UAAU,UAAW,SAAQ,SAAS;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,8BAAsB,kBAAkB,CACtC,CAAC,SAAS,UAAU,GAAG,UAAU,CACjC,SAAQ,aAAa;IAInB,SAAS,CAAC,YAAY,CAAC,EAAE,iBAAiB;gBAF1C,KAAK,EAAE,CAAC,EACR,EAAE,CAAC,EAAE,MAAM,EACD,YAAY,CAAC,EAAE,iBAAiB,YAAA;IAK5C,IAAI,KAAK,IAAI,CAAC,CAEb;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO;IAIP,QAAQ;iBA9BW,MAAM;cAAQ,MAAM;;IAkCvC,cAAc,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;IAIpD,cAAc,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,GAAG;IAUhD,kBAAkB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM;CAQ5D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseTokenNode } from "../base/BaseTokenNode.js";
|
|
2
|
+
import { resolveAssetPath, } from "../export_types.js";
|
|
3
|
+
export class BaseAssetTokenNode extends BaseTokenNode {
|
|
4
|
+
tokenFactory;
|
|
5
|
+
constructor(token, id, tokenFactory) {
|
|
6
|
+
super(token, id, tokenFactory);
|
|
7
|
+
this.tokenFactory = tokenFactory;
|
|
8
|
+
}
|
|
9
|
+
get token() {
|
|
10
|
+
return this._token;
|
|
11
|
+
}
|
|
12
|
+
get width() {
|
|
13
|
+
return this.token.width ?? 0;
|
|
14
|
+
}
|
|
15
|
+
get height() {
|
|
16
|
+
return this.token.height ?? 0;
|
|
17
|
+
}
|
|
18
|
+
getPath() {
|
|
19
|
+
return this.token.path;
|
|
20
|
+
}
|
|
21
|
+
getError() {
|
|
22
|
+
return this.token.error;
|
|
23
|
+
}
|
|
24
|
+
getCopyContent(options) {
|
|
25
|
+
return this.getPath() ?? "";
|
|
26
|
+
}
|
|
27
|
+
getJSONContent(options) {
|
|
28
|
+
const output = super.getJSONContent(options);
|
|
29
|
+
const path = this.getPath();
|
|
30
|
+
if (path) {
|
|
31
|
+
const resolvedPath = resolveAssetPath(path, options);
|
|
32
|
+
output.path = resolvedPath;
|
|
33
|
+
}
|
|
34
|
+
return output;
|
|
35
|
+
}
|
|
36
|
+
getMarkdownContent(options) {
|
|
37
|
+
const path = this.getPath();
|
|
38
|
+
if (!path) {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
const resolvedPath = resolveAssetPath(path, options);
|
|
42
|
+
return ``;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=BaseAssetTokenNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseAssetTokenNode.js","sourceRoot":"","sources":["../../src/figures/BaseAssetTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAIL,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,OAAgB,kBAEpB,SAAQ,aAAa;IAIT;IAHZ,YACE,KAAQ,EACR,EAAW,EACD,YAAgC;QAE1C,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAFrB,iBAAY,GAAZ,YAAY,CAAoB;IAG5C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAW,CAAC;IAC1B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,cAAc,CAAC,OAA4B;QACzC,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED,cAAc,CAAC,OAA2B;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACrD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;QAC7B,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,kBAAkB,CAAC,OAA+B;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,QAAQ,YAAY,GAAG,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { DiagramToken } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class DiagramTokenNode extends
|
|
1
|
+
import { DiagramToken } from "../types";
|
|
2
|
+
import { ITokenNodeFactory } from "../base/ITokenNodeFactory";
|
|
3
|
+
import { LatexExportOptions } from "../export_types";
|
|
4
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode";
|
|
5
|
+
export declare class DiagramTokenNode extends BaseAssetTokenNode<DiagramToken> {
|
|
6
6
|
protected tokenFactory?: ITokenNodeFactory | undefined;
|
|
7
7
|
constructor(token: DiagramToken, id?: string, tokenFactory?: ITokenNodeFactory | undefined);
|
|
8
|
-
get token(): DiagramToken;
|
|
9
|
-
get width(): number;
|
|
10
|
-
get height(): number;
|
|
11
8
|
get name(): string;
|
|
12
|
-
getError(): {
|
|
13
|
-
message: string;
|
|
14
|
-
type: import("..").GraphicsErrorType;
|
|
15
|
-
} | undefined;
|
|
16
9
|
getCode(): string;
|
|
17
|
-
getPath(): string | undefined;
|
|
18
|
-
getCopyContent(options?: CopyContentOptions): string;
|
|
19
10
|
getLatexContent(options?: LatexExportOptions): string;
|
|
20
|
-
getMarkdownContent(options?: MarkdownExportOptions): string;
|
|
21
11
|
}
|
|
22
12
|
//# sourceMappingURL=DiagramTokenNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/DiagramTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DiagramTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/DiagramTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,gBAAiB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IAIlE,SAAS,CAAC,YAAY,CAAC,EAAE,iBAAiB;gBAF1C,KAAK,EAAE,YAAY,EACnB,EAAE,CAAC,EAAE,MAAM,EACD,YAAY,CAAC,EAAE,iBAAiB,YAAA;IAK5C,IAAI,IAAI,WAEP;IAED,OAAO;IAKP,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAkBtD"}
|
|
@@ -1,48 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class DiagramTokenNode extends
|
|
1
|
+
import { resolveAssetPath } from "../export_types.js";
|
|
2
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode.js";
|
|
3
|
+
export class DiagramTokenNode extends BaseAssetTokenNode {
|
|
4
4
|
tokenFactory;
|
|
5
5
|
constructor(token, id, tokenFactory) {
|
|
6
6
|
super(token, id, tokenFactory);
|
|
7
7
|
this.tokenFactory = tokenFactory;
|
|
8
8
|
}
|
|
9
|
-
get token() {
|
|
10
|
-
return this._token;
|
|
11
|
-
}
|
|
12
|
-
get width() {
|
|
13
|
-
return this.token.width ?? 0;
|
|
14
|
-
}
|
|
15
|
-
get height() {
|
|
16
|
-
return this.token.height ?? 0;
|
|
17
|
-
}
|
|
18
9
|
get name() {
|
|
19
10
|
return this.token.name; // tikzpicture, picture, etc.
|
|
20
11
|
}
|
|
21
|
-
getError() {
|
|
22
|
-
return this.token.error;
|
|
23
|
-
}
|
|
24
12
|
getCode() {
|
|
25
13
|
// e.g. \begin{tikzpicture} ... \end{tikzpicture}
|
|
26
14
|
return this.token.content;
|
|
27
15
|
}
|
|
28
|
-
getPath() {
|
|
29
|
-
// svg path or image path
|
|
30
|
-
return this.token.path;
|
|
31
|
-
}
|
|
32
|
-
getCopyContent(options) {
|
|
33
|
-
return this.getPath() ?? '';
|
|
34
|
-
}
|
|
35
16
|
getLatexContent(options) {
|
|
36
|
-
let comment =
|
|
17
|
+
let comment = "";
|
|
37
18
|
const path = this.getPath();
|
|
38
19
|
if (!path) {
|
|
39
|
-
return
|
|
20
|
+
return "";
|
|
40
21
|
}
|
|
41
22
|
const resolvedPath = resolveAssetPath(path, options);
|
|
42
|
-
comment =
|
|
23
|
+
comment = "\n% Alternatively use path: \n% ";
|
|
43
24
|
// Check if the file is an SVG and use appropriate command
|
|
44
|
-
if (resolvedPath.toLowerCase().endsWith(
|
|
45
|
-
const pathWithoutExt = resolvedPath.replace(/\.svg$/i,
|
|
25
|
+
if (resolvedPath.toLowerCase().endsWith(".svg")) {
|
|
26
|
+
const pathWithoutExt = resolvedPath.replace(/\.svg$/i, "");
|
|
46
27
|
comment += `\\includesvg{${pathWithoutExt}}\n`;
|
|
47
28
|
}
|
|
48
29
|
else {
|
|
@@ -50,13 +31,5 @@ export class DiagramTokenNode extends BaseTokenNode {
|
|
|
50
31
|
}
|
|
51
32
|
return comment + this.getCode();
|
|
52
33
|
}
|
|
53
|
-
getMarkdownContent(options) {
|
|
54
|
-
const path = this.getPath();
|
|
55
|
-
if (!path) {
|
|
56
|
-
return '';
|
|
57
|
-
}
|
|
58
|
-
const resolvedPath = resolveAssetPath(path, options);
|
|
59
|
-
return ``;
|
|
60
|
-
}
|
|
61
34
|
}
|
|
62
35
|
//# sourceMappingURL=DiagramTokenNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramTokenNode.js","sourceRoot":"","sources":["../../src/figures/DiagramTokenNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagramTokenNode.js","sourceRoot":"","sources":["../../src/figures/DiagramTokenNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,gBAAiB,SAAQ,kBAAgC;IAIxD;IAHZ,YACE,KAAmB,EACnB,EAAW,EACD,YAAgC;QAE1C,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAFrB,iBAAY,GAAZ,YAAY,CAAoB;IAG5C,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,6BAA6B;IACvD,CAAC;IAED,OAAO;QACL,iDAAiD;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC;IAED,eAAe,CAAC,OAA4B;QAC1C,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,GAAG,kCAAkC,CAAC;QAE7C,0DAA0D;QAC1D,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC3D,OAAO,IAAI,gBAAgB,cAAc,KAAK,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,qBAAqB,YAAY,KAAK,CAAC;QACpD,CAAC;QACD,OAAO,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import { IncludeGraphicsToken } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class IncludeGraphicsTokenNode extends
|
|
1
|
+
import { IncludeGraphicsToken } from "../types";
|
|
2
|
+
import { ITokenNodeFactory } from "../base/ITokenNodeFactory";
|
|
3
|
+
import { LatexExportOptions } from "../export_types";
|
|
4
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode";
|
|
5
|
+
export declare class IncludeGraphicsTokenNode extends BaseAssetTokenNode<IncludeGraphicsToken> {
|
|
6
6
|
protected tokenFactory?: ITokenNodeFactory | undefined;
|
|
7
7
|
constructor(token: IncludeGraphicsToken, id?: string, tokenFactory?: ITokenNodeFactory | undefined);
|
|
8
|
-
get token(): IncludeGraphicsToken;
|
|
9
|
-
get width(): number;
|
|
10
|
-
get height(): number;
|
|
11
|
-
getPath(): string | undefined;
|
|
12
|
-
getError(): {
|
|
13
|
-
message: string;
|
|
14
|
-
type: import("..").GraphicsErrorType;
|
|
15
|
-
} | undefined;
|
|
16
|
-
getCopyContent(options?: CopyContentOptions): string;
|
|
17
8
|
getLatexContent(options?: LatexExportOptions): string;
|
|
18
|
-
getMarkdownContent(options?: MarkdownExportOptions): string;
|
|
19
9
|
}
|
|
20
10
|
//# sourceMappingURL=IncludeGraphicsTokenNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncludeGraphicsTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/IncludeGraphicsTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"IncludeGraphicsTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/IncludeGraphicsTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,wBAAyB,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC;IAIlF,SAAS,CAAC,YAAY,CAAC,EAAE,iBAAiB;gBAF1C,KAAK,EAAE,oBAAoB,EAC3B,EAAE,CAAC,EAAE,MAAM,EACD,YAAY,CAAC,EAAE,iBAAiB,YAAA;IAK5C,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAQtD"}
|
|
@@ -1,44 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class IncludeGraphicsTokenNode extends
|
|
1
|
+
import { resolveAssetPath } from "../export_types.js";
|
|
2
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode.js";
|
|
3
|
+
export class IncludeGraphicsTokenNode extends BaseAssetTokenNode {
|
|
4
4
|
tokenFactory;
|
|
5
5
|
constructor(token, id, tokenFactory) {
|
|
6
6
|
super(token, id, tokenFactory);
|
|
7
7
|
this.tokenFactory = tokenFactory;
|
|
8
8
|
}
|
|
9
|
-
get token() {
|
|
10
|
-
return this._token;
|
|
11
|
-
}
|
|
12
|
-
get width() {
|
|
13
|
-
return this.token.width ?? 0;
|
|
14
|
-
}
|
|
15
|
-
get height() {
|
|
16
|
-
return this.token.height ?? 0;
|
|
17
|
-
}
|
|
18
|
-
getPath() {
|
|
19
|
-
return this.token.path;
|
|
20
|
-
}
|
|
21
|
-
getError() {
|
|
22
|
-
return this.token.error;
|
|
23
|
-
}
|
|
24
|
-
getCopyContent(options) {
|
|
25
|
-
return this.getPath() ?? '';
|
|
26
|
-
}
|
|
27
9
|
getLatexContent(options) {
|
|
28
10
|
const path = this.getPath();
|
|
29
11
|
if (!path) {
|
|
30
|
-
return
|
|
12
|
+
return "";
|
|
31
13
|
}
|
|
32
14
|
const resolvedPath = resolveAssetPath(path, options);
|
|
33
15
|
return `\\includegraphics{${resolvedPath}}`;
|
|
34
16
|
}
|
|
35
|
-
getMarkdownContent(options) {
|
|
36
|
-
const path = this.getPath();
|
|
37
|
-
if (!path) {
|
|
38
|
-
return '';
|
|
39
|
-
}
|
|
40
|
-
const resolvedPath = resolveAssetPath(path, options);
|
|
41
|
-
return ``;
|
|
42
|
-
}
|
|
43
17
|
}
|
|
44
18
|
//# sourceMappingURL=IncludeGraphicsTokenNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncludeGraphicsTokenNode.js","sourceRoot":"","sources":["../../src/figures/IncludeGraphicsTokenNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IncludeGraphicsTokenNode.js","sourceRoot":"","sources":["../../src/figures/IncludeGraphicsTokenNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,wBAAyB,SAAQ,kBAAwC;IAIxE;IAHZ,YACE,KAA2B,EAC3B,EAAW,EACD,YAAgC;QAE1C,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAFrB,iBAAY,GAAZ,YAAY,CAAoB;IAG5C,CAAC;IAED,eAAe,CAAC,OAA4B;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,qBAAqB,YAAY,GAAG,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { IncludePdfToken } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare class IncludePdfTokenNode extends
|
|
1
|
+
import { IncludePdfToken } from "../types";
|
|
2
|
+
import { ITokenNodeFactory } from "../base/ITokenNodeFactory";
|
|
3
|
+
import { LatexExportOptions } from "../export_types";
|
|
4
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode";
|
|
5
|
+
export declare class IncludePdfTokenNode extends BaseAssetTokenNode<IncludePdfToken> {
|
|
6
6
|
protected tokenFactory?: ITokenNodeFactory | undefined;
|
|
7
7
|
constructor(token: IncludePdfToken, id?: string, tokenFactory?: ITokenNodeFactory | undefined);
|
|
8
|
-
get token(): IncludePdfToken;
|
|
9
|
-
getPath(): string | undefined;
|
|
10
|
-
getError(): {
|
|
11
|
-
message: string;
|
|
12
|
-
type: import("..").GraphicsErrorType;
|
|
13
|
-
} | undefined;
|
|
14
|
-
getCopyContent(options?: CopyContentOptions): string;
|
|
15
8
|
getLatexContent(options?: LatexExportOptions): string;
|
|
16
|
-
getMarkdownContent(options?: MarkdownExportOptions): string;
|
|
17
9
|
}
|
|
18
10
|
//# sourceMappingURL=IncludePdfTokenNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncludePdfTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/IncludePdfTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"IncludePdfTokenNode.d.ts","sourceRoot":"","sources":["../../src/figures/IncludePdfTokenNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,eAAe,CAAC;IAIxE,SAAS,CAAC,YAAY,CAAC,EAAE,iBAAiB;gBAF1C,KAAK,EAAE,eAAe,EACtB,EAAE,CAAC,EAAE,MAAM,EACD,YAAY,CAAC,EAAE,iBAAiB,YAAA;IAK5C,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAQtD"}
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class IncludePdfTokenNode extends
|
|
1
|
+
import { resolveAssetPath } from "../export_types.js";
|
|
2
|
+
import { BaseAssetTokenNode } from "./BaseAssetTokenNode.js";
|
|
3
|
+
export class IncludePdfTokenNode extends BaseAssetTokenNode {
|
|
4
4
|
tokenFactory;
|
|
5
5
|
constructor(token, id, tokenFactory) {
|
|
6
6
|
super(token, id, tokenFactory);
|
|
7
7
|
this.tokenFactory = tokenFactory;
|
|
8
8
|
}
|
|
9
|
-
get token() {
|
|
10
|
-
return this._token;
|
|
11
|
-
}
|
|
12
|
-
getPath() {
|
|
13
|
-
return this.token.path;
|
|
14
|
-
}
|
|
15
|
-
getError() {
|
|
16
|
-
return this.token.error;
|
|
17
|
-
}
|
|
18
|
-
getCopyContent(options) {
|
|
19
|
-
return this.getPath() ?? '';
|
|
20
|
-
}
|
|
21
9
|
getLatexContent(options) {
|
|
22
10
|
const path = this.getPath();
|
|
23
11
|
if (!path) {
|
|
24
|
-
return
|
|
12
|
+
return "";
|
|
25
13
|
}
|
|
26
14
|
const resolvedPath = resolveAssetPath(path, options);
|
|
27
15
|
return `\\includepdf{${resolvedPath}}`;
|
|
28
16
|
}
|
|
29
|
-
getMarkdownContent(options) {
|
|
30
|
-
const path = this.getPath();
|
|
31
|
-
if (!path) {
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
const resolvedPath = resolveAssetPath(path, options);
|
|
35
|
-
return ``;
|
|
36
|
-
}
|
|
37
17
|
}
|
|
38
18
|
//# sourceMappingURL=IncludePdfTokenNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncludePdfTokenNode.js","sourceRoot":"","sources":["../../src/figures/IncludePdfTokenNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IncludePdfTokenNode.js","sourceRoot":"","sources":["../../src/figures/IncludePdfTokenNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,mBAAoB,SAAQ,kBAAmC;IAI9D;IAHZ,YACE,KAAsB,EACtB,EAAW,EACD,YAAgC;QAE1C,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;QAFrB,iBAAY,GAAZ,YAAY,CAAoB;IAG5C,CAAC;IAED,eAAe,CAAC,OAA4B;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,gBAAgB,YAAY,GAAG,CAAC;IACzC,CAAC;CACF"}
|