@fc-components/monaco-editor 0.3.2 → 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.
@@ -3666,11 +3666,19 @@ var getSqlCompletionProvider = function getSqlCompletionProvider() {
3666
3666
  };
3667
3667
  };
3668
3668
 
3669
+ var _templateObject$2;
3669
3670
  function formatSql(sql) {
3670
3671
  try {
3671
3672
  return sqlFormatter.format(sql, {
3672
3673
  tabWidth: 2,
3673
- keywordCase: 'upper'
3674
+ keywordCase: 'upper',
3675
+ // Treat custom $__ prefixed macros (like $__timeFilter, $__timeRange, etc.)
3676
+ // as parameter placeholders so the formatter doesn't choke on them.
3677
+ paramTypes: {
3678
+ custom: [{
3679
+ regex: String.raw(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["$__[a-zA-Z_][a-zA-Z0-9_]*"], ["\\$__[a-zA-Z_][a-zA-Z0-9_]*"])))
3680
+ }]
3681
+ }
3674
3682
  });
3675
3683
  } catch (_unused) {
3676
3684
  // If formatting fails, return the original SQL
@@ -3678,7 +3686,7 @@ function formatSql(sql) {
3678
3686
  }
3679
3687
  }
3680
3688
 
3681
- var _templateObject$2, _templateObject2$2, _templateObject3;
3689
+ var _templateObject$3, _templateObject2$2, _templateObject3;
3682
3690
  var SQL_LANG_ID = 'sql';
3683
3691
  var SIZE_MAP$2 = {
3684
3692
  small: {
@@ -3704,9 +3712,9 @@ var themeMap$2 = {
3704
3712
  light: 'sql-light',
3705
3713
  dark: 'sql-dark'
3706
3714
  };
3707
- var containerDisabledClassName$2 = /*#__PURE__*/css.css(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
3715
+ var containerDisabledClassName$2 = /*#__PURE__*/css.css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
3708
3716
  var containerReadOnlyClassName$2 = /*#__PURE__*/css.css(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
3709
- var formatBtnClassName = /*#__PURE__*/css.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: 0.6;\n transition: opacity 0.15s;\n\n &:hover {\n opacity: 1;\n background: var(--format-btn-hover-bg, rgba(128, 128, 128, 0.15));\n }\n"])));
3717
+ var formatBtnClassName = /*#__PURE__*/css.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"])));
3710
3718
  var SqlEditor = /*#__PURE__*/React.forwardRef(function (props, ref) {
3711
3719
  var id = uuid.v4();
3712
3720
  var className = props.className,
@@ -3924,12 +3932,12 @@ var SqlEditor = /*#__PURE__*/React.forwardRef(function (props, ref) {
3924
3932
  }
3925
3933
  }, React__default.createElement("svg", {
3926
3934
  xmlns: 'http://www.w3.org/2000/svg',
3927
- width: '16',
3928
- height: '16',
3935
+ width: '12',
3936
+ height: '12',
3929
3937
  viewBox: '0 0 24 24',
3930
3938
  fill: 'none',
3931
3939
  stroke: 'currentColor',
3932
- strokeWidth: '2',
3940
+ strokeWidth: '1',
3933
3941
  strokeLinecap: 'round',
3934
3942
  strokeLinejoin: 'round'
3935
3943
  }, React__default.createElement("path", {
@@ -5610,7 +5618,7 @@ function countDoubleQuotesOutsideBlockComments(line) {
5610
5618
  return (withoutBlockComments.match(/"/g) || []).length;
5611
5619
  }
5612
5620
 
5613
- var _templateObject$3, _templateObject2$3;
5621
+ var _templateObject$4, _templateObject2$3;
5614
5622
  var EXPR_LANG_ID$1 = 'expr';
5615
5623
  var SIZE_MAP$3 = {
5616
5624
  small: {
@@ -5636,7 +5644,7 @@ var themeMap$3 = {
5636
5644
  light: 'expr-light',
5637
5645
  dark: 'expr-dark'
5638
5646
  };
5639
- var containerDisabledClassName$3 = /*#__PURE__*/css.css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
5647
+ var containerDisabledClassName$3 = /*#__PURE__*/css.css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
5640
5648
  var containerReadOnlyClassName$3 = /*#__PURE__*/css.css(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
5641
5649
  function ExprEditor(props) {
5642
5650
  var id = uuid.v4();