@hpcc-js/codemirror 3.2.0 → 3.3.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.js CHANGED
@@ -9932,6 +9932,66 @@ function requireSql() {
9932
9932
  }()), sql.exports;
9933
9933
  }
9934
9934
  requireSql();
9935
+ var yaml = { exports: {} }, hasRequiredYaml;
9936
+ function requireYaml() {
9937
+ return hasRequiredYaml || (hasRequiredYaml = 1, function(module, exports) {
9938
+ (function(mod) {
9939
+ mod(requireCodemirror());
9940
+ })(function(CodeMirror2) {
9941
+ CodeMirror2.defineMode("yaml", function() {
9942
+ var cons = ["true", "false", "on", "off", "yes", "no"], keywordRegex = new RegExp("\\b((" + cons.join(")|(") + "))$", "i");
9943
+ return {
9944
+ token: function(stream, state) {
9945
+ var ch = stream.peek(), esc = state.escaped;
9946
+ if (state.escaped = !1, ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1))))
9947
+ return stream.skipToEnd(), "comment";
9948
+ if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))
9949
+ return "string";
9950
+ if (state.literal && stream.indentation() > state.keyCol)
9951
+ return stream.skipToEnd(), "string";
9952
+ if (state.literal && (state.literal = !1), stream.sol()) {
9953
+ if (state.keyCol = 0, state.pair = !1, state.pairStart = !1, stream.match("---") || stream.match("..."))
9954
+ return "def";
9955
+ if (stream.match(/\s*-\s+/))
9956
+ return "meta";
9957
+ }
9958
+ if (stream.match(/^(\{|\}|\[|\])/))
9959
+ return ch == "{" ? state.inlinePairs++ : ch == "}" ? state.inlinePairs-- : ch == "[" ? state.inlineList++ : state.inlineList--, "meta";
9960
+ if (state.inlineList > 0 && !esc && ch == ",")
9961
+ return stream.next(), "meta";
9962
+ if (state.inlinePairs > 0 && !esc && ch == ",")
9963
+ return state.keyCol = 0, state.pair = !1, state.pairStart = !1, stream.next(), "meta";
9964
+ if (state.pairStart) {
9965
+ if (stream.match(/^\s*(\||\>)\s*/))
9966
+ return state.literal = !0, "meta";
9967
+ if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))
9968
+ return "variable-2";
9969
+ if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/) || state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))
9970
+ return "number";
9971
+ if (stream.match(keywordRegex))
9972
+ return "keyword";
9973
+ }
9974
+ return !state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/) ? (state.pair = !0, state.keyCol = stream.indentation(), "atom") : state.pair && stream.match(/^:\s*/) ? (state.pairStart = !0, "meta") : (state.pairStart = !1, state.escaped = ch == "\\", stream.next(), null);
9975
+ },
9976
+ startState: function() {
9977
+ return {
9978
+ pair: !1,
9979
+ pairStart: !1,
9980
+ keyCol: 0,
9981
+ inlinePairs: 0,
9982
+ inlineList: 0,
9983
+ literal: !1,
9984
+ escaped: !1
9985
+ };
9986
+ },
9987
+ lineComment: "#",
9988
+ fold: "indent"
9989
+ };
9990
+ }), CodeMirror2.defineMIME("text/x-yaml", "yaml"), CodeMirror2.defineMIME("text/yaml", "yaml");
9991
+ });
9992
+ }()), yaml.exports;
9993
+ }
9994
+ requireYaml();
9935
9995
  var codemirrorExports = requireCodemirror();
9936
9996
  const CodeMirror = /* @__PURE__ */ getDefaultExportFromCjs(codemirrorExports);
9937
9997
  CodeMirror.defineMode("dot", function(config) {
@@ -12070,6 +12130,20 @@ class SQLEditor extends Editor {
12070
12130
  }
12071
12131
  }
12072
12132
  SQLEditor.prototype._class += " codemirror_SQLEditor";
12133
+ class YAMLEditor extends Editor {
12134
+ options() {
12135
+ return {
12136
+ ...super.options(),
12137
+ mode: "text/x-yaml",
12138
+ foldGutter: !0,
12139
+ gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
12140
+ };
12141
+ }
12142
+ yaml(_) {
12143
+ return arguments.length ? (this.text(_), this) : this.text();
12144
+ }
12145
+ }
12146
+ YAMLEditor.prototype._class += " codemirror_YAMLEditor";
12073
12147
  export {
12074
12148
  BUILD_VERSION,
12075
12149
  CSSEditor,
@@ -12084,6 +12158,7 @@ export {
12084
12158
  PKG_NAME,
12085
12159
  PKG_VERSION,
12086
12160
  SQLEditor,
12087
- XMLEditor
12161
+ XMLEditor,
12162
+ YAMLEditor
12088
12163
  };
12089
12164
  //# sourceMappingURL=index.js.map