@vuu-ui/vuu-codemirror 0.6.21-debug → 0.6.22-debug

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/cjs/index.js CHANGED
@@ -49,6 +49,7 @@ __export(src_exports, {
49
49
  drawSelection: () => drawSelection,
50
50
  ensureSyntaxTree: () => ensureSyntaxTree,
51
51
  equalityOperators: () => equalityOperators,
52
+ getNamePrompt: () => getNamePrompt,
52
53
  getNamedParentNode: () => getNamedParentNode,
53
54
  getNodeByName: () => getNodeByName,
54
55
  getPreviousNamedNode: () => getPreviousNamedNode,
@@ -14852,6 +14853,7 @@ var minimalSetup = (() => [
14852
14853
  highlightSpecialChars(),
14853
14854
  history(),
14854
14855
  drawSelection(),
14856
+ closeBrackets(),
14855
14857
  syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
14856
14858
  keymap.of(keyBindings)
14857
14859
  ])();
@@ -15111,8 +15113,23 @@ var { COUNT: COUNT2 } = metadataKeys;
15111
15113
 
15112
15114
  // src/suggestion-utils.ts
15113
15115
  var NO_OPTIONS = {};
15116
+ var applyWithCursorMove = () => (view, completion, from) => {
15117
+ const annotation = new AnnotationType();
15118
+ view.dispatch(
15119
+ {
15120
+ changes: { from, insert: completion.label },
15121
+ annotations: annotation.of(completion)
15122
+ },
15123
+ {
15124
+ changes: { from: from + 1, insert: " " },
15125
+ selection: { anchor: from + 2, head: from + 2 },
15126
+ annotations: annotation.of(completion)
15127
+ }
15128
+ );
15129
+ };
15114
15130
  var toSuggestions = (values, options = NO_OPTIONS) => {
15115
15131
  const {
15132
+ moveCursorToEnd = false,
15116
15133
  prefix = "",
15117
15134
  quoted = false,
15118
15135
  suffix = " ",
@@ -15122,7 +15139,7 @@ var toSuggestions = (values, options = NO_OPTIONS) => {
15122
15139
  return values.map((value) => ({
15123
15140
  isIllustration,
15124
15141
  label: value,
15125
- apply: isIllustration ? `${quote}${prefix}${quote}` : `${prefix}${quote}${value}${quote}${suffix}`
15142
+ apply: moveCursorToEnd ? applyWithCursorMove() : isIllustration ? `${quote}${prefix}${quote}` : `${prefix}${quote}${value}${quote}${suffix}`
15126
15143
  }));
15127
15144
  };
15128
15145
  var asNameSuggestion = { label: "as", apply: "as ", boost: 1 };
@@ -15152,4 +15169,8 @@ var getRelationalOperators = (column) => {
15152
15169
  return equalityOperators;
15153
15170
  }
15154
15171
  };
15172
+ var getNamePrompt = (entity) => {
15173
+ const label = entity ? `enter name for this ${entity}` : "enter name";
15174
+ return [{ label, boost: 5 }];
15175
+ };
15155
15176
  //# sourceMappingURL=index.js.map