@cozeloop/prompt-components 0.0.1 → 0.0.2
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/edenx.config.d.ts +2 -0
- package/dist/{es/basic-editor/extensions/go-syntax.js → go-syntax-067c4f5d.mjs} +16 -9
- package/dist/go-syntax-4deb0289.js +8 -0
- package/dist/{es/basic-editor/extensions/go-theme.js → go-theme-062a6df6.mjs} +3 -4
- package/dist/go-theme-fbd8a4fa.js +1 -0
- package/dist/index.cjs +61 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2788 -0
- package/dist/{types → src}/basic-editor/custom-facet.d.ts +2 -1
- package/dist/src/basic-editor/diff.d.ts +16 -0
- package/dist/src/basic-editor/extensions/go-syntax.d.ts +71 -0
- package/dist/src/basic-editor/extensions/go-template.d.ts +1 -0
- package/dist/{types → src}/basic-editor/extensions/go-theme.d.ts +1 -1
- package/dist/src/basic-editor/extensions/jinja.d.ts +4 -0
- package/dist/{types → src}/basic-editor/extensions/keymap.d.ts +3 -2
- package/dist/src/basic-editor/extensions/language-support.d.ts +2 -0
- package/dist/src/basic-editor/extensions/markdown.d.ts +2 -0
- package/dist/src/basic-editor/extensions/search/dom/icon.d.ts +59 -0
- package/dist/src/basic-editor/extensions/search/dom/match-count.d.ts +14 -0
- package/dist/src/basic-editor/extensions/search/index.d.ts +1 -0
- package/dist/src/basic-editor/extensions/search/panel.d.ts +33 -0
- package/dist/src/basic-editor/extensions/search/theme.d.ts +1 -0
- package/dist/src/basic-editor/extensions/validation.d.ts +8 -0
- package/dist/src/basic-editor/extensions/variable.d.ts +11 -0
- package/dist/src/basic-editor/index.d.ts +29 -0
- package/dist/{types → src}/code-editor/index.d.ts +1 -1
- package/dist/src/code-editor/json-editor.d.ts +18 -0
- package/dist/src/code-editor/raw-text-editor.d.ts +11 -0
- package/dist/{types → src}/consts/index.d.ts +1 -1
- package/dist/src/dev-layout/index.d.ts +7 -0
- package/dist/{types → src}/index.d.ts +7 -7
- package/dist/src/mermaid-diagram/index.d.ts +12 -0
- package/dist/src/mermaid-diagram/use-svg-pan-zoom.d.ts +12 -0
- package/dist/{types → src}/mermaid-diagram/utils.d.ts +1 -1
- package/dist/src/model-config-editor/basic-type.d.ts +13 -0
- package/dist/src/model-config-editor/model-config-form.d.ts +13 -0
- package/dist/src/model-config-editor/popover-type.d.ts +19 -0
- package/dist/src/model-select/index.d.ts +27 -0
- package/dist/src/model-select/model-option/index.d.ts +25 -0
- package/dist/src/model-select/model-option-group/index.d.ts +16 -0
- package/dist/src/prompt-editor/index.d.ts +31 -0
- package/dist/src/prompt-editor/message-type-select.d.ts +11 -0
- package/dist/src/schema-editor/index.d.ts +11 -0
- package/dist/{types → src}/utils/base.d.ts +5 -4
- package/dist/src/utils/model-config.d.ts +5 -0
- package/dist/style.css +1 -0
- package/dist/test-build.d.ts +7 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +15 -5
- package/dist/es/basic-editor/custom-facet.js +0 -9
- package/dist/es/basic-editor/diff.js +0 -138
- package/dist/es/basic-editor/extensions/go-template.js +0 -16
- package/dist/es/basic-editor/extensions/jinja.js +0 -80
- package/dist/es/basic-editor/extensions/keymap.js +0 -442
- package/dist/es/basic-editor/extensions/language-support.js +0 -12
- package/dist/es/basic-editor/extensions/markdown.js +0 -58
- package/dist/es/basic-editor/extensions/search/dom/icon.js +0 -250
- package/dist/es/basic-editor/extensions/search/dom/match-count.js +0 -33
- package/dist/es/basic-editor/extensions/search/index.js +0 -18
- package/dist/es/basic-editor/extensions/search/panel.js +0 -418
- package/dist/es/basic-editor/extensions/search/theme.js +0 -184
- package/dist/es/basic-editor/extensions/validation.js +0 -84
- package/dist/es/basic-editor/extensions/validation.module.js +0 -5
- package/dist/es/basic-editor/extensions/validation_module.css +0 -7
- package/dist/es/basic-editor/extensions/variable.js +0 -178
- package/dist/es/basic-editor/index.js +0 -171
- package/dist/es/code-editor/code-editor.js +0 -83
- package/dist/es/code-editor/index.js +0 -12
- package/dist/es/code-editor/json-editor.js +0 -157
- package/dist/es/code-editor/raw-text-editor.js +0 -46
- package/dist/es/code-editor/text-editor.js +0 -41
- package/dist/es/code-editor/themes/coze-dark.js +0 -112
- package/dist/es/code-editor/themes/coze-light.js +0 -118
- package/dist/es/consts/index.js +0 -12
- package/dist/es/dev-layout/index.js +0 -35
- package/dist/es/index.js +0 -66
- package/dist/es/mermaid-diagram/index.js +0 -148
- package/dist/es/mermaid-diagram/index.module.js +0 -5
- package/dist/es/mermaid-diagram/index_module.css +0 -4
- package/dist/es/mermaid-diagram/use-svg-pan-zoom.js +0 -49
- package/dist/es/mermaid-diagram/utils.js +0 -74
- package/dist/es/model-config-editor/basic-type.js +0 -73
- package/dist/es/model-config-editor/index.module.js +0 -5
- package/dist/es/model-config-editor/index_module.css +0 -8
- package/dist/es/model-config-editor/model-config-form.js +0 -130
- package/dist/es/model-config-editor/popover-type.js +0 -118
- package/dist/es/model-select/index.js +0 -136
- package/dist/es/model-select/index.module.js +0 -5
- package/dist/es/model-select/index_module.css +0 -14
- package/dist/es/model-select/model-option/index.js +0 -161
- package/dist/es/model-select/model-option/index.module.js +0 -5
- package/dist/es/model-select/model-option/index_module.css +0 -23
- package/dist/es/model-select/model-option-group/index.js +0 -44
- package/dist/es/prompt-editor/index.js +0 -188
- package/dist/es/prompt-editor/index.module.js +0 -5
- package/dist/es/prompt-editor/index_module.css +0 -71
- package/dist/es/prompt-editor/message-type-select.js +0 -74
- package/dist/es/schema-editor/index.js +0 -43
- package/dist/es/utils/base.js +0 -53
- package/dist/es/utils/model-config.js +0 -32
- package/dist/lib/basic-editor/custom-facet.js +0 -33
- package/dist/lib/basic-editor/diff.js +0 -167
- package/dist/lib/basic-editor/extensions/go-syntax.js +0 -146
- package/dist/lib/basic-editor/extensions/go-template.js +0 -50
- package/dist/lib/basic-editor/extensions/go-theme.js +0 -1091
- package/dist/lib/basic-editor/extensions/jinja.js +0 -100
- package/dist/lib/basic-editor/extensions/keymap.js +0 -465
- package/dist/lib/basic-editor/extensions/language-support.js +0 -32
- package/dist/lib/basic-editor/extensions/markdown.js +0 -78
- package/dist/lib/basic-editor/extensions/search/dom/icon.js +0 -291
- package/dist/lib/basic-editor/extensions/search/dom/match-count.js +0 -67
- package/dist/lib/basic-editor/extensions/search/index.js +0 -38
- package/dist/lib/basic-editor/extensions/search/panel.js +0 -429
- package/dist/lib/basic-editor/extensions/search/theme.js +0 -208
- package/dist/lib/basic-editor/extensions/validation.js +0 -118
- package/dist/lib/basic-editor/extensions/validation.module.js +0 -25
- package/dist/lib/basic-editor/extensions/validation_module.css +0 -7
- package/dist/lib/basic-editor/extensions/variable.js +0 -190
- package/dist/lib/basic-editor/index.js +0 -193
- package/dist/lib/code-editor/code-editor.js +0 -117
- package/dist/lib/code-editor/index.js +0 -40
- package/dist/lib/code-editor/json-editor.js +0 -184
- package/dist/lib/code-editor/raw-text-editor.js +0 -70
- package/dist/lib/code-editor/text-editor.js +0 -75
- package/dist/lib/code-editor/themes/coze-dark.js +0 -136
- package/dist/lib/code-editor/themes/coze-light.js +0 -142
- package/dist/lib/consts/index.js +0 -38
- package/dist/lib/dev-layout/index.js +0 -69
- package/dist/lib/index.js +0 -110
- package/dist/lib/mermaid-diagram/index.js +0 -174
- package/dist/lib/mermaid-diagram/index.module.js +0 -25
- package/dist/lib/mermaid-diagram/index_module.css +0 -4
- package/dist/lib/mermaid-diagram/use-svg-pan-zoom.js +0 -83
- package/dist/lib/mermaid-diagram/utils.js +0 -98
- package/dist/lib/model-config-editor/basic-type.js +0 -105
- package/dist/lib/model-config-editor/index.module.js +0 -25
- package/dist/lib/model-config-editor/index_module.css +0 -8
- package/dist/lib/model-config-editor/model-config-form.js +0 -149
- package/dist/lib/model-config-editor/popover-type.js +0 -145
- package/dist/lib/model-select/index.js +0 -170
- package/dist/lib/model-select/index.module.js +0 -25
- package/dist/lib/model-select/index_module.css +0 -14
- package/dist/lib/model-select/model-option/index.js +0 -188
- package/dist/lib/model-select/model-option/index.module.js +0 -25
- package/dist/lib/model-select/model-option/index_module.css +0 -23
- package/dist/lib/model-select/model-option-group/index.js +0 -75
- package/dist/lib/prompt-editor/index.js +0 -218
- package/dist/lib/prompt-editor/index.module.js +0 -25
- package/dist/lib/prompt-editor/index_module.css +0 -71
- package/dist/lib/prompt-editor/message-type-select.js +0 -108
- package/dist/lib/schema-editor/index.js +0 -77
- package/dist/lib/utils/base.js +0 -82
- package/dist/lib/utils/model-config.js +0 -57
- package/dist/types/basic-editor/diff.d.ts +0 -15
- package/dist/types/basic-editor/extensions/go-syntax.d.ts +0 -71
- package/dist/types/basic-editor/extensions/go-template.d.ts +0 -1
- package/dist/types/basic-editor/extensions/jinja.d.ts +0 -6
- package/dist/types/basic-editor/extensions/language-support.d.ts +0 -2
- package/dist/types/basic-editor/extensions/markdown.d.ts +0 -2
- package/dist/types/basic-editor/extensions/search/dom/icon.d.ts +0 -59
- package/dist/types/basic-editor/extensions/search/dom/match-count.d.ts +0 -14
- package/dist/types/basic-editor/extensions/search/index.d.ts +0 -1
- package/dist/types/basic-editor/extensions/search/panel.d.ts +0 -32
- package/dist/types/basic-editor/extensions/search/theme.d.ts +0 -1
- package/dist/types/basic-editor/extensions/validation.d.ts +0 -10
- package/dist/types/basic-editor/extensions/variable.d.ts +0 -14
- package/dist/types/basic-editor/index.d.ts +0 -28
- package/dist/types/code-editor/code-editor.d.ts +0 -23
- package/dist/types/code-editor/json-editor.d.ts +0 -17
- package/dist/types/code-editor/raw-text-editor.d.ts +0 -11
- package/dist/types/code-editor/text-editor.d.ts +0 -23
- package/dist/types/code-editor/themes/coze-dark.d.ts +0 -1
- package/dist/types/code-editor/themes/coze-light.d.ts +0 -1
- package/dist/types/dev-layout/index.d.ts +0 -13
- package/dist/types/mermaid-diagram/index.d.ts +0 -12
- package/dist/types/mermaid-diagram/use-svg-pan-zoom.d.ts +0 -17
- package/dist/types/model-config-editor/basic-type.d.ts +0 -19
- package/dist/types/model-config-editor/model-config-form.d.ts +0 -14
- package/dist/types/model-config-editor/popover-type.d.ts +0 -25
- package/dist/types/model-select/index.d.ts +0 -38
- package/dist/types/model-select/model-option/index.d.ts +0 -30
- package/dist/types/model-select/model-option-group/index.d.ts +0 -15
- package/dist/types/prompt-editor/index.d.ts +0 -30
- package/dist/types/prompt-editor/message-type-select.d.ts +0 -16
- package/dist/types/schema-editor/index.d.ts +0 -18
- package/dist/types/utils/model-config.d.ts +0 -4
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var diff_exports = {};
|
|
30
|
-
__export(diff_exports, {
|
|
31
|
-
PromptDiffEditor: () => PromptDiffEditor
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(diff_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var import_react2 = require("@coze-editor/editor/react");
|
|
37
|
-
var import_preset_prompt = __toESM(require("@coze-editor/editor/preset-prompt"));
|
|
38
|
-
var import_view = require("@codemirror/view");
|
|
39
|
-
var import_markdown = __toESM(require("./extensions/markdown"));
|
|
40
|
-
var import_language_support = __toESM(require("./extensions/language-support"));
|
|
41
|
-
var import_jinja = __toESM(require("./extensions/jinja"));
|
|
42
|
-
var import_custom_facet = require("./custom-facet");
|
|
43
|
-
const extensions = [
|
|
44
|
-
// diff theme
|
|
45
|
-
import_view.EditorView.theme({
|
|
46
|
-
"&.cm-merge-b .cm-changedLine": {
|
|
47
|
-
background: "transparent !important"
|
|
48
|
-
},
|
|
49
|
-
"&.cm-merge-b .cm-line": {
|
|
50
|
-
paddingLeft: "12px !important"
|
|
51
|
-
},
|
|
52
|
-
"&.cm-merge-b .cm-changedText": {
|
|
53
|
-
background: "rgba(34,184,24,0.3)"
|
|
54
|
-
},
|
|
55
|
-
"&.cm-merge-a .cm-changedText, .cm-deletedChunk .cm-deletedText": {
|
|
56
|
-
background: "rgba(238,68,51,0.3)"
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
];
|
|
60
|
-
const PromptDiffEditor = (0, import_react.forwardRef)(
|
|
61
|
-
({
|
|
62
|
-
oldValue,
|
|
63
|
-
newValue,
|
|
64
|
-
autoScrollToBottom,
|
|
65
|
-
children,
|
|
66
|
-
editorAble,
|
|
67
|
-
onChange
|
|
68
|
-
}, ref) => {
|
|
69
|
-
const editorRef = (0, import_react.useRef)(null);
|
|
70
|
-
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
71
|
-
goToPreviousChunk: () => {
|
|
72
|
-
var _a;
|
|
73
|
-
const view = (_a = editorRef.current) == null ? void 0 : _a.$view;
|
|
74
|
-
if (!view) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
(0, import_react2.goToPreviousChunk)(view);
|
|
78
|
-
},
|
|
79
|
-
goToNextChunk: () => {
|
|
80
|
-
var _a;
|
|
81
|
-
const view = (_a = editorRef.current) == null ? void 0 : _a.$view;
|
|
82
|
-
if (!view) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
(0, import_react2.goToNextChunk)(view);
|
|
86
|
-
}
|
|
87
|
-
}));
|
|
88
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react2.EditorProvider, { children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
-
import_react2.MergeViewRenderer,
|
|
91
|
-
{
|
|
92
|
-
plugins: import_preset_prompt.default,
|
|
93
|
-
domProps: {
|
|
94
|
-
style: {
|
|
95
|
-
flex: 1,
|
|
96
|
-
fontSize: 12,
|
|
97
|
-
width: "100%"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
mergeConfig: {
|
|
101
|
-
gutter: true,
|
|
102
|
-
collapseUnchanged: {
|
|
103
|
-
margin: 3,
|
|
104
|
-
minSize: 4
|
|
105
|
-
},
|
|
106
|
-
diffConfig: {
|
|
107
|
-
scanLimit: 3e3
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
a: {
|
|
111
|
-
defaultValue: oldValue,
|
|
112
|
-
extensions: [
|
|
113
|
-
...extensions,
|
|
114
|
-
import_custom_facet.cunstomFacet.of({
|
|
115
|
-
id: "a",
|
|
116
|
-
oldValue,
|
|
117
|
-
newValue
|
|
118
|
-
})
|
|
119
|
-
],
|
|
120
|
-
options: {
|
|
121
|
-
editable: false,
|
|
122
|
-
readOnly: true
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
b: {
|
|
126
|
-
defaultValue: newValue,
|
|
127
|
-
extensions: [
|
|
128
|
-
...extensions,
|
|
129
|
-
import_custom_facet.cunstomFacet.of({
|
|
130
|
-
id: "b",
|
|
131
|
-
oldValue,
|
|
132
|
-
newValue
|
|
133
|
-
})
|
|
134
|
-
],
|
|
135
|
-
options: {
|
|
136
|
-
editable: editorAble,
|
|
137
|
-
readOnly: !editorAble
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
didMount: (editor) => {
|
|
141
|
-
if (autoScrollToBottom) {
|
|
142
|
-
editor.b.$view.dispatch({
|
|
143
|
-
effects: import_view.EditorView.scrollIntoView(
|
|
144
|
-
editor.b.$view.state.doc.length
|
|
145
|
-
)
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (onChange) {
|
|
149
|
-
editor.b.$on("change", (e) => {
|
|
150
|
-
onChange(e.value);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
editorRef.current = editor.a;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_language_support.default, {}),
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jinja.default, {}),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_markdown.default, {}),
|
|
160
|
-
children
|
|
161
|
-
] });
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
165
|
-
0 && (module.exports = {
|
|
166
|
-
PromptDiffEditor
|
|
167
|
-
});
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var go_syntax_exports = {};
|
|
20
|
-
__export(go_syntax_exports, {
|
|
21
|
-
tmLanguage: () => tmLanguage
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(go_syntax_exports);
|
|
24
|
-
const tmLanguage = {
|
|
25
|
-
foldingStartMarker: "\\{\\{\\s*(?:if|with|range)\\b",
|
|
26
|
-
foldingStopMarker: "\\{\\{\\s*(?:else|end)\\b",
|
|
27
|
-
name: "go-template",
|
|
28
|
-
patterns: [
|
|
29
|
-
{
|
|
30
|
-
begin: "\\{\\{",
|
|
31
|
-
beginCaptures: {
|
|
32
|
-
"0": {
|
|
33
|
-
name: "punctuation.section.embedded.begin.gotemplate"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
end: "\\}\\}",
|
|
37
|
-
endCaptures: {
|
|
38
|
-
"0": {
|
|
39
|
-
name: "punctuation.section.embedded.end.gotemplate"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
patterns: [
|
|
43
|
-
{
|
|
44
|
-
match: ":=",
|
|
45
|
-
name: "keyword.operator.initialize.gotemplate"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
match: "\\|",
|
|
49
|
-
name: "keyword.operator.pipe.gotemplate"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
match: "[.$][\\w]*",
|
|
53
|
-
name: "variable.other.gotemplate"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
match: "\\b(if|else|range|template|with|end|nil|with|define|block)\\b",
|
|
57
|
-
name: "keyword.control.gotemplate"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
match: "\\b(and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\\b",
|
|
61
|
-
name: "support.function.builtin.gotemplate"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
begin: "/\\*",
|
|
65
|
-
end: "\\*/",
|
|
66
|
-
name: "comment.block.gotemplate"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
begin: '"',
|
|
70
|
-
beginCaptures: {
|
|
71
|
-
"0": {
|
|
72
|
-
name: "punctuation.definition.string.begin.gotemplate"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
end: '"',
|
|
76
|
-
endCaptures: {
|
|
77
|
-
"0": {
|
|
78
|
-
name: "punctuation.definition.string.end.gotemplate"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
name: "string.quoted.double.gotemplate",
|
|
82
|
-
patterns: [
|
|
83
|
-
{
|
|
84
|
-
include: "#string_placeholder"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
include: "#string_escaped_char"
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
begin: "`",
|
|
93
|
-
beginCaptures: {
|
|
94
|
-
"0": {
|
|
95
|
-
name: "punctuation.definition.string.begin.gotemplate"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
end: "`",
|
|
99
|
-
endCaptures: {
|
|
100
|
-
"0": {
|
|
101
|
-
name: "punctuation.definition.string.end.gotemplate"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
name: "string.quoted.raw.gotemplate",
|
|
105
|
-
patterns: [
|
|
106
|
-
{
|
|
107
|
-
include: "#string_placeholder"
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
repository: {
|
|
115
|
-
string_escaped_char: {
|
|
116
|
-
patterns: [
|
|
117
|
-
{
|
|
118
|
-
match: `\\\\(\\\\|[abfnrtv'"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|[0-7]{3})`,
|
|
119
|
-
name: "constant.character.escape.gotemplate"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
match: "\\\\.",
|
|
123
|
-
name: "invalid.illegal.unknown-escape.gotemplate"
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
|
-
string_placeholder: {
|
|
128
|
-
patterns: [
|
|
129
|
-
{
|
|
130
|
-
match: "(?x)%\n (\\d+\\$)? # field (argument #)\n [#0\\- +']* # flags\n [,;:_]? # separator character (AltiVec)\n ((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n (\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n [diouxXDOUeEfFgGaAcCsSqpnvtTbyYhHmMzZ%] # conversion type\n ",
|
|
131
|
-
name: "constant.other.placeholder.gotemplate"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
match: "%",
|
|
135
|
-
name: "invalid.illegal.placeholder.gotemplate"
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
scopeName: "source.gotemplate",
|
|
141
|
-
uuid: "43606de8-c638-11e2-b661-6711676f99ca"
|
|
142
|
-
};
|
|
143
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
-
0 && (module.exports = {
|
|
145
|
-
tmLanguage
|
|
146
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var go_template_exports = {};
|
|
30
|
-
__export(go_template_exports, {
|
|
31
|
-
goExtension: () => goExtension
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(go_template_exports);
|
|
34
|
-
var import_oniguruma = require("shiki/engine/oniguruma");
|
|
35
|
-
var import_core = require("shiki/core");
|
|
36
|
-
var import_codemirror_shiki = __toESM(require("codemirror-shiki"));
|
|
37
|
-
const highlighter = (0, import_core.createHighlighterCore)({
|
|
38
|
-
langs: [Promise.resolve().then(() => __toESM(require("./go-syntax"))).then((mod) => mod.tmLanguage)],
|
|
39
|
-
themes: [Promise.resolve().then(() => __toESM(require("./go-theme")))],
|
|
40
|
-
engine: (0, import_oniguruma.createOnigurumaEngine)(Promise.resolve().then(() => __toESM(require("shiki/wasm"))))
|
|
41
|
-
});
|
|
42
|
-
const goExtension = (0, import_codemirror_shiki.default)({
|
|
43
|
-
highlighter,
|
|
44
|
-
language: "go-template",
|
|
45
|
-
theme: "one-light"
|
|
46
|
-
});
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
goExtension
|
|
50
|
-
});
|