@fc-components/monaco-editor 0.3.3 → 0.3.4

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.
@@ -3660,11 +3660,19 @@ var getSqlCompletionProvider = function getSqlCompletionProvider() {
3660
3660
  };
3661
3661
  };
3662
3662
 
3663
+ var _templateObject$2;
3663
3664
  function formatSql(sql) {
3664
3665
  try {
3665
3666
  return format(sql, {
3666
3667
  tabWidth: 2,
3667
- keywordCase: 'upper'
3668
+ keywordCase: 'upper',
3669
+ // Treat custom $__ prefixed macros (like $__timeFilter, $__timeRange, etc.)
3670
+ // as parameter placeholders so the formatter doesn't choke on them.
3671
+ paramTypes: {
3672
+ custom: [{
3673
+ regex: String.raw(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["$__[a-zA-Z_][a-zA-Z0-9_]*"], ["\\$__[a-zA-Z_][a-zA-Z0-9_]*"])))
3674
+ }]
3675
+ }
3668
3676
  });
3669
3677
  } catch (_unused) {
3670
3678
  // If formatting fails, return the original SQL
@@ -3672,7 +3680,7 @@ function formatSql(sql) {
3672
3680
  }
3673
3681
  }
3674
3682
 
3675
- var _templateObject$2, _templateObject2$2, _templateObject3;
3683
+ var _templateObject$3, _templateObject2$2, _templateObject3;
3676
3684
  var SQL_LANG_ID = 'sql';
3677
3685
  var SIZE_MAP$2 = {
3678
3686
  small: {
@@ -3698,7 +3706,7 @@ var themeMap$2 = {
3698
3706
  light: 'sql-light',
3699
3707
  dark: 'sql-dark'
3700
3708
  };
3701
- var containerDisabledClassName$2 = /*#__PURE__*/css(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
3709
+ var containerDisabledClassName$2 = /*#__PURE__*/css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
3702
3710
  var containerReadOnlyClassName$2 = /*#__PURE__*/css(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
3703
3711
  var formatBtnClassName = /*#__PURE__*/css(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 4px;\n right: 4px;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n color: inherit;\n opacity: 1;\n transition: opacity 0.15s;\n\n &:hover {\n background: var(--format-btn-hover-bg, rgba(128, 128, 128, 0.15));\n }\n"])));
3704
3712
  var SqlEditor = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -5604,7 +5612,7 @@ function countDoubleQuotesOutsideBlockComments(line) {
5604
5612
  return (withoutBlockComments.match(/"/g) || []).length;
5605
5613
  }
5606
5614
 
5607
- var _templateObject$3, _templateObject2$3;
5615
+ var _templateObject$4, _templateObject2$3;
5608
5616
  var EXPR_LANG_ID$1 = 'expr';
5609
5617
  var SIZE_MAP$3 = {
5610
5618
  small: {
@@ -5630,7 +5638,7 @@ var themeMap$3 = {
5630
5638
  light: 'expr-light',
5631
5639
  dark: 'expr-dark'
5632
5640
  };
5633
- var containerDisabledClassName$3 = /*#__PURE__*/css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
5641
+ var containerDisabledClassName$3 = /*#__PURE__*/css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
5634
5642
  var containerReadOnlyClassName$3 = /*#__PURE__*/css(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
5635
5643
  function ExprEditor(props) {
5636
5644
  var id = v4();