@node-projects/web-component-designer-zpl 0.1.13 → 0.1.15
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addZplLanguageToMonaco(monaco: any): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function addZplLanguageToMonaco(monaco) {
|
|
2
|
+
//@ts-ignore
|
|
3
|
+
monaco.languages.register({ id: "zplLanguage" });
|
|
4
|
+
//@ts-ignore
|
|
5
|
+
monaco.languages.setMonarchTokensProvider("zplLanguage", {
|
|
6
|
+
tokenizer: {
|
|
7
|
+
root: [
|
|
8
|
+
// lookbehind seems not to work - [/(?<=\^FD)[^\^]*/, "text"],
|
|
9
|
+
[/\^FX[^\^]*/, "comment"],
|
|
10
|
+
[/\^FD[^\^]*/, "text"],
|
|
11
|
+
[/\^../, "command"],
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
monaco.editor.defineTheme("zplTheme", {
|
|
17
|
+
base: "vs",
|
|
18
|
+
inherit: false,
|
|
19
|
+
rules: [
|
|
20
|
+
{ token: "text", foreground: "999999" },
|
|
21
|
+
{ token: "comment", foreground: "008000" },
|
|
22
|
+
{ token: "command", foreground: "0000FF", fontStyle: "bold" },
|
|
23
|
+
],
|
|
24
|
+
colors: {
|
|
25
|
+
"editor.foreground": "#000000",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./widgets/zpl-graphic-circle.js";
|
|
|
4
4
|
export * from "./widgets/zpl-graphic-diagonal-line.js";
|
|
5
5
|
export * from "./widgets/zpl-image.js";
|
|
6
6
|
export * from "./widgets/zpl-text.js";
|
|
7
|
+
export * from "./monaco/ZplLanguage.js";
|
|
7
8
|
export * from "./extensions/ZplLayoutResizeExtensionProvider.js";
|
|
8
9
|
export * from "./services/ZplImageDrop.js";
|
|
9
10
|
export * from "./services/ZplLayoutCopyPasteService.js";
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./widgets/zpl-graphic-circle.js";
|
|
|
4
4
|
export * from "./widgets/zpl-graphic-diagonal-line.js";
|
|
5
5
|
export * from "./widgets/zpl-image.js";
|
|
6
6
|
export * from "./widgets/zpl-text.js";
|
|
7
|
+
export * from "./monaco/ZplLanguage.js";
|
|
7
8
|
export * from "./extensions/ZplLayoutResizeExtensionProvider.js";
|
|
8
9
|
export * from "./services/ZplImageDrop.js";
|
|
9
10
|
export * from "./services/ZplLayoutCopyPasteService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addZplLanguageToMonaco(monaco?: any): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function addZplLanguageToMonaco(monaco) {
|
|
2
|
+
if (!monaco)
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
monaco = window.monaco;
|
|
5
|
+
//@ts-ignore
|
|
6
|
+
monaco.languages.register({ id: "zplLanguage" });
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
monaco.languages.setMonarchTokensProvider("zplLanguage", {
|
|
9
|
+
tokenizer: {
|
|
10
|
+
root: [
|
|
11
|
+
// lookbehind seems not to work - [/(?<=\^FD)[^\^]*/, "text"],
|
|
12
|
+
[/\^FX[^\^]*/, "comment"],
|
|
13
|
+
[/\^FD[^\^]*/, "text"],
|
|
14
|
+
[/\^../, "command"],
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//@ts-ignore
|
|
19
|
+
monaco.editor.defineTheme("zplTheme", {
|
|
20
|
+
base: "vs",
|
|
21
|
+
inherit: false,
|
|
22
|
+
rules: [
|
|
23
|
+
{ token: "text", foreground: "999999" },
|
|
24
|
+
{ token: "comment", foreground: "008000" },
|
|
25
|
+
{ token: "command", foreground: "0000FF", fontStyle: "bold" },
|
|
26
|
+
],
|
|
27
|
+
colors: {
|
|
28
|
+
"editor.foreground": "#000000",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "web-component-designer addon: Widgets and Services for creating a ZPL Designer",
|
|
3
3
|
"name": "@node-projects/web-component-designer-zpl",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "jochen.kuehner@gmx.de",
|